You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

5360 lines
159 KiB

  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  4. var React = require('react');
  5. var React__default = _interopDefault(React);
  6. var PropTypes = _interopDefault(require('prop-types'));
  7. var classNames = _interopDefault(require('classnames'));
  8. var isFunction = _interopDefault(require('lodash.isfunction'));
  9. var isobject = _interopDefault(require('lodash.isobject'));
  10. var ReactDOM = _interopDefault(require('react-dom'));
  11. var reactPopper = require('react-popper');
  12. var reactTransitionGroup = require('react-transition-group');
  13. var toNumber = _interopDefault(require('lodash.tonumber'));
  14. var reactLifecyclesCompat = require('react-lifecycles-compat');
  15. function _extends() {
  16. _extends = Object.assign || function (target) {
  17. for (var i = 1; i < arguments.length; i++) {
  18. var source = arguments[i];
  19. for (var key in source) {
  20. if (Object.prototype.hasOwnProperty.call(source, key)) {
  21. target[key] = source[key];
  22. }
  23. }
  24. }
  25. return target;
  26. };
  27. return _extends.apply(this, arguments);
  28. }
  29. function _inheritsLoose(subClass, superClass) {
  30. subClass.prototype = Object.create(superClass.prototype);
  31. subClass.prototype.constructor = subClass;
  32. subClass.__proto__ = superClass;
  33. }
  34. function _objectWithoutPropertiesLoose(source, excluded) {
  35. if (source == null) return {};
  36. var target = {};
  37. var sourceKeys = Object.keys(source);
  38. var key, i;
  39. for (i = 0; i < sourceKeys.length; i++) {
  40. key = sourceKeys[i];
  41. if (excluded.indexOf(key) >= 0) continue;
  42. target[key] = source[key];
  43. }
  44. return target;
  45. }
  46. function _assertThisInitialized(self) {
  47. if (self === void 0) {
  48. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  49. }
  50. return self;
  51. }
  52. function getScrollbarWidth() {
  53. var scrollDiv = document.createElement('div'); // .modal-scrollbar-measure styles // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.4/scss/_modal.scss#L106-L113
  54. scrollDiv.style.position = 'absolute';
  55. scrollDiv.style.top = '-9999px';
  56. scrollDiv.style.width = '50px';
  57. scrollDiv.style.height = '50px';
  58. scrollDiv.style.overflow = 'scroll';
  59. document.body.appendChild(scrollDiv);
  60. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  61. document.body.removeChild(scrollDiv);
  62. return scrollbarWidth;
  63. }
  64. function setScrollbarWidth(padding) {
  65. document.body.style.paddingRight = padding > 0 ? padding + "px" : null;
  66. }
  67. function isBodyOverflowing() {
  68. return document.body.clientWidth < window.innerWidth;
  69. }
  70. function getOriginalBodyPadding() {
  71. var style = window.getComputedStyle(document.body, null);
  72. return parseInt(style && style.getPropertyValue('padding-right') || 0, 10);
  73. }
  74. function conditionallyUpdateScrollbar() {
  75. var scrollbarWidth = getScrollbarWidth(); // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.6/js/src/modal.js#L433
  76. var fixedContent = document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')[0];
  77. var bodyPadding = fixedContent ? parseInt(fixedContent.style.paddingRight || 0, 10) : 0;
  78. if (isBodyOverflowing()) {
  79. setScrollbarWidth(bodyPadding + scrollbarWidth);
  80. }
  81. }
  82. var globalCssModule;
  83. function setGlobalCssModule(cssModule) {
  84. globalCssModule = cssModule;
  85. }
  86. function mapToCssModules(className, cssModule) {
  87. if (className === void 0) {
  88. className = '';
  89. }
  90. if (cssModule === void 0) {
  91. cssModule = globalCssModule;
  92. }
  93. if (!cssModule) return className;
  94. return className.split(' ').map(function (c) {
  95. return cssModule[c] || c;
  96. }).join(' ');
  97. }
  98. /**
  99. * Returns a new object with the key/value pairs from `obj` that are not in the array `omitKeys`.
  100. */
  101. function omit(obj, omitKeys) {
  102. var result = {};
  103. Object.keys(obj).forEach(function (key) {
  104. if (omitKeys.indexOf(key) === -1) {
  105. result[key] = obj[key];
  106. }
  107. });
  108. return result;
  109. }
  110. /**
  111. * Returns a filtered copy of an object with only the specified keys.
  112. */
  113. function pick(obj, keys) {
  114. var pickKeys = Array.isArray(keys) ? keys : [keys];
  115. var length = pickKeys.length;
  116. var key;
  117. var result = {};
  118. while (length > 0) {
  119. length -= 1;
  120. key = pickKeys[length];
  121. result[key] = obj[key];
  122. }
  123. return result;
  124. }
  125. var warned = {};
  126. function warnOnce(message) {
  127. if (!warned[message]) {
  128. /* istanbul ignore else */
  129. if (typeof console !== 'undefined') {
  130. console.error(message); // eslint-disable-line no-console
  131. }
  132. warned[message] = true;
  133. }
  134. }
  135. function deprecated(propType, explanation) {
  136. return function validate(props, propName, componentName) {
  137. if (props[propName] !== null && typeof props[propName] !== 'undefined') {
  138. warnOnce("\"" + propName + "\" property of \"" + componentName + "\" has been deprecated.\n" + explanation);
  139. }
  140. for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  141. rest[_key - 3] = arguments[_key];
  142. }
  143. return propType.apply(void 0, [props, propName, componentName].concat(rest));
  144. };
  145. }
  146. function DOMElement(props, propName, componentName) {
  147. if (!(props[propName] instanceof Element)) {
  148. return new Error('Invalid prop `' + propName + '` supplied to `' + componentName + '`. Expected prop to be an instance of Element. Validation failed.');
  149. }
  150. }
  151. var targetPropType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, DOMElement, PropTypes.shape({
  152. current: PropTypes.any
  153. })]);
  154. var tagPropType = PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.shape({
  155. $$typeof: PropTypes.symbol,
  156. render: PropTypes.func
  157. }), PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.shape({
  158. $$typeof: PropTypes.symbol,
  159. render: PropTypes.func
  160. })]))]);
  161. /* eslint key-spacing: ["error", { afterColon: true, align: "value" }] */
  162. // These are all setup to match what is in the bootstrap _variables.scss
  163. // https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss
  164. var TransitionTimeouts = {
  165. Fade: 150,
  166. // $transition-fade
  167. Collapse: 350,
  168. // $transition-collapse
  169. Modal: 300,
  170. // $modal-transition
  171. Carousel: 600 // $carousel-transition
  172. }; // Duplicated Transition.propType keys to ensure that Reactstrap builds
  173. // for distribution properly exclude these keys for nested child HTML attributes
  174. // since `react-transition-group` removes propTypes in production builds.
  175. var TransitionPropTypeKeys = ['in', 'mountOnEnter', 'unmountOnExit', 'appear', 'enter', 'exit', 'timeout', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'];
  176. var TransitionStatuses = {
  177. ENTERING: 'entering',
  178. ENTERED: 'entered',
  179. EXITING: 'exiting',
  180. EXITED: 'exited'
  181. };
  182. var keyCodes = {
  183. esc: 27,
  184. space: 32,
  185. enter: 13,
  186. tab: 9,
  187. up: 38,
  188. down: 40,
  189. home: 36,
  190. end: 35,
  191. n: 78,
  192. p: 80
  193. };
  194. var PopperPlacements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  195. var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
  196. function isReactRefObj(target) {
  197. if (target && typeof target === 'object') {
  198. return 'current' in target;
  199. }
  200. return false;
  201. }
  202. function findDOMElements(target) {
  203. if (isReactRefObj(target)) {
  204. return target.current;
  205. }
  206. if (isFunction(target)) {
  207. return target();
  208. }
  209. if (typeof target === 'string' && canUseDOM) {
  210. var selection = document.querySelectorAll(target);
  211. if (!selection.length) {
  212. selection = document.querySelectorAll("#" + target);
  213. }
  214. if (!selection.length) {
  215. throw new Error("The target '" + target + "' could not be identified in the dom, tip: check spelling");
  216. }
  217. return selection;
  218. }
  219. return target;
  220. }
  221. function isArrayOrNodeList(els) {
  222. if (els === null) {
  223. return false;
  224. }
  225. return Array.isArray(els) || canUseDOM && typeof els.length === 'number';
  226. }
  227. function getTarget(target) {
  228. var els = findDOMElements(target);
  229. if (isArrayOrNodeList(els)) {
  230. return els[0];
  231. }
  232. return els;
  233. }
  234. var defaultToggleEvents = ['touchstart', 'click'];
  235. function addMultipleEventListeners(_els, handler, _events, useCapture) {
  236. var els = _els;
  237. if (!isArrayOrNodeList(els)) {
  238. els = [els];
  239. }
  240. var events = _events;
  241. if (typeof events === 'string') {
  242. events = events.split(/\s+/);
  243. }
  244. if (!isArrayOrNodeList(els) || typeof handler !== 'function' || !Array.isArray(events)) {
  245. throw new Error("\n The first argument of this function must be DOM node or an array on DOM nodes or NodeList.\n The second must be a function.\n The third is a string or an array of strings that represents DOM events\n ");
  246. }
  247. Array.prototype.forEach.call(events, function (event) {
  248. Array.prototype.forEach.call(els, function (el) {
  249. el.addEventListener(event, handler, useCapture);
  250. });
  251. });
  252. return function removeEvents() {
  253. Array.prototype.forEach.call(events, function (event) {
  254. Array.prototype.forEach.call(els, function (el) {
  255. el.removeEventListener(event, handler, useCapture);
  256. });
  257. });
  258. };
  259. }
  260. var focusableElements = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=hidden])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'object', 'embed', '[tabindex]:not(.modal)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'];
  261. var utils = /*#__PURE__*/Object.freeze({
  262. getScrollbarWidth: getScrollbarWidth,
  263. setScrollbarWidth: setScrollbarWidth,
  264. isBodyOverflowing: isBodyOverflowing,
  265. getOriginalBodyPadding: getOriginalBodyPadding,
  266. conditionallyUpdateScrollbar: conditionallyUpdateScrollbar,
  267. setGlobalCssModule: setGlobalCssModule,
  268. mapToCssModules: mapToCssModules,
  269. omit: omit,
  270. pick: pick,
  271. warnOnce: warnOnce,
  272. deprecated: deprecated,
  273. DOMElement: DOMElement,
  274. targetPropType: targetPropType,
  275. tagPropType: tagPropType,
  276. TransitionTimeouts: TransitionTimeouts,
  277. TransitionPropTypeKeys: TransitionPropTypeKeys,
  278. TransitionStatuses: TransitionStatuses,
  279. keyCodes: keyCodes,
  280. PopperPlacements: PopperPlacements,
  281. canUseDOM: canUseDOM,
  282. isReactRefObj: isReactRefObj,
  283. findDOMElements: findDOMElements,
  284. isArrayOrNodeList: isArrayOrNodeList,
  285. getTarget: getTarget,
  286. defaultToggleEvents: defaultToggleEvents,
  287. addMultipleEventListeners: addMultipleEventListeners,
  288. focusableElements: focusableElements
  289. });
  290. var propTypes = {
  291. tag: tagPropType,
  292. fluid: PropTypes.bool,
  293. className: PropTypes.string,
  294. cssModule: PropTypes.object
  295. };
  296. var defaultProps = {
  297. tag: 'div'
  298. };
  299. var Container = function Container(props) {
  300. var className = props.className,
  301. cssModule = props.cssModule,
  302. fluid = props.fluid,
  303. Tag = props.tag,
  304. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "fluid", "tag"]);
  305. var classes = mapToCssModules(classNames(className, fluid ? 'container-fluid' : 'container'), cssModule);
  306. return React__default.createElement(Tag, _extends({}, attributes, {
  307. className: classes
  308. }));
  309. };
  310. Container.propTypes = propTypes;
  311. Container.defaultProps = defaultProps;
  312. var propTypes$1 = {
  313. tag: tagPropType,
  314. noGutters: PropTypes.bool,
  315. className: PropTypes.string,
  316. cssModule: PropTypes.object,
  317. form: PropTypes.bool
  318. };
  319. var defaultProps$1 = {
  320. tag: 'div'
  321. };
  322. var Row = function Row(props) {
  323. var className = props.className,
  324. cssModule = props.cssModule,
  325. noGutters = props.noGutters,
  326. Tag = props.tag,
  327. form = props.form,
  328. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "noGutters", "tag", "form"]);
  329. var classes = mapToCssModules(classNames(className, noGutters ? 'no-gutters' : null, form ? 'form-row' : 'row'), cssModule);
  330. return React__default.createElement(Tag, _extends({}, attributes, {
  331. className: classes
  332. }));
  333. };
  334. Row.propTypes = propTypes$1;
  335. Row.defaultProps = defaultProps$1;
  336. var colWidths = ['xs', 'sm', 'md', 'lg', 'xl'];
  337. var stringOrNumberProp = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);
  338. var columnProps = PropTypes.oneOfType([PropTypes.bool, PropTypes.number, PropTypes.string, PropTypes.shape({
  339. size: PropTypes.oneOfType([PropTypes.bool, PropTypes.number, PropTypes.string]),
  340. push: deprecated(stringOrNumberProp, 'Please use the prop "order"'),
  341. pull: deprecated(stringOrNumberProp, 'Please use the prop "order"'),
  342. order: stringOrNumberProp,
  343. offset: stringOrNumberProp
  344. })]);
  345. var propTypes$2 = {
  346. tag: tagPropType,
  347. xs: columnProps,
  348. sm: columnProps,
  349. md: columnProps,
  350. lg: columnProps,
  351. xl: columnProps,
  352. className: PropTypes.string,
  353. cssModule: PropTypes.object,
  354. widths: PropTypes.array
  355. };
  356. var defaultProps$2 = {
  357. tag: 'div',
  358. widths: colWidths
  359. };
  360. var getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) {
  361. if (colSize === true || colSize === '') {
  362. return isXs ? 'col' : "col-" + colWidth;
  363. } else if (colSize === 'auto') {
  364. return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
  365. }
  366. return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
  367. };
  368. var Col = function Col(props) {
  369. var className = props.className,
  370. cssModule = props.cssModule,
  371. widths = props.widths,
  372. Tag = props.tag,
  373. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "widths", "tag"]);
  374. var colClasses = [];
  375. widths.forEach(function (colWidth, i) {
  376. var columnProp = props[colWidth];
  377. delete attributes[colWidth];
  378. if (!columnProp && columnProp !== '') {
  379. return;
  380. }
  381. var isXs = !i;
  382. if (isobject(columnProp)) {
  383. var _classNames;
  384. var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
  385. var colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
  386. colClasses.push(mapToCssModules(classNames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames["order" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames["offset" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames)), cssModule));
  387. } else {
  388. var _colClass = getColumnSizeClass(isXs, colWidth, columnProp);
  389. colClasses.push(_colClass);
  390. }
  391. });
  392. if (!colClasses.length) {
  393. colClasses.push('col');
  394. }
  395. var classes = mapToCssModules(classNames(className, colClasses), cssModule);
  396. return React__default.createElement(Tag, _extends({}, attributes, {
  397. className: classes
  398. }));
  399. };
  400. Col.propTypes = propTypes$2;
  401. Col.defaultProps = defaultProps$2;
  402. var propTypes$3 = {
  403. light: PropTypes.bool,
  404. dark: PropTypes.bool,
  405. inverse: deprecated(PropTypes.bool, 'Please use the prop "dark"'),
  406. full: PropTypes.bool,
  407. fixed: PropTypes.string,
  408. sticky: PropTypes.string,
  409. color: PropTypes.string,
  410. role: PropTypes.string,
  411. tag: tagPropType,
  412. className: PropTypes.string,
  413. cssModule: PropTypes.object,
  414. toggleable: deprecated(PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), 'Please use the prop "expand"'),
  415. expand: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
  416. };
  417. var defaultProps$3 = {
  418. tag: 'nav',
  419. expand: false
  420. };
  421. var getExpandClass = function getExpandClass(expand) {
  422. if (expand === false) {
  423. return false;
  424. } else if (expand === true || expand === 'xs') {
  425. return 'navbar-expand';
  426. }
  427. return "navbar-expand-" + expand;
  428. }; // To better maintain backwards compatibility while toggleable is deprecated.
  429. // We must map breakpoints to the next breakpoint so that toggleable and expand do the same things at the same breakpoint.
  430. var toggleableToExpand = {
  431. xs: 'sm',
  432. sm: 'md',
  433. md: 'lg',
  434. lg: 'xl'
  435. };
  436. var getToggleableClass = function getToggleableClass(toggleable) {
  437. if (toggleable === undefined || toggleable === 'xl') {
  438. return false;
  439. } else if (toggleable === false) {
  440. return 'navbar-expand';
  441. }
  442. return "navbar-expand-" + (toggleable === true ? 'sm' : toggleableToExpand[toggleable] || toggleable);
  443. };
  444. var Navbar = function Navbar(props) {
  445. var _classNames;
  446. var toggleable = props.toggleable,
  447. expand = props.expand,
  448. className = props.className,
  449. cssModule = props.cssModule,
  450. light = props.light,
  451. dark = props.dark,
  452. inverse = props.inverse,
  453. fixed = props.fixed,
  454. sticky = props.sticky,
  455. color = props.color,
  456. Tag = props.tag,
  457. attributes = _objectWithoutPropertiesLoose(props, ["toggleable", "expand", "className", "cssModule", "light", "dark", "inverse", "fixed", "sticky", "color", "tag"]);
  458. var classes = mapToCssModules(classNames(className, 'navbar', getExpandClass(expand) || getToggleableClass(toggleable), (_classNames = {
  459. 'navbar-light': light,
  460. 'navbar-dark': inverse || dark
  461. }, _classNames["bg-" + color] = color, _classNames["fixed-" + fixed] = fixed, _classNames["sticky-" + sticky] = sticky, _classNames)), cssModule);
  462. return React__default.createElement(Tag, _extends({}, attributes, {
  463. className: classes
  464. }));
  465. };
  466. Navbar.propTypes = propTypes$3;
  467. Navbar.defaultProps = defaultProps$3;
  468. var propTypes$4 = {
  469. tag: tagPropType,
  470. className: PropTypes.string,
  471. cssModule: PropTypes.object
  472. };
  473. var defaultProps$4 = {
  474. tag: 'a'
  475. };
  476. var NavbarBrand = function NavbarBrand(props) {
  477. var className = props.className,
  478. cssModule = props.cssModule,
  479. Tag = props.tag,
  480. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  481. var classes = mapToCssModules(classNames(className, 'navbar-brand'), cssModule);
  482. return React__default.createElement(Tag, _extends({}, attributes, {
  483. className: classes
  484. }));
  485. };
  486. NavbarBrand.propTypes = propTypes$4;
  487. NavbarBrand.defaultProps = defaultProps$4;
  488. var propTypes$5 = {
  489. tag: tagPropType,
  490. type: PropTypes.string,
  491. className: PropTypes.string,
  492. cssModule: PropTypes.object,
  493. children: PropTypes.node
  494. };
  495. var defaultProps$5 = {
  496. tag: 'button',
  497. type: 'button'
  498. };
  499. var NavbarToggler = function NavbarToggler(props) {
  500. var className = props.className,
  501. cssModule = props.cssModule,
  502. children = props.children,
  503. Tag = props.tag,
  504. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "tag"]);
  505. var classes = mapToCssModules(classNames(className, 'navbar-toggler'), cssModule);
  506. return React__default.createElement(Tag, _extends({}, attributes, {
  507. className: classes
  508. }), children || React__default.createElement("span", {
  509. className: mapToCssModules('navbar-toggler-icon', cssModule)
  510. }));
  511. };
  512. NavbarToggler.propTypes = propTypes$5;
  513. NavbarToggler.defaultProps = defaultProps$5;
  514. var propTypes$6 = {
  515. tabs: PropTypes.bool,
  516. pills: PropTypes.bool,
  517. vertical: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
  518. horizontal: PropTypes.string,
  519. justified: PropTypes.bool,
  520. fill: PropTypes.bool,
  521. navbar: PropTypes.bool,
  522. card: PropTypes.bool,
  523. tag: tagPropType,
  524. className: PropTypes.string,
  525. cssModule: PropTypes.object
  526. };
  527. var defaultProps$6 = {
  528. tag: 'ul',
  529. vertical: false
  530. };
  531. var getVerticalClass = function getVerticalClass(vertical) {
  532. if (vertical === false) {
  533. return false;
  534. } else if (vertical === true || vertical === 'xs') {
  535. return 'flex-column';
  536. }
  537. return "flex-" + vertical + "-column";
  538. };
  539. var Nav = function Nav(props) {
  540. var className = props.className,
  541. cssModule = props.cssModule,
  542. tabs = props.tabs,
  543. pills = props.pills,
  544. vertical = props.vertical,
  545. horizontal = props.horizontal,
  546. justified = props.justified,
  547. fill = props.fill,
  548. navbar = props.navbar,
  549. card = props.card,
  550. Tag = props.tag,
  551. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabs", "pills", "vertical", "horizontal", "justified", "fill", "navbar", "card", "tag"]);
  552. var classes = mapToCssModules(classNames(className, navbar ? 'navbar-nav' : 'nav', horizontal ? "justify-content-" + horizontal : false, getVerticalClass(vertical), {
  553. 'nav-tabs': tabs,
  554. 'card-header-tabs': card && tabs,
  555. 'nav-pills': pills,
  556. 'card-header-pills': card && pills,
  557. 'nav-justified': justified,
  558. 'nav-fill': fill
  559. }), cssModule);
  560. return React__default.createElement(Tag, _extends({}, attributes, {
  561. className: classes
  562. }));
  563. };
  564. Nav.propTypes = propTypes$6;
  565. Nav.defaultProps = defaultProps$6;
  566. var propTypes$7 = {
  567. tag: tagPropType,
  568. active: PropTypes.bool,
  569. className: PropTypes.string,
  570. cssModule: PropTypes.object
  571. };
  572. var defaultProps$7 = {
  573. tag: 'li'
  574. };
  575. var NavItem = function NavItem(props) {
  576. var className = props.className,
  577. cssModule = props.cssModule,
  578. active = props.active,
  579. Tag = props.tag,
  580. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
  581. var classes = mapToCssModules(classNames(className, 'nav-item', active ? 'active' : false), cssModule);
  582. return React__default.createElement(Tag, _extends({}, attributes, {
  583. className: classes
  584. }));
  585. };
  586. NavItem.propTypes = propTypes$7;
  587. NavItem.defaultProps = defaultProps$7;
  588. var propTypes$8 = {
  589. disabled: PropTypes.bool,
  590. dropup: deprecated(PropTypes.bool, 'Please use the prop "direction" with the value "up".'),
  591. direction: PropTypes.oneOf(['up', 'down', 'left', 'right']),
  592. group: PropTypes.bool,
  593. isOpen: PropTypes.bool,
  594. nav: PropTypes.bool,
  595. active: PropTypes.bool,
  596. addonType: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['prepend', 'append'])]),
  597. size: PropTypes.string,
  598. tag: tagPropType,
  599. toggle: PropTypes.func,
  600. children: PropTypes.node,
  601. className: PropTypes.string,
  602. cssModule: PropTypes.object,
  603. inNavbar: PropTypes.bool,
  604. setActiveFromChild: PropTypes.bool
  605. };
  606. var defaultProps$8 = {
  607. isOpen: false,
  608. direction: 'down',
  609. nav: false,
  610. active: false,
  611. addonType: false,
  612. inNavbar: false,
  613. setActiveFromChild: false
  614. };
  615. var childContextTypes = {
  616. toggle: PropTypes.func.isRequired,
  617. isOpen: PropTypes.bool.isRequired,
  618. direction: PropTypes.oneOf(['up', 'down', 'left', 'right']).isRequired,
  619. inNavbar: PropTypes.bool.isRequired
  620. };
  621. var Dropdown =
  622. /*#__PURE__*/
  623. function (_React$Component) {
  624. _inheritsLoose(Dropdown, _React$Component);
  625. function Dropdown(props) {
  626. var _this;
  627. _this = _React$Component.call(this, props) || this;
  628. _this.addEvents = _this.addEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  629. _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  630. _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  631. _this.removeEvents = _this.removeEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  632. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  633. return _this;
  634. }
  635. var _proto = Dropdown.prototype;
  636. _proto.getChildContext = function getChildContext() {
  637. return {
  638. toggle: this.props.toggle,
  639. isOpen: this.props.isOpen,
  640. direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction,
  641. inNavbar: this.props.inNavbar
  642. };
  643. };
  644. _proto.componentDidMount = function componentDidMount() {
  645. this.handleProps();
  646. };
  647. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  648. if (this.props.isOpen !== prevProps.isOpen) {
  649. this.handleProps();
  650. }
  651. };
  652. _proto.componentWillUnmount = function componentWillUnmount() {
  653. this.removeEvents();
  654. };
  655. _proto.getContainer = function getContainer() {
  656. if (this._$container) return this._$container;
  657. this._$container = ReactDOM.findDOMNode(this);
  658. return ReactDOM.findDOMNode(this);
  659. };
  660. _proto.getMenuCtrl = function getMenuCtrl() {
  661. if (this._$menuCtrl) return this._$menuCtrl;
  662. this._$menuCtrl = this.getContainer().querySelector('[aria-expanded]');
  663. return this._$menuCtrl;
  664. };
  665. _proto.getMenuItems = function getMenuItems() {
  666. return [].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'));
  667. };
  668. _proto.addEvents = function addEvents() {
  669. var _this2 = this;
  670. ['click', 'touchstart', 'keyup'].forEach(function (event) {
  671. return document.addEventListener(event, _this2.handleDocumentClick, true);
  672. });
  673. };
  674. _proto.removeEvents = function removeEvents() {
  675. var _this3 = this;
  676. ['click', 'touchstart', 'keyup'].forEach(function (event) {
  677. return document.removeEventListener(event, _this3.handleDocumentClick, true);
  678. });
  679. };
  680. _proto.handleDocumentClick = function handleDocumentClick(e) {
  681. if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return;
  682. var container = this.getContainer();
  683. if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) {
  684. return;
  685. }
  686. this.toggle(e);
  687. };
  688. _proto.handleKeyDown = function handleKeyDown(e) {
  689. var _this4 = this;
  690. if (/input|textarea/i.test(e.target.tagName) || keyCodes.tab === e.which && e.target.getAttribute('role') !== 'menuitem') {
  691. return;
  692. }
  693. e.preventDefault();
  694. if (this.props.disabled) return;
  695. if (this.getMenuCtrl() === e.target) {
  696. if (!this.props.isOpen && [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {
  697. this.toggle(e);
  698. setTimeout(function () {
  699. return _this4.getMenuItems()[0].focus();
  700. });
  701. }
  702. }
  703. if (this.props.isOpen && e.target.getAttribute('role') === 'menuitem') {
  704. if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {
  705. this.toggle(e);
  706. this.getMenuCtrl().focus();
  707. } else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {
  708. e.target.click();
  709. this.getMenuCtrl().focus();
  710. } else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {
  711. var $menuitems = this.getMenuItems();
  712. var index = $menuitems.indexOf(e.target);
  713. if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {
  714. index = index !== 0 ? index - 1 : $menuitems.length - 1;
  715. } else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {
  716. index = index === $menuitems.length - 1 ? 0 : index + 1;
  717. }
  718. $menuitems[index].focus();
  719. } else if (keyCodes.end === e.which) {
  720. var _$menuitems = this.getMenuItems();
  721. _$menuitems[_$menuitems.length - 1].focus();
  722. } else if (keyCodes.home === e.which) {
  723. var _$menuitems2 = this.getMenuItems();
  724. _$menuitems2[0].focus();
  725. } else if (e.which >= 48 && e.which <= 90) {
  726. var _$menuitems3 = this.getMenuItems();
  727. var charPressed = String.fromCharCode(e.which).toLowerCase();
  728. for (var i = 0; i < _$menuitems3.length; i += 1) {
  729. var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();
  730. if (firstLetter === charPressed) {
  731. _$menuitems3[i].focus();
  732. break;
  733. }
  734. }
  735. }
  736. }
  737. };
  738. _proto.handleProps = function handleProps() {
  739. if (this.props.isOpen) {
  740. this.addEvents();
  741. } else {
  742. this.removeEvents();
  743. }
  744. };
  745. _proto.toggle = function toggle(e) {
  746. if (this.props.disabled) {
  747. return e && e.preventDefault();
  748. }
  749. return this.props.toggle(e);
  750. };
  751. _proto.render = function render() {
  752. var _classNames;
  753. var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar', 'direction']),
  754. className = _omit.className,
  755. cssModule = _omit.cssModule,
  756. dropup = _omit.dropup,
  757. isOpen = _omit.isOpen,
  758. group = _omit.group,
  759. size = _omit.size,
  760. nav = _omit.nav,
  761. setActiveFromChild = _omit.setActiveFromChild,
  762. active = _omit.active,
  763. addonType = _omit.addonType,
  764. attrs = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "dropup", "isOpen", "group", "size", "nav", "setActiveFromChild", "active", "addonType"]);
  765. var direction = this.props.direction === 'down' && dropup ? 'up' : this.props.direction;
  766. attrs.tag = attrs.tag || (nav ? 'li' : 'div');
  767. var subItemIsActive = false;
  768. if (setActiveFromChild) {
  769. React__default.Children.map(this.props.children[1].props.children, function (dropdownItem) {
  770. if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;
  771. });
  772. }
  773. var classes = mapToCssModules(classNames(className, direction !== 'down' && "drop" + direction, nav && active ? 'active' : false, setActiveFromChild && subItemIsActive ? 'active' : false, (_classNames = {}, _classNames["input-group-" + addonType] = addonType, _classNames['btn-group'] = group, _classNames["btn-group-" + size] = !!size, _classNames.dropdown = !group && !addonType, _classNames.show = isOpen, _classNames['nav-item'] = nav, _classNames)), cssModule);
  774. return React__default.createElement(reactPopper.Manager, _extends({}, attrs, {
  775. className: classes,
  776. onKeyDown: this.handleKeyDown
  777. }));
  778. };
  779. return Dropdown;
  780. }(React__default.Component);
  781. Dropdown.propTypes = propTypes$8;
  782. Dropdown.defaultProps = defaultProps$8;
  783. Dropdown.childContextTypes = childContextTypes;
  784. function NavDropdown(props) {
  785. warnOnce('The "NavDropdown" component has been deprecated.\nPlease use component "Dropdown" with nav prop.');
  786. return React__default.createElement(Dropdown, _extends({
  787. nav: true
  788. }, props));
  789. }
  790. var propTypes$9 = {
  791. tag: tagPropType,
  792. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
  793. disabled: PropTypes.bool,
  794. active: PropTypes.bool,
  795. className: PropTypes.string,
  796. cssModule: PropTypes.object,
  797. onClick: PropTypes.func,
  798. href: PropTypes.any
  799. };
  800. var defaultProps$9 = {
  801. tag: 'a'
  802. };
  803. var NavLink =
  804. /*#__PURE__*/
  805. function (_React$Component) {
  806. _inheritsLoose(NavLink, _React$Component);
  807. function NavLink(props) {
  808. var _this;
  809. _this = _React$Component.call(this, props) || this;
  810. _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  811. return _this;
  812. }
  813. var _proto = NavLink.prototype;
  814. _proto.onClick = function onClick(e) {
  815. if (this.props.disabled) {
  816. e.preventDefault();
  817. return;
  818. }
  819. if (this.props.href === '#') {
  820. e.preventDefault();
  821. }
  822. if (this.props.onClick) {
  823. this.props.onClick(e);
  824. }
  825. };
  826. _proto.render = function render() {
  827. var _this$props = this.props,
  828. className = _this$props.className,
  829. cssModule = _this$props.cssModule,
  830. active = _this$props.active,
  831. Tag = _this$props.tag,
  832. innerRef = _this$props.innerRef,
  833. attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "active", "tag", "innerRef"]);
  834. var classes = mapToCssModules(classNames(className, 'nav-link', {
  835. disabled: attributes.disabled,
  836. active: active
  837. }), cssModule);
  838. return React__default.createElement(Tag, _extends({}, attributes, {
  839. ref: innerRef,
  840. onClick: this.onClick,
  841. className: classes
  842. }));
  843. };
  844. return NavLink;
  845. }(React__default.Component);
  846. NavLink.propTypes = propTypes$9;
  847. NavLink.defaultProps = defaultProps$9;
  848. var propTypes$a = {
  849. tag: tagPropType,
  850. listTag: tagPropType,
  851. className: PropTypes.string,
  852. listClassName: PropTypes.string,
  853. cssModule: PropTypes.object,
  854. children: PropTypes.node,
  855. 'aria-label': PropTypes.string
  856. };
  857. var defaultProps$a = {
  858. tag: 'nav',
  859. listTag: 'ol',
  860. 'aria-label': 'breadcrumb'
  861. };
  862. var Breadcrumb = function Breadcrumb(props) {
  863. var className = props.className,
  864. listClassName = props.listClassName,
  865. cssModule = props.cssModule,
  866. children = props.children,
  867. Tag = props.tag,
  868. ListTag = props.listTag,
  869. label = props['aria-label'],
  870. attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "children", "tag", "listTag", "aria-label"]);
  871. var classes = mapToCssModules(classNames(className), cssModule);
  872. var listClasses = mapToCssModules(classNames('breadcrumb', listClassName), cssModule);
  873. return React__default.createElement(Tag, _extends({}, attributes, {
  874. className: classes,
  875. "aria-label": label
  876. }), React__default.createElement(ListTag, {
  877. className: listClasses
  878. }, children));
  879. };
  880. Breadcrumb.propTypes = propTypes$a;
  881. Breadcrumb.defaultProps = defaultProps$a;
  882. var propTypes$b = {
  883. tag: tagPropType,
  884. active: PropTypes.bool,
  885. className: PropTypes.string,
  886. cssModule: PropTypes.object
  887. };
  888. var defaultProps$b = {
  889. tag: 'li'
  890. };
  891. var BreadcrumbItem = function BreadcrumbItem(props) {
  892. var className = props.className,
  893. cssModule = props.cssModule,
  894. active = props.active,
  895. Tag = props.tag,
  896. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
  897. var classes = mapToCssModules(classNames(className, active ? 'active' : false, 'breadcrumb-item'), cssModule);
  898. return React__default.createElement(Tag, _extends({}, attributes, {
  899. className: classes,
  900. "aria-current": active ? 'page' : undefined
  901. }));
  902. };
  903. BreadcrumbItem.propTypes = propTypes$b;
  904. BreadcrumbItem.defaultProps = defaultProps$b;
  905. var propTypes$c = {
  906. active: PropTypes.bool,
  907. 'aria-label': PropTypes.string,
  908. block: PropTypes.bool,
  909. color: PropTypes.string,
  910. disabled: PropTypes.bool,
  911. outline: PropTypes.bool,
  912. tag: tagPropType,
  913. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
  914. onClick: PropTypes.func,
  915. size: PropTypes.string,
  916. children: PropTypes.node,
  917. className: PropTypes.string,
  918. cssModule: PropTypes.object,
  919. close: PropTypes.bool
  920. };
  921. var defaultProps$c = {
  922. color: 'secondary',
  923. tag: 'button'
  924. };
  925. var Button =
  926. /*#__PURE__*/
  927. function (_React$Component) {
  928. _inheritsLoose(Button, _React$Component);
  929. function Button(props) {
  930. var _this;
  931. _this = _React$Component.call(this, props) || this;
  932. _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  933. return _this;
  934. }
  935. var _proto = Button.prototype;
  936. _proto.onClick = function onClick(e) {
  937. if (this.props.disabled) {
  938. e.preventDefault();
  939. return;
  940. }
  941. if (this.props.onClick) {
  942. this.props.onClick(e);
  943. }
  944. };
  945. _proto.render = function render() {
  946. var _this$props = this.props,
  947. active = _this$props.active,
  948. ariaLabel = _this$props['aria-label'],
  949. block = _this$props.block,
  950. className = _this$props.className,
  951. close = _this$props.close,
  952. cssModule = _this$props.cssModule,
  953. color = _this$props.color,
  954. outline = _this$props.outline,
  955. size = _this$props.size,
  956. Tag = _this$props.tag,
  957. innerRef = _this$props.innerRef,
  958. attributes = _objectWithoutPropertiesLoose(_this$props, ["active", "aria-label", "block", "className", "close", "cssModule", "color", "outline", "size", "tag", "innerRef"]);
  959. if (close && typeof attributes.children === 'undefined') {
  960. attributes.children = React__default.createElement("span", {
  961. "aria-hidden": true
  962. }, "\xD7");
  963. }
  964. var btnOutlineColor = "btn" + (outline ? '-outline' : '') + "-" + color;
  965. var classes = mapToCssModules(classNames(className, {
  966. close: close
  967. }, close || 'btn', close || btnOutlineColor, size ? "btn-" + size : false, block ? 'btn-block' : false, {
  968. active: active,
  969. disabled: this.props.disabled
  970. }), cssModule);
  971. if (attributes.href && Tag === 'button') {
  972. Tag = 'a';
  973. }
  974. var defaultAriaLabel = close ? 'Close' : null;
  975. return React__default.createElement(Tag, _extends({
  976. type: Tag === 'button' && attributes.onClick ? 'button' : undefined
  977. }, attributes, {
  978. className: classes,
  979. ref: innerRef,
  980. onClick: this.onClick,
  981. "aria-label": ariaLabel || defaultAriaLabel
  982. }));
  983. };
  984. return Button;
  985. }(React__default.Component);
  986. Button.propTypes = propTypes$c;
  987. Button.defaultProps = defaultProps$c;
  988. var propTypes$d = {
  989. children: PropTypes.node
  990. };
  991. var ButtonDropdown = function ButtonDropdown(props) {
  992. return React__default.createElement(Dropdown, _extends({
  993. group: true
  994. }, props));
  995. };
  996. ButtonDropdown.propTypes = propTypes$d;
  997. var propTypes$e = {
  998. tag: tagPropType,
  999. 'aria-label': PropTypes.string,
  1000. className: PropTypes.string,
  1001. cssModule: PropTypes.object,
  1002. role: PropTypes.string,
  1003. size: PropTypes.string,
  1004. vertical: PropTypes.bool
  1005. };
  1006. var defaultProps$d = {
  1007. tag: 'div',
  1008. role: 'group'
  1009. };
  1010. var ButtonGroup = function ButtonGroup(props) {
  1011. var className = props.className,
  1012. cssModule = props.cssModule,
  1013. size = props.size,
  1014. vertical = props.vertical,
  1015. Tag = props.tag,
  1016. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "vertical", "tag"]);
  1017. var classes = mapToCssModules(classNames(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule);
  1018. return React__default.createElement(Tag, _extends({}, attributes, {
  1019. className: classes
  1020. }));
  1021. };
  1022. ButtonGroup.propTypes = propTypes$e;
  1023. ButtonGroup.defaultProps = defaultProps$d;
  1024. var propTypes$f = {
  1025. tag: tagPropType,
  1026. 'aria-label': PropTypes.string,
  1027. className: PropTypes.string,
  1028. cssModule: PropTypes.object,
  1029. role: PropTypes.string
  1030. };
  1031. var defaultProps$e = {
  1032. tag: 'div',
  1033. role: 'toolbar'
  1034. };
  1035. var ButtonToolbar = function ButtonToolbar(props) {
  1036. var className = props.className,
  1037. cssModule = props.cssModule,
  1038. Tag = props.tag,
  1039. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  1040. var classes = mapToCssModules(classNames(className, 'btn-toolbar'), cssModule);
  1041. return React__default.createElement(Tag, _extends({}, attributes, {
  1042. className: classes
  1043. }));
  1044. };
  1045. ButtonToolbar.propTypes = propTypes$f;
  1046. ButtonToolbar.defaultProps = defaultProps$e;
  1047. var propTypes$g = {
  1048. children: PropTypes.node,
  1049. active: PropTypes.bool,
  1050. disabled: PropTypes.bool,
  1051. divider: PropTypes.bool,
  1052. tag: tagPropType,
  1053. header: PropTypes.bool,
  1054. onClick: PropTypes.func,
  1055. className: PropTypes.string,
  1056. cssModule: PropTypes.object,
  1057. toggle: PropTypes.bool
  1058. };
  1059. var contextTypes = {
  1060. toggle: PropTypes.func
  1061. };
  1062. var defaultProps$f = {
  1063. tag: 'button',
  1064. toggle: true
  1065. };
  1066. var DropdownItem =
  1067. /*#__PURE__*/
  1068. function (_React$Component) {
  1069. _inheritsLoose(DropdownItem, _React$Component);
  1070. function DropdownItem(props) {
  1071. var _this;
  1072. _this = _React$Component.call(this, props) || this;
  1073. _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1074. _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1075. return _this;
  1076. }
  1077. var _proto = DropdownItem.prototype;
  1078. _proto.onClick = function onClick(e) {
  1079. if (this.props.disabled || this.props.header || this.props.divider) {
  1080. e.preventDefault();
  1081. return;
  1082. }
  1083. if (this.props.onClick) {
  1084. this.props.onClick(e);
  1085. }
  1086. if (this.props.toggle) {
  1087. this.context.toggle(e);
  1088. }
  1089. };
  1090. _proto.getTabIndex = function getTabIndex() {
  1091. if (this.props.disabled || this.props.header || this.props.divider) {
  1092. return '-1';
  1093. }
  1094. return '0';
  1095. };
  1096. _proto.render = function render() {
  1097. var tabIndex = this.getTabIndex();
  1098. var role = tabIndex > -1 ? 'menuitem' : undefined;
  1099. var _omit = omit(this.props, ['toggle']),
  1100. className = _omit.className,
  1101. cssModule = _omit.cssModule,
  1102. divider = _omit.divider,
  1103. Tag = _omit.tag,
  1104. header = _omit.header,
  1105. active = _omit.active,
  1106. props = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "divider", "tag", "header", "active"]);
  1107. var classes = mapToCssModules(classNames(className, {
  1108. disabled: props.disabled,
  1109. 'dropdown-item': !divider && !header,
  1110. active: active,
  1111. 'dropdown-header': header,
  1112. 'dropdown-divider': divider
  1113. }), cssModule);
  1114. if (Tag === 'button') {
  1115. if (header) {
  1116. Tag = 'h6';
  1117. } else if (divider) {
  1118. Tag = 'div';
  1119. } else if (props.href) {
  1120. Tag = 'a';
  1121. }
  1122. }
  1123. return React__default.createElement(Tag, _extends({
  1124. type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined
  1125. }, props, {
  1126. tabIndex: tabIndex,
  1127. role: role,
  1128. className: classes,
  1129. onClick: this.onClick
  1130. }));
  1131. };
  1132. return DropdownItem;
  1133. }(React__default.Component);
  1134. DropdownItem.propTypes = propTypes$g;
  1135. DropdownItem.defaultProps = defaultProps$f;
  1136. DropdownItem.contextTypes = contextTypes;
  1137. var propTypes$h = {
  1138. tag: tagPropType,
  1139. children: PropTypes.node.isRequired,
  1140. right: PropTypes.bool,
  1141. flip: PropTypes.bool,
  1142. modifiers: PropTypes.object,
  1143. className: PropTypes.string,
  1144. cssModule: PropTypes.object,
  1145. persist: PropTypes.bool
  1146. };
  1147. var defaultProps$g = {
  1148. tag: 'div',
  1149. flip: true
  1150. };
  1151. var contextTypes$1 = {
  1152. isOpen: PropTypes.bool.isRequired,
  1153. direction: PropTypes.oneOf(['up', 'down', 'left', 'right']).isRequired,
  1154. inNavbar: PropTypes.bool.isRequired
  1155. };
  1156. var noFlipModifier = {
  1157. flip: {
  1158. enabled: false
  1159. }
  1160. };
  1161. var directionPositionMap = {
  1162. up: 'top',
  1163. left: 'left',
  1164. right: 'right',
  1165. down: 'bottom'
  1166. };
  1167. var DropdownMenu = function DropdownMenu(props, context) {
  1168. var className = props.className,
  1169. cssModule = props.cssModule,
  1170. right = props.right,
  1171. tag = props.tag,
  1172. flip = props.flip,
  1173. modifiers = props.modifiers,
  1174. persist = props.persist,
  1175. attrs = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "right", "tag", "flip", "modifiers", "persist"]);
  1176. var classes = mapToCssModules(classNames(className, 'dropdown-menu', {
  1177. 'dropdown-menu-right': right,
  1178. show: context.isOpen
  1179. }), cssModule);
  1180. var Tag = tag;
  1181. if (persist || context.isOpen && !context.inNavbar) {
  1182. Tag = reactPopper.Popper;
  1183. var position1 = directionPositionMap[context.direction] || 'bottom';
  1184. var position2 = right ? 'end' : 'start';
  1185. attrs.placement = position1 + "-" + position2;
  1186. attrs.component = tag;
  1187. attrs.modifiers = !flip ? _extends({}, modifiers, noFlipModifier) : modifiers;
  1188. }
  1189. return React__default.createElement(Tag, _extends({
  1190. tabIndex: "-1",
  1191. role: "menu"
  1192. }, attrs, {
  1193. "aria-hidden": !context.isOpen,
  1194. className: classes,
  1195. "x-placement": attrs.placement
  1196. }));
  1197. };
  1198. DropdownMenu.propTypes = propTypes$h;
  1199. DropdownMenu.defaultProps = defaultProps$g;
  1200. DropdownMenu.contextTypes = contextTypes$1;
  1201. var propTypes$i = {
  1202. caret: PropTypes.bool,
  1203. color: PropTypes.string,
  1204. children: PropTypes.node,
  1205. className: PropTypes.string,
  1206. cssModule: PropTypes.object,
  1207. disabled: PropTypes.bool,
  1208. onClick: PropTypes.func,
  1209. 'aria-haspopup': PropTypes.bool,
  1210. split: PropTypes.bool,
  1211. tag: tagPropType,
  1212. nav: PropTypes.bool
  1213. };
  1214. var defaultProps$h = {
  1215. 'aria-haspopup': true,
  1216. color: 'secondary'
  1217. };
  1218. var contextTypes$2 = {
  1219. isOpen: PropTypes.bool.isRequired,
  1220. toggle: PropTypes.func.isRequired,
  1221. inNavbar: PropTypes.bool.isRequired
  1222. };
  1223. var DropdownToggle =
  1224. /*#__PURE__*/
  1225. function (_React$Component) {
  1226. _inheritsLoose(DropdownToggle, _React$Component);
  1227. function DropdownToggle(props) {
  1228. var _this;
  1229. _this = _React$Component.call(this, props) || this;
  1230. _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1231. return _this;
  1232. }
  1233. var _proto = DropdownToggle.prototype;
  1234. _proto.onClick = function onClick(e) {
  1235. if (this.props.disabled) {
  1236. e.preventDefault();
  1237. return;
  1238. }
  1239. if (this.props.nav && !this.props.tag) {
  1240. e.preventDefault();
  1241. }
  1242. if (this.props.onClick) {
  1243. this.props.onClick(e);
  1244. }
  1245. this.context.toggle(e);
  1246. };
  1247. _proto.render = function render() {
  1248. var _this$props = this.props,
  1249. className = _this$props.className,
  1250. color = _this$props.color,
  1251. cssModule = _this$props.cssModule,
  1252. caret = _this$props.caret,
  1253. split = _this$props.split,
  1254. nav = _this$props.nav,
  1255. tag = _this$props.tag,
  1256. props = _objectWithoutPropertiesLoose(_this$props, ["className", "color", "cssModule", "caret", "split", "nav", "tag"]);
  1257. var ariaLabel = props['aria-label'] || 'Toggle Dropdown';
  1258. var classes = mapToCssModules(classNames(className, {
  1259. 'dropdown-toggle': caret || split,
  1260. 'dropdown-toggle-split': split,
  1261. 'nav-link': nav
  1262. }), cssModule);
  1263. var children = props.children || React__default.createElement("span", {
  1264. className: "sr-only"
  1265. }, ariaLabel);
  1266. var Tag;
  1267. if (nav && !tag) {
  1268. Tag = 'a';
  1269. props.href = '#';
  1270. } else if (!tag) {
  1271. Tag = Button;
  1272. props.color = color;
  1273. props.cssModule = cssModule;
  1274. } else {
  1275. Tag = tag;
  1276. }
  1277. if (this.context.inNavbar) {
  1278. return React__default.createElement(Tag, _extends({}, props, {
  1279. className: classes,
  1280. onClick: this.onClick,
  1281. "aria-expanded": this.context.isOpen,
  1282. children: children
  1283. }));
  1284. }
  1285. return React__default.createElement(reactPopper.Target, _extends({}, props, {
  1286. className: classes,
  1287. component: Tag,
  1288. onClick: this.onClick,
  1289. "aria-expanded": this.context.isOpen,
  1290. children: children
  1291. }));
  1292. };
  1293. return DropdownToggle;
  1294. }(React__default.Component);
  1295. DropdownToggle.propTypes = propTypes$i;
  1296. DropdownToggle.defaultProps = defaultProps$h;
  1297. DropdownToggle.contextTypes = contextTypes$2;
  1298. var propTypes$j = _extends({}, reactTransitionGroup.Transition.propTypes, {
  1299. children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
  1300. tag: tagPropType,
  1301. baseClass: PropTypes.string,
  1302. baseClassActive: PropTypes.string,
  1303. className: PropTypes.string,
  1304. cssModule: PropTypes.object,
  1305. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
  1306. });
  1307. var defaultProps$i = _extends({}, reactTransitionGroup.Transition.defaultProps, {
  1308. tag: 'div',
  1309. baseClass: 'fade',
  1310. baseClassActive: 'show',
  1311. timeout: TransitionTimeouts.Fade,
  1312. appear: true,
  1313. enter: true,
  1314. exit: true,
  1315. in: true
  1316. });
  1317. function Fade(props) {
  1318. var Tag = props.tag,
  1319. baseClass = props.baseClass,
  1320. baseClassActive = props.baseClassActive,
  1321. className = props.className,
  1322. cssModule = props.cssModule,
  1323. children = props.children,
  1324. innerRef = props.innerRef,
  1325. otherProps = _objectWithoutPropertiesLoose(props, ["tag", "baseClass", "baseClassActive", "className", "cssModule", "children", "innerRef"]);
  1326. var transitionProps = pick(otherProps, TransitionPropTypeKeys);
  1327. var childProps = omit(otherProps, TransitionPropTypeKeys);
  1328. return React__default.createElement(reactTransitionGroup.Transition, transitionProps, function (status) {
  1329. var isActive = status === 'entered';
  1330. var classes = mapToCssModules(classNames(className, baseClass, isActive && baseClassActive), cssModule);
  1331. return React__default.createElement(Tag, _extends({
  1332. className: classes
  1333. }, childProps, {
  1334. ref: innerRef
  1335. }), children);
  1336. });
  1337. }
  1338. Fade.propTypes = propTypes$j;
  1339. Fade.defaultProps = defaultProps$i;
  1340. var propTypes$k = {
  1341. color: PropTypes.string,
  1342. pill: PropTypes.bool,
  1343. tag: tagPropType,
  1344. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
  1345. children: PropTypes.node,
  1346. className: PropTypes.string,
  1347. cssModule: PropTypes.object
  1348. };
  1349. var defaultProps$j = {
  1350. color: 'secondary',
  1351. pill: false,
  1352. tag: 'span'
  1353. };
  1354. var Badge = function Badge(props) {
  1355. var className = props.className,
  1356. cssModule = props.cssModule,
  1357. color = props.color,
  1358. innerRef = props.innerRef,
  1359. pill = props.pill,
  1360. Tag = props.tag,
  1361. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "innerRef", "pill", "tag"]);
  1362. var classes = mapToCssModules(classNames(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule);
  1363. if (attributes.href && Tag === 'span') {
  1364. Tag = 'a';
  1365. }
  1366. return React__default.createElement(Tag, _extends({}, attributes, {
  1367. className: classes,
  1368. ref: innerRef
  1369. }));
  1370. };
  1371. Badge.propTypes = propTypes$k;
  1372. Badge.defaultProps = defaultProps$j;
  1373. var propTypes$l = {
  1374. tag: tagPropType,
  1375. inverse: PropTypes.bool,
  1376. color: PropTypes.string,
  1377. block: deprecated(PropTypes.bool, 'Please use the props "body"'),
  1378. body: PropTypes.bool,
  1379. outline: PropTypes.bool,
  1380. className: PropTypes.string,
  1381. cssModule: PropTypes.object,
  1382. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
  1383. };
  1384. var defaultProps$k = {
  1385. tag: 'div'
  1386. };
  1387. var Card = function Card(props) {
  1388. var className = props.className,
  1389. cssModule = props.cssModule,
  1390. color = props.color,
  1391. block = props.block,
  1392. body = props.body,
  1393. inverse = props.inverse,
  1394. outline = props.outline,
  1395. Tag = props.tag,
  1396. innerRef = props.innerRef,
  1397. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "block", "body", "inverse", "outline", "tag", "innerRef"]);
  1398. var classes = mapToCssModules(classNames(className, 'card', inverse ? 'text-white' : false, block || body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + "-" + color : false), cssModule);
  1399. return React__default.createElement(Tag, _extends({}, attributes, {
  1400. className: classes,
  1401. ref: innerRef
  1402. }));
  1403. };
  1404. Card.propTypes = propTypes$l;
  1405. Card.defaultProps = defaultProps$k;
  1406. var propTypes$m = {
  1407. tag: tagPropType,
  1408. className: PropTypes.string,
  1409. cssModule: PropTypes.object
  1410. };
  1411. var defaultProps$l = {
  1412. tag: 'div'
  1413. };
  1414. var CardGroup = function CardGroup(props) {
  1415. var className = props.className,
  1416. cssModule = props.cssModule,
  1417. Tag = props.tag,
  1418. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  1419. var classes = mapToCssModules(classNames(className, 'card-group'), cssModule);
  1420. return React__default.createElement(Tag, _extends({}, attributes, {
  1421. className: classes
  1422. }));
  1423. };
  1424. CardGroup.propTypes = propTypes$m;
  1425. CardGroup.defaultProps = defaultProps$l;
  1426. var propTypes$n = {
  1427. tag: tagPropType,
  1428. className: PropTypes.string,
  1429. cssModule: PropTypes.object
  1430. };
  1431. var defaultProps$m = {
  1432. tag: 'div'
  1433. };
  1434. var CardDeck = function CardDeck(props) {
  1435. var className = props.className,
  1436. cssModule = props.cssModule,
  1437. Tag = props.tag,
  1438. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  1439. var classes = mapToCssModules(classNames(className, 'card-deck'), cssModule);
  1440. return React__default.createElement(Tag, _extends({}, attributes, {
  1441. className: classes
  1442. }));
  1443. };
  1444. CardDeck.propTypes = propTypes$n;
  1445. CardDeck.defaultProps = defaultProps$m;
  1446. var propTypes$o = {
  1447. tag: tagPropType,
  1448. className: PropTypes.string,
  1449. cssModule: PropTypes.object
  1450. };
  1451. var defaultProps$n = {
  1452. tag: 'div'
  1453. };
  1454. var CardColumns = function CardColumns(props) {
  1455. var className = props.className,
  1456. cssModule = props.cssModule,
  1457. Tag = props.tag,
  1458. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  1459. var classes = mapToCssModules(classNames(className, 'card-columns'), cssModule);
  1460. return React__default.createElement(Tag, _extends({}, attributes, {
  1461. className: classes
  1462. }));
  1463. };
  1464. CardColumns.propTypes = propTypes$o;
  1465. CardColumns.defaultProps = defaultProps$n;
  1466. var propTypes$p = {
  1467. tag: tagPropType,
  1468. className: PropTypes.string,
  1469. cssModule: PropTypes.object,
  1470. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
  1471. };
  1472. var defaultProps$o = {
  1473. tag: 'div'
  1474. };
  1475. var CardBody = function CardBody(props) {
  1476. var className = props.className,
  1477. cssModule = props.cssModule,
  1478. innerRef = props.innerRef,
  1479. Tag = props.tag,
  1480. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
  1481. var classes = mapToCssModules(classNames(className, 'card-body'), cssModule);
  1482. return React__default.createElement(Tag, _extends({}, attributes, {
  1483. className: classes,
  1484. ref: innerRef
  1485. }));
  1486. };
  1487. CardBody.propTypes = propTypes$p;
  1488. CardBody.defaultProps = defaultProps$o;
  1489. function CardBlock(props) {
  1490. warnOnce('The "CardBlock" component has been deprecated.\nPlease use component "CardBody".');
  1491. return React__default.createElement(CardBody, props);
  1492. }
  1493. var propTypes$q = {
  1494. tag: tagPropType,
  1495. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
  1496. className: PropTypes.string,
  1497. cssModule: PropTypes.object
  1498. };
  1499. var defaultProps$p = {
  1500. tag: 'a'
  1501. };
  1502. var CardLink = function CardLink(props) {
  1503. var className = props.className,
  1504. cssModule = props.cssModule,
  1505. Tag = props.tag,
  1506. innerRef = props.innerRef,
  1507. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "innerRef"]);
  1508. var classes = mapToCssModules(classNames(className, 'card-link'), cssModule);
  1509. return React__default.createElement(Tag, _extends({}, attributes, {
  1510. ref: innerRef,
  1511. className: classes
  1512. }));
  1513. };
  1514. CardLink.propTypes = propTypes$q;
  1515. CardLink.defaultProps = defaultProps$p;
  1516. var propTypes$r = {
  1517. tag: tagPropType,
  1518. className: PropTypes.string,
  1519. cssModule: PropTypes.object
  1520. };
  1521. var defaultProps$q = {
  1522. tag: 'div'
  1523. };
  1524. var CardFooter = function CardFooter(props) {
  1525. var className = props.className,
  1526. cssModule = props.cssModule,
  1527. Tag = props.tag,
  1528. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  1529. var classes = mapToCssModules(classNames(className, 'card-footer'), cssModule);
  1530. return React__default.createElement(Tag, _extends({}, attributes, {
  1531. className: classes
  1532. }));
  1533. };
  1534. CardFooter.propTypes = propTypes$r;
  1535. CardFooter.defaultProps = defaultProps$q;
  1536. var propTypes$s = {
  1537. tag: tagPropType,
  1538. className: PropTypes.string,
  1539. cssModule: PropTypes.object
  1540. };
  1541. var defaultProps$r = {
  1542. tag: 'div'
  1543. };
  1544. var CardHeader = function CardHeader(props) {
  1545. var className = props.className,
  1546. cssModule = props.cssModule,
  1547. Tag = props.tag,
  1548. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  1549. var classes = mapToCssModules(classNames(className, 'card-header'), cssModule);
  1550. return React__default.createElement(Tag, _extends({}, attributes, {
  1551. className: classes
  1552. }));
  1553. };
  1554. CardHeader.propTypes = propTypes$s;
  1555. CardHeader.defaultProps = defaultProps$r;
  1556. var propTypes$t = {
  1557. tag: tagPropType,
  1558. top: PropTypes.bool,
  1559. bottom: PropTypes.bool,
  1560. className: PropTypes.string,
  1561. cssModule: PropTypes.object
  1562. };
  1563. var defaultProps$s = {
  1564. tag: 'img'
  1565. };
  1566. var CardImg = function CardImg(props) {
  1567. var className = props.className,
  1568. cssModule = props.cssModule,
  1569. top = props.top,
  1570. bottom = props.bottom,
  1571. Tag = props.tag,
  1572. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "top", "bottom", "tag"]);
  1573. var cardImgClassName = 'card-img';
  1574. if (top) {
  1575. cardImgClassName = 'card-img-top';
  1576. }
  1577. if (bottom) {
  1578. cardImgClassName = 'card-img-bottom';
  1579. }
  1580. var classes = mapToCssModules(classNames(className, cardImgClassName), cssModule);
  1581. return React__default.createElement(Tag, _extends({}, attributes, {
  1582. className: classes
  1583. }));
  1584. };
  1585. CardImg.propTypes = propTypes$t;
  1586. CardImg.defaultProps = defaultProps$s;
  1587. var propTypes$u = {
  1588. tag: tagPropType,
  1589. className: PropTypes.string,
  1590. cssModule: PropTypes.object
  1591. };
  1592. var defaultProps$t = {
  1593. tag: 'div'
  1594. };
  1595. var CardImgOverlay = function CardImgOverlay(props) {
  1596. var className = props.className,
  1597. cssModule = props.cssModule,
  1598. Tag = props.tag,
  1599. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  1600. var classes = mapToCssModules(classNames(className, 'card-img-overlay'), cssModule);
  1601. return React__default.createElement(Tag, _extends({}, attributes, {
  1602. className: classes
  1603. }));
  1604. };
  1605. CardImgOverlay.propTypes = propTypes$u;
  1606. CardImgOverlay.defaultProps = defaultProps$t;
  1607. var CarouselItem =
  1608. /*#__PURE__*/
  1609. function (_React$Component) {
  1610. _inheritsLoose(CarouselItem, _React$Component);
  1611. function CarouselItem(props) {
  1612. var _this;
  1613. _this = _React$Component.call(this, props) || this;
  1614. _this.state = {
  1615. startAnimation: false
  1616. };
  1617. _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1618. _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1619. _this.onExit = _this.onExit.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1620. _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1621. _this.onExited = _this.onExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1622. return _this;
  1623. }
  1624. var _proto = CarouselItem.prototype;
  1625. _proto.onEnter = function onEnter(node, isAppearing) {
  1626. this.setState({
  1627. startAnimation: false
  1628. });
  1629. this.props.onEnter(node, isAppearing);
  1630. };
  1631. _proto.onEntering = function onEntering(node, isAppearing) {
  1632. // getting this variable triggers a reflow
  1633. var offsetHeight = node.offsetHeight;
  1634. this.setState({
  1635. startAnimation: true
  1636. });
  1637. this.props.onEntering(node, isAppearing);
  1638. return offsetHeight;
  1639. };
  1640. _proto.onExit = function onExit(node) {
  1641. this.setState({
  1642. startAnimation: false
  1643. });
  1644. this.props.onExit(node);
  1645. };
  1646. _proto.onExiting = function onExiting(node) {
  1647. this.setState({
  1648. startAnimation: true
  1649. });
  1650. node.dispatchEvent(new CustomEvent('slide.bs.carousel'));
  1651. this.props.onExiting(node);
  1652. };
  1653. _proto.onExited = function onExited(node) {
  1654. node.dispatchEvent(new CustomEvent('slid.bs.carousel'));
  1655. this.props.onExited(node);
  1656. };
  1657. _proto.render = function render() {
  1658. var _this2 = this;
  1659. var _this$props = this.props,
  1660. isIn = _this$props.in,
  1661. children = _this$props.children,
  1662. cssModule = _this$props.cssModule,
  1663. slide = _this$props.slide,
  1664. Tag = _this$props.tag,
  1665. className = _this$props.className,
  1666. transitionProps = _objectWithoutPropertiesLoose(_this$props, ["in", "children", "cssModule", "slide", "tag", "className"]);
  1667. return React__default.createElement(reactTransitionGroup.Transition, _extends({}, transitionProps, {
  1668. enter: slide,
  1669. exit: slide,
  1670. in: isIn,
  1671. onEnter: this.onEnter,
  1672. onEntering: this.onEntering,
  1673. onExit: this.onExit,
  1674. onExiting: this.onExiting,
  1675. onExited: this.onExited
  1676. }), function (status) {
  1677. var direction = _this2.context.direction;
  1678. var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING;
  1679. var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'right' ? 'carousel-item-left' : 'carousel-item-right');
  1680. var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'right' ? 'carousel-item-next' : 'carousel-item-prev');
  1681. var itemClasses = mapToCssModules(classNames(className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule);
  1682. return React__default.createElement(Tag, {
  1683. className: itemClasses
  1684. }, children);
  1685. });
  1686. };
  1687. return CarouselItem;
  1688. }(React__default.Component);
  1689. CarouselItem.propTypes = _extends({}, reactTransitionGroup.Transition.propTypes, {
  1690. tag: tagPropType,
  1691. in: PropTypes.bool,
  1692. cssModule: PropTypes.object,
  1693. children: PropTypes.node,
  1694. slide: PropTypes.bool,
  1695. className: PropTypes.string
  1696. });
  1697. CarouselItem.defaultProps = _extends({}, reactTransitionGroup.Transition.defaultProps, {
  1698. tag: 'div',
  1699. timeout: TransitionTimeouts.Carousel,
  1700. slide: true
  1701. });
  1702. CarouselItem.contextTypes = {
  1703. direction: PropTypes.string
  1704. };
  1705. var Carousel =
  1706. /*#__PURE__*/
  1707. function (_React$Component) {
  1708. _inheritsLoose(Carousel, _React$Component);
  1709. function Carousel(props) {
  1710. var _this;
  1711. _this = _React$Component.call(this, props) || this;
  1712. _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1713. _this.renderItems = _this.renderItems.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1714. _this.hoverStart = _this.hoverStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1715. _this.hoverEnd = _this.hoverEnd.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  1716. _this.state = {
  1717. direction: 'right',
  1718. indicatorClicked: false
  1719. };
  1720. return _this;
  1721. }
  1722. var _proto = Carousel.prototype;
  1723. _proto.getChildContext = function getChildContext() {
  1724. return {
  1725. direction: this.state.direction
  1726. };
  1727. };
  1728. _proto.componentDidMount = function componentDidMount() {
  1729. // Set up the cycle
  1730. if (this.props.ride === 'carousel') {
  1731. this.setInterval();
  1732. } // TODO: move this to the specific carousel like bootstrap. Currently it will trigger ALL carousels on the page.
  1733. document.addEventListener('keyup', this.handleKeyPress);
  1734. };
  1735. _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
  1736. this.setInterval(nextProps); // Calculate the direction to turn
  1737. if (this.props.activeIndex + 1 === nextProps.activeIndex) {
  1738. this.setState({
  1739. direction: 'right'
  1740. });
  1741. } else if (this.props.activeIndex - 1 === nextProps.activeIndex) {
  1742. this.setState({
  1743. direction: 'left'
  1744. });
  1745. } else if (this.props.activeIndex > nextProps.activeIndex) {
  1746. this.setState({
  1747. direction: this.state.indicatorClicked ? 'left' : 'right'
  1748. });
  1749. } else if (this.props.activeIndex !== nextProps.activeIndex) {
  1750. this.setState({
  1751. direction: this.state.indicatorClicked ? 'right' : 'left'
  1752. });
  1753. }
  1754. this.setState({
  1755. indicatorClicked: false
  1756. });
  1757. };
  1758. _proto.componentWillUnmount = function componentWillUnmount() {
  1759. this.clearInterval();
  1760. document.removeEventListener('keyup', this.handleKeyPress);
  1761. };
  1762. _proto.setInterval = function (_setInterval) {
  1763. function setInterval() {
  1764. return _setInterval.apply(this, arguments);
  1765. }
  1766. setInterval.toString = function () {
  1767. return _setInterval.toString();
  1768. };
  1769. return setInterval;
  1770. }(function (props) {
  1771. if (props === void 0) {
  1772. props = this.props;
  1773. }
  1774. // make sure not to have multiple intervals going...
  1775. this.clearInterval();
  1776. if (props.interval) {
  1777. this.cycleInterval = setInterval(function () {
  1778. props.next();
  1779. }, parseInt(props.interval, 10));
  1780. }
  1781. });
  1782. _proto.clearInterval = function (_clearInterval) {
  1783. function clearInterval() {
  1784. return _clearInterval.apply(this, arguments);
  1785. }
  1786. clearInterval.toString = function () {
  1787. return _clearInterval.toString();
  1788. };
  1789. return clearInterval;
  1790. }(function () {
  1791. clearInterval(this.cycleInterval);
  1792. });
  1793. _proto.hoverStart = function hoverStart() {
  1794. if (this.props.pause === 'hover') {
  1795. this.clearInterval();
  1796. }
  1797. if (this.props.mouseEnter) {
  1798. var _this$props;
  1799. (_this$props = this.props).mouseEnter.apply(_this$props, arguments);
  1800. }
  1801. };
  1802. _proto.hoverEnd = function hoverEnd() {
  1803. if (this.props.pause === 'hover') {
  1804. this.setInterval();
  1805. }
  1806. if (this.props.mouseLeave) {
  1807. var _this$props2;
  1808. (_this$props2 = this.props).mouseLeave.apply(_this$props2, arguments);
  1809. }
  1810. };
  1811. _proto.handleKeyPress = function handleKeyPress(evt) {
  1812. if (this.props.keyboard) {
  1813. if (evt.keyCode === 37) {
  1814. this.props.previous();
  1815. } else if (evt.keyCode === 39) {
  1816. this.props.next();
  1817. }
  1818. }
  1819. };
  1820. _proto.renderItems = function renderItems(carouselItems, className) {
  1821. var _this2 = this;
  1822. var slide = this.props.slide;
  1823. return React__default.createElement("div", {
  1824. role: "listbox",
  1825. className: className
  1826. }, carouselItems.map(function (item, index) {
  1827. var isIn = index === _this2.props.activeIndex;
  1828. return React__default.cloneElement(item, {
  1829. in: isIn,
  1830. slide: slide
  1831. });
  1832. }));
  1833. };
  1834. _proto.render = function render() {
  1835. var _this3 = this;
  1836. var _this$props3 = this.props,
  1837. cssModule = _this$props3.cssModule,
  1838. slide = _this$props3.slide,
  1839. className = _this$props3.className;
  1840. var outerClasses = mapToCssModules(classNames(className, 'carousel', slide && 'slide'), cssModule);
  1841. var innerClasses = mapToCssModules(classNames('carousel-inner'), cssModule); // filter out booleans, null, or undefined
  1842. var children = this.props.children.filter(function (child) {
  1843. return child !== null && child !== undefined && typeof child !== 'boolean';
  1844. });
  1845. var slidesOnly = children.every(function (child) {
  1846. return child.type === CarouselItem;
  1847. }); // Rendering only slides
  1848. if (slidesOnly) {
  1849. return React__default.createElement("div", {
  1850. className: outerClasses,
  1851. onMouseEnter: this.hoverStart,
  1852. onMouseLeave: this.hoverEnd
  1853. }, this.renderItems(children, innerClasses));
  1854. } // Rendering slides and controls
  1855. if (children[0] instanceof Array) {
  1856. var _carouselItems = children[0];
  1857. var _controlLeft = children[1];
  1858. var _controlRight = children[2];
  1859. return React__default.createElement("div", {
  1860. className: outerClasses,
  1861. onMouseEnter: this.hoverStart,
  1862. onMouseLeave: this.hoverEnd
  1863. }, this.renderItems(_carouselItems, innerClasses), _controlLeft, _controlRight);
  1864. } // Rendering indicators, slides and controls
  1865. var indicators = children[0];
  1866. var wrappedOnClick = function wrappedOnClick(e) {
  1867. if (typeof indicators.props.onClickHandler === 'function') {
  1868. _this3.setState({
  1869. indicatorClicked: true
  1870. }, function () {
  1871. return indicators.props.onClickHandler(e);
  1872. });
  1873. }
  1874. };
  1875. var wrappedIndicators = React__default.cloneElement(indicators, {
  1876. onClickHandler: wrappedOnClick
  1877. });
  1878. var carouselItems = children[1];
  1879. var controlLeft = children[2];
  1880. var controlRight = children[3];
  1881. return React__default.createElement("div", {
  1882. className: outerClasses,
  1883. onMouseEnter: this.hoverStart,
  1884. onMouseLeave: this.hoverEnd
  1885. }, wrappedIndicators, this.renderItems(carouselItems, innerClasses), controlLeft, controlRight);
  1886. };
  1887. return Carousel;
  1888. }(React__default.Component);
  1889. Carousel.propTypes = {
  1890. // the current active slide of the carousel
  1891. activeIndex: PropTypes.number,
  1892. // a function which should advance the carousel to the next slide (via activeIndex)
  1893. next: PropTypes.func.isRequired,
  1894. // a function which should advance the carousel to the previous slide (via activeIndex)
  1895. previous: PropTypes.func.isRequired,
  1896. // controls if the left and right arrow keys should control the carousel
  1897. keyboard: PropTypes.bool,
  1898. /* If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on
  1899. * mouseleave. If set to false, hovering over the carousel won't pause it. (default: "hover")
  1900. */
  1901. pause: PropTypes.oneOf(['hover', false]),
  1902. // Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.
  1903. // This is how bootstrap defines it... I would prefer a bool named autoplay or something...
  1904. ride: PropTypes.oneOf(['carousel']),
  1905. // the interval at which the carousel automatically cycles (default: 5000)
  1906. // eslint-disable-next-line react/no-unused-prop-types
  1907. interval: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.bool]),
  1908. children: PropTypes.array,
  1909. // called when the mouse enters the Carousel
  1910. mouseEnter: PropTypes.func,
  1911. // called when the mouse exits the Carousel
  1912. mouseLeave: PropTypes.func,
  1913. // controls whether the slide animation on the Carousel works or not
  1914. slide: PropTypes.bool,
  1915. cssModule: PropTypes.object,
  1916. className: PropTypes.string
  1917. };
  1918. Carousel.defaultProps = {
  1919. interval: 5000,
  1920. pause: 'hover',
  1921. keyboard: true,
  1922. slide: true
  1923. };
  1924. Carousel.childContextTypes = {
  1925. direction: PropTypes.string
  1926. };
  1927. var CarouselControl = function CarouselControl(props) {
  1928. var direction = props.direction,
  1929. onClickHandler = props.onClickHandler,
  1930. cssModule = props.cssModule,
  1931. directionText = props.directionText,
  1932. className = props.className;
  1933. var anchorClasses = mapToCssModules(classNames(className, "carousel-control-" + direction), cssModule);
  1934. var iconClasses = mapToCssModules(classNames("carousel-control-" + direction + "-icon"), cssModule);
  1935. var screenReaderClasses = mapToCssModules(classNames('sr-only'), cssModule);
  1936. return React__default.createElement("a", {
  1937. className: anchorClasses,
  1938. role: "button",
  1939. tabIndex: "0",
  1940. onClick: function onClick(e) {
  1941. e.preventDefault();
  1942. onClickHandler();
  1943. }
  1944. }, React__default.createElement("span", {
  1945. className: iconClasses,
  1946. "aria-hidden": "true"
  1947. }), React__default.createElement("span", {
  1948. className: screenReaderClasses
  1949. }, directionText || direction));
  1950. };
  1951. CarouselControl.propTypes = {
  1952. direction: PropTypes.oneOf(['prev', 'next']).isRequired,
  1953. onClickHandler: PropTypes.func.isRequired,
  1954. cssModule: PropTypes.object,
  1955. directionText: PropTypes.string,
  1956. className: PropTypes.string
  1957. };
  1958. var CarouselIndicators = function CarouselIndicators(props) {
  1959. var items = props.items,
  1960. activeIndex = props.activeIndex,
  1961. cssModule = props.cssModule,
  1962. onClickHandler = props.onClickHandler,
  1963. className = props.className;
  1964. var listClasses = mapToCssModules(classNames(className, 'carousel-indicators'), cssModule);
  1965. var indicators = items.map(function (item, idx) {
  1966. var indicatorClasses = mapToCssModules(classNames({
  1967. active: activeIndex === idx
  1968. }), cssModule);
  1969. return React__default.createElement("li", {
  1970. key: "" + (item.key || Object.values(item).join('')),
  1971. onClick: function onClick(e) {
  1972. e.preventDefault();
  1973. onClickHandler(idx);
  1974. },
  1975. className: indicatorClasses
  1976. });
  1977. });
  1978. return React__default.createElement("ol", {
  1979. className: listClasses
  1980. }, indicators);
  1981. };
  1982. CarouselIndicators.propTypes = {
  1983. items: PropTypes.array.isRequired,
  1984. activeIndex: PropTypes.number.isRequired,
  1985. cssModule: PropTypes.object,
  1986. onClickHandler: PropTypes.func.isRequired,
  1987. className: PropTypes.string
  1988. };
  1989. var CarouselCaption = function CarouselCaption(props) {
  1990. var captionHeader = props.captionHeader,
  1991. captionText = props.captionText,
  1992. cssModule = props.cssModule,
  1993. className = props.className;
  1994. var classes = mapToCssModules(classNames(className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule);
  1995. return React__default.createElement("div", {
  1996. className: classes
  1997. }, React__default.createElement("h3", null, captionHeader), React__default.createElement("p", null, captionText));
  1998. };
  1999. CarouselCaption.propTypes = {
  2000. captionHeader: PropTypes.string,
  2001. captionText: PropTypes.string.isRequired,
  2002. cssModule: PropTypes.object,
  2003. className: PropTypes.string
  2004. };
  2005. var propTypes$v = {
  2006. items: PropTypes.array.isRequired,
  2007. indicators: PropTypes.bool,
  2008. controls: PropTypes.bool,
  2009. autoPlay: PropTypes.bool,
  2010. defaultActiveIndex: PropTypes.number,
  2011. activeIndex: PropTypes.number,
  2012. next: PropTypes.func,
  2013. previous: PropTypes.func,
  2014. goToIndex: PropTypes.func
  2015. };
  2016. var UncontrolledCarousel =
  2017. /*#__PURE__*/
  2018. function (_Component) {
  2019. _inheritsLoose(UncontrolledCarousel, _Component);
  2020. function UncontrolledCarousel(props) {
  2021. var _this;
  2022. _this = _Component.call(this, props) || this;
  2023. _this.animating = false;
  2024. _this.state = {
  2025. activeIndex: props.defaultActiveIndex || 0
  2026. };
  2027. _this.next = _this.next.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2028. _this.previous = _this.previous.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2029. _this.goToIndex = _this.goToIndex.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2030. _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2031. _this.onExited = _this.onExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2032. return _this;
  2033. }
  2034. var _proto = UncontrolledCarousel.prototype;
  2035. _proto.onExiting = function onExiting() {
  2036. this.animating = true;
  2037. };
  2038. _proto.onExited = function onExited() {
  2039. this.animating = false;
  2040. };
  2041. _proto.next = function next() {
  2042. if (this.animating) return;
  2043. var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1;
  2044. this.setState({
  2045. activeIndex: nextIndex
  2046. });
  2047. };
  2048. _proto.previous = function previous() {
  2049. if (this.animating) return;
  2050. var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1;
  2051. this.setState({
  2052. activeIndex: nextIndex
  2053. });
  2054. };
  2055. _proto.goToIndex = function goToIndex(newIndex) {
  2056. if (this.animating) return;
  2057. this.setState({
  2058. activeIndex: newIndex
  2059. });
  2060. };
  2061. _proto.render = function render() {
  2062. var _this2 = this;
  2063. var _this$props = this.props,
  2064. defaultActiveIndex = _this$props.defaultActiveIndex,
  2065. autoPlay = _this$props.autoPlay,
  2066. indicators = _this$props.indicators,
  2067. controls = _this$props.controls,
  2068. items = _this$props.items,
  2069. goToIndex = _this$props.goToIndex,
  2070. props = _objectWithoutPropertiesLoose(_this$props, ["defaultActiveIndex", "autoPlay", "indicators", "controls", "items", "goToIndex"]);
  2071. var activeIndex = this.state.activeIndex;
  2072. var slides = items.map(function (item) {
  2073. return React__default.createElement(CarouselItem, {
  2074. onExiting: _this2.onExiting,
  2075. onExited: _this2.onExited,
  2076. key: item.src
  2077. }, React__default.createElement("img", {
  2078. className: "d-block w-100",
  2079. src: item.src,
  2080. alt: item.altText
  2081. }), React__default.createElement(CarouselCaption, {
  2082. captionText: item.caption,
  2083. captionHeader: item.header || item.caption
  2084. }));
  2085. });
  2086. return React__default.createElement(Carousel, _extends({
  2087. activeIndex: activeIndex,
  2088. next: this.next,
  2089. previous: this.previous,
  2090. ride: autoPlay ? 'carousel' : undefined
  2091. }, props), indicators && React__default.createElement(CarouselIndicators, {
  2092. items: items,
  2093. activeIndex: props.activeIndex || activeIndex,
  2094. onClickHandler: goToIndex || this.goToIndex
  2095. }), slides, controls && React__default.createElement(CarouselControl, {
  2096. direction: "prev",
  2097. directionText: "Previous",
  2098. onClickHandler: props.previous || this.previous
  2099. }), controls && React__default.createElement(CarouselControl, {
  2100. direction: "next",
  2101. directionText: "Next",
  2102. onClickHandler: props.next || this.next
  2103. }));
  2104. };
  2105. return UncontrolledCarousel;
  2106. }(React.Component);
  2107. UncontrolledCarousel.propTypes = propTypes$v;
  2108. UncontrolledCarousel.defaultProps = {
  2109. controls: true,
  2110. indicators: true,
  2111. autoPlay: true
  2112. };
  2113. var propTypes$w = {
  2114. tag: tagPropType,
  2115. className: PropTypes.string,
  2116. cssModule: PropTypes.object
  2117. };
  2118. var defaultProps$u = {
  2119. tag: 'div'
  2120. };
  2121. var CardSubtitle = function CardSubtitle(props) {
  2122. var className = props.className,
  2123. cssModule = props.cssModule,
  2124. Tag = props.tag,
  2125. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  2126. var classes = mapToCssModules(classNames(className, 'card-subtitle'), cssModule);
  2127. return React__default.createElement(Tag, _extends({}, attributes, {
  2128. className: classes
  2129. }));
  2130. };
  2131. CardSubtitle.propTypes = propTypes$w;
  2132. CardSubtitle.defaultProps = defaultProps$u;
  2133. var propTypes$x = {
  2134. tag: tagPropType,
  2135. className: PropTypes.string,
  2136. cssModule: PropTypes.object
  2137. };
  2138. var defaultProps$v = {
  2139. tag: 'p'
  2140. };
  2141. var CardText = function CardText(props) {
  2142. var className = props.className,
  2143. cssModule = props.cssModule,
  2144. Tag = props.tag,
  2145. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  2146. var classes = mapToCssModules(classNames(className, 'card-text'), cssModule);
  2147. return React__default.createElement(Tag, _extends({}, attributes, {
  2148. className: classes
  2149. }));
  2150. };
  2151. CardText.propTypes = propTypes$x;
  2152. CardText.defaultProps = defaultProps$v;
  2153. var propTypes$y = {
  2154. tag: tagPropType,
  2155. className: PropTypes.string,
  2156. cssModule: PropTypes.object
  2157. };
  2158. var defaultProps$w = {
  2159. tag: 'div'
  2160. };
  2161. var CardTitle = function CardTitle(props) {
  2162. var className = props.className,
  2163. cssModule = props.cssModule,
  2164. Tag = props.tag,
  2165. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  2166. var classes = mapToCssModules(classNames(className, 'card-title'), cssModule);
  2167. return React__default.createElement(Tag, _extends({}, attributes, {
  2168. className: classes
  2169. }));
  2170. };
  2171. CardTitle.propTypes = propTypes$y;
  2172. CardTitle.defaultProps = defaultProps$w;
  2173. var propTypes$z = {
  2174. className: PropTypes.string,
  2175. id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
  2176. type: PropTypes.string.isRequired,
  2177. label: PropTypes.node,
  2178. inline: PropTypes.bool,
  2179. valid: PropTypes.bool,
  2180. invalid: PropTypes.bool,
  2181. bsSize: PropTypes.string,
  2182. cssModule: PropTypes.object,
  2183. children: PropTypes.oneOfType([PropTypes.node, PropTypes.array, PropTypes.func]),
  2184. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
  2185. };
  2186. function CustomInput(props) {
  2187. var className = props.className,
  2188. label = props.label,
  2189. inline = props.inline,
  2190. valid = props.valid,
  2191. invalid = props.invalid,
  2192. cssModule = props.cssModule,
  2193. children = props.children,
  2194. bsSize = props.bsSize,
  2195. innerRef = props.innerRef,
  2196. attributes = _objectWithoutPropertiesLoose(props, ["className", "label", "inline", "valid", "invalid", "cssModule", "children", "bsSize", "innerRef"]);
  2197. var type = attributes.type;
  2198. var customClass = mapToCssModules(classNames(className, "custom-" + type, bsSize ? "custom-" + type + "-" + bsSize : false), cssModule);
  2199. var validationClassNames = mapToCssModules(classNames(invalid && 'is-invalid', valid && 'is-valid'), cssModule);
  2200. if (type === 'select') {
  2201. return React__default.createElement("select", _extends({}, attributes, {
  2202. ref: innerRef,
  2203. className: classNames(validationClassNames, customClass)
  2204. }), children);
  2205. }
  2206. if (type === 'file') {
  2207. return React__default.createElement("div", {
  2208. className: customClass
  2209. }, React__default.createElement("input", _extends({}, attributes, {
  2210. ref: innerRef,
  2211. className: classNames(validationClassNames, mapToCssModules('custom-file-input', cssModule))
  2212. })), React__default.createElement("label", {
  2213. className: mapToCssModules('custom-file-label', cssModule),
  2214. htmlFor: attributes.id
  2215. }, label || 'Choose file'));
  2216. }
  2217. if (type !== 'checkbox' && type !== 'radio' && type !== 'switch') {
  2218. return React__default.createElement("input", _extends({}, attributes, {
  2219. ref: innerRef,
  2220. className: classNames(validationClassNames, customClass)
  2221. }));
  2222. }
  2223. var wrapperClasses = classNames(customClass, mapToCssModules(classNames('custom-control', {
  2224. 'custom-control-inline': inline
  2225. }), cssModule));
  2226. return React__default.createElement("div", {
  2227. className: wrapperClasses
  2228. }, React__default.createElement("input", _extends({}, attributes, {
  2229. type: type === 'switch' ? 'checkbox' : type,
  2230. ref: innerRef,
  2231. className: classNames(validationClassNames, mapToCssModules('custom-control-input', cssModule))
  2232. })), React__default.createElement("label", {
  2233. className: mapToCssModules('custom-control-label', cssModule),
  2234. htmlFor: attributes.id
  2235. }, label), children);
  2236. }
  2237. CustomInput.propTypes = propTypes$z;
  2238. var propTypes$A = {
  2239. children: PropTypes.node.isRequired,
  2240. className: PropTypes.string,
  2241. placement: PropTypes.string,
  2242. placementPrefix: PropTypes.string,
  2243. arrowClassName: PropTypes.string,
  2244. hideArrow: PropTypes.bool,
  2245. tag: tagPropType,
  2246. isOpen: PropTypes.bool.isRequired,
  2247. cssModule: PropTypes.object,
  2248. offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  2249. fallbackPlacement: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
  2250. flip: PropTypes.bool,
  2251. container: targetPropType,
  2252. target: targetPropType.isRequired,
  2253. modifiers: PropTypes.object,
  2254. boundariesElement: PropTypes.oneOfType([PropTypes.string, DOMElement])
  2255. };
  2256. var defaultProps$x = {
  2257. boundariesElement: 'scrollParent',
  2258. placement: 'auto',
  2259. hideArrow: false,
  2260. isOpen: false,
  2261. offset: 0,
  2262. fallbackPlacement: 'flip',
  2263. flip: true,
  2264. container: 'body',
  2265. modifiers: {}
  2266. };
  2267. var childContextTypes$1 = {
  2268. popperManager: PropTypes.object.isRequired
  2269. };
  2270. var PopperContent =
  2271. /*#__PURE__*/
  2272. function (_React$Component) {
  2273. _inheritsLoose(PopperContent, _React$Component);
  2274. function PopperContent(props) {
  2275. var _this;
  2276. _this = _React$Component.call(this, props) || this;
  2277. _this.handlePlacementChange = _this.handlePlacementChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2278. _this.setTargetNode = _this.setTargetNode.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2279. _this.getTargetNode = _this.getTargetNode.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2280. _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2281. _this.state = {};
  2282. return _this;
  2283. }
  2284. var _proto = PopperContent.prototype;
  2285. _proto.getChildContext = function getChildContext() {
  2286. return {
  2287. popperManager: {
  2288. setTargetNode: this.setTargetNode,
  2289. getTargetNode: this.getTargetNode
  2290. }
  2291. };
  2292. };
  2293. _proto.componentDidUpdate = function componentDidUpdate() {
  2294. if (this._element && this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) {
  2295. this._element.childNodes[0].focus();
  2296. }
  2297. };
  2298. _proto.setTargetNode = function setTargetNode(node) {
  2299. this.targetNode = node;
  2300. };
  2301. _proto.getTargetNode = function getTargetNode() {
  2302. return this.targetNode;
  2303. };
  2304. _proto.getContainerNode = function getContainerNode() {
  2305. return getTarget(this.props.container);
  2306. };
  2307. _proto.getRef = function getRef(ref) {
  2308. this._element = ref;
  2309. };
  2310. _proto.handlePlacementChange = function handlePlacementChange(data) {
  2311. if (this.state.placement !== data.placement) {
  2312. this.setState({
  2313. placement: data.placement
  2314. });
  2315. }
  2316. return data;
  2317. };
  2318. _proto.renderChildren = function renderChildren() {
  2319. var _this$props = this.props,
  2320. cssModule = _this$props.cssModule,
  2321. children = _this$props.children,
  2322. isOpen = _this$props.isOpen,
  2323. flip = _this$props.flip,
  2324. target = _this$props.target,
  2325. offset = _this$props.offset,
  2326. fallbackPlacement = _this$props.fallbackPlacement,
  2327. placementPrefix = _this$props.placementPrefix,
  2328. _arrowClassName = _this$props.arrowClassName,
  2329. hideArrow = _this$props.hideArrow,
  2330. className = _this$props.className,
  2331. tag = _this$props.tag,
  2332. container = _this$props.container,
  2333. modifiers = _this$props.modifiers,
  2334. boundariesElement = _this$props.boundariesElement,
  2335. attrs = _objectWithoutPropertiesLoose(_this$props, ["cssModule", "children", "isOpen", "flip", "target", "offset", "fallbackPlacement", "placementPrefix", "arrowClassName", "hideArrow", "className", "tag", "container", "modifiers", "boundariesElement"]);
  2336. var arrowClassName = mapToCssModules(classNames('arrow', _arrowClassName), cssModule);
  2337. var placement = (this.state.placement || attrs.placement).split('-')[0];
  2338. var popperClassName = mapToCssModules(classNames(className, placementPrefix ? placementPrefix + "-" + placement : placement), this.props.cssModule);
  2339. var extendedModifiers = _extends({
  2340. offset: {
  2341. offset: offset
  2342. },
  2343. flip: {
  2344. enabled: flip,
  2345. behavior: fallbackPlacement
  2346. },
  2347. preventOverflow: {
  2348. boundariesElement: boundariesElement
  2349. },
  2350. update: {
  2351. enabled: true,
  2352. order: 950,
  2353. fn: this.handlePlacementChange
  2354. }
  2355. }, modifiers);
  2356. return React__default.createElement(reactPopper.Popper, _extends({
  2357. modifiers: extendedModifiers
  2358. }, attrs, {
  2359. component: tag,
  2360. className: popperClassName,
  2361. "x-placement": this.state.placement || attrs.placement
  2362. }), children, !hideArrow && React__default.createElement(reactPopper.Arrow, {
  2363. className: arrowClassName
  2364. }));
  2365. };
  2366. _proto.render = function render() {
  2367. this.setTargetNode(getTarget(this.props.target));
  2368. if (this.props.isOpen) {
  2369. return this.props.container === 'inline' ? this.renderChildren() : ReactDOM.createPortal(React__default.createElement("div", {
  2370. ref: this.getRef
  2371. }, this.renderChildren()), this.getContainerNode());
  2372. }
  2373. return null;
  2374. };
  2375. return PopperContent;
  2376. }(React__default.Component);
  2377. PopperContent.propTypes = propTypes$A;
  2378. PopperContent.defaultProps = defaultProps$x;
  2379. PopperContent.childContextTypes = childContextTypes$1;
  2380. var PopperTargetHelper = function PopperTargetHelper(props, context) {
  2381. context.popperManager.setTargetNode(getTarget(props.target));
  2382. return null;
  2383. };
  2384. PopperTargetHelper.contextTypes = {
  2385. popperManager: PropTypes.object.isRequired
  2386. };
  2387. PopperTargetHelper.propTypes = {
  2388. target: targetPropType.isRequired
  2389. };
  2390. var propTypes$B = {
  2391. placement: PropTypes.oneOf(PopperPlacements),
  2392. target: targetPropType.isRequired,
  2393. container: targetPropType,
  2394. isOpen: PropTypes.bool,
  2395. disabled: PropTypes.bool,
  2396. hideArrow: PropTypes.bool,
  2397. boundariesElement: PropTypes.oneOfType([PropTypes.string, DOMElement]),
  2398. className: PropTypes.string,
  2399. innerClassName: PropTypes.string,
  2400. arrowClassName: PropTypes.string,
  2401. cssModule: PropTypes.object,
  2402. toggle: PropTypes.func,
  2403. autohide: PropTypes.bool,
  2404. placementPrefix: PropTypes.string,
  2405. delay: PropTypes.oneOfType([PropTypes.shape({
  2406. show: PropTypes.number,
  2407. hide: PropTypes.number
  2408. }), PropTypes.number]),
  2409. modifiers: PropTypes.object,
  2410. offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  2411. innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object]),
  2412. trigger: PropTypes.string
  2413. };
  2414. var DEFAULT_DELAYS = {
  2415. show: 0,
  2416. hide: 250
  2417. };
  2418. var defaultProps$y = {
  2419. isOpen: false,
  2420. hideArrow: false,
  2421. autohide: false,
  2422. delay: DEFAULT_DELAYS,
  2423. toggle: function toggle() {},
  2424. trigger: 'click'
  2425. };
  2426. function isInDOMSubtree(element, subtreeRoot) {
  2427. return subtreeRoot && (element === subtreeRoot || subtreeRoot.contains(element));
  2428. }
  2429. var TooltipPopoverWrapper =
  2430. /*#__PURE__*/
  2431. function (_React$Component) {
  2432. _inheritsLoose(TooltipPopoverWrapper, _React$Component);
  2433. function TooltipPopoverWrapper(props) {
  2434. var _this;
  2435. _this = _React$Component.call(this, props) || this;
  2436. _this._target = null;
  2437. _this.addTargetEvents = _this.addTargetEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2438. _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2439. _this.removeTargetEvents = _this.removeTargetEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2440. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2441. _this.showWithDelay = _this.showWithDelay.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2442. _this.hideWithDelay = _this.hideWithDelay.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2443. _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2444. _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2445. _this.show = _this.show.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2446. _this.hide = _this.hide.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2447. _this.onEscKeyDown = _this.onEscKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2448. _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2449. return _this;
  2450. }
  2451. var _proto = TooltipPopoverWrapper.prototype;
  2452. _proto.componentDidMount = function componentDidMount() {
  2453. this.updateTarget();
  2454. };
  2455. _proto.componentWillUnmount = function componentWillUnmount() {
  2456. this.removeTargetEvents();
  2457. };
  2458. _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {
  2459. if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
  2460. if (this._hideTimeout) {
  2461. this.clearHideTimeout();
  2462. }
  2463. }
  2464. };
  2465. _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {
  2466. if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
  2467. if (this._showTimeout) {
  2468. this.clearShowTimeout();
  2469. }
  2470. e.persist();
  2471. this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
  2472. }
  2473. };
  2474. _proto.onEscKeyDown = function onEscKeyDown(e) {
  2475. if (e.key === 'Escape') {
  2476. this.hide(e);
  2477. }
  2478. };
  2479. _proto.getRef = function getRef(ref) {
  2480. var innerRef = this.props.innerRef;
  2481. if (innerRef) {
  2482. if (typeof innerRef === 'function') {
  2483. innerRef(ref);
  2484. } else if (typeof innerRef === 'object') {
  2485. innerRef.current = ref;
  2486. }
  2487. }
  2488. this._popover = ref;
  2489. };
  2490. _proto.getDelay = function getDelay(key) {
  2491. var delay = this.props.delay;
  2492. if (typeof delay === 'object') {
  2493. return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];
  2494. }
  2495. return delay;
  2496. };
  2497. _proto.show = function show(e) {
  2498. if (!this.props.isOpen) {
  2499. this.clearShowTimeout();
  2500. this.toggle(e);
  2501. }
  2502. };
  2503. _proto.showWithDelay = function showWithDelay(e) {
  2504. if (this._hideTimeout) {
  2505. this.clearHideTimeout();
  2506. }
  2507. this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));
  2508. };
  2509. _proto.hide = function hide(e) {
  2510. if (this.props.isOpen) {
  2511. this.clearHideTimeout();
  2512. this.toggle(e);
  2513. }
  2514. };
  2515. _proto.hideWithDelay = function hideWithDelay(e) {
  2516. if (this._showTimeout) {
  2517. this.clearShowTimeout();
  2518. }
  2519. this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
  2520. };
  2521. _proto.clearShowTimeout = function clearShowTimeout() {
  2522. clearTimeout(this._showTimeout);
  2523. this._showTimeout = undefined;
  2524. };
  2525. _proto.clearHideTimeout = function clearHideTimeout() {
  2526. clearTimeout(this._hideTimeout);
  2527. this._hideTimeout = undefined;
  2528. };
  2529. _proto.handleDocumentClick = function handleDocumentClick(e) {
  2530. var triggers = this.props.trigger.split(' ');
  2531. if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtree(e.target, this._target))) {
  2532. if (this._hideTimeout) {
  2533. this.clearHideTimeout();
  2534. }
  2535. if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {
  2536. this.hideWithDelay(e);
  2537. } else {
  2538. this.showWithDelay(e);
  2539. }
  2540. } else if (triggers.indexOf('click') > -1 && isInDOMSubtree(e.target, this._target)) {
  2541. if (this._hideTimeout) {
  2542. this.clearHideTimeout();
  2543. }
  2544. if (!this.props.isOpen) {
  2545. this.showWithDelay(e);
  2546. } else {
  2547. this.hideWithDelay(e);
  2548. }
  2549. }
  2550. };
  2551. _proto.addTargetEvents = function addTargetEvents() {
  2552. var _this2 = this;
  2553. if (this.props.trigger) {
  2554. var triggers = this.props.trigger.split(' ');
  2555. if (triggers.indexOf('manual') === -1) {
  2556. if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {
  2557. ['click', 'touchstart'].forEach(function (event) {
  2558. return document.addEventListener(event, _this2.handleDocumentClick, true);
  2559. });
  2560. }
  2561. if (this._target) {
  2562. if (triggers.indexOf('hover') > -1) {
  2563. this._target.addEventListener('mouseover', this.showWithDelay, true);
  2564. this._target.addEventListener('mouseout', this.hideWithDelay, true);
  2565. }
  2566. if (triggers.indexOf('focus') > -1) {
  2567. this._target.addEventListener('focusin', this.show, true);
  2568. this._target.addEventListener('focusout', this.hide, true);
  2569. }
  2570. this._target.addEventListener('keydown', this.onEscKeyDown, true);
  2571. }
  2572. }
  2573. }
  2574. };
  2575. _proto.removeTargetEvents = function removeTargetEvents() {
  2576. var _this3 = this;
  2577. if (this._target) {
  2578. this._target.removeEventListener('mouseover', this.showWithDelay, true);
  2579. this._target.removeEventListener('mouseout', this.hideWithDelay, true);
  2580. this._target.removeEventListener('keydown', this.onEscKeyDown, true);
  2581. this._target.removeEventListener('focusin', this.show, true);
  2582. this._target.removeEventListener('focusout', this.hide, true);
  2583. }
  2584. ['click', 'touchstart'].forEach(function (event) {
  2585. return document.removeEventListener(event, _this3.handleDocumentClick, true);
  2586. });
  2587. };
  2588. _proto.updateTarget = function updateTarget() {
  2589. var newTarget = getTarget(this.props.target);
  2590. if (newTarget !== this._target) {
  2591. this.removeTargetEvents();
  2592. this._target = newTarget;
  2593. this.addTargetEvents();
  2594. }
  2595. };
  2596. _proto.toggle = function toggle(e) {
  2597. if (this.props.disabled) {
  2598. return e && e.preventDefault();
  2599. }
  2600. return this.props.toggle(e);
  2601. };
  2602. _proto.render = function render() {
  2603. if (!this.props.isOpen) {
  2604. return null;
  2605. }
  2606. this.updateTarget();
  2607. var _this$props = this.props,
  2608. className = _this$props.className,
  2609. cssModule = _this$props.cssModule,
  2610. innerClassName = _this$props.innerClassName,
  2611. target = _this$props.target,
  2612. isOpen = _this$props.isOpen,
  2613. hideArrow = _this$props.hideArrow,
  2614. boundariesElement = _this$props.boundariesElement,
  2615. placement = _this$props.placement,
  2616. placementPrefix = _this$props.placementPrefix,
  2617. arrowClassName = _this$props.arrowClassName,
  2618. container = _this$props.container,
  2619. modifiers = _this$props.modifiers,
  2620. offset = _this$props.offset;
  2621. var attributes = omit(this.props, Object.keys(propTypes$B));
  2622. var popperClasses = mapToCssModules(className, cssModule);
  2623. var classes = mapToCssModules(innerClassName, cssModule);
  2624. return React__default.createElement(PopperContent, {
  2625. className: popperClasses,
  2626. target: target,
  2627. isOpen: isOpen,
  2628. hideArrow: hideArrow,
  2629. boundariesElement: boundariesElement,
  2630. placement: placement,
  2631. placementPrefix: placementPrefix,
  2632. arrowClassName: arrowClassName,
  2633. container: container,
  2634. modifiers: modifiers,
  2635. offset: offset,
  2636. cssModule: cssModule
  2637. }, React__default.createElement("div", _extends({}, attributes, {
  2638. ref: this.getRef,
  2639. className: classes,
  2640. role: "tooltip",
  2641. "aria-hidden": isOpen,
  2642. onMouseOver: this.onMouseOverTooltipContent,
  2643. onMouseLeave: this.onMouseLeaveTooltipContent,
  2644. onKeyDown: this.onEscKeyDown
  2645. })));
  2646. };
  2647. return TooltipPopoverWrapper;
  2648. }(React__default.Component);
  2649. TooltipPopoverWrapper.propTypes = propTypes$B;
  2650. TooltipPopoverWrapper.defaultProps = defaultProps$y;
  2651. var defaultProps$z = {
  2652. placement: 'right',
  2653. placementPrefix: 'bs-popover',
  2654. trigger: 'click'
  2655. };
  2656. var Popover = function Popover(props) {
  2657. var popperClasses = classNames('popover', 'show', props.className);
  2658. var classes = classNames('popover-inner', props.innerClassName);
  2659. return React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
  2660. className: popperClasses,
  2661. innerClassName: classes
  2662. }));
  2663. };
  2664. Popover.propTypes = propTypes$B;
  2665. Popover.defaultProps = defaultProps$z;
  2666. var omitKeys = ['defaultOpen'];
  2667. var UncontrolledPopover =
  2668. /*#__PURE__*/
  2669. function (_Component) {
  2670. _inheritsLoose(UncontrolledPopover, _Component);
  2671. function UncontrolledPopover(props) {
  2672. var _this;
  2673. _this = _Component.call(this, props) || this;
  2674. _this.state = {
  2675. isOpen: props.defaultOpen || false
  2676. };
  2677. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2678. return _this;
  2679. }
  2680. var _proto = UncontrolledPopover.prototype;
  2681. _proto.toggle = function toggle() {
  2682. this.setState({
  2683. isOpen: !this.state.isOpen
  2684. });
  2685. };
  2686. _proto.render = function render() {
  2687. return React__default.createElement(Popover, _extends({
  2688. isOpen: this.state.isOpen,
  2689. toggle: this.toggle
  2690. }, omit(this.props, omitKeys)));
  2691. };
  2692. return UncontrolledPopover;
  2693. }(React.Component);
  2694. UncontrolledPopover.propTypes = _extends({
  2695. defaultOpen: PropTypes.bool
  2696. }, Popover.propTypes);
  2697. var propTypes$C = {
  2698. tag: tagPropType,
  2699. className: PropTypes.string,
  2700. cssModule: PropTypes.object
  2701. };
  2702. var defaultProps$A = {
  2703. tag: 'h3'
  2704. };
  2705. var PopoverHeader = function PopoverHeader(props) {
  2706. var className = props.className,
  2707. cssModule = props.cssModule,
  2708. Tag = props.tag,
  2709. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  2710. var classes = mapToCssModules(classNames(className, 'popover-header'), cssModule);
  2711. return React__default.createElement(Tag, _extends({}, attributes, {
  2712. className: classes
  2713. }));
  2714. };
  2715. PopoverHeader.propTypes = propTypes$C;
  2716. PopoverHeader.defaultProps = defaultProps$A;
  2717. function PopoverTitle(props) {
  2718. warnOnce('The "PopoverTitle" component has been deprecated.\nPlease use component "PopoverHeader".');
  2719. return React__default.createElement(PopoverHeader, props);
  2720. }
  2721. var propTypes$D = {
  2722. tag: tagPropType,
  2723. className: PropTypes.string,
  2724. cssModule: PropTypes.object
  2725. };
  2726. var defaultProps$B = {
  2727. tag: 'div'
  2728. };
  2729. var PopoverBody = function PopoverBody(props) {
  2730. var className = props.className,
  2731. cssModule = props.cssModule,
  2732. Tag = props.tag,
  2733. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  2734. var classes = mapToCssModules(classNames(className, 'popover-body'), cssModule);
  2735. return React__default.createElement(Tag, _extends({}, attributes, {
  2736. className: classes
  2737. }));
  2738. };
  2739. PopoverBody.propTypes = propTypes$D;
  2740. PopoverBody.defaultProps = defaultProps$B;
  2741. function PopoverContent(props) {
  2742. warnOnce('The "PopoverContent" component has been deprecated.\nPlease use component "PopoverBody".');
  2743. return React__default.createElement(PopoverBody, props);
  2744. }
  2745. var propTypes$E = {
  2746. children: PropTypes.node,
  2747. bar: PropTypes.bool,
  2748. multi: PropTypes.bool,
  2749. tag: tagPropType,
  2750. value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  2751. max: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  2752. animated: PropTypes.bool,
  2753. striped: PropTypes.bool,
  2754. color: PropTypes.string,
  2755. className: PropTypes.string,
  2756. barClassName: PropTypes.string,
  2757. cssModule: PropTypes.object
  2758. };
  2759. var defaultProps$C = {
  2760. tag: 'div',
  2761. value: 0,
  2762. max: 100
  2763. };
  2764. var Progress = function Progress(props) {
  2765. var children = props.children,
  2766. className = props.className,
  2767. barClassName = props.barClassName,
  2768. cssModule = props.cssModule,
  2769. value = props.value,
  2770. max = props.max,
  2771. animated = props.animated,
  2772. striped = props.striped,
  2773. color = props.color,
  2774. bar = props.bar,
  2775. multi = props.multi,
  2776. Tag = props.tag,
  2777. attributes = _objectWithoutPropertiesLoose(props, ["children", "className", "barClassName", "cssModule", "value", "max", "animated", "striped", "color", "bar", "multi", "tag"]);
  2778. var percent = toNumber(value) / toNumber(max) * 100;
  2779. var progressClasses = mapToCssModules(classNames(className, 'progress'), cssModule);
  2780. var progressBarClasses = mapToCssModules(classNames('progress-bar', bar ? className || barClassName : barClassName, animated ? 'progress-bar-animated' : null, color ? "bg-" + color : null, striped || animated ? 'progress-bar-striped' : null), cssModule);
  2781. var ProgressBar = multi ? children : React__default.createElement("div", {
  2782. className: progressBarClasses,
  2783. style: {
  2784. width: percent + "%"
  2785. },
  2786. role: "progressbar",
  2787. "aria-valuenow": value,
  2788. "aria-valuemin": "0",
  2789. "aria-valuemax": max,
  2790. children: children
  2791. });
  2792. if (bar) {
  2793. return ProgressBar;
  2794. }
  2795. return React__default.createElement(Tag, _extends({}, attributes, {
  2796. className: progressClasses,
  2797. children: ProgressBar
  2798. }));
  2799. };
  2800. Progress.propTypes = propTypes$E;
  2801. Progress.defaultProps = defaultProps$C;
  2802. var propTypes$F = {
  2803. children: PropTypes.node.isRequired,
  2804. node: PropTypes.any
  2805. };
  2806. var Portal =
  2807. /*#__PURE__*/
  2808. function (_React$Component) {
  2809. _inheritsLoose(Portal, _React$Component);
  2810. function Portal() {
  2811. return _React$Component.apply(this, arguments) || this;
  2812. }
  2813. var _proto = Portal.prototype;
  2814. _proto.componentWillUnmount = function componentWillUnmount() {
  2815. if (this.defaultNode) {
  2816. document.body.removeChild(this.defaultNode);
  2817. }
  2818. this.defaultNode = null;
  2819. };
  2820. _proto.render = function render() {
  2821. if (!canUseDOM) {
  2822. return null;
  2823. }
  2824. if (!this.props.node && !this.defaultNode) {
  2825. this.defaultNode = document.createElement('div');
  2826. document.body.appendChild(this.defaultNode);
  2827. }
  2828. return ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);
  2829. };
  2830. return Portal;
  2831. }(React__default.Component);
  2832. Portal.propTypes = propTypes$F;
  2833. function noop() {}
  2834. var FadePropTypes = PropTypes.shape(Fade.propTypes);
  2835. var propTypes$G = {
  2836. isOpen: PropTypes.bool,
  2837. autoFocus: PropTypes.bool,
  2838. centered: PropTypes.bool,
  2839. size: PropTypes.string,
  2840. toggle: PropTypes.func,
  2841. keyboard: PropTypes.bool,
  2842. role: PropTypes.string,
  2843. labelledBy: PropTypes.string,
  2844. backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['static'])]),
  2845. onEnter: PropTypes.func,
  2846. onExit: PropTypes.func,
  2847. onOpened: PropTypes.func,
  2848. onClosed: PropTypes.func,
  2849. children: PropTypes.node,
  2850. className: PropTypes.string,
  2851. wrapClassName: PropTypes.string,
  2852. modalClassName: PropTypes.string,
  2853. backdropClassName: PropTypes.string,
  2854. contentClassName: PropTypes.string,
  2855. external: PropTypes.node,
  2856. fade: PropTypes.bool,
  2857. cssModule: PropTypes.object,
  2858. zIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  2859. backdropTransition: FadePropTypes,
  2860. modalTransition: FadePropTypes,
  2861. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
  2862. };
  2863. var propsToOmit = Object.keys(propTypes$G);
  2864. var defaultProps$D = {
  2865. isOpen: false,
  2866. autoFocus: true,
  2867. centered: false,
  2868. role: 'dialog',
  2869. backdrop: true,
  2870. keyboard: true,
  2871. zIndex: 1050,
  2872. fade: true,
  2873. onOpened: noop,
  2874. onClosed: noop,
  2875. modalTransition: {
  2876. timeout: TransitionTimeouts.Modal
  2877. },
  2878. backdropTransition: {
  2879. mountOnEnter: true,
  2880. timeout: TransitionTimeouts.Fade // uses standard fade transition
  2881. }
  2882. };
  2883. var Modal =
  2884. /*#__PURE__*/
  2885. function (_React$Component) {
  2886. _inheritsLoose(Modal, _React$Component);
  2887. function Modal(props) {
  2888. var _this;
  2889. _this = _React$Component.call(this, props) || this;
  2890. _this._element = null;
  2891. _this._originalBodyPadding = null;
  2892. _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2893. _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2894. _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2895. _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2896. _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2897. _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2898. _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  2899. _this.state = {
  2900. isOpen: props.isOpen
  2901. };
  2902. if (props.isOpen) {
  2903. _this.init();
  2904. }
  2905. return _this;
  2906. }
  2907. var _proto = Modal.prototype;
  2908. _proto.componentDidMount = function componentDidMount() {
  2909. if (this.props.onEnter) {
  2910. this.props.onEnter();
  2911. }
  2912. if (this.state.isOpen && this.props.autoFocus) {
  2913. this.setFocus();
  2914. }
  2915. this._isMounted = true;
  2916. };
  2917. _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
  2918. if (nextProps.isOpen && !this.props.isOpen) {
  2919. this.setState({
  2920. isOpen: nextProps.isOpen
  2921. });
  2922. }
  2923. };
  2924. _proto.componentWillUpdate = function componentWillUpdate(nextProps, nextState) {
  2925. if (nextState.isOpen && !this.state.isOpen) {
  2926. this.init();
  2927. }
  2928. };
  2929. _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
  2930. if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {
  2931. this.setFocus();
  2932. }
  2933. if (this._element && prevProps.zIndex !== this.props.zIndex) {
  2934. this._element.style.zIndex = this.props.zIndex;
  2935. }
  2936. };
  2937. _proto.componentWillUnmount = function componentWillUnmount() {
  2938. if (this.props.onExit) {
  2939. this.props.onExit();
  2940. }
  2941. if (this.state.isOpen) {
  2942. this.destroy();
  2943. }
  2944. this._isMounted = false;
  2945. };
  2946. _proto.onOpened = function onOpened(node, isAppearing) {
  2947. this.props.onOpened();
  2948. (this.props.modalTransition.onEntered || noop)(node, isAppearing);
  2949. };
  2950. _proto.onClosed = function onClosed(node) {
  2951. // so all methods get called before it is unmounted
  2952. this.props.onClosed();
  2953. (this.props.modalTransition.onExited || noop)(node);
  2954. this.destroy();
  2955. if (this._isMounted) {
  2956. this.setState({
  2957. isOpen: false
  2958. });
  2959. }
  2960. };
  2961. _proto.setFocus = function setFocus() {
  2962. if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') {
  2963. this._dialog.parentNode.focus();
  2964. }
  2965. };
  2966. _proto.getFocusableChildren = function getFocusableChildren() {
  2967. return this._element.querySelectorAll(focusableElements.join(', '));
  2968. };
  2969. _proto.getFocusedChild = function getFocusedChild() {
  2970. var currentFocus;
  2971. var focusableChildren = this.getFocusableChildren();
  2972. try {
  2973. currentFocus = document.activeElement;
  2974. } catch (err) {
  2975. currentFocus = focusableChildren[0];
  2976. }
  2977. return currentFocus;
  2978. } // not mouseUp because scrollbar fires it, shouldn't close when user scrolls
  2979. ;
  2980. _proto.handleBackdropClick = function handleBackdropClick(e) {
  2981. if (e.target === this._mouseDownElement) {
  2982. e.stopPropagation();
  2983. if (!this.props.isOpen || this.props.backdrop !== true) return;
  2984. var backdrop = this._dialog ? this._dialog.parentNode : null;
  2985. if (backdrop && e.target === backdrop && this.props.toggle) {
  2986. this.props.toggle(e);
  2987. }
  2988. }
  2989. };
  2990. _proto.handleTab = function handleTab(e) {
  2991. if (e.which !== 9) return;
  2992. var focusableChildren = this.getFocusableChildren();
  2993. var totalFocusable = focusableChildren.length;
  2994. var currentFocus = this.getFocusedChild();
  2995. var focusedIndex = 0;
  2996. for (var i = 0; i < totalFocusable; i += 1) {
  2997. if (focusableChildren[i] === currentFocus) {
  2998. focusedIndex = i;
  2999. break;
  3000. }
  3001. }
  3002. if (e.shiftKey && focusedIndex === 0) {
  3003. e.preventDefault();
  3004. focusableChildren[totalFocusable - 1].focus();
  3005. } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {
  3006. e.preventDefault();
  3007. focusableChildren[0].focus();
  3008. }
  3009. };
  3010. _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {
  3011. this._mouseDownElement = e.target;
  3012. };
  3013. _proto.handleEscape = function handleEscape(e) {
  3014. if (this.props.isOpen && this.props.keyboard && e.keyCode === 27 && this.props.toggle) {
  3015. e.preventDefault();
  3016. e.stopPropagation();
  3017. this.props.toggle(e);
  3018. }
  3019. };
  3020. _proto.init = function init() {
  3021. try {
  3022. this._triggeringElement = document.activeElement;
  3023. } catch (err) {
  3024. this._triggeringElement = null;
  3025. }
  3026. this._element = document.createElement('div');
  3027. this._element.setAttribute('tabindex', '-1');
  3028. this._element.style.position = 'relative';
  3029. this._element.style.zIndex = this.props.zIndex;
  3030. this._originalBodyPadding = getOriginalBodyPadding();
  3031. conditionallyUpdateScrollbar();
  3032. document.body.appendChild(this._element);
  3033. if (Modal.openCount === 0) {
  3034. document.body.className = classNames(document.body.className, mapToCssModules('modal-open', this.props.cssModule));
  3035. }
  3036. Modal.openCount += 1;
  3037. };
  3038. _proto.destroy = function destroy() {
  3039. if (this._element) {
  3040. document.body.removeChild(this._element);
  3041. this._element = null;
  3042. }
  3043. if (this._triggeringElement) {
  3044. if (this._triggeringElement.focus) this._triggeringElement.focus();
  3045. this._triggeringElement = null;
  3046. }
  3047. if (Modal.openCount <= 1) {
  3048. var modalOpenClassName = mapToCssModules('modal-open', this.props.cssModule); // Use regex to prevent matching `modal-open` as part of a different class, e.g. `my-modal-opened`
  3049. var modalOpenClassNameRegex = new RegExp("(^| )" + modalOpenClassName + "( |$)");
  3050. document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim();
  3051. }
  3052. Modal.openCount -= 1;
  3053. setScrollbarWidth(this._originalBodyPadding);
  3054. };
  3055. _proto.renderModalDialog = function renderModalDialog() {
  3056. var _classNames,
  3057. _this2 = this;
  3058. var attributes = omit(this.props, propsToOmit);
  3059. var dialogBaseClass = 'modal-dialog';
  3060. return React__default.createElement("div", _extends({}, attributes, {
  3061. className: mapToCssModules(classNames(dialogBaseClass, this.props.className, (_classNames = {}, _classNames["modal-" + this.props.size] = this.props.size, _classNames[dialogBaseClass + "-centered"] = this.props.centered, _classNames)), this.props.cssModule),
  3062. role: "document",
  3063. ref: function ref(c) {
  3064. _this2._dialog = c;
  3065. }
  3066. }), React__default.createElement("div", {
  3067. className: mapToCssModules(classNames('modal-content', this.props.contentClassName), this.props.cssModule)
  3068. }, this.props.children));
  3069. };
  3070. _proto.render = function render() {
  3071. if (this.state.isOpen) {
  3072. var _this$props = this.props,
  3073. wrapClassName = _this$props.wrapClassName,
  3074. modalClassName = _this$props.modalClassName,
  3075. backdropClassName = _this$props.backdropClassName,
  3076. cssModule = _this$props.cssModule,
  3077. isOpen = _this$props.isOpen,
  3078. backdrop = _this$props.backdrop,
  3079. role = _this$props.role,
  3080. labelledBy = _this$props.labelledBy,
  3081. external = _this$props.external,
  3082. innerRef = _this$props.innerRef;
  3083. var modalAttributes = {
  3084. onClick: this.handleBackdropClick,
  3085. onMouseDown: this.handleBackdropMouseDown,
  3086. onKeyUp: this.handleEscape,
  3087. onKeyDown: this.handleTab,
  3088. style: {
  3089. display: 'block'
  3090. },
  3091. 'aria-labelledby': labelledBy,
  3092. role: role,
  3093. tabIndex: '-1'
  3094. };
  3095. var hasTransition = this.props.fade;
  3096. var modalTransition = _extends({}, Fade.defaultProps, this.props.modalTransition, {
  3097. baseClass: hasTransition ? this.props.modalTransition.baseClass : '',
  3098. timeout: hasTransition ? this.props.modalTransition.timeout : 0
  3099. });
  3100. var backdropTransition = _extends({}, Fade.defaultProps, this.props.backdropTransition, {
  3101. baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',
  3102. timeout: hasTransition ? this.props.backdropTransition.timeout : 0
  3103. });
  3104. var Backdrop = backdrop && (hasTransition ? React__default.createElement(Fade, _extends({}, backdropTransition, {
  3105. in: isOpen && !!backdrop,
  3106. cssModule: cssModule,
  3107. className: mapToCssModules(classNames('modal-backdrop', backdropClassName), cssModule)
  3108. })) : React__default.createElement("div", {
  3109. className: mapToCssModules(classNames('modal-backdrop', 'show', backdropClassName), cssModule)
  3110. }));
  3111. return React__default.createElement(Portal, {
  3112. node: this._element
  3113. }, React__default.createElement("div", {
  3114. className: mapToCssModules(wrapClassName)
  3115. }, React__default.createElement(Fade, _extends({}, modalAttributes, modalTransition, {
  3116. in: isOpen,
  3117. onEntered: this.onOpened,
  3118. onExited: this.onClosed,
  3119. cssModule: cssModule,
  3120. className: mapToCssModules(classNames('modal', modalClassName), cssModule),
  3121. innerRef: innerRef
  3122. }), external, this.renderModalDialog()), Backdrop));
  3123. }
  3124. return null;
  3125. };
  3126. return Modal;
  3127. }(React__default.Component);
  3128. Modal.propTypes = propTypes$G;
  3129. Modal.defaultProps = defaultProps$D;
  3130. Modal.openCount = 0;
  3131. var propTypes$H = {
  3132. tag: tagPropType,
  3133. wrapTag: tagPropType,
  3134. toggle: PropTypes.func,
  3135. className: PropTypes.string,
  3136. cssModule: PropTypes.object,
  3137. children: PropTypes.node,
  3138. closeAriaLabel: PropTypes.string,
  3139. charCode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3140. close: PropTypes.object
  3141. };
  3142. var defaultProps$E = {
  3143. tag: 'h5',
  3144. wrapTag: 'div',
  3145. closeAriaLabel: 'Close',
  3146. charCode: 215
  3147. };
  3148. var ModalHeader = function ModalHeader(props) {
  3149. var closeButton;
  3150. var className = props.className,
  3151. cssModule = props.cssModule,
  3152. children = props.children,
  3153. toggle = props.toggle,
  3154. Tag = props.tag,
  3155. WrapTag = props.wrapTag,
  3156. closeAriaLabel = props.closeAriaLabel,
  3157. charCode = props.charCode,
  3158. close = props.close,
  3159. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close"]);
  3160. var classes = mapToCssModules(classNames(className, 'modal-header'), cssModule);
  3161. if (!close && toggle) {
  3162. var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
  3163. closeButton = React__default.createElement("button", {
  3164. type: "button",
  3165. onClick: toggle,
  3166. className: mapToCssModules('close', cssModule),
  3167. "aria-label": closeAriaLabel
  3168. }, React__default.createElement("span", {
  3169. "aria-hidden": "true"
  3170. }, closeIcon));
  3171. }
  3172. return React__default.createElement(WrapTag, _extends({}, attributes, {
  3173. className: classes
  3174. }), React__default.createElement(Tag, {
  3175. className: mapToCssModules('modal-title', cssModule)
  3176. }, children), close || closeButton);
  3177. };
  3178. ModalHeader.propTypes = propTypes$H;
  3179. ModalHeader.defaultProps = defaultProps$E;
  3180. var propTypes$I = {
  3181. tag: tagPropType,
  3182. className: PropTypes.string,
  3183. cssModule: PropTypes.object
  3184. };
  3185. var defaultProps$F = {
  3186. tag: 'div'
  3187. };
  3188. var ModalBody = function ModalBody(props) {
  3189. var className = props.className,
  3190. cssModule = props.cssModule,
  3191. Tag = props.tag,
  3192. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  3193. var classes = mapToCssModules(classNames(className, 'modal-body'), cssModule);
  3194. return React__default.createElement(Tag, _extends({}, attributes, {
  3195. className: classes
  3196. }));
  3197. };
  3198. ModalBody.propTypes = propTypes$I;
  3199. ModalBody.defaultProps = defaultProps$F;
  3200. var propTypes$J = {
  3201. tag: tagPropType,
  3202. className: PropTypes.string,
  3203. cssModule: PropTypes.object
  3204. };
  3205. var defaultProps$G = {
  3206. tag: 'div'
  3207. };
  3208. var ModalFooter = function ModalFooter(props) {
  3209. var className = props.className,
  3210. cssModule = props.cssModule,
  3211. Tag = props.tag,
  3212. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  3213. var classes = mapToCssModules(classNames(className, 'modal-footer'), cssModule);
  3214. return React__default.createElement(Tag, _extends({}, attributes, {
  3215. className: classes
  3216. }));
  3217. };
  3218. ModalFooter.propTypes = propTypes$J;
  3219. ModalFooter.defaultProps = defaultProps$G;
  3220. var defaultProps$H = {
  3221. placement: 'top',
  3222. autohide: true,
  3223. placementPrefix: 'bs-tooltip',
  3224. trigger: 'click hover focus'
  3225. };
  3226. var Tooltip = function Tooltip(props) {
  3227. var popperClasses = classNames('tooltip', 'show', props.className);
  3228. var classes = classNames('tooltip-inner', props.innerClassName);
  3229. return React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
  3230. className: popperClasses,
  3231. innerClassName: classes
  3232. }));
  3233. };
  3234. Tooltip.propTypes = propTypes$B;
  3235. Tooltip.defaultProps = defaultProps$H;
  3236. var propTypes$K = {
  3237. className: PropTypes.string,
  3238. cssModule: PropTypes.object,
  3239. size: PropTypes.string,
  3240. bordered: PropTypes.bool,
  3241. borderless: PropTypes.bool,
  3242. striped: PropTypes.bool,
  3243. inverse: deprecated(PropTypes.bool, 'Please use the prop "dark"'),
  3244. dark: PropTypes.bool,
  3245. hover: PropTypes.bool,
  3246. responsive: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
  3247. tag: tagPropType,
  3248. responsiveTag: tagPropType,
  3249. innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object])
  3250. };
  3251. var defaultProps$I = {
  3252. tag: 'table',
  3253. responsiveTag: 'div'
  3254. };
  3255. var Table = function Table(props) {
  3256. var className = props.className,
  3257. cssModule = props.cssModule,
  3258. size = props.size,
  3259. bordered = props.bordered,
  3260. borderless = props.borderless,
  3261. striped = props.striped,
  3262. inverse = props.inverse,
  3263. dark = props.dark,
  3264. hover = props.hover,
  3265. responsive = props.responsive,
  3266. Tag = props.tag,
  3267. ResponsiveTag = props.responsiveTag,
  3268. innerRef = props.innerRef,
  3269. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "bordered", "borderless", "striped", "inverse", "dark", "hover", "responsive", "tag", "responsiveTag", "innerRef"]);
  3270. var classes = mapToCssModules(classNames(className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, borderless ? 'table-borderless' : false, striped ? 'table-striped' : false, dark || inverse ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule);
  3271. var table = React__default.createElement(Tag, _extends({}, attributes, {
  3272. ref: innerRef,
  3273. className: classes
  3274. }));
  3275. if (responsive) {
  3276. var responsiveClassName = responsive === true ? 'table-responsive' : "table-responsive-" + responsive;
  3277. return React__default.createElement(ResponsiveTag, {
  3278. className: responsiveClassName
  3279. }, table);
  3280. }
  3281. return table;
  3282. };
  3283. Table.propTypes = propTypes$K;
  3284. Table.defaultProps = defaultProps$I;
  3285. var propTypes$L = {
  3286. tag: tagPropType,
  3287. flush: PropTypes.bool,
  3288. className: PropTypes.string,
  3289. cssModule: PropTypes.object
  3290. };
  3291. var defaultProps$J = {
  3292. tag: 'ul'
  3293. };
  3294. var ListGroup = function ListGroup(props) {
  3295. var className = props.className,
  3296. cssModule = props.cssModule,
  3297. Tag = props.tag,
  3298. flush = props.flush,
  3299. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "flush"]);
  3300. var classes = mapToCssModules(classNames(className, 'list-group', flush ? 'list-group-flush' : false), cssModule);
  3301. return React__default.createElement(Tag, _extends({}, attributes, {
  3302. className: classes
  3303. }));
  3304. };
  3305. ListGroup.propTypes = propTypes$L;
  3306. ListGroup.defaultProps = defaultProps$J;
  3307. var propTypes$M = {
  3308. children: PropTypes.node,
  3309. inline: PropTypes.bool,
  3310. tag: tagPropType,
  3311. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
  3312. className: PropTypes.string,
  3313. cssModule: PropTypes.object
  3314. };
  3315. var defaultProps$K = {
  3316. tag: 'form'
  3317. };
  3318. var Form =
  3319. /*#__PURE__*/
  3320. function (_Component) {
  3321. _inheritsLoose(Form, _Component);
  3322. function Form(props) {
  3323. var _this;
  3324. _this = _Component.call(this, props) || this;
  3325. _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3326. _this.submit = _this.submit.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3327. return _this;
  3328. }
  3329. var _proto = Form.prototype;
  3330. _proto.getRef = function getRef(ref) {
  3331. if (this.props.innerRef) {
  3332. this.props.innerRef(ref);
  3333. }
  3334. this.ref = ref;
  3335. };
  3336. _proto.submit = function submit() {
  3337. if (this.ref) {
  3338. this.ref.submit();
  3339. }
  3340. };
  3341. _proto.render = function render() {
  3342. var _this$props = this.props,
  3343. className = _this$props.className,
  3344. cssModule = _this$props.cssModule,
  3345. inline = _this$props.inline,
  3346. Tag = _this$props.tag,
  3347. innerRef = _this$props.innerRef,
  3348. attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "inline", "tag", "innerRef"]);
  3349. var classes = mapToCssModules(classNames(className, inline ? 'form-inline' : false), cssModule);
  3350. return React__default.createElement(Tag, _extends({}, attributes, {
  3351. ref: innerRef,
  3352. className: classes
  3353. }));
  3354. };
  3355. return Form;
  3356. }(React.Component);
  3357. Form.propTypes = propTypes$M;
  3358. Form.defaultProps = defaultProps$K;
  3359. var propTypes$N = {
  3360. children: PropTypes.node,
  3361. tag: tagPropType,
  3362. className: PropTypes.string,
  3363. cssModule: PropTypes.object,
  3364. valid: PropTypes.bool,
  3365. tooltip: PropTypes.bool
  3366. };
  3367. var defaultProps$L = {
  3368. tag: 'div',
  3369. valid: undefined
  3370. };
  3371. var FormFeedback = function FormFeedback(props) {
  3372. var className = props.className,
  3373. cssModule = props.cssModule,
  3374. valid = props.valid,
  3375. tooltip = props.tooltip,
  3376. Tag = props.tag,
  3377. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "valid", "tooltip", "tag"]);
  3378. var validMode = tooltip ? 'tooltip' : 'feedback';
  3379. var classes = mapToCssModules(classNames(className, valid ? "valid-" + validMode : "invalid-" + validMode), cssModule);
  3380. return React__default.createElement(Tag, _extends({}, attributes, {
  3381. className: classes
  3382. }));
  3383. };
  3384. FormFeedback.propTypes = propTypes$N;
  3385. FormFeedback.defaultProps = defaultProps$L;
  3386. var propTypes$O = {
  3387. children: PropTypes.node,
  3388. row: PropTypes.bool,
  3389. check: PropTypes.bool,
  3390. inline: PropTypes.bool,
  3391. disabled: PropTypes.bool,
  3392. tag: tagPropType,
  3393. className: PropTypes.string,
  3394. cssModule: PropTypes.object
  3395. };
  3396. var defaultProps$M = {
  3397. tag: 'div'
  3398. };
  3399. var FormGroup = function FormGroup(props) {
  3400. var className = props.className,
  3401. cssModule = props.cssModule,
  3402. row = props.row,
  3403. disabled = props.disabled,
  3404. check = props.check,
  3405. inline = props.inline,
  3406. Tag = props.tag,
  3407. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "row", "disabled", "check", "inline", "tag"]);
  3408. var classes = mapToCssModules(classNames(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule);
  3409. return React__default.createElement(Tag, _extends({}, attributes, {
  3410. className: classes
  3411. }));
  3412. };
  3413. FormGroup.propTypes = propTypes$O;
  3414. FormGroup.defaultProps = defaultProps$M;
  3415. var propTypes$P = {
  3416. children: PropTypes.node,
  3417. inline: PropTypes.bool,
  3418. tag: tagPropType,
  3419. color: PropTypes.string,
  3420. className: PropTypes.string,
  3421. cssModule: PropTypes.object
  3422. };
  3423. var defaultProps$N = {
  3424. tag: 'small',
  3425. color: 'muted'
  3426. };
  3427. var FormText = function FormText(props) {
  3428. var className = props.className,
  3429. cssModule = props.cssModule,
  3430. inline = props.inline,
  3431. color = props.color,
  3432. Tag = props.tag,
  3433. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "inline", "color", "tag"]);
  3434. var classes = mapToCssModules(classNames(className, !inline ? 'form-text' : false, color ? "text-" + color : false), cssModule);
  3435. return React__default.createElement(Tag, _extends({}, attributes, {
  3436. className: classes
  3437. }));
  3438. };
  3439. FormText.propTypes = propTypes$P;
  3440. FormText.defaultProps = defaultProps$N;
  3441. var propTypes$Q = {
  3442. children: PropTypes.node,
  3443. type: PropTypes.string,
  3444. size: PropTypes.string,
  3445. bsSize: PropTypes.string,
  3446. state: deprecated(PropTypes.string, 'Please use the props "valid" and "invalid" to indicate the state.'),
  3447. valid: PropTypes.bool,
  3448. invalid: PropTypes.bool,
  3449. tag: tagPropType,
  3450. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
  3451. static: deprecated(PropTypes.bool, 'Please use the prop "plaintext"'),
  3452. plaintext: PropTypes.bool,
  3453. addon: PropTypes.bool,
  3454. className: PropTypes.string,
  3455. cssModule: PropTypes.object
  3456. };
  3457. var defaultProps$O = {
  3458. type: 'text'
  3459. };
  3460. var Input =
  3461. /*#__PURE__*/
  3462. function (_React$Component) {
  3463. _inheritsLoose(Input, _React$Component);
  3464. function Input(props) {
  3465. var _this;
  3466. _this = _React$Component.call(this, props) || this;
  3467. _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3468. _this.focus = _this.focus.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3469. return _this;
  3470. }
  3471. var _proto = Input.prototype;
  3472. _proto.getRef = function getRef(ref) {
  3473. if (this.props.innerRef) {
  3474. this.props.innerRef(ref);
  3475. }
  3476. this.ref = ref;
  3477. };
  3478. _proto.focus = function focus() {
  3479. if (this.ref) {
  3480. this.ref.focus();
  3481. }
  3482. };
  3483. _proto.render = function render() {
  3484. var _this$props = this.props,
  3485. className = _this$props.className,
  3486. cssModule = _this$props.cssModule,
  3487. type = _this$props.type,
  3488. bsSize = _this$props.bsSize,
  3489. state = _this$props.state,
  3490. valid = _this$props.valid,
  3491. invalid = _this$props.invalid,
  3492. tag = _this$props.tag,
  3493. addon = _this$props.addon,
  3494. staticInput = _this$props.static,
  3495. plaintext = _this$props.plaintext,
  3496. innerRef = _this$props.innerRef,
  3497. attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "type", "bsSize", "state", "valid", "invalid", "tag", "addon", "static", "plaintext", "innerRef"]);
  3498. var checkInput = ['radio', 'checkbox'].indexOf(type) > -1;
  3499. var isNotaNumber = new RegExp('\\D', 'g');
  3500. var fileInput = type === 'file';
  3501. var textareaInput = type === 'textarea';
  3502. var selectInput = type === 'select';
  3503. var Tag = tag || (selectInput || textareaInput ? type : 'input');
  3504. var formControlClass = 'form-control';
  3505. if (plaintext || staticInput) {
  3506. formControlClass = formControlClass + "-plaintext";
  3507. Tag = tag || 'input';
  3508. } else if (fileInput) {
  3509. formControlClass = formControlClass + "-file";
  3510. } else if (checkInput) {
  3511. if (addon) {
  3512. formControlClass = null;
  3513. } else {
  3514. formControlClass = 'form-check-input';
  3515. }
  3516. }
  3517. if (state && typeof valid === 'undefined' && typeof invalid === 'undefined') {
  3518. if (state === 'danger') {
  3519. invalid = true;
  3520. } else if (state === 'success') {
  3521. valid = true;
  3522. }
  3523. }
  3524. if (attributes.size && isNotaNumber.test(attributes.size)) {
  3525. warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.');
  3526. bsSize = attributes.size;
  3527. delete attributes.size;
  3528. }
  3529. var classes = mapToCssModules(classNames(className, invalid && 'is-invalid', valid && 'is-valid', bsSize ? "form-control-" + bsSize : false, formControlClass), cssModule);
  3530. if (Tag === 'input' || tag && typeof tag === 'function') {
  3531. attributes.type = type;
  3532. }
  3533. if (attributes.children && !(plaintext || staticInput || type === 'select' || typeof Tag !== 'string' || Tag === 'select')) {
  3534. warnOnce("Input with a type of \"" + type + "\" cannot have children. Please use \"value\"/\"defaultValue\" instead.");
  3535. delete attributes.children;
  3536. }
  3537. return React__default.createElement(Tag, _extends({}, attributes, {
  3538. ref: innerRef,
  3539. className: classes
  3540. }));
  3541. };
  3542. return Input;
  3543. }(React__default.Component);
  3544. Input.propTypes = propTypes$Q;
  3545. Input.defaultProps = defaultProps$O;
  3546. var propTypes$R = {
  3547. tag: tagPropType,
  3548. size: PropTypes.string,
  3549. className: PropTypes.string,
  3550. cssModule: PropTypes.object
  3551. };
  3552. var defaultProps$P = {
  3553. tag: 'div'
  3554. };
  3555. var InputGroup = function InputGroup(props) {
  3556. var className = props.className,
  3557. cssModule = props.cssModule,
  3558. Tag = props.tag,
  3559. size = props.size,
  3560. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "size"]);
  3561. var classes = mapToCssModules(classNames(className, 'input-group', size ? "input-group-" + size : null), cssModule);
  3562. return React__default.createElement(Tag, _extends({}, attributes, {
  3563. className: classes
  3564. }));
  3565. };
  3566. InputGroup.propTypes = propTypes$R;
  3567. InputGroup.defaultProps = defaultProps$P;
  3568. var propTypes$S = {
  3569. tag: tagPropType,
  3570. className: PropTypes.string,
  3571. cssModule: PropTypes.object
  3572. };
  3573. var defaultProps$Q = {
  3574. tag: 'span'
  3575. };
  3576. var InputGroupText = function InputGroupText(props) {
  3577. var className = props.className,
  3578. cssModule = props.cssModule,
  3579. Tag = props.tag,
  3580. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  3581. var classes = mapToCssModules(classNames(className, 'input-group-text'), cssModule);
  3582. return React__default.createElement(Tag, _extends({}, attributes, {
  3583. className: classes
  3584. }));
  3585. };
  3586. InputGroupText.propTypes = propTypes$S;
  3587. InputGroupText.defaultProps = defaultProps$Q;
  3588. var propTypes$T = {
  3589. tag: tagPropType,
  3590. addonType: PropTypes.oneOf(['prepend', 'append']).isRequired,
  3591. children: PropTypes.node,
  3592. className: PropTypes.string,
  3593. cssModule: PropTypes.object
  3594. };
  3595. var defaultProps$R = {
  3596. tag: 'div'
  3597. };
  3598. var InputGroupAddon = function InputGroupAddon(props) {
  3599. var className = props.className,
  3600. cssModule = props.cssModule,
  3601. Tag = props.tag,
  3602. addonType = props.addonType,
  3603. children = props.children,
  3604. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "addonType", "children"]);
  3605. var classes = mapToCssModules(classNames(className, 'input-group-' + addonType), cssModule); // Convenience to assist with transition
  3606. if (typeof children === 'string') {
  3607. return React__default.createElement(Tag, _extends({}, attributes, {
  3608. className: classes
  3609. }), React__default.createElement(InputGroupText, {
  3610. children: children
  3611. }));
  3612. }
  3613. return React__default.createElement(Tag, _extends({}, attributes, {
  3614. className: classes,
  3615. children: children
  3616. }));
  3617. };
  3618. InputGroupAddon.propTypes = propTypes$T;
  3619. InputGroupAddon.defaultProps = defaultProps$R;
  3620. var propTypes$U = {
  3621. tag: tagPropType,
  3622. addonType: PropTypes.oneOf(['prepend', 'append']).isRequired,
  3623. children: PropTypes.node,
  3624. groupClassName: PropTypes.string,
  3625. groupAttributes: PropTypes.object,
  3626. className: PropTypes.string,
  3627. cssModule: PropTypes.object
  3628. };
  3629. var InputGroupButton = function InputGroupButton(props) {
  3630. warnOnce('The "InputGroupButton" component has been deprecated.\nPlease use component "InputGroupAddon".');
  3631. var children = props.children,
  3632. groupClassName = props.groupClassName,
  3633. groupAttributes = props.groupAttributes,
  3634. propsWithoutGroup = _objectWithoutPropertiesLoose(props, ["children", "groupClassName", "groupAttributes"]);
  3635. if (typeof children === 'string') {
  3636. var cssModule = propsWithoutGroup.cssModule,
  3637. tag = propsWithoutGroup.tag,
  3638. addonType = propsWithoutGroup.addonType,
  3639. attributes = _objectWithoutPropertiesLoose(propsWithoutGroup, ["cssModule", "tag", "addonType"]);
  3640. var allGroupAttributes = _extends({}, groupAttributes, {
  3641. cssModule: cssModule,
  3642. tag: tag,
  3643. addonType: addonType
  3644. });
  3645. return React__default.createElement(InputGroupAddon, _extends({}, allGroupAttributes, {
  3646. className: groupClassName
  3647. }), React__default.createElement(Button, _extends({}, attributes, {
  3648. children: children
  3649. })));
  3650. }
  3651. return React__default.createElement(InputGroupAddon, _extends({}, props, {
  3652. children: children
  3653. }));
  3654. };
  3655. InputGroupButton.propTypes = propTypes$U;
  3656. var propTypes$V = {
  3657. addonType: PropTypes.oneOf(['prepend', 'append']).isRequired,
  3658. children: PropTypes.node
  3659. };
  3660. var InputGroupButtonDropdown = function InputGroupButtonDropdown(props) {
  3661. return React__default.createElement(Dropdown, props);
  3662. };
  3663. InputGroupButtonDropdown.propTypes = propTypes$V;
  3664. var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl'];
  3665. var stringOrNumberProp$1 = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);
  3666. var columnProps$1 = PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.shape({
  3667. size: stringOrNumberProp$1,
  3668. push: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'),
  3669. pull: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'),
  3670. order: stringOrNumberProp$1,
  3671. offset: stringOrNumberProp$1
  3672. })]);
  3673. var propTypes$W = {
  3674. children: PropTypes.node,
  3675. hidden: PropTypes.bool,
  3676. check: PropTypes.bool,
  3677. size: PropTypes.string,
  3678. for: PropTypes.string,
  3679. tag: tagPropType,
  3680. className: PropTypes.string,
  3681. cssModule: PropTypes.object,
  3682. xs: columnProps$1,
  3683. sm: columnProps$1,
  3684. md: columnProps$1,
  3685. lg: columnProps$1,
  3686. xl: columnProps$1,
  3687. widths: PropTypes.array
  3688. };
  3689. var defaultProps$S = {
  3690. tag: 'label',
  3691. widths: colWidths$1
  3692. };
  3693. var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) {
  3694. if (colSize === true || colSize === '') {
  3695. return isXs ? 'col' : "col-" + colWidth;
  3696. } else if (colSize === 'auto') {
  3697. return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
  3698. }
  3699. return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
  3700. };
  3701. var Label = function Label(props) {
  3702. var className = props.className,
  3703. cssModule = props.cssModule,
  3704. hidden = props.hidden,
  3705. widths = props.widths,
  3706. Tag = props.tag,
  3707. check = props.check,
  3708. size = props.size,
  3709. htmlFor = props.for,
  3710. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "hidden", "widths", "tag", "check", "size", "for"]);
  3711. var colClasses = [];
  3712. widths.forEach(function (colWidth, i) {
  3713. var columnProp = props[colWidth];
  3714. delete attributes[colWidth];
  3715. if (!columnProp && columnProp !== '') {
  3716. return;
  3717. }
  3718. var isXs = !i;
  3719. var colClass;
  3720. if (isobject(columnProp)) {
  3721. var _classNames;
  3722. var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
  3723. colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size);
  3724. colClasses.push(mapToCssModules(classNames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames["order" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames["offset" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames))), cssModule);
  3725. } else {
  3726. colClass = getColumnSizeClass$1(isXs, colWidth, columnProp);
  3727. colClasses.push(colClass);
  3728. }
  3729. });
  3730. var classes = mapToCssModules(classNames(className, hidden ? 'sr-only' : false, check ? 'form-check-label' : false, size ? "col-form-label-" + size : false, colClasses, colClasses.length ? 'col-form-label' : false), cssModule);
  3731. return React__default.createElement(Tag, _extends({
  3732. htmlFor: htmlFor
  3733. }, attributes, {
  3734. className: classes
  3735. }));
  3736. };
  3737. Label.propTypes = propTypes$W;
  3738. Label.defaultProps = defaultProps$S;
  3739. var propTypes$X = {
  3740. body: PropTypes.bool,
  3741. bottom: PropTypes.bool,
  3742. children: PropTypes.node,
  3743. className: PropTypes.string,
  3744. cssModule: PropTypes.object,
  3745. heading: PropTypes.bool,
  3746. left: PropTypes.bool,
  3747. list: PropTypes.bool,
  3748. middle: PropTypes.bool,
  3749. object: PropTypes.bool,
  3750. right: PropTypes.bool,
  3751. tag: tagPropType,
  3752. top: PropTypes.bool
  3753. };
  3754. var Media = function Media(props) {
  3755. var body = props.body,
  3756. bottom = props.bottom,
  3757. className = props.className,
  3758. cssModule = props.cssModule,
  3759. heading = props.heading,
  3760. left = props.left,
  3761. list = props.list,
  3762. middle = props.middle,
  3763. object = props.object,
  3764. right = props.right,
  3765. tag = props.tag,
  3766. top = props.top,
  3767. attributes = _objectWithoutPropertiesLoose(props, ["body", "bottom", "className", "cssModule", "heading", "left", "list", "middle", "object", "right", "tag", "top"]);
  3768. var defaultTag;
  3769. if (heading) {
  3770. defaultTag = 'h4';
  3771. } else if (attributes.href) {
  3772. defaultTag = 'a';
  3773. } else if (attributes.src || object) {
  3774. defaultTag = 'img';
  3775. } else if (list) {
  3776. defaultTag = 'ul';
  3777. } else {
  3778. defaultTag = 'div';
  3779. }
  3780. var Tag = tag || defaultTag;
  3781. var classes = mapToCssModules(classNames(className, {
  3782. 'media-body': body,
  3783. 'media-heading': heading,
  3784. 'media-left': left,
  3785. 'media-right': right,
  3786. 'media-top': top,
  3787. 'media-bottom': bottom,
  3788. 'media-middle': middle,
  3789. 'media-object': object,
  3790. 'media-list': list,
  3791. media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list
  3792. }), cssModule);
  3793. return React__default.createElement(Tag, _extends({}, attributes, {
  3794. className: classes
  3795. }));
  3796. };
  3797. Media.propTypes = propTypes$X;
  3798. var propTypes$Y = {
  3799. children: PropTypes.node,
  3800. className: PropTypes.string,
  3801. listClassName: PropTypes.string,
  3802. cssModule: PropTypes.object,
  3803. size: PropTypes.string,
  3804. tag: tagPropType,
  3805. listTag: tagPropType,
  3806. 'aria-label': PropTypes.string
  3807. };
  3808. var defaultProps$T = {
  3809. tag: 'nav',
  3810. listTag: 'ul',
  3811. 'aria-label': 'pagination'
  3812. };
  3813. var Pagination = function Pagination(props) {
  3814. var _classNames;
  3815. var className = props.className,
  3816. listClassName = props.listClassName,
  3817. cssModule = props.cssModule,
  3818. size = props.size,
  3819. Tag = props.tag,
  3820. ListTag = props.listTag,
  3821. label = props['aria-label'],
  3822. attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"]);
  3823. var classes = mapToCssModules(classNames(className), cssModule);
  3824. var listClasses = mapToCssModules(classNames(listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
  3825. return React__default.createElement(Tag, {
  3826. className: classes,
  3827. "aria-label": label
  3828. }, React__default.createElement(ListTag, _extends({}, attributes, {
  3829. className: listClasses
  3830. })));
  3831. };
  3832. Pagination.propTypes = propTypes$Y;
  3833. Pagination.defaultProps = defaultProps$T;
  3834. var propTypes$Z = {
  3835. active: PropTypes.bool,
  3836. children: PropTypes.node,
  3837. className: PropTypes.string,
  3838. cssModule: PropTypes.object,
  3839. disabled: PropTypes.bool,
  3840. tag: tagPropType
  3841. };
  3842. var defaultProps$U = {
  3843. tag: 'li'
  3844. };
  3845. var PaginationItem = function PaginationItem(props) {
  3846. var active = props.active,
  3847. className = props.className,
  3848. cssModule = props.cssModule,
  3849. disabled = props.disabled,
  3850. Tag = props.tag,
  3851. attributes = _objectWithoutPropertiesLoose(props, ["active", "className", "cssModule", "disabled", "tag"]);
  3852. var classes = mapToCssModules(classNames(className, 'page-item', {
  3853. active: active,
  3854. disabled: disabled
  3855. }), cssModule);
  3856. return React__default.createElement(Tag, _extends({}, attributes, {
  3857. className: classes
  3858. }));
  3859. };
  3860. PaginationItem.propTypes = propTypes$Z;
  3861. PaginationItem.defaultProps = defaultProps$U;
  3862. var propTypes$_ = {
  3863. 'aria-label': PropTypes.string,
  3864. children: PropTypes.node,
  3865. className: PropTypes.string,
  3866. cssModule: PropTypes.object,
  3867. next: PropTypes.bool,
  3868. previous: PropTypes.bool,
  3869. tag: tagPropType
  3870. };
  3871. var defaultProps$V = {
  3872. tag: 'a'
  3873. };
  3874. var PaginationLink = function PaginationLink(props) {
  3875. var className = props.className,
  3876. cssModule = props.cssModule,
  3877. next = props.next,
  3878. previous = props.previous,
  3879. Tag = props.tag,
  3880. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "next", "previous", "tag"]);
  3881. var classes = mapToCssModules(classNames(className, 'page-link'), cssModule);
  3882. var defaultAriaLabel;
  3883. if (previous) {
  3884. defaultAriaLabel = 'Previous';
  3885. } else if (next) {
  3886. defaultAriaLabel = 'Next';
  3887. }
  3888. var ariaLabel = props['aria-label'] || defaultAriaLabel;
  3889. var defaultCaret;
  3890. if (previous) {
  3891. defaultCaret = "\xAB";
  3892. } else if (next) {
  3893. defaultCaret = "\xBB";
  3894. }
  3895. var children = props.children;
  3896. if (children && Array.isArray(children) && children.length === 0) {
  3897. children = null;
  3898. }
  3899. if (!attributes.href && Tag === 'a') {
  3900. Tag = 'button';
  3901. }
  3902. if (previous || next) {
  3903. children = [React__default.createElement("span", {
  3904. "aria-hidden": "true",
  3905. key: "caret"
  3906. }, children || defaultCaret), React__default.createElement("span", {
  3907. className: "sr-only",
  3908. key: "sr"
  3909. }, ariaLabel)];
  3910. }
  3911. return React__default.createElement(Tag, _extends({}, attributes, {
  3912. className: classes,
  3913. "aria-label": ariaLabel
  3914. }), children);
  3915. };
  3916. PaginationLink.propTypes = propTypes$_;
  3917. PaginationLink.defaultProps = defaultProps$V;
  3918. var propTypes$10 = {
  3919. tag: tagPropType,
  3920. activeTab: PropTypes.any,
  3921. className: PropTypes.string,
  3922. cssModule: PropTypes.object
  3923. };
  3924. var defaultProps$W = {
  3925. tag: 'div'
  3926. };
  3927. var childContextTypes$2 = {
  3928. activeTabId: PropTypes.any
  3929. };
  3930. var TabContent =
  3931. /*#__PURE__*/
  3932. function (_Component) {
  3933. _inheritsLoose(TabContent, _Component);
  3934. TabContent.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
  3935. if (prevState.activeTab !== nextProps.activeTab) {
  3936. return {
  3937. activeTab: nextProps.activeTab
  3938. };
  3939. }
  3940. return null;
  3941. };
  3942. function TabContent(props) {
  3943. var _this;
  3944. _this = _Component.call(this, props) || this;
  3945. _this.state = {
  3946. activeTab: _this.props.activeTab
  3947. };
  3948. return _this;
  3949. }
  3950. var _proto = TabContent.prototype;
  3951. _proto.getChildContext = function getChildContext() {
  3952. return {
  3953. activeTabId: this.state.activeTab
  3954. };
  3955. };
  3956. _proto.render = function render() {
  3957. var _this$props = this.props,
  3958. className = _this$props.className,
  3959. cssModule = _this$props.cssModule,
  3960. Tag = _this$props.tag;
  3961. var attributes = omit(this.props, Object.keys(propTypes$10));
  3962. var classes = mapToCssModules(classNames('tab-content', className), cssModule);
  3963. return React__default.createElement(Tag, _extends({}, attributes, {
  3964. className: classes
  3965. }));
  3966. };
  3967. return TabContent;
  3968. }(React.Component);
  3969. reactLifecyclesCompat.polyfill(TabContent);
  3970. TabContent.propTypes = propTypes$10;
  3971. TabContent.defaultProps = defaultProps$W;
  3972. TabContent.childContextTypes = childContextTypes$2;
  3973. var propTypes$11 = {
  3974. tag: tagPropType,
  3975. className: PropTypes.string,
  3976. cssModule: PropTypes.object,
  3977. tabId: PropTypes.any
  3978. };
  3979. var defaultProps$X = {
  3980. tag: 'div'
  3981. };
  3982. var contextTypes$3 = {
  3983. activeTabId: PropTypes.any
  3984. };
  3985. function TabPane(props, context) {
  3986. var className = props.className,
  3987. cssModule = props.cssModule,
  3988. tabId = props.tabId,
  3989. Tag = props.tag,
  3990. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabId", "tag"]);
  3991. var classes = mapToCssModules(classNames('tab-pane', className, {
  3992. active: tabId === context.activeTabId
  3993. }), cssModule);
  3994. return React__default.createElement(Tag, _extends({}, attributes, {
  3995. className: classes
  3996. }));
  3997. }
  3998. TabPane.propTypes = propTypes$11;
  3999. TabPane.defaultProps = defaultProps$X;
  4000. TabPane.contextTypes = contextTypes$3;
  4001. var propTypes$12 = {
  4002. tag: tagPropType,
  4003. fluid: PropTypes.bool,
  4004. className: PropTypes.string,
  4005. cssModule: PropTypes.object
  4006. };
  4007. var defaultProps$Y = {
  4008. tag: 'div'
  4009. };
  4010. var Jumbotron = function Jumbotron(props) {
  4011. var className = props.className,
  4012. cssModule = props.cssModule,
  4013. Tag = props.tag,
  4014. fluid = props.fluid,
  4015. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "fluid"]);
  4016. var classes = mapToCssModules(classNames(className, 'jumbotron', fluid ? 'jumbotron-fluid' : false), cssModule);
  4017. return React__default.createElement(Tag, _extends({}, attributes, {
  4018. className: classes
  4019. }));
  4020. };
  4021. Jumbotron.propTypes = propTypes$12;
  4022. Jumbotron.defaultProps = defaultProps$Y;
  4023. var propTypes$13 = {
  4024. children: PropTypes.node,
  4025. className: PropTypes.string,
  4026. closeClassName: PropTypes.string,
  4027. closeAriaLabel: PropTypes.string,
  4028. cssModule: PropTypes.object,
  4029. color: PropTypes.string,
  4030. fade: PropTypes.bool,
  4031. isOpen: PropTypes.bool,
  4032. toggle: PropTypes.func,
  4033. tag: tagPropType,
  4034. transition: PropTypes.shape(Fade.propTypes),
  4035. innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
  4036. };
  4037. var defaultProps$Z = {
  4038. color: 'success',
  4039. isOpen: true,
  4040. tag: 'div',
  4041. closeAriaLabel: 'Close',
  4042. fade: true,
  4043. transition: _extends({}, Fade.defaultProps, {
  4044. unmountOnExit: true
  4045. })
  4046. };
  4047. function Alert(props) {
  4048. var className = props.className,
  4049. closeClassName = props.closeClassName,
  4050. closeAriaLabel = props.closeAriaLabel,
  4051. cssModule = props.cssModule,
  4052. Tag = props.tag,
  4053. color = props.color,
  4054. isOpen = props.isOpen,
  4055. toggle = props.toggle,
  4056. children = props.children,
  4057. transition = props.transition,
  4058. fade = props.fade,
  4059. innerRef = props.innerRef,
  4060. attributes = _objectWithoutPropertiesLoose(props, ["className", "closeClassName", "closeAriaLabel", "cssModule", "tag", "color", "isOpen", "toggle", "children", "transition", "fade", "innerRef"]);
  4061. var classes = mapToCssModules(classNames(className, 'alert', "alert-" + color, {
  4062. 'alert-dismissible': toggle
  4063. }), cssModule);
  4064. var closeClasses = mapToCssModules(classNames('close', closeClassName), cssModule);
  4065. var alertTransition = _extends({}, Fade.defaultProps, transition, {
  4066. baseClass: fade ? transition.baseClass : '',
  4067. timeout: fade ? transition.timeout : 0
  4068. });
  4069. return React__default.createElement(Fade, _extends({}, attributes, alertTransition, {
  4070. tag: Tag,
  4071. className: classes,
  4072. in: isOpen,
  4073. role: "alert",
  4074. innerRef: innerRef
  4075. }), toggle ? React__default.createElement("button", {
  4076. type: "button",
  4077. className: closeClasses,
  4078. "aria-label": closeAriaLabel,
  4079. onClick: toggle
  4080. }, React__default.createElement("span", {
  4081. "aria-hidden": "true"
  4082. }, "\xD7")) : null, children);
  4083. }
  4084. Alert.propTypes = propTypes$13;
  4085. Alert.defaultProps = defaultProps$Z;
  4086. var _transitionStatusToCl;
  4087. var propTypes$14 = _extends({}, reactTransitionGroup.Transition.propTypes, {
  4088. isOpen: PropTypes.bool,
  4089. children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
  4090. tag: tagPropType,
  4091. className: PropTypes.node,
  4092. navbar: PropTypes.bool,
  4093. cssModule: PropTypes.object,
  4094. innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object])
  4095. });
  4096. var defaultProps$_ = _extends({}, reactTransitionGroup.Transition.defaultProps, {
  4097. isOpen: false,
  4098. appear: false,
  4099. enter: true,
  4100. exit: true,
  4101. tag: 'div',
  4102. timeout: TransitionTimeouts.Collapse
  4103. });
  4104. var transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);
  4105. function getTransitionClass(status) {
  4106. return transitionStatusToClassHash[status] || 'collapse';
  4107. }
  4108. function getHeight(node) {
  4109. return node.scrollHeight;
  4110. }
  4111. var Collapse =
  4112. /*#__PURE__*/
  4113. function (_Component) {
  4114. _inheritsLoose(Collapse, _Component);
  4115. function Collapse(props) {
  4116. var _this;
  4117. _this = _Component.call(this, props) || this;
  4118. _this.state = {
  4119. height: null
  4120. };
  4121. ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {
  4122. _this[name] = _this[name].bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4123. });
  4124. return _this;
  4125. }
  4126. var _proto = Collapse.prototype;
  4127. _proto.onEntering = function onEntering(node, isAppearing) {
  4128. this.setState({
  4129. height: getHeight(node)
  4130. });
  4131. this.props.onEntering(node, isAppearing);
  4132. };
  4133. _proto.onEntered = function onEntered(node, isAppearing) {
  4134. this.setState({
  4135. height: null
  4136. });
  4137. this.props.onEntered(node, isAppearing);
  4138. };
  4139. _proto.onExit = function onExit(node) {
  4140. this.setState({
  4141. height: getHeight(node)
  4142. });
  4143. this.props.onExit(node);
  4144. };
  4145. _proto.onExiting = function onExiting(node) {
  4146. // getting this variable triggers a reflow
  4147. var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars
  4148. this.setState({
  4149. height: 0
  4150. });
  4151. this.props.onExiting(node);
  4152. };
  4153. _proto.onExited = function onExited(node) {
  4154. this.setState({
  4155. height: null
  4156. });
  4157. this.props.onExited(node);
  4158. };
  4159. _proto.render = function render() {
  4160. var _this2 = this;
  4161. var _this$props = this.props,
  4162. Tag = _this$props.tag,
  4163. isOpen = _this$props.isOpen,
  4164. className = _this$props.className,
  4165. navbar = _this$props.navbar,
  4166. cssModule = _this$props.cssModule,
  4167. children = _this$props.children,
  4168. innerRef = _this$props.innerRef,
  4169. otherProps = _objectWithoutPropertiesLoose(_this$props, ["tag", "isOpen", "className", "navbar", "cssModule", "children", "innerRef"]);
  4170. var height = this.state.height;
  4171. var transitionProps = pick(otherProps, TransitionPropTypeKeys);
  4172. var childProps = omit(otherProps, TransitionPropTypeKeys);
  4173. return React__default.createElement(reactTransitionGroup.Transition, _extends({}, transitionProps, {
  4174. in: isOpen,
  4175. onEntering: this.onEntering,
  4176. onEntered: this.onEntered,
  4177. onExit: this.onExit,
  4178. onExiting: this.onExiting,
  4179. onExited: this.onExited
  4180. }), function (status) {
  4181. var collapseClass = getTransitionClass(status);
  4182. var classes = mapToCssModules(classNames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);
  4183. var style = height === null ? null : {
  4184. height: height
  4185. };
  4186. return React__default.createElement(Tag, _extends({}, childProps, {
  4187. style: _extends({}, childProps.style, style),
  4188. className: classes,
  4189. ref: _this2.props.innerRef
  4190. }), children);
  4191. });
  4192. };
  4193. return Collapse;
  4194. }(React.Component);
  4195. Collapse.propTypes = propTypes$14;
  4196. Collapse.defaultProps = defaultProps$_;
  4197. var propTypes$15 = {
  4198. tag: tagPropType,
  4199. active: PropTypes.bool,
  4200. disabled: PropTypes.bool,
  4201. color: PropTypes.string,
  4202. action: PropTypes.bool,
  4203. className: PropTypes.any,
  4204. cssModule: PropTypes.object
  4205. };
  4206. var defaultProps$10 = {
  4207. tag: 'li'
  4208. };
  4209. var handleDisabledOnClick = function handleDisabledOnClick(e) {
  4210. e.preventDefault();
  4211. };
  4212. var ListGroupItem = function ListGroupItem(props) {
  4213. var className = props.className,
  4214. cssModule = props.cssModule,
  4215. Tag = props.tag,
  4216. active = props.active,
  4217. disabled = props.disabled,
  4218. action = props.action,
  4219. color = props.color,
  4220. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "active", "disabled", "action", "color"]);
  4221. var classes = mapToCssModules(classNames(className, active ? 'active' : false, disabled ? 'disabled' : false, action ? 'list-group-item-action' : false, color ? "list-group-item-" + color : false, 'list-group-item'), cssModule); // Prevent click event when disabled.
  4222. if (disabled) {
  4223. attributes.onClick = handleDisabledOnClick;
  4224. }
  4225. return React__default.createElement(Tag, _extends({}, attributes, {
  4226. className: classes
  4227. }));
  4228. };
  4229. ListGroupItem.propTypes = propTypes$15;
  4230. ListGroupItem.defaultProps = defaultProps$10;
  4231. var propTypes$16 = {
  4232. tag: tagPropType,
  4233. className: PropTypes.any,
  4234. cssModule: PropTypes.object
  4235. };
  4236. var defaultProps$11 = {
  4237. tag: 'h5'
  4238. };
  4239. var ListGroupItemHeading = function ListGroupItemHeading(props) {
  4240. var className = props.className,
  4241. cssModule = props.cssModule,
  4242. Tag = props.tag,
  4243. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  4244. var classes = mapToCssModules(classNames(className, 'list-group-item-heading'), cssModule);
  4245. return React__default.createElement(Tag, _extends({}, attributes, {
  4246. className: classes
  4247. }));
  4248. };
  4249. ListGroupItemHeading.propTypes = propTypes$16;
  4250. ListGroupItemHeading.defaultProps = defaultProps$11;
  4251. var propTypes$17 = {
  4252. tag: tagPropType,
  4253. className: PropTypes.any,
  4254. cssModule: PropTypes.object
  4255. };
  4256. var defaultProps$12 = {
  4257. tag: 'p'
  4258. };
  4259. var ListGroupItemText = function ListGroupItemText(props) {
  4260. var className = props.className,
  4261. cssModule = props.cssModule,
  4262. Tag = props.tag,
  4263. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  4264. var classes = mapToCssModules(classNames(className, 'list-group-item-text'), cssModule);
  4265. return React__default.createElement(Tag, _extends({}, attributes, {
  4266. className: classes
  4267. }));
  4268. };
  4269. ListGroupItemText.propTypes = propTypes$17;
  4270. ListGroupItemText.defaultProps = defaultProps$12;
  4271. var UncontrolledAlert =
  4272. /*#__PURE__*/
  4273. function (_Component) {
  4274. _inheritsLoose(UncontrolledAlert, _Component);
  4275. function UncontrolledAlert(props) {
  4276. var _this;
  4277. _this = _Component.call(this, props) || this;
  4278. _this.state = {
  4279. isOpen: true
  4280. };
  4281. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4282. return _this;
  4283. }
  4284. var _proto = UncontrolledAlert.prototype;
  4285. _proto.toggle = function toggle() {
  4286. this.setState({
  4287. isOpen: !this.state.isOpen
  4288. });
  4289. };
  4290. _proto.render = function render() {
  4291. return React__default.createElement(Alert, _extends({
  4292. isOpen: this.state.isOpen,
  4293. toggle: this.toggle
  4294. }, this.props));
  4295. };
  4296. return UncontrolledAlert;
  4297. }(React.Component);
  4298. var omitKeys$1 = ['defaultOpen'];
  4299. var UncontrolledButtonDropdown =
  4300. /*#__PURE__*/
  4301. function (_Component) {
  4302. _inheritsLoose(UncontrolledButtonDropdown, _Component);
  4303. function UncontrolledButtonDropdown(props) {
  4304. var _this;
  4305. _this = _Component.call(this, props) || this;
  4306. _this.state = {
  4307. isOpen: props.defaultOpen || false
  4308. };
  4309. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4310. return _this;
  4311. }
  4312. var _proto = UncontrolledButtonDropdown.prototype;
  4313. _proto.toggle = function toggle() {
  4314. this.setState({
  4315. isOpen: !this.state.isOpen
  4316. });
  4317. };
  4318. _proto.render = function render() {
  4319. return React__default.createElement(ButtonDropdown, _extends({
  4320. isOpen: this.state.isOpen,
  4321. toggle: this.toggle
  4322. }, omit(this.props, omitKeys$1)));
  4323. };
  4324. return UncontrolledButtonDropdown;
  4325. }(React.Component);
  4326. UncontrolledButtonDropdown.propTypes = _extends({
  4327. defaultOpen: PropTypes.bool
  4328. }, ButtonDropdown.propTypes);
  4329. var omitKeys$2 = ['toggleEvents', 'defaultOpen'];
  4330. var propTypes$18 = {
  4331. defaultOpen: PropTypes.bool,
  4332. toggler: PropTypes.string.isRequired,
  4333. toggleEvents: PropTypes.arrayOf(PropTypes.string)
  4334. };
  4335. var defaultProps$13 = {
  4336. toggleEvents: defaultToggleEvents
  4337. };
  4338. var UncontrolledCollapse =
  4339. /*#__PURE__*/
  4340. function (_Component) {
  4341. _inheritsLoose(UncontrolledCollapse, _Component);
  4342. function UncontrolledCollapse(props) {
  4343. var _this;
  4344. _this = _Component.call(this, props) || this;
  4345. _this.togglers = null;
  4346. _this.removeEventListeners = null;
  4347. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4348. _this.state = {
  4349. isOpen: props.defaultOpen || false
  4350. };
  4351. return _this;
  4352. }
  4353. var _proto = UncontrolledCollapse.prototype;
  4354. _proto.componentDidMount = function componentDidMount() {
  4355. this.togglers = findDOMElements(this.props.toggler);
  4356. if (this.togglers.length) {
  4357. this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);
  4358. }
  4359. };
  4360. _proto.componentWillUnmount = function componentWillUnmount() {
  4361. if (this.togglers.length && this.removeEventListeners) {
  4362. this.removeEventListeners();
  4363. }
  4364. };
  4365. _proto.toggle = function toggle(e) {
  4366. this.setState(function (_ref) {
  4367. var isOpen = _ref.isOpen;
  4368. return {
  4369. isOpen: !isOpen
  4370. };
  4371. });
  4372. e.preventDefault();
  4373. };
  4374. _proto.render = function render() {
  4375. return React__default.createElement(Collapse, _extends({
  4376. isOpen: this.state.isOpen
  4377. }, omit(this.props, omitKeys$2)));
  4378. };
  4379. return UncontrolledCollapse;
  4380. }(React.Component);
  4381. UncontrolledCollapse.propTypes = propTypes$18;
  4382. UncontrolledCollapse.defaultProps = defaultProps$13;
  4383. var omitKeys$3 = ['defaultOpen'];
  4384. var UncontrolledDropdown =
  4385. /*#__PURE__*/
  4386. function (_Component) {
  4387. _inheritsLoose(UncontrolledDropdown, _Component);
  4388. function UncontrolledDropdown(props) {
  4389. var _this;
  4390. _this = _Component.call(this, props) || this;
  4391. _this.state = {
  4392. isOpen: props.defaultOpen || false
  4393. };
  4394. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4395. return _this;
  4396. }
  4397. var _proto = UncontrolledDropdown.prototype;
  4398. _proto.toggle = function toggle() {
  4399. this.setState({
  4400. isOpen: !this.state.isOpen
  4401. });
  4402. };
  4403. _proto.render = function render() {
  4404. return React__default.createElement(Dropdown, _extends({
  4405. isOpen: this.state.isOpen,
  4406. toggle: this.toggle
  4407. }, omit(this.props, omitKeys$3)));
  4408. };
  4409. return UncontrolledDropdown;
  4410. }(React.Component);
  4411. UncontrolledDropdown.propTypes = _extends({
  4412. defaultOpen: PropTypes.bool
  4413. }, Dropdown.propTypes);
  4414. var UncontrolledNavDropdown = function UncontrolledNavDropdown(props) {
  4415. warnOnce('The "UncontrolledNavDropdown" component has been deprecated.\nPlease use component "UncontrolledDropdown" with nav prop.');
  4416. return React__default.createElement(UncontrolledDropdown, _extends({
  4417. nav: true
  4418. }, props));
  4419. };
  4420. var omitKeys$4 = ['defaultOpen'];
  4421. var UncontrolledTooltip =
  4422. /*#__PURE__*/
  4423. function (_Component) {
  4424. _inheritsLoose(UncontrolledTooltip, _Component);
  4425. function UncontrolledTooltip(props) {
  4426. var _this;
  4427. _this = _Component.call(this, props) || this;
  4428. _this.state = {
  4429. isOpen: props.defaultOpen || false
  4430. };
  4431. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4432. return _this;
  4433. }
  4434. var _proto = UncontrolledTooltip.prototype;
  4435. _proto.toggle = function toggle() {
  4436. this.setState({
  4437. isOpen: !this.state.isOpen
  4438. });
  4439. };
  4440. _proto.render = function render() {
  4441. return React__default.createElement(Tooltip, _extends({
  4442. isOpen: this.state.isOpen,
  4443. toggle: this.toggle
  4444. }, omit(this.props, omitKeys$4)));
  4445. };
  4446. return UncontrolledTooltip;
  4447. }(React.Component);
  4448. UncontrolledTooltip.propTypes = _extends({
  4449. defaultOpen: PropTypes.bool
  4450. }, Tooltip.propTypes);
  4451. var propTypes$19 = {
  4452. tag: tagPropType,
  4453. type: PropTypes.string,
  4454. size: PropTypes.string,
  4455. color: PropTypes.string,
  4456. className: PropTypes.string,
  4457. cssModule: PropTypes.object,
  4458. children: PropTypes.string
  4459. };
  4460. var defaultProps$14 = {
  4461. tag: 'div',
  4462. type: 'border',
  4463. children: 'Loading...'
  4464. };
  4465. var Spinner = function Spinner(props) {
  4466. var className = props.className,
  4467. cssModule = props.cssModule,
  4468. type = props.type,
  4469. size = props.size,
  4470. color = props.color,
  4471. children = props.children,
  4472. Tag = props.tag,
  4473. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "type", "size", "color", "children", "tag"]);
  4474. var classes = mapToCssModules(classNames(className, size ? "spinner-" + type + "-" + size : false, "spinner-" + type, color ? "text-" + color : false), cssModule);
  4475. return React__default.createElement(Tag, _extends({
  4476. role: "status"
  4477. }, attributes, {
  4478. className: classes
  4479. }), children && React__default.createElement("span", {
  4480. className: mapToCssModules('sr-only', cssModule)
  4481. }, children));
  4482. };
  4483. Spinner.propTypes = propTypes$19;
  4484. Spinner.defaultProps = defaultProps$14;
  4485. exports.Container = Container;
  4486. exports.Row = Row;
  4487. exports.Col = Col;
  4488. exports.Navbar = Navbar;
  4489. exports.NavbarBrand = NavbarBrand;
  4490. exports.NavbarToggler = NavbarToggler;
  4491. exports.Nav = Nav;
  4492. exports.NavItem = NavItem;
  4493. exports.NavDropdown = NavDropdown;
  4494. exports.NavLink = NavLink;
  4495. exports.Breadcrumb = Breadcrumb;
  4496. exports.BreadcrumbItem = BreadcrumbItem;
  4497. exports.Button = Button;
  4498. exports.ButtonDropdown = ButtonDropdown;
  4499. exports.ButtonGroup = ButtonGroup;
  4500. exports.ButtonToolbar = ButtonToolbar;
  4501. exports.Dropdown = Dropdown;
  4502. exports.DropdownItem = DropdownItem;
  4503. exports.DropdownMenu = DropdownMenu;
  4504. exports.DropdownToggle = DropdownToggle;
  4505. exports.Fade = Fade;
  4506. exports.Badge = Badge;
  4507. exports.Card = Card;
  4508. exports.CardGroup = CardGroup;
  4509. exports.CardDeck = CardDeck;
  4510. exports.CardColumns = CardColumns;
  4511. exports.CardBody = CardBody;
  4512. exports.CardBlock = CardBlock;
  4513. exports.CardLink = CardLink;
  4514. exports.CardFooter = CardFooter;
  4515. exports.CardHeader = CardHeader;
  4516. exports.CardImg = CardImg;
  4517. exports.CardImgOverlay = CardImgOverlay;
  4518. exports.Carousel = Carousel;
  4519. exports.UncontrolledCarousel = UncontrolledCarousel;
  4520. exports.CarouselControl = CarouselControl;
  4521. exports.CarouselItem = CarouselItem;
  4522. exports.CarouselIndicators = CarouselIndicators;
  4523. exports.CarouselCaption = CarouselCaption;
  4524. exports.CardSubtitle = CardSubtitle;
  4525. exports.CardText = CardText;
  4526. exports.CardTitle = CardTitle;
  4527. exports.CustomInput = CustomInput;
  4528. exports.PopperContent = PopperContent;
  4529. exports.PopperTargetHelper = PopperTargetHelper;
  4530. exports.Popover = Popover;
  4531. exports.UncontrolledPopover = UncontrolledPopover;
  4532. exports.PopoverHeader = PopoverHeader;
  4533. exports.PopoverTitle = PopoverTitle;
  4534. exports.PopoverBody = PopoverBody;
  4535. exports.PopoverContent = PopoverContent;
  4536. exports.Progress = Progress;
  4537. exports.Modal = Modal;
  4538. exports.ModalHeader = ModalHeader;
  4539. exports.ModalBody = ModalBody;
  4540. exports.ModalFooter = ModalFooter;
  4541. exports.Tooltip = Tooltip;
  4542. exports.Table = Table;
  4543. exports.ListGroup = ListGroup;
  4544. exports.Form = Form;
  4545. exports.FormFeedback = FormFeedback;
  4546. exports.FormGroup = FormGroup;
  4547. exports.FormText = FormText;
  4548. exports.Input = Input;
  4549. exports.InputGroup = InputGroup;
  4550. exports.InputGroupAddon = InputGroupAddon;
  4551. exports.InputGroupButton = InputGroupButton;
  4552. exports.InputGroupButtonDropdown = InputGroupButtonDropdown;
  4553. exports.InputGroupText = InputGroupText;
  4554. exports.Label = Label;
  4555. exports.Media = Media;
  4556. exports.Pagination = Pagination;
  4557. exports.PaginationItem = PaginationItem;
  4558. exports.PaginationLink = PaginationLink;
  4559. exports.TabContent = TabContent;
  4560. exports.TabPane = TabPane;
  4561. exports.Jumbotron = Jumbotron;
  4562. exports.Alert = Alert;
  4563. exports.Collapse = Collapse;
  4564. exports.ListGroupItem = ListGroupItem;
  4565. exports.ListGroupItemHeading = ListGroupItemHeading;
  4566. exports.ListGroupItemText = ListGroupItemText;
  4567. exports.UncontrolledAlert = UncontrolledAlert;
  4568. exports.UncontrolledButtonDropdown = UncontrolledButtonDropdown;
  4569. exports.UncontrolledCollapse = UncontrolledCollapse;
  4570. exports.UncontrolledDropdown = UncontrolledDropdown;
  4571. exports.UncontrolledNavDropdown = UncontrolledNavDropdown;
  4572. exports.UncontrolledTooltip = UncontrolledTooltip;
  4573. exports.Spinner = Spinner;
  4574. exports.Util = utils;
  4575. //# sourceMappingURL=reactstrap.cjs.js.map