|
- import React, { Component } from 'react';
- import PropTypes from 'prop-types';
- import classNames from 'classnames';
- import isFunction from 'lodash.isfunction';
- import isobject from 'lodash.isobject';
- import ReactDOM from 'react-dom';
- import { Manager, Popper, Target, Arrow } from 'react-popper';
- import { Transition } from 'react-transition-group';
- import toNumber from 'lodash.tonumber';
- import { polyfill } from 'react-lifecycles-compat';
-
- function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
- }
-
- function _inheritsLoose(subClass, superClass) {
- subClass.prototype = Object.create(superClass.prototype);
- subClass.prototype.constructor = subClass;
- subClass.__proto__ = superClass;
- }
-
- function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
-
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
-
- return target;
- }
-
- function _assertThisInitialized(self) {
- if (self === void 0) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
-
- return self;
- }
-
- function getScrollbarWidth() {
- 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
-
- scrollDiv.style.position = 'absolute';
- scrollDiv.style.top = '-9999px';
- scrollDiv.style.width = '50px';
- scrollDiv.style.height = '50px';
- scrollDiv.style.overflow = 'scroll';
- document.body.appendChild(scrollDiv);
- var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
- document.body.removeChild(scrollDiv);
- return scrollbarWidth;
- }
- function setScrollbarWidth(padding) {
- document.body.style.paddingRight = padding > 0 ? padding + "px" : null;
- }
- function isBodyOverflowing() {
- return document.body.clientWidth < window.innerWidth;
- }
- function getOriginalBodyPadding() {
- var style = window.getComputedStyle(document.body, null);
- return parseInt(style && style.getPropertyValue('padding-right') || 0, 10);
- }
- function conditionallyUpdateScrollbar() {
- var scrollbarWidth = getScrollbarWidth(); // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.6/js/src/modal.js#L433
-
- var fixedContent = document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')[0];
- var bodyPadding = fixedContent ? parseInt(fixedContent.style.paddingRight || 0, 10) : 0;
-
- if (isBodyOverflowing()) {
- setScrollbarWidth(bodyPadding + scrollbarWidth);
- }
- }
- var globalCssModule;
- function setGlobalCssModule(cssModule) {
- globalCssModule = cssModule;
- }
- function mapToCssModules(className, cssModule) {
- if (className === void 0) {
- className = '';
- }
-
- if (cssModule === void 0) {
- cssModule = globalCssModule;
- }
-
- if (!cssModule) return className;
- return className.split(' ').map(function (c) {
- return cssModule[c] || c;
- }).join(' ');
- }
- /**
- * Returns a new object with the key/value pairs from `obj` that are not in the array `omitKeys`.
- */
-
- function omit(obj, omitKeys) {
- var result = {};
- Object.keys(obj).forEach(function (key) {
- if (omitKeys.indexOf(key) === -1) {
- result[key] = obj[key];
- }
- });
- return result;
- }
- /**
- * Returns a filtered copy of an object with only the specified keys.
- */
-
- function pick(obj, keys) {
- var pickKeys = Array.isArray(keys) ? keys : [keys];
- var length = pickKeys.length;
- var key;
- var result = {};
-
- while (length > 0) {
- length -= 1;
- key = pickKeys[length];
- result[key] = obj[key];
- }
-
- return result;
- }
- var warned = {};
- function warnOnce(message) {
- if (!warned[message]) {
- /* istanbul ignore else */
- if (typeof console !== 'undefined') {
- console.error(message); // eslint-disable-line no-console
- }
-
- warned[message] = true;
- }
- }
- function deprecated(propType, explanation) {
- return function validate(props, propName, componentName) {
- if (props[propName] !== null && typeof props[propName] !== 'undefined') {
- warnOnce("\"" + propName + "\" property of \"" + componentName + "\" has been deprecated.\n" + explanation);
- }
-
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
- rest[_key - 3] = arguments[_key];
- }
-
- return propType.apply(void 0, [props, propName, componentName].concat(rest));
- };
- }
- function DOMElement(props, propName, componentName) {
- if (!(props[propName] instanceof Element)) {
- return new Error('Invalid prop `' + propName + '` supplied to `' + componentName + '`. Expected prop to be an instance of Element. Validation failed.');
- }
- }
- var targetPropType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, DOMElement, PropTypes.shape({
- current: PropTypes.any
- })]);
- var tagPropType = PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.shape({
- $$typeof: PropTypes.symbol,
- render: PropTypes.func
- }), PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.shape({
- $$typeof: PropTypes.symbol,
- render: PropTypes.func
- })]))]);
- /* eslint key-spacing: ["error", { afterColon: true, align: "value" }] */
- // These are all setup to match what is in the bootstrap _variables.scss
- // https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss
-
- var TransitionTimeouts = {
- Fade: 150,
- // $transition-fade
- Collapse: 350,
- // $transition-collapse
- Modal: 300,
- // $modal-transition
- Carousel: 600 // $carousel-transition
-
- }; // Duplicated Transition.propType keys to ensure that Reactstrap builds
- // for distribution properly exclude these keys for nested child HTML attributes
- // since `react-transition-group` removes propTypes in production builds.
-
- var TransitionPropTypeKeys = ['in', 'mountOnEnter', 'unmountOnExit', 'appear', 'enter', 'exit', 'timeout', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'];
- var TransitionStatuses = {
- ENTERING: 'entering',
- ENTERED: 'entered',
- EXITING: 'exiting',
- EXITED: 'exited'
- };
- var keyCodes = {
- esc: 27,
- space: 32,
- enter: 13,
- tab: 9,
- up: 38,
- down: 40,
- home: 36,
- end: 35,
- n: 78,
- p: 80
- };
- 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'];
- var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
- function isReactRefObj(target) {
- if (target && typeof target === 'object') {
- return 'current' in target;
- }
-
- return false;
- }
- function findDOMElements(target) {
- if (isReactRefObj(target)) {
- return target.current;
- }
-
- if (isFunction(target)) {
- return target();
- }
-
- if (typeof target === 'string' && canUseDOM) {
- var selection = document.querySelectorAll(target);
-
- if (!selection.length) {
- selection = document.querySelectorAll("#" + target);
- }
-
- if (!selection.length) {
- throw new Error("The target '" + target + "' could not be identified in the dom, tip: check spelling");
- }
-
- return selection;
- }
-
- return target;
- }
- function isArrayOrNodeList(els) {
- if (els === null) {
- return false;
- }
-
- return Array.isArray(els) || canUseDOM && typeof els.length === 'number';
- }
- function getTarget(target) {
- var els = findDOMElements(target);
-
- if (isArrayOrNodeList(els)) {
- return els[0];
- }
-
- return els;
- }
- var defaultToggleEvents = ['touchstart', 'click'];
- function addMultipleEventListeners(_els, handler, _events, useCapture) {
- var els = _els;
-
- if (!isArrayOrNodeList(els)) {
- els = [els];
- }
-
- var events = _events;
-
- if (typeof events === 'string') {
- events = events.split(/\s+/);
- }
-
- if (!isArrayOrNodeList(els) || typeof handler !== 'function' || !Array.isArray(events)) {
- 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 ");
- }
-
- Array.prototype.forEach.call(events, function (event) {
- Array.prototype.forEach.call(els, function (el) {
- el.addEventListener(event, handler, useCapture);
- });
- });
- return function removeEvents() {
- Array.prototype.forEach.call(events, function (event) {
- Array.prototype.forEach.call(els, function (el) {
- el.removeEventListener(event, handler, useCapture);
- });
- });
- };
- }
- 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"])'];
-
- var utils = /*#__PURE__*/Object.freeze({
- getScrollbarWidth: getScrollbarWidth,
- setScrollbarWidth: setScrollbarWidth,
- isBodyOverflowing: isBodyOverflowing,
- getOriginalBodyPadding: getOriginalBodyPadding,
- conditionallyUpdateScrollbar: conditionallyUpdateScrollbar,
- setGlobalCssModule: setGlobalCssModule,
- mapToCssModules: mapToCssModules,
- omit: omit,
- pick: pick,
- warnOnce: warnOnce,
- deprecated: deprecated,
- DOMElement: DOMElement,
- targetPropType: targetPropType,
- tagPropType: tagPropType,
- TransitionTimeouts: TransitionTimeouts,
- TransitionPropTypeKeys: TransitionPropTypeKeys,
- TransitionStatuses: TransitionStatuses,
- keyCodes: keyCodes,
- PopperPlacements: PopperPlacements,
- canUseDOM: canUseDOM,
- isReactRefObj: isReactRefObj,
- findDOMElements: findDOMElements,
- isArrayOrNodeList: isArrayOrNodeList,
- getTarget: getTarget,
- defaultToggleEvents: defaultToggleEvents,
- addMultipleEventListeners: addMultipleEventListeners,
- focusableElements: focusableElements
- });
-
- var propTypes = {
- tag: tagPropType,
- fluid: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps = {
- tag: 'div'
- };
-
- var Container = function Container(props) {
- var className = props.className,
- cssModule = props.cssModule,
- fluid = props.fluid,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "fluid", "tag"]);
-
- var classes = mapToCssModules(classNames(className, fluid ? 'container-fluid' : 'container'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- Container.propTypes = propTypes;
- Container.defaultProps = defaultProps;
-
- var propTypes$1 = {
- tag: tagPropType,
- noGutters: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- form: PropTypes.bool
- };
- var defaultProps$1 = {
- tag: 'div'
- };
-
- var Row = function Row(props) {
- var className = props.className,
- cssModule = props.cssModule,
- noGutters = props.noGutters,
- Tag = props.tag,
- form = props.form,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "noGutters", "tag", "form"]);
-
- var classes = mapToCssModules(classNames(className, noGutters ? 'no-gutters' : null, form ? 'form-row' : 'row'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- Row.propTypes = propTypes$1;
- Row.defaultProps = defaultProps$1;
-
- var colWidths = ['xs', 'sm', 'md', 'lg', 'xl'];
- var stringOrNumberProp = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);
- var columnProps = PropTypes.oneOfType([PropTypes.bool, PropTypes.number, PropTypes.string, PropTypes.shape({
- size: PropTypes.oneOfType([PropTypes.bool, PropTypes.number, PropTypes.string]),
- push: deprecated(stringOrNumberProp, 'Please use the prop "order"'),
- pull: deprecated(stringOrNumberProp, 'Please use the prop "order"'),
- order: stringOrNumberProp,
- offset: stringOrNumberProp
- })]);
- var propTypes$2 = {
- tag: tagPropType,
- xs: columnProps,
- sm: columnProps,
- md: columnProps,
- lg: columnProps,
- xl: columnProps,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- widths: PropTypes.array
- };
- var defaultProps$2 = {
- tag: 'div',
- widths: colWidths
- };
-
- var getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) {
- if (colSize === true || colSize === '') {
- return isXs ? 'col' : "col-" + colWidth;
- } else if (colSize === 'auto') {
- return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
- }
-
- return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
- };
-
- var Col = function Col(props) {
- var className = props.className,
- cssModule = props.cssModule,
- widths = props.widths,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "widths", "tag"]);
-
- var colClasses = [];
- widths.forEach(function (colWidth, i) {
- var columnProp = props[colWidth];
- delete attributes[colWidth];
-
- if (!columnProp && columnProp !== '') {
- return;
- }
-
- var isXs = !i;
-
- if (isobject(columnProp)) {
- var _classNames;
-
- var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
- var colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
- 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));
- } else {
- var _colClass = getColumnSizeClass(isXs, colWidth, columnProp);
-
- colClasses.push(_colClass);
- }
- });
-
- if (!colClasses.length) {
- colClasses.push('col');
- }
-
- var classes = mapToCssModules(classNames(className, colClasses), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- Col.propTypes = propTypes$2;
- Col.defaultProps = defaultProps$2;
-
- var propTypes$3 = {
- light: PropTypes.bool,
- dark: PropTypes.bool,
- inverse: deprecated(PropTypes.bool, 'Please use the prop "dark"'),
- full: PropTypes.bool,
- fixed: PropTypes.string,
- sticky: PropTypes.string,
- color: PropTypes.string,
- role: PropTypes.string,
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- toggleable: deprecated(PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), 'Please use the prop "expand"'),
- expand: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
- };
- var defaultProps$3 = {
- tag: 'nav',
- expand: false
- };
-
- var getExpandClass = function getExpandClass(expand) {
- if (expand === false) {
- return false;
- } else if (expand === true || expand === 'xs') {
- return 'navbar-expand';
- }
-
- return "navbar-expand-" + expand;
- }; // To better maintain backwards compatibility while toggleable is deprecated.
- // We must map breakpoints to the next breakpoint so that toggleable and expand do the same things at the same breakpoint.
-
-
- var toggleableToExpand = {
- xs: 'sm',
- sm: 'md',
- md: 'lg',
- lg: 'xl'
- };
-
- var getToggleableClass = function getToggleableClass(toggleable) {
- if (toggleable === undefined || toggleable === 'xl') {
- return false;
- } else if (toggleable === false) {
- return 'navbar-expand';
- }
-
- return "navbar-expand-" + (toggleable === true ? 'sm' : toggleableToExpand[toggleable] || toggleable);
- };
-
- var Navbar = function Navbar(props) {
- var _classNames;
-
- var toggleable = props.toggleable,
- expand = props.expand,
- className = props.className,
- cssModule = props.cssModule,
- light = props.light,
- dark = props.dark,
- inverse = props.inverse,
- fixed = props.fixed,
- sticky = props.sticky,
- color = props.color,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["toggleable", "expand", "className", "cssModule", "light", "dark", "inverse", "fixed", "sticky", "color", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'navbar', getExpandClass(expand) || getToggleableClass(toggleable), (_classNames = {
- 'navbar-light': light,
- 'navbar-dark': inverse || dark
- }, _classNames["bg-" + color] = color, _classNames["fixed-" + fixed] = fixed, _classNames["sticky-" + sticky] = sticky, _classNames)), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- Navbar.propTypes = propTypes$3;
- Navbar.defaultProps = defaultProps$3;
-
- var propTypes$4 = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$4 = {
- tag: 'a'
- };
-
- var NavbarBrand = function NavbarBrand(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'navbar-brand'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- NavbarBrand.propTypes = propTypes$4;
- NavbarBrand.defaultProps = defaultProps$4;
-
- var propTypes$5 = {
- tag: tagPropType,
- type: PropTypes.string,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- children: PropTypes.node
- };
- var defaultProps$5 = {
- tag: 'button',
- type: 'button'
- };
-
- var NavbarToggler = function NavbarToggler(props) {
- var className = props.className,
- cssModule = props.cssModule,
- children = props.children,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'navbar-toggler'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }), children || React.createElement("span", {
- className: mapToCssModules('navbar-toggler-icon', cssModule)
- }));
- };
-
- NavbarToggler.propTypes = propTypes$5;
- NavbarToggler.defaultProps = defaultProps$5;
-
- var propTypes$6 = {
- tabs: PropTypes.bool,
- pills: PropTypes.bool,
- vertical: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
- horizontal: PropTypes.string,
- justified: PropTypes.bool,
- fill: PropTypes.bool,
- navbar: PropTypes.bool,
- card: PropTypes.bool,
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$6 = {
- tag: 'ul',
- vertical: false
- };
-
- var getVerticalClass = function getVerticalClass(vertical) {
- if (vertical === false) {
- return false;
- } else if (vertical === true || vertical === 'xs') {
- return 'flex-column';
- }
-
- return "flex-" + vertical + "-column";
- };
-
- var Nav = function Nav(props) {
- var className = props.className,
- cssModule = props.cssModule,
- tabs = props.tabs,
- pills = props.pills,
- vertical = props.vertical,
- horizontal = props.horizontal,
- justified = props.justified,
- fill = props.fill,
- navbar = props.navbar,
- card = props.card,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabs", "pills", "vertical", "horizontal", "justified", "fill", "navbar", "card", "tag"]);
-
- var classes = mapToCssModules(classNames(className, navbar ? 'navbar-nav' : 'nav', horizontal ? "justify-content-" + horizontal : false, getVerticalClass(vertical), {
- 'nav-tabs': tabs,
- 'card-header-tabs': card && tabs,
- 'nav-pills': pills,
- 'card-header-pills': card && pills,
- 'nav-justified': justified,
- 'nav-fill': fill
- }), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- Nav.propTypes = propTypes$6;
- Nav.defaultProps = defaultProps$6;
-
- var propTypes$7 = {
- tag: tagPropType,
- active: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$7 = {
- tag: 'li'
- };
-
- var NavItem = function NavItem(props) {
- var className = props.className,
- cssModule = props.cssModule,
- active = props.active,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'nav-item', active ? 'active' : false), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- NavItem.propTypes = propTypes$7;
- NavItem.defaultProps = defaultProps$7;
-
- var propTypes$8 = {
- disabled: PropTypes.bool,
- dropup: deprecated(PropTypes.bool, 'Please use the prop "direction" with the value "up".'),
- direction: PropTypes.oneOf(['up', 'down', 'left', 'right']),
- group: PropTypes.bool,
- isOpen: PropTypes.bool,
- nav: PropTypes.bool,
- active: PropTypes.bool,
- addonType: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['prepend', 'append'])]),
- size: PropTypes.string,
- tag: tagPropType,
- toggle: PropTypes.func,
- children: PropTypes.node,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- inNavbar: PropTypes.bool,
- setActiveFromChild: PropTypes.bool
- };
- var defaultProps$8 = {
- isOpen: false,
- direction: 'down',
- nav: false,
- active: false,
- addonType: false,
- inNavbar: false,
- setActiveFromChild: false
- };
- var childContextTypes = {
- toggle: PropTypes.func.isRequired,
- isOpen: PropTypes.bool.isRequired,
- direction: PropTypes.oneOf(['up', 'down', 'left', 'right']).isRequired,
- inNavbar: PropTypes.bool.isRequired
- };
-
- var Dropdown =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Dropdown, _React$Component);
-
- function Dropdown(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.addEvents = _this.addEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.removeEvents = _this.removeEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = Dropdown.prototype;
-
- _proto.getChildContext = function getChildContext() {
- return {
- toggle: this.props.toggle,
- isOpen: this.props.isOpen,
- direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction,
- inNavbar: this.props.inNavbar
- };
- };
-
- _proto.componentDidMount = function componentDidMount() {
- this.handleProps();
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
- if (this.props.isOpen !== prevProps.isOpen) {
- this.handleProps();
- }
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this.removeEvents();
- };
-
- _proto.getContainer = function getContainer() {
- if (this._$container) return this._$container;
- this._$container = ReactDOM.findDOMNode(this);
- return ReactDOM.findDOMNode(this);
- };
-
- _proto.getMenuCtrl = function getMenuCtrl() {
- if (this._$menuCtrl) return this._$menuCtrl;
- this._$menuCtrl = this.getContainer().querySelector('[aria-expanded]');
- return this._$menuCtrl;
- };
-
- _proto.getMenuItems = function getMenuItems() {
- return [].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'));
- };
-
- _proto.addEvents = function addEvents() {
- var _this2 = this;
-
- ['click', 'touchstart', 'keyup'].forEach(function (event) {
- return document.addEventListener(event, _this2.handleDocumentClick, true);
- });
- };
-
- _proto.removeEvents = function removeEvents() {
- var _this3 = this;
-
- ['click', 'touchstart', 'keyup'].forEach(function (event) {
- return document.removeEventListener(event, _this3.handleDocumentClick, true);
- });
- };
-
- _proto.handleDocumentClick = function handleDocumentClick(e) {
- if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return;
- var container = this.getContainer();
-
- if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) {
- return;
- }
-
- this.toggle(e);
- };
-
- _proto.handleKeyDown = function handleKeyDown(e) {
- var _this4 = this;
-
- if (/input|textarea/i.test(e.target.tagName) || keyCodes.tab === e.which && e.target.getAttribute('role') !== 'menuitem') {
- return;
- }
-
- e.preventDefault();
- if (this.props.disabled) return;
-
- if (this.getMenuCtrl() === e.target) {
- if (!this.props.isOpen && [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {
- this.toggle(e);
- setTimeout(function () {
- return _this4.getMenuItems()[0].focus();
- });
- }
- }
-
- if (this.props.isOpen && e.target.getAttribute('role') === 'menuitem') {
- if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {
- this.toggle(e);
- this.getMenuCtrl().focus();
- } else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {
- e.target.click();
- this.getMenuCtrl().focus();
- } else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {
- var $menuitems = this.getMenuItems();
- var index = $menuitems.indexOf(e.target);
-
- if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {
- index = index !== 0 ? index - 1 : $menuitems.length - 1;
- } else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {
- index = index === $menuitems.length - 1 ? 0 : index + 1;
- }
-
- $menuitems[index].focus();
- } else if (keyCodes.end === e.which) {
- var _$menuitems = this.getMenuItems();
-
- _$menuitems[_$menuitems.length - 1].focus();
- } else if (keyCodes.home === e.which) {
- var _$menuitems2 = this.getMenuItems();
-
- _$menuitems2[0].focus();
- } else if (e.which >= 48 && e.which <= 90) {
- var _$menuitems3 = this.getMenuItems();
-
- var charPressed = String.fromCharCode(e.which).toLowerCase();
-
- for (var i = 0; i < _$menuitems3.length; i += 1) {
- var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();
-
- if (firstLetter === charPressed) {
- _$menuitems3[i].focus();
-
- break;
- }
- }
- }
- }
- };
-
- _proto.handleProps = function handleProps() {
- if (this.props.isOpen) {
- this.addEvents();
- } else {
- this.removeEvents();
- }
- };
-
- _proto.toggle = function toggle(e) {
- if (this.props.disabled) {
- return e && e.preventDefault();
- }
-
- return this.props.toggle(e);
- };
-
- _proto.render = function render() {
- var _classNames;
-
- var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar', 'direction']),
- className = _omit.className,
- cssModule = _omit.cssModule,
- dropup = _omit.dropup,
- isOpen = _omit.isOpen,
- group = _omit.group,
- size = _omit.size,
- nav = _omit.nav,
- setActiveFromChild = _omit.setActiveFromChild,
- active = _omit.active,
- addonType = _omit.addonType,
- attrs = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "dropup", "isOpen", "group", "size", "nav", "setActiveFromChild", "active", "addonType"]);
-
- var direction = this.props.direction === 'down' && dropup ? 'up' : this.props.direction;
- attrs.tag = attrs.tag || (nav ? 'li' : 'div');
- var subItemIsActive = false;
-
- if (setActiveFromChild) {
- React.Children.map(this.props.children[1].props.children, function (dropdownItem) {
- if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;
- });
- }
-
- 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);
- return React.createElement(Manager, _extends({}, attrs, {
- className: classes,
- onKeyDown: this.handleKeyDown
- }));
- };
-
- return Dropdown;
- }(React.Component);
-
- Dropdown.propTypes = propTypes$8;
- Dropdown.defaultProps = defaultProps$8;
- Dropdown.childContextTypes = childContextTypes;
-
- function NavDropdown(props) {
- warnOnce('The "NavDropdown" component has been deprecated.\nPlease use component "Dropdown" with nav prop.');
- return React.createElement(Dropdown, _extends({
- nav: true
- }, props));
- }
-
- var propTypes$9 = {
- tag: tagPropType,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
- disabled: PropTypes.bool,
- active: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- onClick: PropTypes.func,
- href: PropTypes.any
- };
- var defaultProps$9 = {
- tag: 'a'
- };
-
- var NavLink =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(NavLink, _React$Component);
-
- function NavLink(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = NavLink.prototype;
-
- _proto.onClick = function onClick(e) {
- if (this.props.disabled) {
- e.preventDefault();
- return;
- }
-
- if (this.props.href === '#') {
- e.preventDefault();
- }
-
- if (this.props.onClick) {
- this.props.onClick(e);
- }
- };
-
- _proto.render = function render() {
- var _this$props = this.props,
- className = _this$props.className,
- cssModule = _this$props.cssModule,
- active = _this$props.active,
- Tag = _this$props.tag,
- innerRef = _this$props.innerRef,
- attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "active", "tag", "innerRef"]);
-
- var classes = mapToCssModules(classNames(className, 'nav-link', {
- disabled: attributes.disabled,
- active: active
- }), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- ref: innerRef,
- onClick: this.onClick,
- className: classes
- }));
- };
-
- return NavLink;
- }(React.Component);
-
- NavLink.propTypes = propTypes$9;
- NavLink.defaultProps = defaultProps$9;
-
- var propTypes$a = {
- tag: tagPropType,
- listTag: tagPropType,
- className: PropTypes.string,
- listClassName: PropTypes.string,
- cssModule: PropTypes.object,
- children: PropTypes.node,
- 'aria-label': PropTypes.string
- };
- var defaultProps$a = {
- tag: 'nav',
- listTag: 'ol',
- 'aria-label': 'breadcrumb'
- };
-
- var Breadcrumb = function Breadcrumb(props) {
- var className = props.className,
- listClassName = props.listClassName,
- cssModule = props.cssModule,
- children = props.children,
- Tag = props.tag,
- ListTag = props.listTag,
- label = props['aria-label'],
- attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "children", "tag", "listTag", "aria-label"]);
-
- var classes = mapToCssModules(classNames(className), cssModule);
- var listClasses = mapToCssModules(classNames('breadcrumb', listClassName), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes,
- "aria-label": label
- }), React.createElement(ListTag, {
- className: listClasses
- }, children));
- };
-
- Breadcrumb.propTypes = propTypes$a;
- Breadcrumb.defaultProps = defaultProps$a;
-
- var propTypes$b = {
- tag: tagPropType,
- active: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$b = {
- tag: 'li'
- };
-
- var BreadcrumbItem = function BreadcrumbItem(props) {
- var className = props.className,
- cssModule = props.cssModule,
- active = props.active,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
-
- var classes = mapToCssModules(classNames(className, active ? 'active' : false, 'breadcrumb-item'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes,
- "aria-current": active ? 'page' : undefined
- }));
- };
-
- BreadcrumbItem.propTypes = propTypes$b;
- BreadcrumbItem.defaultProps = defaultProps$b;
-
- var propTypes$c = {
- active: PropTypes.bool,
- 'aria-label': PropTypes.string,
- block: PropTypes.bool,
- color: PropTypes.string,
- disabled: PropTypes.bool,
- outline: PropTypes.bool,
- tag: tagPropType,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
- onClick: PropTypes.func,
- size: PropTypes.string,
- children: PropTypes.node,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- close: PropTypes.bool
- };
- var defaultProps$c = {
- color: 'secondary',
- tag: 'button'
- };
-
- var Button =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Button, _React$Component);
-
- function Button(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = Button.prototype;
-
- _proto.onClick = function onClick(e) {
- if (this.props.disabled) {
- e.preventDefault();
- return;
- }
-
- if (this.props.onClick) {
- this.props.onClick(e);
- }
- };
-
- _proto.render = function render() {
- var _this$props = this.props,
- active = _this$props.active,
- ariaLabel = _this$props['aria-label'],
- block = _this$props.block,
- className = _this$props.className,
- close = _this$props.close,
- cssModule = _this$props.cssModule,
- color = _this$props.color,
- outline = _this$props.outline,
- size = _this$props.size,
- Tag = _this$props.tag,
- innerRef = _this$props.innerRef,
- attributes = _objectWithoutPropertiesLoose(_this$props, ["active", "aria-label", "block", "className", "close", "cssModule", "color", "outline", "size", "tag", "innerRef"]);
-
- if (close && typeof attributes.children === 'undefined') {
- attributes.children = React.createElement("span", {
- "aria-hidden": true
- }, "\xD7");
- }
-
- var btnOutlineColor = "btn" + (outline ? '-outline' : '') + "-" + color;
- var classes = mapToCssModules(classNames(className, {
- close: close
- }, close || 'btn', close || btnOutlineColor, size ? "btn-" + size : false, block ? 'btn-block' : false, {
- active: active,
- disabled: this.props.disabled
- }), cssModule);
-
- if (attributes.href && Tag === 'button') {
- Tag = 'a';
- }
-
- var defaultAriaLabel = close ? 'Close' : null;
- return React.createElement(Tag, _extends({
- type: Tag === 'button' && attributes.onClick ? 'button' : undefined
- }, attributes, {
- className: classes,
- ref: innerRef,
- onClick: this.onClick,
- "aria-label": ariaLabel || defaultAriaLabel
- }));
- };
-
- return Button;
- }(React.Component);
-
- Button.propTypes = propTypes$c;
- Button.defaultProps = defaultProps$c;
-
- var propTypes$d = {
- children: PropTypes.node
- };
-
- var ButtonDropdown = function ButtonDropdown(props) {
- return React.createElement(Dropdown, _extends({
- group: true
- }, props));
- };
-
- ButtonDropdown.propTypes = propTypes$d;
-
- var propTypes$e = {
- tag: tagPropType,
- 'aria-label': PropTypes.string,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- role: PropTypes.string,
- size: PropTypes.string,
- vertical: PropTypes.bool
- };
- var defaultProps$d = {
- tag: 'div',
- role: 'group'
- };
-
- var ButtonGroup = function ButtonGroup(props) {
- var className = props.className,
- cssModule = props.cssModule,
- size = props.size,
- vertical = props.vertical,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "vertical", "tag"]);
-
- var classes = mapToCssModules(classNames(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- ButtonGroup.propTypes = propTypes$e;
- ButtonGroup.defaultProps = defaultProps$d;
-
- var propTypes$f = {
- tag: tagPropType,
- 'aria-label': PropTypes.string,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- role: PropTypes.string
- };
- var defaultProps$e = {
- tag: 'div',
- role: 'toolbar'
- };
-
- var ButtonToolbar = function ButtonToolbar(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'btn-toolbar'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- ButtonToolbar.propTypes = propTypes$f;
- ButtonToolbar.defaultProps = defaultProps$e;
-
- var propTypes$g = {
- children: PropTypes.node,
- active: PropTypes.bool,
- disabled: PropTypes.bool,
- divider: PropTypes.bool,
- tag: tagPropType,
- header: PropTypes.bool,
- onClick: PropTypes.func,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- toggle: PropTypes.bool
- };
- var contextTypes = {
- toggle: PropTypes.func
- };
- var defaultProps$f = {
- tag: 'button',
- toggle: true
- };
-
- var DropdownItem =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(DropdownItem, _React$Component);
-
- function DropdownItem(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = DropdownItem.prototype;
-
- _proto.onClick = function onClick(e) {
- if (this.props.disabled || this.props.header || this.props.divider) {
- e.preventDefault();
- return;
- }
-
- if (this.props.onClick) {
- this.props.onClick(e);
- }
-
- if (this.props.toggle) {
- this.context.toggle(e);
- }
- };
-
- _proto.getTabIndex = function getTabIndex() {
- if (this.props.disabled || this.props.header || this.props.divider) {
- return '-1';
- }
-
- return '0';
- };
-
- _proto.render = function render() {
- var tabIndex = this.getTabIndex();
- var role = tabIndex > -1 ? 'menuitem' : undefined;
-
- var _omit = omit(this.props, ['toggle']),
- className = _omit.className,
- cssModule = _omit.cssModule,
- divider = _omit.divider,
- Tag = _omit.tag,
- header = _omit.header,
- active = _omit.active,
- props = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "divider", "tag", "header", "active"]);
-
- var classes = mapToCssModules(classNames(className, {
- disabled: props.disabled,
- 'dropdown-item': !divider && !header,
- active: active,
- 'dropdown-header': header,
- 'dropdown-divider': divider
- }), cssModule);
-
- if (Tag === 'button') {
- if (header) {
- Tag = 'h6';
- } else if (divider) {
- Tag = 'div';
- } else if (props.href) {
- Tag = 'a';
- }
- }
-
- return React.createElement(Tag, _extends({
- type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined
- }, props, {
- tabIndex: tabIndex,
- role: role,
- className: classes,
- onClick: this.onClick
- }));
- };
-
- return DropdownItem;
- }(React.Component);
-
- DropdownItem.propTypes = propTypes$g;
- DropdownItem.defaultProps = defaultProps$f;
- DropdownItem.contextTypes = contextTypes;
-
- var propTypes$h = {
- tag: tagPropType,
- children: PropTypes.node.isRequired,
- right: PropTypes.bool,
- flip: PropTypes.bool,
- modifiers: PropTypes.object,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- persist: PropTypes.bool
- };
- var defaultProps$g = {
- tag: 'div',
- flip: true
- };
- var contextTypes$1 = {
- isOpen: PropTypes.bool.isRequired,
- direction: PropTypes.oneOf(['up', 'down', 'left', 'right']).isRequired,
- inNavbar: PropTypes.bool.isRequired
- };
- var noFlipModifier = {
- flip: {
- enabled: false
- }
- };
- var directionPositionMap = {
- up: 'top',
- left: 'left',
- right: 'right',
- down: 'bottom'
- };
-
- var DropdownMenu = function DropdownMenu(props, context) {
- var className = props.className,
- cssModule = props.cssModule,
- right = props.right,
- tag = props.tag,
- flip = props.flip,
- modifiers = props.modifiers,
- persist = props.persist,
- attrs = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "right", "tag", "flip", "modifiers", "persist"]);
-
- var classes = mapToCssModules(classNames(className, 'dropdown-menu', {
- 'dropdown-menu-right': right,
- show: context.isOpen
- }), cssModule);
- var Tag = tag;
-
- if (persist || context.isOpen && !context.inNavbar) {
- Tag = Popper;
- var position1 = directionPositionMap[context.direction] || 'bottom';
- var position2 = right ? 'end' : 'start';
- attrs.placement = position1 + "-" + position2;
- attrs.component = tag;
- attrs.modifiers = !flip ? _extends({}, modifiers, noFlipModifier) : modifiers;
- }
-
- return React.createElement(Tag, _extends({
- tabIndex: "-1",
- role: "menu"
- }, attrs, {
- "aria-hidden": !context.isOpen,
- className: classes,
- "x-placement": attrs.placement
- }));
- };
-
- DropdownMenu.propTypes = propTypes$h;
- DropdownMenu.defaultProps = defaultProps$g;
- DropdownMenu.contextTypes = contextTypes$1;
-
- var propTypes$i = {
- caret: PropTypes.bool,
- color: PropTypes.string,
- children: PropTypes.node,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- disabled: PropTypes.bool,
- onClick: PropTypes.func,
- 'aria-haspopup': PropTypes.bool,
- split: PropTypes.bool,
- tag: tagPropType,
- nav: PropTypes.bool
- };
- var defaultProps$h = {
- 'aria-haspopup': true,
- color: 'secondary'
- };
- var contextTypes$2 = {
- isOpen: PropTypes.bool.isRequired,
- toggle: PropTypes.func.isRequired,
- inNavbar: PropTypes.bool.isRequired
- };
-
- var DropdownToggle =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(DropdownToggle, _React$Component);
-
- function DropdownToggle(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = DropdownToggle.prototype;
-
- _proto.onClick = function onClick(e) {
- if (this.props.disabled) {
- e.preventDefault();
- return;
- }
-
- if (this.props.nav && !this.props.tag) {
- e.preventDefault();
- }
-
- if (this.props.onClick) {
- this.props.onClick(e);
- }
-
- this.context.toggle(e);
- };
-
- _proto.render = function render() {
- var _this$props = this.props,
- className = _this$props.className,
- color = _this$props.color,
- cssModule = _this$props.cssModule,
- caret = _this$props.caret,
- split = _this$props.split,
- nav = _this$props.nav,
- tag = _this$props.tag,
- props = _objectWithoutPropertiesLoose(_this$props, ["className", "color", "cssModule", "caret", "split", "nav", "tag"]);
-
- var ariaLabel = props['aria-label'] || 'Toggle Dropdown';
- var classes = mapToCssModules(classNames(className, {
- 'dropdown-toggle': caret || split,
- 'dropdown-toggle-split': split,
- 'nav-link': nav
- }), cssModule);
- var children = props.children || React.createElement("span", {
- className: "sr-only"
- }, ariaLabel);
- var Tag;
-
- if (nav && !tag) {
- Tag = 'a';
- props.href = '#';
- } else if (!tag) {
- Tag = Button;
- props.color = color;
- props.cssModule = cssModule;
- } else {
- Tag = tag;
- }
-
- if (this.context.inNavbar) {
- return React.createElement(Tag, _extends({}, props, {
- className: classes,
- onClick: this.onClick,
- "aria-expanded": this.context.isOpen,
- children: children
- }));
- }
-
- return React.createElement(Target, _extends({}, props, {
- className: classes,
- component: Tag,
- onClick: this.onClick,
- "aria-expanded": this.context.isOpen,
- children: children
- }));
- };
-
- return DropdownToggle;
- }(React.Component);
-
- DropdownToggle.propTypes = propTypes$i;
- DropdownToggle.defaultProps = defaultProps$h;
- DropdownToggle.contextTypes = contextTypes$2;
-
- var propTypes$j = _extends({}, Transition.propTypes, {
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
- tag: tagPropType,
- baseClass: PropTypes.string,
- baseClassActive: PropTypes.string,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
- });
-
- var defaultProps$i = _extends({}, Transition.defaultProps, {
- tag: 'div',
- baseClass: 'fade',
- baseClassActive: 'show',
- timeout: TransitionTimeouts.Fade,
- appear: true,
- enter: true,
- exit: true,
- in: true
- });
-
- function Fade(props) {
- var Tag = props.tag,
- baseClass = props.baseClass,
- baseClassActive = props.baseClassActive,
- className = props.className,
- cssModule = props.cssModule,
- children = props.children,
- innerRef = props.innerRef,
- otherProps = _objectWithoutPropertiesLoose(props, ["tag", "baseClass", "baseClassActive", "className", "cssModule", "children", "innerRef"]);
-
- var transitionProps = pick(otherProps, TransitionPropTypeKeys);
- var childProps = omit(otherProps, TransitionPropTypeKeys);
- return React.createElement(Transition, transitionProps, function (status) {
- var isActive = status === 'entered';
- var classes = mapToCssModules(classNames(className, baseClass, isActive && baseClassActive), cssModule);
- return React.createElement(Tag, _extends({
- className: classes
- }, childProps, {
- ref: innerRef
- }), children);
- });
- }
-
- Fade.propTypes = propTypes$j;
- Fade.defaultProps = defaultProps$i;
-
- var propTypes$k = {
- color: PropTypes.string,
- pill: PropTypes.bool,
- tag: tagPropType,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
- children: PropTypes.node,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$j = {
- color: 'secondary',
- pill: false,
- tag: 'span'
- };
-
- var Badge = function Badge(props) {
- var className = props.className,
- cssModule = props.cssModule,
- color = props.color,
- innerRef = props.innerRef,
- pill = props.pill,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "innerRef", "pill", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule);
-
- if (attributes.href && Tag === 'span') {
- Tag = 'a';
- }
-
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes,
- ref: innerRef
- }));
- };
-
- Badge.propTypes = propTypes$k;
- Badge.defaultProps = defaultProps$j;
-
- var propTypes$l = {
- tag: tagPropType,
- inverse: PropTypes.bool,
- color: PropTypes.string,
- block: deprecated(PropTypes.bool, 'Please use the props "body"'),
- body: PropTypes.bool,
- outline: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
- };
- var defaultProps$k = {
- tag: 'div'
- };
-
- var Card = function Card(props) {
- var className = props.className,
- cssModule = props.cssModule,
- color = props.color,
- block = props.block,
- body = props.body,
- inverse = props.inverse,
- outline = props.outline,
- Tag = props.tag,
- innerRef = props.innerRef,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "block", "body", "inverse", "outline", "tag", "innerRef"]);
-
- var classes = mapToCssModules(classNames(className, 'card', inverse ? 'text-white' : false, block || body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + "-" + color : false), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes,
- ref: innerRef
- }));
- };
-
- Card.propTypes = propTypes$l;
- Card.defaultProps = defaultProps$k;
-
- var propTypes$m = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$l = {
- tag: 'div'
- };
-
- var CardGroup = function CardGroup(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-group'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardGroup.propTypes = propTypes$m;
- CardGroup.defaultProps = defaultProps$l;
-
- var propTypes$n = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$m = {
- tag: 'div'
- };
-
- var CardDeck = function CardDeck(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-deck'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardDeck.propTypes = propTypes$n;
- CardDeck.defaultProps = defaultProps$m;
-
- var propTypes$o = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$n = {
- tag: 'div'
- };
-
- var CardColumns = function CardColumns(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-columns'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardColumns.propTypes = propTypes$o;
- CardColumns.defaultProps = defaultProps$n;
-
- var propTypes$p = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
- };
- var defaultProps$o = {
- tag: 'div'
- };
-
- var CardBody = function CardBody(props) {
- var className = props.className,
- cssModule = props.cssModule,
- innerRef = props.innerRef,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-body'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes,
- ref: innerRef
- }));
- };
-
- CardBody.propTypes = propTypes$p;
- CardBody.defaultProps = defaultProps$o;
-
- function CardBlock(props) {
- warnOnce('The "CardBlock" component has been deprecated.\nPlease use component "CardBody".');
- return React.createElement(CardBody, props);
- }
-
- var propTypes$q = {
- tag: tagPropType,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$p = {
- tag: 'a'
- };
-
- var CardLink = function CardLink(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- innerRef = props.innerRef,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "innerRef"]);
-
- var classes = mapToCssModules(classNames(className, 'card-link'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- ref: innerRef,
- className: classes
- }));
- };
-
- CardLink.propTypes = propTypes$q;
- CardLink.defaultProps = defaultProps$p;
-
- var propTypes$r = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$q = {
- tag: 'div'
- };
-
- var CardFooter = function CardFooter(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-footer'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardFooter.propTypes = propTypes$r;
- CardFooter.defaultProps = defaultProps$q;
-
- var propTypes$s = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$r = {
- tag: 'div'
- };
-
- var CardHeader = function CardHeader(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-header'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardHeader.propTypes = propTypes$s;
- CardHeader.defaultProps = defaultProps$r;
-
- var propTypes$t = {
- tag: tagPropType,
- top: PropTypes.bool,
- bottom: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$s = {
- tag: 'img'
- };
-
- var CardImg = function CardImg(props) {
- var className = props.className,
- cssModule = props.cssModule,
- top = props.top,
- bottom = props.bottom,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "top", "bottom", "tag"]);
-
- var cardImgClassName = 'card-img';
-
- if (top) {
- cardImgClassName = 'card-img-top';
- }
-
- if (bottom) {
- cardImgClassName = 'card-img-bottom';
- }
-
- var classes = mapToCssModules(classNames(className, cardImgClassName), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardImg.propTypes = propTypes$t;
- CardImg.defaultProps = defaultProps$s;
-
- var propTypes$u = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$t = {
- tag: 'div'
- };
-
- var CardImgOverlay = function CardImgOverlay(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-img-overlay'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardImgOverlay.propTypes = propTypes$u;
- CardImgOverlay.defaultProps = defaultProps$t;
-
- var CarouselItem =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(CarouselItem, _React$Component);
-
- function CarouselItem(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.state = {
- startAnimation: false
- };
- _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onExit = _this.onExit.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onExited = _this.onExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = CarouselItem.prototype;
-
- _proto.onEnter = function onEnter(node, isAppearing) {
- this.setState({
- startAnimation: false
- });
- this.props.onEnter(node, isAppearing);
- };
-
- _proto.onEntering = function onEntering(node, isAppearing) {
- // getting this variable triggers a reflow
- var offsetHeight = node.offsetHeight;
- this.setState({
- startAnimation: true
- });
- this.props.onEntering(node, isAppearing);
- return offsetHeight;
- };
-
- _proto.onExit = function onExit(node) {
- this.setState({
- startAnimation: false
- });
- this.props.onExit(node);
- };
-
- _proto.onExiting = function onExiting(node) {
- this.setState({
- startAnimation: true
- });
- node.dispatchEvent(new CustomEvent('slide.bs.carousel'));
- this.props.onExiting(node);
- };
-
- _proto.onExited = function onExited(node) {
- node.dispatchEvent(new CustomEvent('slid.bs.carousel'));
- this.props.onExited(node);
- };
-
- _proto.render = function render() {
- var _this2 = this;
-
- var _this$props = this.props,
- isIn = _this$props.in,
- children = _this$props.children,
- cssModule = _this$props.cssModule,
- slide = _this$props.slide,
- Tag = _this$props.tag,
- className = _this$props.className,
- transitionProps = _objectWithoutPropertiesLoose(_this$props, ["in", "children", "cssModule", "slide", "tag", "className"]);
-
- return React.createElement(Transition, _extends({}, transitionProps, {
- enter: slide,
- exit: slide,
- in: isIn,
- onEnter: this.onEnter,
- onEntering: this.onEntering,
- onExit: this.onExit,
- onExiting: this.onExiting,
- onExited: this.onExited
- }), function (status) {
- var direction = _this2.context.direction;
- var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING;
- var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'right' ? 'carousel-item-left' : 'carousel-item-right');
- var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'right' ? 'carousel-item-next' : 'carousel-item-prev');
- var itemClasses = mapToCssModules(classNames(className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule);
- return React.createElement(Tag, {
- className: itemClasses
- }, children);
- });
- };
-
- return CarouselItem;
- }(React.Component);
-
- CarouselItem.propTypes = _extends({}, Transition.propTypes, {
- tag: tagPropType,
- in: PropTypes.bool,
- cssModule: PropTypes.object,
- children: PropTypes.node,
- slide: PropTypes.bool,
- className: PropTypes.string
- });
- CarouselItem.defaultProps = _extends({}, Transition.defaultProps, {
- tag: 'div',
- timeout: TransitionTimeouts.Carousel,
- slide: true
- });
- CarouselItem.contextTypes = {
- direction: PropTypes.string
- };
-
- var Carousel =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Carousel, _React$Component);
-
- function Carousel(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.renderItems = _this.renderItems.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.hoverStart = _this.hoverStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.hoverEnd = _this.hoverEnd.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.state = {
- direction: 'right',
- indicatorClicked: false
- };
- return _this;
- }
-
- var _proto = Carousel.prototype;
-
- _proto.getChildContext = function getChildContext() {
- return {
- direction: this.state.direction
- };
- };
-
- _proto.componentDidMount = function componentDidMount() {
- // Set up the cycle
- if (this.props.ride === 'carousel') {
- this.setInterval();
- } // TODO: move this to the specific carousel like bootstrap. Currently it will trigger ALL carousels on the page.
-
-
- document.addEventListener('keyup', this.handleKeyPress);
- };
-
- _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- this.setInterval(nextProps); // Calculate the direction to turn
-
- if (this.props.activeIndex + 1 === nextProps.activeIndex) {
- this.setState({
- direction: 'right'
- });
- } else if (this.props.activeIndex - 1 === nextProps.activeIndex) {
- this.setState({
- direction: 'left'
- });
- } else if (this.props.activeIndex > nextProps.activeIndex) {
- this.setState({
- direction: this.state.indicatorClicked ? 'left' : 'right'
- });
- } else if (this.props.activeIndex !== nextProps.activeIndex) {
- this.setState({
- direction: this.state.indicatorClicked ? 'right' : 'left'
- });
- }
-
- this.setState({
- indicatorClicked: false
- });
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this.clearInterval();
- document.removeEventListener('keyup', this.handleKeyPress);
- };
-
- _proto.setInterval = function (_setInterval) {
- function setInterval() {
- return _setInterval.apply(this, arguments);
- }
-
- setInterval.toString = function () {
- return _setInterval.toString();
- };
-
- return setInterval;
- }(function (props) {
- if (props === void 0) {
- props = this.props;
- }
-
- // make sure not to have multiple intervals going...
- this.clearInterval();
-
- if (props.interval) {
- this.cycleInterval = setInterval(function () {
- props.next();
- }, parseInt(props.interval, 10));
- }
- });
-
- _proto.clearInterval = function (_clearInterval) {
- function clearInterval() {
- return _clearInterval.apply(this, arguments);
- }
-
- clearInterval.toString = function () {
- return _clearInterval.toString();
- };
-
- return clearInterval;
- }(function () {
- clearInterval(this.cycleInterval);
- });
-
- _proto.hoverStart = function hoverStart() {
- if (this.props.pause === 'hover') {
- this.clearInterval();
- }
-
- if (this.props.mouseEnter) {
- var _this$props;
-
- (_this$props = this.props).mouseEnter.apply(_this$props, arguments);
- }
- };
-
- _proto.hoverEnd = function hoverEnd() {
- if (this.props.pause === 'hover') {
- this.setInterval();
- }
-
- if (this.props.mouseLeave) {
- var _this$props2;
-
- (_this$props2 = this.props).mouseLeave.apply(_this$props2, arguments);
- }
- };
-
- _proto.handleKeyPress = function handleKeyPress(evt) {
- if (this.props.keyboard) {
- if (evt.keyCode === 37) {
- this.props.previous();
- } else if (evt.keyCode === 39) {
- this.props.next();
- }
- }
- };
-
- _proto.renderItems = function renderItems(carouselItems, className) {
- var _this2 = this;
-
- var slide = this.props.slide;
- return React.createElement("div", {
- role: "listbox",
- className: className
- }, carouselItems.map(function (item, index) {
- var isIn = index === _this2.props.activeIndex;
- return React.cloneElement(item, {
- in: isIn,
- slide: slide
- });
- }));
- };
-
- _proto.render = function render() {
- var _this3 = this;
-
- var _this$props3 = this.props,
- cssModule = _this$props3.cssModule,
- slide = _this$props3.slide,
- className = _this$props3.className;
- var outerClasses = mapToCssModules(classNames(className, 'carousel', slide && 'slide'), cssModule);
- var innerClasses = mapToCssModules(classNames('carousel-inner'), cssModule); // filter out booleans, null, or undefined
-
- var children = this.props.children.filter(function (child) {
- return child !== null && child !== undefined && typeof child !== 'boolean';
- });
- var slidesOnly = children.every(function (child) {
- return child.type === CarouselItem;
- }); // Rendering only slides
-
- if (slidesOnly) {
- return React.createElement("div", {
- className: outerClasses,
- onMouseEnter: this.hoverStart,
- onMouseLeave: this.hoverEnd
- }, this.renderItems(children, innerClasses));
- } // Rendering slides and controls
-
-
- if (children[0] instanceof Array) {
- var _carouselItems = children[0];
- var _controlLeft = children[1];
- var _controlRight = children[2];
- return React.createElement("div", {
- className: outerClasses,
- onMouseEnter: this.hoverStart,
- onMouseLeave: this.hoverEnd
- }, this.renderItems(_carouselItems, innerClasses), _controlLeft, _controlRight);
- } // Rendering indicators, slides and controls
-
-
- var indicators = children[0];
-
- var wrappedOnClick = function wrappedOnClick(e) {
- if (typeof indicators.props.onClickHandler === 'function') {
- _this3.setState({
- indicatorClicked: true
- }, function () {
- return indicators.props.onClickHandler(e);
- });
- }
- };
-
- var wrappedIndicators = React.cloneElement(indicators, {
- onClickHandler: wrappedOnClick
- });
- var carouselItems = children[1];
- var controlLeft = children[2];
- var controlRight = children[3];
- return React.createElement("div", {
- className: outerClasses,
- onMouseEnter: this.hoverStart,
- onMouseLeave: this.hoverEnd
- }, wrappedIndicators, this.renderItems(carouselItems, innerClasses), controlLeft, controlRight);
- };
-
- return Carousel;
- }(React.Component);
-
- Carousel.propTypes = {
- // the current active slide of the carousel
- activeIndex: PropTypes.number,
- // a function which should advance the carousel to the next slide (via activeIndex)
- next: PropTypes.func.isRequired,
- // a function which should advance the carousel to the previous slide (via activeIndex)
- previous: PropTypes.func.isRequired,
- // controls if the left and right arrow keys should control the carousel
- keyboard: PropTypes.bool,
-
- /* If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on
- * mouseleave. If set to false, hovering over the carousel won't pause it. (default: "hover")
- */
- pause: PropTypes.oneOf(['hover', false]),
- // Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.
- // This is how bootstrap defines it... I would prefer a bool named autoplay or something...
- ride: PropTypes.oneOf(['carousel']),
- // the interval at which the carousel automatically cycles (default: 5000)
- // eslint-disable-next-line react/no-unused-prop-types
- interval: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.bool]),
- children: PropTypes.array,
- // called when the mouse enters the Carousel
- mouseEnter: PropTypes.func,
- // called when the mouse exits the Carousel
- mouseLeave: PropTypes.func,
- // controls whether the slide animation on the Carousel works or not
- slide: PropTypes.bool,
- cssModule: PropTypes.object,
- className: PropTypes.string
- };
- Carousel.defaultProps = {
- interval: 5000,
- pause: 'hover',
- keyboard: true,
- slide: true
- };
- Carousel.childContextTypes = {
- direction: PropTypes.string
- };
-
- var CarouselControl = function CarouselControl(props) {
- var direction = props.direction,
- onClickHandler = props.onClickHandler,
- cssModule = props.cssModule,
- directionText = props.directionText,
- className = props.className;
- var anchorClasses = mapToCssModules(classNames(className, "carousel-control-" + direction), cssModule);
- var iconClasses = mapToCssModules(classNames("carousel-control-" + direction + "-icon"), cssModule);
- var screenReaderClasses = mapToCssModules(classNames('sr-only'), cssModule);
- return React.createElement("a", {
- className: anchorClasses,
- role: "button",
- tabIndex: "0",
- onClick: function onClick(e) {
- e.preventDefault();
- onClickHandler();
- }
- }, React.createElement("span", {
- className: iconClasses,
- "aria-hidden": "true"
- }), React.createElement("span", {
- className: screenReaderClasses
- }, directionText || direction));
- };
-
- CarouselControl.propTypes = {
- direction: PropTypes.oneOf(['prev', 'next']).isRequired,
- onClickHandler: PropTypes.func.isRequired,
- cssModule: PropTypes.object,
- directionText: PropTypes.string,
- className: PropTypes.string
- };
-
- var CarouselIndicators = function CarouselIndicators(props) {
- var items = props.items,
- activeIndex = props.activeIndex,
- cssModule = props.cssModule,
- onClickHandler = props.onClickHandler,
- className = props.className;
- var listClasses = mapToCssModules(classNames(className, 'carousel-indicators'), cssModule);
- var indicators = items.map(function (item, idx) {
- var indicatorClasses = mapToCssModules(classNames({
- active: activeIndex === idx
- }), cssModule);
- return React.createElement("li", {
- key: "" + (item.key || Object.values(item).join('')),
- onClick: function onClick(e) {
- e.preventDefault();
- onClickHandler(idx);
- },
- className: indicatorClasses
- });
- });
- return React.createElement("ol", {
- className: listClasses
- }, indicators);
- };
-
- CarouselIndicators.propTypes = {
- items: PropTypes.array.isRequired,
- activeIndex: PropTypes.number.isRequired,
- cssModule: PropTypes.object,
- onClickHandler: PropTypes.func.isRequired,
- className: PropTypes.string
- };
-
- var CarouselCaption = function CarouselCaption(props) {
- var captionHeader = props.captionHeader,
- captionText = props.captionText,
- cssModule = props.cssModule,
- className = props.className;
- var classes = mapToCssModules(classNames(className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule);
- return React.createElement("div", {
- className: classes
- }, React.createElement("h3", null, captionHeader), React.createElement("p", null, captionText));
- };
-
- CarouselCaption.propTypes = {
- captionHeader: PropTypes.string,
- captionText: PropTypes.string.isRequired,
- cssModule: PropTypes.object,
- className: PropTypes.string
- };
-
- var propTypes$v = {
- items: PropTypes.array.isRequired,
- indicators: PropTypes.bool,
- controls: PropTypes.bool,
- autoPlay: PropTypes.bool,
- defaultActiveIndex: PropTypes.number,
- activeIndex: PropTypes.number,
- next: PropTypes.func,
- previous: PropTypes.func,
- goToIndex: PropTypes.func
- };
-
- var UncontrolledCarousel =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(UncontrolledCarousel, _Component);
-
- function UncontrolledCarousel(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.animating = false;
- _this.state = {
- activeIndex: props.defaultActiveIndex || 0
- };
- _this.next = _this.next.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.previous = _this.previous.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.goToIndex = _this.goToIndex.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onExited = _this.onExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = UncontrolledCarousel.prototype;
-
- _proto.onExiting = function onExiting() {
- this.animating = true;
- };
-
- _proto.onExited = function onExited() {
- this.animating = false;
- };
-
- _proto.next = function next() {
- if (this.animating) return;
- var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1;
- this.setState({
- activeIndex: nextIndex
- });
- };
-
- _proto.previous = function previous() {
- if (this.animating) return;
- var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1;
- this.setState({
- activeIndex: nextIndex
- });
- };
-
- _proto.goToIndex = function goToIndex(newIndex) {
- if (this.animating) return;
- this.setState({
- activeIndex: newIndex
- });
- };
-
- _proto.render = function render() {
- var _this2 = this;
-
- var _this$props = this.props,
- defaultActiveIndex = _this$props.defaultActiveIndex,
- autoPlay = _this$props.autoPlay,
- indicators = _this$props.indicators,
- controls = _this$props.controls,
- items = _this$props.items,
- goToIndex = _this$props.goToIndex,
- props = _objectWithoutPropertiesLoose(_this$props, ["defaultActiveIndex", "autoPlay", "indicators", "controls", "items", "goToIndex"]);
-
- var activeIndex = this.state.activeIndex;
- var slides = items.map(function (item) {
- return React.createElement(CarouselItem, {
- onExiting: _this2.onExiting,
- onExited: _this2.onExited,
- key: item.src
- }, React.createElement("img", {
- className: "d-block w-100",
- src: item.src,
- alt: item.altText
- }), React.createElement(CarouselCaption, {
- captionText: item.caption,
- captionHeader: item.header || item.caption
- }));
- });
- return React.createElement(Carousel, _extends({
- activeIndex: activeIndex,
- next: this.next,
- previous: this.previous,
- ride: autoPlay ? 'carousel' : undefined
- }, props), indicators && React.createElement(CarouselIndicators, {
- items: items,
- activeIndex: props.activeIndex || activeIndex,
- onClickHandler: goToIndex || this.goToIndex
- }), slides, controls && React.createElement(CarouselControl, {
- direction: "prev",
- directionText: "Previous",
- onClickHandler: props.previous || this.previous
- }), controls && React.createElement(CarouselControl, {
- direction: "next",
- directionText: "Next",
- onClickHandler: props.next || this.next
- }));
- };
-
- return UncontrolledCarousel;
- }(Component);
-
- UncontrolledCarousel.propTypes = propTypes$v;
- UncontrolledCarousel.defaultProps = {
- controls: true,
- indicators: true,
- autoPlay: true
- };
-
- var propTypes$w = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$u = {
- tag: 'div'
- };
-
- var CardSubtitle = function CardSubtitle(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-subtitle'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardSubtitle.propTypes = propTypes$w;
- CardSubtitle.defaultProps = defaultProps$u;
-
- var propTypes$x = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$v = {
- tag: 'p'
- };
-
- var CardText = function CardText(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-text'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardText.propTypes = propTypes$x;
- CardText.defaultProps = defaultProps$v;
-
- var propTypes$y = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$w = {
- tag: 'div'
- };
-
- var CardTitle = function CardTitle(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'card-title'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- CardTitle.propTypes = propTypes$y;
- CardTitle.defaultProps = defaultProps$w;
-
- var propTypes$z = {
- className: PropTypes.string,
- id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
- type: PropTypes.string.isRequired,
- label: PropTypes.node,
- inline: PropTypes.bool,
- valid: PropTypes.bool,
- invalid: PropTypes.bool,
- bsSize: PropTypes.string,
- cssModule: PropTypes.object,
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.array, PropTypes.func]),
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
- };
-
- function CustomInput(props) {
- var className = props.className,
- label = props.label,
- inline = props.inline,
- valid = props.valid,
- invalid = props.invalid,
- cssModule = props.cssModule,
- children = props.children,
- bsSize = props.bsSize,
- innerRef = props.innerRef,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "label", "inline", "valid", "invalid", "cssModule", "children", "bsSize", "innerRef"]);
-
- var type = attributes.type;
- var customClass = mapToCssModules(classNames(className, "custom-" + type, bsSize ? "custom-" + type + "-" + bsSize : false), cssModule);
- var validationClassNames = mapToCssModules(classNames(invalid && 'is-invalid', valid && 'is-valid'), cssModule);
-
- if (type === 'select') {
- return React.createElement("select", _extends({}, attributes, {
- ref: innerRef,
- className: classNames(validationClassNames, customClass)
- }), children);
- }
-
- if (type === 'file') {
- return React.createElement("div", {
- className: customClass
- }, React.createElement("input", _extends({}, attributes, {
- ref: innerRef,
- className: classNames(validationClassNames, mapToCssModules('custom-file-input', cssModule))
- })), React.createElement("label", {
- className: mapToCssModules('custom-file-label', cssModule),
- htmlFor: attributes.id
- }, label || 'Choose file'));
- }
-
- if (type !== 'checkbox' && type !== 'radio' && type !== 'switch') {
- return React.createElement("input", _extends({}, attributes, {
- ref: innerRef,
- className: classNames(validationClassNames, customClass)
- }));
- }
-
- var wrapperClasses = classNames(customClass, mapToCssModules(classNames('custom-control', {
- 'custom-control-inline': inline
- }), cssModule));
- return React.createElement("div", {
- className: wrapperClasses
- }, React.createElement("input", _extends({}, attributes, {
- type: type === 'switch' ? 'checkbox' : type,
- ref: innerRef,
- className: classNames(validationClassNames, mapToCssModules('custom-control-input', cssModule))
- })), React.createElement("label", {
- className: mapToCssModules('custom-control-label', cssModule),
- htmlFor: attributes.id
- }, label), children);
- }
-
- CustomInput.propTypes = propTypes$z;
-
- var propTypes$A = {
- children: PropTypes.node.isRequired,
- className: PropTypes.string,
- placement: PropTypes.string,
- placementPrefix: PropTypes.string,
- arrowClassName: PropTypes.string,
- hideArrow: PropTypes.bool,
- tag: tagPropType,
- isOpen: PropTypes.bool.isRequired,
- cssModule: PropTypes.object,
- offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
- fallbackPlacement: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
- flip: PropTypes.bool,
- container: targetPropType,
- target: targetPropType.isRequired,
- modifiers: PropTypes.object,
- boundariesElement: PropTypes.oneOfType([PropTypes.string, DOMElement])
- };
- var defaultProps$x = {
- boundariesElement: 'scrollParent',
- placement: 'auto',
- hideArrow: false,
- isOpen: false,
- offset: 0,
- fallbackPlacement: 'flip',
- flip: true,
- container: 'body',
- modifiers: {}
- };
- var childContextTypes$1 = {
- popperManager: PropTypes.object.isRequired
- };
-
- var PopperContent =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(PopperContent, _React$Component);
-
- function PopperContent(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.handlePlacementChange = _this.handlePlacementChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.setTargetNode = _this.setTargetNode.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.getTargetNode = _this.getTargetNode.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.state = {};
- return _this;
- }
-
- var _proto = PopperContent.prototype;
-
- _proto.getChildContext = function getChildContext() {
- return {
- popperManager: {
- setTargetNode: this.setTargetNode,
- getTargetNode: this.getTargetNode
- }
- };
- };
-
- _proto.componentDidUpdate = function componentDidUpdate() {
- if (this._element && this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) {
- this._element.childNodes[0].focus();
- }
- };
-
- _proto.setTargetNode = function setTargetNode(node) {
- this.targetNode = node;
- };
-
- _proto.getTargetNode = function getTargetNode() {
- return this.targetNode;
- };
-
- _proto.getContainerNode = function getContainerNode() {
- return getTarget(this.props.container);
- };
-
- _proto.getRef = function getRef(ref) {
- this._element = ref;
- };
-
- _proto.handlePlacementChange = function handlePlacementChange(data) {
- if (this.state.placement !== data.placement) {
- this.setState({
- placement: data.placement
- });
- }
-
- return data;
- };
-
- _proto.renderChildren = function renderChildren() {
- var _this$props = this.props,
- cssModule = _this$props.cssModule,
- children = _this$props.children,
- isOpen = _this$props.isOpen,
- flip = _this$props.flip,
- target = _this$props.target,
- offset = _this$props.offset,
- fallbackPlacement = _this$props.fallbackPlacement,
- placementPrefix = _this$props.placementPrefix,
- _arrowClassName = _this$props.arrowClassName,
- hideArrow = _this$props.hideArrow,
- className = _this$props.className,
- tag = _this$props.tag,
- container = _this$props.container,
- modifiers = _this$props.modifiers,
- boundariesElement = _this$props.boundariesElement,
- attrs = _objectWithoutPropertiesLoose(_this$props, ["cssModule", "children", "isOpen", "flip", "target", "offset", "fallbackPlacement", "placementPrefix", "arrowClassName", "hideArrow", "className", "tag", "container", "modifiers", "boundariesElement"]);
-
- var arrowClassName = mapToCssModules(classNames('arrow', _arrowClassName), cssModule);
- var placement = (this.state.placement || attrs.placement).split('-')[0];
- var popperClassName = mapToCssModules(classNames(className, placementPrefix ? placementPrefix + "-" + placement : placement), this.props.cssModule);
-
- var extendedModifiers = _extends({
- offset: {
- offset: offset
- },
- flip: {
- enabled: flip,
- behavior: fallbackPlacement
- },
- preventOverflow: {
- boundariesElement: boundariesElement
- },
- update: {
- enabled: true,
- order: 950,
- fn: this.handlePlacementChange
- }
- }, modifiers);
-
- return React.createElement(Popper, _extends({
- modifiers: extendedModifiers
- }, attrs, {
- component: tag,
- className: popperClassName,
- "x-placement": this.state.placement || attrs.placement
- }), children, !hideArrow && React.createElement(Arrow, {
- className: arrowClassName
- }));
- };
-
- _proto.render = function render() {
- this.setTargetNode(getTarget(this.props.target));
-
- if (this.props.isOpen) {
- return this.props.container === 'inline' ? this.renderChildren() : ReactDOM.createPortal(React.createElement("div", {
- ref: this.getRef
- }, this.renderChildren()), this.getContainerNode());
- }
-
- return null;
- };
-
- return PopperContent;
- }(React.Component);
-
- PopperContent.propTypes = propTypes$A;
- PopperContent.defaultProps = defaultProps$x;
- PopperContent.childContextTypes = childContextTypes$1;
-
- var PopperTargetHelper = function PopperTargetHelper(props, context) {
- context.popperManager.setTargetNode(getTarget(props.target));
- return null;
- };
-
- PopperTargetHelper.contextTypes = {
- popperManager: PropTypes.object.isRequired
- };
- PopperTargetHelper.propTypes = {
- target: targetPropType.isRequired
- };
-
- var propTypes$B = {
- placement: PropTypes.oneOf(PopperPlacements),
- target: targetPropType.isRequired,
- container: targetPropType,
- isOpen: PropTypes.bool,
- disabled: PropTypes.bool,
- hideArrow: PropTypes.bool,
- boundariesElement: PropTypes.oneOfType([PropTypes.string, DOMElement]),
- className: PropTypes.string,
- innerClassName: PropTypes.string,
- arrowClassName: PropTypes.string,
- cssModule: PropTypes.object,
- toggle: PropTypes.func,
- autohide: PropTypes.bool,
- placementPrefix: PropTypes.string,
- delay: PropTypes.oneOfType([PropTypes.shape({
- show: PropTypes.number,
- hide: PropTypes.number
- }), PropTypes.number]),
- modifiers: PropTypes.object,
- offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
- innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object]),
- trigger: PropTypes.string
- };
- var DEFAULT_DELAYS = {
- show: 0,
- hide: 250
- };
- var defaultProps$y = {
- isOpen: false,
- hideArrow: false,
- autohide: false,
- delay: DEFAULT_DELAYS,
- toggle: function toggle() {},
- trigger: 'click'
- };
-
- function isInDOMSubtree(element, subtreeRoot) {
- return subtreeRoot && (element === subtreeRoot || subtreeRoot.contains(element));
- }
-
- var TooltipPopoverWrapper =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(TooltipPopoverWrapper, _React$Component);
-
- function TooltipPopoverWrapper(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this._target = null;
- _this.addTargetEvents = _this.addTargetEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.removeTargetEvents = _this.removeTargetEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.showWithDelay = _this.showWithDelay.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.hideWithDelay = _this.hideWithDelay.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.show = _this.show.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.hide = _this.hide.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onEscKeyDown = _this.onEscKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = TooltipPopoverWrapper.prototype;
-
- _proto.componentDidMount = function componentDidMount() {
- this.updateTarget();
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this.removeTargetEvents();
- };
-
- _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {
- if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
- if (this._hideTimeout) {
- this.clearHideTimeout();
- }
- }
- };
-
- _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {
- if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
- if (this._showTimeout) {
- this.clearShowTimeout();
- }
-
- e.persist();
- this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
- }
- };
-
- _proto.onEscKeyDown = function onEscKeyDown(e) {
- if (e.key === 'Escape') {
- this.hide(e);
- }
- };
-
- _proto.getRef = function getRef(ref) {
- var innerRef = this.props.innerRef;
-
- if (innerRef) {
- if (typeof innerRef === 'function') {
- innerRef(ref);
- } else if (typeof innerRef === 'object') {
- innerRef.current = ref;
- }
- }
-
- this._popover = ref;
- };
-
- _proto.getDelay = function getDelay(key) {
- var delay = this.props.delay;
-
- if (typeof delay === 'object') {
- return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];
- }
-
- return delay;
- };
-
- _proto.show = function show(e) {
- if (!this.props.isOpen) {
- this.clearShowTimeout();
- this.toggle(e);
- }
- };
-
- _proto.showWithDelay = function showWithDelay(e) {
- if (this._hideTimeout) {
- this.clearHideTimeout();
- }
-
- this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));
- };
-
- _proto.hide = function hide(e) {
- if (this.props.isOpen) {
- this.clearHideTimeout();
- this.toggle(e);
- }
- };
-
- _proto.hideWithDelay = function hideWithDelay(e) {
- if (this._showTimeout) {
- this.clearShowTimeout();
- }
-
- this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
- };
-
- _proto.clearShowTimeout = function clearShowTimeout() {
- clearTimeout(this._showTimeout);
- this._showTimeout = undefined;
- };
-
- _proto.clearHideTimeout = function clearHideTimeout() {
- clearTimeout(this._hideTimeout);
- this._hideTimeout = undefined;
- };
-
- _proto.handleDocumentClick = function handleDocumentClick(e) {
- var triggers = this.props.trigger.split(' ');
-
- if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtree(e.target, this._target))) {
- if (this._hideTimeout) {
- this.clearHideTimeout();
- }
-
- if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {
- this.hideWithDelay(e);
- } else {
- this.showWithDelay(e);
- }
- } else if (triggers.indexOf('click') > -1 && isInDOMSubtree(e.target, this._target)) {
- if (this._hideTimeout) {
- this.clearHideTimeout();
- }
-
- if (!this.props.isOpen) {
- this.showWithDelay(e);
- } else {
- this.hideWithDelay(e);
- }
- }
- };
-
- _proto.addTargetEvents = function addTargetEvents() {
- var _this2 = this;
-
- if (this.props.trigger) {
- var triggers = this.props.trigger.split(' ');
-
- if (triggers.indexOf('manual') === -1) {
- if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {
- ['click', 'touchstart'].forEach(function (event) {
- return document.addEventListener(event, _this2.handleDocumentClick, true);
- });
- }
-
- if (this._target) {
- if (triggers.indexOf('hover') > -1) {
- this._target.addEventListener('mouseover', this.showWithDelay, true);
-
- this._target.addEventListener('mouseout', this.hideWithDelay, true);
- }
-
- if (triggers.indexOf('focus') > -1) {
- this._target.addEventListener('focusin', this.show, true);
-
- this._target.addEventListener('focusout', this.hide, true);
- }
-
- this._target.addEventListener('keydown', this.onEscKeyDown, true);
- }
- }
- }
- };
-
- _proto.removeTargetEvents = function removeTargetEvents() {
- var _this3 = this;
-
- if (this._target) {
- this._target.removeEventListener('mouseover', this.showWithDelay, true);
-
- this._target.removeEventListener('mouseout', this.hideWithDelay, true);
-
- this._target.removeEventListener('keydown', this.onEscKeyDown, true);
-
- this._target.removeEventListener('focusin', this.show, true);
-
- this._target.removeEventListener('focusout', this.hide, true);
- }
-
- ['click', 'touchstart'].forEach(function (event) {
- return document.removeEventListener(event, _this3.handleDocumentClick, true);
- });
- };
-
- _proto.updateTarget = function updateTarget() {
- var newTarget = getTarget(this.props.target);
-
- if (newTarget !== this._target) {
- this.removeTargetEvents();
- this._target = newTarget;
- this.addTargetEvents();
- }
- };
-
- _proto.toggle = function toggle(e) {
- if (this.props.disabled) {
- return e && e.preventDefault();
- }
-
- return this.props.toggle(e);
- };
-
- _proto.render = function render() {
- if (!this.props.isOpen) {
- return null;
- }
-
- this.updateTarget();
- var _this$props = this.props,
- className = _this$props.className,
- cssModule = _this$props.cssModule,
- innerClassName = _this$props.innerClassName,
- target = _this$props.target,
- isOpen = _this$props.isOpen,
- hideArrow = _this$props.hideArrow,
- boundariesElement = _this$props.boundariesElement,
- placement = _this$props.placement,
- placementPrefix = _this$props.placementPrefix,
- arrowClassName = _this$props.arrowClassName,
- container = _this$props.container,
- modifiers = _this$props.modifiers,
- offset = _this$props.offset;
- var attributes = omit(this.props, Object.keys(propTypes$B));
- var popperClasses = mapToCssModules(className, cssModule);
- var classes = mapToCssModules(innerClassName, cssModule);
- return React.createElement(PopperContent, {
- className: popperClasses,
- target: target,
- isOpen: isOpen,
- hideArrow: hideArrow,
- boundariesElement: boundariesElement,
- placement: placement,
- placementPrefix: placementPrefix,
- arrowClassName: arrowClassName,
- container: container,
- modifiers: modifiers,
- offset: offset,
- cssModule: cssModule
- }, React.createElement("div", _extends({}, attributes, {
- ref: this.getRef,
- className: classes,
- role: "tooltip",
- "aria-hidden": isOpen,
- onMouseOver: this.onMouseOverTooltipContent,
- onMouseLeave: this.onMouseLeaveTooltipContent,
- onKeyDown: this.onEscKeyDown
- })));
- };
-
- return TooltipPopoverWrapper;
- }(React.Component);
-
- TooltipPopoverWrapper.propTypes = propTypes$B;
- TooltipPopoverWrapper.defaultProps = defaultProps$y;
-
- var defaultProps$z = {
- placement: 'right',
- placementPrefix: 'bs-popover',
- trigger: 'click'
- };
-
- var Popover = function Popover(props) {
- var popperClasses = classNames('popover', 'show', props.className);
- var classes = classNames('popover-inner', props.innerClassName);
- return React.createElement(TooltipPopoverWrapper, _extends({}, props, {
- className: popperClasses,
- innerClassName: classes
- }));
- };
-
- Popover.propTypes = propTypes$B;
- Popover.defaultProps = defaultProps$z;
-
- var omitKeys = ['defaultOpen'];
-
- var UncontrolledPopover =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(UncontrolledPopover, _Component);
-
- function UncontrolledPopover(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.state = {
- isOpen: props.defaultOpen || false
- };
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = UncontrolledPopover.prototype;
-
- _proto.toggle = function toggle() {
- this.setState({
- isOpen: !this.state.isOpen
- });
- };
-
- _proto.render = function render() {
- return React.createElement(Popover, _extends({
- isOpen: this.state.isOpen,
- toggle: this.toggle
- }, omit(this.props, omitKeys)));
- };
-
- return UncontrolledPopover;
- }(Component);
- UncontrolledPopover.propTypes = _extends({
- defaultOpen: PropTypes.bool
- }, Popover.propTypes);
-
- var propTypes$C = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$A = {
- tag: 'h3'
- };
-
- var PopoverHeader = function PopoverHeader(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'popover-header'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- PopoverHeader.propTypes = propTypes$C;
- PopoverHeader.defaultProps = defaultProps$A;
-
- function PopoverTitle(props) {
- warnOnce('The "PopoverTitle" component has been deprecated.\nPlease use component "PopoverHeader".');
- return React.createElement(PopoverHeader, props);
- }
-
- var propTypes$D = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$B = {
- tag: 'div'
- };
-
- var PopoverBody = function PopoverBody(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'popover-body'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- PopoverBody.propTypes = propTypes$D;
- PopoverBody.defaultProps = defaultProps$B;
-
- function PopoverContent(props) {
- warnOnce('The "PopoverContent" component has been deprecated.\nPlease use component "PopoverBody".');
- return React.createElement(PopoverBody, props);
- }
-
- var propTypes$E = {
- children: PropTypes.node,
- bar: PropTypes.bool,
- multi: PropTypes.bool,
- tag: tagPropType,
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
- max: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
- animated: PropTypes.bool,
- striped: PropTypes.bool,
- color: PropTypes.string,
- className: PropTypes.string,
- barClassName: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$C = {
- tag: 'div',
- value: 0,
- max: 100
- };
-
- var Progress = function Progress(props) {
- var children = props.children,
- className = props.className,
- barClassName = props.barClassName,
- cssModule = props.cssModule,
- value = props.value,
- max = props.max,
- animated = props.animated,
- striped = props.striped,
- color = props.color,
- bar = props.bar,
- multi = props.multi,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["children", "className", "barClassName", "cssModule", "value", "max", "animated", "striped", "color", "bar", "multi", "tag"]);
-
- var percent = toNumber(value) / toNumber(max) * 100;
- var progressClasses = mapToCssModules(classNames(className, 'progress'), cssModule);
- 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);
- var ProgressBar = multi ? children : React.createElement("div", {
- className: progressBarClasses,
- style: {
- width: percent + "%"
- },
- role: "progressbar",
- "aria-valuenow": value,
- "aria-valuemin": "0",
- "aria-valuemax": max,
- children: children
- });
-
- if (bar) {
- return ProgressBar;
- }
-
- return React.createElement(Tag, _extends({}, attributes, {
- className: progressClasses,
- children: ProgressBar
- }));
- };
-
- Progress.propTypes = propTypes$E;
- Progress.defaultProps = defaultProps$C;
-
- var propTypes$F = {
- children: PropTypes.node.isRequired,
- node: PropTypes.any
- };
-
- var Portal =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Portal, _React$Component);
-
- function Portal() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = Portal.prototype;
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- if (this.defaultNode) {
- document.body.removeChild(this.defaultNode);
- }
-
- this.defaultNode = null;
- };
-
- _proto.render = function render() {
- if (!canUseDOM) {
- return null;
- }
-
- if (!this.props.node && !this.defaultNode) {
- this.defaultNode = document.createElement('div');
- document.body.appendChild(this.defaultNode);
- }
-
- return ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);
- };
-
- return Portal;
- }(React.Component);
-
- Portal.propTypes = propTypes$F;
-
- function noop() {}
-
- var FadePropTypes = PropTypes.shape(Fade.propTypes);
- var propTypes$G = {
- isOpen: PropTypes.bool,
- autoFocus: PropTypes.bool,
- centered: PropTypes.bool,
- size: PropTypes.string,
- toggle: PropTypes.func,
- keyboard: PropTypes.bool,
- role: PropTypes.string,
- labelledBy: PropTypes.string,
- backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['static'])]),
- onEnter: PropTypes.func,
- onExit: PropTypes.func,
- onOpened: PropTypes.func,
- onClosed: PropTypes.func,
- children: PropTypes.node,
- className: PropTypes.string,
- wrapClassName: PropTypes.string,
- modalClassName: PropTypes.string,
- backdropClassName: PropTypes.string,
- contentClassName: PropTypes.string,
- external: PropTypes.node,
- fade: PropTypes.bool,
- cssModule: PropTypes.object,
- zIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
- backdropTransition: FadePropTypes,
- modalTransition: FadePropTypes,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
- };
- var propsToOmit = Object.keys(propTypes$G);
- var defaultProps$D = {
- isOpen: false,
- autoFocus: true,
- centered: false,
- role: 'dialog',
- backdrop: true,
- keyboard: true,
- zIndex: 1050,
- fade: true,
- onOpened: noop,
- onClosed: noop,
- modalTransition: {
- timeout: TransitionTimeouts.Modal
- },
- backdropTransition: {
- mountOnEnter: true,
- timeout: TransitionTimeouts.Fade // uses standard fade transition
-
- }
- };
-
- var Modal =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Modal, _React$Component);
-
- function Modal(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this._element = null;
- _this._originalBodyPadding = null;
- _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.state = {
- isOpen: props.isOpen
- };
-
- if (props.isOpen) {
- _this.init();
- }
-
- return _this;
- }
-
- var _proto = Modal.prototype;
-
- _proto.componentDidMount = function componentDidMount() {
- if (this.props.onEnter) {
- this.props.onEnter();
- }
-
- if (this.state.isOpen && this.props.autoFocus) {
- this.setFocus();
- }
-
- this._isMounted = true;
- };
-
- _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- if (nextProps.isOpen && !this.props.isOpen) {
- this.setState({
- isOpen: nextProps.isOpen
- });
- }
- };
-
- _proto.componentWillUpdate = function componentWillUpdate(nextProps, nextState) {
- if (nextState.isOpen && !this.state.isOpen) {
- this.init();
- }
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
- if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {
- this.setFocus();
- }
-
- if (this._element && prevProps.zIndex !== this.props.zIndex) {
- this._element.style.zIndex = this.props.zIndex;
- }
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- if (this.props.onExit) {
- this.props.onExit();
- }
-
- if (this.state.isOpen) {
- this.destroy();
- }
-
- this._isMounted = false;
- };
-
- _proto.onOpened = function onOpened(node, isAppearing) {
- this.props.onOpened();
- (this.props.modalTransition.onEntered || noop)(node, isAppearing);
- };
-
- _proto.onClosed = function onClosed(node) {
- // so all methods get called before it is unmounted
- this.props.onClosed();
- (this.props.modalTransition.onExited || noop)(node);
- this.destroy();
-
- if (this._isMounted) {
- this.setState({
- isOpen: false
- });
- }
- };
-
- _proto.setFocus = function setFocus() {
- if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') {
- this._dialog.parentNode.focus();
- }
- };
-
- _proto.getFocusableChildren = function getFocusableChildren() {
- return this._element.querySelectorAll(focusableElements.join(', '));
- };
-
- _proto.getFocusedChild = function getFocusedChild() {
- var currentFocus;
- var focusableChildren = this.getFocusableChildren();
-
- try {
- currentFocus = document.activeElement;
- } catch (err) {
- currentFocus = focusableChildren[0];
- }
-
- return currentFocus;
- } // not mouseUp because scrollbar fires it, shouldn't close when user scrolls
- ;
-
- _proto.handleBackdropClick = function handleBackdropClick(e) {
- if (e.target === this._mouseDownElement) {
- e.stopPropagation();
- if (!this.props.isOpen || this.props.backdrop !== true) return;
- var backdrop = this._dialog ? this._dialog.parentNode : null;
-
- if (backdrop && e.target === backdrop && this.props.toggle) {
- this.props.toggle(e);
- }
- }
- };
-
- _proto.handleTab = function handleTab(e) {
- if (e.which !== 9) return;
- var focusableChildren = this.getFocusableChildren();
- var totalFocusable = focusableChildren.length;
- var currentFocus = this.getFocusedChild();
- var focusedIndex = 0;
-
- for (var i = 0; i < totalFocusable; i += 1) {
- if (focusableChildren[i] === currentFocus) {
- focusedIndex = i;
- break;
- }
- }
-
- if (e.shiftKey && focusedIndex === 0) {
- e.preventDefault();
- focusableChildren[totalFocusable - 1].focus();
- } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {
- e.preventDefault();
- focusableChildren[0].focus();
- }
- };
-
- _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {
- this._mouseDownElement = e.target;
- };
-
- _proto.handleEscape = function handleEscape(e) {
- if (this.props.isOpen && this.props.keyboard && e.keyCode === 27 && this.props.toggle) {
- e.preventDefault();
- e.stopPropagation();
- this.props.toggle(e);
- }
- };
-
- _proto.init = function init() {
- try {
- this._triggeringElement = document.activeElement;
- } catch (err) {
- this._triggeringElement = null;
- }
-
- this._element = document.createElement('div');
-
- this._element.setAttribute('tabindex', '-1');
-
- this._element.style.position = 'relative';
- this._element.style.zIndex = this.props.zIndex;
- this._originalBodyPadding = getOriginalBodyPadding();
- conditionallyUpdateScrollbar();
- document.body.appendChild(this._element);
-
- if (Modal.openCount === 0) {
- document.body.className = classNames(document.body.className, mapToCssModules('modal-open', this.props.cssModule));
- }
-
- Modal.openCount += 1;
- };
-
- _proto.destroy = function destroy() {
- if (this._element) {
- document.body.removeChild(this._element);
- this._element = null;
- }
-
- if (this._triggeringElement) {
- if (this._triggeringElement.focus) this._triggeringElement.focus();
- this._triggeringElement = null;
- }
-
- if (Modal.openCount <= 1) {
- 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`
-
- var modalOpenClassNameRegex = new RegExp("(^| )" + modalOpenClassName + "( |$)");
- document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim();
- }
-
- Modal.openCount -= 1;
- setScrollbarWidth(this._originalBodyPadding);
- };
-
- _proto.renderModalDialog = function renderModalDialog() {
- var _classNames,
- _this2 = this;
-
- var attributes = omit(this.props, propsToOmit);
- var dialogBaseClass = 'modal-dialog';
- return React.createElement("div", _extends({}, attributes, {
- 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),
- role: "document",
- ref: function ref(c) {
- _this2._dialog = c;
- }
- }), React.createElement("div", {
- className: mapToCssModules(classNames('modal-content', this.props.contentClassName), this.props.cssModule)
- }, this.props.children));
- };
-
- _proto.render = function render() {
- if (this.state.isOpen) {
- var _this$props = this.props,
- wrapClassName = _this$props.wrapClassName,
- modalClassName = _this$props.modalClassName,
- backdropClassName = _this$props.backdropClassName,
- cssModule = _this$props.cssModule,
- isOpen = _this$props.isOpen,
- backdrop = _this$props.backdrop,
- role = _this$props.role,
- labelledBy = _this$props.labelledBy,
- external = _this$props.external,
- innerRef = _this$props.innerRef;
- var modalAttributes = {
- onClick: this.handleBackdropClick,
- onMouseDown: this.handleBackdropMouseDown,
- onKeyUp: this.handleEscape,
- onKeyDown: this.handleTab,
- style: {
- display: 'block'
- },
- 'aria-labelledby': labelledBy,
- role: role,
- tabIndex: '-1'
- };
- var hasTransition = this.props.fade;
-
- var modalTransition = _extends({}, Fade.defaultProps, this.props.modalTransition, {
- baseClass: hasTransition ? this.props.modalTransition.baseClass : '',
- timeout: hasTransition ? this.props.modalTransition.timeout : 0
- });
-
- var backdropTransition = _extends({}, Fade.defaultProps, this.props.backdropTransition, {
- baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',
- timeout: hasTransition ? this.props.backdropTransition.timeout : 0
- });
-
- var Backdrop = backdrop && (hasTransition ? React.createElement(Fade, _extends({}, backdropTransition, {
- in: isOpen && !!backdrop,
- cssModule: cssModule,
- className: mapToCssModules(classNames('modal-backdrop', backdropClassName), cssModule)
- })) : React.createElement("div", {
- className: mapToCssModules(classNames('modal-backdrop', 'show', backdropClassName), cssModule)
- }));
- return React.createElement(Portal, {
- node: this._element
- }, React.createElement("div", {
- className: mapToCssModules(wrapClassName)
- }, React.createElement(Fade, _extends({}, modalAttributes, modalTransition, {
- in: isOpen,
- onEntered: this.onOpened,
- onExited: this.onClosed,
- cssModule: cssModule,
- className: mapToCssModules(classNames('modal', modalClassName), cssModule),
- innerRef: innerRef
- }), external, this.renderModalDialog()), Backdrop));
- }
-
- return null;
- };
-
- return Modal;
- }(React.Component);
-
- Modal.propTypes = propTypes$G;
- Modal.defaultProps = defaultProps$D;
- Modal.openCount = 0;
-
- var propTypes$H = {
- tag: tagPropType,
- wrapTag: tagPropType,
- toggle: PropTypes.func,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- children: PropTypes.node,
- closeAriaLabel: PropTypes.string,
- charCode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
- close: PropTypes.object
- };
- var defaultProps$E = {
- tag: 'h5',
- wrapTag: 'div',
- closeAriaLabel: 'Close',
- charCode: 215
- };
-
- var ModalHeader = function ModalHeader(props) {
- var closeButton;
-
- var className = props.className,
- cssModule = props.cssModule,
- children = props.children,
- toggle = props.toggle,
- Tag = props.tag,
- WrapTag = props.wrapTag,
- closeAriaLabel = props.closeAriaLabel,
- charCode = props.charCode,
- close = props.close,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close"]);
-
- var classes = mapToCssModules(classNames(className, 'modal-header'), cssModule);
-
- if (!close && toggle) {
- var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
- closeButton = React.createElement("button", {
- type: "button",
- onClick: toggle,
- className: mapToCssModules('close', cssModule),
- "aria-label": closeAriaLabel
- }, React.createElement("span", {
- "aria-hidden": "true"
- }, closeIcon));
- }
-
- return React.createElement(WrapTag, _extends({}, attributes, {
- className: classes
- }), React.createElement(Tag, {
- className: mapToCssModules('modal-title', cssModule)
- }, children), close || closeButton);
- };
-
- ModalHeader.propTypes = propTypes$H;
- ModalHeader.defaultProps = defaultProps$E;
-
- var propTypes$I = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$F = {
- tag: 'div'
- };
-
- var ModalBody = function ModalBody(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'modal-body'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- ModalBody.propTypes = propTypes$I;
- ModalBody.defaultProps = defaultProps$F;
-
- var propTypes$J = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$G = {
- tag: 'div'
- };
-
- var ModalFooter = function ModalFooter(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'modal-footer'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- ModalFooter.propTypes = propTypes$J;
- ModalFooter.defaultProps = defaultProps$G;
-
- var defaultProps$H = {
- placement: 'top',
- autohide: true,
- placementPrefix: 'bs-tooltip',
- trigger: 'click hover focus'
- };
-
- var Tooltip = function Tooltip(props) {
- var popperClasses = classNames('tooltip', 'show', props.className);
- var classes = classNames('tooltip-inner', props.innerClassName);
- return React.createElement(TooltipPopoverWrapper, _extends({}, props, {
- className: popperClasses,
- innerClassName: classes
- }));
- };
-
- Tooltip.propTypes = propTypes$B;
- Tooltip.defaultProps = defaultProps$H;
-
- var propTypes$K = {
- className: PropTypes.string,
- cssModule: PropTypes.object,
- size: PropTypes.string,
- bordered: PropTypes.bool,
- borderless: PropTypes.bool,
- striped: PropTypes.bool,
- inverse: deprecated(PropTypes.bool, 'Please use the prop "dark"'),
- dark: PropTypes.bool,
- hover: PropTypes.bool,
- responsive: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
- tag: tagPropType,
- responsiveTag: tagPropType,
- innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object])
- };
- var defaultProps$I = {
- tag: 'table',
- responsiveTag: 'div'
- };
-
- var Table = function Table(props) {
- var className = props.className,
- cssModule = props.cssModule,
- size = props.size,
- bordered = props.bordered,
- borderless = props.borderless,
- striped = props.striped,
- inverse = props.inverse,
- dark = props.dark,
- hover = props.hover,
- responsive = props.responsive,
- Tag = props.tag,
- ResponsiveTag = props.responsiveTag,
- innerRef = props.innerRef,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "bordered", "borderless", "striped", "inverse", "dark", "hover", "responsive", "tag", "responsiveTag", "innerRef"]);
-
- 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);
- var table = React.createElement(Tag, _extends({}, attributes, {
- ref: innerRef,
- className: classes
- }));
-
- if (responsive) {
- var responsiveClassName = responsive === true ? 'table-responsive' : "table-responsive-" + responsive;
- return React.createElement(ResponsiveTag, {
- className: responsiveClassName
- }, table);
- }
-
- return table;
- };
-
- Table.propTypes = propTypes$K;
- Table.defaultProps = defaultProps$I;
-
- var propTypes$L = {
- tag: tagPropType,
- flush: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$J = {
- tag: 'ul'
- };
-
- var ListGroup = function ListGroup(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- flush = props.flush,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "flush"]);
-
- var classes = mapToCssModules(classNames(className, 'list-group', flush ? 'list-group-flush' : false), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- ListGroup.propTypes = propTypes$L;
- ListGroup.defaultProps = defaultProps$J;
-
- var propTypes$M = {
- children: PropTypes.node,
- inline: PropTypes.bool,
- tag: tagPropType,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$K = {
- tag: 'form'
- };
-
- var Form =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(Form, _Component);
-
- function Form(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.submit = _this.submit.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = Form.prototype;
-
- _proto.getRef = function getRef(ref) {
- if (this.props.innerRef) {
- this.props.innerRef(ref);
- }
-
- this.ref = ref;
- };
-
- _proto.submit = function submit() {
- if (this.ref) {
- this.ref.submit();
- }
- };
-
- _proto.render = function render() {
- var _this$props = this.props,
- className = _this$props.className,
- cssModule = _this$props.cssModule,
- inline = _this$props.inline,
- Tag = _this$props.tag,
- innerRef = _this$props.innerRef,
- attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "inline", "tag", "innerRef"]);
-
- var classes = mapToCssModules(classNames(className, inline ? 'form-inline' : false), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- ref: innerRef,
- className: classes
- }));
- };
-
- return Form;
- }(Component);
-
- Form.propTypes = propTypes$M;
- Form.defaultProps = defaultProps$K;
-
- var propTypes$N = {
- children: PropTypes.node,
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- valid: PropTypes.bool,
- tooltip: PropTypes.bool
- };
- var defaultProps$L = {
- tag: 'div',
- valid: undefined
- };
-
- var FormFeedback = function FormFeedback(props) {
- var className = props.className,
- cssModule = props.cssModule,
- valid = props.valid,
- tooltip = props.tooltip,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "valid", "tooltip", "tag"]);
-
- var validMode = tooltip ? 'tooltip' : 'feedback';
- var classes = mapToCssModules(classNames(className, valid ? "valid-" + validMode : "invalid-" + validMode), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- FormFeedback.propTypes = propTypes$N;
- FormFeedback.defaultProps = defaultProps$L;
-
- var propTypes$O = {
- children: PropTypes.node,
- row: PropTypes.bool,
- check: PropTypes.bool,
- inline: PropTypes.bool,
- disabled: PropTypes.bool,
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$M = {
- tag: 'div'
- };
-
- var FormGroup = function FormGroup(props) {
- var className = props.className,
- cssModule = props.cssModule,
- row = props.row,
- disabled = props.disabled,
- check = props.check,
- inline = props.inline,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "row", "disabled", "check", "inline", "tag"]);
-
- var classes = mapToCssModules(classNames(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- FormGroup.propTypes = propTypes$O;
- FormGroup.defaultProps = defaultProps$M;
-
- var propTypes$P = {
- children: PropTypes.node,
- inline: PropTypes.bool,
- tag: tagPropType,
- color: PropTypes.string,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$N = {
- tag: 'small',
- color: 'muted'
- };
-
- var FormText = function FormText(props) {
- var className = props.className,
- cssModule = props.cssModule,
- inline = props.inline,
- color = props.color,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "inline", "color", "tag"]);
-
- var classes = mapToCssModules(classNames(className, !inline ? 'form-text' : false, color ? "text-" + color : false), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- FormText.propTypes = propTypes$P;
- FormText.defaultProps = defaultProps$N;
-
- var propTypes$Q = {
- children: PropTypes.node,
- type: PropTypes.string,
- size: PropTypes.string,
- bsSize: PropTypes.string,
- state: deprecated(PropTypes.string, 'Please use the props "valid" and "invalid" to indicate the state.'),
- valid: PropTypes.bool,
- invalid: PropTypes.bool,
- tag: tagPropType,
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
- static: deprecated(PropTypes.bool, 'Please use the prop "plaintext"'),
- plaintext: PropTypes.bool,
- addon: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$O = {
- type: 'text'
- };
-
- var Input =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Input, _React$Component);
-
- function Input(props) {
- var _this;
-
- _this = _React$Component.call(this, props) || this;
- _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.focus = _this.focus.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = Input.prototype;
-
- _proto.getRef = function getRef(ref) {
- if (this.props.innerRef) {
- this.props.innerRef(ref);
- }
-
- this.ref = ref;
- };
-
- _proto.focus = function focus() {
- if (this.ref) {
- this.ref.focus();
- }
- };
-
- _proto.render = function render() {
- var _this$props = this.props,
- className = _this$props.className,
- cssModule = _this$props.cssModule,
- type = _this$props.type,
- bsSize = _this$props.bsSize,
- state = _this$props.state,
- valid = _this$props.valid,
- invalid = _this$props.invalid,
- tag = _this$props.tag,
- addon = _this$props.addon,
- staticInput = _this$props.static,
- plaintext = _this$props.plaintext,
- innerRef = _this$props.innerRef,
- attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "type", "bsSize", "state", "valid", "invalid", "tag", "addon", "static", "plaintext", "innerRef"]);
-
- var checkInput = ['radio', 'checkbox'].indexOf(type) > -1;
- var isNotaNumber = new RegExp('\\D', 'g');
- var fileInput = type === 'file';
- var textareaInput = type === 'textarea';
- var selectInput = type === 'select';
- var Tag = tag || (selectInput || textareaInput ? type : 'input');
- var formControlClass = 'form-control';
-
- if (plaintext || staticInput) {
- formControlClass = formControlClass + "-plaintext";
- Tag = tag || 'input';
- } else if (fileInput) {
- formControlClass = formControlClass + "-file";
- } else if (checkInput) {
- if (addon) {
- formControlClass = null;
- } else {
- formControlClass = 'form-check-input';
- }
- }
-
- if (state && typeof valid === 'undefined' && typeof invalid === 'undefined') {
- if (state === 'danger') {
- invalid = true;
- } else if (state === 'success') {
- valid = true;
- }
- }
-
- if (attributes.size && isNotaNumber.test(attributes.size)) {
- warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.');
- bsSize = attributes.size;
- delete attributes.size;
- }
-
- var classes = mapToCssModules(classNames(className, invalid && 'is-invalid', valid && 'is-valid', bsSize ? "form-control-" + bsSize : false, formControlClass), cssModule);
-
- if (Tag === 'input' || tag && typeof tag === 'function') {
- attributes.type = type;
- }
-
- if (attributes.children && !(plaintext || staticInput || type === 'select' || typeof Tag !== 'string' || Tag === 'select')) {
- warnOnce("Input with a type of \"" + type + "\" cannot have children. Please use \"value\"/\"defaultValue\" instead.");
- delete attributes.children;
- }
-
- return React.createElement(Tag, _extends({}, attributes, {
- ref: innerRef,
- className: classes
- }));
- };
-
- return Input;
- }(React.Component);
-
- Input.propTypes = propTypes$Q;
- Input.defaultProps = defaultProps$O;
-
- var propTypes$R = {
- tag: tagPropType,
- size: PropTypes.string,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$P = {
- tag: 'div'
- };
-
- var InputGroup = function InputGroup(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- size = props.size,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "size"]);
-
- var classes = mapToCssModules(classNames(className, 'input-group', size ? "input-group-" + size : null), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- InputGroup.propTypes = propTypes$R;
- InputGroup.defaultProps = defaultProps$P;
-
- var propTypes$S = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$Q = {
- tag: 'span'
- };
-
- var InputGroupText = function InputGroupText(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'input-group-text'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- InputGroupText.propTypes = propTypes$S;
- InputGroupText.defaultProps = defaultProps$Q;
-
- var propTypes$T = {
- tag: tagPropType,
- addonType: PropTypes.oneOf(['prepend', 'append']).isRequired,
- children: PropTypes.node,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$R = {
- tag: 'div'
- };
-
- var InputGroupAddon = function InputGroupAddon(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- addonType = props.addonType,
- children = props.children,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "addonType", "children"]);
-
- var classes = mapToCssModules(classNames(className, 'input-group-' + addonType), cssModule); // Convenience to assist with transition
-
- if (typeof children === 'string') {
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }), React.createElement(InputGroupText, {
- children: children
- }));
- }
-
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes,
- children: children
- }));
- };
-
- InputGroupAddon.propTypes = propTypes$T;
- InputGroupAddon.defaultProps = defaultProps$R;
-
- var propTypes$U = {
- tag: tagPropType,
- addonType: PropTypes.oneOf(['prepend', 'append']).isRequired,
- children: PropTypes.node,
- groupClassName: PropTypes.string,
- groupAttributes: PropTypes.object,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
-
- var InputGroupButton = function InputGroupButton(props) {
- warnOnce('The "InputGroupButton" component has been deprecated.\nPlease use component "InputGroupAddon".');
-
- var children = props.children,
- groupClassName = props.groupClassName,
- groupAttributes = props.groupAttributes,
- propsWithoutGroup = _objectWithoutPropertiesLoose(props, ["children", "groupClassName", "groupAttributes"]);
-
- if (typeof children === 'string') {
- var cssModule = propsWithoutGroup.cssModule,
- tag = propsWithoutGroup.tag,
- addonType = propsWithoutGroup.addonType,
- attributes = _objectWithoutPropertiesLoose(propsWithoutGroup, ["cssModule", "tag", "addonType"]);
-
- var allGroupAttributes = _extends({}, groupAttributes, {
- cssModule: cssModule,
- tag: tag,
- addonType: addonType
- });
-
- return React.createElement(InputGroupAddon, _extends({}, allGroupAttributes, {
- className: groupClassName
- }), React.createElement(Button, _extends({}, attributes, {
- children: children
- })));
- }
-
- return React.createElement(InputGroupAddon, _extends({}, props, {
- children: children
- }));
- };
-
- InputGroupButton.propTypes = propTypes$U;
-
- var propTypes$V = {
- addonType: PropTypes.oneOf(['prepend', 'append']).isRequired,
- children: PropTypes.node
- };
-
- var InputGroupButtonDropdown = function InputGroupButtonDropdown(props) {
- return React.createElement(Dropdown, props);
- };
-
- InputGroupButtonDropdown.propTypes = propTypes$V;
-
- var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl'];
- var stringOrNumberProp$1 = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);
- var columnProps$1 = PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.shape({
- size: stringOrNumberProp$1,
- push: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'),
- pull: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'),
- order: stringOrNumberProp$1,
- offset: stringOrNumberProp$1
- })]);
- var propTypes$W = {
- children: PropTypes.node,
- hidden: PropTypes.bool,
- check: PropTypes.bool,
- size: PropTypes.string,
- for: PropTypes.string,
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- xs: columnProps$1,
- sm: columnProps$1,
- md: columnProps$1,
- lg: columnProps$1,
- xl: columnProps$1,
- widths: PropTypes.array
- };
- var defaultProps$S = {
- tag: 'label',
- widths: colWidths$1
- };
-
- var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) {
- if (colSize === true || colSize === '') {
- return isXs ? 'col' : "col-" + colWidth;
- } else if (colSize === 'auto') {
- return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
- }
-
- return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
- };
-
- var Label = function Label(props) {
- var className = props.className,
- cssModule = props.cssModule,
- hidden = props.hidden,
- widths = props.widths,
- Tag = props.tag,
- check = props.check,
- size = props.size,
- htmlFor = props.for,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "hidden", "widths", "tag", "check", "size", "for"]);
-
- var colClasses = [];
- widths.forEach(function (colWidth, i) {
- var columnProp = props[colWidth];
- delete attributes[colWidth];
-
- if (!columnProp && columnProp !== '') {
- return;
- }
-
- var isXs = !i;
- var colClass;
-
- if (isobject(columnProp)) {
- var _classNames;
-
- var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
- colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size);
- 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);
- } else {
- colClass = getColumnSizeClass$1(isXs, colWidth, columnProp);
- colClasses.push(colClass);
- }
- });
- 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);
- return React.createElement(Tag, _extends({
- htmlFor: htmlFor
- }, attributes, {
- className: classes
- }));
- };
-
- Label.propTypes = propTypes$W;
- Label.defaultProps = defaultProps$S;
-
- var propTypes$X = {
- body: PropTypes.bool,
- bottom: PropTypes.bool,
- children: PropTypes.node,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- heading: PropTypes.bool,
- left: PropTypes.bool,
- list: PropTypes.bool,
- middle: PropTypes.bool,
- object: PropTypes.bool,
- right: PropTypes.bool,
- tag: tagPropType,
- top: PropTypes.bool
- };
-
- var Media = function Media(props) {
- var body = props.body,
- bottom = props.bottom,
- className = props.className,
- cssModule = props.cssModule,
- heading = props.heading,
- left = props.left,
- list = props.list,
- middle = props.middle,
- object = props.object,
- right = props.right,
- tag = props.tag,
- top = props.top,
- attributes = _objectWithoutPropertiesLoose(props, ["body", "bottom", "className", "cssModule", "heading", "left", "list", "middle", "object", "right", "tag", "top"]);
-
- var defaultTag;
-
- if (heading) {
- defaultTag = 'h4';
- } else if (attributes.href) {
- defaultTag = 'a';
- } else if (attributes.src || object) {
- defaultTag = 'img';
- } else if (list) {
- defaultTag = 'ul';
- } else {
- defaultTag = 'div';
- }
-
- var Tag = tag || defaultTag;
- var classes = mapToCssModules(classNames(className, {
- 'media-body': body,
- 'media-heading': heading,
- 'media-left': left,
- 'media-right': right,
- 'media-top': top,
- 'media-bottom': bottom,
- 'media-middle': middle,
- 'media-object': object,
- 'media-list': list,
- media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list
- }), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- Media.propTypes = propTypes$X;
-
- var propTypes$Y = {
- children: PropTypes.node,
- className: PropTypes.string,
- listClassName: PropTypes.string,
- cssModule: PropTypes.object,
- size: PropTypes.string,
- tag: tagPropType,
- listTag: tagPropType,
- 'aria-label': PropTypes.string
- };
- var defaultProps$T = {
- tag: 'nav',
- listTag: 'ul',
- 'aria-label': 'pagination'
- };
-
- var Pagination = function Pagination(props) {
- var _classNames;
-
- var className = props.className,
- listClassName = props.listClassName,
- cssModule = props.cssModule,
- size = props.size,
- Tag = props.tag,
- ListTag = props.listTag,
- label = props['aria-label'],
- attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"]);
-
- var classes = mapToCssModules(classNames(className), cssModule);
- var listClasses = mapToCssModules(classNames(listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
- return React.createElement(Tag, {
- className: classes,
- "aria-label": label
- }, React.createElement(ListTag, _extends({}, attributes, {
- className: listClasses
- })));
- };
-
- Pagination.propTypes = propTypes$Y;
- Pagination.defaultProps = defaultProps$T;
-
- var propTypes$Z = {
- active: PropTypes.bool,
- children: PropTypes.node,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- disabled: PropTypes.bool,
- tag: tagPropType
- };
- var defaultProps$U = {
- tag: 'li'
- };
-
- var PaginationItem = function PaginationItem(props) {
- var active = props.active,
- className = props.className,
- cssModule = props.cssModule,
- disabled = props.disabled,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["active", "className", "cssModule", "disabled", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'page-item', {
- active: active,
- disabled: disabled
- }), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- PaginationItem.propTypes = propTypes$Z;
- PaginationItem.defaultProps = defaultProps$U;
-
- var propTypes$_ = {
- 'aria-label': PropTypes.string,
- children: PropTypes.node,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- next: PropTypes.bool,
- previous: PropTypes.bool,
- tag: tagPropType
- };
- var defaultProps$V = {
- tag: 'a'
- };
-
- var PaginationLink = function PaginationLink(props) {
- var className = props.className,
- cssModule = props.cssModule,
- next = props.next,
- previous = props.previous,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "next", "previous", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'page-link'), cssModule);
- var defaultAriaLabel;
-
- if (previous) {
- defaultAriaLabel = 'Previous';
- } else if (next) {
- defaultAriaLabel = 'Next';
- }
-
- var ariaLabel = props['aria-label'] || defaultAriaLabel;
- var defaultCaret;
-
- if (previous) {
- defaultCaret = "\xAB";
- } else if (next) {
- defaultCaret = "\xBB";
- }
-
- var children = props.children;
-
- if (children && Array.isArray(children) && children.length === 0) {
- children = null;
- }
-
- if (!attributes.href && Tag === 'a') {
- Tag = 'button';
- }
-
- if (previous || next) {
- children = [React.createElement("span", {
- "aria-hidden": "true",
- key: "caret"
- }, children || defaultCaret), React.createElement("span", {
- className: "sr-only",
- key: "sr"
- }, ariaLabel)];
- }
-
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes,
- "aria-label": ariaLabel
- }), children);
- };
-
- PaginationLink.propTypes = propTypes$_;
- PaginationLink.defaultProps = defaultProps$V;
-
- var propTypes$10 = {
- tag: tagPropType,
- activeTab: PropTypes.any,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$W = {
- tag: 'div'
- };
- var childContextTypes$2 = {
- activeTabId: PropTypes.any
- };
-
- var TabContent =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(TabContent, _Component);
-
- TabContent.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
- if (prevState.activeTab !== nextProps.activeTab) {
- return {
- activeTab: nextProps.activeTab
- };
- }
-
- return null;
- };
-
- function TabContent(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.state = {
- activeTab: _this.props.activeTab
- };
- return _this;
- }
-
- var _proto = TabContent.prototype;
-
- _proto.getChildContext = function getChildContext() {
- return {
- activeTabId: this.state.activeTab
- };
- };
-
- _proto.render = function render() {
- var _this$props = this.props,
- className = _this$props.className,
- cssModule = _this$props.cssModule,
- Tag = _this$props.tag;
- var attributes = omit(this.props, Object.keys(propTypes$10));
- var classes = mapToCssModules(classNames('tab-content', className), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- return TabContent;
- }(Component);
-
- polyfill(TabContent);
- TabContent.propTypes = propTypes$10;
- TabContent.defaultProps = defaultProps$W;
- TabContent.childContextTypes = childContextTypes$2;
-
- var propTypes$11 = {
- tag: tagPropType,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- tabId: PropTypes.any
- };
- var defaultProps$X = {
- tag: 'div'
- };
- var contextTypes$3 = {
- activeTabId: PropTypes.any
- };
- function TabPane(props, context) {
- var className = props.className,
- cssModule = props.cssModule,
- tabId = props.tabId,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabId", "tag"]);
-
- var classes = mapToCssModules(classNames('tab-pane', className, {
- active: tabId === context.activeTabId
- }), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- }
- TabPane.propTypes = propTypes$11;
- TabPane.defaultProps = defaultProps$X;
- TabPane.contextTypes = contextTypes$3;
-
- var propTypes$12 = {
- tag: tagPropType,
- fluid: PropTypes.bool,
- className: PropTypes.string,
- cssModule: PropTypes.object
- };
- var defaultProps$Y = {
- tag: 'div'
- };
-
- var Jumbotron = function Jumbotron(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- fluid = props.fluid,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "fluid"]);
-
- var classes = mapToCssModules(classNames(className, 'jumbotron', fluid ? 'jumbotron-fluid' : false), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- Jumbotron.propTypes = propTypes$12;
- Jumbotron.defaultProps = defaultProps$Y;
-
- var propTypes$13 = {
- children: PropTypes.node,
- className: PropTypes.string,
- closeClassName: PropTypes.string,
- closeAriaLabel: PropTypes.string,
- cssModule: PropTypes.object,
- color: PropTypes.string,
- fade: PropTypes.bool,
- isOpen: PropTypes.bool,
- toggle: PropTypes.func,
- tag: tagPropType,
- transition: PropTypes.shape(Fade.propTypes),
- innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])
- };
- var defaultProps$Z = {
- color: 'success',
- isOpen: true,
- tag: 'div',
- closeAriaLabel: 'Close',
- fade: true,
- transition: _extends({}, Fade.defaultProps, {
- unmountOnExit: true
- })
- };
-
- function Alert(props) {
- var className = props.className,
- closeClassName = props.closeClassName,
- closeAriaLabel = props.closeAriaLabel,
- cssModule = props.cssModule,
- Tag = props.tag,
- color = props.color,
- isOpen = props.isOpen,
- toggle = props.toggle,
- children = props.children,
- transition = props.transition,
- fade = props.fade,
- innerRef = props.innerRef,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "closeClassName", "closeAriaLabel", "cssModule", "tag", "color", "isOpen", "toggle", "children", "transition", "fade", "innerRef"]);
-
- var classes = mapToCssModules(classNames(className, 'alert', "alert-" + color, {
- 'alert-dismissible': toggle
- }), cssModule);
- var closeClasses = mapToCssModules(classNames('close', closeClassName), cssModule);
-
- var alertTransition = _extends({}, Fade.defaultProps, transition, {
- baseClass: fade ? transition.baseClass : '',
- timeout: fade ? transition.timeout : 0
- });
-
- return React.createElement(Fade, _extends({}, attributes, alertTransition, {
- tag: Tag,
- className: classes,
- in: isOpen,
- role: "alert",
- innerRef: innerRef
- }), toggle ? React.createElement("button", {
- type: "button",
- className: closeClasses,
- "aria-label": closeAriaLabel,
- onClick: toggle
- }, React.createElement("span", {
- "aria-hidden": "true"
- }, "\xD7")) : null, children);
- }
-
- Alert.propTypes = propTypes$13;
- Alert.defaultProps = defaultProps$Z;
-
- var _transitionStatusToCl;
-
- var propTypes$14 = _extends({}, Transition.propTypes, {
- isOpen: PropTypes.bool,
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
- tag: tagPropType,
- className: PropTypes.node,
- navbar: PropTypes.bool,
- cssModule: PropTypes.object,
- innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object])
- });
-
- var defaultProps$_ = _extends({}, Transition.defaultProps, {
- isOpen: false,
- appear: false,
- enter: true,
- exit: true,
- tag: 'div',
- timeout: TransitionTimeouts.Collapse
- });
-
- var transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);
-
- function getTransitionClass(status) {
- return transitionStatusToClassHash[status] || 'collapse';
- }
-
- function getHeight(node) {
- return node.scrollHeight;
- }
-
- var Collapse =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(Collapse, _Component);
-
- function Collapse(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.state = {
- height: null
- };
- ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {
- _this[name] = _this[name].bind(_assertThisInitialized(_assertThisInitialized(_this)));
- });
- return _this;
- }
-
- var _proto = Collapse.prototype;
-
- _proto.onEntering = function onEntering(node, isAppearing) {
- this.setState({
- height: getHeight(node)
- });
- this.props.onEntering(node, isAppearing);
- };
-
- _proto.onEntered = function onEntered(node, isAppearing) {
- this.setState({
- height: null
- });
- this.props.onEntered(node, isAppearing);
- };
-
- _proto.onExit = function onExit(node) {
- this.setState({
- height: getHeight(node)
- });
- this.props.onExit(node);
- };
-
- _proto.onExiting = function onExiting(node) {
- // getting this variable triggers a reflow
- var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars
-
- this.setState({
- height: 0
- });
- this.props.onExiting(node);
- };
-
- _proto.onExited = function onExited(node) {
- this.setState({
- height: null
- });
- this.props.onExited(node);
- };
-
- _proto.render = function render() {
- var _this2 = this;
-
- var _this$props = this.props,
- Tag = _this$props.tag,
- isOpen = _this$props.isOpen,
- className = _this$props.className,
- navbar = _this$props.navbar,
- cssModule = _this$props.cssModule,
- children = _this$props.children,
- innerRef = _this$props.innerRef,
- otherProps = _objectWithoutPropertiesLoose(_this$props, ["tag", "isOpen", "className", "navbar", "cssModule", "children", "innerRef"]);
-
- var height = this.state.height;
- var transitionProps = pick(otherProps, TransitionPropTypeKeys);
- var childProps = omit(otherProps, TransitionPropTypeKeys);
- return React.createElement(Transition, _extends({}, transitionProps, {
- in: isOpen,
- onEntering: this.onEntering,
- onEntered: this.onEntered,
- onExit: this.onExit,
- onExiting: this.onExiting,
- onExited: this.onExited
- }), function (status) {
- var collapseClass = getTransitionClass(status);
- var classes = mapToCssModules(classNames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);
- var style = height === null ? null : {
- height: height
- };
- return React.createElement(Tag, _extends({}, childProps, {
- style: _extends({}, childProps.style, style),
- className: classes,
- ref: _this2.props.innerRef
- }), children);
- });
- };
-
- return Collapse;
- }(Component);
-
- Collapse.propTypes = propTypes$14;
- Collapse.defaultProps = defaultProps$_;
-
- var propTypes$15 = {
- tag: tagPropType,
- active: PropTypes.bool,
- disabled: PropTypes.bool,
- color: PropTypes.string,
- action: PropTypes.bool,
- className: PropTypes.any,
- cssModule: PropTypes.object
- };
- var defaultProps$10 = {
- tag: 'li'
- };
-
- var handleDisabledOnClick = function handleDisabledOnClick(e) {
- e.preventDefault();
- };
-
- var ListGroupItem = function ListGroupItem(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- active = props.active,
- disabled = props.disabled,
- action = props.action,
- color = props.color,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "active", "disabled", "action", "color"]);
-
- 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.
-
- if (disabled) {
- attributes.onClick = handleDisabledOnClick;
- }
-
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- ListGroupItem.propTypes = propTypes$15;
- ListGroupItem.defaultProps = defaultProps$10;
-
- var propTypes$16 = {
- tag: tagPropType,
- className: PropTypes.any,
- cssModule: PropTypes.object
- };
- var defaultProps$11 = {
- tag: 'h5'
- };
-
- var ListGroupItemHeading = function ListGroupItemHeading(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'list-group-item-heading'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- ListGroupItemHeading.propTypes = propTypes$16;
- ListGroupItemHeading.defaultProps = defaultProps$11;
-
- var propTypes$17 = {
- tag: tagPropType,
- className: PropTypes.any,
- cssModule: PropTypes.object
- };
- var defaultProps$12 = {
- tag: 'p'
- };
-
- var ListGroupItemText = function ListGroupItemText(props) {
- var className = props.className,
- cssModule = props.cssModule,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
-
- var classes = mapToCssModules(classNames(className, 'list-group-item-text'), cssModule);
- return React.createElement(Tag, _extends({}, attributes, {
- className: classes
- }));
- };
-
- ListGroupItemText.propTypes = propTypes$17;
- ListGroupItemText.defaultProps = defaultProps$12;
-
- var UncontrolledAlert =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(UncontrolledAlert, _Component);
-
- function UncontrolledAlert(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.state = {
- isOpen: true
- };
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = UncontrolledAlert.prototype;
-
- _proto.toggle = function toggle() {
- this.setState({
- isOpen: !this.state.isOpen
- });
- };
-
- _proto.render = function render() {
- return React.createElement(Alert, _extends({
- isOpen: this.state.isOpen,
- toggle: this.toggle
- }, this.props));
- };
-
- return UncontrolledAlert;
- }(Component);
-
- var omitKeys$1 = ['defaultOpen'];
-
- var UncontrolledButtonDropdown =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(UncontrolledButtonDropdown, _Component);
-
- function UncontrolledButtonDropdown(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.state = {
- isOpen: props.defaultOpen || false
- };
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = UncontrolledButtonDropdown.prototype;
-
- _proto.toggle = function toggle() {
- this.setState({
- isOpen: !this.state.isOpen
- });
- };
-
- _proto.render = function render() {
- return React.createElement(ButtonDropdown, _extends({
- isOpen: this.state.isOpen,
- toggle: this.toggle
- }, omit(this.props, omitKeys$1)));
- };
-
- return UncontrolledButtonDropdown;
- }(Component);
- UncontrolledButtonDropdown.propTypes = _extends({
- defaultOpen: PropTypes.bool
- }, ButtonDropdown.propTypes);
-
- var omitKeys$2 = ['toggleEvents', 'defaultOpen'];
- var propTypes$18 = {
- defaultOpen: PropTypes.bool,
- toggler: PropTypes.string.isRequired,
- toggleEvents: PropTypes.arrayOf(PropTypes.string)
- };
- var defaultProps$13 = {
- toggleEvents: defaultToggleEvents
- };
-
- var UncontrolledCollapse =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(UncontrolledCollapse, _Component);
-
- function UncontrolledCollapse(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.togglers = null;
- _this.removeEventListeners = null;
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this.state = {
- isOpen: props.defaultOpen || false
- };
- return _this;
- }
-
- var _proto = UncontrolledCollapse.prototype;
-
- _proto.componentDidMount = function componentDidMount() {
- this.togglers = findDOMElements(this.props.toggler);
-
- if (this.togglers.length) {
- this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);
- }
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- if (this.togglers.length && this.removeEventListeners) {
- this.removeEventListeners();
- }
- };
-
- _proto.toggle = function toggle(e) {
- this.setState(function (_ref) {
- var isOpen = _ref.isOpen;
- return {
- isOpen: !isOpen
- };
- });
- e.preventDefault();
- };
-
- _proto.render = function render() {
- return React.createElement(Collapse, _extends({
- isOpen: this.state.isOpen
- }, omit(this.props, omitKeys$2)));
- };
-
- return UncontrolledCollapse;
- }(Component);
-
- UncontrolledCollapse.propTypes = propTypes$18;
- UncontrolledCollapse.defaultProps = defaultProps$13;
-
- var omitKeys$3 = ['defaultOpen'];
-
- var UncontrolledDropdown =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(UncontrolledDropdown, _Component);
-
- function UncontrolledDropdown(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.state = {
- isOpen: props.defaultOpen || false
- };
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = UncontrolledDropdown.prototype;
-
- _proto.toggle = function toggle() {
- this.setState({
- isOpen: !this.state.isOpen
- });
- };
-
- _proto.render = function render() {
- return React.createElement(Dropdown, _extends({
- isOpen: this.state.isOpen,
- toggle: this.toggle
- }, omit(this.props, omitKeys$3)));
- };
-
- return UncontrolledDropdown;
- }(Component);
- UncontrolledDropdown.propTypes = _extends({
- defaultOpen: PropTypes.bool
- }, Dropdown.propTypes);
-
- var UncontrolledNavDropdown = function UncontrolledNavDropdown(props) {
- warnOnce('The "UncontrolledNavDropdown" component has been deprecated.\nPlease use component "UncontrolledDropdown" with nav prop.');
- return React.createElement(UncontrolledDropdown, _extends({
- nav: true
- }, props));
- };
-
- var omitKeys$4 = ['defaultOpen'];
-
- var UncontrolledTooltip =
- /*#__PURE__*/
- function (_Component) {
- _inheritsLoose(UncontrolledTooltip, _Component);
-
- function UncontrolledTooltip(props) {
- var _this;
-
- _this = _Component.call(this, props) || this;
- _this.state = {
- isOpen: props.defaultOpen || false
- };
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- return _this;
- }
-
- var _proto = UncontrolledTooltip.prototype;
-
- _proto.toggle = function toggle() {
- this.setState({
- isOpen: !this.state.isOpen
- });
- };
-
- _proto.render = function render() {
- return React.createElement(Tooltip, _extends({
- isOpen: this.state.isOpen,
- toggle: this.toggle
- }, omit(this.props, omitKeys$4)));
- };
-
- return UncontrolledTooltip;
- }(Component);
- UncontrolledTooltip.propTypes = _extends({
- defaultOpen: PropTypes.bool
- }, Tooltip.propTypes);
-
- var propTypes$19 = {
- tag: tagPropType,
- type: PropTypes.string,
- size: PropTypes.string,
- color: PropTypes.string,
- className: PropTypes.string,
- cssModule: PropTypes.object,
- children: PropTypes.string
- };
- var defaultProps$14 = {
- tag: 'div',
- type: 'border',
- children: 'Loading...'
- };
-
- var Spinner = function Spinner(props) {
- var className = props.className,
- cssModule = props.cssModule,
- type = props.type,
- size = props.size,
- color = props.color,
- children = props.children,
- Tag = props.tag,
- attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "type", "size", "color", "children", "tag"]);
-
- var classes = mapToCssModules(classNames(className, size ? "spinner-" + type + "-" + size : false, "spinner-" + type, color ? "text-" + color : false), cssModule);
- return React.createElement(Tag, _extends({
- role: "status"
- }, attributes, {
- className: classes
- }), children && React.createElement("span", {
- className: mapToCssModules('sr-only', cssModule)
- }, children));
- };
-
- Spinner.propTypes = propTypes$19;
- Spinner.defaultProps = defaultProps$14;
-
- export { Container, Row, Col, Navbar, NavbarBrand, NavbarToggler, Nav, NavItem, NavDropdown, NavLink, Breadcrumb, BreadcrumbItem, Button, ButtonDropdown, ButtonGroup, ButtonToolbar, Dropdown, DropdownItem, DropdownMenu, DropdownToggle, Fade, Badge, Card, CardGroup, CardDeck, CardColumns, CardBody, CardBlock, CardLink, CardFooter, CardHeader, CardImg, CardImgOverlay, Carousel, UncontrolledCarousel, CarouselControl, CarouselItem, CarouselIndicators, CarouselCaption, CardSubtitle, CardText, CardTitle, CustomInput, PopperContent, PopperTargetHelper, Popover, UncontrolledPopover, PopoverHeader, PopoverTitle, PopoverBody, PopoverContent, Progress, Modal, ModalHeader, ModalBody, ModalFooter, Tooltip, Table, ListGroup, Form, FormFeedback, FormGroup, FormText, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupButtonDropdown, InputGroupText, Label, Media, Pagination, PaginationItem, PaginationLink, TabContent, TabPane, Jumbotron, Alert, Collapse, ListGroupItem, ListGroupItemHeading, ListGroupItemText, UncontrolledAlert, UncontrolledButtonDropdown, UncontrolledCollapse, UncontrolledDropdown, UncontrolledNavDropdown, UncontrolledTooltip, Spinner, utils as Util };
- //# sourceMappingURL=reactstrap.es.js.map
|