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