1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('classnames'), require('react-popper'), require('react-dom'), require('react-transition-group')) :
|
3 | typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', 'classnames', 'react-popper', 'react-dom', 'react-transition-group'], factory) :
|
4 | (global = global || self, factory(global.reactstrap = {}, global.react, global.propTypes, global.classnames, global.reactPopper, global.reactDom, global.reactTransitionGroup));
|
5 | })(this, (function (exports, React, PropTypes, classNames, reactPopper, ReactDOM, reactTransitionGroup) {
|
6 | function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
7 |
|
8 | var React__default = _interopDefaultLegacy(React);
|
9 | var PropTypes__default = _interopDefaultLegacy(PropTypes);
|
10 | var classNames__default = _interopDefaultLegacy(classNames);
|
11 | var ReactDOM__default = _interopDefaultLegacy(ReactDOM);
|
12 |
|
13 | function ownKeys(object, enumerableOnly) {
|
14 | var keys = Object.keys(object);
|
15 |
|
16 | if (Object.getOwnPropertySymbols) {
|
17 | var symbols = Object.getOwnPropertySymbols(object);
|
18 |
|
19 | if (enumerableOnly) {
|
20 | symbols = symbols.filter(function (sym) {
|
21 | return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
22 | });
|
23 | }
|
24 |
|
25 | keys.push.apply(keys, symbols);
|
26 | }
|
27 |
|
28 | return keys;
|
29 | }
|
30 |
|
31 | function _objectSpread2(target) {
|
32 | for (var i = 1; i < arguments.length; i++) {
|
33 | var source = arguments[i] != null ? arguments[i] : {};
|
34 |
|
35 | if (i % 2) {
|
36 | ownKeys(Object(source), true).forEach(function (key) {
|
37 | _defineProperty(target, key, source[key]);
|
38 | });
|
39 | } else if (Object.getOwnPropertyDescriptors) {
|
40 | Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
41 | } else {
|
42 | ownKeys(Object(source)).forEach(function (key) {
|
43 | Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
44 | });
|
45 | }
|
46 | }
|
47 |
|
48 | return target;
|
49 | }
|
50 |
|
51 | function _defineProperty(obj, key, value) {
|
52 | if (key in obj) {
|
53 | Object.defineProperty(obj, key, {
|
54 | value: value,
|
55 | enumerable: true,
|
56 | configurable: true,
|
57 | writable: true
|
58 | });
|
59 | } else {
|
60 | obj[key] = value;
|
61 | }
|
62 |
|
63 | return obj;
|
64 | }
|
65 |
|
66 | function _extends() {
|
67 | _extends = Object.assign || function (target) {
|
68 | for (var i = 1; i < arguments.length; i++) {
|
69 | var source = arguments[i];
|
70 |
|
71 | for (var key in source) {
|
72 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
73 | target[key] = source[key];
|
74 | }
|
75 | }
|
76 | }
|
77 |
|
78 | return target;
|
79 | };
|
80 |
|
81 | return _extends.apply(this, arguments);
|
82 | }
|
83 |
|
84 | function _inheritsLoose(subClass, superClass) {
|
85 | subClass.prototype = Object.create(superClass.prototype);
|
86 | subClass.prototype.constructor = subClass;
|
87 |
|
88 | _setPrototypeOf(subClass, superClass);
|
89 | }
|
90 |
|
91 | function _setPrototypeOf(o, p) {
|
92 | _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
93 | o.__proto__ = p;
|
94 | return o;
|
95 | };
|
96 |
|
97 | return _setPrototypeOf(o, p);
|
98 | }
|
99 |
|
100 | function _objectWithoutPropertiesLoose(source, excluded) {
|
101 | if (source == null) return {};
|
102 | var target = {};
|
103 | var sourceKeys = Object.keys(source);
|
104 | var key, i;
|
105 |
|
106 | for (i = 0; i < sourceKeys.length; i++) {
|
107 | key = sourceKeys[i];
|
108 | if (excluded.indexOf(key) >= 0) continue;
|
109 | target[key] = source[key];
|
110 | }
|
111 |
|
112 | return target;
|
113 | }
|
114 |
|
115 | function _assertThisInitialized(self) {
|
116 | if (self === void 0) {
|
117 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
118 | }
|
119 |
|
120 | return self;
|
121 | }
|
122 |
|
123 | function getScrollbarWidth() {
|
124 | var scrollDiv = document.createElement('div');
|
125 |
|
126 | scrollDiv.style.position = 'absolute';
|
127 | scrollDiv.style.top = '-9999px';
|
128 | scrollDiv.style.width = '50px';
|
129 | scrollDiv.style.height = '50px';
|
130 | scrollDiv.style.overflow = 'scroll';
|
131 | document.body.appendChild(scrollDiv);
|
132 | var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
133 | document.body.removeChild(scrollDiv);
|
134 | return scrollbarWidth;
|
135 | }
|
136 | function setScrollbarWidth(padding) {
|
137 | document.body.style.paddingRight = padding > 0 ? padding + "px" : null;
|
138 | }
|
139 | function isBodyOverflowing() {
|
140 | return document.body.clientWidth < window.innerWidth;
|
141 | }
|
142 | function getOriginalBodyPadding() {
|
143 | var style = window.getComputedStyle(document.body, null);
|
144 | return parseInt(style && style.getPropertyValue('padding-right') || 0, 10);
|
145 | }
|
146 | function conditionallyUpdateScrollbar() {
|
147 | var scrollbarWidth = getScrollbarWidth();
|
148 |
|
149 | var fixedContent = document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')[0];
|
150 | var bodyPadding = fixedContent ? parseInt(fixedContent.style.paddingRight || 0, 10) : 0;
|
151 |
|
152 | if (isBodyOverflowing()) {
|
153 | setScrollbarWidth(bodyPadding + scrollbarWidth);
|
154 | }
|
155 | }
|
156 | var globalCssModule;
|
157 | function setGlobalCssModule(cssModule) {
|
158 | globalCssModule = cssModule;
|
159 | }
|
160 | function mapToCssModules(className, cssModule) {
|
161 | if (className === void 0) {
|
162 | className = '';
|
163 | }
|
164 |
|
165 | if (cssModule === void 0) {
|
166 | cssModule = globalCssModule;
|
167 | }
|
168 |
|
169 | if (!cssModule) return className;
|
170 | return className.split(' ').map(function (c) {
|
171 | return cssModule[c] || c;
|
172 | }).join(' ');
|
173 | }
|
174 | |
175 |
|
176 |
|
177 |
|
178 | function omit(obj, omitKeys) {
|
179 | var result = {};
|
180 | Object.keys(obj).forEach(function (key) {
|
181 | if (omitKeys.indexOf(key) === -1) {
|
182 | result[key] = obj[key];
|
183 | }
|
184 | });
|
185 | return result;
|
186 | }
|
187 | |
188 |
|
189 |
|
190 |
|
191 | function pick(obj, keys) {
|
192 | var pickKeys = Array.isArray(keys) ? keys : [keys];
|
193 | var length = pickKeys.length;
|
194 | var key;
|
195 | var result = {};
|
196 |
|
197 | while (length > 0) {
|
198 | length -= 1;
|
199 | key = pickKeys[length];
|
200 | result[key] = obj[key];
|
201 | }
|
202 |
|
203 | return result;
|
204 | }
|
205 | var warned = {};
|
206 | function warnOnce(message) {
|
207 | if (!warned[message]) {
|
208 |
|
209 | if (typeof console !== 'undefined') {
|
210 | console.error(message);
|
211 | }
|
212 |
|
213 | warned[message] = true;
|
214 | }
|
215 | }
|
216 | function deprecated(propType, explanation) {
|
217 | return function validate(props, propName, componentName) {
|
218 | if (props[propName] !== null && typeof props[propName] !== 'undefined') {
|
219 | warnOnce("\"" + propName + "\" property of \"" + componentName + "\" has been deprecated.\n" + explanation);
|
220 | }
|
221 |
|
222 | return propType.apply(void 0, [props, propName, componentName].concat([].slice.call(arguments, 3)));
|
223 | };
|
224 | }
|
225 |
|
226 | var Element = typeof window === 'object' && window.Element || function () {};
|
227 |
|
228 | function DOMElement(props, propName, componentName) {
|
229 | if (!(props[propName] instanceof Element)) {
|
230 | return new Error('Invalid prop `' + propName + '` supplied to `' + componentName + '`. Expected prop to be an instance of Element. Validation failed.');
|
231 | }
|
232 | }
|
233 | var targetPropType = PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].func, DOMElement, PropTypes__default["default"].shape({
|
234 | current: PropTypes__default["default"].any
|
235 | })]);
|
236 | var tagPropType = PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].string, PropTypes__default["default"].shape({
|
237 | $$typeof: PropTypes__default["default"].symbol,
|
238 | render: PropTypes__default["default"].func
|
239 | }), PropTypes__default["default"].arrayOf(PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].string, PropTypes__default["default"].shape({
|
240 | $$typeof: PropTypes__default["default"].symbol,
|
241 | render: PropTypes__default["default"].func
|
242 | })]))]);
|
243 |
|
244 |
|
245 |
|
246 |
|
247 | var TransitionTimeouts = {
|
248 | Fade: 150,
|
249 |
|
250 | Collapse: 350,
|
251 |
|
252 | Modal: 300,
|
253 |
|
254 | Carousel: 600,
|
255 |
|
256 | Offcanvas: 300
|
257 |
|
258 | };
|
259 |
|
260 |
|
261 |
|
262 | var TransitionPropTypeKeys = ['in', 'mountOnEnter', 'unmountOnExit', 'appear', 'enter', 'exit', 'timeout', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'];
|
263 | var TransitionStatuses = {
|
264 | ENTERING: 'entering',
|
265 | ENTERED: 'entered',
|
266 | EXITING: 'exiting',
|
267 | EXITED: 'exited'
|
268 | };
|
269 | var keyCodes = {
|
270 | esc: 27,
|
271 | space: 32,
|
272 | enter: 13,
|
273 | tab: 9,
|
274 | up: 38,
|
275 | down: 40,
|
276 | home: 36,
|
277 | end: 35,
|
278 | n: 78,
|
279 | p: 80
|
280 | };
|
281 | 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'];
|
282 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
283 | function isReactRefObj(target) {
|
284 | if (target && typeof target === 'object') {
|
285 | return 'current' in target;
|
286 | }
|
287 |
|
288 | return false;
|
289 | }
|
290 |
|
291 | function getTag(value) {
|
292 | if (value == null) {
|
293 | return value === undefined ? '[object Undefined]' : '[object Null]';
|
294 | }
|
295 |
|
296 | return Object.prototype.toString.call(value);
|
297 | }
|
298 |
|
299 | function toNumber(value) {
|
300 | var type = typeof value;
|
301 | var NAN = 0 / 0;
|
302 |
|
303 | if (type === 'number') {
|
304 | return value;
|
305 | }
|
306 |
|
307 | if (type === 'symbol' || type === 'object' && getTag(value) === '[object Symbol]') {
|
308 | return NAN;
|
309 | }
|
310 |
|
311 | if (isObject(value)) {
|
312 | var other = typeof value.valueOf === 'function' ? value.valueOf() : value;
|
313 | value = isObject(other) ? "" + other : other;
|
314 | }
|
315 |
|
316 | if (type !== 'string') {
|
317 | return value === 0 ? value : +value;
|
318 | }
|
319 |
|
320 | value = value.replace(/^\s+|\s+$/g, '');
|
321 | var isBinary = /^0b[01]+$/i.test(value);
|
322 | return isBinary || /^0o[0-7]+$/i.test(value) ? parseInt(value.slice(2), isBinary ? 2 : 8) : /^[-+]0x[0-9a-f]+$/i.test(value) ? NAN : +value;
|
323 | }
|
324 | function isObject(value) {
|
325 | var type = typeof value;
|
326 | return value != null && (type === 'object' || type === 'function');
|
327 | }
|
328 | function isFunction(value) {
|
329 | if (!isObject(value)) {
|
330 | return false;
|
331 | }
|
332 |
|
333 | var tag = getTag(value);
|
334 | return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object Proxy]';
|
335 | }
|
336 | function findDOMElements(target) {
|
337 | if (isReactRefObj(target)) {
|
338 | return target.current;
|
339 | }
|
340 |
|
341 | if (isFunction(target)) {
|
342 | return target();
|
343 | }
|
344 |
|
345 | if (typeof target === 'string' && canUseDOM) {
|
346 | var selection = document.querySelectorAll(target);
|
347 |
|
348 | if (!selection.length) {
|
349 | selection = document.querySelectorAll("#" + target);
|
350 | }
|
351 |
|
352 | if (!selection.length) {
|
353 | throw new Error("The target '" + target + "' could not be identified in the dom, tip: check spelling");
|
354 | }
|
355 |
|
356 | return selection;
|
357 | }
|
358 |
|
359 | return target;
|
360 | }
|
361 | function isArrayOrNodeList(els) {
|
362 | if (els === null) {
|
363 | return false;
|
364 | }
|
365 |
|
366 | return Array.isArray(els) || canUseDOM && typeof els.length === 'number';
|
367 | }
|
368 | function getTarget(target, allElements) {
|
369 | var els = findDOMElements(target);
|
370 |
|
371 | if (allElements) {
|
372 | if (isArrayOrNodeList(els)) {
|
373 | return els;
|
374 | }
|
375 |
|
376 | if (els === null) {
|
377 | return [];
|
378 | }
|
379 |
|
380 | return [els];
|
381 | } else {
|
382 | if (isArrayOrNodeList(els)) {
|
383 | return els[0];
|
384 | }
|
385 |
|
386 | return els;
|
387 | }
|
388 | }
|
389 | var defaultToggleEvents = ['touchstart', 'click'];
|
390 | function addMultipleEventListeners(_els, handler, _events, useCapture) {
|
391 | var els = _els;
|
392 |
|
393 | if (!isArrayOrNodeList(els)) {
|
394 | els = [els];
|
395 | }
|
396 |
|
397 | var events = _events;
|
398 |
|
399 | if (typeof events === 'string') {
|
400 | events = events.split(/\s+/);
|
401 | }
|
402 |
|
403 | if (!isArrayOrNodeList(els) || typeof handler !== 'function' || !Array.isArray(events)) {
|
404 | 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 ");
|
405 | }
|
406 |
|
407 | Array.prototype.forEach.call(events, function (event) {
|
408 | Array.prototype.forEach.call(els, function (el) {
|
409 | el.addEventListener(event, handler, useCapture);
|
410 | });
|
411 | });
|
412 | return function removeEvents() {
|
413 | Array.prototype.forEach.call(events, function (event) {
|
414 | Array.prototype.forEach.call(els, function (el) {
|
415 | el.removeEventListener(event, handler, useCapture);
|
416 | });
|
417 | });
|
418 | };
|
419 | }
|
420 | 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"])'];
|
421 |
|
422 | var utils = {
|
423 | __proto__: null,
|
424 | getScrollbarWidth: getScrollbarWidth,
|
425 | setScrollbarWidth: setScrollbarWidth,
|
426 | isBodyOverflowing: isBodyOverflowing,
|
427 | getOriginalBodyPadding: getOriginalBodyPadding,
|
428 | conditionallyUpdateScrollbar: conditionallyUpdateScrollbar,
|
429 | setGlobalCssModule: setGlobalCssModule,
|
430 | mapToCssModules: mapToCssModules,
|
431 | omit: omit,
|
432 | pick: pick,
|
433 | warnOnce: warnOnce,
|
434 | deprecated: deprecated,
|
435 | DOMElement: DOMElement,
|
436 | targetPropType: targetPropType,
|
437 | tagPropType: tagPropType,
|
438 | TransitionTimeouts: TransitionTimeouts,
|
439 | TransitionPropTypeKeys: TransitionPropTypeKeys,
|
440 | TransitionStatuses: TransitionStatuses,
|
441 | keyCodes: keyCodes,
|
442 | PopperPlacements: PopperPlacements,
|
443 | canUseDOM: canUseDOM,
|
444 | isReactRefObj: isReactRefObj,
|
445 | toNumber: toNumber,
|
446 | isObject: isObject,
|
447 | isFunction: isFunction,
|
448 | findDOMElements: findDOMElements,
|
449 | isArrayOrNodeList: isArrayOrNodeList,
|
450 | getTarget: getTarget,
|
451 | defaultToggleEvents: defaultToggleEvents,
|
452 | addMultipleEventListeners: addMultipleEventListeners,
|
453 | focusableElements: focusableElements
|
454 | };
|
455 |
|
456 | var _excluded$1f = ["className", "cssModule", "fluid", "tag"];
|
457 | var propTypes$1l = {
|
458 | tag: tagPropType,
|
459 | fluid: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].string]),
|
460 | className: PropTypes__default["default"].string,
|
461 | cssModule: PropTypes__default["default"].object
|
462 | };
|
463 | var defaultProps$1j = {
|
464 | tag: 'div'
|
465 | };
|
466 |
|
467 | var Container = function Container(props) {
|
468 | var className = props.className,
|
469 | cssModule = props.cssModule,
|
470 | fluid = props.fluid,
|
471 | Tag = props.tag,
|
472 | attributes = _objectWithoutPropertiesLoose(props, _excluded$1f);
|
473 |
|
474 | var containerClass = 'container';
|
475 |
|
476 | if (fluid === true) {
|
477 | containerClass = 'container-fluid';
|
478 | } else if (fluid) {
|
479 | containerClass = "container-" + fluid;
|
480 | }
|
481 |
|
482 | var classes = mapToCssModules(classNames__default["default"](className, containerClass), cssModule);
|
483 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
484 | className: classes
|
485 | }));
|
486 | };
|
487 |
|
488 | Container.propTypes = propTypes$1l;
|
489 | Container.defaultProps = defaultProps$1j;
|
490 | var Container$1 = Container;
|
491 |
|
492 | var _excluded$1e = ["className", "cssModule", "noGutters", "tag", "widths"];
|
493 | var rowColWidths = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
494 | var rowColsPropType = PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]);
|
495 | var propTypes$1k = {
|
496 | tag: tagPropType,
|
497 | noGutters: deprecated(PropTypes__default["default"].bool, "Please use Bootstrap 5 gutter utility classes. https://getbootstrap.com/docs/5.0/layout/gutters/"),
|
498 | className: PropTypes__default["default"].string,
|
499 | cssModule: PropTypes__default["default"].object,
|
500 | xs: rowColsPropType,
|
501 | sm: rowColsPropType,
|
502 | md: rowColsPropType,
|
503 | lg: rowColsPropType,
|
504 | xl: rowColsPropType,
|
505 | xxl: rowColsPropType
|
506 | };
|
507 | var defaultProps$1i = {
|
508 | tag: 'div',
|
509 | widths: rowColWidths
|
510 | };
|
511 |
|
512 | var Row = function Row(props) {
|
513 | var className = props.className,
|
514 | cssModule = props.cssModule,
|
515 | noGutters = props.noGutters,
|
516 | Tag = props.tag,
|
517 | widths = props.widths,
|
518 | attributes = _objectWithoutPropertiesLoose(props, _excluded$1e);
|
519 |
|
520 | var colClasses = [];
|
521 | widths.forEach(function (colWidth, i) {
|
522 | var colSize = props[colWidth];
|
523 | delete attributes[colWidth];
|
524 |
|
525 | if (!colSize) {
|
526 | return;
|
527 | }
|
528 |
|
529 | var isXs = !i;
|
530 | colClasses.push(isXs ? "row-cols-" + colSize : "row-cols-" + colWidth + "-" + colSize);
|
531 | });
|
532 | var classes = mapToCssModules(classNames__default["default"](className, noGutters ? 'gx-0' : null, 'row', colClasses), cssModule);
|
533 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
534 | className: classes
|
535 | }));
|
536 | };
|
537 |
|
538 | Row.propTypes = propTypes$1k;
|
539 | Row.defaultProps = defaultProps$1i;
|
540 | var Row$1 = Row;
|
541 |
|
542 | var _excluded$1d = ["className", "cssModule", "widths", "tag"];
|
543 | var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
544 | var stringOrNumberProp$1 = PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]);
|
545 | var columnProps$1 = PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].number, PropTypes__default["default"].string, PropTypes__default["default"].shape({
|
546 | size: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
547 | order: stringOrNumberProp$1,
|
548 | offset: stringOrNumberProp$1
|
549 | })]);
|
550 | var propTypes$1j = {
|
551 | tag: tagPropType,
|
552 | xs: columnProps$1,
|
553 | sm: columnProps$1,
|
554 | md: columnProps$1,
|
555 | lg: columnProps$1,
|
556 | xl: columnProps$1,
|
557 | xxl: columnProps$1,
|
558 | className: PropTypes__default["default"].string,
|
559 | cssModule: PropTypes__default["default"].object,
|
560 | widths: PropTypes__default["default"].array
|
561 | };
|
562 | var defaultProps$1h = {
|
563 | tag: 'div',
|
564 | widths: colWidths$1
|
565 | };
|
566 |
|
567 | var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) {
|
568 | if (colSize === true || colSize === '') {
|
569 | return isXs ? 'col' : "col-" + colWidth;
|
570 | } else if (colSize === 'auto') {
|
571 | return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
|
572 | }
|
573 |
|
574 | return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
|
575 | };
|
576 |
|
577 | var getColumnClasses = function getColumnClasses(attributes, cssModule, widths) {
|
578 | if (widths === void 0) {
|
579 | widths = colWidths$1;
|
580 | }
|
581 |
|
582 | var colClasses = [];
|
583 | widths.forEach(function (colWidth, i) {
|
584 | var columnProp = attributes[colWidth];
|
585 | delete attributes[colWidth];
|
586 |
|
587 | if (!columnProp && columnProp !== '') {
|
588 | return;
|
589 | }
|
590 |
|
591 | var isXs = !i;
|
592 |
|
593 | if (isObject(columnProp)) {
|
594 | var _classNames;
|
595 |
|
596 | var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
|
597 | var colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size);
|
598 | colClasses.push(mapToCssModules(classNames__default["default"]((_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));
|
599 | } else {
|
600 | var _colClass = getColumnSizeClass$1(isXs, colWidth, columnProp);
|
601 |
|
602 | colClasses.push(_colClass);
|
603 | }
|
604 | });
|
605 | return {
|
606 | colClasses: colClasses,
|
607 | attributes: attributes
|
608 | };
|
609 | };
|
610 |
|
611 | var Col = function Col(props) {
|
612 | var className = props.className,
|
613 | cssModule = props.cssModule,
|
614 | widths = props.widths,
|
615 | Tag = props.tag,
|
616 | attributes = _objectWithoutPropertiesLoose(props, _excluded$1d);
|
617 |
|
618 | var _getColumnClasses = getColumnClasses(attributes, cssModule, widths),
|
619 | modifiedAttributes = _getColumnClasses.attributes,
|
620 | colClasses = _getColumnClasses.colClasses;
|
621 |
|
622 | if (!colClasses.length) {
|
623 | colClasses.push('col');
|
624 | }
|
625 |
|
626 | var classes = mapToCssModules(classNames__default["default"](className, colClasses), cssModule);
|
627 | return React__default["default"].createElement(Tag, _extends({}, modifiedAttributes, {
|
628 | className: classes
|
629 | }));
|
630 | };
|
631 |
|
632 | Col.propTypes = propTypes$1j;
|
633 | Col.defaultProps = defaultProps$1h;
|
634 | var Col$1 = Col;
|
635 |
|
636 | var _excluded$1c = ["expand", "className", "cssModule", "light", "dark", "fixed", "sticky", "color", "container", "tag", "children"];
|
637 | var propTypes$1i = {
|
638 | light: PropTypes__default["default"].bool,
|
639 | dark: PropTypes__default["default"].bool,
|
640 | full: PropTypes__default["default"].bool,
|
641 | fixed: PropTypes__default["default"].string,
|
642 | sticky: PropTypes__default["default"].string,
|
643 | color: PropTypes__default["default"].string,
|
644 | role: PropTypes__default["default"].string,
|
645 | tag: tagPropType,
|
646 | container: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].string]),
|
647 | className: PropTypes__default["default"].string,
|
648 | cssModule: PropTypes__default["default"].object,
|
649 | expand: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].string]),
|
650 | children: PropTypes__default["default"].node
|
651 | };
|
652 | var defaultProps$1g = {
|
653 | tag: 'nav',
|
654 | expand: false,
|
655 | container: 'fluid'
|
656 | };
|
657 |
|
658 | var getExpandClass = function getExpandClass(expand) {
|
659 | if (expand === false) {
|
660 | return false;
|
661 | } else if (expand === true || expand === 'xs') {
|
662 | return 'navbar-expand';
|
663 | }
|
664 |
|
665 | return "navbar-expand-" + expand;
|
666 | };
|
667 |
|
668 | var Navbar = function Navbar(props) {
|
669 | var _classNames;
|
670 |
|
671 | var expand = props.expand,
|
672 | className = props.className,
|
673 | cssModule = props.cssModule,
|
674 | light = props.light,
|
675 | dark = props.dark,
|
676 | fixed = props.fixed,
|
677 | sticky = props.sticky,
|
678 | color = props.color,
|
679 | container = props.container,
|
680 | Tag = props.tag,
|
681 | children = props.children,
|
682 | attributes = _objectWithoutPropertiesLoose(props, _excluded$1c);
|
683 |
|
684 | var classes = mapToCssModules(classNames__default["default"](className, 'navbar', getExpandClass(expand), (_classNames = {
|
685 | 'navbar-light': light,
|
686 | 'navbar-dark': dark
|
687 | }, _classNames["bg-" + color] = color, _classNames["fixed-" + fixed] = fixed, _classNames["sticky-" + sticky] = sticky, _classNames)), cssModule);
|
688 | var containerClass = container && container === true ? 'container' : "container-" + container;
|
689 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
690 | className: classes
|
691 | }), container ? React__default["default"].createElement("div", {
|
692 | className: containerClass
|
693 | }, children) : children);
|
694 | };
|
695 |
|
696 | Navbar.propTypes = propTypes$1i;
|
697 | Navbar.defaultProps = defaultProps$1g;
|
698 | var Navbar$1 = Navbar;
|
699 |
|
700 | var _excluded$1b = ["className", "cssModule", "tag"];
|
701 | var propTypes$1h = {
|
702 | tag: tagPropType,
|
703 | className: PropTypes__default["default"].string,
|
704 | cssModule: PropTypes__default["default"].object
|
705 | };
|
706 | var defaultProps$1f = {
|
707 | tag: 'a'
|
708 | };
|
709 |
|
710 | var NavbarBrand = function NavbarBrand(props) {
|
711 | var className = props.className,
|
712 | cssModule = props.cssModule,
|
713 | Tag = props.tag,
|
714 | attributes = _objectWithoutPropertiesLoose(props, _excluded$1b);
|
715 |
|
716 | var classes = mapToCssModules(classNames__default["default"](className, 'navbar-brand'), cssModule);
|
717 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
718 | className: classes
|
719 | }));
|
720 | };
|
721 |
|
722 | NavbarBrand.propTypes = propTypes$1h;
|
723 | NavbarBrand.defaultProps = defaultProps$1f;
|
724 | var NavbarBrand$1 = NavbarBrand;
|
725 |
|
726 | var _excluded$1a = ["className", "cssModule", "active", "tag"];
|
727 | var propTypes$1g = {
|
728 | tag: tagPropType,
|
729 | className: PropTypes__default["default"].string,
|
730 | cssModule: PropTypes__default["default"].object
|
731 | };
|
732 | var defaultProps$1e = {
|
733 | tag: 'span'
|
734 | };
|
735 |
|
736 | var NavbarText = function NavbarText(props) {
|
737 | var className = props.className,
|
738 | cssModule = props.cssModule,
|
739 | Tag = props.tag,
|
740 | attributes = _objectWithoutPropertiesLoose(props, _excluded$1a);
|
741 |
|
742 | var classes = mapToCssModules(classNames__default["default"](className, 'navbar-text'), cssModule);
|
743 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
744 | className: classes
|
745 | }));
|
746 | };
|
747 |
|
748 | NavbarText.propTypes = propTypes$1g;
|
749 | NavbarText.defaultProps = defaultProps$1e;
|
750 | var NavbarText$1 = NavbarText;
|
751 |
|
752 | var _excluded$19 = ["className", "cssModule", "children", "tag"];
|
753 | var propTypes$1f = {
|
754 | tag: tagPropType,
|
755 | type: PropTypes__default["default"].string,
|
756 | className: PropTypes__default["default"].string,
|
757 | cssModule: PropTypes__default["default"].object,
|
758 | children: PropTypes__default["default"].node
|
759 | };
|
760 | var defaultProps$1d = {
|
761 | tag: 'button',
|
762 | type: 'button'
|
763 | };
|
764 |
|
765 | var NavbarToggler = function NavbarToggler(props) {
|
766 | var className = props.className,
|
767 | cssModule = props.cssModule,
|
768 | children = props.children,
|
769 | Tag = props.tag,
|
770 | attributes = _objectWithoutPropertiesLoose(props, _excluded$19);
|
771 |
|
772 | var classes = mapToCssModules(classNames__default["default"](className, 'navbar-toggler'), cssModule);
|
773 | return React__default["default"].createElement(Tag, _extends({
|
774 | "aria-label": "Toggle navigation"
|
775 | }, attributes, {
|
776 | className: classes
|
777 | }), children || React__default["default"].createElement("span", {
|
778 | className: mapToCssModules('navbar-toggler-icon', cssModule)
|
779 | }));
|
780 | };
|
781 |
|
782 | NavbarToggler.propTypes = propTypes$1f;
|
783 | NavbarToggler.defaultProps = defaultProps$1d;
|
784 | var NavbarToggler$1 = NavbarToggler;
|
785 |
|
786 | var _excluded$18 = ["className", "cssModule", "tabs", "pills", "vertical", "horizontal", "justified", "fill", "navbar", "card", "tag"];
|
787 | var propTypes$1e = {
|
788 | tabs: PropTypes__default["default"].bool,
|
789 | pills: PropTypes__default["default"].bool,
|
790 | vertical: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].string]),
|
791 | horizontal: PropTypes__default["default"].string,
|
792 | justified: PropTypes__default["default"].bool,
|
793 | fill: PropTypes__default["default"].bool,
|
794 | navbar: PropTypes__default["default"].bool,
|
795 | card: PropTypes__default["default"].bool,
|
796 | tag: tagPropType,
|
797 | className: PropTypes__default["default"].string,
|
798 | cssModule: PropTypes__default["default"].object
|
799 | };
|
800 | var defaultProps$1c = {
|
801 | tag: 'ul',
|
802 | vertical: false
|
803 | };
|
804 |
|
805 | var getVerticalClass = function getVerticalClass(vertical) {
|
806 | if (vertical === false) {
|
807 | return false;
|
808 | } else if (vertical === true || vertical === 'xs') {
|
809 | return 'flex-column';
|
810 | }
|
811 |
|
812 | return "flex-" + vertical + "-column";
|
813 | };
|
814 |
|
815 | var Nav = function Nav(props) {
|
816 | var className = props.className,
|
817 | cssModule = props.cssModule,
|
818 | tabs = props.tabs,
|
819 | pills = props.pills,
|
820 | vertical = props.vertical,
|
821 | horizontal = props.horizontal,
|
822 | justified = props.justified,
|
823 | fill = props.fill,
|
824 | navbar = props.navbar,
|
825 | card = props.card,
|
826 | Tag = props.tag,
|
827 | attributes = _objectWithoutPropertiesLoose(props, _excluded$18);
|
828 |
|
829 | var classes = mapToCssModules(classNames__default["default"](className, navbar ? 'navbar-nav' : 'nav', horizontal ? "justify-content-" + horizontal : false, getVerticalClass(vertical), {
|
830 | 'nav-tabs': tabs,
|
831 | 'card-header-tabs': card && tabs,
|
832 | 'nav-pills': pills,
|
833 | 'card-header-pills': card && pills,
|
834 | 'nav-justified': justified,
|
835 | 'nav-fill': fill
|
836 | }), cssModule);
|
837 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
838 | className: classes
|
839 | }));
|
840 | };
|
841 |
|
842 | Nav.propTypes = propTypes$1e;
|
843 | Nav.defaultProps = defaultProps$1c;
|
844 | var Nav$1 = Nav;
|
845 |
|
846 | var _excluded$17 = ["className", "cssModule", "active", "tag"];
|
847 | var propTypes$1d = {
|
848 | tag: tagPropType,
|
849 | active: PropTypes__default["default"].bool,
|
850 | className: PropTypes__default["default"].string,
|
851 | cssModule: PropTypes__default["default"].object
|
852 | };
|
853 | var defaultProps$1b = {
|
854 | tag: 'li'
|
855 | };
|
856 |
|
857 | var NavItem = function NavItem(props) {
|
858 | var className = props.className,
|
859 | cssModule = props.cssModule,
|
860 | active = props.active,
|
861 | Tag = props.tag,
|
862 | attributes = _objectWithoutPropertiesLoose(props, _excluded$17);
|
863 |
|
864 | var classes = mapToCssModules(classNames__default["default"](className, 'nav-item', active ? 'active' : false), cssModule);
|
865 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
866 | className: classes
|
867 | }));
|
868 | };
|
869 |
|
870 | NavItem.propTypes = propTypes$1d;
|
871 | NavItem.defaultProps = defaultProps$1b;
|
872 | var NavItem$1 = NavItem;
|
873 |
|
874 | var _excluded$16 = ["className", "cssModule", "active", "tag", "innerRef"];
|
875 | var propTypes$1c = {
|
876 | tag: tagPropType,
|
877 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].func, PropTypes__default["default"].string]),
|
878 | disabled: PropTypes__default["default"].bool,
|
879 | active: PropTypes__default["default"].bool,
|
880 | className: PropTypes__default["default"].string,
|
881 | cssModule: PropTypes__default["default"].object,
|
882 | onClick: PropTypes__default["default"].func,
|
883 | href: PropTypes__default["default"].any
|
884 | };
|
885 | var defaultProps$1a = {
|
886 | tag: 'a'
|
887 | };
|
888 |
|
889 | var NavLink = function (_React$Component) {
|
890 | _inheritsLoose(NavLink, _React$Component);
|
891 |
|
892 | function NavLink(props) {
|
893 | var _this;
|
894 |
|
895 | _this = _React$Component.call(this, props) || this;
|
896 | _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
|
897 | return _this;
|
898 | }
|
899 |
|
900 | var _proto = NavLink.prototype;
|
901 |
|
902 | _proto.onClick = function onClick(e) {
|
903 | if (this.props.disabled) {
|
904 | e.preventDefault();
|
905 | return;
|
906 | }
|
907 |
|
908 | if (this.props.href === '#') {
|
909 | e.preventDefault();
|
910 | }
|
911 |
|
912 | if (this.props.onClick) {
|
913 | this.props.onClick(e);
|
914 | }
|
915 | };
|
916 |
|
917 | _proto.render = function render() {
|
918 | var _this$props = this.props,
|
919 | className = _this$props.className,
|
920 | cssModule = _this$props.cssModule,
|
921 | active = _this$props.active,
|
922 | Tag = _this$props.tag,
|
923 | innerRef = _this$props.innerRef,
|
924 | attributes = _objectWithoutPropertiesLoose(_this$props, _excluded$16);
|
925 |
|
926 | var classes = mapToCssModules(classNames__default["default"](className, 'nav-link', {
|
927 | disabled: attributes.disabled,
|
928 | active: active
|
929 | }), cssModule);
|
930 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
931 | ref: innerRef,
|
932 | onClick: this.onClick,
|
933 | className: classes
|
934 | }));
|
935 | };
|
936 |
|
937 | return NavLink;
|
938 | }(React__default["default"].Component);
|
939 |
|
940 | NavLink.propTypes = propTypes$1c;
|
941 | NavLink.defaultProps = defaultProps$1a;
|
942 | var NavLink$1 = NavLink;
|
943 |
|
944 | var _excluded$15 = ["className", "listClassName", "cssModule", "children", "tag", "listTag", "aria-label"];
|
945 | var propTypes$1b = {
|
946 | tag: tagPropType,
|
947 | listTag: tagPropType,
|
948 | className: PropTypes__default["default"].string,
|
949 | listClassName: PropTypes__default["default"].string,
|
950 | cssModule: PropTypes__default["default"].object,
|
951 | children: PropTypes__default["default"].node,
|
952 | 'aria-label': PropTypes__default["default"].string
|
953 | };
|
954 | var defaultProps$19 = {
|
955 | tag: 'nav',
|
956 | listTag: 'ol',
|
957 | 'aria-label': 'breadcrumb'
|
958 | };
|
959 |
|
960 | var Breadcrumb = function Breadcrumb(props) {
|
961 | var className = props.className,
|
962 | listClassName = props.listClassName,
|
963 | cssModule = props.cssModule,
|
964 | children = props.children,
|
965 | Tag = props.tag,
|
966 | ListTag = props.listTag,
|
967 | label = props['aria-label'],
|
968 | attributes = _objectWithoutPropertiesLoose(props, _excluded$15);
|
969 |
|
970 | var classes = mapToCssModules(classNames__default["default"](className), cssModule);
|
971 | var listClasses = mapToCssModules(classNames__default["default"]('breadcrumb', listClassName), cssModule);
|
972 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
973 | className: classes,
|
974 | "aria-label": label
|
975 | }), React__default["default"].createElement(ListTag, {
|
976 | className: listClasses
|
977 | }, children));
|
978 | };
|
979 |
|
980 | Breadcrumb.propTypes = propTypes$1b;
|
981 | Breadcrumb.defaultProps = defaultProps$19;
|
982 | var Breadcrumb$1 = Breadcrumb;
|
983 |
|
984 | var _excluded$14 = ["className", "cssModule", "active", "tag"];
|
985 | var propTypes$1a = {
|
986 | tag: tagPropType,
|
987 | active: PropTypes__default["default"].bool,
|
988 | className: PropTypes__default["default"].string,
|
989 | cssModule: PropTypes__default["default"].object
|
990 | };
|
991 | var defaultProps$18 = {
|
992 | tag: 'li'
|
993 | };
|
994 |
|
995 | var BreadcrumbItem = function BreadcrumbItem(props) {
|
996 | var className = props.className,
|
997 | cssModule = props.cssModule,
|
998 | active = props.active,
|
999 | Tag = props.tag,
|
1000 | attributes = _objectWithoutPropertiesLoose(props, _excluded$14);
|
1001 |
|
1002 | var classes = mapToCssModules(classNames__default["default"](className, active ? 'active' : false, 'breadcrumb-item'), cssModule);
|
1003 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
1004 | className: classes,
|
1005 | "aria-current": active ? 'page' : undefined
|
1006 | }));
|
1007 | };
|
1008 |
|
1009 | BreadcrumbItem.propTypes = propTypes$1a;
|
1010 | BreadcrumbItem.defaultProps = defaultProps$18;
|
1011 | var BreadcrumbItem$1 = BreadcrumbItem;
|
1012 |
|
1013 | var _excluded$13 = ["className", "cssModule", "variant", "innerRef"];
|
1014 | var propTypes$19 = {
|
1015 | active: PropTypes__default["default"].bool,
|
1016 | 'aria-label': PropTypes__default["default"].string,
|
1017 | onClick: PropTypes__default["default"].func,
|
1018 | variant: PropTypes__default["default"].oneOf(['white'])
|
1019 | };
|
1020 | var defaultProps$17 = {
|
1021 | 'aria-label': 'close'
|
1022 | };
|
1023 |
|
1024 | var CloseButton = function CloseButton(props) {
|
1025 | var className = props.className,
|
1026 | variant = props.variant,
|
1027 | innerRef = props.innerRef,
|
1028 | attributes = _objectWithoutPropertiesLoose(props, _excluded$13);
|
1029 |
|
1030 | var classes = mapToCssModules(classNames__default["default"](className, 'btn-close', variant && "btn-close-" + variant));
|
1031 | return React__default["default"].createElement("button", _extends({
|
1032 | ref: innerRef,
|
1033 | type: "button",
|
1034 | className: classes
|
1035 | }, attributes));
|
1036 | };
|
1037 |
|
1038 | CloseButton.propTypes = propTypes$19;
|
1039 | CloseButton.defaultProps = defaultProps$17;
|
1040 | var CloseButton$1 = CloseButton;
|
1041 |
|
1042 | var _excluded$12 = ["active", "aria-label", "block", "className", "close", "cssModule", "color", "outline", "size", "tag", "innerRef"];
|
1043 | var propTypes$18 = {
|
1044 | active: PropTypes__default["default"].bool,
|
1045 | 'aria-label': PropTypes__default["default"].string,
|
1046 | block: PropTypes__default["default"].bool,
|
1047 | color: PropTypes__default["default"].string,
|
1048 | disabled: PropTypes__default["default"].bool,
|
1049 | outline: PropTypes__default["default"].bool,
|
1050 | tag: tagPropType,
|
1051 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].func, PropTypes__default["default"].string]),
|
1052 | onClick: PropTypes__default["default"].func,
|
1053 | size: PropTypes__default["default"].string,
|
1054 | children: PropTypes__default["default"].node,
|
1055 | className: PropTypes__default["default"].string,
|
1056 | cssModule: PropTypes__default["default"].object,
|
1057 | close: PropTypes__default["default"].bool
|
1058 | };
|
1059 | var defaultProps$16 = {
|
1060 | color: 'secondary',
|
1061 | tag: 'button'
|
1062 | };
|
1063 |
|
1064 | function Button(props) {
|
1065 | var onClick = React.useCallback(function (e) {
|
1066 | if (props.disabled) {
|
1067 | e.preventDefault();
|
1068 | return;
|
1069 | }
|
1070 |
|
1071 | if (props.onClick) {
|
1072 | return props.onClick(e);
|
1073 | }
|
1074 | }, [props.onClick, props.disabled]);
|
1075 |
|
1076 | var active = props.active,
|
1077 | ariaLabel = props['aria-label'],
|
1078 | block = props.block,
|
1079 | className = props.className,
|
1080 | close = props.close,
|
1081 | cssModule = props.cssModule,
|
1082 | color = props.color,
|
1083 | outline = props.outline,
|
1084 | size = props.size,
|
1085 | Tag = props.tag,
|
1086 | innerRef = props.innerRef,
|
1087 | attributes = _objectWithoutPropertiesLoose(props, _excluded$12);
|
1088 |
|
1089 | if (close) {
|
1090 | return React__default["default"].createElement(CloseButton$1, attributes);
|
1091 | }
|
1092 |
|
1093 | var btnOutlineColor = "btn" + (outline ? '-outline' : '') + "-" + color;
|
1094 | var classes = mapToCssModules(classNames__default["default"](className, 'btn', btnOutlineColor, size ? "btn-" + size : false, block ? 'd-block w-100' : false, {
|
1095 | active: active,
|
1096 | disabled: props.disabled
|
1097 | }), cssModule);
|
1098 |
|
1099 | if (attributes.href && Tag === 'button') {
|
1100 | Tag = 'a';
|
1101 | }
|
1102 |
|
1103 | return React__default["default"].createElement(Tag, _extends({
|
1104 | type: Tag === 'button' && attributes.onClick ? 'button' : undefined
|
1105 | }, attributes, {
|
1106 | className: classes,
|
1107 | ref: innerRef,
|
1108 | onClick: onClick,
|
1109 | "aria-label": ariaLabel
|
1110 | }));
|
1111 | }
|
1112 |
|
1113 | Button.propTypes = propTypes$18;
|
1114 | Button.defaultProps = defaultProps$16;
|
1115 |
|
1116 | var _excluded$11 = ["className"];
|
1117 | var propTypes$17 = {
|
1118 | onClick: PropTypes__default["default"].func,
|
1119 | onBlur: PropTypes__default["default"].func,
|
1120 | onFocus: PropTypes__default["default"].func,
|
1121 | defaultValue: PropTypes__default["default"].bool
|
1122 | };
|
1123 | var defaultProps$15 = {
|
1124 | defaultValue: false
|
1125 | };
|
1126 |
|
1127 | var ButtonToggle = function (_React$Component) {
|
1128 | _inheritsLoose(ButtonToggle, _React$Component);
|
1129 |
|
1130 | function ButtonToggle(props) {
|
1131 | var _this;
|
1132 |
|
1133 | _this = _React$Component.call(this, props) || this;
|
1134 | _this.state = {
|
1135 | toggled: props.defaultValue,
|
1136 | focus: false
|
1137 | };
|
1138 | _this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));
|
1139 | _this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));
|
1140 | _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
|
1141 | return _this;
|
1142 | }
|
1143 |
|
1144 | var _proto = ButtonToggle.prototype;
|
1145 |
|
1146 | _proto.onBlur = function onBlur(e) {
|
1147 | if (this.props.onBlur) {
|
1148 | this.props.onBlur(e);
|
1149 | }
|
1150 |
|
1151 | this.setState({
|
1152 | focus: false
|
1153 | });
|
1154 | };
|
1155 |
|
1156 | _proto.onFocus = function onFocus(e) {
|
1157 | if (this.props.onFocus) {
|
1158 | this.props.onFocus(e);
|
1159 | }
|
1160 |
|
1161 | this.setState({
|
1162 | focus: true
|
1163 | });
|
1164 | };
|
1165 |
|
1166 | _proto.onClick = function onClick(e) {
|
1167 | if (this.props.onClick) {
|
1168 | this.props.onClick(e);
|
1169 | }
|
1170 |
|
1171 | this.setState(function (_ref) {
|
1172 | var toggled = _ref.toggled;
|
1173 | return {
|
1174 | toggled: !toggled
|
1175 | };
|
1176 | });
|
1177 | };
|
1178 |
|
1179 | _proto.render = function render() {
|
1180 | var _this$props = this.props,
|
1181 | className = _this$props.className,
|
1182 | attributes = _objectWithoutPropertiesLoose(_this$props, _excluded$11);
|
1183 |
|
1184 | var classes = mapToCssModules(classNames__default["default"](className, {
|
1185 | focus: this.state.focus
|
1186 | }), this.props.cssModule);
|
1187 | return React__default["default"].createElement(Button, _extends({
|
1188 | active: this.state.toggled,
|
1189 | onBlur: this.onBlur,
|
1190 | onFocus: this.onFocus,
|
1191 | onClick: this.onClick,
|
1192 | className: classes
|
1193 | }, attributes));
|
1194 | };
|
1195 |
|
1196 | return ButtonToggle;
|
1197 | }(React__default["default"].Component);
|
1198 |
|
1199 | ButtonToggle.propTypes = propTypes$17;
|
1200 | ButtonToggle.defaultProps = defaultProps$15;
|
1201 | var ButtonToggle$1 = ButtonToggle;
|
1202 |
|
1203 | |
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 | var DropdownContext = React__default["default"].createContext({});
|
1215 |
|
1216 | var _excluded$10 = ["className", "cssModule", "direction", "isOpen", "group", "size", "nav", "setActiveFromChild", "active", "tag", "menuRole"];
|
1217 | var propTypes$16 = {
|
1218 | a11y: PropTypes__default["default"].bool,
|
1219 | disabled: PropTypes__default["default"].bool,
|
1220 | direction: PropTypes__default["default"].oneOf(['up', 'down', 'start', 'end', 'left', 'right']),
|
1221 | group: PropTypes__default["default"].bool,
|
1222 | isOpen: PropTypes__default["default"].bool,
|
1223 | nav: PropTypes__default["default"].bool,
|
1224 | active: PropTypes__default["default"].bool,
|
1225 | size: PropTypes__default["default"].string,
|
1226 | tag: tagPropType,
|
1227 | toggle: PropTypes__default["default"].func,
|
1228 | children: PropTypes__default["default"].node,
|
1229 | className: PropTypes__default["default"].string,
|
1230 | cssModule: PropTypes__default["default"].object,
|
1231 | inNavbar: PropTypes__default["default"].bool,
|
1232 | setActiveFromChild: PropTypes__default["default"].bool,
|
1233 | menuRole: PropTypes__default["default"].oneOf(['listbox', 'menu'])
|
1234 | };
|
1235 | var defaultProps$14 = {
|
1236 | a11y: true,
|
1237 | isOpen: false,
|
1238 | direction: 'down',
|
1239 | nav: false,
|
1240 | active: false,
|
1241 | inNavbar: false,
|
1242 | setActiveFromChild: false
|
1243 | };
|
1244 | var preventDefaultKeys = [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down, keyCodes.end, keyCodes.home];
|
1245 |
|
1246 | var Dropdown = function (_React$Component) {
|
1247 | _inheritsLoose(Dropdown, _React$Component);
|
1248 |
|
1249 | function Dropdown(props) {
|
1250 | var _this;
|
1251 |
|
1252 | _this = _React$Component.call(this, props) || this;
|
1253 | _this.addEvents = _this.addEvents.bind(_assertThisInitialized(_this));
|
1254 | _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));
|
1255 | _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
|
1256 | _this.removeEvents = _this.removeEvents.bind(_assertThisInitialized(_this));
|
1257 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
1258 | _this.handleMenuRef = _this.handleMenuRef.bind(_assertThisInitialized(_this));
|
1259 | _this.containerRef = React__default["default"].createRef();
|
1260 | _this.menuRef = React__default["default"].createRef();
|
1261 | return _this;
|
1262 | }
|
1263 |
|
1264 | var _proto = Dropdown.prototype;
|
1265 |
|
1266 | _proto.handleMenuRef = function handleMenuRef(menuRef) {
|
1267 | this.menuRef.current = menuRef;
|
1268 | };
|
1269 |
|
1270 | _proto.getContextValue = function getContextValue() {
|
1271 | return {
|
1272 | toggle: this.toggle,
|
1273 | isOpen: this.props.isOpen,
|
1274 | direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction,
|
1275 | inNavbar: this.props.inNavbar,
|
1276 | disabled: this.props.disabled,
|
1277 |
|
1278 |
|
1279 | onMenuRef: this.handleMenuRef,
|
1280 | menuRole: this.props.menuRole
|
1281 | };
|
1282 | };
|
1283 |
|
1284 | _proto.componentDidMount = function componentDidMount() {
|
1285 | this.handleProps();
|
1286 | };
|
1287 |
|
1288 | _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
1289 | if (this.props.isOpen !== prevProps.isOpen) {
|
1290 | this.handleProps();
|
1291 | }
|
1292 | };
|
1293 |
|
1294 | _proto.componentWillUnmount = function componentWillUnmount() {
|
1295 | this.removeEvents();
|
1296 | };
|
1297 |
|
1298 | _proto.getContainer = function getContainer() {
|
1299 | return this.containerRef.current;
|
1300 | };
|
1301 |
|
1302 | _proto.getMenu = function getMenu() {
|
1303 | return this.menuRef.current;
|
1304 | };
|
1305 |
|
1306 | _proto.getMenuCtrl = function getMenuCtrl() {
|
1307 | if (this._$menuCtrl) return this._$menuCtrl;
|
1308 | this._$menuCtrl = this.getContainer().querySelector('[aria-expanded]');
|
1309 | return this._$menuCtrl;
|
1310 | };
|
1311 |
|
1312 | _proto.getItemType = function getItemType() {
|
1313 | if (this.context.menuRole === 'listbox') {
|
1314 | return 'option';
|
1315 | }
|
1316 |
|
1317 | return 'menuitem';
|
1318 | };
|
1319 |
|
1320 | _proto.getMenuItems = function getMenuItems() {
|
1321 |
|
1322 |
|
1323 |
|
1324 | var menuContainer = this.getMenu() || this.getContainer();
|
1325 | return [].slice.call(menuContainer.querySelectorAll("[role=\"" + this.getItemType() + "\"]"));
|
1326 | };
|
1327 |
|
1328 | _proto.addEvents = function addEvents() {
|
1329 | var _this2 = this;
|
1330 |
|
1331 | ['click', 'touchstart', 'keyup'].forEach(function (event) {
|
1332 | return document.addEventListener(event, _this2.handleDocumentClick, true);
|
1333 | });
|
1334 | };
|
1335 |
|
1336 | _proto.removeEvents = function removeEvents() {
|
1337 | var _this3 = this;
|
1338 |
|
1339 | ['click', 'touchstart', 'keyup'].forEach(function (event) {
|
1340 | return document.removeEventListener(event, _this3.handleDocumentClick, true);
|
1341 | });
|
1342 | };
|
1343 |
|
1344 | _proto.handleDocumentClick = function handleDocumentClick(e) {
|
1345 | if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return;
|
1346 | var container = this.getContainer();
|
1347 | var menu = this.getMenu();
|
1348 | var clickIsInContainer = container.contains(e.target) && container !== e.target;
|
1349 | var clickIsInInput = container.classList.contains('input-group') && container.classList.contains('dropdown') && e.target.tagName === 'INPUT';
|
1350 | var clickIsInMenu = menu && menu.contains(e.target) && menu !== e.target;
|
1351 |
|
1352 | if ((clickIsInContainer && !clickIsInInput || clickIsInMenu) && (e.type !== 'keyup' || e.which === keyCodes.tab)) {
|
1353 | return;
|
1354 | }
|
1355 |
|
1356 | this.toggle(e);
|
1357 | };
|
1358 |
|
1359 | _proto.handleKeyDown = function handleKeyDown(e) {
|
1360 | var _this4 = this;
|
1361 |
|
1362 | var isTargetMenuItem = e.target.getAttribute('role') === 'menuitem' || e.target.getAttribute('role') === 'option';
|
1363 | var isTargetMenuCtrl = this.getMenuCtrl() === e.target;
|
1364 | var isTab = keyCodes.tab === e.which;
|
1365 |
|
1366 | if (/input|textarea/i.test(e.target.tagName) || isTab && !this.props.a11y || isTab && !(isTargetMenuItem || isTargetMenuCtrl)) {
|
1367 | return;
|
1368 | }
|
1369 |
|
1370 | if (preventDefaultKeys.indexOf(e.which) !== -1 || e.which >= 48 && e.which <= 90) {
|
1371 | e.preventDefault();
|
1372 | }
|
1373 |
|
1374 | if (this.props.disabled) return;
|
1375 |
|
1376 | if (isTargetMenuCtrl) {
|
1377 | if ([keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {
|
1378 |
|
1379 | if (!this.props.isOpen) {
|
1380 | this.toggle(e);
|
1381 | }
|
1382 |
|
1383 | setTimeout(function () {
|
1384 | return _this4.getMenuItems()[0].focus();
|
1385 | });
|
1386 | } else if (this.props.isOpen && isTab) {
|
1387 |
|
1388 |
|
1389 |
|
1390 | e.preventDefault();
|
1391 | this.getMenuItems()[0].focus();
|
1392 | } else if (this.props.isOpen && e.which === keyCodes.esc) {
|
1393 | this.toggle(e);
|
1394 | }
|
1395 | }
|
1396 |
|
1397 | if (this.props.isOpen && isTargetMenuItem) {
|
1398 | if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {
|
1399 | this.toggle(e);
|
1400 | this.getMenuCtrl().focus();
|
1401 | } else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {
|
1402 | e.target.click();
|
1403 | this.getMenuCtrl().focus();
|
1404 | } else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {
|
1405 | var $menuitems = this.getMenuItems();
|
1406 | var index = $menuitems.indexOf(e.target);
|
1407 |
|
1408 | if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {
|
1409 | index = index !== 0 ? index - 1 : $menuitems.length - 1;
|
1410 | } else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {
|
1411 | index = index === $menuitems.length - 1 ? 0 : index + 1;
|
1412 | }
|
1413 |
|
1414 | $menuitems[index].focus();
|
1415 | } else if (keyCodes.end === e.which) {
|
1416 | var _$menuitems = this.getMenuItems();
|
1417 |
|
1418 | _$menuitems[_$menuitems.length - 1].focus();
|
1419 | } else if (keyCodes.home === e.which) {
|
1420 | var _$menuitems2 = this.getMenuItems();
|
1421 |
|
1422 | _$menuitems2[0].focus();
|
1423 | } else if (e.which >= 48 && e.which <= 90) {
|
1424 | var _$menuitems3 = this.getMenuItems();
|
1425 |
|
1426 | var charPressed = String.fromCharCode(e.which).toLowerCase();
|
1427 |
|
1428 | for (var i = 0; i < _$menuitems3.length; i += 1) {
|
1429 | var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();
|
1430 |
|
1431 | if (firstLetter === charPressed) {
|
1432 | _$menuitems3[i].focus();
|
1433 |
|
1434 | break;
|
1435 | }
|
1436 | }
|
1437 | }
|
1438 | }
|
1439 | };
|
1440 |
|
1441 | _proto.handleProps = function handleProps() {
|
1442 | if (this.props.isOpen) {
|
1443 | this.addEvents();
|
1444 | } else {
|
1445 | this.removeEvents();
|
1446 | }
|
1447 | };
|
1448 |
|
1449 | _proto.toggle = function toggle(e) {
|
1450 | if (this.props.disabled) {
|
1451 | return e && e.preventDefault();
|
1452 | }
|
1453 |
|
1454 | return this.props.toggle(e);
|
1455 | };
|
1456 |
|
1457 | _proto.render = function render() {
|
1458 | var _classNames, _ref;
|
1459 |
|
1460 | var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar', 'a11y']),
|
1461 | className = _omit.className,
|
1462 | cssModule = _omit.cssModule,
|
1463 | direction = _omit.direction,
|
1464 | isOpen = _omit.isOpen,
|
1465 | group = _omit.group,
|
1466 | size = _omit.size,
|
1467 | nav = _omit.nav,
|
1468 | setActiveFromChild = _omit.setActiveFromChild,
|
1469 | active = _omit.active,
|
1470 | tag = _omit.tag,
|
1471 | attrs = _objectWithoutPropertiesLoose(_omit, _excluded$10);
|
1472 |
|
1473 | var Tag = tag || (nav ? 'li' : 'div');
|
1474 | var subItemIsActive = false;
|
1475 |
|
1476 | if (setActiveFromChild) {
|
1477 | React__default["default"].Children.map(this.props.children[1].props.children, function (dropdownItem) {
|
1478 | if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;
|
1479 | });
|
1480 | }
|
1481 |
|
1482 | var classes = mapToCssModules(classNames__default["default"](className, nav && active ? 'active' : false, setActiveFromChild && subItemIsActive ? 'active' : false, (_classNames = {
|
1483 | 'btn-group': group
|
1484 | }, _classNames["btn-group-" + size] = !!size, _classNames.dropdown = !group, _classNames.dropup = direction === 'up', _classNames.dropstart = direction === 'start' || direction === 'left', _classNames.dropend = direction === 'end' || direction === 'right', _classNames.show = isOpen, _classNames['nav-item'] = nav, _classNames)), cssModule);
|
1485 | return React__default["default"].createElement(DropdownContext.Provider, {
|
1486 | value: this.getContextValue()
|
1487 | }, React__default["default"].createElement(reactPopper.Manager, null, React__default["default"].createElement(Tag, _extends({}, attrs, (_ref = {}, _ref[typeof Tag === 'string' ? 'ref' : 'innerRef'] = this.containerRef, _ref), {
|
1488 | onKeyDown: this.handleKeyDown,
|
1489 | className: classes
|
1490 | }))));
|
1491 | };
|
1492 |
|
1493 | return Dropdown;
|
1494 | }(React__default["default"].Component);
|
1495 |
|
1496 | Dropdown.propTypes = propTypes$16;
|
1497 | Dropdown.defaultProps = defaultProps$14;
|
1498 | var Dropdown$1 = Dropdown;
|
1499 |
|
1500 | var propTypes$15 = {
|
1501 | children: PropTypes__default["default"].node
|
1502 | };
|
1503 |
|
1504 | var ButtonDropdown = function ButtonDropdown(props) {
|
1505 | return React__default["default"].createElement(Dropdown$1, _extends({
|
1506 | group: true
|
1507 | }, props));
|
1508 | };
|
1509 |
|
1510 | ButtonDropdown.propTypes = propTypes$15;
|
1511 | var ButtonDropdown$1 = ButtonDropdown;
|
1512 |
|
1513 | var _excluded$$ = ["className", "cssModule", "size", "vertical", "tag"];
|
1514 | var propTypes$14 = {
|
1515 | tag: tagPropType,
|
1516 | 'aria-label': PropTypes__default["default"].string,
|
1517 | className: PropTypes__default["default"].string,
|
1518 | cssModule: PropTypes__default["default"].object,
|
1519 | role: PropTypes__default["default"].string,
|
1520 | size: PropTypes__default["default"].string,
|
1521 | vertical: PropTypes__default["default"].bool
|
1522 | };
|
1523 | var defaultProps$13 = {
|
1524 | tag: 'div',
|
1525 | role: 'group'
|
1526 | };
|
1527 |
|
1528 | var ButtonGroup = function ButtonGroup(props) {
|
1529 | var className = props.className,
|
1530 | cssModule = props.cssModule,
|
1531 | size = props.size,
|
1532 | vertical = props.vertical,
|
1533 | Tag = props.tag,
|
1534 | attributes = _objectWithoutPropertiesLoose(props, _excluded$$);
|
1535 |
|
1536 | var classes = mapToCssModules(classNames__default["default"](className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule);
|
1537 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
1538 | className: classes
|
1539 | }));
|
1540 | };
|
1541 |
|
1542 | ButtonGroup.propTypes = propTypes$14;
|
1543 | ButtonGroup.defaultProps = defaultProps$13;
|
1544 | var ButtonGroup$1 = ButtonGroup;
|
1545 |
|
1546 | var _excluded$_ = ["className", "cssModule", "tag"];
|
1547 | var propTypes$13 = {
|
1548 | tag: tagPropType,
|
1549 | 'aria-label': PropTypes__default["default"].string,
|
1550 | className: PropTypes__default["default"].string,
|
1551 | cssModule: PropTypes__default["default"].object,
|
1552 | role: PropTypes__default["default"].string
|
1553 | };
|
1554 | var defaultProps$12 = {
|
1555 | tag: 'div',
|
1556 | role: 'toolbar'
|
1557 | };
|
1558 |
|
1559 | var ButtonToolbar = function ButtonToolbar(props) {
|
1560 | var className = props.className,
|
1561 | cssModule = props.cssModule,
|
1562 | Tag = props.tag,
|
1563 | attributes = _objectWithoutPropertiesLoose(props, _excluded$_);
|
1564 |
|
1565 | var classes = mapToCssModules(classNames__default["default"](className, 'btn-toolbar'), cssModule);
|
1566 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
1567 | className: classes
|
1568 | }));
|
1569 | };
|
1570 |
|
1571 | ButtonToolbar.propTypes = propTypes$13;
|
1572 | ButtonToolbar.defaultProps = defaultProps$12;
|
1573 | var ButtonToolbar$1 = ButtonToolbar;
|
1574 |
|
1575 | var _excluded$Z = ["className", "cssModule", "divider", "tag", "header", "active", "text"];
|
1576 | var propTypes$12 = {
|
1577 | children: PropTypes__default["default"].node,
|
1578 | active: PropTypes__default["default"].bool,
|
1579 | disabled: PropTypes__default["default"].bool,
|
1580 | divider: PropTypes__default["default"].bool,
|
1581 | tag: tagPropType,
|
1582 | header: PropTypes__default["default"].bool,
|
1583 | onClick: PropTypes__default["default"].func,
|
1584 | className: PropTypes__default["default"].string,
|
1585 | cssModule: PropTypes__default["default"].object,
|
1586 | toggle: PropTypes__default["default"].bool,
|
1587 | text: PropTypes__default["default"].bool
|
1588 | };
|
1589 | var defaultProps$11 = {
|
1590 | tag: 'button',
|
1591 | toggle: true
|
1592 | };
|
1593 |
|
1594 | var DropdownItem = function (_React$Component) {
|
1595 | _inheritsLoose(DropdownItem, _React$Component);
|
1596 |
|
1597 | function DropdownItem(props) {
|
1598 | var _this;
|
1599 |
|
1600 | _this = _React$Component.call(this, props) || this;
|
1601 | _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
|
1602 | _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_this));
|
1603 | return _this;
|
1604 | }
|
1605 |
|
1606 | var _proto = DropdownItem.prototype;
|
1607 |
|
1608 | _proto.getRole = function getRole() {
|
1609 | if (this.context.menuRole === 'listbox') {
|
1610 | return 'option';
|
1611 | }
|
1612 |
|
1613 | return 'menuitem';
|
1614 | };
|
1615 |
|
1616 | _proto.onClick = function onClick(e) {
|
1617 | var _this$props = this.props,
|
1618 | disabled = _this$props.disabled,
|
1619 | header = _this$props.header,
|
1620 | divider = _this$props.divider,
|
1621 | text = _this$props.text;
|
1622 |
|
1623 | if (disabled || header || divider || text) {
|
1624 | e.preventDefault();
|
1625 | return;
|
1626 | }
|
1627 |
|
1628 | if (this.props.onClick) {
|
1629 | this.props.onClick(e);
|
1630 | }
|
1631 |
|
1632 | if (this.props.toggle) {
|
1633 | this.context.toggle(e);
|
1634 | }
|
1635 | };
|
1636 |
|
1637 | _proto.getTabIndex = function getTabIndex() {
|
1638 | var _this$props2 = this.props,
|
1639 | disabled = _this$props2.disabled,
|
1640 | header = _this$props2.header,
|
1641 | divider = _this$props2.divider,
|
1642 | text = _this$props2.text;
|
1643 |
|
1644 | if (disabled || header || divider || text) {
|
1645 | return '-1';
|
1646 | }
|
1647 |
|
1648 | return '0';
|
1649 | };
|
1650 |
|
1651 | _proto.render = function render() {
|
1652 | var tabIndex = this.getTabIndex();
|
1653 | var role = tabIndex > -1 ? this.getRole() : undefined;
|
1654 |
|
1655 | var _omit = omit(this.props, ['toggle']),
|
1656 | className = _omit.className,
|
1657 | cssModule = _omit.cssModule,
|
1658 | divider = _omit.divider,
|
1659 | Tag = _omit.tag,
|
1660 | header = _omit.header,
|
1661 | active = _omit.active,
|
1662 | text = _omit.text,
|
1663 | props = _objectWithoutPropertiesLoose(_omit, _excluded$Z);
|
1664 |
|
1665 | var classes = mapToCssModules(classNames__default["default"](className, {
|
1666 | disabled: props.disabled,
|
1667 | 'dropdown-item': !divider && !header && !text,
|
1668 | active: active,
|
1669 | 'dropdown-header': header,
|
1670 | 'dropdown-divider': divider,
|
1671 | 'dropdown-item-text': text
|
1672 | }), cssModule);
|
1673 |
|
1674 | if (Tag === 'button') {
|
1675 | if (header) {
|
1676 | Tag = 'h6';
|
1677 | } else if (divider) {
|
1678 | Tag = 'div';
|
1679 | } else if (props.href) {
|
1680 | Tag = 'a';
|
1681 | } else if (text) {
|
1682 | Tag = 'span';
|
1683 | }
|
1684 | }
|
1685 |
|
1686 | return React__default["default"].createElement(Tag, _extends({
|
1687 | type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined
|
1688 | }, props, {
|
1689 | tabIndex: tabIndex,
|
1690 | role: role,
|
1691 | className: classes,
|
1692 | onClick: this.onClick
|
1693 | }));
|
1694 | };
|
1695 |
|
1696 | return DropdownItem;
|
1697 | }(React__default["default"].Component);
|
1698 |
|
1699 | DropdownItem.propTypes = propTypes$12;
|
1700 | DropdownItem.defaultProps = defaultProps$11;
|
1701 | DropdownItem.contextType = DropdownContext;
|
1702 | var DropdownItem$1 = DropdownItem;
|
1703 |
|
1704 | var _excluded$Y = ["className", "cssModule", "dark", "end", "right", "tag", "flip", "modifiers", "persist", "strategy", "container", "updateOnSelect"];
|
1705 | var propTypes$11 = {
|
1706 | tag: tagPropType,
|
1707 | children: PropTypes__default["default"].node.isRequired,
|
1708 | dark: PropTypes__default["default"].bool,
|
1709 | end: PropTypes__default["default"].bool,
|
1710 | flip: PropTypes__default["default"].bool,
|
1711 | modifiers: PropTypes__default["default"].array,
|
1712 | className: PropTypes__default["default"].string,
|
1713 | cssModule: PropTypes__default["default"].object,
|
1714 | persist: PropTypes__default["default"].bool,
|
1715 | strategy: PropTypes__default["default"].string,
|
1716 | container: targetPropType,
|
1717 |
|
1718 |
|
1719 | updateOnSelect: PropTypes__default["default"].bool,
|
1720 | right: deprecated(PropTypes__default["default"].bool, 'Please use "end" instead.')
|
1721 | };
|
1722 | var defaultProps$10 = {
|
1723 | tag: 'div',
|
1724 | flip: true,
|
1725 | modifiers: []
|
1726 | };
|
1727 | var directionPositionMap = {
|
1728 | up: 'top',
|
1729 | left: 'left',
|
1730 | right: 'right',
|
1731 | start: 'left',
|
1732 | end: 'right',
|
1733 | down: 'bottom'
|
1734 | };
|
1735 |
|
1736 | var DropdownMenu = function (_React$Component) {
|
1737 | _inheritsLoose(DropdownMenu, _React$Component);
|
1738 |
|
1739 | function DropdownMenu() {
|
1740 | return _React$Component.apply(this, arguments) || this;
|
1741 | }
|
1742 |
|
1743 | var _proto = DropdownMenu.prototype;
|
1744 |
|
1745 | _proto.getRole = function getRole() {
|
1746 | if (this.context.menuRole === 'listbox') {
|
1747 | return 'listbox';
|
1748 | }
|
1749 |
|
1750 | return 'menu';
|
1751 | };
|
1752 |
|
1753 | _proto.render = function render() {
|
1754 | var _this = this;
|
1755 |
|
1756 | var _this$props = this.props,
|
1757 | className = _this$props.className,
|
1758 | cssModule = _this$props.cssModule,
|
1759 | dark = _this$props.dark,
|
1760 | end = _this$props.end,
|
1761 | right = _this$props.right,
|
1762 | tag = _this$props.tag,
|
1763 | flip = _this$props.flip,
|
1764 | modifiers = _this$props.modifiers,
|
1765 | persist = _this$props.persist,
|
1766 | strategy = _this$props.strategy,
|
1767 | container = _this$props.container,
|
1768 | updateOnSelect = _this$props.updateOnSelect,
|
1769 | attrs = _objectWithoutPropertiesLoose(_this$props, _excluded$Y);
|
1770 |
|
1771 | var classes = mapToCssModules(classNames__default["default"](className, 'dropdown-menu', {
|
1772 | 'dropdown-menu-dark': dark,
|
1773 | 'dropdown-menu-end': end || right,
|
1774 | show: this.context.isOpen
|
1775 | }), cssModule);
|
1776 | var Tag = tag;
|
1777 |
|
1778 | if (persist || this.context.isOpen && !this.context.inNavbar) {
|
1779 | var position1 = directionPositionMap[this.context.direction] || 'bottom';
|
1780 | var position2 = end || right ? 'end' : 'start';
|
1781 | var poperPlacement = position1 + "-" + position2;
|
1782 | var poperModifiers = [].concat(modifiers, [{
|
1783 | name: 'flip',
|
1784 | enabled: !!flip
|
1785 | }]);
|
1786 | var popper = React__default["default"].createElement(reactPopper.Popper, {
|
1787 | placement: poperPlacement,
|
1788 | modifiers: poperModifiers,
|
1789 | strategy: strategy
|
1790 | }, function (_ref) {
|
1791 | var ref = _ref.ref,
|
1792 | style = _ref.style,
|
1793 | placement = _ref.placement,
|
1794 | update = _ref.update;
|
1795 |
|
1796 | var combinedStyle = _objectSpread2(_objectSpread2({}, _this.props.style), style);
|
1797 |
|
1798 | var handleRef = function handleRef(tagRef) {
|
1799 |
|
1800 | ref(tagRef);
|
1801 |
|
1802 |
|
1803 | var onMenuRef = _this.context.onMenuRef;
|
1804 | if (onMenuRef) onMenuRef(tagRef);
|
1805 | };
|
1806 |
|
1807 | return React__default["default"].createElement(Tag, _extends({
|
1808 | tabIndex: "-1",
|
1809 | role: _this.getRole(),
|
1810 | ref: handleRef
|
1811 | }, attrs, {
|
1812 | style: combinedStyle,
|
1813 | "aria-hidden": !_this.context.isOpen,
|
1814 | className: classes,
|
1815 | "data-popper-placement": placement,
|
1816 | onClick: function onClick() {
|
1817 | return updateOnSelect && update();
|
1818 | }
|
1819 | }));
|
1820 | });
|
1821 |
|
1822 | if (container) {
|
1823 | return ReactDOM__default["default"].createPortal(popper, getTarget(container));
|
1824 | } else {
|
1825 | return popper;
|
1826 | }
|
1827 | }
|
1828 |
|
1829 | return React__default["default"].createElement(Tag, _extends({
|
1830 | tabIndex: "-1",
|
1831 | role: this.getRole()
|
1832 | }, attrs, {
|
1833 | "aria-hidden": !this.context.isOpen,
|
1834 | className: classes,
|
1835 | "data-popper-placement": attrs.placement
|
1836 | }));
|
1837 | };
|
1838 |
|
1839 | return DropdownMenu;
|
1840 | }(React__default["default"].Component);
|
1841 | DropdownMenu.propTypes = propTypes$11;
|
1842 | DropdownMenu.defaultProps = defaultProps$10;
|
1843 | DropdownMenu.contextType = DropdownContext;
|
1844 | var DropdownMenu$1 = DropdownMenu;
|
1845 |
|
1846 | var _excluded$X = ["className", "color", "cssModule", "caret", "split", "nav", "tag", "innerRef"];
|
1847 | var propTypes$10 = {
|
1848 | caret: PropTypes__default["default"].bool,
|
1849 | color: PropTypes__default["default"].string,
|
1850 | children: PropTypes__default["default"].node,
|
1851 | className: PropTypes__default["default"].string,
|
1852 | cssModule: PropTypes__default["default"].object,
|
1853 | disabled: PropTypes__default["default"].bool,
|
1854 | onClick: PropTypes__default["default"].func,
|
1855 | 'aria-haspopup': PropTypes__default["default"].bool,
|
1856 | split: PropTypes__default["default"].bool,
|
1857 | tag: tagPropType,
|
1858 | nav: PropTypes__default["default"].bool
|
1859 | };
|
1860 | var defaultProps$$ = {
|
1861 | color: 'secondary',
|
1862 | 'aria-haspopup': true
|
1863 | };
|
1864 |
|
1865 | var DropdownToggle = function (_React$Component) {
|
1866 | _inheritsLoose(DropdownToggle, _React$Component);
|
1867 |
|
1868 | function DropdownToggle(props) {
|
1869 | var _this;
|
1870 |
|
1871 | _this = _React$Component.call(this, props) || this;
|
1872 | _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
|
1873 | return _this;
|
1874 | }
|
1875 |
|
1876 | var _proto = DropdownToggle.prototype;
|
1877 |
|
1878 | _proto.onClick = function onClick(e) {
|
1879 | if (this.props.disabled || this.context.disabled) {
|
1880 | e.preventDefault();
|
1881 | return;
|
1882 | }
|
1883 |
|
1884 | if (this.props.nav && !this.props.tag) {
|
1885 | e.preventDefault();
|
1886 | }
|
1887 |
|
1888 | if (this.props.onClick) {
|
1889 | this.props.onClick(e);
|
1890 | }
|
1891 |
|
1892 | this.context.toggle(e);
|
1893 | };
|
1894 |
|
1895 | _proto.getRole = function getRole() {
|
1896 | return this.context.menuRole || this.props['aria-haspopup'];
|
1897 | };
|
1898 |
|
1899 | _proto.render = function render() {
|
1900 | var _this2 = this;
|
1901 |
|
1902 | var _this$props = this.props,
|
1903 | className = _this$props.className,
|
1904 | color = _this$props.color,
|
1905 | cssModule = _this$props.cssModule,
|
1906 | caret = _this$props.caret,
|
1907 | split = _this$props.split,
|
1908 | nav = _this$props.nav,
|
1909 | tag = _this$props.tag,
|
1910 | innerRef = _this$props.innerRef,
|
1911 | props = _objectWithoutPropertiesLoose(_this$props, _excluded$X);
|
1912 |
|
1913 | var ariaLabel = props['aria-label'] || 'Toggle Dropdown';
|
1914 | var classes = mapToCssModules(classNames__default["default"](className, {
|
1915 | 'dropdown-toggle': caret || split,
|
1916 | 'dropdown-toggle-split': split,
|
1917 | 'nav-link': nav
|
1918 | }), cssModule);
|
1919 | var children = typeof props.children !== 'undefined' ? props.children : React__default["default"].createElement("span", {
|
1920 | className: "visually-hidden"
|
1921 | }, ariaLabel);
|
1922 | var Tag;
|
1923 |
|
1924 | if (nav && !tag) {
|
1925 | Tag = 'a';
|
1926 | props.href = '#';
|
1927 | } else if (!tag) {
|
1928 | Tag = Button;
|
1929 | props.color = color;
|
1930 | props.cssModule = cssModule;
|
1931 | } else {
|
1932 | Tag = tag;
|
1933 | }
|
1934 |
|
1935 | if (this.context.inNavbar) {
|
1936 | return React__default["default"].createElement(Tag, _extends({}, props, {
|
1937 | className: classes,
|
1938 | onClick: this.onClick,
|
1939 | "aria-expanded": this.context.isOpen,
|
1940 | "aria-haspopup": this.getRole(),
|
1941 | children: children
|
1942 | }));
|
1943 | }
|
1944 |
|
1945 | return React__default["default"].createElement(reactPopper.Reference, {
|
1946 | innerRef: innerRef
|
1947 | }, function (_ref) {
|
1948 | var _ref2;
|
1949 |
|
1950 | var ref = _ref.ref;
|
1951 | return React__default["default"].createElement(Tag, _extends({}, props, (_ref2 = {}, _ref2[typeof Tag === 'string' ? 'ref' : 'innerRef'] = ref, _ref2), {
|
1952 | className: classes,
|
1953 | onClick: _this2.onClick,
|
1954 | "aria-expanded": _this2.context.isOpen,
|
1955 | "aria-haspopup": _this2.getRole(),
|
1956 | children: children
|
1957 | }));
|
1958 | });
|
1959 | };
|
1960 |
|
1961 | return DropdownToggle;
|
1962 | }(React__default["default"].Component);
|
1963 |
|
1964 | DropdownToggle.propTypes = propTypes$10;
|
1965 | DropdownToggle.defaultProps = defaultProps$$;
|
1966 | DropdownToggle.contextType = DropdownContext;
|
1967 | var DropdownToggle$1 = DropdownToggle;
|
1968 |
|
1969 | var _excluded$W = ["tag", "baseClass", "baseClassActive", "className", "cssModule", "children", "innerRef"];
|
1970 |
|
1971 | var propTypes$$ = _objectSpread2(_objectSpread2({}, reactTransitionGroup.Transition.propTypes), {}, {
|
1972 | children: PropTypes__default["default"].oneOfType([PropTypes__default["default"].arrayOf(PropTypes__default["default"].node), PropTypes__default["default"].node]),
|
1973 | tag: tagPropType,
|
1974 | baseClass: PropTypes__default["default"].string,
|
1975 | baseClassActive: PropTypes__default["default"].string,
|
1976 | className: PropTypes__default["default"].string,
|
1977 | cssModule: PropTypes__default["default"].object,
|
1978 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func])
|
1979 | });
|
1980 |
|
1981 | var defaultProps$_ = _objectSpread2(_objectSpread2({}, reactTransitionGroup.Transition.defaultProps), {}, {
|
1982 | tag: 'div',
|
1983 | baseClass: 'fade',
|
1984 | baseClassActive: 'show',
|
1985 | timeout: TransitionTimeouts.Fade,
|
1986 | appear: true,
|
1987 | enter: true,
|
1988 | exit: true,
|
1989 | "in": true
|
1990 | });
|
1991 |
|
1992 | function Fade(props) {
|
1993 | var Tag = props.tag,
|
1994 | baseClass = props.baseClass,
|
1995 | baseClassActive = props.baseClassActive,
|
1996 | className = props.className,
|
1997 | cssModule = props.cssModule,
|
1998 | children = props.children,
|
1999 | innerRef = props.innerRef,
|
2000 | otherProps = _objectWithoutPropertiesLoose(props, _excluded$W);
|
2001 |
|
2002 | var transitionProps = pick(otherProps, TransitionPropTypeKeys);
|
2003 | var childProps = omit(otherProps, TransitionPropTypeKeys);
|
2004 | return React__default["default"].createElement(reactTransitionGroup.Transition, transitionProps, function (status) {
|
2005 | var isActive = status === 'entered';
|
2006 | var classes = mapToCssModules(classNames__default["default"](className, baseClass, isActive && baseClassActive), cssModule);
|
2007 | return React__default["default"].createElement(Tag, _extends({
|
2008 | className: classes
|
2009 | }, childProps, {
|
2010 | ref: innerRef
|
2011 | }), children);
|
2012 | });
|
2013 | }
|
2014 |
|
2015 | Fade.propTypes = propTypes$$;
|
2016 | Fade.defaultProps = defaultProps$_;
|
2017 |
|
2018 | |
2019 |
|
2020 |
|
2021 |
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 | var AccordionContext = React__default["default"].createContext({});
|
2027 |
|
2028 | var _excluded$V = ["flush", "open", "toggle", "className", "cssModule", "tag", "innerRef"];
|
2029 | var propTypes$_ = {
|
2030 | tag: tagPropType,
|
2031 | className: PropTypes__default["default"].string,
|
2032 | cssModule: PropTypes__default["default"].object,
|
2033 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
2034 | children: PropTypes__default["default"].node,
|
2035 | flush: PropTypes__default["default"].bool,
|
2036 | open: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array, PropTypes__default["default"].string]).isRequired,
|
2037 | toggle: PropTypes__default["default"].func.isRequired
|
2038 | };
|
2039 | var defaultProps$Z = {
|
2040 | tag: 'div'
|
2041 | };
|
2042 |
|
2043 | var Accordion = function Accordion(props) {
|
2044 | var flush = props.flush,
|
2045 | open = props.open,
|
2046 | toggle = props.toggle,
|
2047 | className = props.className,
|
2048 | cssModule = props.cssModule,
|
2049 | Tag = props.tag,
|
2050 | innerRef = props.innerRef,
|
2051 | attributes = _objectWithoutPropertiesLoose(props, _excluded$V);
|
2052 |
|
2053 | var classes = mapToCssModules(classNames__default["default"](className, 'accordion', {
|
2054 | 'accordion-flush': flush
|
2055 | }), cssModule);
|
2056 | var accordionContext = React.useMemo(function () {
|
2057 | return {
|
2058 | open: open,
|
2059 | toggle: toggle
|
2060 | };
|
2061 | });
|
2062 | return React__default["default"].createElement(AccordionContext.Provider, {
|
2063 | value: accordionContext
|
2064 | }, React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2065 | className: classes,
|
2066 | ref: innerRef
|
2067 | })));
|
2068 | };
|
2069 |
|
2070 | Accordion.propTypes = propTypes$_;
|
2071 | Accordion.defaultProps = defaultProps$Z;
|
2072 | var Accordion$1 = Accordion;
|
2073 |
|
2074 | var _excluded$U = ["defaultOpen", "stayOpen"];
|
2075 | var propTypes$Z = {
|
2076 | tag: tagPropType,
|
2077 | className: PropTypes__default["default"].string,
|
2078 | cssModule: PropTypes__default["default"].object,
|
2079 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
2080 | children: PropTypes__default["default"].node,
|
2081 | defaultOpen: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array, PropTypes__default["default"].string]),
|
2082 | stayOpen: PropTypes__default["default"].bool
|
2083 | };
|
2084 | var defaultProps$Y = {
|
2085 | tag: 'div'
|
2086 | };
|
2087 |
|
2088 | var UncontrolledAccordion = function UncontrolledAccordion(_ref) {
|
2089 | var defaultOpen = _ref.defaultOpen,
|
2090 | stayOpen = _ref.stayOpen,
|
2091 | props = _objectWithoutPropertiesLoose(_ref, _excluded$U);
|
2092 |
|
2093 | var _useState = React.useState(defaultOpen || (stayOpen ? [] : undefined)),
|
2094 | open = _useState[0],
|
2095 | setOpen = _useState[1];
|
2096 |
|
2097 | var toggle = function toggle(id) {
|
2098 | if (stayOpen) {
|
2099 | open.includes(id) ? setOpen(open.filter(function (accordionId) {
|
2100 | return accordionId !== id;
|
2101 | })) : setOpen([].concat(open, [id]));
|
2102 | } else {
|
2103 | open === id ? setOpen(undefined) : setOpen(id);
|
2104 | }
|
2105 | };
|
2106 |
|
2107 | return React__default["default"].createElement(Accordion$1, _extends({}, props, {
|
2108 | open: open,
|
2109 | toggle: toggle
|
2110 | }));
|
2111 | };
|
2112 |
|
2113 | UncontrolledAccordion.propTypes = propTypes$Z;
|
2114 | UncontrolledAccordion.defaultProps = defaultProps$Y;
|
2115 | var UncontrolledAccordion$1 = UncontrolledAccordion;
|
2116 |
|
2117 | var _excluded$T = ["className", "cssModule", "tag", "innerRef", "children", "targetId"];
|
2118 | var propTypes$Y = {
|
2119 | tag: tagPropType,
|
2120 | className: PropTypes__default["default"].string,
|
2121 | cssModule: PropTypes__default["default"].object,
|
2122 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
2123 | children: PropTypes__default["default"].node,
|
2124 | targetId: PropTypes__default["default"].string.isRequired
|
2125 | };
|
2126 | var defaultProps$X = {
|
2127 | tag: 'h2'
|
2128 | };
|
2129 |
|
2130 | var AccordionHeader = function AccordionHeader(props) {
|
2131 | var className = props.className,
|
2132 | cssModule = props.cssModule,
|
2133 | Tag = props.tag,
|
2134 | innerRef = props.innerRef,
|
2135 | children = props.children,
|
2136 | targetId = props.targetId,
|
2137 | attributes = _objectWithoutPropertiesLoose(props, _excluded$T);
|
2138 |
|
2139 | var _useContext = React.useContext(AccordionContext),
|
2140 | open = _useContext.open,
|
2141 | toggle = _useContext.toggle;
|
2142 |
|
2143 | var classes = mapToCssModules(classNames__default["default"](className, 'accordion-header'), cssModule);
|
2144 | var buttonClasses = mapToCssModules(classNames__default["default"]('accordion-button', {
|
2145 | collapsed: !(Array.isArray(open) ? open.includes(targetId) : open === targetId)
|
2146 | }), cssModule);
|
2147 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2148 | className: classes,
|
2149 | ref: innerRef
|
2150 | }), React__default["default"].createElement("button", {
|
2151 | type: "button",
|
2152 | className: buttonClasses,
|
2153 | onClick: function onClick() {
|
2154 | return toggle(targetId);
|
2155 | }
|
2156 | }, children));
|
2157 | };
|
2158 |
|
2159 | AccordionHeader.propTypes = propTypes$Y;
|
2160 | AccordionHeader.defaultProps = defaultProps$X;
|
2161 | var AccordionHeader$1 = AccordionHeader;
|
2162 |
|
2163 | var _excluded$S = ["className", "cssModule", "tag", "innerRef"];
|
2164 | var propTypes$X = {
|
2165 | tag: tagPropType,
|
2166 | className: PropTypes__default["default"].string,
|
2167 | cssModule: PropTypes__default["default"].object,
|
2168 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
2169 | children: PropTypes__default["default"].node
|
2170 | };
|
2171 | var defaultProps$W = {
|
2172 | tag: 'div'
|
2173 | };
|
2174 |
|
2175 | var AccordionItem = function AccordionItem(props) {
|
2176 | var className = props.className,
|
2177 | cssModule = props.cssModule,
|
2178 | Tag = props.tag,
|
2179 | innerRef = props.innerRef,
|
2180 | attributes = _objectWithoutPropertiesLoose(props, _excluded$S);
|
2181 |
|
2182 | var classes = mapToCssModules(classNames__default["default"](className, 'accordion-item'), cssModule);
|
2183 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2184 | className: classes,
|
2185 | ref: innerRef
|
2186 | }));
|
2187 | };
|
2188 |
|
2189 | AccordionItem.propTypes = propTypes$X;
|
2190 | AccordionItem.defaultProps = defaultProps$W;
|
2191 | var AccordionItem$1 = AccordionItem;
|
2192 |
|
2193 | var _excluded$R = ["tag", "horizontal", "isOpen", "className", "navbar", "cssModule", "children", "innerRef"];
|
2194 |
|
2195 | var _transitionStatusToCl;
|
2196 |
|
2197 | var propTypes$W = _objectSpread2(_objectSpread2({}, reactTransitionGroup.Transition.propTypes), {}, {
|
2198 | horizontal: PropTypes__default["default"].bool,
|
2199 | isOpen: PropTypes__default["default"].bool,
|
2200 | children: PropTypes__default["default"].oneOfType([PropTypes__default["default"].arrayOf(PropTypes__default["default"].node), PropTypes__default["default"].node]),
|
2201 | tag: tagPropType,
|
2202 | className: PropTypes__default["default"].node,
|
2203 | navbar: PropTypes__default["default"].bool,
|
2204 | cssModule: PropTypes__default["default"].object,
|
2205 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].string, PropTypes__default["default"].object])
|
2206 | });
|
2207 |
|
2208 | var defaultProps$V = _objectSpread2(_objectSpread2({}, reactTransitionGroup.Transition.defaultProps), {}, {
|
2209 | horizontal: false,
|
2210 | isOpen: false,
|
2211 | appear: false,
|
2212 | enter: true,
|
2213 | exit: true,
|
2214 | tag: 'div',
|
2215 | timeout: TransitionTimeouts.Collapse
|
2216 | });
|
2217 |
|
2218 | var transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);
|
2219 |
|
2220 | function getTransitionClass(status) {
|
2221 | return transitionStatusToClassHash[status] || 'collapse';
|
2222 | }
|
2223 |
|
2224 | var Collapse = function (_Component) {
|
2225 | _inheritsLoose(Collapse, _Component);
|
2226 |
|
2227 | function Collapse(props) {
|
2228 | var _this;
|
2229 |
|
2230 | _this = _Component.call(this, props) || this;
|
2231 | _this.state = {
|
2232 | dimension: null
|
2233 | };
|
2234 | ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {
|
2235 | _this[name] = _this[name].bind(_assertThisInitialized(_this));
|
2236 | });
|
2237 | return _this;
|
2238 | }
|
2239 |
|
2240 | var _proto = Collapse.prototype;
|
2241 |
|
2242 | _proto.getDimension = function getDimension(node) {
|
2243 | return this.props.horizontal ? node.scrollWidth : node.scrollHeight;
|
2244 | };
|
2245 |
|
2246 | _proto.onEntering = function onEntering(node, isAppearing) {
|
2247 | this.setState({
|
2248 | dimension: this.getDimension(node)
|
2249 | });
|
2250 | this.props.onEntering(node, isAppearing);
|
2251 | };
|
2252 |
|
2253 | _proto.onEntered = function onEntered(node, isAppearing) {
|
2254 | this.setState({
|
2255 | dimension: null
|
2256 | });
|
2257 | this.props.onEntered(node, isAppearing);
|
2258 | };
|
2259 |
|
2260 | _proto.onExit = function onExit(node) {
|
2261 | this.setState({
|
2262 | dimension: this.getDimension(node)
|
2263 | });
|
2264 | this.props.onExit(node);
|
2265 | };
|
2266 |
|
2267 | _proto.onExiting = function onExiting(node) {
|
2268 |
|
2269 | this.getDimension(node);
|
2270 |
|
2271 |
|
2272 | this.setState({
|
2273 | dimension: 0
|
2274 | });
|
2275 | this.props.onExiting(node);
|
2276 | };
|
2277 |
|
2278 | _proto.onExited = function onExited(node) {
|
2279 | this.setState({
|
2280 | dimension: null
|
2281 | });
|
2282 | this.props.onExited(node);
|
2283 | };
|
2284 |
|
2285 | _proto.render = function render() {
|
2286 | var _this2 = this;
|
2287 |
|
2288 | var _this$props = this.props,
|
2289 | Tag = _this$props.tag,
|
2290 | horizontal = _this$props.horizontal,
|
2291 | isOpen = _this$props.isOpen,
|
2292 | className = _this$props.className,
|
2293 | navbar = _this$props.navbar,
|
2294 | cssModule = _this$props.cssModule,
|
2295 | children = _this$props.children,
|
2296 | otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$R);
|
2297 |
|
2298 | var dimension = this.state.dimension;
|
2299 | var transitionProps = pick(otherProps, TransitionPropTypeKeys);
|
2300 | var childProps = omit(otherProps, TransitionPropTypeKeys);
|
2301 | return React__default["default"].createElement(reactTransitionGroup.Transition, _extends({}, transitionProps, {
|
2302 | "in": isOpen,
|
2303 | onEntering: this.onEntering,
|
2304 | onEntered: this.onEntered,
|
2305 | onExit: this.onExit,
|
2306 | onExiting: this.onExiting,
|
2307 | onExited: this.onExited
|
2308 | }), function (status) {
|
2309 | var _ref;
|
2310 |
|
2311 | var collapseClass = getTransitionClass(status);
|
2312 | var classes = mapToCssModules(classNames__default["default"](className, horizontal && 'collapse-horizontal', collapseClass, navbar && 'navbar-collapse'), cssModule);
|
2313 | var style = dimension === null ? null : (_ref = {}, _ref[horizontal ? 'width' : 'height'] = dimension, _ref);
|
2314 | return React__default["default"].createElement(Tag, _extends({}, childProps, {
|
2315 | style: _objectSpread2(_objectSpread2({}, childProps.style), style),
|
2316 | className: classes,
|
2317 | ref: _this2.props.innerRef
|
2318 | }), children);
|
2319 | });
|
2320 | };
|
2321 |
|
2322 | return Collapse;
|
2323 | }(React.Component);
|
2324 |
|
2325 | Collapse.propTypes = propTypes$W;
|
2326 | Collapse.defaultProps = defaultProps$V;
|
2327 | var Collapse$1 = Collapse;
|
2328 |
|
2329 | var _excluded$Q = ["className", "cssModule", "tag", "innerRef", "children", "accordionId"];
|
2330 | var propTypes$V = {
|
2331 | tag: tagPropType,
|
2332 | className: PropTypes__default["default"].string,
|
2333 | cssModule: PropTypes__default["default"].object,
|
2334 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
2335 | children: PropTypes__default["default"].node,
|
2336 | accordionId: PropTypes__default["default"].string.isRequired
|
2337 | };
|
2338 | var defaultProps$U = {
|
2339 | tag: 'div'
|
2340 | };
|
2341 |
|
2342 | var AccordionBody = function AccordionBody(props) {
|
2343 | var className = props.className,
|
2344 | cssModule = props.cssModule,
|
2345 | Tag = props.tag,
|
2346 | innerRef = props.innerRef,
|
2347 | children = props.children,
|
2348 | accordionId = props.accordionId,
|
2349 | attributes = _objectWithoutPropertiesLoose(props, _excluded$Q);
|
2350 |
|
2351 | var _useContext = React.useContext(AccordionContext),
|
2352 | open = _useContext.open;
|
2353 |
|
2354 | var classes = mapToCssModules(classNames__default["default"](className, 'accordion-collapse'), cssModule);
|
2355 | return React__default["default"].createElement(Collapse$1, _extends({}, attributes, {
|
2356 | className: classes,
|
2357 | ref: innerRef,
|
2358 | isOpen: Array.isArray(open) ? open.includes(accordionId) : open === accordionId
|
2359 | }), React__default["default"].createElement(Tag, {
|
2360 | className: "accordion-body"
|
2361 | }, children));
|
2362 | };
|
2363 |
|
2364 | AccordionBody.propTypes = propTypes$V;
|
2365 | AccordionBody.defaultProps = defaultProps$U;
|
2366 | var AccordionBody$1 = AccordionBody;
|
2367 |
|
2368 | var _excluded$P = ["className", "cssModule", "color", "innerRef", "pill", "tag"];
|
2369 | var propTypes$U = {
|
2370 | color: PropTypes__default["default"].string,
|
2371 | pill: PropTypes__default["default"].bool,
|
2372 | tag: tagPropType,
|
2373 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].func, PropTypes__default["default"].string]),
|
2374 | children: PropTypes__default["default"].node,
|
2375 | className: PropTypes__default["default"].string,
|
2376 | cssModule: PropTypes__default["default"].object
|
2377 | };
|
2378 | var defaultProps$T = {
|
2379 | color: 'secondary',
|
2380 | pill: false,
|
2381 | tag: 'span'
|
2382 | };
|
2383 |
|
2384 | var Badge = function Badge(props) {
|
2385 | var className = props.className,
|
2386 | cssModule = props.cssModule,
|
2387 | color = props.color,
|
2388 | innerRef = props.innerRef,
|
2389 | pill = props.pill,
|
2390 | Tag = props.tag,
|
2391 | attributes = _objectWithoutPropertiesLoose(props, _excluded$P);
|
2392 |
|
2393 | var classes = mapToCssModules(classNames__default["default"](className, 'badge', 'bg-' + color, pill ? 'rounded-pill' : false), cssModule);
|
2394 |
|
2395 | if (attributes.href && Tag === 'span') {
|
2396 | Tag = 'a';
|
2397 | }
|
2398 |
|
2399 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2400 | className: classes,
|
2401 | ref: innerRef
|
2402 | }));
|
2403 | };
|
2404 |
|
2405 | Badge.propTypes = propTypes$U;
|
2406 | Badge.defaultProps = defaultProps$T;
|
2407 | var Badge$1 = Badge;
|
2408 |
|
2409 | var _excluded$O = ["className", "cssModule", "color", "body", "inverse", "outline", "tag", "innerRef"];
|
2410 | var propTypes$T = {
|
2411 | tag: tagPropType,
|
2412 | inverse: PropTypes__default["default"].bool,
|
2413 | color: PropTypes__default["default"].string,
|
2414 | body: PropTypes__default["default"].bool,
|
2415 | outline: PropTypes__default["default"].bool,
|
2416 | className: PropTypes__default["default"].string,
|
2417 | cssModule: PropTypes__default["default"].object,
|
2418 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func])
|
2419 | };
|
2420 | var defaultProps$S = {
|
2421 | tag: 'div'
|
2422 | };
|
2423 |
|
2424 | var Card = function Card(props) {
|
2425 | var className = props.className,
|
2426 | cssModule = props.cssModule,
|
2427 | color = props.color,
|
2428 | body = props.body,
|
2429 | inverse = props.inverse,
|
2430 | outline = props.outline,
|
2431 | Tag = props.tag,
|
2432 | innerRef = props.innerRef,
|
2433 | attributes = _objectWithoutPropertiesLoose(props, _excluded$O);
|
2434 |
|
2435 | var classes = mapToCssModules(classNames__default["default"](className, 'card', inverse ? 'text-white' : false, body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + "-" + color : false), cssModule);
|
2436 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2437 | className: classes,
|
2438 | ref: innerRef
|
2439 | }));
|
2440 | };
|
2441 |
|
2442 | Card.propTypes = propTypes$T;
|
2443 | Card.defaultProps = defaultProps$S;
|
2444 | var Card$1 = Card;
|
2445 |
|
2446 | var _excluded$N = ["className", "cssModule", "tag"];
|
2447 | var propTypes$S = {
|
2448 | tag: tagPropType,
|
2449 | className: PropTypes__default["default"].string,
|
2450 | cssModule: PropTypes__default["default"].object
|
2451 | };
|
2452 | var defaultProps$R = {
|
2453 | tag: 'div'
|
2454 | };
|
2455 |
|
2456 | var CardGroup = function CardGroup(props) {
|
2457 | var className = props.className,
|
2458 | cssModule = props.cssModule,
|
2459 | Tag = props.tag,
|
2460 | attributes = _objectWithoutPropertiesLoose(props, _excluded$N);
|
2461 |
|
2462 | var classes = mapToCssModules(classNames__default["default"](className, 'card-group'), cssModule);
|
2463 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2464 | className: classes
|
2465 | }));
|
2466 | };
|
2467 |
|
2468 | CardGroup.propTypes = propTypes$S;
|
2469 | CardGroup.defaultProps = defaultProps$R;
|
2470 | var CardGroup$1 = CardGroup;
|
2471 |
|
2472 | var _excluded$M = ["className", "cssModule", "tag"];
|
2473 | var propTypes$R = {
|
2474 | tag: tagPropType,
|
2475 | className: PropTypes__default["default"].string,
|
2476 | cssModule: PropTypes__default["default"].object
|
2477 | };
|
2478 | var defaultProps$Q = {
|
2479 | tag: 'div'
|
2480 | };
|
2481 |
|
2482 | var CardDeck = function CardDeck(props) {
|
2483 | var className = props.className,
|
2484 | cssModule = props.cssModule,
|
2485 | Tag = props.tag,
|
2486 | attributes = _objectWithoutPropertiesLoose(props, _excluded$M);
|
2487 |
|
2488 | var classes = mapToCssModules(classNames__default["default"](className, 'card-deck'), cssModule);
|
2489 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2490 | className: classes
|
2491 | }));
|
2492 | };
|
2493 |
|
2494 | CardDeck.propTypes = propTypes$R;
|
2495 | CardDeck.defaultProps = defaultProps$Q;
|
2496 | var CardDeck$1 = CardDeck;
|
2497 |
|
2498 | var _excluded$L = ["className", "cssModule", "tag"];
|
2499 | var propTypes$Q = {
|
2500 | tag: tagPropType,
|
2501 | className: PropTypes__default["default"].string,
|
2502 | cssModule: PropTypes__default["default"].object
|
2503 | };
|
2504 | var defaultProps$P = {
|
2505 | tag: 'div'
|
2506 | };
|
2507 |
|
2508 | var CardColumns = function CardColumns(props) {
|
2509 | var className = props.className,
|
2510 | cssModule = props.cssModule,
|
2511 | Tag = props.tag,
|
2512 | attributes = _objectWithoutPropertiesLoose(props, _excluded$L);
|
2513 |
|
2514 | var classes = mapToCssModules(classNames__default["default"](className, 'card-columns'), cssModule);
|
2515 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2516 | className: classes
|
2517 | }));
|
2518 | };
|
2519 |
|
2520 | CardColumns.propTypes = propTypes$Q;
|
2521 | CardColumns.defaultProps = defaultProps$P;
|
2522 | var CardColumns$1 = CardColumns;
|
2523 |
|
2524 | var _excluded$K = ["className", "cssModule", "innerRef", "tag"];
|
2525 | var propTypes$P = {
|
2526 | tag: tagPropType,
|
2527 | className: PropTypes__default["default"].string,
|
2528 | cssModule: PropTypes__default["default"].object,
|
2529 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func])
|
2530 | };
|
2531 | var defaultProps$O = {
|
2532 | tag: 'div'
|
2533 | };
|
2534 |
|
2535 | var CardBody = function CardBody(props) {
|
2536 | var className = props.className,
|
2537 | cssModule = props.cssModule,
|
2538 | innerRef = props.innerRef,
|
2539 | Tag = props.tag,
|
2540 | attributes = _objectWithoutPropertiesLoose(props, _excluded$K);
|
2541 |
|
2542 | var classes = mapToCssModules(classNames__default["default"](className, 'card-body'), cssModule);
|
2543 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2544 | className: classes,
|
2545 | ref: innerRef
|
2546 | }));
|
2547 | };
|
2548 |
|
2549 | CardBody.propTypes = propTypes$P;
|
2550 | CardBody.defaultProps = defaultProps$O;
|
2551 | var CardBody$1 = CardBody;
|
2552 |
|
2553 | var _excluded$J = ["className", "cssModule", "tag", "innerRef"];
|
2554 | var propTypes$O = {
|
2555 | tag: tagPropType,
|
2556 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].func, PropTypes__default["default"].string]),
|
2557 | className: PropTypes__default["default"].string,
|
2558 | cssModule: PropTypes__default["default"].object
|
2559 | };
|
2560 | var defaultProps$N = {
|
2561 | tag: 'a'
|
2562 | };
|
2563 |
|
2564 | var CardLink = function CardLink(props) {
|
2565 | var className = props.className,
|
2566 | cssModule = props.cssModule,
|
2567 | Tag = props.tag,
|
2568 | innerRef = props.innerRef,
|
2569 | attributes = _objectWithoutPropertiesLoose(props, _excluded$J);
|
2570 |
|
2571 | var classes = mapToCssModules(classNames__default["default"](className, 'card-link'), cssModule);
|
2572 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2573 | ref: innerRef,
|
2574 | className: classes
|
2575 | }));
|
2576 | };
|
2577 |
|
2578 | CardLink.propTypes = propTypes$O;
|
2579 | CardLink.defaultProps = defaultProps$N;
|
2580 | var CardLink$1 = CardLink;
|
2581 |
|
2582 | var _excluded$I = ["className", "cssModule", "tag"];
|
2583 | var propTypes$N = {
|
2584 | tag: tagPropType,
|
2585 | className: PropTypes__default["default"].string,
|
2586 | cssModule: PropTypes__default["default"].object
|
2587 | };
|
2588 | var defaultProps$M = {
|
2589 | tag: 'div'
|
2590 | };
|
2591 |
|
2592 | var CardFooter = function CardFooter(props) {
|
2593 | var className = props.className,
|
2594 | cssModule = props.cssModule,
|
2595 | Tag = props.tag,
|
2596 | attributes = _objectWithoutPropertiesLoose(props, _excluded$I);
|
2597 |
|
2598 | var classes = mapToCssModules(classNames__default["default"](className, 'card-footer'), cssModule);
|
2599 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2600 | className: classes
|
2601 | }));
|
2602 | };
|
2603 |
|
2604 | CardFooter.propTypes = propTypes$N;
|
2605 | CardFooter.defaultProps = defaultProps$M;
|
2606 | var CardFooter$1 = CardFooter;
|
2607 |
|
2608 | var _excluded$H = ["className", "cssModule", "tag"];
|
2609 | var propTypes$M = {
|
2610 | tag: tagPropType,
|
2611 | className: PropTypes__default["default"].string,
|
2612 | cssModule: PropTypes__default["default"].object
|
2613 | };
|
2614 | var defaultProps$L = {
|
2615 | tag: 'div'
|
2616 | };
|
2617 |
|
2618 | var CardHeader = function CardHeader(props) {
|
2619 | var className = props.className,
|
2620 | cssModule = props.cssModule,
|
2621 | Tag = props.tag,
|
2622 | attributes = _objectWithoutPropertiesLoose(props, _excluded$H);
|
2623 |
|
2624 | var classes = mapToCssModules(classNames__default["default"](className, 'card-header'), cssModule);
|
2625 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2626 | className: classes
|
2627 | }));
|
2628 | };
|
2629 |
|
2630 | CardHeader.propTypes = propTypes$M;
|
2631 | CardHeader.defaultProps = defaultProps$L;
|
2632 | var CardHeader$1 = CardHeader;
|
2633 |
|
2634 | var _excluded$G = ["className", "cssModule", "top", "bottom", "tag"];
|
2635 | var propTypes$L = {
|
2636 | tag: tagPropType,
|
2637 | top: PropTypes__default["default"].bool,
|
2638 | bottom: PropTypes__default["default"].bool,
|
2639 | className: PropTypes__default["default"].string,
|
2640 | cssModule: PropTypes__default["default"].object
|
2641 | };
|
2642 | var defaultProps$K = {
|
2643 | tag: 'img'
|
2644 | };
|
2645 |
|
2646 | var CardImg = function CardImg(props) {
|
2647 | var className = props.className,
|
2648 | cssModule = props.cssModule,
|
2649 | top = props.top,
|
2650 | bottom = props.bottom,
|
2651 | Tag = props.tag,
|
2652 | attributes = _objectWithoutPropertiesLoose(props, _excluded$G);
|
2653 |
|
2654 | var cardImgClassName = 'card-img';
|
2655 |
|
2656 | if (top) {
|
2657 | cardImgClassName = 'card-img-top';
|
2658 | }
|
2659 |
|
2660 | if (bottom) {
|
2661 | cardImgClassName = 'card-img-bottom';
|
2662 | }
|
2663 |
|
2664 | var classes = mapToCssModules(classNames__default["default"](className, cardImgClassName), cssModule);
|
2665 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2666 | className: classes
|
2667 | }));
|
2668 | };
|
2669 |
|
2670 | CardImg.propTypes = propTypes$L;
|
2671 | CardImg.defaultProps = defaultProps$K;
|
2672 | var CardImg$1 = CardImg;
|
2673 |
|
2674 | var _excluded$F = ["className", "cssModule", "tag"];
|
2675 | var propTypes$K = {
|
2676 | tag: tagPropType,
|
2677 | className: PropTypes__default["default"].string,
|
2678 | cssModule: PropTypes__default["default"].object
|
2679 | };
|
2680 | var defaultProps$J = {
|
2681 | tag: 'div'
|
2682 | };
|
2683 |
|
2684 | var CardImgOverlay = function CardImgOverlay(props) {
|
2685 | var className = props.className,
|
2686 | cssModule = props.cssModule,
|
2687 | Tag = props.tag,
|
2688 | attributes = _objectWithoutPropertiesLoose(props, _excluded$F);
|
2689 |
|
2690 | var classes = mapToCssModules(classNames__default["default"](className, 'card-img-overlay'), cssModule);
|
2691 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
2692 | className: classes
|
2693 | }));
|
2694 | };
|
2695 |
|
2696 | CardImgOverlay.propTypes = propTypes$K;
|
2697 | CardImgOverlay.defaultProps = defaultProps$J;
|
2698 | var CardImgOverlay$1 = CardImgOverlay;
|
2699 |
|
2700 | var _excluded$E = ["in", "children", "cssModule", "slide", "tag", "className"];
|
2701 |
|
2702 | var CarouselItem = function (_React$Component) {
|
2703 | _inheritsLoose(CarouselItem, _React$Component);
|
2704 |
|
2705 | function CarouselItem(props) {
|
2706 | var _this;
|
2707 |
|
2708 | _this = _React$Component.call(this, props) || this;
|
2709 | _this.state = {
|
2710 | startAnimation: false
|
2711 | };
|
2712 | _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this));
|
2713 | _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_this));
|
2714 | _this.onExit = _this.onExit.bind(_assertThisInitialized(_this));
|
2715 | _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
|
2716 | _this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
|
2717 | return _this;
|
2718 | }
|
2719 |
|
2720 | var _proto = CarouselItem.prototype;
|
2721 |
|
2722 | _proto.onEnter = function onEnter(node, isAppearing) {
|
2723 | this.setState({
|
2724 | startAnimation: false
|
2725 | });
|
2726 | this.props.onEnter(node, isAppearing);
|
2727 | };
|
2728 |
|
2729 | _proto.onEntering = function onEntering(node, isAppearing) {
|
2730 |
|
2731 | var offsetHeight = node.offsetHeight;
|
2732 | this.setState({
|
2733 | startAnimation: true
|
2734 | });
|
2735 | this.props.onEntering(node, isAppearing);
|
2736 | return offsetHeight;
|
2737 | };
|
2738 |
|
2739 | _proto.onExit = function onExit(node) {
|
2740 | this.setState({
|
2741 | startAnimation: false
|
2742 | });
|
2743 | this.props.onExit(node);
|
2744 | };
|
2745 |
|
2746 | _proto.onExiting = function onExiting(node) {
|
2747 | this.setState({
|
2748 | startAnimation: true
|
2749 | });
|
2750 | node.dispatchEvent(new CustomEvent('slide.bs.carousel'));
|
2751 | this.props.onExiting(node);
|
2752 | };
|
2753 |
|
2754 | _proto.onExited = function onExited(node) {
|
2755 | node.dispatchEvent(new CustomEvent('slid.bs.carousel'));
|
2756 | this.props.onExited(node);
|
2757 | };
|
2758 |
|
2759 | _proto.render = function render() {
|
2760 | var _this2 = this;
|
2761 |
|
2762 | var _this$props = this.props,
|
2763 | isIn = _this$props["in"],
|
2764 | children = _this$props.children,
|
2765 | cssModule = _this$props.cssModule,
|
2766 | slide = _this$props.slide,
|
2767 | Tag = _this$props.tag,
|
2768 | className = _this$props.className,
|
2769 | transitionProps = _objectWithoutPropertiesLoose(_this$props, _excluded$E);
|
2770 |
|
2771 | return React__default["default"].createElement(reactTransitionGroup.Transition, _extends({}, transitionProps, {
|
2772 | enter: slide,
|
2773 | exit: slide,
|
2774 | "in": isIn,
|
2775 | onEnter: this.onEnter,
|
2776 | onEntering: this.onEntering,
|
2777 | onExit: this.onExit,
|
2778 | onExiting: this.onExiting,
|
2779 | onExited: this.onExited
|
2780 | }), function (status) {
|
2781 | var direction = _this2.context.direction;
|
2782 | var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING;
|
2783 | var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'end' ? 'carousel-item-start' : 'carousel-item-end');
|
2784 | var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'end' ? 'carousel-item-next' : 'carousel-item-prev');
|
2785 | var itemClasses = mapToCssModules(classNames__default["default"](className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule);
|
2786 | return React__default["default"].createElement(Tag, {
|
2787 | className: itemClasses
|
2788 | }, children);
|
2789 | });
|
2790 | };
|
2791 |
|
2792 | return CarouselItem;
|
2793 | }(React__default["default"].Component);
|
2794 |
|
2795 | CarouselItem.propTypes = _objectSpread2(_objectSpread2({}, reactTransitionGroup.Transition.propTypes), {}, {
|
2796 | tag: tagPropType,
|
2797 | "in": PropTypes__default["default"].bool,
|
2798 | cssModule: PropTypes__default["default"].object,
|
2799 | children: PropTypes__default["default"].node,
|
2800 | slide: PropTypes__default["default"].bool,
|
2801 | className: PropTypes__default["default"].string
|
2802 | });
|
2803 | CarouselItem.defaultProps = _objectSpread2(_objectSpread2({}, reactTransitionGroup.Transition.defaultProps), {}, {
|
2804 | tag: 'div',
|
2805 | timeout: TransitionTimeouts.Carousel,
|
2806 | slide: true
|
2807 | });
|
2808 | CarouselItem.contextTypes = {
|
2809 | direction: PropTypes__default["default"].string
|
2810 | };
|
2811 | var CarouselItem$1 = CarouselItem;
|
2812 |
|
2813 | |
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 |
|
2820 | var CarouselContext = React__default["default"].createContext({});
|
2821 |
|
2822 | var SWIPE_THRESHOLD = 40;
|
2823 |
|
2824 | var Carousel = function (_React$Component) {
|
2825 | _inheritsLoose(Carousel, _React$Component);
|
2826 |
|
2827 | function Carousel(props) {
|
2828 | var _this;
|
2829 |
|
2830 | _this = _React$Component.call(this, props) || this;
|
2831 | _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_this));
|
2832 | _this.renderItems = _this.renderItems.bind(_assertThisInitialized(_this));
|
2833 | _this.hoverStart = _this.hoverStart.bind(_assertThisInitialized(_this));
|
2834 | _this.hoverEnd = _this.hoverEnd.bind(_assertThisInitialized(_this));
|
2835 | _this.handleTouchStart = _this.handleTouchStart.bind(_assertThisInitialized(_this));
|
2836 | _this.handleTouchEnd = _this.handleTouchEnd.bind(_assertThisInitialized(_this));
|
2837 | _this.touchStartX = 0;
|
2838 | _this.touchStartY = 0;
|
2839 | _this.state = {
|
2840 | activeIndex: _this.props.activeIndex,
|
2841 | direction: 'end',
|
2842 | indicatorClicked: false
|
2843 | };
|
2844 | return _this;
|
2845 | }
|
2846 |
|
2847 | var _proto = Carousel.prototype;
|
2848 |
|
2849 | _proto.getContextValue = function getContextValue() {
|
2850 | return {
|
2851 | direction: this.state.direction
|
2852 | };
|
2853 | };
|
2854 |
|
2855 | _proto.componentDidMount = function componentDidMount() {
|
2856 |
|
2857 | if (this.props.ride === 'carousel') {
|
2858 | this.setInterval();
|
2859 | }
|
2860 |
|
2861 |
|
2862 | document.addEventListener('keyup', this.handleKeyPress);
|
2863 | };
|
2864 |
|
2865 | Carousel.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
|
2866 | var newState = null;
|
2867 | var activeIndex = prevState.activeIndex,
|
2868 | direction = prevState.direction,
|
2869 | indicatorClicked = prevState.indicatorClicked;
|
2870 |
|
2871 | if (nextProps.activeIndex !== activeIndex) {
|
2872 |
|
2873 | if (nextProps.activeIndex === activeIndex + 1) {
|
2874 | direction = 'end';
|
2875 | } else if (nextProps.activeIndex === activeIndex - 1) {
|
2876 | direction = 'start';
|
2877 | } else if (nextProps.activeIndex < activeIndex) {
|
2878 | direction = indicatorClicked ? 'start' : 'end';
|
2879 | } else if (nextProps.activeIndex !== activeIndex) {
|
2880 | direction = indicatorClicked ? 'end' : 'start';
|
2881 | }
|
2882 |
|
2883 | newState = {
|
2884 | activeIndex: nextProps.activeIndex,
|
2885 | direction: direction,
|
2886 | indicatorClicked: false
|
2887 | };
|
2888 | }
|
2889 |
|
2890 | return newState;
|
2891 | };
|
2892 |
|
2893 | _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
2894 | if (prevState.activeIndex === this.state.activeIndex) return;
|
2895 | this.setInterval(this.props);
|
2896 | };
|
2897 |
|
2898 | _proto.componentWillUnmount = function componentWillUnmount() {
|
2899 | this.clearInterval();
|
2900 | document.removeEventListener('keyup', this.handleKeyPress);
|
2901 | };
|
2902 |
|
2903 | _proto.setInterval = function (_setInterval) {
|
2904 | function setInterval() {
|
2905 | return _setInterval.apply(this, arguments);
|
2906 | }
|
2907 |
|
2908 | setInterval.toString = function () {
|
2909 | return _setInterval.toString();
|
2910 | };
|
2911 |
|
2912 | return setInterval;
|
2913 | }(function (props) {
|
2914 | if (props === void 0) {
|
2915 | props = this.props;
|
2916 | }
|
2917 |
|
2918 |
|
2919 | this.clearInterval();
|
2920 |
|
2921 | if (props.interval) {
|
2922 | this.cycleInterval = setInterval(function () {
|
2923 | props.next();
|
2924 | }, parseInt(props.interval, 10));
|
2925 | }
|
2926 | });
|
2927 |
|
2928 | _proto.clearInterval = function (_clearInterval) {
|
2929 | function clearInterval() {
|
2930 | return _clearInterval.apply(this, arguments);
|
2931 | }
|
2932 |
|
2933 | clearInterval.toString = function () {
|
2934 | return _clearInterval.toString();
|
2935 | };
|
2936 |
|
2937 | return clearInterval;
|
2938 | }(function () {
|
2939 | clearInterval(this.cycleInterval);
|
2940 | });
|
2941 |
|
2942 | _proto.hoverStart = function hoverStart() {
|
2943 | if (this.props.pause === 'hover') {
|
2944 | this.clearInterval();
|
2945 | }
|
2946 |
|
2947 | if (this.props.mouseEnter) {
|
2948 | var _this$props;
|
2949 |
|
2950 | (_this$props = this.props).mouseEnter.apply(_this$props, [].slice.call(arguments));
|
2951 | }
|
2952 | };
|
2953 |
|
2954 | _proto.hoverEnd = function hoverEnd() {
|
2955 | if (this.props.pause === 'hover') {
|
2956 | this.setInterval();
|
2957 | }
|
2958 |
|
2959 | if (this.props.mouseLeave) {
|
2960 | var _this$props2;
|
2961 |
|
2962 | (_this$props2 = this.props).mouseLeave.apply(_this$props2, [].slice.call(arguments));
|
2963 | }
|
2964 | };
|
2965 |
|
2966 | _proto.handleKeyPress = function handleKeyPress(evt) {
|
2967 | if (this.props.keyboard) {
|
2968 | if (evt.keyCode === 37) {
|
2969 | this.props.previous();
|
2970 | } else if (evt.keyCode === 39) {
|
2971 | this.props.next();
|
2972 | }
|
2973 | }
|
2974 | };
|
2975 |
|
2976 | _proto.handleTouchStart = function handleTouchStart(e) {
|
2977 | if (!this.props.enableTouch) {
|
2978 | return;
|
2979 | }
|
2980 |
|
2981 | this.touchStartX = e.changedTouches[0].screenX;
|
2982 | this.touchStartY = e.changedTouches[0].screenY;
|
2983 | };
|
2984 |
|
2985 | _proto.handleTouchEnd = function handleTouchEnd(e) {
|
2986 | if (!this.props.enableTouch) {
|
2987 | return;
|
2988 | }
|
2989 |
|
2990 | var currentX = e.changedTouches[0].screenX;
|
2991 | var currentY = e.changedTouches[0].screenY;
|
2992 | var diffX = Math.abs(this.touchStartX - currentX);
|
2993 | var diffY = Math.abs(this.touchStartY - currentY);
|
2994 |
|
2995 | if (diffX < diffY) {
|
2996 | return;
|
2997 | }
|
2998 |
|
2999 | if (diffX < SWIPE_THRESHOLD) {
|
3000 | return;
|
3001 | }
|
3002 |
|
3003 | if (currentX < this.touchStartX) {
|
3004 | this.props.next();
|
3005 | } else {
|
3006 | this.props.previous();
|
3007 | }
|
3008 | };
|
3009 |
|
3010 | _proto.renderItems = function renderItems(carouselItems, className) {
|
3011 | var _this2 = this;
|
3012 |
|
3013 | var slide = this.props.slide;
|
3014 | return React__default["default"].createElement("div", {
|
3015 | className: className
|
3016 | }, carouselItems.map(function (item, index) {
|
3017 | var isIn = index === _this2.state.activeIndex;
|
3018 | return React__default["default"].cloneElement(item, {
|
3019 | "in": isIn,
|
3020 | slide: slide
|
3021 | });
|
3022 | }));
|
3023 | };
|
3024 |
|
3025 | _proto.render = function render() {
|
3026 | var _this3 = this;
|
3027 |
|
3028 | var _this$props3 = this.props,
|
3029 | cssModule = _this$props3.cssModule,
|
3030 | slide = _this$props3.slide,
|
3031 | className = _this$props3.className,
|
3032 | dark = _this$props3.dark,
|
3033 | fade = _this$props3.fade;
|
3034 | var outerClasses = mapToCssModules(classNames__default["default"](className, 'carousel', fade, slide && 'slide', dark && 'carousel-dark'), cssModule);
|
3035 | var innerClasses = mapToCssModules(classNames__default["default"]('carousel-inner'), cssModule);
|
3036 |
|
3037 | var children = this.props.children.filter(function (child) {
|
3038 | return child !== null && child !== undefined && typeof child !== 'boolean';
|
3039 | });
|
3040 | var slidesOnly = children.every(function (child) {
|
3041 | return child.type === CarouselItem$1;
|
3042 | });
|
3043 |
|
3044 | if (slidesOnly) {
|
3045 | return React__default["default"].createElement("div", {
|
3046 | className: outerClasses,
|
3047 | onMouseEnter: this.hoverStart,
|
3048 | onMouseLeave: this.hoverEnd
|
3049 | }, React__default["default"].createElement(CarouselContext.Provider, {
|
3050 | value: this.getContextValue()
|
3051 | }, this.renderItems(children, innerClasses)));
|
3052 | }
|
3053 |
|
3054 |
|
3055 | if (children[0] instanceof Array) {
|
3056 | var _carouselItems = children[0];
|
3057 | var _controlLeft = children[1];
|
3058 | var _controlRight = children[2];
|
3059 | return React__default["default"].createElement("div", {
|
3060 | className: outerClasses,
|
3061 | onMouseEnter: this.hoverStart,
|
3062 | onMouseLeave: this.hoverEnd
|
3063 | }, React__default["default"].createElement(CarouselContext.Provider, {
|
3064 | value: this.getContextValue()
|
3065 | }, this.renderItems(_carouselItems, innerClasses), _controlLeft, _controlRight));
|
3066 | }
|
3067 |
|
3068 |
|
3069 | var indicators = children[0];
|
3070 |
|
3071 | var wrappedOnClick = function wrappedOnClick(e) {
|
3072 | if (typeof indicators.props.onClickHandler === 'function') {
|
3073 | _this3.setState({
|
3074 | indicatorClicked: true
|
3075 | }, function () {
|
3076 | return indicators.props.onClickHandler(e);
|
3077 | });
|
3078 | }
|
3079 | };
|
3080 |
|
3081 | var wrappedIndicators = React__default["default"].cloneElement(indicators, {
|
3082 | onClickHandler: wrappedOnClick
|
3083 | });
|
3084 | var carouselItems = children[1];
|
3085 | var controlLeft = children[2];
|
3086 | var controlRight = children[3];
|
3087 | return React__default["default"].createElement("div", {
|
3088 | className: outerClasses,
|
3089 | onMouseEnter: this.hoverStart,
|
3090 | onMouseLeave: this.hoverEnd,
|
3091 | onTouchStart: this.handleTouchStart,
|
3092 | onTouchEnd: this.handleTouchEnd
|
3093 | }, React__default["default"].createElement(CarouselContext.Provider, {
|
3094 | value: this.getContextValue()
|
3095 | }, wrappedIndicators, this.renderItems(carouselItems, innerClasses), controlLeft, controlRight));
|
3096 | };
|
3097 |
|
3098 | return Carousel;
|
3099 | }(React__default["default"].Component);
|
3100 |
|
3101 | Carousel.propTypes = {
|
3102 |
|
3103 | activeIndex: PropTypes__default["default"].number,
|
3104 |
|
3105 | next: PropTypes__default["default"].func.isRequired,
|
3106 |
|
3107 | previous: PropTypes__default["default"].func.isRequired,
|
3108 |
|
3109 | keyboard: PropTypes__default["default"].bool,
|
3110 |
|
3111 | |
3112 |
|
3113 |
|
3114 | pause: PropTypes__default["default"].oneOf(['hover', false]),
|
3115 |
|
3116 |
|
3117 | ride: PropTypes__default["default"].oneOf(['carousel']),
|
3118 |
|
3119 |
|
3120 | interval: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string, PropTypes__default["default"].bool]),
|
3121 | children: PropTypes__default["default"].array,
|
3122 |
|
3123 | mouseEnter: PropTypes__default["default"].func,
|
3124 |
|
3125 | mouseLeave: PropTypes__default["default"].func,
|
3126 |
|
3127 | slide: PropTypes__default["default"].bool,
|
3128 |
|
3129 | dark: PropTypes__default["default"].bool,
|
3130 | cssModule: PropTypes__default["default"].object,
|
3131 | className: PropTypes__default["default"].string,
|
3132 | enableTouch: PropTypes__default["default"].bool
|
3133 | };
|
3134 | Carousel.defaultProps = {
|
3135 | interval: 5000,
|
3136 | pause: 'hover',
|
3137 | keyboard: true,
|
3138 | slide: true,
|
3139 | enableTouch: true,
|
3140 | fade: false
|
3141 | };
|
3142 | Carousel.childContextTypes = {
|
3143 | direction: PropTypes__default["default"].string
|
3144 | };
|
3145 | var Carousel$1 = Carousel;
|
3146 |
|
3147 | var CarouselControl = function CarouselControl(props) {
|
3148 | var direction = props.direction,
|
3149 | onClickHandler = props.onClickHandler,
|
3150 | cssModule = props.cssModule,
|
3151 | directionText = props.directionText,
|
3152 | className = props.className;
|
3153 | var anchorClasses = mapToCssModules(classNames__default["default"](className, "carousel-control-" + direction), cssModule);
|
3154 | var iconClasses = mapToCssModules(classNames__default["default"]("carousel-control-" + direction + "-icon"), cssModule);
|
3155 | var screenReaderClasses = mapToCssModules(classNames__default["default"]('visually-hidden'), cssModule);
|
3156 | return (
|
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 | React__default["default"].createElement("a", {
|
3163 | className: anchorClasses,
|
3164 | style: {
|
3165 | cursor: "pointer"
|
3166 | },
|
3167 | role: "button",
|
3168 | tabIndex: "0",
|
3169 | onClick: function onClick(e) {
|
3170 | e.preventDefault();
|
3171 | onClickHandler();
|
3172 | }
|
3173 | }, React__default["default"].createElement("span", {
|
3174 | className: iconClasses,
|
3175 | "aria-hidden": "true"
|
3176 | }), React__default["default"].createElement("span", {
|
3177 | className: screenReaderClasses
|
3178 | }, directionText || direction))
|
3179 | );
|
3180 | };
|
3181 |
|
3182 | CarouselControl.propTypes = {
|
3183 | direction: PropTypes__default["default"].oneOf(['prev', 'next']).isRequired,
|
3184 | onClickHandler: PropTypes__default["default"].func.isRequired,
|
3185 | cssModule: PropTypes__default["default"].object,
|
3186 | directionText: PropTypes__default["default"].string,
|
3187 | className: PropTypes__default["default"].string
|
3188 | };
|
3189 | var CarouselControl$1 = CarouselControl;
|
3190 |
|
3191 | var CarouselIndicators = function CarouselIndicators(props) {
|
3192 | var items = props.items,
|
3193 | activeIndex = props.activeIndex,
|
3194 | cssModule = props.cssModule,
|
3195 | onClickHandler = props.onClickHandler,
|
3196 | className = props.className;
|
3197 | var listClasses = mapToCssModules(classNames__default["default"](className, 'carousel-indicators'), cssModule);
|
3198 | var indicators = items.map(function (item, idx) {
|
3199 | var indicatorClasses = mapToCssModules(classNames__default["default"]({
|
3200 | active: activeIndex === idx
|
3201 | }), cssModule);
|
3202 | return React__default["default"].createElement("button", {
|
3203 | "aria-label": item.caption,
|
3204 | "data-bs-target": true,
|
3205 | key: "" + (item.key || Object.values(item).join('')),
|
3206 | onClick: function onClick(e) {
|
3207 | e.preventDefault();
|
3208 | onClickHandler(idx);
|
3209 | },
|
3210 | className: indicatorClasses
|
3211 | });
|
3212 | });
|
3213 | return React__default["default"].createElement("div", {
|
3214 | className: listClasses
|
3215 | }, indicators);
|
3216 | };
|
3217 |
|
3218 | CarouselIndicators.propTypes = {
|
3219 | items: PropTypes__default["default"].array.isRequired,
|
3220 | activeIndex: PropTypes__default["default"].number.isRequired,
|
3221 | cssModule: PropTypes__default["default"].object,
|
3222 | onClickHandler: PropTypes__default["default"].func.isRequired,
|
3223 | className: PropTypes__default["default"].string
|
3224 | };
|
3225 | var CarouselIndicators$1 = CarouselIndicators;
|
3226 |
|
3227 | var CarouselCaption = function CarouselCaption(props) {
|
3228 | var captionHeader = props.captionHeader,
|
3229 | captionText = props.captionText,
|
3230 | cssModule = props.cssModule,
|
3231 | className = props.className;
|
3232 | var classes = mapToCssModules(classNames__default["default"](className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule);
|
3233 | return React__default["default"].createElement("div", {
|
3234 | className: classes
|
3235 | }, React__default["default"].createElement("h3", null, captionHeader), React__default["default"].createElement("p", null, captionText));
|
3236 | };
|
3237 |
|
3238 | CarouselCaption.propTypes = {
|
3239 | captionHeader: PropTypes__default["default"].node,
|
3240 | captionText: PropTypes__default["default"].node.isRequired,
|
3241 | cssModule: PropTypes__default["default"].object,
|
3242 | className: PropTypes__default["default"].string
|
3243 | };
|
3244 | var CarouselCaption$1 = CarouselCaption;
|
3245 |
|
3246 | var _excluded$D = ["defaultActiveIndex", "autoPlay", "indicators", "controls", "items", "goToIndex"];
|
3247 | var propTypes$J = {
|
3248 | items: PropTypes__default["default"].array.isRequired,
|
3249 | indicators: PropTypes__default["default"].bool,
|
3250 | controls: PropTypes__default["default"].bool,
|
3251 | autoPlay: PropTypes__default["default"].bool,
|
3252 | defaultActiveIndex: PropTypes__default["default"].number,
|
3253 | activeIndex: PropTypes__default["default"].number,
|
3254 | next: PropTypes__default["default"].func,
|
3255 | previous: PropTypes__default["default"].func,
|
3256 | goToIndex: PropTypes__default["default"].func
|
3257 | };
|
3258 |
|
3259 | var UncontrolledCarousel = function (_Component) {
|
3260 | _inheritsLoose(UncontrolledCarousel, _Component);
|
3261 |
|
3262 | function UncontrolledCarousel(props) {
|
3263 | var _this;
|
3264 |
|
3265 | _this = _Component.call(this, props) || this;
|
3266 | _this.animating = false;
|
3267 | _this.state = {
|
3268 | activeIndex: props.defaultActiveIndex || 0
|
3269 | };
|
3270 | _this.next = _this.next.bind(_assertThisInitialized(_this));
|
3271 | _this.previous = _this.previous.bind(_assertThisInitialized(_this));
|
3272 | _this.goToIndex = _this.goToIndex.bind(_assertThisInitialized(_this));
|
3273 | _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
|
3274 | _this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
|
3275 | return _this;
|
3276 | }
|
3277 |
|
3278 | var _proto = UncontrolledCarousel.prototype;
|
3279 |
|
3280 | _proto.onExiting = function onExiting() {
|
3281 | this.animating = true;
|
3282 | };
|
3283 |
|
3284 | _proto.onExited = function onExited() {
|
3285 | this.animating = false;
|
3286 | };
|
3287 |
|
3288 | _proto.next = function next() {
|
3289 | if (this.animating) return;
|
3290 | var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1;
|
3291 | this.setState({
|
3292 | activeIndex: nextIndex
|
3293 | });
|
3294 | };
|
3295 |
|
3296 | _proto.previous = function previous() {
|
3297 | if (this.animating) return;
|
3298 | var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1;
|
3299 | this.setState({
|
3300 | activeIndex: nextIndex
|
3301 | });
|
3302 | };
|
3303 |
|
3304 | _proto.goToIndex = function goToIndex(newIndex) {
|
3305 | if (this.animating) return;
|
3306 | this.setState({
|
3307 | activeIndex: newIndex
|
3308 | });
|
3309 | };
|
3310 |
|
3311 | _proto.render = function render() {
|
3312 | var _this2 = this;
|
3313 |
|
3314 | var _this$props = this.props,
|
3315 | autoPlay = _this$props.autoPlay,
|
3316 | indicators = _this$props.indicators,
|
3317 | controls = _this$props.controls,
|
3318 | items = _this$props.items,
|
3319 | goToIndex = _this$props.goToIndex,
|
3320 | props = _objectWithoutPropertiesLoose(_this$props, _excluded$D);
|
3321 |
|
3322 | var activeIndex = this.state.activeIndex;
|
3323 | var slides = items.map(function (item) {
|
3324 | var key = item.key || item.src;
|
3325 | return React__default["default"].createElement(CarouselItem$1, {
|
3326 | onExiting: _this2.onExiting,
|
3327 | onExited: _this2.onExited,
|
3328 | key: key
|
3329 | }, React__default["default"].createElement("img", {
|
3330 | className: "d-block w-100",
|
3331 | src: item.src,
|
3332 | alt: item.altText
|
3333 | }), React__default["default"].createElement(CarouselCaption$1, {
|
3334 | captionText: item.caption,
|
3335 | captionHeader: item.header || item.caption
|
3336 | }));
|
3337 | });
|
3338 | return React__default["default"].createElement(Carousel$1, _extends({
|
3339 | activeIndex: activeIndex,
|
3340 | next: this.next,
|
3341 | previous: this.previous,
|
3342 | ride: autoPlay ? 'carousel' : undefined
|
3343 | }, props), indicators && React__default["default"].createElement(CarouselIndicators$1, {
|
3344 | items: items,
|
3345 | activeIndex: props.activeIndex || activeIndex,
|
3346 | onClickHandler: goToIndex || this.goToIndex
|
3347 | }), slides, controls && React__default["default"].createElement(CarouselControl$1, {
|
3348 | direction: "prev",
|
3349 | directionText: "Previous",
|
3350 | onClickHandler: props.previous || this.previous
|
3351 | }), controls && React__default["default"].createElement(CarouselControl$1, {
|
3352 | direction: "next",
|
3353 | directionText: "Next",
|
3354 | onClickHandler: props.next || this.next
|
3355 | }));
|
3356 | };
|
3357 |
|
3358 | return UncontrolledCarousel;
|
3359 | }(React.Component);
|
3360 |
|
3361 | UncontrolledCarousel.propTypes = propTypes$J;
|
3362 | UncontrolledCarousel.defaultProps = {
|
3363 | controls: true,
|
3364 | indicators: true,
|
3365 | autoPlay: true
|
3366 | };
|
3367 | var UncontrolledCarousel$1 = UncontrolledCarousel;
|
3368 |
|
3369 | var _excluded$C = ["className", "cssModule", "tag"];
|
3370 | var propTypes$I = {
|
3371 | tag: tagPropType,
|
3372 | className: PropTypes__default["default"].string,
|
3373 | cssModule: PropTypes__default["default"].object
|
3374 | };
|
3375 | var defaultProps$I = {
|
3376 | tag: 'div'
|
3377 | };
|
3378 |
|
3379 | var CardSubtitle = function CardSubtitle(props) {
|
3380 | var className = props.className,
|
3381 | cssModule = props.cssModule,
|
3382 | Tag = props.tag,
|
3383 | attributes = _objectWithoutPropertiesLoose(props, _excluded$C);
|
3384 |
|
3385 | var classes = mapToCssModules(classNames__default["default"](className, 'card-subtitle'), cssModule);
|
3386 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
3387 | className: classes
|
3388 | }));
|
3389 | };
|
3390 |
|
3391 | CardSubtitle.propTypes = propTypes$I;
|
3392 | CardSubtitle.defaultProps = defaultProps$I;
|
3393 | var CardSubtitle$1 = CardSubtitle;
|
3394 |
|
3395 | var _excluded$B = ["className", "cssModule", "tag"];
|
3396 | var propTypes$H = {
|
3397 | tag: tagPropType,
|
3398 | className: PropTypes__default["default"].string,
|
3399 | cssModule: PropTypes__default["default"].object
|
3400 | };
|
3401 | var defaultProps$H = {
|
3402 | tag: 'p'
|
3403 | };
|
3404 |
|
3405 | var CardText = function CardText(props) {
|
3406 | var className = props.className,
|
3407 | cssModule = props.cssModule,
|
3408 | Tag = props.tag,
|
3409 | attributes = _objectWithoutPropertiesLoose(props, _excluded$B);
|
3410 |
|
3411 | var classes = mapToCssModules(classNames__default["default"](className, 'card-text'), cssModule);
|
3412 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
3413 | className: classes
|
3414 | }));
|
3415 | };
|
3416 |
|
3417 | CardText.propTypes = propTypes$H;
|
3418 | CardText.defaultProps = defaultProps$H;
|
3419 | var CardText$1 = CardText;
|
3420 |
|
3421 | var _excluded$A = ["className", "cssModule", "tag"];
|
3422 | var propTypes$G = {
|
3423 | tag: tagPropType,
|
3424 | className: PropTypes__default["default"].string,
|
3425 | cssModule: PropTypes__default["default"].object
|
3426 | };
|
3427 | var defaultProps$G = {
|
3428 | tag: 'div'
|
3429 | };
|
3430 |
|
3431 | var CardTitle = function CardTitle(props) {
|
3432 | var className = props.className,
|
3433 | cssModule = props.cssModule,
|
3434 | Tag = props.tag,
|
3435 | attributes = _objectWithoutPropertiesLoose(props, _excluded$A);
|
3436 |
|
3437 | var classes = mapToCssModules(classNames__default["default"](className, 'card-title'), cssModule);
|
3438 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
3439 | className: classes
|
3440 | }));
|
3441 | };
|
3442 |
|
3443 | CardTitle.propTypes = propTypes$G;
|
3444 | CardTitle.defaultProps = defaultProps$G;
|
3445 | var CardTitle$1 = CardTitle;
|
3446 |
|
3447 | var _excluded$z = ["cssModule", "children", "isOpen", "flip", "target", "offset", "fallbackPlacements", "placementPrefix", "arrowClassName", "hideArrow", "popperClassName", "tag", "container", "modifiers", "strategy", "boundariesElement", "onClosed", "fade", "transition", "placement"];
|
3448 |
|
3449 | function noop$2() {}
|
3450 |
|
3451 | var propTypes$F = {
|
3452 | children: PropTypes__default["default"].oneOfType([PropTypes__default["default"].node, PropTypes__default["default"].func]).isRequired,
|
3453 | popperClassName: PropTypes__default["default"].string,
|
3454 | placement: PropTypes__default["default"].string,
|
3455 | placementPrefix: PropTypes__default["default"].string,
|
3456 | arrowClassName: PropTypes__default["default"].string,
|
3457 | hideArrow: PropTypes__default["default"].bool,
|
3458 | tag: tagPropType,
|
3459 | isOpen: PropTypes__default["default"].bool.isRequired,
|
3460 | cssModule: PropTypes__default["default"].object,
|
3461 | offset: PropTypes__default["default"].arrayOf(PropTypes__default["default"].number),
|
3462 | fallbackPlacements: PropTypes__default["default"].array,
|
3463 | flip: PropTypes__default["default"].bool,
|
3464 | container: targetPropType,
|
3465 | target: targetPropType.isRequired,
|
3466 | modifiers: PropTypes__default["default"].array,
|
3467 | strategy: PropTypes__default["default"].string,
|
3468 | boundariesElement: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, DOMElement]),
|
3469 | onClosed: PropTypes__default["default"].func,
|
3470 | fade: PropTypes__default["default"].bool,
|
3471 | transition: PropTypes__default["default"].shape(Fade.propTypes)
|
3472 | };
|
3473 | var defaultProps$F = {
|
3474 | boundariesElement: 'scrollParent',
|
3475 | placement: 'auto',
|
3476 | hideArrow: false,
|
3477 | isOpen: false,
|
3478 | offset: [0, 0],
|
3479 | flip: true,
|
3480 | container: 'body',
|
3481 | modifiers: [],
|
3482 | onClosed: noop$2,
|
3483 | fade: true,
|
3484 | transition: _objectSpread2({}, Fade.defaultProps)
|
3485 | };
|
3486 |
|
3487 | var PopperContent = function (_React$Component) {
|
3488 | _inheritsLoose(PopperContent, _React$Component);
|
3489 |
|
3490 | function PopperContent(props) {
|
3491 | var _this;
|
3492 |
|
3493 | _this = _React$Component.call(this, props) || this;
|
3494 | _this.setTargetNode = _this.setTargetNode.bind(_assertThisInitialized(_this));
|
3495 | _this.getTargetNode = _this.getTargetNode.bind(_assertThisInitialized(_this));
|
3496 | _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
3497 | _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
|
3498 | _this.state = {
|
3499 | isOpen: props.isOpen
|
3500 | };
|
3501 | return _this;
|
3502 | }
|
3503 |
|
3504 | PopperContent.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
3505 | if (props.isOpen && !state.isOpen) {
|
3506 | return {
|
3507 | isOpen: props.isOpen
|
3508 | };
|
3509 | } else return null;
|
3510 | };
|
3511 |
|
3512 | var _proto = PopperContent.prototype;
|
3513 |
|
3514 | _proto.componentDidUpdate = function componentDidUpdate() {
|
3515 | if (this._element && this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) {
|
3516 | this._element.childNodes[0].focus();
|
3517 | }
|
3518 | };
|
3519 |
|
3520 | _proto.setTargetNode = function setTargetNode(node) {
|
3521 | this.targetNode = typeof node === 'string' ? getTarget(node) : node;
|
3522 | };
|
3523 |
|
3524 | _proto.getTargetNode = function getTargetNode() {
|
3525 | return this.targetNode;
|
3526 | };
|
3527 |
|
3528 | _proto.getContainerNode = function getContainerNode() {
|
3529 | return getTarget(this.props.container);
|
3530 | };
|
3531 |
|
3532 | _proto.getRef = function getRef(ref) {
|
3533 | this._element = ref;
|
3534 | };
|
3535 |
|
3536 | _proto.onClosed = function onClosed() {
|
3537 | this.props.onClosed();
|
3538 | this.setState({
|
3539 | isOpen: false
|
3540 | });
|
3541 | };
|
3542 |
|
3543 | _proto.renderChildren = function renderChildren() {
|
3544 | var _this$props = this.props,
|
3545 | cssModule = _this$props.cssModule,
|
3546 | children = _this$props.children,
|
3547 | isOpen = _this$props.isOpen,
|
3548 | flip = _this$props.flip,
|
3549 | offset = _this$props.offset,
|
3550 | fallbackPlacements = _this$props.fallbackPlacements,
|
3551 | placementPrefix = _this$props.placementPrefix,
|
3552 | _arrowClassName = _this$props.arrowClassName,
|
3553 | hideArrow = _this$props.hideArrow,
|
3554 | _popperClassName = _this$props.popperClassName,
|
3555 | tag = _this$props.tag,
|
3556 | modifiers = _this$props.modifiers,
|
3557 | strategy = _this$props.strategy,
|
3558 | boundariesElement = _this$props.boundariesElement,
|
3559 | fade = _this$props.fade,
|
3560 | transition = _this$props.transition,
|
3561 | placement = _this$props.placement,
|
3562 | attrs = _objectWithoutPropertiesLoose(_this$props, _excluded$z);
|
3563 |
|
3564 | var arrowClassName = mapToCssModules(classNames__default["default"]('arrow', _arrowClassName), cssModule);
|
3565 | var popperClassName = mapToCssModules(classNames__default["default"](_popperClassName, placementPrefix ? placementPrefix + "-auto" : ''), this.props.cssModule);
|
3566 | var modifierNames = modifiers.map(function (m) {
|
3567 | return m.name;
|
3568 | });
|
3569 | var baseModifiers = [{
|
3570 | name: 'offset',
|
3571 | options: {
|
3572 | offset: offset
|
3573 | }
|
3574 | }, {
|
3575 | name: 'flip',
|
3576 | enabled: flip,
|
3577 | options: {
|
3578 | fallbackPlacements: fallbackPlacements
|
3579 | }
|
3580 | }, {
|
3581 | name: 'preventOverflow',
|
3582 | options: {
|
3583 | boundary: boundariesElement
|
3584 | }
|
3585 | }].filter(function (m) {
|
3586 | return !modifierNames.includes(m.name);
|
3587 | });
|
3588 | var extendedModifiers = [].concat(baseModifiers, modifiers);
|
3589 |
|
3590 | var popperTransition = _objectSpread2(_objectSpread2(_objectSpread2({}, Fade.defaultProps), transition), {}, {
|
3591 | baseClass: fade ? transition.baseClass : '',
|
3592 | timeout: fade ? transition.timeout : 0
|
3593 | });
|
3594 |
|
3595 | return React__default["default"].createElement(Fade, _extends({}, popperTransition, attrs, {
|
3596 | "in": isOpen,
|
3597 | onExited: this.onClosed,
|
3598 | tag: tag
|
3599 | }), React__default["default"].createElement(reactPopper.Popper, {
|
3600 | referenceElement: this.targetNode,
|
3601 | modifiers: extendedModifiers,
|
3602 | placement: placement,
|
3603 | strategy: strategy
|
3604 | }, function (_ref) {
|
3605 | var ref = _ref.ref,
|
3606 | style = _ref.style,
|
3607 | popperPlacement = _ref.placement,
|
3608 | isReferenceHidden = _ref.isReferenceHidden,
|
3609 | arrowProps = _ref.arrowProps,
|
3610 | update = _ref.update;
|
3611 | return React__default["default"].createElement("div", {
|
3612 | ref: ref,
|
3613 | style: style,
|
3614 | className: popperClassName,
|
3615 | "data-popper-placement": popperPlacement,
|
3616 | "data-popper-reference-hidden": isReferenceHidden ? 'true' : undefined
|
3617 | }, typeof children === 'function' ? children({
|
3618 | update: update
|
3619 | }) : children, !hideArrow && React__default["default"].createElement("span", {
|
3620 | ref: arrowProps.ref,
|
3621 | className: arrowClassName,
|
3622 | style: arrowProps.style
|
3623 | }));
|
3624 | }));
|
3625 | };
|
3626 |
|
3627 | _proto.render = function render() {
|
3628 | this.setTargetNode(this.props.target);
|
3629 |
|
3630 | if (this.state.isOpen) {
|
3631 | return this.props.container === 'inline' ? this.renderChildren() : ReactDOM__default["default"].createPortal( React__default["default"].createElement("div", {
|
3632 | ref: this.getRef
|
3633 | }, this.renderChildren()), this.getContainerNode());
|
3634 | }
|
3635 |
|
3636 | return null;
|
3637 | };
|
3638 |
|
3639 | return PopperContent;
|
3640 | }(React__default["default"].Component);
|
3641 |
|
3642 | PopperContent.propTypes = propTypes$F;
|
3643 | PopperContent.defaultProps = defaultProps$F;
|
3644 | var PopperContent$1 = PopperContent;
|
3645 |
|
3646 | var PopperTargetHelper = function PopperTargetHelper(props, context) {
|
3647 | context.popperManager.setTargetNode(getTarget(props.target));
|
3648 | return null;
|
3649 | };
|
3650 |
|
3651 | PopperTargetHelper.contextTypes = {
|
3652 | popperManager: PropTypes__default["default"].object.isRequired
|
3653 | };
|
3654 | PopperTargetHelper.propTypes = {
|
3655 | target: targetPropType.isRequired
|
3656 | };
|
3657 | var PopperTargetHelper$1 = PopperTargetHelper;
|
3658 |
|
3659 | var propTypes$E = {
|
3660 | children: PropTypes__default["default"].oneOfType([PropTypes__default["default"].node, PropTypes__default["default"].func]),
|
3661 | placement: PropTypes__default["default"].oneOf(PopperPlacements),
|
3662 | target: targetPropType.isRequired,
|
3663 | container: targetPropType,
|
3664 | isOpen: PropTypes__default["default"].bool,
|
3665 | disabled: PropTypes__default["default"].bool,
|
3666 | hideArrow: PropTypes__default["default"].bool,
|
3667 | boundariesElement: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, DOMElement]),
|
3668 | className: PropTypes__default["default"].string,
|
3669 | innerClassName: PropTypes__default["default"].string,
|
3670 | arrowClassName: PropTypes__default["default"].string,
|
3671 | popperClassName: PropTypes__default["default"].string,
|
3672 | cssModule: PropTypes__default["default"].object,
|
3673 | toggle: PropTypes__default["default"].func,
|
3674 | autohide: PropTypes__default["default"].bool,
|
3675 | placementPrefix: PropTypes__default["default"].string,
|
3676 | delay: PropTypes__default["default"].oneOfType([PropTypes__default["default"].shape({
|
3677 | show: PropTypes__default["default"].number,
|
3678 | hide: PropTypes__default["default"].number
|
3679 | }), PropTypes__default["default"].number]),
|
3680 | modifiers: PropTypes__default["default"].array,
|
3681 | strategy: PropTypes__default["default"].string,
|
3682 | offset: PropTypes__default["default"].arrayOf(PropTypes__default["default"].number),
|
3683 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].string, PropTypes__default["default"].object]),
|
3684 | trigger: PropTypes__default["default"].string,
|
3685 | fade: PropTypes__default["default"].bool,
|
3686 | flip: PropTypes__default["default"].bool
|
3687 | };
|
3688 | var DEFAULT_DELAYS = {
|
3689 | show: 0,
|
3690 | hide: 50
|
3691 | };
|
3692 | var defaultProps$E = {
|
3693 | isOpen: false,
|
3694 | hideArrow: false,
|
3695 | autohide: false,
|
3696 | delay: DEFAULT_DELAYS,
|
3697 | toggle: function toggle() {},
|
3698 | trigger: 'click',
|
3699 | fade: true
|
3700 | };
|
3701 |
|
3702 | function isInDOMSubtree(element, subtreeRoot) {
|
3703 | return subtreeRoot && (element === subtreeRoot || subtreeRoot.contains(element));
|
3704 | }
|
3705 |
|
3706 | function isInDOMSubtrees(element, subtreeRoots) {
|
3707 | if (subtreeRoots === void 0) {
|
3708 | subtreeRoots = [];
|
3709 | }
|
3710 |
|
3711 | return subtreeRoots && subtreeRoots.length && subtreeRoots.filter(function (subTreeRoot) {
|
3712 | return isInDOMSubtree(element, subTreeRoot);
|
3713 | })[0];
|
3714 | }
|
3715 |
|
3716 | var TooltipPopoverWrapper = function (_React$Component) {
|
3717 | _inheritsLoose(TooltipPopoverWrapper, _React$Component);
|
3718 |
|
3719 | function TooltipPopoverWrapper(props) {
|
3720 | var _this;
|
3721 |
|
3722 | _this = _React$Component.call(this, props) || this;
|
3723 | _this._targets = [];
|
3724 | _this.currentTargetElement = null;
|
3725 | _this.addTargetEvents = _this.addTargetEvents.bind(_assertThisInitialized(_this));
|
3726 | _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));
|
3727 | _this.removeTargetEvents = _this.removeTargetEvents.bind(_assertThisInitialized(_this));
|
3728 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
3729 | _this.showWithDelay = _this.showWithDelay.bind(_assertThisInitialized(_this));
|
3730 | _this.hideWithDelay = _this.hideWithDelay.bind(_assertThisInitialized(_this));
|
3731 | _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_assertThisInitialized(_this));
|
3732 | _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_assertThisInitialized(_this));
|
3733 | _this.show = _this.show.bind(_assertThisInitialized(_this));
|
3734 | _this.hide = _this.hide.bind(_assertThisInitialized(_this));
|
3735 | _this.onEscKeyDown = _this.onEscKeyDown.bind(_assertThisInitialized(_this));
|
3736 | _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
3737 | _this.state = {
|
3738 | isOpen: props.isOpen
|
3739 | };
|
3740 | _this._isMounted = false;
|
3741 | return _this;
|
3742 | }
|
3743 |
|
3744 | var _proto = TooltipPopoverWrapper.prototype;
|
3745 |
|
3746 | _proto.componentDidMount = function componentDidMount() {
|
3747 | this._isMounted = true;
|
3748 | this.updateTarget();
|
3749 | };
|
3750 |
|
3751 | _proto.componentWillUnmount = function componentWillUnmount() {
|
3752 | this._isMounted = false;
|
3753 | this.removeTargetEvents();
|
3754 | this._targets = null;
|
3755 | this.clearShowTimeout();
|
3756 | this.clearHideTimeout();
|
3757 | };
|
3758 |
|
3759 | TooltipPopoverWrapper.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
3760 | if (props.isOpen && !state.isOpen) {
|
3761 | return {
|
3762 | isOpen: props.isOpen
|
3763 | };
|
3764 | } else return null;
|
3765 | };
|
3766 |
|
3767 | _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {
|
3768 | if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
|
3769 | if (this._hideTimeout) {
|
3770 | this.clearHideTimeout();
|
3771 | }
|
3772 |
|
3773 | if (this.state.isOpen && !this.props.isOpen) {
|
3774 | this.toggle();
|
3775 | }
|
3776 | }
|
3777 | };
|
3778 |
|
3779 | _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {
|
3780 | if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
|
3781 | if (this._showTimeout) {
|
3782 | this.clearShowTimeout();
|
3783 | }
|
3784 |
|
3785 | e.persist();
|
3786 | this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
|
3787 | }
|
3788 | };
|
3789 |
|
3790 | _proto.onEscKeyDown = function onEscKeyDown(e) {
|
3791 | if (e.key === 'Escape') {
|
3792 | this.hide(e);
|
3793 | }
|
3794 | };
|
3795 |
|
3796 | _proto.getRef = function getRef(ref) {
|
3797 | var innerRef = this.props.innerRef;
|
3798 |
|
3799 | if (innerRef) {
|
3800 | if (typeof innerRef === 'function') {
|
3801 | innerRef(ref);
|
3802 | } else if (typeof innerRef === 'object') {
|
3803 | innerRef.current = ref;
|
3804 | }
|
3805 | }
|
3806 |
|
3807 | this._popover = ref;
|
3808 | };
|
3809 |
|
3810 | _proto.getDelay = function getDelay(key) {
|
3811 | var delay = this.props.delay;
|
3812 |
|
3813 | if (typeof delay === 'object') {
|
3814 | return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];
|
3815 | }
|
3816 |
|
3817 | return delay;
|
3818 | };
|
3819 |
|
3820 | _proto.getCurrentTarget = function getCurrentTarget(target) {
|
3821 | if (!target) return null;
|
3822 |
|
3823 | var index = this._targets.indexOf(target);
|
3824 |
|
3825 | if (index >= 0) return this._targets[index];
|
3826 | return this.getCurrentTarget(target.parentElement);
|
3827 | };
|
3828 |
|
3829 | _proto.show = function show(e) {
|
3830 | if (!this.props.isOpen) {
|
3831 | this.clearShowTimeout();
|
3832 | this.currentTargetElement = e ? e.currentTarget || this.getCurrentTarget(e.target) : null;
|
3833 |
|
3834 | if (e && e.composedPath && typeof e.composedPath === 'function') {
|
3835 | var path = e.composedPath();
|
3836 | this.currentTargetElement = path && path[0] || this.currentTargetElement;
|
3837 | }
|
3838 |
|
3839 | this.toggle(e);
|
3840 | }
|
3841 | };
|
3842 |
|
3843 | _proto.showWithDelay = function showWithDelay(e) {
|
3844 | if (this._hideTimeout) {
|
3845 | this.clearHideTimeout();
|
3846 | }
|
3847 |
|
3848 | this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));
|
3849 | };
|
3850 |
|
3851 | _proto.hide = function hide(e) {
|
3852 | if (this.props.isOpen) {
|
3853 | this.clearHideTimeout();
|
3854 | this.currentTargetElement = null;
|
3855 | this.toggle(e);
|
3856 | }
|
3857 | };
|
3858 |
|
3859 | _proto.hideWithDelay = function hideWithDelay(e) {
|
3860 | if (this._showTimeout) {
|
3861 | this.clearShowTimeout();
|
3862 | }
|
3863 |
|
3864 | this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
|
3865 | };
|
3866 |
|
3867 | _proto.clearShowTimeout = function clearShowTimeout() {
|
3868 | clearTimeout(this._showTimeout);
|
3869 | this._showTimeout = undefined;
|
3870 | };
|
3871 |
|
3872 | _proto.clearHideTimeout = function clearHideTimeout() {
|
3873 | clearTimeout(this._hideTimeout);
|
3874 | this._hideTimeout = undefined;
|
3875 | };
|
3876 |
|
3877 | _proto.handleDocumentClick = function handleDocumentClick(e) {
|
3878 | var triggers = this.props.trigger.split(' ');
|
3879 |
|
3880 | if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtrees(e.target, this._targets))) {
|
3881 | if (this._hideTimeout) {
|
3882 | this.clearHideTimeout();
|
3883 | }
|
3884 |
|
3885 | if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {
|
3886 | this.hideWithDelay(e);
|
3887 | } else if (!this.props.isOpen) {
|
3888 | this.showWithDelay(e);
|
3889 | }
|
3890 | } else if (triggers.indexOf('click') > -1 && isInDOMSubtrees(e.target, this._targets)) {
|
3891 | if (this._hideTimeout) {
|
3892 | this.clearHideTimeout();
|
3893 | }
|
3894 |
|
3895 | if (!this.props.isOpen) {
|
3896 | this.showWithDelay(e);
|
3897 | } else {
|
3898 | this.hideWithDelay(e);
|
3899 | }
|
3900 | }
|
3901 | };
|
3902 |
|
3903 | _proto.addEventOnTargets = function addEventOnTargets(type, handler, isBubble) {
|
3904 | this._targets.forEach(function (target) {
|
3905 | target.addEventListener(type, handler, isBubble);
|
3906 | });
|
3907 | };
|
3908 |
|
3909 | _proto.removeEventOnTargets = function removeEventOnTargets(type, handler, isBubble) {
|
3910 | this._targets.forEach(function (target) {
|
3911 | target.removeEventListener(type, handler, isBubble);
|
3912 | });
|
3913 | };
|
3914 |
|
3915 | _proto.addTargetEvents = function addTargetEvents() {
|
3916 | if (this.props.trigger) {
|
3917 | var triggers = this.props.trigger.split(' ');
|
3918 |
|
3919 | if (triggers.indexOf('manual') === -1) {
|
3920 | if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {
|
3921 | document.addEventListener('click', this.handleDocumentClick, true);
|
3922 | }
|
3923 |
|
3924 | if (this._targets && this._targets.length) {
|
3925 | if (triggers.indexOf('hover') > -1) {
|
3926 | this.addEventOnTargets('mouseover', this.showWithDelay, true);
|
3927 | this.addEventOnTargets('mouseout', this.hideWithDelay, true);
|
3928 | }
|
3929 |
|
3930 | if (triggers.indexOf('focus') > -1) {
|
3931 | this.addEventOnTargets('focusin', this.show, true);
|
3932 | this.addEventOnTargets('focusout', this.hide, true);
|
3933 | }
|
3934 |
|
3935 | this.addEventOnTargets('keydown', this.onEscKeyDown, true);
|
3936 | }
|
3937 | }
|
3938 | }
|
3939 | };
|
3940 |
|
3941 | _proto.removeTargetEvents = function removeTargetEvents() {
|
3942 | if (this._targets) {
|
3943 | this.removeEventOnTargets('mouseover', this.showWithDelay, true);
|
3944 | this.removeEventOnTargets('mouseout', this.hideWithDelay, true);
|
3945 | this.removeEventOnTargets('keydown', this.onEscKeyDown, true);
|
3946 | this.removeEventOnTargets('focusin', this.show, true);
|
3947 | this.removeEventOnTargets('focusout', this.hide, true);
|
3948 | }
|
3949 |
|
3950 | document.removeEventListener('click', this.handleDocumentClick, true);
|
3951 | };
|
3952 |
|
3953 | _proto.updateTarget = function updateTarget() {
|
3954 | var newTarget = getTarget(this.props.target, true);
|
3955 |
|
3956 | if (newTarget !== this._targets) {
|
3957 | this.removeTargetEvents();
|
3958 | this._targets = newTarget ? Array.from(newTarget) : [];
|
3959 | this.currentTargetElement = this.currentTargetElement || this._targets[0];
|
3960 | this.addTargetEvents();
|
3961 | }
|
3962 | };
|
3963 |
|
3964 | _proto.toggle = function toggle(e) {
|
3965 | if (this.props.disabled || !this._isMounted) {
|
3966 | return e && e.preventDefault();
|
3967 | }
|
3968 |
|
3969 | return this.props.toggle(e);
|
3970 | };
|
3971 |
|
3972 | _proto.render = function render() {
|
3973 | var _this2 = this;
|
3974 |
|
3975 | if (this.props.isOpen) {
|
3976 | this.updateTarget();
|
3977 | }
|
3978 |
|
3979 | var target = this.currentTargetElement || this._targets[0];
|
3980 |
|
3981 | if (!target) {
|
3982 | return null;
|
3983 | }
|
3984 |
|
3985 | var _this$props = this.props,
|
3986 | className = _this$props.className,
|
3987 | cssModule = _this$props.cssModule,
|
3988 | innerClassName = _this$props.innerClassName,
|
3989 | isOpen = _this$props.isOpen,
|
3990 | hideArrow = _this$props.hideArrow,
|
3991 | boundariesElement = _this$props.boundariesElement,
|
3992 | placement = _this$props.placement,
|
3993 | placementPrefix = _this$props.placementPrefix,
|
3994 | arrowClassName = _this$props.arrowClassName,
|
3995 | popperClassName = _this$props.popperClassName,
|
3996 | container = _this$props.container,
|
3997 | modifiers = _this$props.modifiers,
|
3998 | strategy = _this$props.strategy,
|
3999 | offset = _this$props.offset,
|
4000 | fade = _this$props.fade,
|
4001 | flip = _this$props.flip,
|
4002 | children = _this$props.children;
|
4003 | var attributes = omit(this.props, Object.keys(propTypes$E));
|
4004 | var popperClasses = mapToCssModules(popperClassName, cssModule);
|
4005 | var classes = mapToCssModules(innerClassName, cssModule);
|
4006 | return React__default["default"].createElement(PopperContent$1, {
|
4007 | className: className,
|
4008 | target: target,
|
4009 | isOpen: isOpen,
|
4010 | hideArrow: hideArrow,
|
4011 | boundariesElement: boundariesElement,
|
4012 | placement: placement,
|
4013 | placementPrefix: placementPrefix,
|
4014 | arrowClassName: arrowClassName,
|
4015 | popperClassName: popperClasses,
|
4016 | container: container,
|
4017 | modifiers: modifiers,
|
4018 | strategy: strategy,
|
4019 | offset: offset,
|
4020 | cssModule: cssModule,
|
4021 | fade: fade,
|
4022 | flip: flip
|
4023 | }, function (_ref) {
|
4024 | var update = _ref.update;
|
4025 | return React__default["default"].createElement("div", _extends({}, attributes, {
|
4026 | ref: _this2.getRef,
|
4027 | className: classes,
|
4028 | role: "tooltip",
|
4029 | onMouseOver: _this2.onMouseOverTooltipContent,
|
4030 | onMouseLeave: _this2.onMouseLeaveTooltipContent,
|
4031 | onKeyDown: _this2.onEscKeyDown
|
4032 | }), typeof children === 'function' ? children({
|
4033 | update: update
|
4034 | }) : children);
|
4035 | });
|
4036 | };
|
4037 |
|
4038 | return TooltipPopoverWrapper;
|
4039 | }(React__default["default"].Component);
|
4040 |
|
4041 | TooltipPopoverWrapper.propTypes = propTypes$E;
|
4042 | TooltipPopoverWrapper.defaultProps = defaultProps$E;
|
4043 | var TooltipPopoverWrapper$1 = TooltipPopoverWrapper;
|
4044 |
|
4045 | var defaultProps$D = {
|
4046 | placement: 'right',
|
4047 | placementPrefix: 'bs-popover',
|
4048 | trigger: 'click',
|
4049 | offset: [0, 8]
|
4050 | };
|
4051 |
|
4052 | var Popover = function Popover(props) {
|
4053 | var popperClasses = classNames__default["default"]('popover', 'show', props.popperClassName);
|
4054 | var classes = classNames__default["default"]('popover-inner', props.innerClassName);
|
4055 | return React__default["default"].createElement(TooltipPopoverWrapper$1, _extends({}, props, {
|
4056 | arrowClassName: "popover-arrow",
|
4057 | popperClassName: popperClasses,
|
4058 | innerClassName: classes
|
4059 | }));
|
4060 | };
|
4061 |
|
4062 | Popover.propTypes = propTypes$E;
|
4063 | Popover.defaultProps = defaultProps$D;
|
4064 | var Popover$1 = Popover;
|
4065 |
|
4066 | var omitKeys$4 = ['defaultOpen'];
|
4067 |
|
4068 | var UncontrolledPopover = function (_Component) {
|
4069 | _inheritsLoose(UncontrolledPopover, _Component);
|
4070 |
|
4071 | function UncontrolledPopover(props) {
|
4072 | var _this;
|
4073 |
|
4074 | _this = _Component.call(this, props) || this;
|
4075 | _this.state = {
|
4076 | isOpen: props.defaultOpen || false
|
4077 | };
|
4078 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
4079 | return _this;
|
4080 | }
|
4081 |
|
4082 | var _proto = UncontrolledPopover.prototype;
|
4083 |
|
4084 | _proto.toggle = function toggle() {
|
4085 | this.setState({
|
4086 | isOpen: !this.state.isOpen
|
4087 | });
|
4088 | };
|
4089 |
|
4090 | _proto.render = function render() {
|
4091 | return React__default["default"].createElement(Popover$1, _extends({
|
4092 | isOpen: this.state.isOpen,
|
4093 | toggle: this.toggle
|
4094 | }, omit(this.props, omitKeys$4)));
|
4095 | };
|
4096 |
|
4097 | return UncontrolledPopover;
|
4098 | }(React.Component);
|
4099 | UncontrolledPopover.propTypes = _objectSpread2({
|
4100 | defaultOpen: PropTypes__default["default"].bool
|
4101 | }, Popover$1.propTypes);
|
4102 |
|
4103 | var _excluded$y = ["className", "cssModule", "tag"];
|
4104 | var propTypes$D = {
|
4105 | tag: tagPropType,
|
4106 | className: PropTypes__default["default"].string,
|
4107 | cssModule: PropTypes__default["default"].object
|
4108 | };
|
4109 | var defaultProps$C = {
|
4110 | tag: 'h3'
|
4111 | };
|
4112 |
|
4113 | var PopoverHeader = function PopoverHeader(props) {
|
4114 | var className = props.className,
|
4115 | cssModule = props.cssModule,
|
4116 | Tag = props.tag,
|
4117 | attributes = _objectWithoutPropertiesLoose(props, _excluded$y);
|
4118 |
|
4119 | var classes = mapToCssModules(classNames__default["default"](className, 'popover-header'), cssModule);
|
4120 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
4121 | className: classes
|
4122 | }));
|
4123 | };
|
4124 |
|
4125 | PopoverHeader.propTypes = propTypes$D;
|
4126 | PopoverHeader.defaultProps = defaultProps$C;
|
4127 | var PopoverHeader$1 = PopoverHeader;
|
4128 |
|
4129 | var _excluded$x = ["className", "cssModule", "tag"];
|
4130 | var propTypes$C = {
|
4131 | tag: tagPropType,
|
4132 | className: PropTypes__default["default"].string,
|
4133 | cssModule: PropTypes__default["default"].object
|
4134 | };
|
4135 | var defaultProps$B = {
|
4136 | tag: 'div'
|
4137 | };
|
4138 |
|
4139 | var PopoverBody = function PopoverBody(props) {
|
4140 | var className = props.className,
|
4141 | cssModule = props.cssModule,
|
4142 | Tag = props.tag,
|
4143 | attributes = _objectWithoutPropertiesLoose(props, _excluded$x);
|
4144 |
|
4145 | var classes = mapToCssModules(classNames__default["default"](className, 'popover-body'), cssModule);
|
4146 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
4147 | className: classes
|
4148 | }));
|
4149 | };
|
4150 |
|
4151 | PopoverBody.propTypes = propTypes$C;
|
4152 | PopoverBody.defaultProps = defaultProps$B;
|
4153 | var PopoverBody$1 = PopoverBody;
|
4154 |
|
4155 | var _excluded$w = ["children", "className", "barClassName", "cssModule", "value", "min", "max", "animated", "striped", "color", "bar", "multi", "tag", "style", "barStyle", "barAriaValueText", "barAriaLabelledBy"];
|
4156 | var propTypes$B = {
|
4157 | children: PropTypes__default["default"].node,
|
4158 | bar: PropTypes__default["default"].bool,
|
4159 | multi: PropTypes__default["default"].bool,
|
4160 | tag: tagPropType,
|
4161 | value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
4162 | min: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
4163 | max: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
4164 | animated: PropTypes__default["default"].bool,
|
4165 | striped: PropTypes__default["default"].bool,
|
4166 | color: PropTypes__default["default"].string,
|
4167 | className: PropTypes__default["default"].string,
|
4168 | barClassName: PropTypes__default["default"].string,
|
4169 | cssModule: PropTypes__default["default"].object,
|
4170 | style: PropTypes__default["default"].object,
|
4171 | barStyle: PropTypes__default["default"].object,
|
4172 | barAriaValueText: PropTypes__default["default"].string,
|
4173 | barAriaLabelledBy: PropTypes__default["default"].string
|
4174 | };
|
4175 | var defaultProps$A = {
|
4176 | tag: 'div',
|
4177 | value: 0,
|
4178 | min: 0,
|
4179 | max: 100,
|
4180 | style: {},
|
4181 | barStyle: {}
|
4182 | };
|
4183 |
|
4184 | var Progress = function Progress(props) {
|
4185 | var children = props.children,
|
4186 | className = props.className,
|
4187 | barClassName = props.barClassName,
|
4188 | cssModule = props.cssModule,
|
4189 | value = props.value,
|
4190 | min = props.min,
|
4191 | max = props.max,
|
4192 | animated = props.animated,
|
4193 | striped = props.striped,
|
4194 | color = props.color,
|
4195 | bar = props.bar,
|
4196 | multi = props.multi,
|
4197 | Tag = props.tag,
|
4198 | style = props.style,
|
4199 | barStyle = props.barStyle,
|
4200 | barAriaValueText = props.barAriaValueText,
|
4201 | barAriaLabelledBy = props.barAriaLabelledBy,
|
4202 | attributes = _objectWithoutPropertiesLoose(props, _excluded$w);
|
4203 |
|
4204 | var percent = toNumber(value) / toNumber(max) * 100;
|
4205 | var progressClasses = mapToCssModules(classNames__default["default"](className, 'progress'), cssModule);
|
4206 | var progressBarClasses = mapToCssModules(classNames__default["default"]('progress-bar', bar ? className || barClassName : barClassName, animated ? 'progress-bar-animated' : null, color ? "bg-" + color : null, striped || animated ? 'progress-bar-striped' : null), cssModule);
|
4207 | var progressBarProps = {
|
4208 | className: progressBarClasses,
|
4209 | style: _objectSpread2(_objectSpread2(_objectSpread2({}, bar ? style : {}), barStyle), {}, {
|
4210 | width: percent + "%"
|
4211 | }),
|
4212 | role: 'progressbar',
|
4213 | 'aria-valuenow': value,
|
4214 | 'aria-valuemin': min,
|
4215 | 'aria-valuemax': max,
|
4216 | 'aria-valuetext': barAriaValueText,
|
4217 | 'aria-labelledby': barAriaLabelledBy,
|
4218 | children: children
|
4219 | };
|
4220 |
|
4221 | if (bar) {
|
4222 | return React__default["default"].createElement(Tag, _extends({}, attributes, progressBarProps));
|
4223 | }
|
4224 |
|
4225 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
4226 | style: style,
|
4227 | className: progressClasses
|
4228 | }), multi ? children : React__default["default"].createElement("div", progressBarProps));
|
4229 | };
|
4230 |
|
4231 | Progress.propTypes = propTypes$B;
|
4232 | Progress.defaultProps = defaultProps$A;
|
4233 | var Progress$1 = Progress;
|
4234 |
|
4235 | var propTypes$A = {
|
4236 | children: PropTypes__default["default"].node.isRequired,
|
4237 | node: PropTypes__default["default"].any
|
4238 | };
|
4239 |
|
4240 | var Portal = function (_React$Component) {
|
4241 | _inheritsLoose(Portal, _React$Component);
|
4242 |
|
4243 | function Portal() {
|
4244 | return _React$Component.apply(this, arguments) || this;
|
4245 | }
|
4246 |
|
4247 | var _proto = Portal.prototype;
|
4248 |
|
4249 | _proto.componentWillUnmount = function componentWillUnmount() {
|
4250 | if (this.defaultNode) {
|
4251 | document.body.removeChild(this.defaultNode);
|
4252 | }
|
4253 |
|
4254 | this.defaultNode = null;
|
4255 | };
|
4256 |
|
4257 | _proto.render = function render() {
|
4258 | if (!canUseDOM) {
|
4259 | return null;
|
4260 | }
|
4261 |
|
4262 | if (!this.props.node && !this.defaultNode) {
|
4263 | this.defaultNode = document.createElement('div');
|
4264 | document.body.appendChild(this.defaultNode);
|
4265 | }
|
4266 |
|
4267 | return ReactDOM__default["default"].createPortal(this.props.children, this.props.node || this.defaultNode);
|
4268 | };
|
4269 |
|
4270 | return Portal;
|
4271 | }(React__default["default"].Component);
|
4272 |
|
4273 | Portal.propTypes = propTypes$A;
|
4274 | var Portal$1 = Portal;
|
4275 |
|
4276 | function noop$1() {}
|
4277 |
|
4278 | var FadePropTypes$1 = PropTypes__default["default"].shape(Fade.propTypes);
|
4279 | var propTypes$z = {
|
4280 | isOpen: PropTypes__default["default"].bool,
|
4281 | autoFocus: PropTypes__default["default"].bool,
|
4282 | centered: PropTypes__default["default"].bool,
|
4283 | fullscreen: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].oneOf(['sm', 'md', 'lg', 'xl'])]),
|
4284 | scrollable: PropTypes__default["default"].bool,
|
4285 | size: PropTypes__default["default"].string,
|
4286 | toggle: PropTypes__default["default"].func,
|
4287 | keyboard: PropTypes__default["default"].bool,
|
4288 | role: PropTypes__default["default"].string,
|
4289 | labelledBy: PropTypes__default["default"].string,
|
4290 | backdrop: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].oneOf(['static'])]),
|
4291 | onEnter: PropTypes__default["default"].func,
|
4292 | onExit: PropTypes__default["default"].func,
|
4293 | onOpened: PropTypes__default["default"].func,
|
4294 | onClosed: PropTypes__default["default"].func,
|
4295 | children: PropTypes__default["default"].node,
|
4296 | className: PropTypes__default["default"].string,
|
4297 | wrapClassName: PropTypes__default["default"].string,
|
4298 | modalClassName: PropTypes__default["default"].string,
|
4299 | backdropClassName: PropTypes__default["default"].string,
|
4300 | contentClassName: PropTypes__default["default"].string,
|
4301 | external: PropTypes__default["default"].node,
|
4302 | fade: PropTypes__default["default"].bool,
|
4303 | cssModule: PropTypes__default["default"].object,
|
4304 | zIndex: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
4305 | backdropTransition: FadePropTypes$1,
|
4306 | modalTransition: FadePropTypes$1,
|
4307 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
4308 | unmountOnClose: PropTypes__default["default"].bool,
|
4309 | returnFocusAfterClose: PropTypes__default["default"].bool,
|
4310 | container: targetPropType,
|
4311 | trapFocus: PropTypes__default["default"].bool
|
4312 | };
|
4313 | var propsToOmit$1 = Object.keys(propTypes$z);
|
4314 | var defaultProps$z = {
|
4315 | isOpen: false,
|
4316 | autoFocus: true,
|
4317 | centered: false,
|
4318 | scrollable: false,
|
4319 | role: 'dialog',
|
4320 | backdrop: true,
|
4321 | keyboard: true,
|
4322 | zIndex: 1050,
|
4323 | fade: true,
|
4324 | onOpened: noop$1,
|
4325 | onClosed: noop$1,
|
4326 | modalTransition: {
|
4327 | timeout: TransitionTimeouts.Modal
|
4328 | },
|
4329 | backdropTransition: {
|
4330 | mountOnEnter: true,
|
4331 | timeout: TransitionTimeouts.Fade
|
4332 |
|
4333 | },
|
4334 | unmountOnClose: true,
|
4335 | returnFocusAfterClose: true,
|
4336 | container: 'body',
|
4337 | trapFocus: false
|
4338 | };
|
4339 |
|
4340 | var Modal = function (_React$Component) {
|
4341 | _inheritsLoose(Modal, _React$Component);
|
4342 |
|
4343 | function Modal(props) {
|
4344 | var _this;
|
4345 |
|
4346 | _this = _React$Component.call(this, props) || this;
|
4347 | _this._element = null;
|
4348 | _this._originalBodyPadding = null;
|
4349 | _this._originalBodyOverflow = null;
|
4350 | _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_this));
|
4351 | _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_this));
|
4352 | _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_this));
|
4353 | _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_this));
|
4354 | _this.handleStaticBackdropAnimation = _this.handleStaticBackdropAnimation.bind(_assertThisInitialized(_this));
|
4355 | _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_this));
|
4356 | _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_this));
|
4357 | _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
|
4358 | _this.manageFocusAfterClose = _this.manageFocusAfterClose.bind(_assertThisInitialized(_this));
|
4359 | _this.clearBackdropAnimationTimeout = _this.clearBackdropAnimationTimeout.bind(_assertThisInitialized(_this));
|
4360 | _this.trapFocus = _this.trapFocus.bind(_assertThisInitialized(_this));
|
4361 | _this.state = {
|
4362 | isOpen: false,
|
4363 | showStaticBackdropAnimation: false
|
4364 | };
|
4365 | return _this;
|
4366 | }
|
4367 |
|
4368 | var _proto = Modal.prototype;
|
4369 |
|
4370 | _proto.componentDidMount = function componentDidMount() {
|
4371 | var _this$props = this.props,
|
4372 | isOpen = _this$props.isOpen,
|
4373 | autoFocus = _this$props.autoFocus,
|
4374 | onEnter = _this$props.onEnter;
|
4375 |
|
4376 | if (isOpen) {
|
4377 | this.init();
|
4378 | this.setState({
|
4379 | isOpen: true
|
4380 | });
|
4381 |
|
4382 | if (autoFocus) {
|
4383 | this.setFocus();
|
4384 | }
|
4385 | }
|
4386 |
|
4387 | if (onEnter) {
|
4388 | onEnter();
|
4389 | }
|
4390 |
|
4391 |
|
4392 | document.addEventListener('focus', this.trapFocus, true);
|
4393 | this._isMounted = true;
|
4394 | };
|
4395 |
|
4396 | _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
4397 | if (this.props.isOpen && !prevProps.isOpen) {
|
4398 | this.init();
|
4399 | this.setState({
|
4400 | isOpen: true
|
4401 | });
|
4402 |
|
4403 | return;
|
4404 | }
|
4405 |
|
4406 |
|
4407 | if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {
|
4408 | this.setFocus();
|
4409 | }
|
4410 |
|
4411 | if (this._element && prevProps.zIndex !== this.props.zIndex) {
|
4412 | this._element.style.zIndex = this.props.zIndex;
|
4413 | }
|
4414 | };
|
4415 |
|
4416 | _proto.componentWillUnmount = function componentWillUnmount() {
|
4417 | this.clearBackdropAnimationTimeout();
|
4418 |
|
4419 | if (this.props.onExit) {
|
4420 | this.props.onExit();
|
4421 | }
|
4422 |
|
4423 | if (this._element) {
|
4424 | this.destroy();
|
4425 |
|
4426 | if (this.props.isOpen || this.state.isOpen) {
|
4427 | this.close();
|
4428 | }
|
4429 | }
|
4430 |
|
4431 | document.removeEventListener('focus', this.trapFocus, true);
|
4432 | this._isMounted = false;
|
4433 | };
|
4434 |
|
4435 | _proto.trapFocus = function trapFocus(ev) {
|
4436 | if (!this.props.trapFocus) {
|
4437 | return;
|
4438 | }
|
4439 |
|
4440 | if (!this._element)
|
4441 | return;
|
4442 | if (this._dialog && this._dialog.parentNode === ev.target)
|
4443 | return;
|
4444 | if (this.modalIndex < Modal.openCount - 1)
|
4445 | return;
|
4446 | var children = this.getFocusableChildren();
|
4447 |
|
4448 | for (var i = 0; i < children.length; i++) {
|
4449 |
|
4450 | if (children[i] === ev.target) return;
|
4451 | }
|
4452 |
|
4453 | if (children.length > 0) {
|
4454 |
|
4455 | ev.preventDefault();
|
4456 | ev.stopPropagation();
|
4457 | children[0].focus();
|
4458 | }
|
4459 | };
|
4460 |
|
4461 | _proto.onOpened = function onOpened(node, isAppearing) {
|
4462 | this.props.onOpened();
|
4463 | (this.props.modalTransition.onEntered || noop$1)(node, isAppearing);
|
4464 | };
|
4465 |
|
4466 | _proto.onClosed = function onClosed(node) {
|
4467 | var unmountOnClose = this.props.unmountOnClose;
|
4468 |
|
4469 | this.props.onClosed();
|
4470 | (this.props.modalTransition.onExited || noop$1)(node);
|
4471 |
|
4472 | if (unmountOnClose) {
|
4473 | this.destroy();
|
4474 | }
|
4475 |
|
4476 | this.close();
|
4477 |
|
4478 | if (this._isMounted) {
|
4479 | this.setState({
|
4480 | isOpen: false
|
4481 | });
|
4482 | }
|
4483 | };
|
4484 |
|
4485 | _proto.setFocus = function setFocus() {
|
4486 | if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') {
|
4487 | this._dialog.parentNode.focus();
|
4488 | }
|
4489 | };
|
4490 |
|
4491 | _proto.getFocusableChildren = function getFocusableChildren() {
|
4492 | return this._element.querySelectorAll(focusableElements.join(', '));
|
4493 | };
|
4494 |
|
4495 | _proto.getFocusedChild = function getFocusedChild() {
|
4496 | var currentFocus;
|
4497 | var focusableChildren = this.getFocusableChildren();
|
4498 |
|
4499 | try {
|
4500 | currentFocus = document.activeElement;
|
4501 | } catch (err) {
|
4502 | currentFocus = focusableChildren[0];
|
4503 | }
|
4504 |
|
4505 | return currentFocus;
|
4506 | }
|
4507 | ;
|
4508 |
|
4509 | _proto.handleBackdropClick = function handleBackdropClick(e) {
|
4510 | if (e.target === this._mouseDownElement) {
|
4511 | e.stopPropagation();
|
4512 | var backdrop = this._dialog ? this._dialog.parentNode : null;
|
4513 |
|
4514 | if (backdrop && e.target === backdrop && this.props.backdrop === 'static') {
|
4515 | this.handleStaticBackdropAnimation();
|
4516 | }
|
4517 |
|
4518 | if (!this.props.isOpen || this.props.backdrop !== true) return;
|
4519 |
|
4520 | if (backdrop && e.target === backdrop && this.props.toggle) {
|
4521 | this.props.toggle(e);
|
4522 | }
|
4523 | }
|
4524 | };
|
4525 |
|
4526 | _proto.handleTab = function handleTab(e) {
|
4527 | if (e.which !== 9) return;
|
4528 | if (this.modalIndex < Modal.openCount - 1) return;
|
4529 |
|
4530 | var focusableChildren = this.getFocusableChildren();
|
4531 | var totalFocusable = focusableChildren.length;
|
4532 | if (totalFocusable === 0) return;
|
4533 | var currentFocus = this.getFocusedChild();
|
4534 | var focusedIndex = 0;
|
4535 |
|
4536 | for (var i = 0; i < totalFocusable; i += 1) {
|
4537 | if (focusableChildren[i] === currentFocus) {
|
4538 | focusedIndex = i;
|
4539 | break;
|
4540 | }
|
4541 | }
|
4542 |
|
4543 | if (e.shiftKey && focusedIndex === 0) {
|
4544 | e.preventDefault();
|
4545 | focusableChildren[totalFocusable - 1].focus();
|
4546 | } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {
|
4547 | e.preventDefault();
|
4548 | focusableChildren[0].focus();
|
4549 | }
|
4550 | };
|
4551 |
|
4552 | _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {
|
4553 | this._mouseDownElement = e.target;
|
4554 | };
|
4555 |
|
4556 | _proto.handleEscape = function handleEscape(e) {
|
4557 | if (this.props.isOpen && e.keyCode === keyCodes.esc && this.props.toggle) {
|
4558 | if (this.props.keyboard) {
|
4559 | e.preventDefault();
|
4560 | e.stopPropagation();
|
4561 | this.props.toggle(e);
|
4562 | } else if (this.props.backdrop === 'static') {
|
4563 | e.preventDefault();
|
4564 | e.stopPropagation();
|
4565 | this.handleStaticBackdropAnimation();
|
4566 | }
|
4567 | }
|
4568 | };
|
4569 |
|
4570 | _proto.handleStaticBackdropAnimation = function handleStaticBackdropAnimation() {
|
4571 | var _this2 = this;
|
4572 |
|
4573 | this.clearBackdropAnimationTimeout();
|
4574 | this.setState({
|
4575 | showStaticBackdropAnimation: true
|
4576 | });
|
4577 | this._backdropAnimationTimeout = setTimeout(function () {
|
4578 | _this2.setState({
|
4579 | showStaticBackdropAnimation: false
|
4580 | });
|
4581 | }, 100);
|
4582 | };
|
4583 |
|
4584 | _proto.init = function init() {
|
4585 | try {
|
4586 | this._triggeringElement = document.activeElement;
|
4587 | } catch (err) {
|
4588 | this._triggeringElement = null;
|
4589 | }
|
4590 |
|
4591 | if (!this._element) {
|
4592 | this._element = document.createElement('div');
|
4593 |
|
4594 | this._element.setAttribute('tabindex', '-1');
|
4595 |
|
4596 | this._element.style.position = 'relative';
|
4597 | this._element.style.zIndex = this.props.zIndex;
|
4598 | this._mountContainer = getTarget(this.props.container);
|
4599 |
|
4600 | this._mountContainer.appendChild(this._element);
|
4601 | }
|
4602 |
|
4603 | this._originalBodyPadding = getOriginalBodyPadding();
|
4604 | this._originalBodyOverflow = window.getComputedStyle(document.body).overflow;
|
4605 | conditionallyUpdateScrollbar();
|
4606 |
|
4607 | if (Modal.openCount === 0) {
|
4608 | document.body.className = classNames__default["default"](document.body.className, mapToCssModules('modal-open', this.props.cssModule));
|
4609 | document.body.style.overflow = 'hidden';
|
4610 | }
|
4611 |
|
4612 | this.modalIndex = Modal.openCount;
|
4613 | Modal.openCount += 1;
|
4614 | };
|
4615 |
|
4616 | _proto.destroy = function destroy() {
|
4617 | if (this._element) {
|
4618 | this._mountContainer.removeChild(this._element);
|
4619 |
|
4620 | this._element = null;
|
4621 | }
|
4622 |
|
4623 | this.manageFocusAfterClose();
|
4624 | };
|
4625 |
|
4626 | _proto.manageFocusAfterClose = function manageFocusAfterClose() {
|
4627 | if (this._triggeringElement) {
|
4628 | var returnFocusAfterClose = this.props.returnFocusAfterClose;
|
4629 | if (this._triggeringElement.focus && returnFocusAfterClose) this._triggeringElement.focus();
|
4630 | this._triggeringElement = null;
|
4631 | }
|
4632 | };
|
4633 |
|
4634 | _proto.close = function close() {
|
4635 | if (Modal.openCount <= 1) {
|
4636 | var modalOpenClassName = mapToCssModules('modal-open', this.props.cssModule);
|
4637 |
|
4638 | var modalOpenClassNameRegex = new RegExp("(^| )" + modalOpenClassName + "( |$)");
|
4639 | document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim();
|
4640 | document.body.style.overflow = this._originalBodyOverflow;
|
4641 | }
|
4642 |
|
4643 | this.manageFocusAfterClose();
|
4644 | Modal.openCount = Math.max(0, Modal.openCount - 1);
|
4645 | setScrollbarWidth(this._originalBodyPadding);
|
4646 | };
|
4647 |
|
4648 | _proto.renderModalDialog = function renderModalDialog() {
|
4649 | var _classNames,
|
4650 | _this3 = this;
|
4651 |
|
4652 | var attributes = omit(this.props, propsToOmit$1);
|
4653 | var dialogBaseClass = 'modal-dialog';
|
4654 | return React__default["default"].createElement("div", _extends({}, attributes, {
|
4655 | className: mapToCssModules(classNames__default["default"](dialogBaseClass, this.props.className, (_classNames = {}, _classNames["modal-" + this.props.size] = this.props.size, _classNames[dialogBaseClass + "-centered"] = this.props.centered, _classNames[dialogBaseClass + "-scrollable"] = this.props.scrollable, _classNames['modal-fullscreen'] = this.props.fullscreen === true, _classNames["modal-fullscreen-" + this.props.fullscreen + "-down"] = typeof this.props.fullscreen === 'string', _classNames)), this.props.cssModule),
|
4656 | role: "document",
|
4657 | ref: function ref(c) {
|
4658 | _this3._dialog = c;
|
4659 | }
|
4660 | }), React__default["default"].createElement("div", {
|
4661 | className: mapToCssModules(classNames__default["default"]('modal-content', this.props.contentClassName), this.props.cssModule)
|
4662 | }, this.props.children));
|
4663 | };
|
4664 |
|
4665 | _proto.render = function render() {
|
4666 | var unmountOnClose = this.props.unmountOnClose;
|
4667 |
|
4668 | if (!!this._element && (this.state.isOpen || !unmountOnClose)) {
|
4669 | var isModalHidden = !!this._element && !this.state.isOpen && !unmountOnClose;
|
4670 | this._element.style.display = isModalHidden ? 'none' : 'block';
|
4671 | var _this$props2 = this.props,
|
4672 | wrapClassName = _this$props2.wrapClassName,
|
4673 | modalClassName = _this$props2.modalClassName,
|
4674 | backdropClassName = _this$props2.backdropClassName,
|
4675 | cssModule = _this$props2.cssModule,
|
4676 | isOpen = _this$props2.isOpen,
|
4677 | backdrop = _this$props2.backdrop,
|
4678 | role = _this$props2.role,
|
4679 | labelledBy = _this$props2.labelledBy,
|
4680 | external = _this$props2.external,
|
4681 | innerRef = _this$props2.innerRef;
|
4682 | var modalAttributes = {
|
4683 | onClick: this.handleBackdropClick,
|
4684 | onMouseDown: this.handleBackdropMouseDown,
|
4685 | onKeyUp: this.handleEscape,
|
4686 | onKeyDown: this.handleTab,
|
4687 | style: {
|
4688 | display: 'block'
|
4689 | },
|
4690 | 'aria-labelledby': labelledBy,
|
4691 | role: role,
|
4692 | tabIndex: '-1'
|
4693 | };
|
4694 | var hasTransition = this.props.fade;
|
4695 |
|
4696 | var modalTransition = _objectSpread2(_objectSpread2(_objectSpread2({}, Fade.defaultProps), this.props.modalTransition), {}, {
|
4697 | baseClass: hasTransition ? this.props.modalTransition.baseClass : '',
|
4698 | timeout: hasTransition ? this.props.modalTransition.timeout : 0
|
4699 | });
|
4700 |
|
4701 | var backdropTransition = _objectSpread2(_objectSpread2(_objectSpread2({}, Fade.defaultProps), this.props.backdropTransition), {}, {
|
4702 | baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',
|
4703 | timeout: hasTransition ? this.props.backdropTransition.timeout : 0
|
4704 | });
|
4705 |
|
4706 | var Backdrop = backdrop && (hasTransition ? React__default["default"].createElement(Fade, _extends({}, backdropTransition, {
|
4707 | "in": isOpen && !!backdrop,
|
4708 | cssModule: cssModule,
|
4709 | className: mapToCssModules(classNames__default["default"]('modal-backdrop', backdropClassName), cssModule)
|
4710 | })) : React__default["default"].createElement("div", {
|
4711 | className: mapToCssModules(classNames__default["default"]('modal-backdrop', 'show', backdropClassName), cssModule)
|
4712 | }));
|
4713 | return React__default["default"].createElement(Portal$1, {
|
4714 | node: this._element
|
4715 | }, React__default["default"].createElement("div", {
|
4716 | className: mapToCssModules(wrapClassName)
|
4717 | }, React__default["default"].createElement(Fade, _extends({}, modalAttributes, modalTransition, {
|
4718 | "in": isOpen,
|
4719 | onEntered: this.onOpened,
|
4720 | onExited: this.onClosed,
|
4721 | cssModule: cssModule,
|
4722 | className: mapToCssModules(classNames__default["default"]('modal', modalClassName, this.state.showStaticBackdropAnimation && 'modal-static'), cssModule),
|
4723 | innerRef: innerRef
|
4724 | }), external, this.renderModalDialog()), Backdrop));
|
4725 | }
|
4726 |
|
4727 | return null;
|
4728 | };
|
4729 |
|
4730 | _proto.clearBackdropAnimationTimeout = function clearBackdropAnimationTimeout() {
|
4731 | if (this._backdropAnimationTimeout) {
|
4732 | clearTimeout(this._backdropAnimationTimeout);
|
4733 | this._backdropAnimationTimeout = undefined;
|
4734 | }
|
4735 | };
|
4736 |
|
4737 | return Modal;
|
4738 | }(React__default["default"].Component);
|
4739 |
|
4740 | Modal.propTypes = propTypes$z;
|
4741 | Modal.defaultProps = defaultProps$z;
|
4742 | Modal.openCount = 0;
|
4743 | var Modal$1 = Modal;
|
4744 |
|
4745 | var _excluded$v = ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "close"];
|
4746 | var propTypes$y = {
|
4747 | tag: tagPropType,
|
4748 | wrapTag: tagPropType,
|
4749 | toggle: PropTypes__default["default"].func,
|
4750 | className: PropTypes__default["default"].string,
|
4751 | cssModule: PropTypes__default["default"].object,
|
4752 | children: PropTypes__default["default"].node,
|
4753 | closeAriaLabel: PropTypes__default["default"].string,
|
4754 | close: PropTypes__default["default"].object
|
4755 | };
|
4756 | var defaultProps$y = {
|
4757 | tag: 'h5',
|
4758 | wrapTag: 'div',
|
4759 | closeAriaLabel: 'Close'
|
4760 | };
|
4761 |
|
4762 | var ModalHeader = function ModalHeader(props) {
|
4763 | var closeButton;
|
4764 |
|
4765 | var className = props.className,
|
4766 | cssModule = props.cssModule,
|
4767 | children = props.children,
|
4768 | toggle = props.toggle,
|
4769 | Tag = props.tag,
|
4770 | WrapTag = props.wrapTag,
|
4771 | closeAriaLabel = props.closeAriaLabel,
|
4772 | close = props.close,
|
4773 | attributes = _objectWithoutPropertiesLoose(props, _excluded$v);
|
4774 |
|
4775 | var classes = mapToCssModules(classNames__default["default"](className, 'modal-header'), cssModule);
|
4776 |
|
4777 | if (!close && toggle) {
|
4778 | closeButton = React__default["default"].createElement("button", {
|
4779 | type: "button",
|
4780 | onClick: toggle,
|
4781 | className: mapToCssModules('btn-close', cssModule),
|
4782 | "aria-label": closeAriaLabel
|
4783 | });
|
4784 | }
|
4785 |
|
4786 | return React__default["default"].createElement(WrapTag, _extends({}, attributes, {
|
4787 | className: classes
|
4788 | }), React__default["default"].createElement(Tag, {
|
4789 | className: mapToCssModules('modal-title', cssModule)
|
4790 | }, children), close || closeButton);
|
4791 | };
|
4792 |
|
4793 | ModalHeader.propTypes = propTypes$y;
|
4794 | ModalHeader.defaultProps = defaultProps$y;
|
4795 | var ModalHeader$1 = ModalHeader;
|
4796 |
|
4797 | var _excluded$u = ["className", "cssModule", "tag"];
|
4798 | var propTypes$x = {
|
4799 | tag: tagPropType,
|
4800 | className: PropTypes__default["default"].string,
|
4801 | cssModule: PropTypes__default["default"].object
|
4802 | };
|
4803 | var defaultProps$x = {
|
4804 | tag: 'div'
|
4805 | };
|
4806 |
|
4807 | var ModalBody = function ModalBody(props) {
|
4808 | var className = props.className,
|
4809 | cssModule = props.cssModule,
|
4810 | Tag = props.tag,
|
4811 | attributes = _objectWithoutPropertiesLoose(props, _excluded$u);
|
4812 |
|
4813 | var classes = mapToCssModules(classNames__default["default"](className, 'modal-body'), cssModule);
|
4814 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
4815 | className: classes
|
4816 | }));
|
4817 | };
|
4818 |
|
4819 | ModalBody.propTypes = propTypes$x;
|
4820 | ModalBody.defaultProps = defaultProps$x;
|
4821 | var ModalBody$1 = ModalBody;
|
4822 |
|
4823 | var _excluded$t = ["className", "cssModule", "tag"];
|
4824 | var propTypes$w = {
|
4825 | tag: tagPropType,
|
4826 | className: PropTypes__default["default"].string,
|
4827 | cssModule: PropTypes__default["default"].object
|
4828 | };
|
4829 | var defaultProps$w = {
|
4830 | tag: 'div'
|
4831 | };
|
4832 |
|
4833 | var ModalFooter = function ModalFooter(props) {
|
4834 | var className = props.className,
|
4835 | cssModule = props.cssModule,
|
4836 | Tag = props.tag,
|
4837 | attributes = _objectWithoutPropertiesLoose(props, _excluded$t);
|
4838 |
|
4839 | var classes = mapToCssModules(classNames__default["default"](className, 'modal-footer'), cssModule);
|
4840 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
4841 | className: classes
|
4842 | }));
|
4843 | };
|
4844 |
|
4845 | ModalFooter.propTypes = propTypes$w;
|
4846 | ModalFooter.defaultProps = defaultProps$w;
|
4847 | var ModalFooter$1 = ModalFooter;
|
4848 |
|
4849 | var defaultProps$v = {
|
4850 | placement: 'top',
|
4851 | autohide: true,
|
4852 | placementPrefix: 'bs-tooltip',
|
4853 | trigger: 'hover focus'
|
4854 | };
|
4855 |
|
4856 | var Tooltip = function Tooltip(props) {
|
4857 | var popperClasses = classNames__default["default"]('tooltip', 'show', props.popperClassName);
|
4858 | var classes = classNames__default["default"]('tooltip-inner', props.innerClassName);
|
4859 | return React__default["default"].createElement(TooltipPopoverWrapper$1, _extends({}, props, {
|
4860 | arrowClassName: "tooltip-arrow",
|
4861 | popperClassName: popperClasses,
|
4862 | innerClassName: classes
|
4863 | }));
|
4864 | };
|
4865 |
|
4866 | Tooltip.propTypes = propTypes$E;
|
4867 | Tooltip.defaultProps = defaultProps$v;
|
4868 | var Tooltip$1 = Tooltip;
|
4869 |
|
4870 | var _excluded$s = ["className", "cssModule", "size", "bordered", "borderless", "striped", "dark", "hover", "responsive", "tag", "responsiveTag", "innerRef"];
|
4871 | var propTypes$v = {
|
4872 | className: PropTypes__default["default"].string,
|
4873 | cssModule: PropTypes__default["default"].object,
|
4874 | size: PropTypes__default["default"].string,
|
4875 | bordered: PropTypes__default["default"].bool,
|
4876 | borderless: PropTypes__default["default"].bool,
|
4877 | striped: PropTypes__default["default"].bool,
|
4878 | dark: PropTypes__default["default"].bool,
|
4879 | hover: PropTypes__default["default"].bool,
|
4880 | responsive: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].string]),
|
4881 | tag: tagPropType,
|
4882 | responsiveTag: tagPropType,
|
4883 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].string, PropTypes__default["default"].object])
|
4884 | };
|
4885 | var defaultProps$u = {
|
4886 | tag: 'table',
|
4887 | responsiveTag: 'div'
|
4888 | };
|
4889 |
|
4890 | var Table = function Table(props) {
|
4891 | var className = props.className,
|
4892 | cssModule = props.cssModule,
|
4893 | size = props.size,
|
4894 | bordered = props.bordered,
|
4895 | borderless = props.borderless,
|
4896 | striped = props.striped,
|
4897 | dark = props.dark,
|
4898 | hover = props.hover,
|
4899 | responsive = props.responsive,
|
4900 | Tag = props.tag,
|
4901 | ResponsiveTag = props.responsiveTag,
|
4902 | innerRef = props.innerRef,
|
4903 | attributes = _objectWithoutPropertiesLoose(props, _excluded$s);
|
4904 |
|
4905 | var classes = mapToCssModules(classNames__default["default"](className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, borderless ? 'table-borderless' : false, striped ? 'table-striped' : false, dark ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule);
|
4906 | var table = React__default["default"].createElement(Tag, _extends({}, attributes, {
|
4907 | ref: innerRef,
|
4908 | className: classes
|
4909 | }));
|
4910 |
|
4911 | if (responsive) {
|
4912 | var responsiveClassName = mapToCssModules(responsive === true ? 'table-responsive' : "table-responsive-" + responsive, cssModule);
|
4913 | return React__default["default"].createElement(ResponsiveTag, {
|
4914 | className: responsiveClassName
|
4915 | }, table);
|
4916 | }
|
4917 |
|
4918 | return table;
|
4919 | };
|
4920 |
|
4921 | Table.propTypes = propTypes$v;
|
4922 | Table.defaultProps = defaultProps$u;
|
4923 | var Table$1 = Table;
|
4924 |
|
4925 | var _excluded$r = ["className", "cssModule", "tag", "flush", "horizontal", "numbered"];
|
4926 | var propTypes$u = {
|
4927 | tag: tagPropType,
|
4928 | flush: PropTypes__default["default"].bool,
|
4929 | className: PropTypes__default["default"].string,
|
4930 | cssModule: PropTypes__default["default"].object,
|
4931 | horizontal: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].string]),
|
4932 | numbered: PropTypes__default["default"].bool
|
4933 | };
|
4934 | var defaultProps$t = {
|
4935 | tag: 'ul',
|
4936 | horizontal: false,
|
4937 | numbered: false
|
4938 | };
|
4939 |
|
4940 | var getHorizontalClass = function getHorizontalClass(horizontal) {
|
4941 | if (horizontal === false) {
|
4942 | return false;
|
4943 | } else if (horizontal === true || horizontal === "xs") {
|
4944 | return "list-group-horizontal";
|
4945 | }
|
4946 |
|
4947 | return "list-group-horizontal-" + horizontal;
|
4948 | };
|
4949 |
|
4950 | var ListGroup = function ListGroup(props) {
|
4951 | var className = props.className,
|
4952 | cssModule = props.cssModule,
|
4953 | Tag = props.tag,
|
4954 | flush = props.flush,
|
4955 | horizontal = props.horizontal,
|
4956 | numbered = props.numbered,
|
4957 | attributes = _objectWithoutPropertiesLoose(props, _excluded$r);
|
4958 |
|
4959 | var classes = mapToCssModules(classNames__default["default"](className, 'list-group',
|
4960 |
|
4961 | flush ? 'list-group-flush' : getHorizontalClass(horizontal), {
|
4962 | 'list-group-numbered': numbered
|
4963 | }), cssModule);
|
4964 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
4965 | className: classes
|
4966 | }));
|
4967 | };
|
4968 |
|
4969 | ListGroup.propTypes = propTypes$u;
|
4970 | ListGroup.defaultProps = defaultProps$t;
|
4971 | var ListGroup$1 = ListGroup;
|
4972 |
|
4973 | var _excluded$q = ["className", "cssModule", "inline", "tag", "innerRef"];
|
4974 | var propTypes$t = {
|
4975 | children: PropTypes__default["default"].node,
|
4976 | inline: PropTypes__default["default"].bool,
|
4977 | tag: tagPropType,
|
4978 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].func, PropTypes__default["default"].string]),
|
4979 | className: PropTypes__default["default"].string,
|
4980 | cssModule: PropTypes__default["default"].object
|
4981 | };
|
4982 | var defaultProps$s = {
|
4983 | tag: 'form'
|
4984 | };
|
4985 |
|
4986 | var Form = function (_Component) {
|
4987 | _inheritsLoose(Form, _Component);
|
4988 |
|
4989 | function Form(props) {
|
4990 | var _this;
|
4991 |
|
4992 | _this = _Component.call(this, props) || this;
|
4993 | _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
4994 | _this.submit = _this.submit.bind(_assertThisInitialized(_this));
|
4995 | return _this;
|
4996 | }
|
4997 |
|
4998 | var _proto = Form.prototype;
|
4999 |
|
5000 | _proto.getRef = function getRef(ref) {
|
5001 | if (this.props.innerRef) {
|
5002 | this.props.innerRef(ref);
|
5003 | }
|
5004 |
|
5005 | this.ref = ref;
|
5006 | };
|
5007 |
|
5008 | _proto.submit = function submit() {
|
5009 | if (this.ref) {
|
5010 | this.ref.submit();
|
5011 | }
|
5012 | };
|
5013 |
|
5014 | _proto.render = function render() {
|
5015 | var _this$props = this.props,
|
5016 | className = _this$props.className,
|
5017 | cssModule = _this$props.cssModule,
|
5018 | inline = _this$props.inline,
|
5019 | Tag = _this$props.tag,
|
5020 | innerRef = _this$props.innerRef,
|
5021 | attributes = _objectWithoutPropertiesLoose(_this$props, _excluded$q);
|
5022 |
|
5023 | var classes = mapToCssModules(classNames__default["default"](className, inline ? 'form-inline' : false), cssModule);
|
5024 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5025 | ref: innerRef,
|
5026 | className: classes
|
5027 | }));
|
5028 | };
|
5029 |
|
5030 | return Form;
|
5031 | }(React.Component);
|
5032 |
|
5033 | Form.propTypes = propTypes$t;
|
5034 | Form.defaultProps = defaultProps$s;
|
5035 | var Form$1 = Form;
|
5036 |
|
5037 | var _excluded$p = ["className", "cssModule", "valid", "tooltip", "tag"];
|
5038 | var propTypes$s = {
|
5039 | children: PropTypes__default["default"].node,
|
5040 | tag: tagPropType,
|
5041 | className: PropTypes__default["default"].string,
|
5042 | cssModule: PropTypes__default["default"].object,
|
5043 | valid: PropTypes__default["default"].bool,
|
5044 | tooltip: PropTypes__default["default"].bool
|
5045 | };
|
5046 | var defaultProps$r = {
|
5047 | tag: 'div',
|
5048 | valid: undefined
|
5049 | };
|
5050 |
|
5051 | var FormFeedback = function FormFeedback(props) {
|
5052 | var className = props.className,
|
5053 | cssModule = props.cssModule,
|
5054 | valid = props.valid,
|
5055 | tooltip = props.tooltip,
|
5056 | Tag = props.tag,
|
5057 | attributes = _objectWithoutPropertiesLoose(props, _excluded$p);
|
5058 |
|
5059 | var validMode = tooltip ? 'tooltip' : 'feedback';
|
5060 | var classes = mapToCssModules(classNames__default["default"](className, valid ? "valid-" + validMode : "invalid-" + validMode), cssModule);
|
5061 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5062 | className: classes
|
5063 | }));
|
5064 | };
|
5065 |
|
5066 | FormFeedback.propTypes = propTypes$s;
|
5067 | FormFeedback.defaultProps = defaultProps$r;
|
5068 | var FormFeedback$1 = FormFeedback;
|
5069 |
|
5070 | var _excluded$o = ["className", "cssModule", "row", "disabled", "check", "inline", "floating", "tag", "switch"];
|
5071 | var propTypes$r = {
|
5072 | children: PropTypes__default["default"].node,
|
5073 | row: PropTypes__default["default"].bool,
|
5074 | check: PropTypes__default["default"].bool,
|
5075 | "switch": PropTypes__default["default"].bool,
|
5076 | inline: PropTypes__default["default"].bool,
|
5077 | floating: PropTypes__default["default"].bool,
|
5078 | disabled: PropTypes__default["default"].bool,
|
5079 | tag: tagPropType,
|
5080 | className: PropTypes__default["default"].string,
|
5081 | cssModule: PropTypes__default["default"].object
|
5082 | };
|
5083 | var defaultProps$q = {
|
5084 | tag: 'div'
|
5085 | };
|
5086 |
|
5087 | var FormGroup = function FormGroup(props) {
|
5088 | var className = props.className,
|
5089 | cssModule = props.cssModule,
|
5090 | row = props.row,
|
5091 | disabled = props.disabled,
|
5092 | check = props.check,
|
5093 | inline = props.inline,
|
5094 | floating = props.floating,
|
5095 | Tag = props.tag,
|
5096 | switchProp = props["switch"],
|
5097 | attributes = _objectWithoutPropertiesLoose(props, _excluded$o);
|
5098 |
|
5099 | var formCheck = check || switchProp;
|
5100 | var classes = mapToCssModules(classNames__default["default"](className, row ? 'row' : false, formCheck ? 'form-check' : 'mb-3', switchProp ? 'form-switch' : false, formCheck && inline ? 'form-check-inline' : false, formCheck && disabled ? 'disabled' : false, floating && 'form-floating'), cssModule);
|
5101 |
|
5102 | if (Tag === 'fieldset') {
|
5103 | attributes.disabled = disabled;
|
5104 | }
|
5105 |
|
5106 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5107 | className: classes
|
5108 | }));
|
5109 | };
|
5110 |
|
5111 | FormGroup.propTypes = propTypes$r;
|
5112 | FormGroup.defaultProps = defaultProps$q;
|
5113 | var FormGroup$1 = FormGroup;
|
5114 |
|
5115 | var _excluded$n = ["className", "cssModule", "inline", "color", "tag"];
|
5116 | var propTypes$q = {
|
5117 | children: PropTypes__default["default"].node,
|
5118 | inline: PropTypes__default["default"].bool,
|
5119 | tag: tagPropType,
|
5120 | color: PropTypes__default["default"].string,
|
5121 | className: PropTypes__default["default"].string,
|
5122 | cssModule: PropTypes__default["default"].object
|
5123 | };
|
5124 | var defaultProps$p = {
|
5125 | tag: 'small',
|
5126 | color: 'muted'
|
5127 | };
|
5128 |
|
5129 | var FormText = function FormText(props) {
|
5130 | var className = props.className,
|
5131 | cssModule = props.cssModule,
|
5132 | inline = props.inline,
|
5133 | color = props.color,
|
5134 | Tag = props.tag,
|
5135 | attributes = _objectWithoutPropertiesLoose(props, _excluded$n);
|
5136 |
|
5137 | var classes = mapToCssModules(classNames__default["default"](className, !inline ? 'form-text' : false, color ? "text-" + color : false), cssModule);
|
5138 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5139 | className: classes
|
5140 | }));
|
5141 | };
|
5142 |
|
5143 | FormText.propTypes = propTypes$q;
|
5144 | FormText.defaultProps = defaultProps$p;
|
5145 | var FormText$1 = FormText;
|
5146 |
|
5147 | var _excluded$m = ["className", "cssModule", "type", "bsSize", "valid", "invalid", "tag", "addon", "plaintext", "innerRef"];
|
5148 | var propTypes$p = {
|
5149 | children: PropTypes__default["default"].node,
|
5150 | type: PropTypes__default["default"].string,
|
5151 | size: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
5152 | bsSize: PropTypes__default["default"].string,
|
5153 | valid: PropTypes__default["default"].bool,
|
5154 | invalid: PropTypes__default["default"].bool,
|
5155 | tag: tagPropType,
|
5156 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].func, PropTypes__default["default"].string]),
|
5157 | plaintext: PropTypes__default["default"].bool,
|
5158 | addon: PropTypes__default["default"].bool,
|
5159 | className: PropTypes__default["default"].string,
|
5160 | cssModule: PropTypes__default["default"].object
|
5161 | };
|
5162 | var defaultProps$o = {
|
5163 | type: 'text'
|
5164 | };
|
5165 |
|
5166 | var Input = function (_React$Component) {
|
5167 | _inheritsLoose(Input, _React$Component);
|
5168 |
|
5169 | function Input(props) {
|
5170 | var _this;
|
5171 |
|
5172 | _this = _React$Component.call(this, props) || this;
|
5173 | _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
5174 | _this.focus = _this.focus.bind(_assertThisInitialized(_this));
|
5175 | return _this;
|
5176 | }
|
5177 |
|
5178 | var _proto = Input.prototype;
|
5179 |
|
5180 | _proto.getRef = function getRef(ref) {
|
5181 | if (this.props.innerRef) {
|
5182 | this.props.innerRef(ref);
|
5183 | }
|
5184 |
|
5185 | this.ref = ref;
|
5186 | };
|
5187 |
|
5188 | _proto.focus = function focus() {
|
5189 | if (this.ref) {
|
5190 | this.ref.focus();
|
5191 | }
|
5192 | };
|
5193 |
|
5194 | _proto.render = function render() {
|
5195 | var _this$props = this.props,
|
5196 | className = _this$props.className,
|
5197 | cssModule = _this$props.cssModule,
|
5198 | type = _this$props.type,
|
5199 | bsSize = _this$props.bsSize,
|
5200 | valid = _this$props.valid,
|
5201 | invalid = _this$props.invalid,
|
5202 | tag = _this$props.tag,
|
5203 | addon = _this$props.addon,
|
5204 | plaintext = _this$props.plaintext,
|
5205 | innerRef = _this$props.innerRef,
|
5206 | attributes = _objectWithoutPropertiesLoose(_this$props, _excluded$m);
|
5207 |
|
5208 | var checkInput = ['switch', 'radio', 'checkbox'].indexOf(type) > -1;
|
5209 | var isNotaNumber = new RegExp('\\D', 'g');
|
5210 | var textareaInput = type === 'textarea';
|
5211 | var selectInput = type === 'select';
|
5212 | var rangeInput = type === 'range';
|
5213 | var Tag = tag || (selectInput || textareaInput ? type : 'input');
|
5214 | var formControlClass = 'form-control';
|
5215 |
|
5216 | if (plaintext) {
|
5217 | formControlClass = formControlClass + "-plaintext";
|
5218 | Tag = tag || 'input';
|
5219 | } else if (rangeInput) {
|
5220 | formControlClass = 'form-range';
|
5221 | } else if (selectInput) {
|
5222 | formControlClass = "form-select";
|
5223 | } else if (checkInput) {
|
5224 | if (addon) {
|
5225 | formControlClass = null;
|
5226 | } else {
|
5227 | formControlClass = 'form-check-input';
|
5228 | }
|
5229 | }
|
5230 |
|
5231 | if (attributes.size && isNotaNumber.test(attributes.size)) {
|
5232 | warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.');
|
5233 | bsSize = attributes.size;
|
5234 | delete attributes.size;
|
5235 | }
|
5236 |
|
5237 | var classes = mapToCssModules(classNames__default["default"](className, invalid && 'is-invalid', valid && 'is-valid', bsSize ? selectInput ? "form-select-" + bsSize : "form-control-" + bsSize : false, formControlClass), cssModule);
|
5238 |
|
5239 | if (Tag === 'input' || tag && typeof tag === 'function') {
|
5240 | attributes.type = type === 'switch' ? 'checkbox' : type;
|
5241 | }
|
5242 |
|
5243 | if (attributes.children && !(plaintext || type === 'select' || typeof Tag !== 'string' || Tag === 'select')) {
|
5244 | warnOnce("Input with a type of \"" + type + "\" cannot have children. Please use \"value\"/\"defaultValue\" instead.");
|
5245 | delete attributes.children;
|
5246 | }
|
5247 |
|
5248 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5249 | ref: innerRef,
|
5250 | className: classes,
|
5251 | "aria-invalid": invalid
|
5252 | }));
|
5253 | };
|
5254 |
|
5255 | return Input;
|
5256 | }(React__default["default"].Component);
|
5257 |
|
5258 | Input.propTypes = propTypes$p;
|
5259 | Input.defaultProps = defaultProps$o;
|
5260 | var Input$1 = Input;
|
5261 |
|
5262 | var _excluded$l = ["className", "cssModule", "tag", "type", "size"];
|
5263 | var propTypes$o = {
|
5264 | tag: tagPropType,
|
5265 | type: PropTypes__default["default"].bool,
|
5266 | size: PropTypes__default["default"].string,
|
5267 | className: PropTypes__default["default"].string,
|
5268 | cssModule: PropTypes__default["default"].object
|
5269 | };
|
5270 | var defaultProps$n = {
|
5271 | tag: 'div'
|
5272 | };
|
5273 |
|
5274 | var InputGroup = function InputGroup(props) {
|
5275 | var className = props.className,
|
5276 | cssModule = props.cssModule,
|
5277 | Tag = props.tag,
|
5278 | size = props.size,
|
5279 | attributes = _objectWithoutPropertiesLoose(props, _excluded$l);
|
5280 |
|
5281 | var classes = mapToCssModules(classNames__default["default"](className, 'input-group', size ? "input-group-" + size : null), cssModule);
|
5282 |
|
5283 | if (props.type === 'dropdown') {
|
5284 | return React__default["default"].createElement(Dropdown$1, _extends({}, attributes, {
|
5285 | className: classes
|
5286 | }));
|
5287 | }
|
5288 |
|
5289 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5290 | className: classes
|
5291 | }));
|
5292 | };
|
5293 |
|
5294 | InputGroup.propTypes = propTypes$o;
|
5295 | InputGroup.defaultProps = defaultProps$n;
|
5296 | var InputGroup$1 = InputGroup;
|
5297 |
|
5298 | var _excluded$k = ["className", "cssModule", "tag"];
|
5299 | var propTypes$n = {
|
5300 | tag: tagPropType,
|
5301 | className: PropTypes__default["default"].string,
|
5302 | cssModule: PropTypes__default["default"].object
|
5303 | };
|
5304 | var defaultProps$m = {
|
5305 | tag: 'span'
|
5306 | };
|
5307 |
|
5308 | var InputGroupText = function InputGroupText(props) {
|
5309 | var className = props.className,
|
5310 | cssModule = props.cssModule,
|
5311 | Tag = props.tag,
|
5312 | attributes = _objectWithoutPropertiesLoose(props, _excluded$k);
|
5313 |
|
5314 | var classes = mapToCssModules(classNames__default["default"](className, 'input-group-text'), cssModule);
|
5315 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5316 | className: classes
|
5317 | }));
|
5318 | };
|
5319 |
|
5320 | InputGroupText.propTypes = propTypes$n;
|
5321 | InputGroupText.defaultProps = defaultProps$m;
|
5322 | var InputGroupText$1 = InputGroupText;
|
5323 |
|
5324 | var _excluded$j = ["className", "cssModule", "hidden", "widths", "tag", "check", "size", "for"];
|
5325 | var colWidths = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
5326 | var stringOrNumberProp = PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]);
|
5327 | var columnProps = PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].string, PropTypes__default["default"].number, PropTypes__default["default"].shape({
|
5328 | size: stringOrNumberProp,
|
5329 | order: stringOrNumberProp,
|
5330 | offset: stringOrNumberProp
|
5331 | })]);
|
5332 | var propTypes$m = {
|
5333 | children: PropTypes__default["default"].node,
|
5334 | hidden: PropTypes__default["default"].bool,
|
5335 | check: PropTypes__default["default"].bool,
|
5336 | size: PropTypes__default["default"].string,
|
5337 | "for": PropTypes__default["default"].string,
|
5338 | tag: tagPropType,
|
5339 | className: PropTypes__default["default"].string,
|
5340 | cssModule: PropTypes__default["default"].object,
|
5341 | xs: columnProps,
|
5342 | sm: columnProps,
|
5343 | md: columnProps,
|
5344 | lg: columnProps,
|
5345 | xl: columnProps,
|
5346 | xxl: columnProps,
|
5347 | widths: PropTypes__default["default"].array
|
5348 | };
|
5349 | var defaultProps$l = {
|
5350 | tag: 'label',
|
5351 | widths: colWidths
|
5352 | };
|
5353 |
|
5354 | var getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) {
|
5355 | if (colSize === true || colSize === '') {
|
5356 | return isXs ? 'col' : "col-" + colWidth;
|
5357 | } else if (colSize === 'auto') {
|
5358 | return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
|
5359 | }
|
5360 |
|
5361 | return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
|
5362 | };
|
5363 |
|
5364 | var Label = function Label(props) {
|
5365 | var className = props.className,
|
5366 | cssModule = props.cssModule,
|
5367 | hidden = props.hidden,
|
5368 | widths = props.widths,
|
5369 | Tag = props.tag,
|
5370 | check = props.check,
|
5371 | size = props.size,
|
5372 | htmlFor = props["for"],
|
5373 | attributes = _objectWithoutPropertiesLoose(props, _excluded$j);
|
5374 |
|
5375 | var colClasses = [];
|
5376 | widths.forEach(function (colWidth, i) {
|
5377 | var columnProp = props[colWidth];
|
5378 | delete attributes[colWidth];
|
5379 |
|
5380 | if (!columnProp && columnProp !== '') {
|
5381 | return;
|
5382 | }
|
5383 |
|
5384 | var isXs = !i;
|
5385 | var colClass;
|
5386 |
|
5387 | if (isObject(columnProp)) {
|
5388 | var _classNames;
|
5389 |
|
5390 | var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
|
5391 | colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
|
5392 | colClasses.push(mapToCssModules(classNames__default["default"]((_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);
|
5393 | } else {
|
5394 | colClass = getColumnSizeClass(isXs, colWidth, columnProp);
|
5395 | colClasses.push(colClass);
|
5396 | }
|
5397 | });
|
5398 | var colFormLabel = size || colClasses.length;
|
5399 | var formLabel = !(check || colFormLabel);
|
5400 | var classes = mapToCssModules(classNames__default["default"](className, hidden ? 'visually-hidden' : false, check ? 'form-check-label' : false, size ? "col-form-label-" + size : false, colClasses, colFormLabel ? 'col-form-label' : false, formLabel ? 'form-label' : false), cssModule);
|
5401 | return React__default["default"].createElement(Tag, _extends({
|
5402 | htmlFor: htmlFor
|
5403 | }, attributes, {
|
5404 | className: classes
|
5405 | }));
|
5406 | };
|
5407 |
|
5408 | Label.propTypes = propTypes$m;
|
5409 | Label.defaultProps = defaultProps$l;
|
5410 | var Label$1 = Label;
|
5411 |
|
5412 | var _excluded$i = ["body", "bottom", "className", "cssModule", "heading", "left", "list", "middle", "object", "right", "tag", "top"];
|
5413 | var propTypes$l = {
|
5414 | body: PropTypes__default["default"].bool,
|
5415 | bottom: PropTypes__default["default"].bool,
|
5416 | children: PropTypes__default["default"].node,
|
5417 | className: PropTypes__default["default"].string,
|
5418 | cssModule: PropTypes__default["default"].object,
|
5419 | heading: PropTypes__default["default"].bool,
|
5420 | left: PropTypes__default["default"].bool,
|
5421 | list: PropTypes__default["default"].bool,
|
5422 | middle: PropTypes__default["default"].bool,
|
5423 | object: PropTypes__default["default"].bool,
|
5424 | right: PropTypes__default["default"].bool,
|
5425 | tag: tagPropType,
|
5426 | top: PropTypes__default["default"].bool
|
5427 | };
|
5428 |
|
5429 | var Media = function Media(props) {
|
5430 | var body = props.body,
|
5431 | bottom = props.bottom,
|
5432 | className = props.className,
|
5433 | cssModule = props.cssModule,
|
5434 | heading = props.heading,
|
5435 | left = props.left,
|
5436 | list = props.list,
|
5437 | middle = props.middle,
|
5438 | object = props.object,
|
5439 | right = props.right,
|
5440 | tag = props.tag,
|
5441 | top = props.top,
|
5442 | attributes = _objectWithoutPropertiesLoose(props, _excluded$i);
|
5443 |
|
5444 | var defaultTag;
|
5445 |
|
5446 | if (heading) {
|
5447 | defaultTag = 'h4';
|
5448 | } else if (attributes.href) {
|
5449 | defaultTag = 'a';
|
5450 | } else if (attributes.src || object) {
|
5451 | defaultTag = 'img';
|
5452 | } else if (list) {
|
5453 | defaultTag = 'ul';
|
5454 | } else {
|
5455 | defaultTag = 'div';
|
5456 | }
|
5457 |
|
5458 | var Tag = tag || defaultTag;
|
5459 | var classes = mapToCssModules(classNames__default["default"](className, {
|
5460 | 'media-body': body,
|
5461 | 'media-heading': heading,
|
5462 | 'media-left': left,
|
5463 | 'media-right': right,
|
5464 | 'media-top': top,
|
5465 | 'media-bottom': bottom,
|
5466 | 'media-middle': middle,
|
5467 | 'media-object': object,
|
5468 | 'media-list': list,
|
5469 | media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list
|
5470 | }), cssModule);
|
5471 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5472 | className: classes
|
5473 | }));
|
5474 | };
|
5475 |
|
5476 | Media.propTypes = propTypes$l;
|
5477 | var Media$1 = Media;
|
5478 |
|
5479 | function noop() {}
|
5480 |
|
5481 | var FadePropTypes = PropTypes__default["default"].shape(Fade.propTypes);
|
5482 | var propTypes$k = {
|
5483 | autoFocus: PropTypes__default["default"].bool,
|
5484 | backdrop: PropTypes__default["default"].bool,
|
5485 | backdropClassName: PropTypes__default["default"].string,
|
5486 | backdropTransition: FadePropTypes,
|
5487 | children: PropTypes__default["default"].node,
|
5488 | className: PropTypes__default["default"].string,
|
5489 | container: targetPropType,
|
5490 | cssModule: PropTypes__default["default"].object,
|
5491 | direction: PropTypes__default["default"].oneOf(['start', 'end', 'bottom', 'top']),
|
5492 | fade: PropTypes__default["default"].bool,
|
5493 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
5494 | isOpen: PropTypes__default["default"].bool,
|
5495 | keyboard: PropTypes__default["default"].bool,
|
5496 | labelledBy: PropTypes__default["default"].string,
|
5497 | offcanvasTransition: FadePropTypes,
|
5498 | onClosed: PropTypes__default["default"].func,
|
5499 | onEnter: PropTypes__default["default"].func,
|
5500 | onExit: PropTypes__default["default"].func,
|
5501 | onOpened: PropTypes__default["default"].func,
|
5502 | returnFocusAfterClose: PropTypes__default["default"].bool,
|
5503 | role: PropTypes__default["default"].string,
|
5504 | scrollable: PropTypes__default["default"].bool,
|
5505 | toggle: PropTypes__default["default"].func,
|
5506 | trapFocus: PropTypes__default["default"].bool,
|
5507 | unmountOnClose: PropTypes__default["default"].bool,
|
5508 | zIndex: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string])
|
5509 | };
|
5510 | var propsToOmit = Object.keys(propTypes$k);
|
5511 | var defaultProps$k = {
|
5512 | isOpen: false,
|
5513 | autoFocus: true,
|
5514 | direction: 'start',
|
5515 | scrollable: false,
|
5516 | role: 'dialog',
|
5517 | backdrop: true,
|
5518 | keyboard: true,
|
5519 | zIndex: 1050,
|
5520 | fade: true,
|
5521 | onOpened: noop,
|
5522 | onClosed: noop,
|
5523 | offcanvasTransition: {
|
5524 | timeout: TransitionTimeouts.Offcanvas
|
5525 | },
|
5526 | backdropTransition: {
|
5527 | mountOnEnter: true,
|
5528 | timeout: TransitionTimeouts.Fade
|
5529 |
|
5530 | },
|
5531 | unmountOnClose: true,
|
5532 | returnFocusAfterClose: true,
|
5533 | container: 'body',
|
5534 | trapFocus: false
|
5535 | };
|
5536 |
|
5537 | var Offcanvas = function (_React$Component) {
|
5538 | _inheritsLoose(Offcanvas, _React$Component);
|
5539 |
|
5540 | function Offcanvas(props) {
|
5541 | var _this;
|
5542 |
|
5543 | _this = _React$Component.call(this, props) || this;
|
5544 | _this._element = null;
|
5545 | _this._originalBodyPadding = null;
|
5546 | _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_this));
|
5547 | _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_this));
|
5548 | _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_this));
|
5549 | _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_this));
|
5550 | _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_this));
|
5551 | _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_this));
|
5552 | _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
|
5553 | _this.manageFocusAfterClose = _this.manageFocusAfterClose.bind(_assertThisInitialized(_this));
|
5554 | _this.clearBackdropAnimationTimeout = _this.clearBackdropAnimationTimeout.bind(_assertThisInitialized(_this));
|
5555 | _this.trapFocus = _this.trapFocus.bind(_assertThisInitialized(_this));
|
5556 | _this.state = {
|
5557 | isOpen: false
|
5558 | };
|
5559 | return _this;
|
5560 | }
|
5561 |
|
5562 | var _proto = Offcanvas.prototype;
|
5563 |
|
5564 | _proto.componentDidMount = function componentDidMount() {
|
5565 | var _this$props = this.props,
|
5566 | isOpen = _this$props.isOpen,
|
5567 | autoFocus = _this$props.autoFocus,
|
5568 | onEnter = _this$props.onEnter;
|
5569 |
|
5570 | if (isOpen) {
|
5571 | this.init();
|
5572 | this.setState({
|
5573 | isOpen: true
|
5574 | });
|
5575 |
|
5576 | if (autoFocus) {
|
5577 | this.setFocus();
|
5578 | }
|
5579 | }
|
5580 |
|
5581 | if (onEnter) {
|
5582 | onEnter();
|
5583 | }
|
5584 |
|
5585 |
|
5586 | document.addEventListener('focus', this.trapFocus, true);
|
5587 | this._isMounted = true;
|
5588 | };
|
5589 |
|
5590 | _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
5591 | if (this.props.isOpen && !prevProps.isOpen) {
|
5592 | this.init();
|
5593 | this.setState({
|
5594 | isOpen: true
|
5595 | });
|
5596 | return;
|
5597 | }
|
5598 |
|
5599 |
|
5600 | if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {
|
5601 | this.setFocus();
|
5602 | }
|
5603 |
|
5604 | if (this._element && prevProps.zIndex !== this.props.zIndex) {
|
5605 | this._element.style.zIndex = this.props.zIndex;
|
5606 | }
|
5607 | };
|
5608 |
|
5609 | _proto.componentWillUnmount = function componentWillUnmount() {
|
5610 | this.clearBackdropAnimationTimeout();
|
5611 |
|
5612 | if (this.props.onExit) {
|
5613 | this.props.onExit();
|
5614 | }
|
5615 |
|
5616 | if (this._element) {
|
5617 | this.destroy();
|
5618 |
|
5619 | if (this.props.isOpen || this.state.isOpen) {
|
5620 | this.close();
|
5621 | }
|
5622 | }
|
5623 |
|
5624 | document.removeEventListener('focus', this.trapFocus, true);
|
5625 | this._isMounted = false;
|
5626 | };
|
5627 |
|
5628 | _proto.trapFocus = function trapFocus(ev) {
|
5629 | if (!this.props.trapFocus) {
|
5630 | return;
|
5631 | }
|
5632 |
|
5633 | if (!this._element)
|
5634 | return;
|
5635 | if (this._dialog === ev.target)
|
5636 | return;
|
5637 | if (this.offcanvasIndex < Offcanvas.openCount - 1)
|
5638 | return;
|
5639 | var children = this.getFocusableChildren();
|
5640 |
|
5641 | for (var i = 0; i < children.length; i++) {
|
5642 |
|
5643 | if (children[i] === ev.target) return;
|
5644 | }
|
5645 |
|
5646 | if (children.length > 0) {
|
5647 |
|
5648 | ev.preventDefault();
|
5649 | ev.stopPropagation();
|
5650 | children[0].focus();
|
5651 | }
|
5652 | };
|
5653 |
|
5654 | _proto.onOpened = function onOpened(node, isAppearing) {
|
5655 | this.props.onOpened();
|
5656 | (this.props.offcanvasTransition.onEntered || noop)(node, isAppearing);
|
5657 | };
|
5658 |
|
5659 | _proto.onClosed = function onClosed(node) {
|
5660 | var unmountOnClose = this.props.unmountOnClose;
|
5661 |
|
5662 | this.props.onClosed();
|
5663 | (this.props.offcanvasTransition.onExited || noop)(node);
|
5664 |
|
5665 | if (unmountOnClose) {
|
5666 | this.destroy();
|
5667 | }
|
5668 |
|
5669 | this.close();
|
5670 |
|
5671 | if (this._isMounted) {
|
5672 | this.setState({
|
5673 | isOpen: false
|
5674 | });
|
5675 | }
|
5676 | };
|
5677 |
|
5678 | _proto.setFocus = function setFocus() {
|
5679 | if (this._dialog && typeof this._dialog.focus === 'function') {
|
5680 | this._dialog.focus();
|
5681 | }
|
5682 | };
|
5683 |
|
5684 | _proto.getFocusableChildren = function getFocusableChildren() {
|
5685 | return this._element.querySelectorAll(focusableElements.join(', '));
|
5686 | };
|
5687 |
|
5688 | _proto.getFocusedChild = function getFocusedChild() {
|
5689 | var currentFocus;
|
5690 | var focusableChildren = this.getFocusableChildren();
|
5691 |
|
5692 | try {
|
5693 | currentFocus = document.activeElement;
|
5694 | } catch (err) {
|
5695 | currentFocus = focusableChildren[0];
|
5696 | }
|
5697 |
|
5698 | return currentFocus;
|
5699 | }
|
5700 | ;
|
5701 |
|
5702 | _proto.handleBackdropClick = function handleBackdropClick(e) {
|
5703 | if (e.target === this._mouseDownElement) {
|
5704 | e.stopPropagation();
|
5705 | var backdrop = this._backdrop;
|
5706 | if (!this.props.isOpen || this.props.backdrop !== true) return;
|
5707 |
|
5708 | if (backdrop && e.target === backdrop && this.props.toggle) {
|
5709 | this.props.toggle(e);
|
5710 | }
|
5711 | }
|
5712 | };
|
5713 |
|
5714 | _proto.handleTab = function handleTab(e) {
|
5715 | if (e.which !== 9) return;
|
5716 | if (this.offcanvasIndex < Offcanvas.openCount - 1) return;
|
5717 |
|
5718 | var focusableChildren = this.getFocusableChildren();
|
5719 | var totalFocusable = focusableChildren.length;
|
5720 | if (totalFocusable === 0) return;
|
5721 | var currentFocus = this.getFocusedChild();
|
5722 | var focusedIndex = 0;
|
5723 |
|
5724 | for (var i = 0; i < totalFocusable; i += 1) {
|
5725 | if (focusableChildren[i] === currentFocus) {
|
5726 | focusedIndex = i;
|
5727 | break;
|
5728 | }
|
5729 | }
|
5730 |
|
5731 | if (e.shiftKey && focusedIndex === 0) {
|
5732 | e.preventDefault();
|
5733 | focusableChildren[totalFocusable - 1].focus();
|
5734 | } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {
|
5735 | e.preventDefault();
|
5736 | focusableChildren[0].focus();
|
5737 | }
|
5738 | };
|
5739 |
|
5740 | _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {
|
5741 | this._mouseDownElement = e.target;
|
5742 | };
|
5743 |
|
5744 | _proto.handleEscape = function handleEscape(e) {
|
5745 | if (this.props.isOpen && e.keyCode === keyCodes.esc && this.props.toggle) {
|
5746 | if (this.props.keyboard) {
|
5747 | e.preventDefault();
|
5748 | e.stopPropagation();
|
5749 | this.props.toggle(e);
|
5750 | }
|
5751 | }
|
5752 | };
|
5753 |
|
5754 | _proto.init = function init() {
|
5755 | try {
|
5756 | this._triggeringElement = document.activeElement;
|
5757 | } catch (err) {
|
5758 | this._triggeringElement = null;
|
5759 | }
|
5760 |
|
5761 | if (!this._element) {
|
5762 | this._element = document.createElement('div');
|
5763 |
|
5764 | this._element.setAttribute('tabindex', '-1');
|
5765 |
|
5766 | this._element.style.position = 'relative';
|
5767 | this._element.style.zIndex = this.props.zIndex;
|
5768 | this._mountContainer = getTarget(this.props.container);
|
5769 |
|
5770 | this._mountContainer.appendChild(this._element);
|
5771 | }
|
5772 |
|
5773 | this._originalBodyPadding = getOriginalBodyPadding();
|
5774 | conditionallyUpdateScrollbar();
|
5775 |
|
5776 | if (Offcanvas.openCount === 0 && this.props.backdrop && !this.props.scrollable) {
|
5777 | document.body.style.overflow = 'hidden';
|
5778 | }
|
5779 |
|
5780 | this.offcanvasIndex = Offcanvas.openCount;
|
5781 | Offcanvas.openCount += 1;
|
5782 | };
|
5783 |
|
5784 | _proto.destroy = function destroy() {
|
5785 | if (this._element) {
|
5786 | this._mountContainer.removeChild(this._element);
|
5787 |
|
5788 | this._element = null;
|
5789 | }
|
5790 |
|
5791 | this.manageFocusAfterClose();
|
5792 | };
|
5793 |
|
5794 | _proto.manageFocusAfterClose = function manageFocusAfterClose() {
|
5795 | if (this._triggeringElement) {
|
5796 | var returnFocusAfterClose = this.props.returnFocusAfterClose;
|
5797 | if (this._triggeringElement.focus && returnFocusAfterClose) this._triggeringElement.focus();
|
5798 | this._triggeringElement = null;
|
5799 | }
|
5800 | };
|
5801 |
|
5802 | _proto.close = function close() {
|
5803 | this.manageFocusAfterClose();
|
5804 | Offcanvas.openCount = Math.max(0, Offcanvas.openCount - 1);
|
5805 | document.body.style.overflow = null;
|
5806 | setScrollbarWidth(this._originalBodyPadding);
|
5807 | };
|
5808 |
|
5809 | _proto.render = function render() {
|
5810 | var _this2 = this;
|
5811 |
|
5812 | var _this$props2 = this.props,
|
5813 | direction = _this$props2.direction,
|
5814 | unmountOnClose = _this$props2.unmountOnClose;
|
5815 |
|
5816 | if (!!this._element && (this.state.isOpen || !unmountOnClose)) {
|
5817 | var isOffcanvasHidden = !!this._element && !this.state.isOpen && !unmountOnClose;
|
5818 | this._element.style.display = isOffcanvasHidden ? 'none' : 'block';
|
5819 | var _this$props3 = this.props,
|
5820 | className = _this$props3.className,
|
5821 | backdropClassName = _this$props3.backdropClassName,
|
5822 | cssModule = _this$props3.cssModule,
|
5823 | isOpen = _this$props3.isOpen,
|
5824 | backdrop = _this$props3.backdrop,
|
5825 | role = _this$props3.role,
|
5826 | labelledBy = _this$props3.labelledBy,
|
5827 | style = _this$props3.style;
|
5828 | var offcanvasAttributes = {
|
5829 | onKeyUp: this.handleEscape,
|
5830 | onKeyDown: this.handleTab,
|
5831 | 'aria-labelledby': labelledBy,
|
5832 | role: role,
|
5833 | tabIndex: '-1'
|
5834 | };
|
5835 | var hasTransition = this.props.fade;
|
5836 |
|
5837 | var offcanvasTransition = _objectSpread2(_objectSpread2(_objectSpread2({}, Fade.defaultProps), this.props.offcanvasTransition), {}, {
|
5838 | baseClass: hasTransition ? this.props.offcanvasTransition.baseClass : '',
|
5839 | timeout: hasTransition ? this.props.offcanvasTransition.timeout : 0
|
5840 | });
|
5841 |
|
5842 | var backdropTransition = _objectSpread2(_objectSpread2(_objectSpread2({}, Fade.defaultProps), this.props.backdropTransition), {}, {
|
5843 | baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',
|
5844 | timeout: hasTransition ? this.props.backdropTransition.timeout : 0
|
5845 | });
|
5846 |
|
5847 | var Backdrop = backdrop && (hasTransition ? React__default["default"].createElement(Fade, _extends({}, backdropTransition, {
|
5848 | "in": isOpen && !!backdrop,
|
5849 | innerRef: function innerRef(c) {
|
5850 | _this2._backdrop = c;
|
5851 | },
|
5852 | cssModule: cssModule,
|
5853 | className: mapToCssModules(classNames__default["default"]('offcanvas-backdrop', backdropClassName), cssModule),
|
5854 | onClick: this.handleBackdropClick,
|
5855 | onMouseDown: this.handleBackdropMouseDown
|
5856 | })) : React__default["default"].createElement("div", {
|
5857 | className: mapToCssModules(classNames__default["default"]('offcanvas-backdrop', 'show', backdropClassName), cssModule),
|
5858 | onClick: this.handleBackdropClick,
|
5859 | onMouseDown: this.handleBackdropMouseDown
|
5860 | }));
|
5861 | var attributes = omit(this.props, propsToOmit);
|
5862 | return React__default["default"].createElement(Portal$1, {
|
5863 | node: this._element
|
5864 | }, React__default["default"].createElement(Fade, _extends({}, attributes, offcanvasAttributes, offcanvasTransition, {
|
5865 | "in": isOpen,
|
5866 | onEntered: this.onOpened,
|
5867 | onExited: this.onClosed,
|
5868 | cssModule: cssModule,
|
5869 | className: mapToCssModules(classNames__default["default"]('offcanvas', className, "offcanvas-" + direction), cssModule),
|
5870 | innerRef: function innerRef(c) {
|
5871 | _this2._dialog = c;
|
5872 | },
|
5873 | style: _objectSpread2(_objectSpread2({}, style), {}, {
|
5874 | visibility: isOpen ? 'visible' : 'hidden'
|
5875 | })
|
5876 | }), this.props.children), Backdrop);
|
5877 | }
|
5878 |
|
5879 | return null;
|
5880 | };
|
5881 |
|
5882 | _proto.clearBackdropAnimationTimeout = function clearBackdropAnimationTimeout() {
|
5883 | if (this._backdropAnimationTimeout) {
|
5884 | clearTimeout(this._backdropAnimationTimeout);
|
5885 | this._backdropAnimationTimeout = undefined;
|
5886 | }
|
5887 | };
|
5888 |
|
5889 | return Offcanvas;
|
5890 | }(React__default["default"].Component);
|
5891 |
|
5892 | Offcanvas.propTypes = propTypes$k;
|
5893 | Offcanvas.defaultProps = defaultProps$k;
|
5894 | Offcanvas.openCount = 0;
|
5895 | var Offcanvas$1 = Offcanvas;
|
5896 |
|
5897 | var _excluded$h = ["className", "cssModule", "tag"];
|
5898 | var propTypes$j = {
|
5899 | tag: tagPropType,
|
5900 | className: PropTypes__default["default"].string,
|
5901 | cssModule: PropTypes__default["default"].object
|
5902 | };
|
5903 | var defaultProps$j = {
|
5904 | tag: 'div'
|
5905 | };
|
5906 |
|
5907 | var OffcanvasBody = function OffcanvasBody(props) {
|
5908 | var className = props.className,
|
5909 | cssModule = props.cssModule,
|
5910 | Tag = props.tag,
|
5911 | attributes = _objectWithoutPropertiesLoose(props, _excluded$h);
|
5912 |
|
5913 | var classes = mapToCssModules(classNames__default["default"](className, 'offcanvas-body'), cssModule);
|
5914 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
5915 | className: classes
|
5916 | }));
|
5917 | };
|
5918 |
|
5919 | OffcanvasBody.propTypes = propTypes$j;
|
5920 | OffcanvasBody.defaultProps = defaultProps$j;
|
5921 | var OffcanvasBody$1 = OffcanvasBody;
|
5922 |
|
5923 | var _excluded$g = ["children", "className", "close", "closeAriaLabel", "cssModule", "tag", "toggle", "wrapTag"];
|
5924 | var propTypes$i = {
|
5925 | children: PropTypes__default["default"].node,
|
5926 | className: PropTypes__default["default"].string,
|
5927 | close: PropTypes__default["default"].object,
|
5928 | closeAriaLabel: PropTypes__default["default"].string,
|
5929 | cssModule: PropTypes__default["default"].object,
|
5930 | tag: tagPropType,
|
5931 | toggle: PropTypes__default["default"].func,
|
5932 | wrapTag: tagPropType
|
5933 | };
|
5934 | var defaultProps$i = {
|
5935 | closeAriaLabel: 'Close',
|
5936 | tag: 'h5',
|
5937 | wrapTag: 'div'
|
5938 | };
|
5939 |
|
5940 | var OffcanvasHeader = function OffcanvasHeader(props) {
|
5941 | var closeButton;
|
5942 |
|
5943 | var children = props.children,
|
5944 | className = props.className,
|
5945 | close = props.close,
|
5946 | closeAriaLabel = props.closeAriaLabel,
|
5947 | cssModule = props.cssModule,
|
5948 | Tag = props.tag,
|
5949 | toggle = props.toggle,
|
5950 | WrapTag = props.wrapTag,
|
5951 | attributes = _objectWithoutPropertiesLoose(props, _excluded$g);
|
5952 |
|
5953 | var classes = mapToCssModules(classNames__default["default"](className, 'offcanvas-header'), cssModule);
|
5954 |
|
5955 | if (!close && toggle) {
|
5956 | closeButton = React__default["default"].createElement("button", {
|
5957 | type: "button",
|
5958 | onClick: toggle,
|
5959 | className: mapToCssModules('btn-close', cssModule),
|
5960 | "aria-label": closeAriaLabel
|
5961 | });
|
5962 | }
|
5963 |
|
5964 | return React__default["default"].createElement(WrapTag, _extends({}, attributes, {
|
5965 | className: classes
|
5966 | }), React__default["default"].createElement(Tag, {
|
5967 | className: mapToCssModules('offcanvas-title', cssModule)
|
5968 | }, children), close || closeButton);
|
5969 | };
|
5970 |
|
5971 | OffcanvasHeader.propTypes = propTypes$i;
|
5972 | OffcanvasHeader.defaultProps = defaultProps$i;
|
5973 | var OffcanvasHeader$1 = OffcanvasHeader;
|
5974 |
|
5975 | var _excluded$f = ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"];
|
5976 | var propTypes$h = {
|
5977 | children: PropTypes__default["default"].node,
|
5978 | className: PropTypes__default["default"].string,
|
5979 | listClassName: PropTypes__default["default"].string,
|
5980 | cssModule: PropTypes__default["default"].object,
|
5981 | size: PropTypes__default["default"].string,
|
5982 | tag: tagPropType,
|
5983 | listTag: tagPropType,
|
5984 | 'aria-label': PropTypes__default["default"].string
|
5985 | };
|
5986 | var defaultProps$h = {
|
5987 | tag: 'nav',
|
5988 | listTag: 'ul',
|
5989 | 'aria-label': 'pagination'
|
5990 | };
|
5991 |
|
5992 | var Pagination = function Pagination(props) {
|
5993 | var _classNames;
|
5994 |
|
5995 | var className = props.className,
|
5996 | listClassName = props.listClassName,
|
5997 | cssModule = props.cssModule,
|
5998 | size = props.size,
|
5999 | Tag = props.tag,
|
6000 | ListTag = props.listTag,
|
6001 | label = props['aria-label'],
|
6002 | attributes = _objectWithoutPropertiesLoose(props, _excluded$f);
|
6003 |
|
6004 | var classes = mapToCssModules(classNames__default["default"](className), cssModule);
|
6005 | var listClasses = mapToCssModules(classNames__default["default"](listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
|
6006 | return React__default["default"].createElement(Tag, {
|
6007 | className: classes,
|
6008 | "aria-label": label
|
6009 | }, React__default["default"].createElement(ListTag, _extends({}, attributes, {
|
6010 | className: listClasses
|
6011 | })));
|
6012 | };
|
6013 |
|
6014 | Pagination.propTypes = propTypes$h;
|
6015 | Pagination.defaultProps = defaultProps$h;
|
6016 | var Pagination$1 = Pagination;
|
6017 |
|
6018 | var _excluded$e = ["active", "className", "cssModule", "disabled", "tag"];
|
6019 | var propTypes$g = {
|
6020 | active: PropTypes__default["default"].bool,
|
6021 | children: PropTypes__default["default"].node,
|
6022 | className: PropTypes__default["default"].string,
|
6023 | cssModule: PropTypes__default["default"].object,
|
6024 | disabled: PropTypes__default["default"].bool,
|
6025 | tag: tagPropType
|
6026 | };
|
6027 | var defaultProps$g = {
|
6028 | tag: 'li'
|
6029 | };
|
6030 |
|
6031 | var PaginationItem = function PaginationItem(props) {
|
6032 | var active = props.active,
|
6033 | className = props.className,
|
6034 | cssModule = props.cssModule,
|
6035 | disabled = props.disabled,
|
6036 | Tag = props.tag,
|
6037 | attributes = _objectWithoutPropertiesLoose(props, _excluded$e);
|
6038 |
|
6039 | var classes = mapToCssModules(classNames__default["default"](className, 'page-item', {
|
6040 | active: active,
|
6041 | disabled: disabled
|
6042 | }), cssModule);
|
6043 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6044 | className: classes
|
6045 | }));
|
6046 | };
|
6047 |
|
6048 | PaginationItem.propTypes = propTypes$g;
|
6049 | PaginationItem.defaultProps = defaultProps$g;
|
6050 | var PaginationItem$1 = PaginationItem;
|
6051 |
|
6052 | var _excluded$d = ["className", "cssModule", "next", "previous", "first", "last", "tag"];
|
6053 | var propTypes$f = {
|
6054 | 'aria-label': PropTypes__default["default"].string,
|
6055 | children: PropTypes__default["default"].node,
|
6056 | className: PropTypes__default["default"].string,
|
6057 | cssModule: PropTypes__default["default"].object,
|
6058 | next: PropTypes__default["default"].bool,
|
6059 | previous: PropTypes__default["default"].bool,
|
6060 | first: PropTypes__default["default"].bool,
|
6061 | last: PropTypes__default["default"].bool,
|
6062 | tag: tagPropType
|
6063 | };
|
6064 | var defaultProps$f = {
|
6065 | tag: 'a'
|
6066 | };
|
6067 |
|
6068 | var PaginationLink = function PaginationLink(props) {
|
6069 | var className = props.className,
|
6070 | cssModule = props.cssModule,
|
6071 | next = props.next,
|
6072 | previous = props.previous,
|
6073 | first = props.first,
|
6074 | last = props.last,
|
6075 | Tag = props.tag,
|
6076 | attributes = _objectWithoutPropertiesLoose(props, _excluded$d);
|
6077 |
|
6078 | var classes = mapToCssModules(classNames__default["default"](className, 'page-link'), cssModule);
|
6079 | var defaultAriaLabel;
|
6080 |
|
6081 | if (previous) {
|
6082 | defaultAriaLabel = 'Previous';
|
6083 | } else if (next) {
|
6084 | defaultAriaLabel = 'Next';
|
6085 | } else if (first) {
|
6086 | defaultAriaLabel = 'First';
|
6087 | } else if (last) {
|
6088 | defaultAriaLabel = 'Last';
|
6089 | }
|
6090 |
|
6091 | var ariaLabel = props['aria-label'] || defaultAriaLabel;
|
6092 | var defaultCaret;
|
6093 |
|
6094 | if (previous) {
|
6095 | defaultCaret = "\u2039";
|
6096 | } else if (next) {
|
6097 | defaultCaret = "\u203A";
|
6098 | } else if (first) {
|
6099 | defaultCaret = "\xAB";
|
6100 | } else if (last) {
|
6101 | defaultCaret = "\xBB";
|
6102 | }
|
6103 |
|
6104 | var children = props.children;
|
6105 |
|
6106 | if (children && Array.isArray(children) && children.length === 0) {
|
6107 | children = null;
|
6108 | }
|
6109 |
|
6110 | if (!attributes.href && Tag === 'a') {
|
6111 | Tag = 'button';
|
6112 | }
|
6113 |
|
6114 | if (previous || next || first || last) {
|
6115 | children = [React__default["default"].createElement("span", {
|
6116 | "aria-hidden": "true",
|
6117 | key: "caret"
|
6118 | }, children || defaultCaret), React__default["default"].createElement("span", {
|
6119 | className: "visually-hidden",
|
6120 | key: "ariaLabel"
|
6121 | }, ariaLabel)];
|
6122 | }
|
6123 |
|
6124 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6125 | className: classes,
|
6126 | "aria-label": ariaLabel
|
6127 | }), children);
|
6128 | };
|
6129 |
|
6130 | PaginationLink.propTypes = propTypes$f;
|
6131 | PaginationLink.defaultProps = defaultProps$f;
|
6132 | var PaginationLink$1 = PaginationLink;
|
6133 |
|
6134 | |
6135 |
|
6136 |
|
6137 |
|
6138 |
|
6139 |
|
6140 |
|
6141 | var TabContext = React__default["default"].createContext({});
|
6142 |
|
6143 | var propTypes$e = {
|
6144 | tag: tagPropType,
|
6145 | activeTab: PropTypes__default["default"].any,
|
6146 | className: PropTypes__default["default"].string,
|
6147 | cssModule: PropTypes__default["default"].object
|
6148 | };
|
6149 | var defaultProps$e = {
|
6150 | tag: 'div'
|
6151 | };
|
6152 |
|
6153 | var TabContent = function (_Component) {
|
6154 | _inheritsLoose(TabContent, _Component);
|
6155 |
|
6156 | TabContent.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
|
6157 | if (prevState.activeTab !== nextProps.activeTab) {
|
6158 | return {
|
6159 | activeTab: nextProps.activeTab
|
6160 | };
|
6161 | }
|
6162 |
|
6163 | return null;
|
6164 | };
|
6165 |
|
6166 | function TabContent(props) {
|
6167 | var _this;
|
6168 |
|
6169 | _this = _Component.call(this, props) || this;
|
6170 | _this.state = {
|
6171 | activeTab: _this.props.activeTab
|
6172 | };
|
6173 | return _this;
|
6174 | }
|
6175 |
|
6176 | var _proto = TabContent.prototype;
|
6177 |
|
6178 | _proto.render = function render() {
|
6179 | var _this$props = this.props,
|
6180 | className = _this$props.className,
|
6181 | cssModule = _this$props.cssModule,
|
6182 | Tag = _this$props.tag;
|
6183 | var attributes = omit(this.props, Object.keys(propTypes$e));
|
6184 | var classes = mapToCssModules(classNames__default["default"]('tab-content', className), cssModule);
|
6185 | return React__default["default"].createElement(TabContext.Provider, {
|
6186 | value: {
|
6187 | activeTabId: this.state.activeTab
|
6188 | }
|
6189 | }, React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6190 | className: classes
|
6191 | })));
|
6192 | };
|
6193 |
|
6194 | return TabContent;
|
6195 | }(React.Component);
|
6196 |
|
6197 | var TabContent$1 = TabContent;
|
6198 | TabContent.propTypes = propTypes$e;
|
6199 | TabContent.defaultProps = defaultProps$e;
|
6200 |
|
6201 | var _excluded$c = ["className", "cssModule", "tabId", "tag"];
|
6202 | var propTypes$d = {
|
6203 | tag: tagPropType,
|
6204 | className: PropTypes__default["default"].string,
|
6205 | cssModule: PropTypes__default["default"].object,
|
6206 | tabId: PropTypes__default["default"].any
|
6207 | };
|
6208 | var defaultProps$d = {
|
6209 | tag: 'div'
|
6210 | };
|
6211 | function TabPane(props) {
|
6212 | var className = props.className,
|
6213 | cssModule = props.cssModule,
|
6214 | tabId = props.tabId,
|
6215 | Tag = props.tag,
|
6216 | attributes = _objectWithoutPropertiesLoose(props, _excluded$c);
|
6217 |
|
6218 | var getClasses = function getClasses(activeTabId) {
|
6219 | return mapToCssModules(classNames__default["default"]('tab-pane', className, {
|
6220 | active: tabId === activeTabId
|
6221 | }), cssModule);
|
6222 | };
|
6223 |
|
6224 | return React__default["default"].createElement(TabContext.Consumer, null, function (_ref) {
|
6225 | var activeTabId = _ref.activeTabId;
|
6226 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6227 | className: getClasses(activeTabId)
|
6228 | }));
|
6229 | });
|
6230 | }
|
6231 | TabPane.propTypes = propTypes$d;
|
6232 | TabPane.defaultProps = defaultProps$d;
|
6233 |
|
6234 | var _excluded$b = ["className", "closeClassName", "closeAriaLabel", "cssModule", "tag", "color", "isOpen", "toggle", "children", "transition", "fade", "innerRef"];
|
6235 | var propTypes$c = {
|
6236 | children: PropTypes__default["default"].node,
|
6237 | className: PropTypes__default["default"].string,
|
6238 | closeClassName: PropTypes__default["default"].string,
|
6239 | closeAriaLabel: PropTypes__default["default"].string,
|
6240 | cssModule: PropTypes__default["default"].object,
|
6241 | color: PropTypes__default["default"].string,
|
6242 | fade: PropTypes__default["default"].bool,
|
6243 | isOpen: PropTypes__default["default"].bool,
|
6244 | toggle: PropTypes__default["default"].func,
|
6245 | tag: tagPropType,
|
6246 | transition: PropTypes__default["default"].shape(Fade.propTypes),
|
6247 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func])
|
6248 | };
|
6249 | var defaultProps$c = {
|
6250 | color: 'success',
|
6251 | isOpen: true,
|
6252 | tag: 'div',
|
6253 | closeAriaLabel: 'Close',
|
6254 | fade: true,
|
6255 | transition: _objectSpread2(_objectSpread2({}, Fade.defaultProps), {}, {
|
6256 | unmountOnExit: true
|
6257 | })
|
6258 | };
|
6259 |
|
6260 | function Alert(props) {
|
6261 | var className = props.className,
|
6262 | closeClassName = props.closeClassName,
|
6263 | closeAriaLabel = props.closeAriaLabel,
|
6264 | cssModule = props.cssModule,
|
6265 | Tag = props.tag,
|
6266 | color = props.color,
|
6267 | isOpen = props.isOpen,
|
6268 | toggle = props.toggle,
|
6269 | children = props.children,
|
6270 | transition = props.transition,
|
6271 | fade = props.fade,
|
6272 | innerRef = props.innerRef,
|
6273 | attributes = _objectWithoutPropertiesLoose(props, _excluded$b);
|
6274 |
|
6275 | var classes = mapToCssModules(classNames__default["default"](className, 'alert', "alert-" + color, {
|
6276 | 'alert-dismissible': toggle
|
6277 | }), cssModule);
|
6278 | var closeClasses = mapToCssModules(classNames__default["default"]('btn-close', closeClassName), cssModule);
|
6279 |
|
6280 | var alertTransition = _objectSpread2(_objectSpread2(_objectSpread2({}, Fade.defaultProps), transition), {}, {
|
6281 | baseClass: fade ? transition.baseClass : '',
|
6282 | timeout: fade ? transition.timeout : 0
|
6283 | });
|
6284 |
|
6285 | return React__default["default"].createElement(Fade, _extends({}, attributes, alertTransition, {
|
6286 | tag: Tag,
|
6287 | className: classes,
|
6288 | "in": isOpen,
|
6289 | role: "alert",
|
6290 | innerRef: innerRef
|
6291 | }), toggle ? React__default["default"].createElement("button", {
|
6292 | type: "button",
|
6293 | className: closeClasses,
|
6294 | "aria-label": closeAriaLabel,
|
6295 | onClick: toggle
|
6296 | }) : null, children);
|
6297 | }
|
6298 |
|
6299 | Alert.propTypes = propTypes$c;
|
6300 | Alert.defaultProps = defaultProps$c;
|
6301 |
|
6302 | var _excluded$a = ["className", "cssModule", "tag", "isOpen", "children", "transition", "fade", "innerRef"];
|
6303 | var propTypes$b = {
|
6304 | children: PropTypes__default["default"].node,
|
6305 | className: PropTypes__default["default"].string,
|
6306 | cssModule: PropTypes__default["default"].object,
|
6307 | fade: PropTypes__default["default"].bool,
|
6308 | isOpen: PropTypes__default["default"].bool,
|
6309 | tag: tagPropType,
|
6310 | transition: PropTypes__default["default"].shape(Fade.propTypes),
|
6311 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func])
|
6312 | };
|
6313 | var defaultProps$b = {
|
6314 | isOpen: true,
|
6315 | tag: 'div',
|
6316 | fade: true,
|
6317 | transition: _objectSpread2(_objectSpread2({}, Fade.defaultProps), {}, {
|
6318 | unmountOnExit: true
|
6319 | })
|
6320 | };
|
6321 |
|
6322 | function Toast(props) {
|
6323 | var className = props.className,
|
6324 | cssModule = props.cssModule,
|
6325 | Tag = props.tag,
|
6326 | isOpen = props.isOpen,
|
6327 | children = props.children,
|
6328 | transition = props.transition,
|
6329 | fade = props.fade,
|
6330 | innerRef = props.innerRef,
|
6331 | attributes = _objectWithoutPropertiesLoose(props, _excluded$a);
|
6332 |
|
6333 | var classes = mapToCssModules(classNames__default["default"](className, 'toast'), cssModule);
|
6334 |
|
6335 | var toastTransition = _objectSpread2(_objectSpread2(_objectSpread2({}, Fade.defaultProps), transition), {}, {
|
6336 | baseClass: fade ? transition.baseClass : '',
|
6337 | timeout: fade ? transition.timeout : 0
|
6338 | });
|
6339 |
|
6340 | return React__default["default"].createElement(Fade, _extends({}, attributes, toastTransition, {
|
6341 | tag: Tag,
|
6342 | className: classes,
|
6343 | "in": isOpen,
|
6344 | role: "alert",
|
6345 | innerRef: innerRef
|
6346 | }), children);
|
6347 | }
|
6348 |
|
6349 | Toast.propTypes = propTypes$b;
|
6350 | Toast.defaultProps = defaultProps$b;
|
6351 |
|
6352 | var _excluded$9 = ["className", "cssModule", "innerRef", "tag"];
|
6353 | var propTypes$a = {
|
6354 | tag: tagPropType,
|
6355 | className: PropTypes__default["default"].string,
|
6356 | cssModule: PropTypes__default["default"].object,
|
6357 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].func])
|
6358 | };
|
6359 | var defaultProps$a = {
|
6360 | tag: 'div'
|
6361 | };
|
6362 |
|
6363 | var ToastBody = function ToastBody(props) {
|
6364 | var className = props.className,
|
6365 | cssModule = props.cssModule,
|
6366 | innerRef = props.innerRef,
|
6367 | Tag = props.tag,
|
6368 | attributes = _objectWithoutPropertiesLoose(props, _excluded$9);
|
6369 |
|
6370 | var classes = mapToCssModules(classNames__default["default"](className, 'toast-body'), cssModule);
|
6371 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6372 | className: classes,
|
6373 | ref: innerRef
|
6374 | }));
|
6375 | };
|
6376 |
|
6377 | ToastBody.propTypes = propTypes$a;
|
6378 | ToastBody.defaultProps = defaultProps$a;
|
6379 | var ToastBody$1 = ToastBody;
|
6380 |
|
6381 | var _excluded$8 = ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "close", "tagClassName", "icon"];
|
6382 | var propTypes$9 = {
|
6383 | tag: tagPropType,
|
6384 | icon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].node]),
|
6385 | wrapTag: tagPropType,
|
6386 | toggle: PropTypes__default["default"].func,
|
6387 | className: PropTypes__default["default"].string,
|
6388 | cssModule: PropTypes__default["default"].object,
|
6389 | children: PropTypes__default["default"].node,
|
6390 | closeAriaLabel: PropTypes__default["default"].string,
|
6391 | charCode: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
6392 | close: PropTypes__default["default"].object
|
6393 | };
|
6394 | var defaultProps$9 = {
|
6395 | tag: 'strong',
|
6396 | wrapTag: 'div',
|
6397 | tagClassName: 'me-auto',
|
6398 | closeAriaLabel: 'Close'
|
6399 | };
|
6400 |
|
6401 | var ToastHeader = function ToastHeader(props) {
|
6402 | var closeButton;
|
6403 | var icon;
|
6404 |
|
6405 | var className = props.className,
|
6406 | cssModule = props.cssModule,
|
6407 | children = props.children,
|
6408 | toggle = props.toggle,
|
6409 | Tag = props.tag,
|
6410 | WrapTag = props.wrapTag,
|
6411 | closeAriaLabel = props.closeAriaLabel,
|
6412 | close = props.close,
|
6413 | tagClassName = props.tagClassName,
|
6414 | iconProp = props.icon,
|
6415 | attributes = _objectWithoutPropertiesLoose(props, _excluded$8);
|
6416 |
|
6417 | var classes = mapToCssModules(classNames__default["default"](className, 'toast-header'), cssModule);
|
6418 |
|
6419 | if (!close && toggle) {
|
6420 | closeButton = React__default["default"].createElement("button", {
|
6421 | type: "button",
|
6422 | onClick: toggle,
|
6423 | className: mapToCssModules('btn-close', cssModule),
|
6424 | "aria-label": closeAriaLabel
|
6425 | });
|
6426 | }
|
6427 |
|
6428 | if (typeof iconProp === "string") {
|
6429 | icon = React__default["default"].createElement("svg", {
|
6430 | className: mapToCssModules("rounded text-" + iconProp),
|
6431 | width: "20",
|
6432 | height: "20",
|
6433 | xmlns: "http://www.w3.org/2000/svg",
|
6434 | preserveAspectRatio: "xMidYMid slice",
|
6435 | focusable: "false",
|
6436 | role: "img"
|
6437 | }, React__default["default"].createElement("rect", {
|
6438 | fill: "currentColor",
|
6439 | width: "100%",
|
6440 | height: "100%"
|
6441 | }));
|
6442 | } else if (iconProp) {
|
6443 | icon = iconProp;
|
6444 | }
|
6445 |
|
6446 | return React__default["default"].createElement(WrapTag, _extends({}, attributes, {
|
6447 | className: classes
|
6448 | }), icon, React__default["default"].createElement(Tag, {
|
6449 | className: mapToCssModules(classNames__default["default"](tagClassName, {
|
6450 | "ms-2": icon != null
|
6451 | }), cssModule)
|
6452 | }, children), close || closeButton);
|
6453 | };
|
6454 |
|
6455 | ToastHeader.propTypes = propTypes$9;
|
6456 | ToastHeader.defaultProps = defaultProps$9;
|
6457 | var ToastHeader$1 = ToastHeader;
|
6458 |
|
6459 | var _excluded$7 = ["className", "cssModule", "tag", "active", "disabled", "action", "color"];
|
6460 | var propTypes$8 = {
|
6461 | tag: tagPropType,
|
6462 | active: PropTypes__default["default"].bool,
|
6463 | disabled: PropTypes__default["default"].bool,
|
6464 | color: PropTypes__default["default"].string,
|
6465 | action: PropTypes__default["default"].bool,
|
6466 | className: PropTypes__default["default"].any,
|
6467 | cssModule: PropTypes__default["default"].object
|
6468 | };
|
6469 | var defaultProps$8 = {
|
6470 | tag: 'li'
|
6471 | };
|
6472 |
|
6473 | var handleDisabledOnClick = function handleDisabledOnClick(e) {
|
6474 | e.preventDefault();
|
6475 | };
|
6476 |
|
6477 | var ListGroupItem = function ListGroupItem(props) {
|
6478 | var className = props.className,
|
6479 | cssModule = props.cssModule,
|
6480 | Tag = props.tag,
|
6481 | active = props.active,
|
6482 | disabled = props.disabled,
|
6483 | action = props.action,
|
6484 | color = props.color,
|
6485 | attributes = _objectWithoutPropertiesLoose(props, _excluded$7);
|
6486 |
|
6487 | var classes = mapToCssModules(classNames__default["default"](className, active ? 'active' : false, disabled ? 'disabled' : false, action ? 'list-group-item-action' : false, color ? "list-group-item-" + color : false, 'list-group-item'), cssModule);
|
6488 |
|
6489 | if (disabled) {
|
6490 | attributes.onClick = handleDisabledOnClick;
|
6491 | }
|
6492 |
|
6493 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6494 | className: classes
|
6495 | }));
|
6496 | };
|
6497 |
|
6498 | ListGroupItem.propTypes = propTypes$8;
|
6499 | ListGroupItem.defaultProps = defaultProps$8;
|
6500 | var ListGroupItem$1 = ListGroupItem;
|
6501 |
|
6502 | var _excluded$6 = ["className", "cssModule", "tag"];
|
6503 | var propTypes$7 = {
|
6504 | tag: tagPropType,
|
6505 | className: PropTypes__default["default"].any,
|
6506 | cssModule: PropTypes__default["default"].object
|
6507 | };
|
6508 | var defaultProps$7 = {
|
6509 | tag: 'h5'
|
6510 | };
|
6511 |
|
6512 | var ListGroupItemHeading = function ListGroupItemHeading(props) {
|
6513 | var className = props.className,
|
6514 | cssModule = props.cssModule,
|
6515 | Tag = props.tag,
|
6516 | attributes = _objectWithoutPropertiesLoose(props, _excluded$6);
|
6517 |
|
6518 | var classes = mapToCssModules(classNames__default["default"](className, 'list-group-item-heading'), cssModule);
|
6519 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6520 | className: classes
|
6521 | }));
|
6522 | };
|
6523 |
|
6524 | ListGroupItemHeading.propTypes = propTypes$7;
|
6525 | ListGroupItemHeading.defaultProps = defaultProps$7;
|
6526 | var ListGroupItemHeading$1 = ListGroupItemHeading;
|
6527 |
|
6528 | var _excluded$5 = ["className", "cssModule", "tag"];
|
6529 | var propTypes$6 = {
|
6530 | tag: tagPropType,
|
6531 | className: PropTypes__default["default"].any,
|
6532 | cssModule: PropTypes__default["default"].object
|
6533 | };
|
6534 | var defaultProps$6 = {
|
6535 | tag: 'p'
|
6536 | };
|
6537 |
|
6538 | var ListGroupItemText = function ListGroupItemText(props) {
|
6539 | var className = props.className,
|
6540 | cssModule = props.cssModule,
|
6541 | Tag = props.tag,
|
6542 | attributes = _objectWithoutPropertiesLoose(props, _excluded$5);
|
6543 |
|
6544 | var classes = mapToCssModules(classNames__default["default"](className, 'list-group-item-text'), cssModule);
|
6545 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6546 | className: classes
|
6547 | }));
|
6548 | };
|
6549 |
|
6550 | ListGroupItemText.propTypes = propTypes$6;
|
6551 | ListGroupItemText.defaultProps = defaultProps$6;
|
6552 | var ListGroupItemText$1 = ListGroupItemText;
|
6553 |
|
6554 | var _excluded$4 = ["className", "cssModule", "tag", "type"];
|
6555 | var propTypes$5 = {
|
6556 | tag: tagPropType,
|
6557 | className: PropTypes__default["default"].string,
|
6558 | cssModule: PropTypes__default["default"].object,
|
6559 | type: PropTypes__default["default"].string
|
6560 | };
|
6561 | var defaultProps$5 = {
|
6562 | tag: 'ul'
|
6563 | };
|
6564 | var List = React.forwardRef(function (props, ref) {
|
6565 | var className = props.className,
|
6566 | cssModule = props.cssModule,
|
6567 | Tag = props.tag,
|
6568 | type = props.type,
|
6569 | attributes = _objectWithoutPropertiesLoose(props, _excluded$4);
|
6570 |
|
6571 | var classes = mapToCssModules(classNames__default["default"](className, type ? "list-" + type : false), cssModule);
|
6572 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6573 | className: classes,
|
6574 | ref: ref
|
6575 | }));
|
6576 | });
|
6577 | List.name = 'List';
|
6578 | List.propTypes = propTypes$5;
|
6579 | List.defaultProps = defaultProps$5;
|
6580 | var List$1 = List;
|
6581 |
|
6582 | var _excluded$3 = ["className", "cssModule", "tag"];
|
6583 | var propTypes$4 = {
|
6584 | tag: tagPropType,
|
6585 | className: PropTypes__default["default"].string,
|
6586 | cssModule: PropTypes__default["default"].object
|
6587 | };
|
6588 | var defaultProps$4 = {
|
6589 | tag: 'li'
|
6590 | };
|
6591 | var ListInlineItem = React.forwardRef(function (props, ref) {
|
6592 | var className = props.className,
|
6593 | cssModule = props.cssModule,
|
6594 | Tag = props.tag,
|
6595 | attributes = _objectWithoutPropertiesLoose(props, _excluded$3);
|
6596 |
|
6597 | var classes = mapToCssModules(classNames__default["default"](className, 'list-inline-item'), cssModule);
|
6598 | return React__default["default"].createElement(Tag, _extends({}, attributes, {
|
6599 | className: classes,
|
6600 | ref: ref
|
6601 | }));
|
6602 | });
|
6603 | ListInlineItem.name = 'ListInlineItem';
|
6604 | ListInlineItem.propTypes = propTypes$4;
|
6605 | ListInlineItem.defaultProps = defaultProps$4;
|
6606 | var ListInlineItem$1 = ListInlineItem;
|
6607 |
|
6608 | var UncontrolledAlert = function (_Component) {
|
6609 | _inheritsLoose(UncontrolledAlert, _Component);
|
6610 |
|
6611 | function UncontrolledAlert(props) {
|
6612 | var _this;
|
6613 |
|
6614 | _this = _Component.call(this, props) || this;
|
6615 | _this.state = {
|
6616 | isOpen: true
|
6617 | };
|
6618 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
6619 | return _this;
|
6620 | }
|
6621 |
|
6622 | var _proto = UncontrolledAlert.prototype;
|
6623 |
|
6624 | _proto.toggle = function toggle() {
|
6625 | this.setState({
|
6626 | isOpen: !this.state.isOpen
|
6627 | });
|
6628 | };
|
6629 |
|
6630 | _proto.render = function render() {
|
6631 | return React__default["default"].createElement(Alert, _extends({
|
6632 | isOpen: this.state.isOpen,
|
6633 | toggle: this.toggle
|
6634 | }, this.props));
|
6635 | };
|
6636 |
|
6637 | return UncontrolledAlert;
|
6638 | }(React.Component);
|
6639 |
|
6640 | var UncontrolledAlert$1 = UncontrolledAlert;
|
6641 |
|
6642 | var omitKeys$3 = ['defaultOpen'];
|
6643 |
|
6644 | var UncontrolledButtonDropdown = function (_Component) {
|
6645 | _inheritsLoose(UncontrolledButtonDropdown, _Component);
|
6646 |
|
6647 | function UncontrolledButtonDropdown(props) {
|
6648 | var _this;
|
6649 |
|
6650 | _this = _Component.call(this, props) || this;
|
6651 | _this.state = {
|
6652 | isOpen: props.defaultOpen || false
|
6653 | };
|
6654 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
6655 | return _this;
|
6656 | }
|
6657 |
|
6658 | var _proto = UncontrolledButtonDropdown.prototype;
|
6659 |
|
6660 | _proto.toggle = function toggle() {
|
6661 | this.setState({
|
6662 | isOpen: !this.state.isOpen
|
6663 | });
|
6664 | };
|
6665 |
|
6666 | _proto.render = function render() {
|
6667 | return React__default["default"].createElement(ButtonDropdown$1, _extends({
|
6668 | isOpen: this.state.isOpen,
|
6669 | toggle: this.toggle
|
6670 | }, omit(this.props, omitKeys$3)));
|
6671 | };
|
6672 |
|
6673 | return UncontrolledButtonDropdown;
|
6674 | }(React.Component);
|
6675 | UncontrolledButtonDropdown.propTypes = _objectSpread2({
|
6676 | defaultOpen: PropTypes__default["default"].bool
|
6677 | }, ButtonDropdown$1.propTypes);
|
6678 |
|
6679 | var omitKeys$2 = ['toggleEvents', 'defaultOpen'];
|
6680 | var propTypes$3 = {
|
6681 | defaultOpen: PropTypes__default["default"].bool,
|
6682 | toggler: PropTypes__default["default"].string.isRequired,
|
6683 | toggleEvents: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
|
6684 | };
|
6685 | var defaultProps$3 = {
|
6686 | toggleEvents: defaultToggleEvents
|
6687 | };
|
6688 |
|
6689 | var UncontrolledCollapse = function (_Component) {
|
6690 | _inheritsLoose(UncontrolledCollapse, _Component);
|
6691 |
|
6692 | function UncontrolledCollapse(props) {
|
6693 | var _this;
|
6694 |
|
6695 | _this = _Component.call(this, props) || this;
|
6696 | _this.togglers = null;
|
6697 | _this.removeEventListeners = null;
|
6698 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
6699 | _this.state = {
|
6700 | isOpen: props.defaultOpen || false
|
6701 | };
|
6702 | return _this;
|
6703 | }
|
6704 |
|
6705 | var _proto = UncontrolledCollapse.prototype;
|
6706 |
|
6707 | _proto.componentDidMount = function componentDidMount() {
|
6708 | this.togglers = findDOMElements(this.props.toggler);
|
6709 |
|
6710 | if (this.togglers.length) {
|
6711 | this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);
|
6712 | }
|
6713 | };
|
6714 |
|
6715 | _proto.componentWillUnmount = function componentWillUnmount() {
|
6716 | if (this.togglers.length && this.removeEventListeners) {
|
6717 | this.removeEventListeners();
|
6718 | }
|
6719 | };
|
6720 |
|
6721 | _proto.toggle = function toggle(e) {
|
6722 | this.setState(function (_ref) {
|
6723 | var isOpen = _ref.isOpen;
|
6724 | return {
|
6725 | isOpen: !isOpen
|
6726 | };
|
6727 | });
|
6728 | e.preventDefault();
|
6729 | };
|
6730 |
|
6731 | _proto.render = function render() {
|
6732 | return React__default["default"].createElement(Collapse$1, _extends({
|
6733 | isOpen: this.state.isOpen
|
6734 | }, omit(this.props, omitKeys$2)));
|
6735 | };
|
6736 |
|
6737 | return UncontrolledCollapse;
|
6738 | }(React.Component);
|
6739 |
|
6740 | UncontrolledCollapse.propTypes = propTypes$3;
|
6741 | UncontrolledCollapse.defaultProps = defaultProps$3;
|
6742 | var UncontrolledCollapse$1 = UncontrolledCollapse;
|
6743 |
|
6744 | var omitKeys$1 = ['defaultOpen'];
|
6745 |
|
6746 | var UncontrolledDropdown = function (_Component) {
|
6747 | _inheritsLoose(UncontrolledDropdown, _Component);
|
6748 |
|
6749 | function UncontrolledDropdown(props) {
|
6750 | var _this;
|
6751 |
|
6752 | _this = _Component.call(this, props) || this;
|
6753 | _this.state = {
|
6754 | isOpen: props.defaultOpen || false
|
6755 | };
|
6756 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
6757 | return _this;
|
6758 | }
|
6759 |
|
6760 | var _proto = UncontrolledDropdown.prototype;
|
6761 |
|
6762 | _proto.toggle = function toggle(e) {
|
6763 | var _this2 = this;
|
6764 |
|
6765 | var isOpen = !this.state.isOpen;
|
6766 | this.setState({
|
6767 | isOpen: isOpen
|
6768 | }, function () {
|
6769 | if (_this2.props.onToggle) {
|
6770 | _this2.props.onToggle(e, isOpen);
|
6771 | }
|
6772 | });
|
6773 | };
|
6774 |
|
6775 | _proto.render = function render() {
|
6776 | return React__default["default"].createElement(Dropdown$1, _extends({
|
6777 | isOpen: this.state.isOpen,
|
6778 | toggle: this.toggle
|
6779 | }, omit(this.props, omitKeys$1)));
|
6780 | };
|
6781 |
|
6782 | return UncontrolledDropdown;
|
6783 | }(React.Component);
|
6784 | UncontrolledDropdown.propTypes = _objectSpread2({
|
6785 | defaultOpen: PropTypes__default["default"].bool,
|
6786 | onToggle: PropTypes__default["default"].func
|
6787 | }, Dropdown$1.propTypes);
|
6788 |
|
6789 | var omitKeys = ['defaultOpen'];
|
6790 |
|
6791 | var UncontrolledTooltip = function (_Component) {
|
6792 | _inheritsLoose(UncontrolledTooltip, _Component);
|
6793 |
|
6794 | function UncontrolledTooltip(props) {
|
6795 | var _this;
|
6796 |
|
6797 | _this = _Component.call(this, props) || this;
|
6798 | _this.state = {
|
6799 | isOpen: props.defaultOpen || false
|
6800 | };
|
6801 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
6802 | return _this;
|
6803 | }
|
6804 |
|
6805 | var _proto = UncontrolledTooltip.prototype;
|
6806 |
|
6807 | _proto.toggle = function toggle() {
|
6808 | this.setState({
|
6809 | isOpen: !this.state.isOpen
|
6810 | });
|
6811 | };
|
6812 |
|
6813 | _proto.render = function render() {
|
6814 | return React__default["default"].createElement(Tooltip$1, _extends({
|
6815 | isOpen: this.state.isOpen,
|
6816 | toggle: this.toggle
|
6817 | }, omit(this.props, omitKeys)));
|
6818 | };
|
6819 |
|
6820 | return UncontrolledTooltip;
|
6821 | }(React.Component);
|
6822 | UncontrolledTooltip.propTypes = _objectSpread2({
|
6823 | defaultOpen: PropTypes__default["default"].bool
|
6824 | }, Tooltip$1.propTypes);
|
6825 |
|
6826 | var _excluded$2 = ["className", "cssModule", "type", "size", "color", "children", "tag"];
|
6827 | var propTypes$2 = {
|
6828 | tag: tagPropType,
|
6829 | type: PropTypes__default["default"].string,
|
6830 | size: PropTypes__default["default"].string,
|
6831 | color: PropTypes__default["default"].string,
|
6832 | className: PropTypes__default["default"].string,
|
6833 | cssModule: PropTypes__default["default"].object,
|
6834 | children: PropTypes__default["default"].string
|
6835 | };
|
6836 | var defaultProps$2 = {
|
6837 | tag: 'div',
|
6838 | type: 'border',
|
6839 | children: 'Loading...'
|
6840 | };
|
6841 |
|
6842 | var Spinner = function Spinner(props) {
|
6843 | var className = props.className,
|
6844 | cssModule = props.cssModule,
|
6845 | type = props.type,
|
6846 | size = props.size,
|
6847 | color = props.color,
|
6848 | children = props.children,
|
6849 | Tag = props.tag,
|
6850 | attributes = _objectWithoutPropertiesLoose(props, _excluded$2);
|
6851 |
|
6852 | var classes = mapToCssModules(classNames__default["default"](className, size ? "spinner-" + type + "-" + size : false, "spinner-" + type, color ? "text-" + color : false), cssModule);
|
6853 | return React__default["default"].createElement(Tag, _extends({
|
6854 | role: "status"
|
6855 | }, attributes, {
|
6856 | className: classes
|
6857 | }), children && React__default["default"].createElement("span", {
|
6858 | className: mapToCssModules('visually-hidden', cssModule)
|
6859 | }, children));
|
6860 | };
|
6861 |
|
6862 | Spinner.propTypes = propTypes$2;
|
6863 | Spinner.defaultProps = defaultProps$2;
|
6864 | var Spinner$1 = Spinner;
|
6865 |
|
6866 | var _excluded$1 = ["className", "cssModule", "color", "innerRef", "tag", "animation", "size", "widths"];
|
6867 |
|
6868 | var propTypes$1 = _objectSpread2(_objectSpread2({}, Col$1.propTypes), {}, {
|
6869 | color: PropTypes__default["default"].string,
|
6870 | tag: tagPropType,
|
6871 | animation: PropTypes__default["default"].oneOf(['glow', 'wave']),
|
6872 | innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].func, PropTypes__default["default"].string]),
|
6873 | size: PropTypes__default["default"].oneOf(['lg', 'sm', 'xs'])
|
6874 | });
|
6875 |
|
6876 | var defaultProps$1 = {
|
6877 | tag: 'span'
|
6878 | };
|
6879 |
|
6880 | var Placeholder = function Placeholder(props) {
|
6881 | var className = props.className,
|
6882 | cssModule = props.cssModule,
|
6883 | color = props.color,
|
6884 | innerRef = props.innerRef,
|
6885 | Tag = props.tag,
|
6886 | animation = props.animation,
|
6887 | size = props.size,
|
6888 | widths = props.widths,
|
6889 | attributes = _objectWithoutPropertiesLoose(props, _excluded$1);
|
6890 |
|
6891 | var _getColumnClasses = getColumnClasses(attributes, cssModule, widths),
|
6892 | modifiedAttributes = _getColumnClasses.attributes,
|
6893 | colClasses = _getColumnClasses.colClasses;
|
6894 |
|
6895 | var classes = mapToCssModules(classNames__default["default"](className, colClasses, 'placeholder' + (animation ? '-' + animation : ''), size ? 'placeholder-' + size : false, color ? 'bg-' + color : false), cssModule);
|
6896 | return React__default["default"].createElement(Tag, _extends({}, modifiedAttributes, {
|
6897 | className: classes,
|
6898 | ref: innerRef
|
6899 | }));
|
6900 | };
|
6901 |
|
6902 | Placeholder.propTypes = propTypes$1;
|
6903 | Placeholder.defaultProps = defaultProps$1;
|
6904 | var Placeholder$1 = Placeholder;
|
6905 |
|
6906 | var _excluded = ["cssModule", "className", "tag"];
|
6907 | var propTypes = {
|
6908 | size: PropTypes__default["default"].string,
|
6909 | color: PropTypes__default["default"].string,
|
6910 | outline: PropTypes__default["default"].bool,
|
6911 | className: PropTypes__default["default"].string,
|
6912 | tag: tagPropType
|
6913 | };
|
6914 | var defaultProps = {
|
6915 | color: 'primary',
|
6916 | tag: Button
|
6917 | };
|
6918 |
|
6919 | var PlaceholderButton = function PlaceholderButton(props) {
|
6920 | var cssModule = props.cssModule,
|
6921 | className = props.className,
|
6922 | attributes = _objectWithoutPropertiesLoose(props, _excluded);
|
6923 |
|
6924 | var _getColumnClasses = getColumnClasses(attributes, cssModule),
|
6925 | modifiedAttributes = _getColumnClasses.attributes,
|
6926 | colClasses = _getColumnClasses.colClasses;
|
6927 |
|
6928 | var classes = mapToCssModules(classNames__default["default"]("placeholder", className, colClasses), cssModule);
|
6929 | return React__default["default"].createElement(Button, _extends({}, modifiedAttributes, {
|
6930 | className: classes,
|
6931 | disabled: true
|
6932 | }));
|
6933 | };
|
6934 |
|
6935 | PlaceholderButton.propTypes = propTypes;
|
6936 | PlaceholderButton.defaultProps = defaultProps;
|
6937 | var PlaceholderButton$1 = PlaceholderButton;
|
6938 |
|
6939 | (function () {
|
6940 | if (typeof window !== 'object' || typeof window.CustomEvent === 'function') return;
|
6941 |
|
6942 | var CustomEvent = function CustomEvent(event, params) {
|
6943 | params = params || {
|
6944 | bubbles: false,
|
6945 | cancelable: false,
|
6946 | detail: null
|
6947 | };
|
6948 | var evt = document.createEvent('CustomEvent');
|
6949 | evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
6950 | return evt;
|
6951 | };
|
6952 |
|
6953 | window.CustomEvent = CustomEvent;
|
6954 | })();
|
6955 |
|
6956 | (function () {
|
6957 | if (typeof Object.values === 'function') return;
|
6958 |
|
6959 | var values = function values(O) {
|
6960 | return Object.keys(O).map(function (key) {
|
6961 | return O[key];
|
6962 | });
|
6963 | };
|
6964 |
|
6965 | Object.values = values;
|
6966 | })();
|
6967 |
|
6968 | var polyfill = {
|
6969 | __proto__: null
|
6970 | };
|
6971 |
|
6972 | exports.Accordion = Accordion$1;
|
6973 | exports.AccordionBody = AccordionBody$1;
|
6974 | exports.AccordionContext = AccordionContext;
|
6975 | exports.AccordionHeader = AccordionHeader$1;
|
6976 | exports.AccordionItem = AccordionItem$1;
|
6977 | exports.Alert = Alert;
|
6978 | exports.Badge = Badge$1;
|
6979 | exports.Breadcrumb = Breadcrumb$1;
|
6980 | exports.BreadcrumbItem = BreadcrumbItem$1;
|
6981 | exports.Button = Button;
|
6982 | exports.ButtonDropdown = ButtonDropdown$1;
|
6983 | exports.ButtonGroup = ButtonGroup$1;
|
6984 | exports.ButtonToggle = ButtonToggle$1;
|
6985 | exports.ButtonToolbar = ButtonToolbar$1;
|
6986 | exports.Card = Card$1;
|
6987 | exports.CardBody = CardBody$1;
|
6988 | exports.CardColumns = CardColumns$1;
|
6989 | exports.CardDeck = CardDeck$1;
|
6990 | exports.CardFooter = CardFooter$1;
|
6991 | exports.CardGroup = CardGroup$1;
|
6992 | exports.CardHeader = CardHeader$1;
|
6993 | exports.CardImg = CardImg$1;
|
6994 | exports.CardImgOverlay = CardImgOverlay$1;
|
6995 | exports.CardLink = CardLink$1;
|
6996 | exports.CardSubtitle = CardSubtitle$1;
|
6997 | exports.CardText = CardText$1;
|
6998 | exports.CardTitle = CardTitle$1;
|
6999 | exports.Carousel = Carousel$1;
|
7000 | exports.CarouselCaption = CarouselCaption$1;
|
7001 | exports.CarouselControl = CarouselControl$1;
|
7002 | exports.CarouselIndicators = CarouselIndicators$1;
|
7003 | exports.CarouselItem = CarouselItem$1;
|
7004 | exports.CloseButton = CloseButton$1;
|
7005 | exports.Col = Col$1;
|
7006 | exports.Collapse = Collapse$1;
|
7007 | exports.Container = Container$1;
|
7008 | exports.Dropdown = Dropdown$1;
|
7009 | exports.DropdownContext = DropdownContext;
|
7010 | exports.DropdownItem = DropdownItem$1;
|
7011 | exports.DropdownMenu = DropdownMenu$1;
|
7012 | exports.DropdownToggle = DropdownToggle$1;
|
7013 | exports.Fade = Fade;
|
7014 | exports.Form = Form$1;
|
7015 | exports.FormFeedback = FormFeedback$1;
|
7016 | exports.FormGroup = FormGroup$1;
|
7017 | exports.FormText = FormText$1;
|
7018 | exports.Input = Input$1;
|
7019 | exports.InputGroup = InputGroup$1;
|
7020 | exports.InputGroupText = InputGroupText$1;
|
7021 | exports.Label = Label$1;
|
7022 | exports.List = List$1;
|
7023 | exports.ListGroup = ListGroup$1;
|
7024 | exports.ListGroupItem = ListGroupItem$1;
|
7025 | exports.ListGroupItemHeading = ListGroupItemHeading$1;
|
7026 | exports.ListGroupItemText = ListGroupItemText$1;
|
7027 | exports.ListInlineItem = ListInlineItem$1;
|
7028 | exports.Media = Media$1;
|
7029 | exports.Modal = Modal$1;
|
7030 | exports.ModalBody = ModalBody$1;
|
7031 | exports.ModalFooter = ModalFooter$1;
|
7032 | exports.ModalHeader = ModalHeader$1;
|
7033 | exports.Nav = Nav$1;
|
7034 | exports.NavItem = NavItem$1;
|
7035 | exports.NavLink = NavLink$1;
|
7036 | exports.Navbar = Navbar$1;
|
7037 | exports.NavbarBrand = NavbarBrand$1;
|
7038 | exports.NavbarText = NavbarText$1;
|
7039 | exports.NavbarToggler = NavbarToggler$1;
|
7040 | exports.Offcanvas = Offcanvas$1;
|
7041 | exports.OffcanvasBody = OffcanvasBody$1;
|
7042 | exports.OffcanvasHeader = OffcanvasHeader$1;
|
7043 | exports.Pagination = Pagination$1;
|
7044 | exports.PaginationItem = PaginationItem$1;
|
7045 | exports.PaginationLink = PaginationLink$1;
|
7046 | exports.Placeholder = Placeholder$1;
|
7047 | exports.PlaceholderButton = PlaceholderButton$1;
|
7048 | exports.Polyfill = polyfill;
|
7049 | exports.Popover = Popover$1;
|
7050 | exports.PopoverBody = PopoverBody$1;
|
7051 | exports.PopoverHeader = PopoverHeader$1;
|
7052 | exports.PopperContent = PopperContent$1;
|
7053 | exports.PopperTargetHelper = PopperTargetHelper$1;
|
7054 | exports.Progress = Progress$1;
|
7055 | exports.Row = Row$1;
|
7056 | exports.Spinner = Spinner$1;
|
7057 | exports.TabContent = TabContent$1;
|
7058 | exports.TabPane = TabPane;
|
7059 | exports.Table = Table$1;
|
7060 | exports.Toast = Toast;
|
7061 | exports.ToastBody = ToastBody$1;
|
7062 | exports.ToastHeader = ToastHeader$1;
|
7063 | exports.Tooltip = Tooltip$1;
|
7064 | exports.UncontrolledAccordion = UncontrolledAccordion$1;
|
7065 | exports.UncontrolledAlert = UncontrolledAlert$1;
|
7066 | exports.UncontrolledButtonDropdown = UncontrolledButtonDropdown;
|
7067 | exports.UncontrolledCarousel = UncontrolledCarousel$1;
|
7068 | exports.UncontrolledCollapse = UncontrolledCollapse$1;
|
7069 | exports.UncontrolledDropdown = UncontrolledDropdown;
|
7070 | exports.UncontrolledPopover = UncontrolledPopover;
|
7071 | exports.UncontrolledTooltip = UncontrolledTooltip;
|
7072 | exports.Util = utils;
|
7073 |
|
7074 | }));
|
7075 |
|