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.containerRef = React__default.createRef();
|
1579 | return _this;
|
1580 | }
|
1581 |
|
1582 | var _proto = Dropdown.prototype;
|
1583 |
|
1584 | _proto.getContextValue = function getContextValue() {
|
1585 | return {
|
1586 | toggle: this.toggle,
|
1587 | isOpen: this.props.isOpen,
|
1588 | direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction,
|
1589 | inNavbar: this.props.inNavbar,
|
1590 | disabled: this.props.disabled
|
1591 | };
|
1592 | };
|
1593 |
|
1594 | _proto.componentDidMount = function componentDidMount() {
|
1595 | this.handleProps();
|
1596 | };
|
1597 |
|
1598 | _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
1599 | if (this.props.isOpen !== prevProps.isOpen) {
|
1600 | this.handleProps();
|
1601 | }
|
1602 | };
|
1603 |
|
1604 | _proto.componentWillUnmount = function componentWillUnmount() {
|
1605 | this.removeEvents();
|
1606 | };
|
1607 |
|
1608 | _proto.getContainer = function getContainer() {
|
1609 | return this.containerRef.current;
|
1610 | };
|
1611 |
|
1612 | _proto.getMenuCtrl = function getMenuCtrl() {
|
1613 | if (this._$menuCtrl) return this._$menuCtrl;
|
1614 | this._$menuCtrl = this.getContainer().querySelector('[aria-expanded]');
|
1615 | return this._$menuCtrl;
|
1616 | };
|
1617 |
|
1618 | _proto.getMenuItems = function getMenuItems() {
|
1619 | return [].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'));
|
1620 | };
|
1621 |
|
1622 | _proto.addEvents = function addEvents() {
|
1623 | var _this2 = this;
|
1624 |
|
1625 | ['click', 'touchstart', 'keyup'].forEach(function (event) {
|
1626 | return document.addEventListener(event, _this2.handleDocumentClick, true);
|
1627 | });
|
1628 | };
|
1629 |
|
1630 | _proto.removeEvents = function removeEvents() {
|
1631 | var _this3 = this;
|
1632 |
|
1633 | ['click', 'touchstart', 'keyup'].forEach(function (event) {
|
1634 | return document.removeEventListener(event, _this3.handleDocumentClick, true);
|
1635 | });
|
1636 | };
|
1637 |
|
1638 | _proto.handleDocumentClick = function handleDocumentClick(e) {
|
1639 | if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return;
|
1640 | var container = this.getContainer();
|
1641 |
|
1642 | if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) {
|
1643 | return;
|
1644 | }
|
1645 |
|
1646 | this.toggle(e);
|
1647 | };
|
1648 |
|
1649 | _proto.handleKeyDown = function handleKeyDown(e) {
|
1650 | var _this4 = this;
|
1651 |
|
1652 | if (/input|textarea/i.test(e.target.tagName) || keyCodes.tab === e.which && (e.target.getAttribute('role') !== 'menuitem' || !this.props.a11y)) {
|
1653 | return;
|
1654 | }
|
1655 |
|
1656 | if (preventDefaultKeys.indexOf(e.which) !== -1 || e.which >= 48 && e.which <= 90) {
|
1657 | e.preventDefault();
|
1658 | }
|
1659 |
|
1660 | if (this.props.disabled) return;
|
1661 |
|
1662 | if (this.getMenuCtrl() === e.target) {
|
1663 | if (!this.props.isOpen && [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {
|
1664 | this.toggle(e);
|
1665 | setTimeout(function () {
|
1666 | return _this4.getMenuItems()[0].focus();
|
1667 | });
|
1668 | } else if (this.props.isOpen && e.which === keyCodes.esc) {
|
1669 | this.toggle(e);
|
1670 | }
|
1671 | }
|
1672 |
|
1673 | if (this.props.isOpen && e.target.getAttribute('role') === 'menuitem') {
|
1674 | if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {
|
1675 | this.toggle(e);
|
1676 | this.getMenuCtrl().focus();
|
1677 | } else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {
|
1678 | e.target.click();
|
1679 | this.getMenuCtrl().focus();
|
1680 | } else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {
|
1681 | var $menuitems = this.getMenuItems();
|
1682 | var index = $menuitems.indexOf(e.target);
|
1683 |
|
1684 | if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {
|
1685 | index = index !== 0 ? index - 1 : $menuitems.length - 1;
|
1686 | } else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {
|
1687 | index = index === $menuitems.length - 1 ? 0 : index + 1;
|
1688 | }
|
1689 |
|
1690 | $menuitems[index].focus();
|
1691 | } else if (keyCodes.end === e.which) {
|
1692 | var _$menuitems = this.getMenuItems();
|
1693 |
|
1694 | _$menuitems[_$menuitems.length - 1].focus();
|
1695 | } else if (keyCodes.home === e.which) {
|
1696 | var _$menuitems2 = this.getMenuItems();
|
1697 |
|
1698 | _$menuitems2[0].focus();
|
1699 | } else if (e.which >= 48 && e.which <= 90) {
|
1700 | var _$menuitems3 = this.getMenuItems();
|
1701 |
|
1702 | var charPressed = String.fromCharCode(e.which).toLowerCase();
|
1703 |
|
1704 | for (var i = 0; i < _$menuitems3.length; i += 1) {
|
1705 | var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();
|
1706 |
|
1707 | if (firstLetter === charPressed) {
|
1708 | _$menuitems3[i].focus();
|
1709 |
|
1710 | break;
|
1711 | }
|
1712 | }
|
1713 | }
|
1714 | }
|
1715 | };
|
1716 |
|
1717 | _proto.handleProps = function handleProps() {
|
1718 | if (this.props.isOpen) {
|
1719 | this.addEvents();
|
1720 | } else {
|
1721 | this.removeEvents();
|
1722 | }
|
1723 | };
|
1724 |
|
1725 | _proto.toggle = function toggle(e) {
|
1726 | if (this.props.disabled) {
|
1727 | return e && e.preventDefault();
|
1728 | }
|
1729 |
|
1730 | return this.props.toggle(e);
|
1731 | };
|
1732 |
|
1733 | _proto.render = function render() {
|
1734 | var _classNames, _ref;
|
1735 |
|
1736 | var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar', 'a11y']),
|
1737 | className = _omit.className,
|
1738 | cssModule = _omit.cssModule,
|
1739 | direction = _omit.direction,
|
1740 | isOpen = _omit.isOpen,
|
1741 | group = _omit.group,
|
1742 | size = _omit.size,
|
1743 | nav = _omit.nav,
|
1744 | setActiveFromChild = _omit.setActiveFromChild,
|
1745 | active = _omit.active,
|
1746 | addonType = _omit.addonType,
|
1747 | tag = _omit.tag,
|
1748 | attrs = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "direction", "isOpen", "group", "size", "nav", "setActiveFromChild", "active", "addonType", "tag"]);
|
1749 |
|
1750 | var Tag = tag || (nav ? 'li' : 'div');
|
1751 | var subItemIsActive = false;
|
1752 |
|
1753 | if (setActiveFromChild) {
|
1754 | React__default.Children.map(this.props.children[1].props.children, function (dropdownItem) {
|
1755 | if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;
|
1756 | });
|
1757 | }
|
1758 |
|
1759 | 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);
|
1760 | return React__default.createElement(DropdownContext.Provider, {
|
1761 | value: this.getContextValue()
|
1762 | }, React__default.createElement(reactPopper.Manager, null, React__default.createElement(Tag, _extends({}, attrs, (_ref = {}, _ref[typeof Tag === 'string' ? 'ref' : 'innerRef'] = this.containerRef, _ref), {
|
1763 | onKeyDown: this.handleKeyDown,
|
1764 | className: classes
|
1765 | }))));
|
1766 | };
|
1767 |
|
1768 | return Dropdown;
|
1769 | }(React__default.Component);
|
1770 |
|
1771 | Dropdown.propTypes = propTypes$f;
|
1772 | Dropdown.defaultProps = defaultProps$e;
|
1773 |
|
1774 | var propTypes$g = {
|
1775 | children: propTypes.node
|
1776 | };
|
1777 |
|
1778 | var ButtonDropdown = function ButtonDropdown(props) {
|
1779 | return React__default.createElement(Dropdown, _extends({
|
1780 | group: true
|
1781 | }, props));
|
1782 | };
|
1783 |
|
1784 | ButtonDropdown.propTypes = propTypes$g;
|
1785 |
|
1786 | var propTypes$h = {
|
1787 | tag: tagPropType,
|
1788 | 'aria-label': propTypes.string,
|
1789 | className: propTypes.string,
|
1790 | cssModule: propTypes.object,
|
1791 | role: propTypes.string,
|
1792 | size: propTypes.string,
|
1793 | vertical: propTypes.bool
|
1794 | };
|
1795 | var defaultProps$f = {
|
1796 | tag: 'div',
|
1797 | role: 'group'
|
1798 | };
|
1799 |
|
1800 | var ButtonGroup = function ButtonGroup(props) {
|
1801 | var className = props.className,
|
1802 | cssModule = props.cssModule,
|
1803 | size = props.size,
|
1804 | vertical = props.vertical,
|
1805 | Tag = props.tag,
|
1806 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "vertical", "tag"]);
|
1807 |
|
1808 | var classes = mapToCssModules(classnames(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule);
|
1809 | return React__default.createElement(Tag, _extends({}, attributes, {
|
1810 | className: classes
|
1811 | }));
|
1812 | };
|
1813 |
|
1814 | ButtonGroup.propTypes = propTypes$h;
|
1815 | ButtonGroup.defaultProps = defaultProps$f;
|
1816 |
|
1817 | var propTypes$i = {
|
1818 | tag: tagPropType,
|
1819 | 'aria-label': propTypes.string,
|
1820 | className: propTypes.string,
|
1821 | cssModule: propTypes.object,
|
1822 | role: propTypes.string
|
1823 | };
|
1824 | var defaultProps$g = {
|
1825 | tag: 'div',
|
1826 | role: 'toolbar'
|
1827 | };
|
1828 |
|
1829 | var ButtonToolbar = function ButtonToolbar(props) {
|
1830 | var className = props.className,
|
1831 | cssModule = props.cssModule,
|
1832 | Tag = props.tag,
|
1833 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
1834 |
|
1835 | var classes = mapToCssModules(classnames(className, 'btn-toolbar'), cssModule);
|
1836 | return React__default.createElement(Tag, _extends({}, attributes, {
|
1837 | className: classes
|
1838 | }));
|
1839 | };
|
1840 |
|
1841 | ButtonToolbar.propTypes = propTypes$i;
|
1842 | ButtonToolbar.defaultProps = defaultProps$g;
|
1843 |
|
1844 | var propTypes$j = {
|
1845 | children: propTypes.node,
|
1846 | active: propTypes.bool,
|
1847 | disabled: propTypes.bool,
|
1848 | divider: propTypes.bool,
|
1849 | tag: tagPropType,
|
1850 | header: propTypes.bool,
|
1851 | onClick: propTypes.func,
|
1852 | className: propTypes.string,
|
1853 | cssModule: propTypes.object,
|
1854 | toggle: propTypes.bool
|
1855 | };
|
1856 | var defaultProps$h = {
|
1857 | tag: 'button',
|
1858 | toggle: true
|
1859 | };
|
1860 |
|
1861 | var DropdownItem = function (_React$Component) {
|
1862 | _inheritsLoose(DropdownItem, _React$Component);
|
1863 |
|
1864 | function DropdownItem(props) {
|
1865 | var _this;
|
1866 |
|
1867 | _this = _React$Component.call(this, props) || this;
|
1868 | _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
|
1869 | _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_this));
|
1870 | return _this;
|
1871 | }
|
1872 |
|
1873 | var _proto = DropdownItem.prototype;
|
1874 |
|
1875 | _proto.onClick = function onClick(e) {
|
1876 | if (this.props.disabled || this.props.header || this.props.divider) {
|
1877 | e.preventDefault();
|
1878 | return;
|
1879 | }
|
1880 |
|
1881 | if (this.props.onClick) {
|
1882 | this.props.onClick(e);
|
1883 | }
|
1884 |
|
1885 | if (this.props.toggle) {
|
1886 | this.context.toggle(e);
|
1887 | }
|
1888 | };
|
1889 |
|
1890 | _proto.getTabIndex = function getTabIndex() {
|
1891 | if (this.props.disabled || this.props.header || this.props.divider) {
|
1892 | return '-1';
|
1893 | }
|
1894 |
|
1895 | return '0';
|
1896 | };
|
1897 |
|
1898 | _proto.render = function render() {
|
1899 | var tabIndex = this.getTabIndex();
|
1900 | var role = tabIndex > -1 ? 'menuitem' : undefined;
|
1901 |
|
1902 | var _omit = omit(this.props, ['toggle']),
|
1903 | className = _omit.className,
|
1904 | cssModule = _omit.cssModule,
|
1905 | divider = _omit.divider,
|
1906 | Tag = _omit.tag,
|
1907 | header = _omit.header,
|
1908 | active = _omit.active,
|
1909 | props = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "divider", "tag", "header", "active"]);
|
1910 |
|
1911 | var classes = mapToCssModules(classnames(className, {
|
1912 | disabled: props.disabled,
|
1913 | 'dropdown-item': !divider && !header,
|
1914 | active: active,
|
1915 | 'dropdown-header': header,
|
1916 | 'dropdown-divider': divider
|
1917 | }), cssModule);
|
1918 |
|
1919 | if (Tag === 'button') {
|
1920 | if (header) {
|
1921 | Tag = 'h6';
|
1922 | } else if (divider) {
|
1923 | Tag = 'div';
|
1924 | } else if (props.href) {
|
1925 | Tag = 'a';
|
1926 | }
|
1927 | }
|
1928 |
|
1929 | return React__default.createElement(Tag, _extends({
|
1930 | type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined
|
1931 | }, props, {
|
1932 | tabIndex: tabIndex,
|
1933 | role: role,
|
1934 | className: classes,
|
1935 | onClick: this.onClick
|
1936 | }));
|
1937 | };
|
1938 |
|
1939 | return DropdownItem;
|
1940 | }(React__default.Component);
|
1941 |
|
1942 | DropdownItem.propTypes = propTypes$j;
|
1943 | DropdownItem.defaultProps = defaultProps$h;
|
1944 | DropdownItem.contextType = DropdownContext;
|
1945 |
|
1946 | var propTypes$k = {
|
1947 | tag: tagPropType,
|
1948 | children: propTypes.node.isRequired,
|
1949 | right: propTypes.bool,
|
1950 | flip: propTypes.bool,
|
1951 | modifiers: propTypes.object,
|
1952 | className: propTypes.string,
|
1953 | cssModule: propTypes.object,
|
1954 | persist: propTypes.bool,
|
1955 | positionFixed: propTypes.bool
|
1956 | };
|
1957 | var defaultProps$i = {
|
1958 | tag: 'div',
|
1959 | flip: true
|
1960 | };
|
1961 | var noFlipModifier = {
|
1962 | flip: {
|
1963 | enabled: false
|
1964 | }
|
1965 | };
|
1966 | var directionPositionMap = {
|
1967 | up: 'top',
|
1968 | left: 'left',
|
1969 | right: 'right',
|
1970 | down: 'bottom'
|
1971 | };
|
1972 |
|
1973 | var DropdownMenu = function (_React$Component) {
|
1974 | _inheritsLoose(DropdownMenu, _React$Component);
|
1975 |
|
1976 | function DropdownMenu() {
|
1977 | return _React$Component.apply(this, arguments) || this;
|
1978 | }
|
1979 |
|
1980 | var _proto = DropdownMenu.prototype;
|
1981 |
|
1982 | _proto.render = function render() {
|
1983 | var _this = this;
|
1984 |
|
1985 | var _this$props = this.props,
|
1986 | className = _this$props.className,
|
1987 | cssModule = _this$props.cssModule,
|
1988 | right = _this$props.right,
|
1989 | tag = _this$props.tag,
|
1990 | flip = _this$props.flip,
|
1991 | modifiers = _this$props.modifiers,
|
1992 | persist = _this$props.persist,
|
1993 | positionFixed = _this$props.positionFixed,
|
1994 | attrs = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "right", "tag", "flip", "modifiers", "persist", "positionFixed"]);
|
1995 |
|
1996 | var classes = mapToCssModules(classnames(className, 'dropdown-menu', {
|
1997 | 'dropdown-menu-right': right,
|
1998 | show: this.context.isOpen
|
1999 | }), cssModule);
|
2000 | var Tag = tag;
|
2001 |
|
2002 | if (persist || this.context.isOpen && !this.context.inNavbar) {
|
2003 | var position1 = directionPositionMap[this.context.direction] || 'bottom';
|
2004 | var position2 = right ? 'end' : 'start';
|
2005 | var poperPlacement = position1 + "-" + position2;
|
2006 | var poperModifiers = !flip ? _extends({}, modifiers, noFlipModifier) : modifiers;
|
2007 | var popperPositionFixed = !!positionFixed;
|
2008 | return React__default.createElement(reactPopper.Popper, {
|
2009 | placement: poperPlacement,
|
2010 | modifiers: poperModifiers,
|
2011 | positionFixed: popperPositionFixed
|
2012 | }, function (_ref) {
|
2013 | var ref = _ref.ref,
|
2014 | style = _ref.style,
|
2015 | placement = _ref.placement;
|
2016 | return React__default.createElement(Tag, _extends({
|
2017 | tabIndex: "-1",
|
2018 | role: "menu",
|
2019 | ref: ref,
|
2020 | style: style
|
2021 | }, attrs, {
|
2022 | "aria-hidden": !_this.context.isOpen,
|
2023 | className: classes,
|
2024 | "x-placement": placement
|
2025 | }));
|
2026 | });
|
2027 | }
|
2028 |
|
2029 | return React__default.createElement(Tag, _extends({
|
2030 | tabIndex: "-1",
|
2031 | role: "menu"
|
2032 | }, attrs, {
|
2033 | "aria-hidden": !this.context.isOpen,
|
2034 | className: classes,
|
2035 | "x-placement": attrs.placement
|
2036 | }));
|
2037 | };
|
2038 |
|
2039 | return DropdownMenu;
|
2040 | }(React__default.Component);
|
2041 | DropdownMenu.propTypes = propTypes$k;
|
2042 | DropdownMenu.defaultProps = defaultProps$i;
|
2043 | DropdownMenu.contextType = DropdownContext;
|
2044 |
|
2045 | var propTypes$l = {
|
2046 | caret: propTypes.bool,
|
2047 | color: propTypes.string,
|
2048 | children: propTypes.node,
|
2049 | className: propTypes.string,
|
2050 | cssModule: propTypes.object,
|
2051 | disabled: propTypes.bool,
|
2052 | onClick: propTypes.func,
|
2053 | 'aria-haspopup': propTypes.bool,
|
2054 | split: propTypes.bool,
|
2055 | tag: tagPropType,
|
2056 | nav: propTypes.bool
|
2057 | };
|
2058 | var defaultProps$j = {
|
2059 | 'aria-haspopup': true,
|
2060 | color: 'secondary'
|
2061 | };
|
2062 |
|
2063 | var DropdownToggle = function (_React$Component) {
|
2064 | _inheritsLoose(DropdownToggle, _React$Component);
|
2065 |
|
2066 | function DropdownToggle(props) {
|
2067 | var _this;
|
2068 |
|
2069 | _this = _React$Component.call(this, props) || this;
|
2070 | _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
|
2071 | return _this;
|
2072 | }
|
2073 |
|
2074 | var _proto = DropdownToggle.prototype;
|
2075 |
|
2076 | _proto.onClick = function onClick(e) {
|
2077 | if (this.props.disabled || this.context.disabled) {
|
2078 | e.preventDefault();
|
2079 | return;
|
2080 | }
|
2081 |
|
2082 | if (this.props.nav && !this.props.tag) {
|
2083 | e.preventDefault();
|
2084 | }
|
2085 |
|
2086 | if (this.props.onClick) {
|
2087 | this.props.onClick(e);
|
2088 | }
|
2089 |
|
2090 | this.context.toggle(e);
|
2091 | };
|
2092 |
|
2093 | _proto.render = function render() {
|
2094 | var _this2 = this;
|
2095 |
|
2096 | var _this$props = this.props,
|
2097 | className = _this$props.className,
|
2098 | color = _this$props.color,
|
2099 | cssModule = _this$props.cssModule,
|
2100 | caret = _this$props.caret,
|
2101 | split = _this$props.split,
|
2102 | nav = _this$props.nav,
|
2103 | tag = _this$props.tag,
|
2104 | innerRef = _this$props.innerRef,
|
2105 | props = _objectWithoutPropertiesLoose(_this$props, ["className", "color", "cssModule", "caret", "split", "nav", "tag", "innerRef"]);
|
2106 |
|
2107 | var ariaLabel = props['aria-label'] || 'Toggle Dropdown';
|
2108 | var classes = mapToCssModules(classnames(className, {
|
2109 | 'dropdown-toggle': caret || split,
|
2110 | 'dropdown-toggle-split': split,
|
2111 | 'nav-link': nav
|
2112 | }), cssModule);
|
2113 | var children = typeof props.children !== 'undefined' ? props.children : React__default.createElement("span", {
|
2114 | className: "sr-only"
|
2115 | }, ariaLabel);
|
2116 | var Tag;
|
2117 |
|
2118 | if (nav && !tag) {
|
2119 | Tag = 'a';
|
2120 | props.href = '#';
|
2121 | } else if (!tag) {
|
2122 | Tag = Button;
|
2123 | props.color = color;
|
2124 | props.cssModule = cssModule;
|
2125 | } else {
|
2126 | Tag = tag;
|
2127 | }
|
2128 |
|
2129 | if (this.context.inNavbar) {
|
2130 | return React__default.createElement(Tag, _extends({}, props, {
|
2131 | className: classes,
|
2132 | onClick: this.onClick,
|
2133 | "aria-expanded": this.context.isOpen,
|
2134 | children: children
|
2135 | }));
|
2136 | }
|
2137 |
|
2138 | return React__default.createElement(reactPopper.Reference, {
|
2139 | innerRef: innerRef
|
2140 | }, function (_ref) {
|
2141 | var _ref2;
|
2142 |
|
2143 | var ref = _ref.ref;
|
2144 | return React__default.createElement(Tag, _extends({}, props, (_ref2 = {}, _ref2[typeof Tag === 'string' ? 'ref' : 'innerRef'] = ref, _ref2), {
|
2145 | className: classes,
|
2146 | onClick: _this2.onClick,
|
2147 | "aria-expanded": _this2.context.isOpen,
|
2148 | children: children
|
2149 | }));
|
2150 | });
|
2151 | };
|
2152 |
|
2153 | return DropdownToggle;
|
2154 | }(React__default.Component);
|
2155 |
|
2156 | DropdownToggle.propTypes = propTypes$l;
|
2157 | DropdownToggle.defaultProps = defaultProps$j;
|
2158 | DropdownToggle.contextType = DropdownContext;
|
2159 |
|
2160 | var interopRequireDefault = createCommonjsModule(function (module) {
|
2161 | function _interopRequireDefault(obj) {
|
2162 | return obj && obj.__esModule ? obj : {
|
2163 | "default": obj
|
2164 | };
|
2165 | }
|
2166 |
|
2167 | module.exports = _interopRequireDefault;
|
2168 | });
|
2169 | unwrapExports(interopRequireDefault);
|
2170 |
|
2171 | var hasClass_1 = createCommonjsModule(function (module, exports) {
|
2172 |
|
2173 | exports.__esModule = true;
|
2174 | exports.default = hasClass;
|
2175 |
|
2176 | function hasClass(element, className) {
|
2177 | if (element.classList) return !!className && element.classList.contains(className);else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
|
2178 | }
|
2179 |
|
2180 | module.exports = exports["default"];
|
2181 | });
|
2182 | unwrapExports(hasClass_1);
|
2183 |
|
2184 | var addClass_1 = createCommonjsModule(function (module, exports) {
|
2185 |
|
2186 | exports.__esModule = true;
|
2187 | exports.default = addClass;
|
2188 |
|
2189 | var _hasClass = interopRequireDefault(hasClass_1);
|
2190 |
|
2191 | function addClass(element, className) {
|
2192 | 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);
|
2193 | }
|
2194 |
|
2195 | module.exports = exports["default"];
|
2196 | });
|
2197 | unwrapExports(addClass_1);
|
2198 |
|
2199 | function replaceClassName(origClass, classToRemove) {
|
2200 | return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
|
2201 | }
|
2202 |
|
2203 | var removeClass = function removeClass(element, className) {
|
2204 | 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));
|
2205 | };
|
2206 |
|
2207 | |
2208 |
|
2209 |
|
2210 |
|
2211 |
|
2212 |
|
2213 | function componentWillMount() {
|
2214 |
|
2215 | var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
|
2216 |
|
2217 | if (state !== null && state !== undefined) {
|
2218 | this.setState(state);
|
2219 | }
|
2220 | }
|
2221 |
|
2222 | function componentWillReceiveProps(nextProps) {
|
2223 |
|
2224 |
|
2225 | function updater(prevState) {
|
2226 | var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
|
2227 | return state !== null && state !== undefined ? state : null;
|
2228 | }
|
2229 |
|
2230 |
|
2231 | this.setState(updater.bind(this));
|
2232 | }
|
2233 |
|
2234 | function componentWillUpdate(nextProps, nextState) {
|
2235 | try {
|
2236 | var prevProps = this.props;
|
2237 | var prevState = this.state;
|
2238 | this.props = nextProps;
|
2239 | this.state = nextState;
|
2240 | this.__reactInternalSnapshotFlag = true;
|
2241 | this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
|
2242 | } finally {
|
2243 | this.props = prevProps;
|
2244 | this.state = prevState;
|
2245 | }
|
2246 | }
|
2247 |
|
2248 |
|
2249 |
|
2250 | componentWillMount.__suppressDeprecationWarning = true;
|
2251 | componentWillReceiveProps.__suppressDeprecationWarning = true;
|
2252 | componentWillUpdate.__suppressDeprecationWarning = true;
|
2253 |
|
2254 | function polyfill(Component) {
|
2255 | var prototype = Component.prototype;
|
2256 |
|
2257 | if (!prototype || !prototype.isReactComponent) {
|
2258 | throw new Error('Can only polyfill class components');
|
2259 | }
|
2260 |
|
2261 | if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
|
2262 | return Component;
|
2263 | }
|
2264 |
|
2265 |
|
2266 |
|
2267 |
|
2268 | var foundWillMountName = null;
|
2269 | var foundWillReceivePropsName = null;
|
2270 | var foundWillUpdateName = null;
|
2271 |
|
2272 | if (typeof prototype.componentWillMount === 'function') {
|
2273 | foundWillMountName = 'componentWillMount';
|
2274 | } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
|
2275 | foundWillMountName = 'UNSAFE_componentWillMount';
|
2276 | }
|
2277 |
|
2278 | if (typeof prototype.componentWillReceiveProps === 'function') {
|
2279 | foundWillReceivePropsName = 'componentWillReceiveProps';
|
2280 | } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
|
2281 | foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
2282 | }
|
2283 |
|
2284 | if (typeof prototype.componentWillUpdate === 'function') {
|
2285 | foundWillUpdateName = 'componentWillUpdate';
|
2286 | } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
|
2287 | foundWillUpdateName = 'UNSAFE_componentWillUpdate';
|
2288 | }
|
2289 |
|
2290 | if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
|
2291 | var componentName = Component.displayName || Component.name;
|
2292 | var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
|
2293 | 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');
|
2294 | }
|
2295 |
|
2296 |
|
2297 |
|
2298 |
|
2299 | if (typeof Component.getDerivedStateFromProps === 'function') {
|
2300 | prototype.componentWillMount = componentWillMount;
|
2301 | prototype.componentWillReceiveProps = componentWillReceiveProps;
|
2302 | }
|
2303 |
|
2304 |
|
2305 |
|
2306 |
|
2307 | if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
|
2308 | if (typeof prototype.componentDidUpdate !== 'function') {
|
2309 | throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
|
2310 | }
|
2311 |
|
2312 | prototype.componentWillUpdate = componentWillUpdate;
|
2313 | var componentDidUpdate = prototype.componentDidUpdate;
|
2314 |
|
2315 | prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
|
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 |
|
2321 |
|
2322 |
|
2323 |
|
2324 | var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
|
2325 | componentDidUpdate.call(this, prevProps, prevState, snapshot);
|
2326 | };
|
2327 | }
|
2328 |
|
2329 | return Component;
|
2330 | }
|
2331 |
|
2332 | var reactLifecyclesCompat_es = Object.freeze({
|
2333 | __proto__: null,
|
2334 | polyfill: polyfill
|
2335 | });
|
2336 |
|
2337 | var PropTypes = createCommonjsModule(function (module, exports) {
|
2338 |
|
2339 | exports.__esModule = true;
|
2340 | exports.classNamesShape = exports.timeoutsShape = void 0;
|
2341 |
|
2342 | var _propTypes = _interopRequireDefault(propTypes);
|
2343 |
|
2344 | function _interopRequireDefault(obj) {
|
2345 | return obj && obj.__esModule ? obj : {
|
2346 | default: obj
|
2347 | };
|
2348 | }
|
2349 |
|
2350 | var timeoutsShape = null;
|
2351 | exports.timeoutsShape = timeoutsShape;
|
2352 | var classNamesShape = null;
|
2353 | exports.classNamesShape = classNamesShape;
|
2354 | });
|
2355 | unwrapExports(PropTypes);
|
2356 | var PropTypes_1 = PropTypes.classNamesShape;
|
2357 | var PropTypes_2 = PropTypes.timeoutsShape;
|
2358 |
|
2359 | var _reactLifecyclesCompat = getCjsExportFromNamespace(reactLifecyclesCompat_es);
|
2360 |
|
2361 | var Transition_1 = createCommonjsModule(function (module, exports) {
|
2362 |
|
2363 | exports.__esModule = true;
|
2364 | exports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;
|
2365 |
|
2366 | var PropTypes = _interopRequireWildcard(propTypes);
|
2367 |
|
2368 | var _react = _interopRequireDefault(React__default);
|
2369 |
|
2370 | var _reactDom = _interopRequireDefault(ReactDOM);
|
2371 |
|
2372 | function _interopRequireDefault(obj) {
|
2373 | return obj && obj.__esModule ? obj : {
|
2374 | default: obj
|
2375 | };
|
2376 | }
|
2377 |
|
2378 | function _interopRequireWildcard(obj) {
|
2379 | if (obj && obj.__esModule) {
|
2380 | return obj;
|
2381 | } else {
|
2382 | var newObj = {};
|
2383 |
|
2384 | if (obj != null) {
|
2385 | for (var key in obj) {
|
2386 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
2387 | var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
2388 |
|
2389 | if (desc.get || desc.set) {
|
2390 | Object.defineProperty(newObj, key, desc);
|
2391 | } else {
|
2392 | newObj[key] = obj[key];
|
2393 | }
|
2394 | }
|
2395 | }
|
2396 | }
|
2397 |
|
2398 | newObj.default = obj;
|
2399 | return newObj;
|
2400 | }
|
2401 | }
|
2402 |
|
2403 | function _objectWithoutPropertiesLoose(source, excluded) {
|
2404 | if (source == null) return {};
|
2405 | var target = {};
|
2406 | var sourceKeys = Object.keys(source);
|
2407 | var key, i;
|
2408 |
|
2409 | for (i = 0; i < sourceKeys.length; i++) {
|
2410 | key = sourceKeys[i];
|
2411 | if (excluded.indexOf(key) >= 0) continue;
|
2412 | target[key] = source[key];
|
2413 | }
|
2414 |
|
2415 | return target;
|
2416 | }
|
2417 |
|
2418 | function _inheritsLoose(subClass, superClass) {
|
2419 | subClass.prototype = Object.create(superClass.prototype);
|
2420 | subClass.prototype.constructor = subClass;
|
2421 | subClass.__proto__ = superClass;
|
2422 | }
|
2423 |
|
2424 | var UNMOUNTED = 'unmounted';
|
2425 | exports.UNMOUNTED = UNMOUNTED;
|
2426 | var EXITED = 'exited';
|
2427 | exports.EXITED = EXITED;
|
2428 | var ENTERING = 'entering';
|
2429 | exports.ENTERING = ENTERING;
|
2430 | var ENTERED = 'entered';
|
2431 | exports.ENTERED = ENTERED;
|
2432 | var EXITING = 'exiting';
|
2433 | |
2434 |
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 |
|
2444 |
|
2445 |
|
2446 |
|
2447 |
|
2448 |
|
2449 |
|
2450 |
|
2451 |
|
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 |
|
2471 |
|
2472 |
|
2473 |
|
2474 |
|
2475 |
|
2476 |
|
2477 |
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 |
|
2490 |
|
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 |
|
2501 |
|
2502 |
|
2503 |
|
2504 |
|
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 | exports.EXITING = EXITING;
|
2524 |
|
2525 | var Transition = function (_React$Component) {
|
2526 | _inheritsLoose(Transition, _React$Component);
|
2527 |
|
2528 | function Transition(props, context) {
|
2529 | var _this;
|
2530 |
|
2531 | _this = _React$Component.call(this, props, context) || this;
|
2532 | var parentGroup = context.transitionGroup;
|
2533 |
|
2534 | var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
|
2535 | var initialStatus;
|
2536 | _this.appearStatus = null;
|
2537 |
|
2538 | if (props.in) {
|
2539 | if (appear) {
|
2540 | initialStatus = EXITED;
|
2541 | _this.appearStatus = ENTERING;
|
2542 | } else {
|
2543 | initialStatus = ENTERED;
|
2544 | }
|
2545 | } else {
|
2546 | if (props.unmountOnExit || props.mountOnEnter) {
|
2547 | initialStatus = UNMOUNTED;
|
2548 | } else {
|
2549 | initialStatus = EXITED;
|
2550 | }
|
2551 | }
|
2552 |
|
2553 | _this.state = {
|
2554 | status: initialStatus
|
2555 | };
|
2556 | _this.nextCallback = null;
|
2557 | return _this;
|
2558 | }
|
2559 |
|
2560 | var _proto = Transition.prototype;
|
2561 |
|
2562 | _proto.getChildContext = function getChildContext() {
|
2563 | return {
|
2564 | transitionGroup: null
|
2565 |
|
2566 | };
|
2567 | };
|
2568 |
|
2569 | Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
|
2570 | var nextIn = _ref.in;
|
2571 |
|
2572 | if (nextIn && prevState.status === UNMOUNTED) {
|
2573 | return {
|
2574 | status: EXITED
|
2575 | };
|
2576 | }
|
2577 |
|
2578 | return null;
|
2579 | };
|
2580 |
|
2581 |
|
2582 |
|
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 |
|
2593 |
|
2594 |
|
2595 |
|
2596 |
|
2597 | _proto.componentDidMount = function componentDidMount() {
|
2598 | this.updateStatus(true, this.appearStatus);
|
2599 | };
|
2600 |
|
2601 | _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
2602 | var nextStatus = null;
|
2603 |
|
2604 | if (prevProps !== this.props) {
|
2605 | var status = this.state.status;
|
2606 |
|
2607 | if (this.props.in) {
|
2608 | if (status !== ENTERING && status !== ENTERED) {
|
2609 | nextStatus = ENTERING;
|
2610 | }
|
2611 | } else {
|
2612 | if (status === ENTERING || status === ENTERED) {
|
2613 | nextStatus = EXITING;
|
2614 | }
|
2615 | }
|
2616 | }
|
2617 |
|
2618 | this.updateStatus(false, nextStatus);
|
2619 | };
|
2620 |
|
2621 | _proto.componentWillUnmount = function componentWillUnmount() {
|
2622 | this.cancelNextCallback();
|
2623 | };
|
2624 |
|
2625 | _proto.getTimeouts = function getTimeouts() {
|
2626 | var timeout = this.props.timeout;
|
2627 | var exit, enter, appear;
|
2628 | exit = enter = appear = timeout;
|
2629 |
|
2630 | if (timeout != null && typeof timeout !== 'number') {
|
2631 | exit = timeout.exit;
|
2632 | enter = timeout.enter;
|
2633 |
|
2634 | appear = timeout.appear !== undefined ? timeout.appear : enter;
|
2635 | }
|
2636 |
|
2637 | return {
|
2638 | exit: exit,
|
2639 | enter: enter,
|
2640 | appear: appear
|
2641 | };
|
2642 | };
|
2643 |
|
2644 | _proto.updateStatus = function updateStatus(mounting, nextStatus) {
|
2645 | if (mounting === void 0) {
|
2646 | mounting = false;
|
2647 | }
|
2648 |
|
2649 | if (nextStatus !== null) {
|
2650 |
|
2651 | this.cancelNextCallback();
|
2652 |
|
2653 | var node = _reactDom.default.findDOMNode(this);
|
2654 |
|
2655 | if (nextStatus === ENTERING) {
|
2656 | this.performEnter(node, mounting);
|
2657 | } else {
|
2658 | this.performExit(node);
|
2659 | }
|
2660 | } else if (this.props.unmountOnExit && this.state.status === EXITED) {
|
2661 | this.setState({
|
2662 | status: UNMOUNTED
|
2663 | });
|
2664 | }
|
2665 | };
|
2666 |
|
2667 | _proto.performEnter = function performEnter(node, mounting) {
|
2668 | var _this2 = this;
|
2669 |
|
2670 | var enter = this.props.enter;
|
2671 | var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
|
2672 | var timeouts = this.getTimeouts();
|
2673 | var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
|
2674 |
|
2675 |
|
2676 | if (!mounting && !enter) {
|
2677 | this.safeSetState({
|
2678 | status: ENTERED
|
2679 | }, function () {
|
2680 | _this2.props.onEntered(node);
|
2681 | });
|
2682 | return;
|
2683 | }
|
2684 |
|
2685 | this.props.onEnter(node, appearing);
|
2686 | this.safeSetState({
|
2687 | status: ENTERING
|
2688 | }, function () {
|
2689 | _this2.props.onEntering(node, appearing);
|
2690 |
|
2691 | _this2.onTransitionEnd(node, enterTimeout, function () {
|
2692 | _this2.safeSetState({
|
2693 | status: ENTERED
|
2694 | }, function () {
|
2695 | _this2.props.onEntered(node, appearing);
|
2696 | });
|
2697 | });
|
2698 | });
|
2699 | };
|
2700 |
|
2701 | _proto.performExit = function performExit(node) {
|
2702 | var _this3 = this;
|
2703 |
|
2704 | var exit = this.props.exit;
|
2705 | var timeouts = this.getTimeouts();
|
2706 |
|
2707 | if (!exit) {
|
2708 | this.safeSetState({
|
2709 | status: EXITED
|
2710 | }, function () {
|
2711 | _this3.props.onExited(node);
|
2712 | });
|
2713 | return;
|
2714 | }
|
2715 |
|
2716 | this.props.onExit(node);
|
2717 | this.safeSetState({
|
2718 | status: EXITING
|
2719 | }, function () {
|
2720 | _this3.props.onExiting(node);
|
2721 |
|
2722 | _this3.onTransitionEnd(node, timeouts.exit, function () {
|
2723 | _this3.safeSetState({
|
2724 | status: EXITED
|
2725 | }, function () {
|
2726 | _this3.props.onExited(node);
|
2727 | });
|
2728 | });
|
2729 | });
|
2730 | };
|
2731 |
|
2732 | _proto.cancelNextCallback = function cancelNextCallback() {
|
2733 | if (this.nextCallback !== null) {
|
2734 | this.nextCallback.cancel();
|
2735 | this.nextCallback = null;
|
2736 | }
|
2737 | };
|
2738 |
|
2739 | _proto.safeSetState = function safeSetState(nextState, callback) {
|
2740 |
|
2741 |
|
2742 |
|
2743 | callback = this.setNextCallback(callback);
|
2744 | this.setState(nextState, callback);
|
2745 | };
|
2746 |
|
2747 | _proto.setNextCallback = function setNextCallback(callback) {
|
2748 | var _this4 = this;
|
2749 |
|
2750 | var active = true;
|
2751 |
|
2752 | this.nextCallback = function (event) {
|
2753 | if (active) {
|
2754 | active = false;
|
2755 | _this4.nextCallback = null;
|
2756 | callback(event);
|
2757 | }
|
2758 | };
|
2759 |
|
2760 | this.nextCallback.cancel = function () {
|
2761 | active = false;
|
2762 | };
|
2763 |
|
2764 | return this.nextCallback;
|
2765 | };
|
2766 |
|
2767 | _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
|
2768 | this.setNextCallback(handler);
|
2769 | var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
|
2770 |
|
2771 | if (!node || doesNotHaveTimeoutOrListener) {
|
2772 | setTimeout(this.nextCallback, 0);
|
2773 | return;
|
2774 | }
|
2775 |
|
2776 | if (this.props.addEndListener) {
|
2777 | this.props.addEndListener(node, this.nextCallback);
|
2778 | }
|
2779 |
|
2780 | if (timeout != null) {
|
2781 | setTimeout(this.nextCallback, timeout);
|
2782 | }
|
2783 | };
|
2784 |
|
2785 | _proto.render = function render() {
|
2786 | var status = this.state.status;
|
2787 |
|
2788 | if (status === UNMOUNTED) {
|
2789 | return null;
|
2790 | }
|
2791 |
|
2792 | var _this$props = this.props,
|
2793 | children = _this$props.children,
|
2794 | childProps = _objectWithoutPropertiesLoose(_this$props, ["children"]);
|
2795 |
|
2796 |
|
2797 | delete childProps.in;
|
2798 | delete childProps.mountOnEnter;
|
2799 | delete childProps.unmountOnExit;
|
2800 | delete childProps.appear;
|
2801 | delete childProps.enter;
|
2802 | delete childProps.exit;
|
2803 | delete childProps.timeout;
|
2804 | delete childProps.addEndListener;
|
2805 | delete childProps.onEnter;
|
2806 | delete childProps.onEntering;
|
2807 | delete childProps.onEntered;
|
2808 | delete childProps.onExit;
|
2809 | delete childProps.onExiting;
|
2810 | delete childProps.onExited;
|
2811 |
|
2812 | if (typeof children === 'function') {
|
2813 | return children(status, childProps);
|
2814 | }
|
2815 |
|
2816 | var child = _react.default.Children.only(children);
|
2817 |
|
2818 | return _react.default.cloneElement(child, childProps);
|
2819 | };
|
2820 |
|
2821 | return Transition;
|
2822 | }(_react.default.Component);
|
2823 |
|
2824 | Transition.contextTypes = {
|
2825 | transitionGroup: PropTypes.object
|
2826 | };
|
2827 | Transition.childContextTypes = {
|
2828 | transitionGroup: function transitionGroup() {}
|
2829 | };
|
2830 | Transition.propTypes = {};
|
2831 |
|
2832 | function noop() {}
|
2833 |
|
2834 | Transition.defaultProps = {
|
2835 | in: false,
|
2836 | mountOnEnter: false,
|
2837 | unmountOnExit: false,
|
2838 | appear: false,
|
2839 | enter: true,
|
2840 | exit: true,
|
2841 | onEnter: noop,
|
2842 | onEntering: noop,
|
2843 | onEntered: noop,
|
2844 | onExit: noop,
|
2845 | onExiting: noop,
|
2846 | onExited: noop
|
2847 | };
|
2848 | Transition.UNMOUNTED = 0;
|
2849 | Transition.EXITED = 1;
|
2850 | Transition.ENTERING = 2;
|
2851 | Transition.ENTERED = 3;
|
2852 | Transition.EXITING = 4;
|
2853 |
|
2854 | var _default = (0, _reactLifecyclesCompat.polyfill)(Transition);
|
2855 |
|
2856 | exports.default = _default;
|
2857 | });
|
2858 | unwrapExports(Transition_1);
|
2859 | var Transition_2 = Transition_1.EXITING;
|
2860 | var Transition_3 = Transition_1.ENTERED;
|
2861 | var Transition_4 = Transition_1.ENTERING;
|
2862 | var Transition_5 = Transition_1.EXITED;
|
2863 | var Transition_6 = Transition_1.UNMOUNTED;
|
2864 |
|
2865 | var CSSTransition_1 = createCommonjsModule(function (module, exports) {
|
2866 |
|
2867 | exports.__esModule = true;
|
2868 | exports.default = void 0;
|
2869 |
|
2870 | var PropTypes = _interopRequireWildcard(propTypes);
|
2871 |
|
2872 | var _addClass = _interopRequireDefault(addClass_1);
|
2873 |
|
2874 | var _removeClass = _interopRequireDefault(removeClass);
|
2875 |
|
2876 | var _react = _interopRequireDefault(React__default);
|
2877 |
|
2878 | var _Transition = _interopRequireDefault(Transition_1);
|
2879 |
|
2880 | function _interopRequireDefault(obj) {
|
2881 | return obj && obj.__esModule ? obj : {
|
2882 | default: obj
|
2883 | };
|
2884 | }
|
2885 |
|
2886 | function _interopRequireWildcard(obj) {
|
2887 | if (obj && obj.__esModule) {
|
2888 | return obj;
|
2889 | } else {
|
2890 | var newObj = {};
|
2891 |
|
2892 | if (obj != null) {
|
2893 | for (var key in obj) {
|
2894 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
2895 | var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
2896 |
|
2897 | if (desc.get || desc.set) {
|
2898 | Object.defineProperty(newObj, key, desc);
|
2899 | } else {
|
2900 | newObj[key] = obj[key];
|
2901 | }
|
2902 | }
|
2903 | }
|
2904 | }
|
2905 |
|
2906 | newObj.default = obj;
|
2907 | return newObj;
|
2908 | }
|
2909 | }
|
2910 |
|
2911 | function _extends() {
|
2912 | _extends = Object.assign || function (target) {
|
2913 | for (var i = 1; i < arguments.length; i++) {
|
2914 | var source = arguments[i];
|
2915 |
|
2916 | for (var key in source) {
|
2917 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
2918 | target[key] = source[key];
|
2919 | }
|
2920 | }
|
2921 | }
|
2922 |
|
2923 | return target;
|
2924 | };
|
2925 |
|
2926 | return _extends.apply(this, arguments);
|
2927 | }
|
2928 |
|
2929 | function _inheritsLoose(subClass, superClass) {
|
2930 | subClass.prototype = Object.create(superClass.prototype);
|
2931 | subClass.prototype.constructor = subClass;
|
2932 | subClass.__proto__ = superClass;
|
2933 | }
|
2934 |
|
2935 | var addClass = function addClass(node, classes) {
|
2936 | return node && classes && classes.split(' ').forEach(function (c) {
|
2937 | return (0, _addClass.default)(node, c);
|
2938 | });
|
2939 | };
|
2940 |
|
2941 | var removeClass$1 = function removeClass(node, classes) {
|
2942 | return node && classes && classes.split(' ').forEach(function (c) {
|
2943 | return (0, _removeClass.default)(node, c);
|
2944 | });
|
2945 | };
|
2946 | |
2947 |
|
2948 |
|
2949 |
|
2950 |
|
2951 |
|
2952 |
|
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 |
|
2958 |
|
2959 |
|
2960 |
|
2961 |
|
2962 |
|
2963 |
|
2964 |
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 |
|
2970 |
|
2971 |
|
2972 |
|
2973 |
|
2974 |
|
2975 |
|
2976 |
|
2977 |
|
2978 |
|
2979 |
|
2980 |
|
2981 |
|
2982 |
|
2983 |
|
2984 |
|
2985 |
|
2986 |
|
2987 |
|
2988 |
|
2989 |
|
2990 |
|
2991 |
|
2992 |
|
2993 |
|
2994 |
|
2995 |
|
2996 |
|
2997 |
|
2998 |
|
2999 |
|
3000 |
|
3001 |
|
3002 |
|
3003 |
|
3004 |
|
3005 |
|
3006 |
|
3007 |
|
3008 | var CSSTransition = function (_React$Component) {
|
3009 | _inheritsLoose(CSSTransition, _React$Component);
|
3010 |
|
3011 | function CSSTransition() {
|
3012 | var _this;
|
3013 |
|
3014 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
3015 | args[_key] = arguments[_key];
|
3016 | }
|
3017 |
|
3018 | _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
3019 |
|
3020 | _this.onEnter = function (node, appearing) {
|
3021 | var _this$getClassNames = _this.getClassNames(appearing ? 'appear' : 'enter'),
|
3022 | className = _this$getClassNames.className;
|
3023 |
|
3024 | _this.removeClasses(node, 'exit');
|
3025 |
|
3026 | addClass(node, className);
|
3027 |
|
3028 | if (_this.props.onEnter) {
|
3029 | _this.props.onEnter(node, appearing);
|
3030 | }
|
3031 | };
|
3032 |
|
3033 | _this.onEntering = function (node, appearing) {
|
3034 | var _this$getClassNames2 = _this.getClassNames(appearing ? 'appear' : 'enter'),
|
3035 | activeClassName = _this$getClassNames2.activeClassName;
|
3036 |
|
3037 | _this.reflowAndAddClass(node, activeClassName);
|
3038 |
|
3039 | if (_this.props.onEntering) {
|
3040 | _this.props.onEntering(node, appearing);
|
3041 | }
|
3042 | };
|
3043 |
|
3044 | _this.onEntered = function (node, appearing) {
|
3045 | var appearClassName = _this.getClassNames('appear').doneClassName;
|
3046 |
|
3047 | var enterClassName = _this.getClassNames('enter').doneClassName;
|
3048 |
|
3049 | var doneClassName = appearing ? appearClassName + " " + enterClassName : enterClassName;
|
3050 |
|
3051 | _this.removeClasses(node, appearing ? 'appear' : 'enter');
|
3052 |
|
3053 | addClass(node, doneClassName);
|
3054 |
|
3055 | if (_this.props.onEntered) {
|
3056 | _this.props.onEntered(node, appearing);
|
3057 | }
|
3058 | };
|
3059 |
|
3060 | _this.onExit = function (node) {
|
3061 | var _this$getClassNames3 = _this.getClassNames('exit'),
|
3062 | className = _this$getClassNames3.className;
|
3063 |
|
3064 | _this.removeClasses(node, 'appear');
|
3065 |
|
3066 | _this.removeClasses(node, 'enter');
|
3067 |
|
3068 | addClass(node, className);
|
3069 |
|
3070 | if (_this.props.onExit) {
|
3071 | _this.props.onExit(node);
|
3072 | }
|
3073 | };
|
3074 |
|
3075 | _this.onExiting = function (node) {
|
3076 | var _this$getClassNames4 = _this.getClassNames('exit'),
|
3077 | activeClassName = _this$getClassNames4.activeClassName;
|
3078 |
|
3079 | _this.reflowAndAddClass(node, activeClassName);
|
3080 |
|
3081 | if (_this.props.onExiting) {
|
3082 | _this.props.onExiting(node);
|
3083 | }
|
3084 | };
|
3085 |
|
3086 | _this.onExited = function (node) {
|
3087 | var _this$getClassNames5 = _this.getClassNames('exit'),
|
3088 | doneClassName = _this$getClassNames5.doneClassName;
|
3089 |
|
3090 | _this.removeClasses(node, 'exit');
|
3091 |
|
3092 | addClass(node, doneClassName);
|
3093 |
|
3094 | if (_this.props.onExited) {
|
3095 | _this.props.onExited(node);
|
3096 | }
|
3097 | };
|
3098 |
|
3099 | _this.getClassNames = function (type) {
|
3100 | var classNames = _this.props.classNames;
|
3101 | var isStringClassNames = typeof classNames === 'string';
|
3102 | var prefix = isStringClassNames && classNames ? classNames + '-' : '';
|
3103 | var className = isStringClassNames ? prefix + type : classNames[type];
|
3104 | var activeClassName = isStringClassNames ? className + '-active' : classNames[type + 'Active'];
|
3105 | var doneClassName = isStringClassNames ? className + '-done' : classNames[type + 'Done'];
|
3106 | return {
|
3107 | className: className,
|
3108 | activeClassName: activeClassName,
|
3109 | doneClassName: doneClassName
|
3110 | };
|
3111 | };
|
3112 |
|
3113 | return _this;
|
3114 | }
|
3115 |
|
3116 | var _proto = CSSTransition.prototype;
|
3117 |
|
3118 | _proto.removeClasses = function removeClasses(node, type) {
|
3119 | var _this$getClassNames6 = this.getClassNames(type),
|
3120 | className = _this$getClassNames6.className,
|
3121 | activeClassName = _this$getClassNames6.activeClassName,
|
3122 | doneClassName = _this$getClassNames6.doneClassName;
|
3123 |
|
3124 | className && removeClass$1(node, className);
|
3125 | activeClassName && removeClass$1(node, activeClassName);
|
3126 | doneClassName && removeClass$1(node, doneClassName);
|
3127 | };
|
3128 |
|
3129 | _proto.reflowAndAddClass = function reflowAndAddClass(node, className) {
|
3130 |
|
3131 |
|
3132 | if (className) {
|
3133 |
|
3134 | node && node.scrollTop;
|
3135 |
|
3136 |
|
3137 | addClass(node, className);
|
3138 | }
|
3139 | };
|
3140 |
|
3141 | _proto.render = function render() {
|
3142 | var props = _extends({}, this.props);
|
3143 |
|
3144 | delete props.classNames;
|
3145 | return _react.default.createElement(_Transition.default, _extends({}, props, {
|
3146 | onEnter: this.onEnter,
|
3147 | onEntered: this.onEntered,
|
3148 | onEntering: this.onEntering,
|
3149 | onExit: this.onExit,
|
3150 | onExiting: this.onExiting,
|
3151 | onExited: this.onExited
|
3152 | }));
|
3153 | };
|
3154 |
|
3155 | return CSSTransition;
|
3156 | }(_react.default.Component);
|
3157 |
|
3158 | CSSTransition.defaultProps = {
|
3159 | classNames: ''
|
3160 | };
|
3161 | CSSTransition.propTypes = {};
|
3162 | var _default = CSSTransition;
|
3163 | exports.default = _default;
|
3164 | module.exports = exports["default"];
|
3165 | });
|
3166 | unwrapExports(CSSTransition_1);
|
3167 |
|
3168 | var ChildMapping = createCommonjsModule(function (module, exports) {
|
3169 |
|
3170 | exports.__esModule = true;
|
3171 | exports.getChildMapping = getChildMapping;
|
3172 | exports.mergeChildMappings = mergeChildMappings;
|
3173 | exports.getInitialChildMapping = getInitialChildMapping;
|
3174 | exports.getNextChildMapping = getNextChildMapping;
|
3175 | |
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 | function getChildMapping(children, mapFn) {
|
3183 | var mapper = function mapper(child) {
|
3184 | return mapFn && (0, React__default.isValidElement)(child) ? mapFn(child) : child;
|
3185 | };
|
3186 |
|
3187 | var result = Object.create(null);
|
3188 | if (children) React__default.Children.map(children, function (c) {
|
3189 | return c;
|
3190 | }).forEach(function (child) {
|
3191 |
|
3192 | result[child.key] = mapper(child);
|
3193 | });
|
3194 | return result;
|
3195 | }
|
3196 | |
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 | function mergeChildMappings(prev, next) {
|
3216 | prev = prev || {};
|
3217 | next = next || {};
|
3218 |
|
3219 | function getValueForKey(key) {
|
3220 | return key in next ? next[key] : prev[key];
|
3221 | }
|
3222 |
|
3223 |
|
3224 |
|
3225 | var nextKeysPending = Object.create(null);
|
3226 | var pendingKeys = [];
|
3227 |
|
3228 | for (var prevKey in prev) {
|
3229 | if (prevKey in next) {
|
3230 | if (pendingKeys.length) {
|
3231 | nextKeysPending[prevKey] = pendingKeys;
|
3232 | pendingKeys = [];
|
3233 | }
|
3234 | } else {
|
3235 | pendingKeys.push(prevKey);
|
3236 | }
|
3237 | }
|
3238 |
|
3239 | var i;
|
3240 | var childMapping = {};
|
3241 |
|
3242 | for (var nextKey in next) {
|
3243 | if (nextKeysPending[nextKey]) {
|
3244 | for (i = 0; i < nextKeysPending[nextKey].length; i++) {
|
3245 | var pendingNextKey = nextKeysPending[nextKey][i];
|
3246 | childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
|
3247 | }
|
3248 | }
|
3249 |
|
3250 | childMapping[nextKey] = getValueForKey(nextKey);
|
3251 | }
|
3252 |
|
3253 |
|
3254 | for (i = 0; i < pendingKeys.length; i++) {
|
3255 | childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
|
3256 | }
|
3257 |
|
3258 | return childMapping;
|
3259 | }
|
3260 |
|
3261 | function getProp(child, prop, props) {
|
3262 | return props[prop] != null ? props[prop] : child.props[prop];
|
3263 | }
|
3264 |
|
3265 | function getInitialChildMapping(props, onExited) {
|
3266 | return getChildMapping(props.children, function (child) {
|
3267 | return (0, React__default.cloneElement)(child, {
|
3268 | onExited: onExited.bind(null, child),
|
3269 | in: true,
|
3270 | appear: getProp(child, 'appear', props),
|
3271 | enter: getProp(child, 'enter', props),
|
3272 | exit: getProp(child, 'exit', props)
|
3273 | });
|
3274 | });
|
3275 | }
|
3276 |
|
3277 | function getNextChildMapping(nextProps, prevChildMapping, onExited) {
|
3278 | var nextChildMapping = getChildMapping(nextProps.children);
|
3279 | var children = mergeChildMappings(prevChildMapping, nextChildMapping);
|
3280 | Object.keys(children).forEach(function (key) {
|
3281 | var child = children[key];
|
3282 | if (!(0, React__default.isValidElement)(child)) return;
|
3283 | var hasPrev = (key in prevChildMapping);
|
3284 | var hasNext = (key in nextChildMapping);
|
3285 | var prevChild = prevChildMapping[key];
|
3286 | var isLeaving = (0, React__default.isValidElement)(prevChild) && !prevChild.props.in;
|
3287 |
|
3288 | if (hasNext && (!hasPrev || isLeaving)) {
|
3289 |
|
3290 | children[key] = (0, React__default.cloneElement)(child, {
|
3291 | onExited: onExited.bind(null, child),
|
3292 | in: true,
|
3293 | exit: getProp(child, 'exit', nextProps),
|
3294 | enter: getProp(child, 'enter', nextProps)
|
3295 | });
|
3296 | } else if (!hasNext && hasPrev && !isLeaving) {
|
3297 |
|
3298 |
|
3299 | children[key] = (0, React__default.cloneElement)(child, {
|
3300 | in: false
|
3301 | });
|
3302 | } else if (hasNext && hasPrev && (0, React__default.isValidElement)(prevChild)) {
|
3303 |
|
3304 |
|
3305 |
|
3306 | children[key] = (0, React__default.cloneElement)(child, {
|
3307 | onExited: onExited.bind(null, child),
|
3308 | in: prevChild.props.in,
|
3309 | exit: getProp(child, 'exit', nextProps),
|
3310 | enter: getProp(child, 'enter', nextProps)
|
3311 | });
|
3312 | }
|
3313 | });
|
3314 | return children;
|
3315 | }
|
3316 | });
|
3317 | unwrapExports(ChildMapping);
|
3318 | var ChildMapping_1 = ChildMapping.getChildMapping;
|
3319 | var ChildMapping_2 = ChildMapping.mergeChildMappings;
|
3320 | var ChildMapping_3 = ChildMapping.getInitialChildMapping;
|
3321 | var ChildMapping_4 = ChildMapping.getNextChildMapping;
|
3322 |
|
3323 | var TransitionGroup_1 = createCommonjsModule(function (module, exports) {
|
3324 |
|
3325 | exports.__esModule = true;
|
3326 | exports.default = void 0;
|
3327 |
|
3328 | var _propTypes = _interopRequireDefault(propTypes);
|
3329 |
|
3330 | var _react = _interopRequireDefault(React__default);
|
3331 |
|
3332 | function _interopRequireDefault(obj) {
|
3333 | return obj && obj.__esModule ? obj : {
|
3334 | default: obj
|
3335 | };
|
3336 | }
|
3337 |
|
3338 | function _objectWithoutPropertiesLoose(source, excluded) {
|
3339 | if (source == null) return {};
|
3340 | var target = {};
|
3341 | var sourceKeys = Object.keys(source);
|
3342 | var key, i;
|
3343 |
|
3344 | for (i = 0; i < sourceKeys.length; i++) {
|
3345 | key = sourceKeys[i];
|
3346 | if (excluded.indexOf(key) >= 0) continue;
|
3347 | target[key] = source[key];
|
3348 | }
|
3349 |
|
3350 | return target;
|
3351 | }
|
3352 |
|
3353 | function _extends() {
|
3354 | _extends = Object.assign || function (target) {
|
3355 | for (var i = 1; i < arguments.length; i++) {
|
3356 | var source = arguments[i];
|
3357 |
|
3358 | for (var key in source) {
|
3359 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
3360 | target[key] = source[key];
|
3361 | }
|
3362 | }
|
3363 | }
|
3364 |
|
3365 | return target;
|
3366 | };
|
3367 |
|
3368 | return _extends.apply(this, arguments);
|
3369 | }
|
3370 |
|
3371 | function _inheritsLoose(subClass, superClass) {
|
3372 | subClass.prototype = Object.create(superClass.prototype);
|
3373 | subClass.prototype.constructor = subClass;
|
3374 | subClass.__proto__ = superClass;
|
3375 | }
|
3376 |
|
3377 | function _assertThisInitialized(self) {
|
3378 | if (self === void 0) {
|
3379 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
3380 | }
|
3381 |
|
3382 | return self;
|
3383 | }
|
3384 |
|
3385 | var values = Object.values || function (obj) {
|
3386 | return Object.keys(obj).map(function (k) {
|
3387 | return obj[k];
|
3388 | });
|
3389 | };
|
3390 |
|
3391 | var defaultProps = {
|
3392 | component: 'div',
|
3393 | childFactory: function childFactory(child) {
|
3394 | return child;
|
3395 | }
|
3396 | |
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 |
|
3402 |
|
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 |
|
3410 |
|
3411 | };
|
3412 |
|
3413 | var TransitionGroup = function (_React$Component) {
|
3414 | _inheritsLoose(TransitionGroup, _React$Component);
|
3415 |
|
3416 | function TransitionGroup(props, context) {
|
3417 | var _this;
|
3418 |
|
3419 | _this = _React$Component.call(this, props, context) || this;
|
3420 |
|
3421 | var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
3422 |
|
3423 |
|
3424 | _this.state = {
|
3425 | handleExited: handleExited,
|
3426 | firstRender: true
|
3427 | };
|
3428 | return _this;
|
3429 | }
|
3430 |
|
3431 | var _proto = TransitionGroup.prototype;
|
3432 |
|
3433 | _proto.getChildContext = function getChildContext() {
|
3434 | return {
|
3435 | transitionGroup: {
|
3436 | isMounting: !this.appeared
|
3437 | }
|
3438 | };
|
3439 | };
|
3440 |
|
3441 | _proto.componentDidMount = function componentDidMount() {
|
3442 | this.appeared = true;
|
3443 | this.mounted = true;
|
3444 | };
|
3445 |
|
3446 | _proto.componentWillUnmount = function componentWillUnmount() {
|
3447 | this.mounted = false;
|
3448 | };
|
3449 |
|
3450 | TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
|
3451 | var prevChildMapping = _ref.children,
|
3452 | handleExited = _ref.handleExited,
|
3453 | firstRender = _ref.firstRender;
|
3454 | return {
|
3455 | children: firstRender ? (0, ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),
|
3456 | firstRender: false
|
3457 | };
|
3458 | };
|
3459 |
|
3460 | _proto.handleExited = function handleExited(child, node) {
|
3461 | var currentChildMapping = (0, ChildMapping.getChildMapping)(this.props.children);
|
3462 | if (child.key in currentChildMapping) return;
|
3463 |
|
3464 | if (child.props.onExited) {
|
3465 | child.props.onExited(node);
|
3466 | }
|
3467 |
|
3468 | if (this.mounted) {
|
3469 | this.setState(function (state) {
|
3470 | var children = _extends({}, state.children);
|
3471 |
|
3472 | delete children[child.key];
|
3473 | return {
|
3474 | children: children
|
3475 | };
|
3476 | });
|
3477 | }
|
3478 | };
|
3479 |
|
3480 | _proto.render = function render() {
|
3481 | var _this$props = this.props,
|
3482 | Component = _this$props.component,
|
3483 | childFactory = _this$props.childFactory,
|
3484 | props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
|
3485 |
|
3486 | var children = values(this.state.children).map(childFactory);
|
3487 | delete props.appear;
|
3488 | delete props.enter;
|
3489 | delete props.exit;
|
3490 |
|
3491 | if (Component === null) {
|
3492 | return children;
|
3493 | }
|
3494 |
|
3495 | return _react.default.createElement(Component, props, children);
|
3496 | };
|
3497 |
|
3498 | return TransitionGroup;
|
3499 | }(_react.default.Component);
|
3500 |
|
3501 | TransitionGroup.childContextTypes = {
|
3502 | transitionGroup: _propTypes.default.object.isRequired
|
3503 | };
|
3504 | TransitionGroup.propTypes = {};
|
3505 | TransitionGroup.defaultProps = defaultProps;
|
3506 |
|
3507 | var _default = (0, _reactLifecyclesCompat.polyfill)(TransitionGroup);
|
3508 |
|
3509 | exports.default = _default;
|
3510 | module.exports = exports["default"];
|
3511 | });
|
3512 | unwrapExports(TransitionGroup_1);
|
3513 |
|
3514 | var ReplaceTransition_1 = createCommonjsModule(function (module, exports) {
|
3515 |
|
3516 | exports.__esModule = true;
|
3517 | exports.default = void 0;
|
3518 |
|
3519 | var _propTypes = _interopRequireDefault(propTypes);
|
3520 |
|
3521 | var _react = _interopRequireDefault(React__default);
|
3522 |
|
3523 | var _TransitionGroup = _interopRequireDefault(TransitionGroup_1);
|
3524 |
|
3525 | function _interopRequireDefault(obj) {
|
3526 | return obj && obj.__esModule ? obj : {
|
3527 | default: obj
|
3528 | };
|
3529 | }
|
3530 |
|
3531 | function _objectWithoutPropertiesLoose(source, excluded) {
|
3532 | if (source == null) return {};
|
3533 | var target = {};
|
3534 | var sourceKeys = Object.keys(source);
|
3535 | var key, i;
|
3536 |
|
3537 | for (i = 0; i < sourceKeys.length; i++) {
|
3538 | key = sourceKeys[i];
|
3539 | if (excluded.indexOf(key) >= 0) continue;
|
3540 | target[key] = source[key];
|
3541 | }
|
3542 |
|
3543 | return target;
|
3544 | }
|
3545 |
|
3546 | function _inheritsLoose(subClass, superClass) {
|
3547 | subClass.prototype = Object.create(superClass.prototype);
|
3548 | subClass.prototype.constructor = subClass;
|
3549 | subClass.__proto__ = superClass;
|
3550 | }
|
3551 | |
3552 |
|
3553 |
|
3554 |
|
3555 |
|
3556 |
|
3557 |
|
3558 |
|
3559 |
|
3560 |
|
3561 |
|
3562 |
|
3563 |
|
3564 | var ReplaceTransition = function (_React$Component) {
|
3565 | _inheritsLoose(ReplaceTransition, _React$Component);
|
3566 |
|
3567 | function ReplaceTransition() {
|
3568 | var _this;
|
3569 |
|
3570 | for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
3571 | _args[_key] = arguments[_key];
|
3572 | }
|
3573 |
|
3574 | _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
|
3575 |
|
3576 | _this.handleEnter = function () {
|
3577 | for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
3578 | args[_key2] = arguments[_key2];
|
3579 | }
|
3580 |
|
3581 | return _this.handleLifecycle('onEnter', 0, args);
|
3582 | };
|
3583 |
|
3584 | _this.handleEntering = function () {
|
3585 | for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
3586 | args[_key3] = arguments[_key3];
|
3587 | }
|
3588 |
|
3589 | return _this.handleLifecycle('onEntering', 0, args);
|
3590 | };
|
3591 |
|
3592 | _this.handleEntered = function () {
|
3593 | for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
3594 | args[_key4] = arguments[_key4];
|
3595 | }
|
3596 |
|
3597 | return _this.handleLifecycle('onEntered', 0, args);
|
3598 | };
|
3599 |
|
3600 | _this.handleExit = function () {
|
3601 | for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
3602 | args[_key5] = arguments[_key5];
|
3603 | }
|
3604 |
|
3605 | return _this.handleLifecycle('onExit', 1, args);
|
3606 | };
|
3607 |
|
3608 | _this.handleExiting = function () {
|
3609 | for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
3610 | args[_key6] = arguments[_key6];
|
3611 | }
|
3612 |
|
3613 | return _this.handleLifecycle('onExiting', 1, args);
|
3614 | };
|
3615 |
|
3616 | _this.handleExited = function () {
|
3617 | for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
3618 | args[_key7] = arguments[_key7];
|
3619 | }
|
3620 |
|
3621 | return _this.handleLifecycle('onExited', 1, args);
|
3622 | };
|
3623 |
|
3624 | return _this;
|
3625 | }
|
3626 |
|
3627 | var _proto = ReplaceTransition.prototype;
|
3628 |
|
3629 | _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
|
3630 | var _child$props;
|
3631 |
|
3632 | var children = this.props.children;
|
3633 |
|
3634 | var child = _react.default.Children.toArray(children)[idx];
|
3635 |
|
3636 | if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
|
3637 | if (this.props[handler]) this.props[handler]((0, ReactDOM.findDOMNode)(this));
|
3638 | };
|
3639 |
|
3640 | _proto.render = function render() {
|
3641 | var _this$props = this.props,
|
3642 | children = _this$props.children,
|
3643 | inProp = _this$props.in,
|
3644 | props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
|
3645 |
|
3646 | var _React$Children$toArr = _react.default.Children.toArray(children),
|
3647 | first = _React$Children$toArr[0],
|
3648 | second = _React$Children$toArr[1];
|
3649 |
|
3650 | delete props.onEnter;
|
3651 | delete props.onEntering;
|
3652 | delete props.onEntered;
|
3653 | delete props.onExit;
|
3654 | delete props.onExiting;
|
3655 | delete props.onExited;
|
3656 | return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {
|
3657 | key: 'first',
|
3658 | onEnter: this.handleEnter,
|
3659 | onEntering: this.handleEntering,
|
3660 | onEntered: this.handleEntered
|
3661 | }) : _react.default.cloneElement(second, {
|
3662 | key: 'second',
|
3663 | onEnter: this.handleExit,
|
3664 | onEntering: this.handleExiting,
|
3665 | onEntered: this.handleExited
|
3666 | }));
|
3667 | };
|
3668 |
|
3669 | return ReplaceTransition;
|
3670 | }(_react.default.Component);
|
3671 |
|
3672 | ReplaceTransition.propTypes = {};
|
3673 | var _default = ReplaceTransition;
|
3674 | exports.default = _default;
|
3675 | module.exports = exports["default"];
|
3676 | });
|
3677 | unwrapExports(ReplaceTransition_1);
|
3678 |
|
3679 | var reactTransitionGroup = createCommonjsModule(function (module) {
|
3680 |
|
3681 | var _CSSTransition = _interopRequireDefault(CSSTransition_1);
|
3682 |
|
3683 | var _ReplaceTransition = _interopRequireDefault(ReplaceTransition_1);
|
3684 |
|
3685 | var _TransitionGroup = _interopRequireDefault(TransitionGroup_1);
|
3686 |
|
3687 | var _Transition = _interopRequireDefault(Transition_1);
|
3688 |
|
3689 | function _interopRequireDefault(obj) {
|
3690 | return obj && obj.__esModule ? obj : {
|
3691 | default: obj
|
3692 | };
|
3693 | }
|
3694 |
|
3695 | module.exports = {
|
3696 | Transition: _Transition.default,
|
3697 | TransitionGroup: _TransitionGroup.default,
|
3698 | ReplaceTransition: _ReplaceTransition.default,
|
3699 | CSSTransition: _CSSTransition.default
|
3700 | };
|
3701 | });
|
3702 | unwrapExports(reactTransitionGroup);
|
3703 | var reactTransitionGroup_1 = reactTransitionGroup.Transition;
|
3704 | var reactTransitionGroup_2 = reactTransitionGroup.TransitionGroup;
|
3705 | var reactTransitionGroup_3 = reactTransitionGroup.ReplaceTransition;
|
3706 | var reactTransitionGroup_4 = reactTransitionGroup.CSSTransition;
|
3707 |
|
3708 | var propTypes$m = _extends({}, reactTransitionGroup_1.propTypes, {
|
3709 | children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
|
3710 | tag: tagPropType,
|
3711 | baseClass: propTypes.string,
|
3712 | baseClassActive: propTypes.string,
|
3713 | className: propTypes.string,
|
3714 | cssModule: propTypes.object,
|
3715 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
|
3716 | });
|
3717 |
|
3718 | var defaultProps$k = _extends({}, reactTransitionGroup_1.defaultProps, {
|
3719 | tag: 'div',
|
3720 | baseClass: 'fade',
|
3721 | baseClassActive: 'show',
|
3722 | timeout: TransitionTimeouts.Fade,
|
3723 | appear: true,
|
3724 | enter: true,
|
3725 | exit: true,
|
3726 | in: true
|
3727 | });
|
3728 |
|
3729 | function Fade(props) {
|
3730 | var Tag = props.tag,
|
3731 | baseClass = props.baseClass,
|
3732 | baseClassActive = props.baseClassActive,
|
3733 | className = props.className,
|
3734 | cssModule = props.cssModule,
|
3735 | children = props.children,
|
3736 | innerRef = props.innerRef,
|
3737 | otherProps = _objectWithoutPropertiesLoose(props, ["tag", "baseClass", "baseClassActive", "className", "cssModule", "children", "innerRef"]);
|
3738 |
|
3739 | var transitionProps = pick(otherProps, TransitionPropTypeKeys);
|
3740 | var childProps = omit(otherProps, TransitionPropTypeKeys);
|
3741 | return React__default.createElement(reactTransitionGroup_1, transitionProps, function (status) {
|
3742 | var isActive = status === 'entered';
|
3743 | var classes = mapToCssModules(classnames(className, baseClass, isActive && baseClassActive), cssModule);
|
3744 | return React__default.createElement(Tag, _extends({
|
3745 | className: classes
|
3746 | }, childProps, {
|
3747 | ref: innerRef
|
3748 | }), children);
|
3749 | });
|
3750 | }
|
3751 |
|
3752 | Fade.propTypes = propTypes$m;
|
3753 | Fade.defaultProps = defaultProps$k;
|
3754 |
|
3755 | var propTypes$n = {
|
3756 | color: propTypes.string,
|
3757 | pill: propTypes.bool,
|
3758 | tag: tagPropType,
|
3759 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
|
3760 | children: propTypes.node,
|
3761 | className: propTypes.string,
|
3762 | cssModule: propTypes.object
|
3763 | };
|
3764 | var defaultProps$l = {
|
3765 | color: 'secondary',
|
3766 | pill: false,
|
3767 | tag: 'span'
|
3768 | };
|
3769 |
|
3770 | var Badge = function Badge(props) {
|
3771 | var className = props.className,
|
3772 | cssModule = props.cssModule,
|
3773 | color = props.color,
|
3774 | innerRef = props.innerRef,
|
3775 | pill = props.pill,
|
3776 | Tag = props.tag,
|
3777 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "innerRef", "pill", "tag"]);
|
3778 |
|
3779 | var classes = mapToCssModules(classnames(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule);
|
3780 |
|
3781 | if (attributes.href && Tag === 'span') {
|
3782 | Tag = 'a';
|
3783 | }
|
3784 |
|
3785 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3786 | className: classes,
|
3787 | ref: innerRef
|
3788 | }));
|
3789 | };
|
3790 |
|
3791 | Badge.propTypes = propTypes$n;
|
3792 | Badge.defaultProps = defaultProps$l;
|
3793 |
|
3794 | var propTypes$o = {
|
3795 | tag: tagPropType,
|
3796 | inverse: propTypes.bool,
|
3797 | color: propTypes.string,
|
3798 | body: propTypes.bool,
|
3799 | outline: propTypes.bool,
|
3800 | className: propTypes.string,
|
3801 | cssModule: propTypes.object,
|
3802 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
|
3803 | };
|
3804 | var defaultProps$m = {
|
3805 | tag: 'div'
|
3806 | };
|
3807 |
|
3808 | var Card = function Card(props) {
|
3809 | var className = props.className,
|
3810 | cssModule = props.cssModule,
|
3811 | color = props.color,
|
3812 | body = props.body,
|
3813 | inverse = props.inverse,
|
3814 | outline = props.outline,
|
3815 | Tag = props.tag,
|
3816 | innerRef = props.innerRef,
|
3817 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "body", "inverse", "outline", "tag", "innerRef"]);
|
3818 |
|
3819 | var classes = mapToCssModules(classnames(className, 'card', inverse ? 'text-white' : false, body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + "-" + color : false), cssModule);
|
3820 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3821 | className: classes,
|
3822 | ref: innerRef
|
3823 | }));
|
3824 | };
|
3825 |
|
3826 | Card.propTypes = propTypes$o;
|
3827 | Card.defaultProps = defaultProps$m;
|
3828 |
|
3829 | var propTypes$p = {
|
3830 | tag: tagPropType,
|
3831 | className: propTypes.string,
|
3832 | cssModule: propTypes.object
|
3833 | };
|
3834 | var defaultProps$n = {
|
3835 | tag: 'div'
|
3836 | };
|
3837 |
|
3838 | var CardGroup = function CardGroup(props) {
|
3839 | var className = props.className,
|
3840 | cssModule = props.cssModule,
|
3841 | Tag = props.tag,
|
3842 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
3843 |
|
3844 | var classes = mapToCssModules(classnames(className, 'card-group'), cssModule);
|
3845 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3846 | className: classes
|
3847 | }));
|
3848 | };
|
3849 |
|
3850 | CardGroup.propTypes = propTypes$p;
|
3851 | CardGroup.defaultProps = defaultProps$n;
|
3852 |
|
3853 | var propTypes$q = {
|
3854 | tag: tagPropType,
|
3855 | className: propTypes.string,
|
3856 | cssModule: propTypes.object
|
3857 | };
|
3858 | var defaultProps$o = {
|
3859 | tag: 'div'
|
3860 | };
|
3861 |
|
3862 | var CardDeck = function CardDeck(props) {
|
3863 | var className = props.className,
|
3864 | cssModule = props.cssModule,
|
3865 | Tag = props.tag,
|
3866 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
3867 |
|
3868 | var classes = mapToCssModules(classnames(className, 'card-deck'), cssModule);
|
3869 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3870 | className: classes
|
3871 | }));
|
3872 | };
|
3873 |
|
3874 | CardDeck.propTypes = propTypes$q;
|
3875 | CardDeck.defaultProps = defaultProps$o;
|
3876 |
|
3877 | var propTypes$r = {
|
3878 | tag: tagPropType,
|
3879 | className: propTypes.string,
|
3880 | cssModule: propTypes.object
|
3881 | };
|
3882 | var defaultProps$p = {
|
3883 | tag: 'div'
|
3884 | };
|
3885 |
|
3886 | var CardColumns = function CardColumns(props) {
|
3887 | var className = props.className,
|
3888 | cssModule = props.cssModule,
|
3889 | Tag = props.tag,
|
3890 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
3891 |
|
3892 | var classes = mapToCssModules(classnames(className, 'card-columns'), cssModule);
|
3893 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3894 | className: classes
|
3895 | }));
|
3896 | };
|
3897 |
|
3898 | CardColumns.propTypes = propTypes$r;
|
3899 | CardColumns.defaultProps = defaultProps$p;
|
3900 |
|
3901 | var propTypes$s = {
|
3902 | tag: tagPropType,
|
3903 | className: propTypes.string,
|
3904 | cssModule: propTypes.object,
|
3905 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
|
3906 | };
|
3907 | var defaultProps$q = {
|
3908 | tag: 'div'
|
3909 | };
|
3910 |
|
3911 | var CardBody = function CardBody(props) {
|
3912 | var className = props.className,
|
3913 | cssModule = props.cssModule,
|
3914 | innerRef = props.innerRef,
|
3915 | Tag = props.tag,
|
3916 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
|
3917 |
|
3918 | var classes = mapToCssModules(classnames(className, 'card-body'), cssModule);
|
3919 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3920 | className: classes,
|
3921 | ref: innerRef
|
3922 | }));
|
3923 | };
|
3924 |
|
3925 | CardBody.propTypes = propTypes$s;
|
3926 | CardBody.defaultProps = defaultProps$q;
|
3927 |
|
3928 | var propTypes$t = {
|
3929 | tag: tagPropType,
|
3930 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
|
3931 | className: propTypes.string,
|
3932 | cssModule: propTypes.object
|
3933 | };
|
3934 | var defaultProps$r = {
|
3935 | tag: 'a'
|
3936 | };
|
3937 |
|
3938 | var CardLink = function CardLink(props) {
|
3939 | var className = props.className,
|
3940 | cssModule = props.cssModule,
|
3941 | Tag = props.tag,
|
3942 | innerRef = props.innerRef,
|
3943 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "innerRef"]);
|
3944 |
|
3945 | var classes = mapToCssModules(classnames(className, 'card-link'), cssModule);
|
3946 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3947 | ref: innerRef,
|
3948 | className: classes
|
3949 | }));
|
3950 | };
|
3951 |
|
3952 | CardLink.propTypes = propTypes$t;
|
3953 | CardLink.defaultProps = defaultProps$r;
|
3954 |
|
3955 | var propTypes$u = {
|
3956 | tag: tagPropType,
|
3957 | className: propTypes.string,
|
3958 | cssModule: propTypes.object
|
3959 | };
|
3960 | var defaultProps$s = {
|
3961 | tag: 'div'
|
3962 | };
|
3963 |
|
3964 | var CardFooter = function CardFooter(props) {
|
3965 | var className = props.className,
|
3966 | cssModule = props.cssModule,
|
3967 | Tag = props.tag,
|
3968 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
3969 |
|
3970 | var classes = mapToCssModules(classnames(className, 'card-footer'), cssModule);
|
3971 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3972 | className: classes
|
3973 | }));
|
3974 | };
|
3975 |
|
3976 | CardFooter.propTypes = propTypes$u;
|
3977 | CardFooter.defaultProps = defaultProps$s;
|
3978 |
|
3979 | var propTypes$v = {
|
3980 | tag: tagPropType,
|
3981 | className: propTypes.string,
|
3982 | cssModule: propTypes.object
|
3983 | };
|
3984 | var defaultProps$t = {
|
3985 | tag: 'div'
|
3986 | };
|
3987 |
|
3988 | var CardHeader = function CardHeader(props) {
|
3989 | var className = props.className,
|
3990 | cssModule = props.cssModule,
|
3991 | Tag = props.tag,
|
3992 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
3993 |
|
3994 | var classes = mapToCssModules(classnames(className, 'card-header'), cssModule);
|
3995 | return React__default.createElement(Tag, _extends({}, attributes, {
|
3996 | className: classes
|
3997 | }));
|
3998 | };
|
3999 |
|
4000 | CardHeader.propTypes = propTypes$v;
|
4001 | CardHeader.defaultProps = defaultProps$t;
|
4002 |
|
4003 | var propTypes$w = {
|
4004 | tag: tagPropType,
|
4005 | top: propTypes.bool,
|
4006 | bottom: propTypes.bool,
|
4007 | className: propTypes.string,
|
4008 | cssModule: propTypes.object
|
4009 | };
|
4010 | var defaultProps$u = {
|
4011 | tag: 'img'
|
4012 | };
|
4013 |
|
4014 | var CardImg = function CardImg(props) {
|
4015 | var className = props.className,
|
4016 | cssModule = props.cssModule,
|
4017 | top = props.top,
|
4018 | bottom = props.bottom,
|
4019 | Tag = props.tag,
|
4020 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "top", "bottom", "tag"]);
|
4021 |
|
4022 | var cardImgClassName = 'card-img';
|
4023 |
|
4024 | if (top) {
|
4025 | cardImgClassName = 'card-img-top';
|
4026 | }
|
4027 |
|
4028 | if (bottom) {
|
4029 | cardImgClassName = 'card-img-bottom';
|
4030 | }
|
4031 |
|
4032 | var classes = mapToCssModules(classnames(className, cardImgClassName), cssModule);
|
4033 | return React__default.createElement(Tag, _extends({}, attributes, {
|
4034 | className: classes
|
4035 | }));
|
4036 | };
|
4037 |
|
4038 | CardImg.propTypes = propTypes$w;
|
4039 | CardImg.defaultProps = defaultProps$u;
|
4040 |
|
4041 | var propTypes$x = {
|
4042 | tag: tagPropType,
|
4043 | className: propTypes.string,
|
4044 | cssModule: propTypes.object
|
4045 | };
|
4046 | var defaultProps$v = {
|
4047 | tag: 'div'
|
4048 | };
|
4049 |
|
4050 | var CardImgOverlay = function CardImgOverlay(props) {
|
4051 | var className = props.className,
|
4052 | cssModule = props.cssModule,
|
4053 | Tag = props.tag,
|
4054 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
4055 |
|
4056 | var classes = mapToCssModules(classnames(className, 'card-img-overlay'), cssModule);
|
4057 | return React__default.createElement(Tag, _extends({}, attributes, {
|
4058 | className: classes
|
4059 | }));
|
4060 | };
|
4061 |
|
4062 | CardImgOverlay.propTypes = propTypes$x;
|
4063 | CardImgOverlay.defaultProps = defaultProps$v;
|
4064 |
|
4065 | var CarouselItem = function (_React$Component) {
|
4066 | _inheritsLoose(CarouselItem, _React$Component);
|
4067 |
|
4068 | function CarouselItem(props) {
|
4069 | var _this;
|
4070 |
|
4071 | _this = _React$Component.call(this, props) || this;
|
4072 | _this.state = {
|
4073 | startAnimation: false
|
4074 | };
|
4075 | _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this));
|
4076 | _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_this));
|
4077 | _this.onExit = _this.onExit.bind(_assertThisInitialized(_this));
|
4078 | _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
|
4079 | _this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
|
4080 | return _this;
|
4081 | }
|
4082 |
|
4083 | var _proto = CarouselItem.prototype;
|
4084 |
|
4085 | _proto.onEnter = function onEnter(node, isAppearing) {
|
4086 | this.setState({
|
4087 | startAnimation: false
|
4088 | });
|
4089 | this.props.onEnter(node, isAppearing);
|
4090 | };
|
4091 |
|
4092 | _proto.onEntering = function onEntering(node, isAppearing) {
|
4093 |
|
4094 | var offsetHeight = node.offsetHeight;
|
4095 | this.setState({
|
4096 | startAnimation: true
|
4097 | });
|
4098 | this.props.onEntering(node, isAppearing);
|
4099 | return offsetHeight;
|
4100 | };
|
4101 |
|
4102 | _proto.onExit = function onExit(node) {
|
4103 | this.setState({
|
4104 | startAnimation: false
|
4105 | });
|
4106 | this.props.onExit(node);
|
4107 | };
|
4108 |
|
4109 | _proto.onExiting = function onExiting(node) {
|
4110 | this.setState({
|
4111 | startAnimation: true
|
4112 | });
|
4113 | node.dispatchEvent(new CustomEvent('slide.bs.carousel'));
|
4114 | this.props.onExiting(node);
|
4115 | };
|
4116 |
|
4117 | _proto.onExited = function onExited(node) {
|
4118 | node.dispatchEvent(new CustomEvent('slid.bs.carousel'));
|
4119 | this.props.onExited(node);
|
4120 | };
|
4121 |
|
4122 | _proto.render = function render() {
|
4123 | var _this2 = this;
|
4124 |
|
4125 | var _this$props = this.props,
|
4126 | isIn = _this$props.in,
|
4127 | children = _this$props.children,
|
4128 | cssModule = _this$props.cssModule,
|
4129 | slide = _this$props.slide,
|
4130 | Tag = _this$props.tag,
|
4131 | className = _this$props.className,
|
4132 | transitionProps = _objectWithoutPropertiesLoose(_this$props, ["in", "children", "cssModule", "slide", "tag", "className"]);
|
4133 |
|
4134 | return React__default.createElement(reactTransitionGroup_1, _extends({}, transitionProps, {
|
4135 | enter: slide,
|
4136 | exit: slide,
|
4137 | in: isIn,
|
4138 | onEnter: this.onEnter,
|
4139 | onEntering: this.onEntering,
|
4140 | onExit: this.onExit,
|
4141 | onExiting: this.onExiting,
|
4142 | onExited: this.onExited
|
4143 | }), function (status) {
|
4144 | var direction = _this2.context.direction;
|
4145 | var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING;
|
4146 | var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'right' ? 'carousel-item-left' : 'carousel-item-right');
|
4147 | var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'right' ? 'carousel-item-next' : 'carousel-item-prev');
|
4148 | var itemClasses = mapToCssModules(classnames(className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule);
|
4149 | return React__default.createElement(Tag, {
|
4150 | className: itemClasses
|
4151 | }, children);
|
4152 | });
|
4153 | };
|
4154 |
|
4155 | return CarouselItem;
|
4156 | }(React__default.Component);
|
4157 |
|
4158 | CarouselItem.propTypes = _extends({}, reactTransitionGroup_1.propTypes, {
|
4159 | tag: tagPropType,
|
4160 | in: propTypes.bool,
|
4161 | cssModule: propTypes.object,
|
4162 | children: propTypes.node,
|
4163 | slide: propTypes.bool,
|
4164 | className: propTypes.string
|
4165 | });
|
4166 | CarouselItem.defaultProps = _extends({}, reactTransitionGroup_1.defaultProps, {
|
4167 | tag: 'div',
|
4168 | timeout: TransitionTimeouts.Carousel,
|
4169 | slide: true
|
4170 | });
|
4171 | CarouselItem.contextTypes = {
|
4172 | direction: propTypes.string
|
4173 | };
|
4174 |
|
4175 | var SWIPE_THRESHOLD = 40;
|
4176 |
|
4177 | var Carousel = function (_React$Component) {
|
4178 | _inheritsLoose(Carousel, _React$Component);
|
4179 |
|
4180 | function Carousel(props) {
|
4181 | var _this;
|
4182 |
|
4183 | _this = _React$Component.call(this, props) || this;
|
4184 | _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_this));
|
4185 | _this.renderItems = _this.renderItems.bind(_assertThisInitialized(_this));
|
4186 | _this.hoverStart = _this.hoverStart.bind(_assertThisInitialized(_this));
|
4187 | _this.hoverEnd = _this.hoverEnd.bind(_assertThisInitialized(_this));
|
4188 | _this.handleTouchStart = _this.handleTouchStart.bind(_assertThisInitialized(_this));
|
4189 | _this.handleTouchEnd = _this.handleTouchEnd.bind(_assertThisInitialized(_this));
|
4190 | _this.touchStartX = 0;
|
4191 | _this.touchStartY = 0;
|
4192 | _this.state = {
|
4193 | activeIndex: _this.props.activeIndex,
|
4194 | direction: 'right',
|
4195 | indicatorClicked: false
|
4196 | };
|
4197 | return _this;
|
4198 | }
|
4199 |
|
4200 | var _proto = Carousel.prototype;
|
4201 |
|
4202 | _proto.getChildContext = function getChildContext() {
|
4203 | return {
|
4204 | direction: this.state.direction
|
4205 | };
|
4206 | };
|
4207 |
|
4208 | _proto.componentDidMount = function componentDidMount() {
|
4209 |
|
4210 | if (this.props.ride === 'carousel') {
|
4211 | this.setInterval();
|
4212 | }
|
4213 |
|
4214 |
|
4215 | document.addEventListener('keyup', this.handleKeyPress);
|
4216 | };
|
4217 |
|
4218 | Carousel.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
|
4219 | var newState = null;
|
4220 | var activeIndex = prevState.activeIndex,
|
4221 | direction = prevState.direction,
|
4222 | indicatorClicked = prevState.indicatorClicked;
|
4223 |
|
4224 | if (nextProps.activeIndex !== activeIndex) {
|
4225 |
|
4226 | if (nextProps.activeIndex === activeIndex + 1) {
|
4227 | direction = 'right';
|
4228 | } else if (nextProps.activeIndex === activeIndex - 1) {
|
4229 | direction = 'left';
|
4230 | } else if (nextProps.activeIndex < activeIndex) {
|
4231 | direction = indicatorClicked ? 'left' : 'right';
|
4232 | } else if (nextProps.activeIndex !== activeIndex) {
|
4233 | direction = indicatorClicked ? 'right' : 'left';
|
4234 | }
|
4235 |
|
4236 | newState = {
|
4237 | activeIndex: nextProps.activeIndex,
|
4238 | direction: direction,
|
4239 | indicatorClicked: false
|
4240 | };
|
4241 | }
|
4242 |
|
4243 | return newState;
|
4244 | };
|
4245 |
|
4246 | _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
4247 | if (prevState.activeIndex === this.state.activeIndex) return;
|
4248 | this.setInterval(this.props);
|
4249 | };
|
4250 |
|
4251 | _proto.componentWillUnmount = function componentWillUnmount() {
|
4252 | this.clearInterval();
|
4253 | document.removeEventListener('keyup', this.handleKeyPress);
|
4254 | };
|
4255 |
|
4256 | _proto.setInterval = function (_setInterval) {
|
4257 | function setInterval() {
|
4258 | return _setInterval.apply(this, arguments);
|
4259 | }
|
4260 |
|
4261 | setInterval.toString = function () {
|
4262 | return _setInterval.toString();
|
4263 | };
|
4264 |
|
4265 | return setInterval;
|
4266 | }(function (props) {
|
4267 | if (props === void 0) {
|
4268 | props = this.props;
|
4269 | }
|
4270 |
|
4271 |
|
4272 | this.clearInterval();
|
4273 |
|
4274 | if (props.interval) {
|
4275 | this.cycleInterval = setInterval(function () {
|
4276 | props.next();
|
4277 | }, parseInt(props.interval, 10));
|
4278 | }
|
4279 | });
|
4280 |
|
4281 | _proto.clearInterval = function (_clearInterval) {
|
4282 | function clearInterval() {
|
4283 | return _clearInterval.apply(this, arguments);
|
4284 | }
|
4285 |
|
4286 | clearInterval.toString = function () {
|
4287 | return _clearInterval.toString();
|
4288 | };
|
4289 |
|
4290 | return clearInterval;
|
4291 | }(function () {
|
4292 | clearInterval(this.cycleInterval);
|
4293 | });
|
4294 |
|
4295 | _proto.hoverStart = function hoverStart() {
|
4296 | if (this.props.pause === 'hover') {
|
4297 | this.clearInterval();
|
4298 | }
|
4299 |
|
4300 | if (this.props.mouseEnter) {
|
4301 | var _this$props;
|
4302 |
|
4303 | (_this$props = this.props).mouseEnter.apply(_this$props, arguments);
|
4304 | }
|
4305 | };
|
4306 |
|
4307 | _proto.hoverEnd = function hoverEnd() {
|
4308 | if (this.props.pause === 'hover') {
|
4309 | this.setInterval();
|
4310 | }
|
4311 |
|
4312 | if (this.props.mouseLeave) {
|
4313 | var _this$props2;
|
4314 |
|
4315 | (_this$props2 = this.props).mouseLeave.apply(_this$props2, arguments);
|
4316 | }
|
4317 | };
|
4318 |
|
4319 | _proto.handleKeyPress = function handleKeyPress(evt) {
|
4320 | if (this.props.keyboard) {
|
4321 | if (evt.keyCode === 37) {
|
4322 | this.props.previous();
|
4323 | } else if (evt.keyCode === 39) {
|
4324 | this.props.next();
|
4325 | }
|
4326 | }
|
4327 | };
|
4328 |
|
4329 | _proto.handleTouchStart = function handleTouchStart(e) {
|
4330 | if (!this.props.enableTouch) {
|
4331 | return;
|
4332 | }
|
4333 |
|
4334 | this.touchStartX = e.changedTouches[0].screenX;
|
4335 | this.touchStartY = e.changedTouches[0].screenY;
|
4336 | };
|
4337 |
|
4338 | _proto.handleTouchEnd = function handleTouchEnd(e) {
|
4339 | if (!this.props.enableTouch) {
|
4340 | return;
|
4341 | }
|
4342 |
|
4343 | var currentX = e.changedTouches[0].screenX;
|
4344 | var currentY = e.changedTouches[0].screenY;
|
4345 | var diffX = Math.abs(this.touchStartX - currentX);
|
4346 | var diffY = Math.abs(this.touchStartY - currentY);
|
4347 |
|
4348 | if (diffX < diffY) {
|
4349 | return;
|
4350 | }
|
4351 |
|
4352 | if (diffX < SWIPE_THRESHOLD) {
|
4353 | return;
|
4354 | }
|
4355 |
|
4356 | if (currentX < this.touchStartX) {
|
4357 | this.props.next();
|
4358 | } else {
|
4359 | this.props.previous();
|
4360 | }
|
4361 | };
|
4362 |
|
4363 | _proto.renderItems = function renderItems(carouselItems, className) {
|
4364 | var _this2 = this;
|
4365 |
|
4366 | var slide = this.props.slide;
|
4367 | return React__default.createElement("div", {
|
4368 | className: className
|
4369 | }, carouselItems.map(function (item, index) {
|
4370 | var isIn = index === _this2.state.activeIndex;
|
4371 | return React__default.cloneElement(item, {
|
4372 | in: isIn,
|
4373 | slide: slide
|
4374 | });
|
4375 | }));
|
4376 | };
|
4377 |
|
4378 | _proto.render = function render() {
|
4379 | var _this3 = this;
|
4380 |
|
4381 | var _this$props3 = this.props,
|
4382 | cssModule = _this$props3.cssModule,
|
4383 | slide = _this$props3.slide,
|
4384 | className = _this$props3.className;
|
4385 | var outerClasses = mapToCssModules(classnames(className, 'carousel', slide && 'slide'), cssModule);
|
4386 | var innerClasses = mapToCssModules(classnames('carousel-inner'), cssModule);
|
4387 |
|
4388 | var children = this.props.children.filter(function (child) {
|
4389 | return child !== null && child !== undefined && typeof child !== 'boolean';
|
4390 | });
|
4391 | var slidesOnly = children.every(function (child) {
|
4392 | return child.type === CarouselItem;
|
4393 | });
|
4394 |
|
4395 | if (slidesOnly) {
|
4396 | return React__default.createElement("div", {
|
4397 | className: outerClasses,
|
4398 | onMouseEnter: this.hoverStart,
|
4399 | onMouseLeave: this.hoverEnd
|
4400 | }, this.renderItems(children, innerClasses));
|
4401 | }
|
4402 |
|
4403 |
|
4404 | if (children[0] instanceof Array) {
|
4405 | var _carouselItems = children[0];
|
4406 | var _controlLeft = children[1];
|
4407 | var _controlRight = children[2];
|
4408 | return React__default.createElement("div", {
|
4409 | className: outerClasses,
|
4410 | onMouseEnter: this.hoverStart,
|
4411 | onMouseLeave: this.hoverEnd
|
4412 | }, this.renderItems(_carouselItems, innerClasses), _controlLeft, _controlRight);
|
4413 | }
|
4414 |
|
4415 |
|
4416 | var indicators = children[0];
|
4417 |
|
4418 | var wrappedOnClick = function wrappedOnClick(e) {
|
4419 | if (typeof indicators.props.onClickHandler === 'function') {
|
4420 | _this3.setState({
|
4421 | indicatorClicked: true
|
4422 | }, function () {
|
4423 | return indicators.props.onClickHandler(e);
|
4424 | });
|
4425 | }
|
4426 | };
|
4427 |
|
4428 | var wrappedIndicators = React__default.cloneElement(indicators, {
|
4429 | onClickHandler: wrappedOnClick
|
4430 | });
|
4431 | var carouselItems = children[1];
|
4432 | var controlLeft = children[2];
|
4433 | var controlRight = children[3];
|
4434 | return React__default.createElement("div", {
|
4435 | className: outerClasses,
|
4436 | onMouseEnter: this.hoverStart,
|
4437 | onMouseLeave: this.hoverEnd,
|
4438 | onTouchStart: this.handleTouchStart,
|
4439 | onTouchEnd: this.handleTouchEnd
|
4440 | }, wrappedIndicators, this.renderItems(carouselItems, innerClasses), controlLeft, controlRight);
|
4441 | };
|
4442 |
|
4443 | return Carousel;
|
4444 | }(React__default.Component);
|
4445 |
|
4446 | Carousel.propTypes = {
|
4447 |
|
4448 | activeIndex: propTypes.number,
|
4449 |
|
4450 | next: propTypes.func.isRequired,
|
4451 |
|
4452 | previous: propTypes.func.isRequired,
|
4453 |
|
4454 | keyboard: propTypes.bool,
|
4455 |
|
4456 | |
4457 |
|
4458 |
|
4459 | pause: propTypes.oneOf(['hover', false]),
|
4460 |
|
4461 |
|
4462 | ride: propTypes.oneOf(['carousel']),
|
4463 |
|
4464 |
|
4465 | interval: propTypes.oneOfType([propTypes.number, propTypes.string, propTypes.bool]),
|
4466 | children: propTypes.array,
|
4467 |
|
4468 | mouseEnter: propTypes.func,
|
4469 |
|
4470 | mouseLeave: propTypes.func,
|
4471 |
|
4472 | slide: propTypes.bool,
|
4473 | cssModule: propTypes.object,
|
4474 | className: propTypes.string,
|
4475 | enableTouch: propTypes.bool
|
4476 | };
|
4477 | Carousel.defaultProps = {
|
4478 | interval: 5000,
|
4479 | pause: 'hover',
|
4480 | keyboard: true,
|
4481 | slide: true,
|
4482 | enableTouch: true
|
4483 | };
|
4484 | Carousel.childContextTypes = {
|
4485 | direction: propTypes.string
|
4486 | };
|
4487 |
|
4488 | var CarouselControl = function CarouselControl(props) {
|
4489 | var direction = props.direction,
|
4490 | onClickHandler = props.onClickHandler,
|
4491 | cssModule = props.cssModule,
|
4492 | directionText = props.directionText,
|
4493 | className = props.className;
|
4494 | var anchorClasses = mapToCssModules(classnames(className, "carousel-control-" + direction), cssModule);
|
4495 | var iconClasses = mapToCssModules(classnames("carousel-control-" + direction + "-icon"), cssModule);
|
4496 | var screenReaderClasses = mapToCssModules(classnames('sr-only'), cssModule);
|
4497 | return React__default.createElement("a", {
|
4498 | className: anchorClasses,
|
4499 | style: {
|
4500 | cursor: "pointer"
|
4501 | },
|
4502 | role: "button",
|
4503 | tabIndex: "0",
|
4504 | onClick: function onClick(e) {
|
4505 | e.preventDefault();
|
4506 | onClickHandler();
|
4507 | }
|
4508 | }, React__default.createElement("span", {
|
4509 | className: iconClasses,
|
4510 | "aria-hidden": "true"
|
4511 | }), React__default.createElement("span", {
|
4512 | className: screenReaderClasses
|
4513 | }, directionText || direction));
|
4514 | };
|
4515 |
|
4516 | CarouselControl.propTypes = {
|
4517 | direction: propTypes.oneOf(['prev', 'next']).isRequired,
|
4518 | onClickHandler: propTypes.func.isRequired,
|
4519 | cssModule: propTypes.object,
|
4520 | directionText: propTypes.string,
|
4521 | className: propTypes.string
|
4522 | };
|
4523 |
|
4524 | var CarouselIndicators = function CarouselIndicators(props) {
|
4525 | var items = props.items,
|
4526 | activeIndex = props.activeIndex,
|
4527 | cssModule = props.cssModule,
|
4528 | onClickHandler = props.onClickHandler,
|
4529 | className = props.className;
|
4530 | var listClasses = mapToCssModules(classnames(className, 'carousel-indicators'), cssModule);
|
4531 | var indicators = items.map(function (item, idx) {
|
4532 | var indicatorClasses = mapToCssModules(classnames({
|
4533 | active: activeIndex === idx
|
4534 | }), cssModule);
|
4535 | return React__default.createElement("li", {
|
4536 | key: "" + (item.key || Object.values(item).join('')),
|
4537 | onClick: function onClick(e) {
|
4538 | e.preventDefault();
|
4539 | onClickHandler(idx);
|
4540 | },
|
4541 | className: indicatorClasses
|
4542 | });
|
4543 | });
|
4544 | return React__default.createElement("ol", {
|
4545 | className: listClasses
|
4546 | }, indicators);
|
4547 | };
|
4548 |
|
4549 | CarouselIndicators.propTypes = {
|
4550 | items: propTypes.array.isRequired,
|
4551 | activeIndex: propTypes.number.isRequired,
|
4552 | cssModule: propTypes.object,
|
4553 | onClickHandler: propTypes.func.isRequired,
|
4554 | className: propTypes.string
|
4555 | };
|
4556 |
|
4557 | var CarouselCaption = function CarouselCaption(props) {
|
4558 | var captionHeader = props.captionHeader,
|
4559 | captionText = props.captionText,
|
4560 | cssModule = props.cssModule,
|
4561 | className = props.className;
|
4562 | var classes = mapToCssModules(classnames(className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule);
|
4563 | return React__default.createElement("div", {
|
4564 | className: classes
|
4565 | }, React__default.createElement("h3", null, captionHeader), React__default.createElement("p", null, captionText));
|
4566 | };
|
4567 |
|
4568 | CarouselCaption.propTypes = {
|
4569 | captionHeader: propTypes.node,
|
4570 | captionText: propTypes.node.isRequired,
|
4571 | cssModule: propTypes.object,
|
4572 | className: propTypes.string
|
4573 | };
|
4574 |
|
4575 | var propTypes$y = {
|
4576 | items: propTypes.array.isRequired,
|
4577 | indicators: propTypes.bool,
|
4578 | controls: propTypes.bool,
|
4579 | autoPlay: propTypes.bool,
|
4580 | defaultActiveIndex: propTypes.number,
|
4581 | activeIndex: propTypes.number,
|
4582 | next: propTypes.func,
|
4583 | previous: propTypes.func,
|
4584 | goToIndex: propTypes.func
|
4585 | };
|
4586 |
|
4587 | var UncontrolledCarousel = function (_Component) {
|
4588 | _inheritsLoose(UncontrolledCarousel, _Component);
|
4589 |
|
4590 | function UncontrolledCarousel(props) {
|
4591 | var _this;
|
4592 |
|
4593 | _this = _Component.call(this, props) || this;
|
4594 | _this.animating = false;
|
4595 | _this.state = {
|
4596 | activeIndex: props.defaultActiveIndex || 0
|
4597 | };
|
4598 | _this.next = _this.next.bind(_assertThisInitialized(_this));
|
4599 | _this.previous = _this.previous.bind(_assertThisInitialized(_this));
|
4600 | _this.goToIndex = _this.goToIndex.bind(_assertThisInitialized(_this));
|
4601 | _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
|
4602 | _this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
|
4603 | return _this;
|
4604 | }
|
4605 |
|
4606 | var _proto = UncontrolledCarousel.prototype;
|
4607 |
|
4608 | _proto.onExiting = function onExiting() {
|
4609 | this.animating = true;
|
4610 | };
|
4611 |
|
4612 | _proto.onExited = function onExited() {
|
4613 | this.animating = false;
|
4614 | };
|
4615 |
|
4616 | _proto.next = function next() {
|
4617 | if (this.animating) return;
|
4618 | var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1;
|
4619 | this.setState({
|
4620 | activeIndex: nextIndex
|
4621 | });
|
4622 | };
|
4623 |
|
4624 | _proto.previous = function previous() {
|
4625 | if (this.animating) return;
|
4626 | var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1;
|
4627 | this.setState({
|
4628 | activeIndex: nextIndex
|
4629 | });
|
4630 | };
|
4631 |
|
4632 | _proto.goToIndex = function goToIndex(newIndex) {
|
4633 | if (this.animating) return;
|
4634 | this.setState({
|
4635 | activeIndex: newIndex
|
4636 | });
|
4637 | };
|
4638 |
|
4639 | _proto.render = function render() {
|
4640 | var _this2 = this;
|
4641 |
|
4642 | var _this$props = this.props,
|
4643 | defaultActiveIndex = _this$props.defaultActiveIndex,
|
4644 | autoPlay = _this$props.autoPlay,
|
4645 | indicators = _this$props.indicators,
|
4646 | controls = _this$props.controls,
|
4647 | items = _this$props.items,
|
4648 | goToIndex = _this$props.goToIndex,
|
4649 | props = _objectWithoutPropertiesLoose(_this$props, ["defaultActiveIndex", "autoPlay", "indicators", "controls", "items", "goToIndex"]);
|
4650 |
|
4651 | var activeIndex = this.state.activeIndex;
|
4652 | var slides = items.map(function (item) {
|
4653 | var key = item.key || item.src;
|
4654 | return React__default.createElement(CarouselItem, {
|
4655 | onExiting: _this2.onExiting,
|
4656 | onExited: _this2.onExited,
|
4657 | key: key
|
4658 | }, React__default.createElement("img", {
|
4659 | className: "d-block w-100",
|
4660 | src: item.src,
|
4661 | alt: item.altText
|
4662 | }), React__default.createElement(CarouselCaption, {
|
4663 | captionText: item.caption,
|
4664 | captionHeader: item.header || item.caption
|
4665 | }));
|
4666 | });
|
4667 | return React__default.createElement(Carousel, _extends({
|
4668 | activeIndex: activeIndex,
|
4669 | next: this.next,
|
4670 | previous: this.previous,
|
4671 | ride: autoPlay ? 'carousel' : undefined
|
4672 | }, props), indicators && React__default.createElement(CarouselIndicators, {
|
4673 | items: items,
|
4674 | activeIndex: props.activeIndex || activeIndex,
|
4675 | onClickHandler: goToIndex || this.goToIndex
|
4676 | }), slides, controls && React__default.createElement(CarouselControl, {
|
4677 | direction: "prev",
|
4678 | directionText: "Previous",
|
4679 | onClickHandler: props.previous || this.previous
|
4680 | }), controls && React__default.createElement(CarouselControl, {
|
4681 | direction: "next",
|
4682 | directionText: "Next",
|
4683 | onClickHandler: props.next || this.next
|
4684 | }));
|
4685 | };
|
4686 |
|
4687 | return UncontrolledCarousel;
|
4688 | }(React.Component);
|
4689 |
|
4690 | UncontrolledCarousel.propTypes = propTypes$y;
|
4691 | UncontrolledCarousel.defaultProps = {
|
4692 | controls: true,
|
4693 | indicators: true,
|
4694 | autoPlay: true
|
4695 | };
|
4696 |
|
4697 | var propTypes$z = {
|
4698 | tag: tagPropType,
|
4699 | className: propTypes.string,
|
4700 | cssModule: propTypes.object
|
4701 | };
|
4702 | var defaultProps$w = {
|
4703 | tag: 'div'
|
4704 | };
|
4705 |
|
4706 | var CardSubtitle = function CardSubtitle(props) {
|
4707 | var className = props.className,
|
4708 | cssModule = props.cssModule,
|
4709 | Tag = props.tag,
|
4710 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
4711 |
|
4712 | var classes = mapToCssModules(classnames(className, 'card-subtitle'), cssModule);
|
4713 | return React__default.createElement(Tag, _extends({}, attributes, {
|
4714 | className: classes
|
4715 | }));
|
4716 | };
|
4717 |
|
4718 | CardSubtitle.propTypes = propTypes$z;
|
4719 | CardSubtitle.defaultProps = defaultProps$w;
|
4720 |
|
4721 | var propTypes$A = {
|
4722 | tag: tagPropType,
|
4723 | className: propTypes.string,
|
4724 | cssModule: propTypes.object
|
4725 | };
|
4726 | var defaultProps$x = {
|
4727 | tag: 'p'
|
4728 | };
|
4729 |
|
4730 | var CardText = function CardText(props) {
|
4731 | var className = props.className,
|
4732 | cssModule = props.cssModule,
|
4733 | Tag = props.tag,
|
4734 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
4735 |
|
4736 | var classes = mapToCssModules(classnames(className, 'card-text'), cssModule);
|
4737 | return React__default.createElement(Tag, _extends({}, attributes, {
|
4738 | className: classes
|
4739 | }));
|
4740 | };
|
4741 |
|
4742 | CardText.propTypes = propTypes$A;
|
4743 | CardText.defaultProps = defaultProps$x;
|
4744 |
|
4745 | var propTypes$B = {
|
4746 | tag: tagPropType,
|
4747 | className: propTypes.string,
|
4748 | cssModule: propTypes.object
|
4749 | };
|
4750 | var defaultProps$y = {
|
4751 | tag: 'div'
|
4752 | };
|
4753 |
|
4754 | var CardTitle = function CardTitle(props) {
|
4755 | var className = props.className,
|
4756 | cssModule = props.cssModule,
|
4757 | Tag = props.tag,
|
4758 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
4759 |
|
4760 | var classes = mapToCssModules(classnames(className, 'card-title'), cssModule);
|
4761 | return React__default.createElement(Tag, _extends({}, attributes, {
|
4762 | className: classes
|
4763 | }));
|
4764 | };
|
4765 |
|
4766 | CardTitle.propTypes = propTypes$B;
|
4767 | CardTitle.defaultProps = defaultProps$y;
|
4768 |
|
4769 | var propTypes$C = {
|
4770 | className: propTypes.string,
|
4771 | id: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired,
|
4772 | label: propTypes.node,
|
4773 | valid: propTypes.bool,
|
4774 | invalid: propTypes.bool,
|
4775 | bsSize: propTypes.string,
|
4776 | htmlFor: propTypes.string,
|
4777 | cssModule: propTypes.object,
|
4778 | onChange: propTypes.func,
|
4779 | children: propTypes.oneOfType([propTypes.node, propTypes.array, propTypes.func]),
|
4780 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
|
4781 | };
|
4782 |
|
4783 | var CustomFileInput = function (_React$Component) {
|
4784 | _inheritsLoose(CustomFileInput, _React$Component);
|
4785 |
|
4786 | function CustomFileInput(props) {
|
4787 | var _this;
|
4788 |
|
4789 | _this = _React$Component.call(this, props) || this;
|
4790 | _this.state = {
|
4791 | files: null
|
4792 | };
|
4793 | _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
|
4794 | return _this;
|
4795 | }
|
4796 |
|
4797 | var _proto = CustomFileInput.prototype;
|
4798 |
|
4799 | _proto.onChange = function onChange(e) {
|
4800 | var input = e.target;
|
4801 | var onChange = this.props.onChange;
|
4802 | var files = this.getSelectedFiles(input);
|
4803 |
|
4804 | if (typeof onChange === "function") {
|
4805 | onChange.apply(void 0, arguments);
|
4806 | }
|
4807 |
|
4808 | this.setState({
|
4809 | files: files
|
4810 | });
|
4811 | };
|
4812 |
|
4813 | _proto.getSelectedFiles = function getSelectedFiles(input) {
|
4814 | var multiple = this.props.multiple;
|
4815 |
|
4816 | if (multiple && input.files) {
|
4817 | var files = [].slice.call(input.files);
|
4818 | return files.map(function (file) {
|
4819 | return file.name;
|
4820 | }).join(", ");
|
4821 | }
|
4822 |
|
4823 | if (input.value.indexOf("fakepath") !== -1) {
|
4824 | var parts = input.value.split("\\");
|
4825 | return parts[parts.length - 1];
|
4826 | }
|
4827 |
|
4828 | return input.value;
|
4829 | };
|
4830 |
|
4831 | _proto.render = function render() {
|
4832 | var _this$props = this.props,
|
4833 | className = _this$props.className,
|
4834 | label = _this$props.label,
|
4835 | valid = _this$props.valid,
|
4836 | invalid = _this$props.invalid,
|
4837 | cssModule = _this$props.cssModule,
|
4838 | children = _this$props.children,
|
4839 | bsSize = _this$props.bsSize,
|
4840 | innerRef = _this$props.innerRef,
|
4841 | htmlFor = _this$props.htmlFor,
|
4842 | type = _this$props.type,
|
4843 | onChange = _this$props.onChange,
|
4844 | dataBrowse = _this$props.dataBrowse,
|
4845 | hidden = _this$props.hidden,
|
4846 | attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "label", "valid", "invalid", "cssModule", "children", "bsSize", "innerRef", "htmlFor", "type", "onChange", "dataBrowse", "hidden"]);
|
4847 |
|
4848 | var customClass = mapToCssModules(classnames(className, "custom-file"), cssModule);
|
4849 | var validationClassNames = mapToCssModules(classnames(invalid && "is-invalid", valid && "is-valid"), cssModule);
|
4850 | var labelHtmlFor = htmlFor || attributes.id;
|
4851 | var files = this.state.files;
|
4852 | return React__default.createElement("div", {
|
4853 | className: customClass,
|
4854 | hidden: hidden || false
|
4855 | }, React__default.createElement("input", _extends({
|
4856 | type: "file"
|
4857 | }, attributes, {
|
4858 | ref: innerRef,
|
4859 | "aria-invalid": invalid,
|
4860 | className: classnames(validationClassNames, mapToCssModules("custom-file-input", cssModule)),
|
4861 | onChange: this.onChange
|
4862 | })), React__default.createElement("label", {
|
4863 | className: mapToCssModules("custom-file-label", cssModule),
|
4864 | htmlFor: labelHtmlFor,
|
4865 | "data-browse": dataBrowse
|
4866 | }, files || label || "Choose file"), children);
|
4867 | };
|
4868 |
|
4869 | return CustomFileInput;
|
4870 | }(React__default.Component);
|
4871 |
|
4872 | CustomFileInput.propTypes = propTypes$C;
|
4873 |
|
4874 | var propTypes$D = {
|
4875 | className: propTypes.string,
|
4876 | id: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired,
|
4877 | type: propTypes.string.isRequired,
|
4878 | label: propTypes.node,
|
4879 | inline: propTypes.bool,
|
4880 | valid: propTypes.bool,
|
4881 | invalid: propTypes.bool,
|
4882 | bsSize: propTypes.string,
|
4883 | htmlFor: propTypes.string,
|
4884 | cssModule: propTypes.object,
|
4885 | children: propTypes.oneOfType([propTypes.node, propTypes.array, propTypes.func]),
|
4886 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
|
4887 | };
|
4888 |
|
4889 | function CustomInput(props) {
|
4890 | var className = props.className,
|
4891 | label = props.label,
|
4892 | inline = props.inline,
|
4893 | valid = props.valid,
|
4894 | invalid = props.invalid,
|
4895 | cssModule = props.cssModule,
|
4896 | children = props.children,
|
4897 | bsSize = props.bsSize,
|
4898 | innerRef = props.innerRef,
|
4899 | htmlFor = props.htmlFor,
|
4900 | attributes = _objectWithoutPropertiesLoose(props, ["className", "label", "inline", "valid", "invalid", "cssModule", "children", "bsSize", "innerRef", "htmlFor"]);
|
4901 |
|
4902 | var type = attributes.type;
|
4903 | var customClass = mapToCssModules(classnames(className, "custom-" + type, bsSize ? "custom-" + type + "-" + bsSize : false), cssModule);
|
4904 | var validationClassNames = mapToCssModules(classnames(invalid && "is-invalid", valid && "is-valid"), cssModule);
|
4905 | var labelHtmlFor = htmlFor || attributes.id;
|
4906 |
|
4907 | if (type === "select") {
|
4908 | var _type = attributes.type,
|
4909 | _rest = _objectWithoutPropertiesLoose(attributes, ["type"]);
|
4910 |
|
4911 | return React__default.createElement("select", _extends({}, _rest, {
|
4912 | ref: innerRef,
|
4913 | className: classnames(validationClassNames, customClass),
|
4914 | "aria-invalid": invalid
|
4915 | }), children);
|
4916 | }
|
4917 |
|
4918 | if (type === "file") {
|
4919 | return React__default.createElement(CustomFileInput, props);
|
4920 | }
|
4921 |
|
4922 | if (type !== "checkbox" && type !== "radio" && type !== "switch") {
|
4923 | return React__default.createElement("input", _extends({}, attributes, {
|
4924 | ref: innerRef,
|
4925 | "aria-invalid": invalid,
|
4926 | className: classnames(validationClassNames, customClass)
|
4927 | }));
|
4928 | }
|
4929 |
|
4930 | var wrapperClasses = classnames(customClass, mapToCssModules(classnames("custom-control", {
|
4931 | "custom-control-inline": inline
|
4932 | }), cssModule));
|
4933 |
|
4934 | var hidden = attributes.hidden,
|
4935 | rest = _objectWithoutPropertiesLoose(attributes, ["hidden"]);
|
4936 |
|
4937 | return React__default.createElement("div", {
|
4938 | className: wrapperClasses,
|
4939 | hidden: hidden || false
|
4940 | }, React__default.createElement("input", _extends({}, rest, {
|
4941 | type: type === "switch" ? "checkbox" : type,
|
4942 | ref: innerRef,
|
4943 | "aria-invalid": invalid,
|
4944 | className: classnames(validationClassNames, mapToCssModules("custom-control-input", cssModule))
|
4945 | })), React__default.createElement("label", {
|
4946 | className: mapToCssModules("custom-control-label", cssModule),
|
4947 | htmlFor: labelHtmlFor
|
4948 | }, label), children);
|
4949 | }
|
4950 |
|
4951 | CustomInput.propTypes = propTypes$D;
|
4952 |
|
4953 | function noop() {}
|
4954 |
|
4955 | var propTypes$E = {
|
4956 | children: propTypes.oneOfType([propTypes.node, propTypes.func]).isRequired,
|
4957 | popperClassName: propTypes.string,
|
4958 | placement: propTypes.string,
|
4959 | placementPrefix: propTypes.string,
|
4960 | arrowClassName: propTypes.string,
|
4961 | hideArrow: propTypes.bool,
|
4962 | tag: tagPropType,
|
4963 | isOpen: propTypes.bool.isRequired,
|
4964 | cssModule: propTypes.object,
|
4965 | offset: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
4966 | fallbackPlacement: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
4967 | flip: propTypes.bool,
|
4968 | container: targetPropType,
|
4969 | target: targetPropType.isRequired,
|
4970 | modifiers: propTypes.object,
|
4971 | boundariesElement: propTypes.oneOfType([propTypes.string, DOMElement]),
|
4972 | onClosed: propTypes.func,
|
4973 | fade: propTypes.bool,
|
4974 | transition: propTypes.shape(Fade.propTypes)
|
4975 | };
|
4976 | var defaultProps$z = {
|
4977 | boundariesElement: 'scrollParent',
|
4978 | placement: 'auto',
|
4979 | hideArrow: false,
|
4980 | isOpen: false,
|
4981 | offset: 0,
|
4982 | fallbackPlacement: 'flip',
|
4983 | flip: true,
|
4984 | container: 'body',
|
4985 | modifiers: {},
|
4986 | onClosed: noop,
|
4987 | fade: true,
|
4988 | transition: _extends({}, Fade.defaultProps)
|
4989 | };
|
4990 |
|
4991 | var PopperContent = function (_React$Component) {
|
4992 | _inheritsLoose(PopperContent, _React$Component);
|
4993 |
|
4994 | function PopperContent(props) {
|
4995 | var _this;
|
4996 |
|
4997 | _this = _React$Component.call(this, props) || this;
|
4998 | _this.setTargetNode = _this.setTargetNode.bind(_assertThisInitialized(_this));
|
4999 | _this.getTargetNode = _this.getTargetNode.bind(_assertThisInitialized(_this));
|
5000 | _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
5001 | _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
|
5002 | _this.state = {
|
5003 | isOpen: props.isOpen
|
5004 | };
|
5005 | return _this;
|
5006 | }
|
5007 |
|
5008 | PopperContent.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
5009 | if (props.isOpen && !state.isOpen) {
|
5010 | return {
|
5011 | isOpen: props.isOpen
|
5012 | };
|
5013 | } else return null;
|
5014 | };
|
5015 |
|
5016 | var _proto = PopperContent.prototype;
|
5017 |
|
5018 | _proto.componentDidUpdate = function componentDidUpdate() {
|
5019 | if (this._element && this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) {
|
5020 | this._element.childNodes[0].focus();
|
5021 | }
|
5022 | };
|
5023 |
|
5024 | _proto.setTargetNode = function setTargetNode(node) {
|
5025 | this.targetNode = typeof node === 'string' ? getTarget(node) : node;
|
5026 | };
|
5027 |
|
5028 | _proto.getTargetNode = function getTargetNode() {
|
5029 | return this.targetNode;
|
5030 | };
|
5031 |
|
5032 | _proto.getContainerNode = function getContainerNode() {
|
5033 | return getTarget(this.props.container);
|
5034 | };
|
5035 |
|
5036 | _proto.getRef = function getRef(ref) {
|
5037 | this._element = ref;
|
5038 | };
|
5039 |
|
5040 | _proto.onClosed = function onClosed() {
|
5041 | this.props.onClosed();
|
5042 | this.setState({
|
5043 | isOpen: false
|
5044 | });
|
5045 | };
|
5046 |
|
5047 | _proto.renderChildren = function renderChildren() {
|
5048 | var _this$props = this.props,
|
5049 | cssModule = _this$props.cssModule,
|
5050 | children = _this$props.children,
|
5051 | isOpen = _this$props.isOpen,
|
5052 | flip = _this$props.flip,
|
5053 | target = _this$props.target,
|
5054 | offset = _this$props.offset,
|
5055 | fallbackPlacement = _this$props.fallbackPlacement,
|
5056 | placementPrefix = _this$props.placementPrefix,
|
5057 | _arrowClassName = _this$props.arrowClassName,
|
5058 | hideArrow = _this$props.hideArrow,
|
5059 | _popperClassName = _this$props.popperClassName,
|
5060 | tag = _this$props.tag,
|
5061 | container = _this$props.container,
|
5062 | modifiers = _this$props.modifiers,
|
5063 | boundariesElement = _this$props.boundariesElement,
|
5064 | onClosed = _this$props.onClosed,
|
5065 | fade = _this$props.fade,
|
5066 | transition = _this$props.transition,
|
5067 | placement = _this$props.placement,
|
5068 | attrs = _objectWithoutPropertiesLoose(_this$props, ["cssModule", "children", "isOpen", "flip", "target", "offset", "fallbackPlacement", "placementPrefix", "arrowClassName", "hideArrow", "popperClassName", "tag", "container", "modifiers", "boundariesElement", "onClosed", "fade", "transition", "placement"]);
|
5069 |
|
5070 | var arrowClassName = mapToCssModules(classnames('arrow', _arrowClassName), cssModule);
|
5071 | var popperClassName = mapToCssModules(classnames(_popperClassName, placementPrefix ? placementPrefix + "-auto" : ''), this.props.cssModule);
|
5072 |
|
5073 | var extendedModifiers = _extends({
|
5074 | offset: {
|
5075 | offset: offset
|
5076 | },
|
5077 | flip: {
|
5078 | enabled: flip,
|
5079 | behavior: fallbackPlacement
|
5080 | },
|
5081 | preventOverflow: {
|
5082 | boundariesElement: boundariesElement
|
5083 | }
|
5084 | }, modifiers);
|
5085 |
|
5086 | var popperTransition = _extends({}, Fade.defaultProps, transition, {
|
5087 | baseClass: fade ? transition.baseClass : '',
|
5088 | timeout: fade ? transition.timeout : 0
|
5089 | });
|
5090 |
|
5091 | return React__default.createElement(Fade, _extends({}, popperTransition, attrs, {
|
5092 | in: isOpen,
|
5093 | onExited: this.onClosed,
|
5094 | tag: tag
|
5095 | }), React__default.createElement(reactPopper.Popper, {
|
5096 | referenceElement: this.targetNode,
|
5097 | modifiers: extendedModifiers,
|
5098 | placement: placement
|
5099 | }, function (_ref) {
|
5100 | var ref = _ref.ref,
|
5101 | style = _ref.style,
|
5102 | placement = _ref.placement,
|
5103 | outOfBoundaries = _ref.outOfBoundaries,
|
5104 | arrowProps = _ref.arrowProps,
|
5105 | scheduleUpdate = _ref.scheduleUpdate;
|
5106 | return React__default.createElement("div", {
|
5107 | ref: ref,
|
5108 | style: style,
|
5109 | className: popperClassName,
|
5110 | "x-placement": placement,
|
5111 | "x-out-of-boundaries": outOfBoundaries ? 'true' : undefined
|
5112 | }, typeof children === 'function' ? children({
|
5113 | scheduleUpdate: scheduleUpdate
|
5114 | }) : children, !hideArrow && React__default.createElement("span", {
|
5115 | ref: arrowProps.ref,
|
5116 | className: arrowClassName,
|
5117 | style: arrowProps.style
|
5118 | }));
|
5119 | }));
|
5120 | };
|
5121 |
|
5122 | _proto.render = function render() {
|
5123 | this.setTargetNode(this.props.target);
|
5124 |
|
5125 | if (this.state.isOpen) {
|
5126 | return this.props.container === 'inline' ? this.renderChildren() : ReactDOM.createPortal( React__default.createElement("div", {
|
5127 | ref: this.getRef
|
5128 | }, this.renderChildren()), this.getContainerNode());
|
5129 | }
|
5130 |
|
5131 | return null;
|
5132 | };
|
5133 |
|
5134 | return PopperContent;
|
5135 | }(React__default.Component);
|
5136 |
|
5137 | PopperContent.propTypes = propTypes$E;
|
5138 | PopperContent.defaultProps = defaultProps$z;
|
5139 |
|
5140 | var PopperTargetHelper = function PopperTargetHelper(props, context) {
|
5141 | context.popperManager.setTargetNode(getTarget(props.target));
|
5142 | return null;
|
5143 | };
|
5144 |
|
5145 | PopperTargetHelper.contextTypes = {
|
5146 | popperManager: propTypes.object.isRequired
|
5147 | };
|
5148 | PopperTargetHelper.propTypes = {
|
5149 | target: targetPropType.isRequired
|
5150 | };
|
5151 |
|
5152 | var propTypes$F = {
|
5153 | children: propTypes.oneOfType([propTypes.node, propTypes.func]),
|
5154 | placement: propTypes.oneOf(PopperPlacements),
|
5155 | target: targetPropType.isRequired,
|
5156 | container: targetPropType,
|
5157 | isOpen: propTypes.bool,
|
5158 | disabled: propTypes.bool,
|
5159 | hideArrow: propTypes.bool,
|
5160 | boundariesElement: propTypes.oneOfType([propTypes.string, DOMElement]),
|
5161 | className: propTypes.string,
|
5162 | innerClassName: propTypes.string,
|
5163 | arrowClassName: propTypes.string,
|
5164 | popperClassName: propTypes.string,
|
5165 | cssModule: propTypes.object,
|
5166 | toggle: propTypes.func,
|
5167 | autohide: propTypes.bool,
|
5168 | placementPrefix: propTypes.string,
|
5169 | delay: propTypes.oneOfType([propTypes.shape({
|
5170 | show: propTypes.number,
|
5171 | hide: propTypes.number
|
5172 | }), propTypes.number]),
|
5173 | modifiers: propTypes.object,
|
5174 | offset: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
5175 | innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object]),
|
5176 | trigger: propTypes.string,
|
5177 | fade: propTypes.bool,
|
5178 | flip: propTypes.bool
|
5179 | };
|
5180 | var DEFAULT_DELAYS = {
|
5181 | show: 0,
|
5182 | hide: 50
|
5183 | };
|
5184 | var defaultProps$A = {
|
5185 | isOpen: false,
|
5186 | hideArrow: false,
|
5187 | autohide: false,
|
5188 | delay: DEFAULT_DELAYS,
|
5189 | toggle: function toggle() {},
|
5190 | trigger: 'click',
|
5191 | fade: true
|
5192 | };
|
5193 |
|
5194 | function isInDOMSubtree(element, subtreeRoot) {
|
5195 | return subtreeRoot && (element === subtreeRoot || subtreeRoot.contains(element));
|
5196 | }
|
5197 |
|
5198 | function isInDOMSubtrees(element, subtreeRoots) {
|
5199 | if (subtreeRoots === void 0) {
|
5200 | subtreeRoots = [];
|
5201 | }
|
5202 |
|
5203 | return subtreeRoots && subtreeRoots.length && subtreeRoots.filter(function (subTreeRoot) {
|
5204 | return isInDOMSubtree(element, subTreeRoot);
|
5205 | })[0];
|
5206 | }
|
5207 |
|
5208 | var TooltipPopoverWrapper = function (_React$Component) {
|
5209 | _inheritsLoose(TooltipPopoverWrapper, _React$Component);
|
5210 |
|
5211 | function TooltipPopoverWrapper(props) {
|
5212 | var _this;
|
5213 |
|
5214 | _this = _React$Component.call(this, props) || this;
|
5215 | _this._targets = [];
|
5216 | _this.currentTargetElement = null;
|
5217 | _this.addTargetEvents = _this.addTargetEvents.bind(_assertThisInitialized(_this));
|
5218 | _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));
|
5219 | _this.removeTargetEvents = _this.removeTargetEvents.bind(_assertThisInitialized(_this));
|
5220 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
5221 | _this.showWithDelay = _this.showWithDelay.bind(_assertThisInitialized(_this));
|
5222 | _this.hideWithDelay = _this.hideWithDelay.bind(_assertThisInitialized(_this));
|
5223 | _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_assertThisInitialized(_this));
|
5224 | _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_assertThisInitialized(_this));
|
5225 | _this.show = _this.show.bind(_assertThisInitialized(_this));
|
5226 | _this.hide = _this.hide.bind(_assertThisInitialized(_this));
|
5227 | _this.onEscKeyDown = _this.onEscKeyDown.bind(_assertThisInitialized(_this));
|
5228 | _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
5229 | _this.state = {
|
5230 | isOpen: props.isOpen
|
5231 | };
|
5232 | _this._isMounted = false;
|
5233 | return _this;
|
5234 | }
|
5235 |
|
5236 | var _proto = TooltipPopoverWrapper.prototype;
|
5237 |
|
5238 | _proto.componentDidMount = function componentDidMount() {
|
5239 | this._isMounted = true;
|
5240 | this.updateTarget();
|
5241 | };
|
5242 |
|
5243 | _proto.componentWillUnmount = function componentWillUnmount() {
|
5244 | this._isMounted = false;
|
5245 | this.removeTargetEvents();
|
5246 | this._targets = null;
|
5247 | this.clearShowTimeout();
|
5248 | this.clearHideTimeout();
|
5249 | };
|
5250 |
|
5251 | TooltipPopoverWrapper.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
5252 | if (props.isOpen && !state.isOpen) {
|
5253 | return {
|
5254 | isOpen: props.isOpen
|
5255 | };
|
5256 | } else return null;
|
5257 | };
|
5258 |
|
5259 | _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {
|
5260 | if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
|
5261 | if (this._hideTimeout) {
|
5262 | this.clearHideTimeout();
|
5263 | }
|
5264 |
|
5265 | if (this.state.isOpen && !this.props.isOpen) {
|
5266 | this.toggle();
|
5267 | }
|
5268 | }
|
5269 | };
|
5270 |
|
5271 | _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {
|
5272 | if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
|
5273 | if (this._showTimeout) {
|
5274 | this.clearShowTimeout();
|
5275 | }
|
5276 |
|
5277 | e.persist();
|
5278 | this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
|
5279 | }
|
5280 | };
|
5281 |
|
5282 | _proto.onEscKeyDown = function onEscKeyDown(e) {
|
5283 | if (e.key === 'Escape') {
|
5284 | this.hide(e);
|
5285 | }
|
5286 | };
|
5287 |
|
5288 | _proto.getRef = function getRef(ref) {
|
5289 | var innerRef = this.props.innerRef;
|
5290 |
|
5291 | if (innerRef) {
|
5292 | if (typeof innerRef === 'function') {
|
5293 | innerRef(ref);
|
5294 | } else if (typeof innerRef === 'object') {
|
5295 | innerRef.current = ref;
|
5296 | }
|
5297 | }
|
5298 |
|
5299 | this._popover = ref;
|
5300 | };
|
5301 |
|
5302 | _proto.getDelay = function getDelay(key) {
|
5303 | var delay = this.props.delay;
|
5304 |
|
5305 | if (typeof delay === 'object') {
|
5306 | return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];
|
5307 | }
|
5308 |
|
5309 | return delay;
|
5310 | };
|
5311 |
|
5312 | _proto.show = function show(e) {
|
5313 | if (!this.props.isOpen) {
|
5314 | this.clearShowTimeout();
|
5315 | this.currentTargetElement = e ? e.currentTarget || e.target : null;
|
5316 |
|
5317 | if (e && e.composedPath && typeof e.composedPath === 'function') {
|
5318 | var path = e.composedPath();
|
5319 | this.currentTargetElement = path && path[0] || this.currentTargetElement;
|
5320 | }
|
5321 |
|
5322 | this.toggle(e);
|
5323 | }
|
5324 | };
|
5325 |
|
5326 | _proto.showWithDelay = function showWithDelay(e) {
|
5327 | if (this._hideTimeout) {
|
5328 | this.clearHideTimeout();
|
5329 | }
|
5330 |
|
5331 | this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));
|
5332 | };
|
5333 |
|
5334 | _proto.hide = function hide(e) {
|
5335 | if (this.props.isOpen) {
|
5336 | this.clearHideTimeout();
|
5337 | this.currentTargetElement = null;
|
5338 | this.toggle(e);
|
5339 | }
|
5340 | };
|
5341 |
|
5342 | _proto.hideWithDelay = function hideWithDelay(e) {
|
5343 | if (this._showTimeout) {
|
5344 | this.clearShowTimeout();
|
5345 | }
|
5346 |
|
5347 | this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
|
5348 | };
|
5349 |
|
5350 | _proto.clearShowTimeout = function clearShowTimeout() {
|
5351 | clearTimeout(this._showTimeout);
|
5352 | this._showTimeout = undefined;
|
5353 | };
|
5354 |
|
5355 | _proto.clearHideTimeout = function clearHideTimeout() {
|
5356 | clearTimeout(this._hideTimeout);
|
5357 | this._hideTimeout = undefined;
|
5358 | };
|
5359 |
|
5360 | _proto.handleDocumentClick = function handleDocumentClick(e) {
|
5361 | var triggers = this.props.trigger.split(' ');
|
5362 |
|
5363 | if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtrees(e.target, this._targets))) {
|
5364 | if (this._hideTimeout) {
|
5365 | this.clearHideTimeout();
|
5366 | }
|
5367 |
|
5368 | if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {
|
5369 | this.hideWithDelay(e);
|
5370 | } else if (!this.props.isOpen) {
|
5371 | this.showWithDelay(e);
|
5372 | }
|
5373 | } else if (triggers.indexOf('click') > -1 && isInDOMSubtrees(e.target, this._targets)) {
|
5374 | if (this._hideTimeout) {
|
5375 | this.clearHideTimeout();
|
5376 | }
|
5377 |
|
5378 | if (!this.props.isOpen) {
|
5379 | this.showWithDelay(e);
|
5380 | } else {
|
5381 | this.hideWithDelay(e);
|
5382 | }
|
5383 | }
|
5384 | };
|
5385 |
|
5386 | _proto.addEventOnTargets = function addEventOnTargets(type, handler, isBubble) {
|
5387 | this._targets.forEach(function (target) {
|
5388 | target.addEventListener(type, handler, isBubble);
|
5389 | });
|
5390 | };
|
5391 |
|
5392 | _proto.removeEventOnTargets = function removeEventOnTargets(type, handler, isBubble) {
|
5393 | this._targets.forEach(function (target) {
|
5394 | target.removeEventListener(type, handler, isBubble);
|
5395 | });
|
5396 | };
|
5397 |
|
5398 | _proto.addTargetEvents = function addTargetEvents() {
|
5399 | if (this.props.trigger) {
|
5400 | var triggers = this.props.trigger.split(' ');
|
5401 |
|
5402 | if (triggers.indexOf('manual') === -1) {
|
5403 | if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {
|
5404 | document.addEventListener('click', this.handleDocumentClick, true);
|
5405 | }
|
5406 |
|
5407 | if (this._targets && this._targets.length) {
|
5408 | if (triggers.indexOf('hover') > -1) {
|
5409 | this.addEventOnTargets('mouseover', this.showWithDelay, true);
|
5410 | this.addEventOnTargets('mouseout', this.hideWithDelay, true);
|
5411 | }
|
5412 |
|
5413 | if (triggers.indexOf('focus') > -1) {
|
5414 | this.addEventOnTargets('focusin', this.show, true);
|
5415 | this.addEventOnTargets('focusout', this.hide, true);
|
5416 | }
|
5417 |
|
5418 | this.addEventOnTargets('keydown', this.onEscKeyDown, true);
|
5419 | }
|
5420 | }
|
5421 | }
|
5422 | };
|
5423 |
|
5424 | _proto.removeTargetEvents = function removeTargetEvents() {
|
5425 | if (this._targets) {
|
5426 | this.removeEventOnTargets('mouseover', this.showWithDelay, true);
|
5427 | this.removeEventOnTargets('mouseout', this.hideWithDelay, true);
|
5428 | this.removeEventOnTargets('keydown', this.onEscKeyDown, true);
|
5429 | this.removeEventOnTargets('focusin', this.show, true);
|
5430 | this.removeEventOnTargets('focusout', this.hide, true);
|
5431 | }
|
5432 |
|
5433 | document.removeEventListener('click', this.handleDocumentClick, true);
|
5434 | };
|
5435 |
|
5436 | _proto.updateTarget = function updateTarget() {
|
5437 | var newTarget = getTarget(this.props.target, true);
|
5438 |
|
5439 | if (newTarget !== this._targets) {
|
5440 | this.removeTargetEvents();
|
5441 | this._targets = newTarget ? Array.from(newTarget) : [];
|
5442 | this.currentTargetElement = this.currentTargetElement || this._targets[0];
|
5443 | this.addTargetEvents();
|
5444 | }
|
5445 | };
|
5446 |
|
5447 | _proto.toggle = function toggle(e) {
|
5448 | if (this.props.disabled || !this._isMounted) {
|
5449 | return e && e.preventDefault();
|
5450 | }
|
5451 |
|
5452 | return this.props.toggle(e);
|
5453 | };
|
5454 |
|
5455 | _proto.render = function render() {
|
5456 | var _this2 = this;
|
5457 |
|
5458 | if (!this.props.isOpen) {
|
5459 | return null;
|
5460 | }
|
5461 |
|
5462 | this.updateTarget();
|
5463 | var _this$props = this.props,
|
5464 | className = _this$props.className,
|
5465 | cssModule = _this$props.cssModule,
|
5466 | innerClassName = _this$props.innerClassName,
|
5467 | isOpen = _this$props.isOpen,
|
5468 | hideArrow = _this$props.hideArrow,
|
5469 | boundariesElement = _this$props.boundariesElement,
|
5470 | placement = _this$props.placement,
|
5471 | placementPrefix = _this$props.placementPrefix,
|
5472 | arrowClassName = _this$props.arrowClassName,
|
5473 | popperClassName = _this$props.popperClassName,
|
5474 | container = _this$props.container,
|
5475 | modifiers = _this$props.modifiers,
|
5476 | offset = _this$props.offset,
|
5477 | fade = _this$props.fade,
|
5478 | flip = _this$props.flip,
|
5479 | children = _this$props.children;
|
5480 | var attributes = omit(this.props, Object.keys(propTypes$F));
|
5481 | var popperClasses = mapToCssModules(popperClassName, cssModule);
|
5482 | var classes = mapToCssModules(innerClassName, cssModule);
|
5483 | return React__default.createElement(PopperContent, {
|
5484 | className: className,
|
5485 | target: this.currentTargetElement || this._targets[0],
|
5486 | isOpen: isOpen,
|
5487 | hideArrow: hideArrow,
|
5488 | boundariesElement: boundariesElement,
|
5489 | placement: placement,
|
5490 | placementPrefix: placementPrefix,
|
5491 | arrowClassName: arrowClassName,
|
5492 | popperClassName: popperClasses,
|
5493 | container: container,
|
5494 | modifiers: modifiers,
|
5495 | offset: offset,
|
5496 | cssModule: cssModule,
|
5497 | fade: fade,
|
5498 | flip: flip
|
5499 | }, function (_ref) {
|
5500 | var scheduleUpdate = _ref.scheduleUpdate;
|
5501 | return React__default.createElement("div", _extends({}, attributes, {
|
5502 | ref: _this2.getRef,
|
5503 | className: classes,
|
5504 | role: "tooltip",
|
5505 | onMouseOver: _this2.onMouseOverTooltipContent,
|
5506 | onMouseLeave: _this2.onMouseLeaveTooltipContent,
|
5507 | onKeyDown: _this2.onEscKeyDown
|
5508 | }), typeof children === 'function' ? children({
|
5509 | scheduleUpdate: scheduleUpdate
|
5510 | }) : children);
|
5511 | });
|
5512 | };
|
5513 |
|
5514 | return TooltipPopoverWrapper;
|
5515 | }(React__default.Component);
|
5516 |
|
5517 | TooltipPopoverWrapper.propTypes = propTypes$F;
|
5518 | TooltipPopoverWrapper.defaultProps = defaultProps$A;
|
5519 |
|
5520 | var defaultProps$B = {
|
5521 | placement: 'right',
|
5522 | placementPrefix: 'bs-popover',
|
5523 | trigger: 'click'
|
5524 | };
|
5525 |
|
5526 | var Popover = function Popover(props) {
|
5527 | var popperClasses = classnames('popover', 'show', props.popperClassName);
|
5528 | var classes = classnames('popover-inner', props.innerClassName);
|
5529 | return React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
|
5530 | popperClassName: popperClasses,
|
5531 | innerClassName: classes
|
5532 | }));
|
5533 | };
|
5534 |
|
5535 | Popover.propTypes = propTypes$F;
|
5536 | Popover.defaultProps = defaultProps$B;
|
5537 |
|
5538 | var omitKeys = ['defaultOpen'];
|
5539 |
|
5540 | var UncontrolledPopover = function (_Component) {
|
5541 | _inheritsLoose(UncontrolledPopover, _Component);
|
5542 |
|
5543 | function UncontrolledPopover(props) {
|
5544 | var _this;
|
5545 |
|
5546 | _this = _Component.call(this, props) || this;
|
5547 | _this.state = {
|
5548 | isOpen: props.defaultOpen || false
|
5549 | };
|
5550 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
5551 | return _this;
|
5552 | }
|
5553 |
|
5554 | var _proto = UncontrolledPopover.prototype;
|
5555 |
|
5556 | _proto.toggle = function toggle() {
|
5557 | this.setState({
|
5558 | isOpen: !this.state.isOpen
|
5559 | });
|
5560 | };
|
5561 |
|
5562 | _proto.render = function render() {
|
5563 | return React__default.createElement(Popover, _extends({
|
5564 | isOpen: this.state.isOpen,
|
5565 | toggle: this.toggle
|
5566 | }, omit(this.props, omitKeys)));
|
5567 | };
|
5568 |
|
5569 | return UncontrolledPopover;
|
5570 | }(React.Component);
|
5571 | UncontrolledPopover.propTypes = _extends({
|
5572 | defaultOpen: propTypes.bool
|
5573 | }, Popover.propTypes);
|
5574 |
|
5575 | var propTypes$G = {
|
5576 | tag: tagPropType,
|
5577 | className: propTypes.string,
|
5578 | cssModule: propTypes.object
|
5579 | };
|
5580 | var defaultProps$C = {
|
5581 | tag: 'h3'
|
5582 | };
|
5583 |
|
5584 | var PopoverHeader = function PopoverHeader(props) {
|
5585 | var className = props.className,
|
5586 | cssModule = props.cssModule,
|
5587 | Tag = props.tag,
|
5588 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
5589 |
|
5590 | var classes = mapToCssModules(classnames(className, 'popover-header'), cssModule);
|
5591 | return React__default.createElement(Tag, _extends({}, attributes, {
|
5592 | className: classes
|
5593 | }));
|
5594 | };
|
5595 |
|
5596 | PopoverHeader.propTypes = propTypes$G;
|
5597 | PopoverHeader.defaultProps = defaultProps$C;
|
5598 |
|
5599 | var propTypes$H = {
|
5600 | tag: tagPropType,
|
5601 | className: propTypes.string,
|
5602 | cssModule: propTypes.object
|
5603 | };
|
5604 | var defaultProps$D = {
|
5605 | tag: 'div'
|
5606 | };
|
5607 |
|
5608 | var PopoverBody = function PopoverBody(props) {
|
5609 | var className = props.className,
|
5610 | cssModule = props.cssModule,
|
5611 | Tag = props.tag,
|
5612 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
5613 |
|
5614 | var classes = mapToCssModules(classnames(className, 'popover-body'), cssModule);
|
5615 | return React__default.createElement(Tag, _extends({}, attributes, {
|
5616 | className: classes
|
5617 | }));
|
5618 | };
|
5619 |
|
5620 | PopoverBody.propTypes = propTypes$H;
|
5621 | PopoverBody.defaultProps = defaultProps$D;
|
5622 |
|
5623 | var propTypes$I = {
|
5624 | children: propTypes.node,
|
5625 | bar: propTypes.bool,
|
5626 | multi: propTypes.bool,
|
5627 | tag: tagPropType,
|
5628 | value: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
5629 | min: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
5630 | max: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
5631 | animated: propTypes.bool,
|
5632 | striped: propTypes.bool,
|
5633 | color: propTypes.string,
|
5634 | className: propTypes.string,
|
5635 | barClassName: propTypes.string,
|
5636 | cssModule: propTypes.object,
|
5637 | style: propTypes.object,
|
5638 | barAriaValueText: propTypes.string,
|
5639 | barAriaLabelledBy: propTypes.string
|
5640 | };
|
5641 | var defaultProps$E = {
|
5642 | tag: 'div',
|
5643 | value: 0,
|
5644 | min: 0,
|
5645 | max: 100,
|
5646 | style: {}
|
5647 | };
|
5648 |
|
5649 | var Progress = function Progress(props) {
|
5650 | var children = props.children,
|
5651 | className = props.className,
|
5652 | barClassName = props.barClassName,
|
5653 | cssModule = props.cssModule,
|
5654 | value = props.value,
|
5655 | min = props.min,
|
5656 | max = props.max,
|
5657 | animated = props.animated,
|
5658 | striped = props.striped,
|
5659 | color = props.color,
|
5660 | bar = props.bar,
|
5661 | multi = props.multi,
|
5662 | Tag = props.tag,
|
5663 | style = props.style,
|
5664 | barAriaValueText = props.barAriaValueText,
|
5665 | barAriaLabelledBy = props.barAriaLabelledBy,
|
5666 | attributes = _objectWithoutPropertiesLoose(props, ["children", "className", "barClassName", "cssModule", "value", "min", "max", "animated", "striped", "color", "bar", "multi", "tag", "style", "barAriaValueText", "barAriaLabelledBy"]);
|
5667 |
|
5668 | var percent = toNumber(value) / toNumber(max) * 100;
|
5669 | var progressClasses = mapToCssModules(classnames(className, 'progress'), cssModule);
|
5670 | 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);
|
5671 | var ProgressBar = multi ? children : React__default.createElement("div", _extends({}, attributes, {
|
5672 | className: progressBarClasses,
|
5673 | style: _extends({}, style, {
|
5674 | width: percent + "%"
|
5675 | }),
|
5676 | role: "progressbar",
|
5677 | "aria-valuenow": value,
|
5678 | "aria-valuemin": min,
|
5679 | "aria-valuemax": max,
|
5680 | "aria-valuetext": barAriaValueText,
|
5681 | "aria-labelledby": barAriaLabelledBy,
|
5682 | children: children
|
5683 | }));
|
5684 |
|
5685 | if (bar) {
|
5686 | return ProgressBar;
|
5687 | }
|
5688 |
|
5689 | return React__default.createElement(Tag, _extends({}, attributes, {
|
5690 | className: progressClasses,
|
5691 | children: ProgressBar
|
5692 | }));
|
5693 | };
|
5694 |
|
5695 | Progress.propTypes = propTypes$I;
|
5696 | Progress.defaultProps = defaultProps$E;
|
5697 |
|
5698 | var propTypes$J = {
|
5699 | children: propTypes.node.isRequired,
|
5700 | node: propTypes.any
|
5701 | };
|
5702 |
|
5703 | var Portal$1 = function (_React$Component) {
|
5704 | _inheritsLoose(Portal, _React$Component);
|
5705 |
|
5706 | function Portal() {
|
5707 | return _React$Component.apply(this, arguments) || this;
|
5708 | }
|
5709 |
|
5710 | var _proto = Portal.prototype;
|
5711 |
|
5712 | _proto.componentWillUnmount = function componentWillUnmount() {
|
5713 | if (this.defaultNode) {
|
5714 | document.body.removeChild(this.defaultNode);
|
5715 | }
|
5716 |
|
5717 | this.defaultNode = null;
|
5718 | };
|
5719 |
|
5720 | _proto.render = function render() {
|
5721 | if (!canUseDOM) {
|
5722 | return null;
|
5723 | }
|
5724 |
|
5725 | if (!this.props.node && !this.defaultNode) {
|
5726 | this.defaultNode = document.createElement('div');
|
5727 | document.body.appendChild(this.defaultNode);
|
5728 | }
|
5729 |
|
5730 | return ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);
|
5731 | };
|
5732 |
|
5733 | return Portal;
|
5734 | }(React__default.Component);
|
5735 |
|
5736 | Portal$1.propTypes = propTypes$J;
|
5737 |
|
5738 | function noop$1() {}
|
5739 |
|
5740 | var FadePropTypes = propTypes.shape(Fade.propTypes);
|
5741 | var propTypes$K = {
|
5742 | isOpen: propTypes.bool,
|
5743 | autoFocus: propTypes.bool,
|
5744 | centered: propTypes.bool,
|
5745 | scrollable: propTypes.bool,
|
5746 | size: propTypes.string,
|
5747 | toggle: propTypes.func,
|
5748 | keyboard: propTypes.bool,
|
5749 | role: propTypes.string,
|
5750 | labelledBy: propTypes.string,
|
5751 | backdrop: propTypes.oneOfType([propTypes.bool, propTypes.oneOf(['static'])]),
|
5752 | onEnter: propTypes.func,
|
5753 | onExit: propTypes.func,
|
5754 | onOpened: propTypes.func,
|
5755 | onClosed: propTypes.func,
|
5756 | children: propTypes.node,
|
5757 | className: propTypes.string,
|
5758 | wrapClassName: propTypes.string,
|
5759 | modalClassName: propTypes.string,
|
5760 | backdropClassName: propTypes.string,
|
5761 | contentClassName: propTypes.string,
|
5762 | external: propTypes.node,
|
5763 | fade: propTypes.bool,
|
5764 | cssModule: propTypes.object,
|
5765 | zIndex: propTypes.oneOfType([propTypes.number, propTypes.string]),
|
5766 | backdropTransition: FadePropTypes,
|
5767 | modalTransition: FadePropTypes,
|
5768 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func]),
|
5769 | unmountOnClose: propTypes.bool,
|
5770 | returnFocusAfterClose: propTypes.bool,
|
5771 | container: targetPropType
|
5772 | };
|
5773 | var propsToOmit = Object.keys(propTypes$K);
|
5774 | var defaultProps$F = {
|
5775 | isOpen: false,
|
5776 | autoFocus: true,
|
5777 | centered: false,
|
5778 | scrollable: false,
|
5779 | role: 'dialog',
|
5780 | backdrop: true,
|
5781 | keyboard: true,
|
5782 | zIndex: 1050,
|
5783 | fade: true,
|
5784 | onOpened: noop$1,
|
5785 | onClosed: noop$1,
|
5786 | modalTransition: {
|
5787 | timeout: TransitionTimeouts.Modal
|
5788 | },
|
5789 | backdropTransition: {
|
5790 | mountOnEnter: true,
|
5791 | timeout: TransitionTimeouts.Fade
|
5792 |
|
5793 | },
|
5794 | unmountOnClose: true,
|
5795 | returnFocusAfterClose: true,
|
5796 | container: 'body'
|
5797 | };
|
5798 |
|
5799 | var Modal = function (_React$Component) {
|
5800 | _inheritsLoose(Modal, _React$Component);
|
5801 |
|
5802 | function Modal(props) {
|
5803 | var _this;
|
5804 |
|
5805 | _this = _React$Component.call(this, props) || this;
|
5806 | _this._element = null;
|
5807 | _this._originalBodyPadding = null;
|
5808 | _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_this));
|
5809 | _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_this));
|
5810 | _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_this));
|
5811 | _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_this));
|
5812 | _this.handleStaticBackdropAnimation = _this.handleStaticBackdropAnimation.bind(_assertThisInitialized(_this));
|
5813 | _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_this));
|
5814 | _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_this));
|
5815 | _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
|
5816 | _this.manageFocusAfterClose = _this.manageFocusAfterClose.bind(_assertThisInitialized(_this));
|
5817 | _this.clearBackdropAnimationTimeout = _this.clearBackdropAnimationTimeout.bind(_assertThisInitialized(_this));
|
5818 | _this.state = {
|
5819 | isOpen: false,
|
5820 | showStaticBackdropAnimation: false
|
5821 | };
|
5822 | return _this;
|
5823 | }
|
5824 |
|
5825 | var _proto = Modal.prototype;
|
5826 |
|
5827 | _proto.componentDidMount = function componentDidMount() {
|
5828 | var _this$props = this.props,
|
5829 | isOpen = _this$props.isOpen,
|
5830 | autoFocus = _this$props.autoFocus,
|
5831 | onEnter = _this$props.onEnter;
|
5832 |
|
5833 | if (isOpen) {
|
5834 | this.init();
|
5835 | this.setState({
|
5836 | isOpen: true
|
5837 | });
|
5838 |
|
5839 | if (autoFocus) {
|
5840 | this.setFocus();
|
5841 | }
|
5842 | }
|
5843 |
|
5844 | if (onEnter) {
|
5845 | onEnter();
|
5846 | }
|
5847 |
|
5848 | this._isMounted = true;
|
5849 | };
|
5850 |
|
5851 | _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
5852 | if (this.props.isOpen && !prevProps.isOpen) {
|
5853 | this.init();
|
5854 | this.setState({
|
5855 | isOpen: true
|
5856 | });
|
5857 |
|
5858 | return;
|
5859 | }
|
5860 |
|
5861 |
|
5862 | if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {
|
5863 | this.setFocus();
|
5864 | }
|
5865 |
|
5866 | if (this._element && prevProps.zIndex !== this.props.zIndex) {
|
5867 | this._element.style.zIndex = this.props.zIndex;
|
5868 | }
|
5869 | };
|
5870 |
|
5871 | _proto.componentWillUnmount = function componentWillUnmount() {
|
5872 | this.clearBackdropAnimationTimeout();
|
5873 |
|
5874 | if (this.props.onExit) {
|
5875 | this.props.onExit();
|
5876 | }
|
5877 |
|
5878 | if (this._element) {
|
5879 | this.destroy();
|
5880 |
|
5881 | if (this.props.isOpen || this.state.isOpen) {
|
5882 | this.close();
|
5883 | }
|
5884 | }
|
5885 |
|
5886 | this._isMounted = false;
|
5887 | };
|
5888 |
|
5889 | _proto.onOpened = function onOpened(node, isAppearing) {
|
5890 | this.props.onOpened();
|
5891 | (this.props.modalTransition.onEntered || noop$1)(node, isAppearing);
|
5892 | };
|
5893 |
|
5894 | _proto.onClosed = function onClosed(node) {
|
5895 | var unmountOnClose = this.props.unmountOnClose;
|
5896 |
|
5897 | this.props.onClosed();
|
5898 | (this.props.modalTransition.onExited || noop$1)(node);
|
5899 |
|
5900 | if (unmountOnClose) {
|
5901 | this.destroy();
|
5902 | }
|
5903 |
|
5904 | this.close();
|
5905 |
|
5906 | if (this._isMounted) {
|
5907 | this.setState({
|
5908 | isOpen: false
|
5909 | });
|
5910 | }
|
5911 | };
|
5912 |
|
5913 | _proto.setFocus = function setFocus() {
|
5914 | if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') {
|
5915 | this._dialog.parentNode.focus();
|
5916 | }
|
5917 | };
|
5918 |
|
5919 | _proto.getFocusableChildren = function getFocusableChildren() {
|
5920 | return this._element.querySelectorAll(focusableElements.join(', '));
|
5921 | };
|
5922 |
|
5923 | _proto.getFocusedChild = function getFocusedChild() {
|
5924 | var currentFocus;
|
5925 | var focusableChildren = this.getFocusableChildren();
|
5926 |
|
5927 | try {
|
5928 | currentFocus = document.activeElement;
|
5929 | } catch (err) {
|
5930 | currentFocus = focusableChildren[0];
|
5931 | }
|
5932 |
|
5933 | return currentFocus;
|
5934 | }
|
5935 | ;
|
5936 |
|
5937 | _proto.handleBackdropClick = function handleBackdropClick(e) {
|
5938 | if (e.target === this._mouseDownElement) {
|
5939 | e.stopPropagation();
|
5940 | var backdrop = this._dialog ? this._dialog.parentNode : null;
|
5941 |
|
5942 | if (backdrop && e.target === backdrop && this.props.backdrop === 'static') {
|
5943 | this.handleStaticBackdropAnimation();
|
5944 | }
|
5945 |
|
5946 | if (!this.props.isOpen || this.props.backdrop !== true) return;
|
5947 |
|
5948 | if (backdrop && e.target === backdrop && this.props.toggle) {
|
5949 | this.props.toggle(e);
|
5950 | }
|
5951 | }
|
5952 | };
|
5953 |
|
5954 | _proto.handleTab = function handleTab(e) {
|
5955 | if (e.which !== 9) return;
|
5956 | var focusableChildren = this.getFocusableChildren();
|
5957 | var totalFocusable = focusableChildren.length;
|
5958 | if (totalFocusable === 0) return;
|
5959 | var currentFocus = this.getFocusedChild();
|
5960 | var focusedIndex = 0;
|
5961 |
|
5962 | for (var i = 0; i < totalFocusable; i += 1) {
|
5963 | if (focusableChildren[i] === currentFocus) {
|
5964 | focusedIndex = i;
|
5965 | break;
|
5966 | }
|
5967 | }
|
5968 |
|
5969 | if (e.shiftKey && focusedIndex === 0) {
|
5970 | e.preventDefault();
|
5971 | focusableChildren[totalFocusable - 1].focus();
|
5972 | } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {
|
5973 | e.preventDefault();
|
5974 | focusableChildren[0].focus();
|
5975 | }
|
5976 | };
|
5977 |
|
5978 | _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {
|
5979 | this._mouseDownElement = e.target;
|
5980 | };
|
5981 |
|
5982 | _proto.handleEscape = function handleEscape(e) {
|
5983 | if (this.props.isOpen && e.keyCode === keyCodes.esc && this.props.toggle) {
|
5984 | if (this.props.keyboard) {
|
5985 | e.preventDefault();
|
5986 | e.stopPropagation();
|
5987 | this.props.toggle(e);
|
5988 | } else if (this.props.backdrop === 'static') {
|
5989 | e.preventDefault();
|
5990 | e.stopPropagation();
|
5991 | this.handleStaticBackdropAnimation();
|
5992 | }
|
5993 | }
|
5994 | };
|
5995 |
|
5996 | _proto.handleStaticBackdropAnimation = function handleStaticBackdropAnimation() {
|
5997 | var _this2 = this;
|
5998 |
|
5999 | this.clearBackdropAnimationTimeout();
|
6000 | this.setState({
|
6001 | showStaticBackdropAnimation: true
|
6002 | });
|
6003 | this._backdropAnimationTimeout = setTimeout(function () {
|
6004 | _this2.setState({
|
6005 | showStaticBackdropAnimation: false
|
6006 | });
|
6007 | }, 100);
|
6008 | };
|
6009 |
|
6010 | _proto.init = function init() {
|
6011 | try {
|
6012 | this._triggeringElement = document.activeElement;
|
6013 | } catch (err) {
|
6014 | this._triggeringElement = null;
|
6015 | }
|
6016 |
|
6017 | if (!this._element) {
|
6018 | this._element = document.createElement('div');
|
6019 |
|
6020 | this._element.setAttribute('tabindex', '-1');
|
6021 |
|
6022 | this._element.style.position = 'relative';
|
6023 | this._element.style.zIndex = this.props.zIndex;
|
6024 | this._mountContainer = getTarget(this.props.container);
|
6025 |
|
6026 | this._mountContainer.appendChild(this._element);
|
6027 | }
|
6028 |
|
6029 | this._originalBodyPadding = getOriginalBodyPadding();
|
6030 | conditionallyUpdateScrollbar();
|
6031 |
|
6032 | if (Modal.openCount === 0) {
|
6033 | document.body.className = classnames(document.body.className, mapToCssModules('modal-open', this.props.cssModule));
|
6034 | }
|
6035 |
|
6036 | Modal.openCount += 1;
|
6037 | };
|
6038 |
|
6039 | _proto.destroy = function destroy() {
|
6040 | if (this._element) {
|
6041 | this._mountContainer.removeChild(this._element);
|
6042 |
|
6043 | this._element = null;
|
6044 | }
|
6045 |
|
6046 | this.manageFocusAfterClose();
|
6047 | };
|
6048 |
|
6049 | _proto.manageFocusAfterClose = function manageFocusAfterClose() {
|
6050 | if (this._triggeringElement) {
|
6051 | var returnFocusAfterClose = this.props.returnFocusAfterClose;
|
6052 | if (this._triggeringElement.focus && returnFocusAfterClose) this._triggeringElement.focus();
|
6053 | this._triggeringElement = null;
|
6054 | }
|
6055 | };
|
6056 |
|
6057 | _proto.close = function close() {
|
6058 | if (Modal.openCount <= 1) {
|
6059 | var modalOpenClassName = mapToCssModules('modal-open', this.props.cssModule);
|
6060 |
|
6061 | var modalOpenClassNameRegex = new RegExp("(^| )" + modalOpenClassName + "( |$)");
|
6062 | document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim();
|
6063 | }
|
6064 |
|
6065 | this.manageFocusAfterClose();
|
6066 | Modal.openCount = Math.max(0, Modal.openCount - 1);
|
6067 | setScrollbarWidth(this._originalBodyPadding);
|
6068 | };
|
6069 |
|
6070 | _proto.renderModalDialog = function renderModalDialog() {
|
6071 | var _classNames,
|
6072 | _this3 = this;
|
6073 |
|
6074 | var attributes = omit(this.props, propsToOmit);
|
6075 | var dialogBaseClass = 'modal-dialog';
|
6076 | return React__default.createElement("div", _extends({}, attributes, {
|
6077 | 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),
|
6078 | role: "document",
|
6079 | ref: function ref(c) {
|
6080 | _this3._dialog = c;
|
6081 | }
|
6082 | }), React__default.createElement("div", {
|
6083 | className: mapToCssModules(classnames('modal-content', this.props.contentClassName), this.props.cssModule)
|
6084 | }, this.props.children));
|
6085 | };
|
6086 |
|
6087 | _proto.render = function render() {
|
6088 | var unmountOnClose = this.props.unmountOnClose;
|
6089 |
|
6090 | if (!!this._element && (this.state.isOpen || !unmountOnClose)) {
|
6091 | var isModalHidden = !!this._element && !this.state.isOpen && !unmountOnClose;
|
6092 | this._element.style.display = isModalHidden ? 'none' : 'block';
|
6093 | var _this$props2 = this.props,
|
6094 | wrapClassName = _this$props2.wrapClassName,
|
6095 | modalClassName = _this$props2.modalClassName,
|
6096 | backdropClassName = _this$props2.backdropClassName,
|
6097 | cssModule = _this$props2.cssModule,
|
6098 | isOpen = _this$props2.isOpen,
|
6099 | backdrop = _this$props2.backdrop,
|
6100 | role = _this$props2.role,
|
6101 | labelledBy = _this$props2.labelledBy,
|
6102 | external = _this$props2.external,
|
6103 | innerRef = _this$props2.innerRef;
|
6104 | var modalAttributes = {
|
6105 | onClick: this.handleBackdropClick,
|
6106 | onMouseDown: this.handleBackdropMouseDown,
|
6107 | onKeyUp: this.handleEscape,
|
6108 | onKeyDown: this.handleTab,
|
6109 | style: {
|
6110 | display: 'block'
|
6111 | },
|
6112 | 'aria-labelledby': labelledBy,
|
6113 | role: role,
|
6114 | tabIndex: '-1'
|
6115 | };
|
6116 | var hasTransition = this.props.fade;
|
6117 |
|
6118 | var modalTransition = _extends({}, Fade.defaultProps, this.props.modalTransition, {
|
6119 | baseClass: hasTransition ? this.props.modalTransition.baseClass : '',
|
6120 | timeout: hasTransition ? this.props.modalTransition.timeout : 0
|
6121 | });
|
6122 |
|
6123 | var backdropTransition = _extends({}, Fade.defaultProps, this.props.backdropTransition, {
|
6124 | baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',
|
6125 | timeout: hasTransition ? this.props.backdropTransition.timeout : 0
|
6126 | });
|
6127 |
|
6128 | var Backdrop = backdrop && (hasTransition ? React__default.createElement(Fade, _extends({}, backdropTransition, {
|
6129 | in: isOpen && !!backdrop,
|
6130 | cssModule: cssModule,
|
6131 | className: mapToCssModules(classnames('modal-backdrop', backdropClassName), cssModule)
|
6132 | })) : React__default.createElement("div", {
|
6133 | className: mapToCssModules(classnames('modal-backdrop', 'show', backdropClassName), cssModule)
|
6134 | }));
|
6135 | return React__default.createElement(Portal$1, {
|
6136 | node: this._element
|
6137 | }, React__default.createElement("div", {
|
6138 | className: mapToCssModules(wrapClassName)
|
6139 | }, React__default.createElement(Fade, _extends({}, modalAttributes, modalTransition, {
|
6140 | in: isOpen,
|
6141 | onEntered: this.onOpened,
|
6142 | onExited: this.onClosed,
|
6143 | cssModule: cssModule,
|
6144 | className: mapToCssModules(classnames('modal', modalClassName, this.state.showStaticBackdropAnimation && 'modal-static'), cssModule),
|
6145 | innerRef: innerRef
|
6146 | }), external, this.renderModalDialog()), Backdrop));
|
6147 | }
|
6148 |
|
6149 | return null;
|
6150 | };
|
6151 |
|
6152 | _proto.clearBackdropAnimationTimeout = function clearBackdropAnimationTimeout() {
|
6153 | if (this._backdropAnimationTimeout) {
|
6154 | clearTimeout(this._backdropAnimationTimeout);
|
6155 | this._backdropAnimationTimeout = undefined;
|
6156 | }
|
6157 | };
|
6158 |
|
6159 | return Modal;
|
6160 | }(React__default.Component);
|
6161 |
|
6162 | Modal.propTypes = propTypes$K;
|
6163 | Modal.defaultProps = defaultProps$F;
|
6164 | Modal.openCount = 0;
|
6165 |
|
6166 | var propTypes$L = {
|
6167 | tag: tagPropType,
|
6168 | wrapTag: tagPropType,
|
6169 | toggle: propTypes.func,
|
6170 | className: propTypes.string,
|
6171 | cssModule: propTypes.object,
|
6172 | children: propTypes.node,
|
6173 | closeAriaLabel: propTypes.string,
|
6174 | charCode: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
6175 | close: propTypes.object
|
6176 | };
|
6177 | var defaultProps$G = {
|
6178 | tag: 'h5',
|
6179 | wrapTag: 'div',
|
6180 | closeAriaLabel: 'Close',
|
6181 | charCode: 215
|
6182 | };
|
6183 |
|
6184 | var ModalHeader = function ModalHeader(props) {
|
6185 | var closeButton;
|
6186 |
|
6187 | var className = props.className,
|
6188 | cssModule = props.cssModule,
|
6189 | children = props.children,
|
6190 | toggle = props.toggle,
|
6191 | Tag = props.tag,
|
6192 | WrapTag = props.wrapTag,
|
6193 | closeAriaLabel = props.closeAriaLabel,
|
6194 | charCode = props.charCode,
|
6195 | close = props.close,
|
6196 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close"]);
|
6197 |
|
6198 | var classes = mapToCssModules(classnames(className, 'modal-header'), cssModule);
|
6199 |
|
6200 | if (!close && toggle) {
|
6201 | var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
|
6202 | closeButton = React__default.createElement("button", {
|
6203 | type: "button",
|
6204 | onClick: toggle,
|
6205 | className: mapToCssModules('close', cssModule),
|
6206 | "aria-label": closeAriaLabel
|
6207 | }, React__default.createElement("span", {
|
6208 | "aria-hidden": "true"
|
6209 | }, closeIcon));
|
6210 | }
|
6211 |
|
6212 | return React__default.createElement(WrapTag, _extends({}, attributes, {
|
6213 | className: classes
|
6214 | }), React__default.createElement(Tag, {
|
6215 | className: mapToCssModules('modal-title', cssModule)
|
6216 | }, children), close || closeButton);
|
6217 | };
|
6218 |
|
6219 | ModalHeader.propTypes = propTypes$L;
|
6220 | ModalHeader.defaultProps = defaultProps$G;
|
6221 |
|
6222 | var propTypes$M = {
|
6223 | tag: tagPropType,
|
6224 | className: propTypes.string,
|
6225 | cssModule: propTypes.object
|
6226 | };
|
6227 | var defaultProps$H = {
|
6228 | tag: 'div'
|
6229 | };
|
6230 |
|
6231 | var ModalBody = function ModalBody(props) {
|
6232 | var className = props.className,
|
6233 | cssModule = props.cssModule,
|
6234 | Tag = props.tag,
|
6235 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
6236 |
|
6237 | var classes = mapToCssModules(classnames(className, 'modal-body'), cssModule);
|
6238 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6239 | className: classes
|
6240 | }));
|
6241 | };
|
6242 |
|
6243 | ModalBody.propTypes = propTypes$M;
|
6244 | ModalBody.defaultProps = defaultProps$H;
|
6245 |
|
6246 | var propTypes$N = {
|
6247 | tag: tagPropType,
|
6248 | className: propTypes.string,
|
6249 | cssModule: propTypes.object
|
6250 | };
|
6251 | var defaultProps$I = {
|
6252 | tag: 'div'
|
6253 | };
|
6254 |
|
6255 | var ModalFooter = function ModalFooter(props) {
|
6256 | var className = props.className,
|
6257 | cssModule = props.cssModule,
|
6258 | Tag = props.tag,
|
6259 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
6260 |
|
6261 | var classes = mapToCssModules(classnames(className, 'modal-footer'), cssModule);
|
6262 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6263 | className: classes
|
6264 | }));
|
6265 | };
|
6266 |
|
6267 | ModalFooter.propTypes = propTypes$N;
|
6268 | ModalFooter.defaultProps = defaultProps$I;
|
6269 |
|
6270 | var defaultProps$J = {
|
6271 | placement: 'top',
|
6272 | autohide: true,
|
6273 | placementPrefix: 'bs-tooltip',
|
6274 | trigger: 'hover focus'
|
6275 | };
|
6276 |
|
6277 | var Tooltip = function Tooltip(props) {
|
6278 | var popperClasses = classnames('tooltip', 'show', props.popperClassName);
|
6279 | var classes = classnames('tooltip-inner', props.innerClassName);
|
6280 | return React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
|
6281 | popperClassName: popperClasses,
|
6282 | innerClassName: classes
|
6283 | }));
|
6284 | };
|
6285 |
|
6286 | Tooltip.propTypes = propTypes$F;
|
6287 | Tooltip.defaultProps = defaultProps$J;
|
6288 |
|
6289 | var propTypes$O = {
|
6290 | className: propTypes.string,
|
6291 | cssModule: propTypes.object,
|
6292 | size: propTypes.string,
|
6293 | bordered: propTypes.bool,
|
6294 | borderless: propTypes.bool,
|
6295 | striped: propTypes.bool,
|
6296 | dark: propTypes.bool,
|
6297 | hover: propTypes.bool,
|
6298 | responsive: propTypes.oneOfType([propTypes.bool, propTypes.string]),
|
6299 | tag: tagPropType,
|
6300 | responsiveTag: tagPropType,
|
6301 | innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object])
|
6302 | };
|
6303 | var defaultProps$K = {
|
6304 | tag: 'table',
|
6305 | responsiveTag: 'div'
|
6306 | };
|
6307 |
|
6308 | var Table = function Table(props) {
|
6309 | var className = props.className,
|
6310 | cssModule = props.cssModule,
|
6311 | size = props.size,
|
6312 | bordered = props.bordered,
|
6313 | borderless = props.borderless,
|
6314 | striped = props.striped,
|
6315 | dark = props.dark,
|
6316 | hover = props.hover,
|
6317 | responsive = props.responsive,
|
6318 | Tag = props.tag,
|
6319 | ResponsiveTag = props.responsiveTag,
|
6320 | innerRef = props.innerRef,
|
6321 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "bordered", "borderless", "striped", "dark", "hover", "responsive", "tag", "responsiveTag", "innerRef"]);
|
6322 |
|
6323 | 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);
|
6324 | var table = React__default.createElement(Tag, _extends({}, attributes, {
|
6325 | ref: innerRef,
|
6326 | className: classes
|
6327 | }));
|
6328 |
|
6329 | if (responsive) {
|
6330 | var responsiveClassName = mapToCssModules(responsive === true ? 'table-responsive' : "table-responsive-" + responsive, cssModule);
|
6331 | return React__default.createElement(ResponsiveTag, {
|
6332 | className: responsiveClassName
|
6333 | }, table);
|
6334 | }
|
6335 |
|
6336 | return table;
|
6337 | };
|
6338 |
|
6339 | Table.propTypes = propTypes$O;
|
6340 | Table.defaultProps = defaultProps$K;
|
6341 |
|
6342 | var propTypes$P = {
|
6343 | tag: tagPropType,
|
6344 | flush: propTypes.bool,
|
6345 | className: propTypes.string,
|
6346 | cssModule: propTypes.object,
|
6347 | horizontal: propTypes.oneOfType([propTypes.bool, propTypes.string])
|
6348 | };
|
6349 | var defaultProps$L = {
|
6350 | tag: 'ul',
|
6351 | horizontal: false
|
6352 | };
|
6353 |
|
6354 | var getHorizontalClass = function getHorizontalClass(horizontal) {
|
6355 | if (horizontal === false) {
|
6356 | return false;
|
6357 | } else if (horizontal === true || horizontal === "xs") {
|
6358 | return "list-group-horizontal";
|
6359 | }
|
6360 |
|
6361 | return "list-group-horizontal-" + horizontal;
|
6362 | };
|
6363 |
|
6364 | var ListGroup = function ListGroup(props) {
|
6365 | var className = props.className,
|
6366 | cssModule = props.cssModule,
|
6367 | Tag = props.tag,
|
6368 | flush = props.flush,
|
6369 | horizontal = props.horizontal,
|
6370 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "flush", "horizontal"]);
|
6371 |
|
6372 | var classes = mapToCssModules(classnames(className, 'list-group',
|
6373 |
|
6374 | flush ? 'list-group-flush' : getHorizontalClass(horizontal)), cssModule);
|
6375 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6376 | className: classes
|
6377 | }));
|
6378 | };
|
6379 |
|
6380 | ListGroup.propTypes = propTypes$P;
|
6381 | ListGroup.defaultProps = defaultProps$L;
|
6382 |
|
6383 | var propTypes$Q = {
|
6384 | children: propTypes.node,
|
6385 | inline: propTypes.bool,
|
6386 | tag: tagPropType,
|
6387 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
|
6388 | className: propTypes.string,
|
6389 | cssModule: propTypes.object
|
6390 | };
|
6391 | var defaultProps$M = {
|
6392 | tag: 'form'
|
6393 | };
|
6394 |
|
6395 | var Form = function (_Component) {
|
6396 | _inheritsLoose(Form, _Component);
|
6397 |
|
6398 | function Form(props) {
|
6399 | var _this;
|
6400 |
|
6401 | _this = _Component.call(this, props) || this;
|
6402 | _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
6403 | _this.submit = _this.submit.bind(_assertThisInitialized(_this));
|
6404 | return _this;
|
6405 | }
|
6406 |
|
6407 | var _proto = Form.prototype;
|
6408 |
|
6409 | _proto.getRef = function getRef(ref) {
|
6410 | if (this.props.innerRef) {
|
6411 | this.props.innerRef(ref);
|
6412 | }
|
6413 |
|
6414 | this.ref = ref;
|
6415 | };
|
6416 |
|
6417 | _proto.submit = function submit() {
|
6418 | if (this.ref) {
|
6419 | this.ref.submit();
|
6420 | }
|
6421 | };
|
6422 |
|
6423 | _proto.render = function render() {
|
6424 | var _this$props = this.props,
|
6425 | className = _this$props.className,
|
6426 | cssModule = _this$props.cssModule,
|
6427 | inline = _this$props.inline,
|
6428 | Tag = _this$props.tag,
|
6429 | innerRef = _this$props.innerRef,
|
6430 | attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "inline", "tag", "innerRef"]);
|
6431 |
|
6432 | var classes = mapToCssModules(classnames(className, inline ? 'form-inline' : false), cssModule);
|
6433 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6434 | ref: innerRef,
|
6435 | className: classes
|
6436 | }));
|
6437 | };
|
6438 |
|
6439 | return Form;
|
6440 | }(React.Component);
|
6441 |
|
6442 | Form.propTypes = propTypes$Q;
|
6443 | Form.defaultProps = defaultProps$M;
|
6444 |
|
6445 | var propTypes$R = {
|
6446 | children: propTypes.node,
|
6447 | tag: tagPropType,
|
6448 | className: propTypes.string,
|
6449 | cssModule: propTypes.object,
|
6450 | valid: propTypes.bool,
|
6451 | tooltip: propTypes.bool
|
6452 | };
|
6453 | var defaultProps$N = {
|
6454 | tag: 'div',
|
6455 | valid: undefined
|
6456 | };
|
6457 |
|
6458 | var FormFeedback = function FormFeedback(props) {
|
6459 | var className = props.className,
|
6460 | cssModule = props.cssModule,
|
6461 | valid = props.valid,
|
6462 | tooltip = props.tooltip,
|
6463 | Tag = props.tag,
|
6464 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "valid", "tooltip", "tag"]);
|
6465 |
|
6466 | var validMode = tooltip ? 'tooltip' : 'feedback';
|
6467 | var classes = mapToCssModules(classnames(className, valid ? "valid-" + validMode : "invalid-" + validMode), cssModule);
|
6468 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6469 | className: classes
|
6470 | }));
|
6471 | };
|
6472 |
|
6473 | FormFeedback.propTypes = propTypes$R;
|
6474 | FormFeedback.defaultProps = defaultProps$N;
|
6475 |
|
6476 | var propTypes$S = {
|
6477 | children: propTypes.node,
|
6478 | row: propTypes.bool,
|
6479 | check: propTypes.bool,
|
6480 | inline: propTypes.bool,
|
6481 | disabled: propTypes.bool,
|
6482 | tag: tagPropType,
|
6483 | className: propTypes.string,
|
6484 | cssModule: propTypes.object
|
6485 | };
|
6486 | var defaultProps$O = {
|
6487 | tag: 'div'
|
6488 | };
|
6489 |
|
6490 | var FormGroup = function FormGroup(props) {
|
6491 | var className = props.className,
|
6492 | cssModule = props.cssModule,
|
6493 | row = props.row,
|
6494 | disabled = props.disabled,
|
6495 | check = props.check,
|
6496 | inline = props.inline,
|
6497 | Tag = props.tag,
|
6498 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "row", "disabled", "check", "inline", "tag"]);
|
6499 |
|
6500 | var classes = mapToCssModules(classnames(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule);
|
6501 |
|
6502 | if (Tag === 'fieldset') {
|
6503 | attributes.disabled = disabled;
|
6504 | }
|
6505 |
|
6506 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6507 | className: classes
|
6508 | }));
|
6509 | };
|
6510 |
|
6511 | FormGroup.propTypes = propTypes$S;
|
6512 | FormGroup.defaultProps = defaultProps$O;
|
6513 |
|
6514 | var propTypes$T = {
|
6515 | children: propTypes.node,
|
6516 | inline: propTypes.bool,
|
6517 | tag: tagPropType,
|
6518 | color: propTypes.string,
|
6519 | className: propTypes.string,
|
6520 | cssModule: propTypes.object
|
6521 | };
|
6522 | var defaultProps$P = {
|
6523 | tag: 'small',
|
6524 | color: 'muted'
|
6525 | };
|
6526 |
|
6527 | var FormText = function FormText(props) {
|
6528 | var className = props.className,
|
6529 | cssModule = props.cssModule,
|
6530 | inline = props.inline,
|
6531 | color = props.color,
|
6532 | Tag = props.tag,
|
6533 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "inline", "color", "tag"]);
|
6534 |
|
6535 | var classes = mapToCssModules(classnames(className, !inline ? 'form-text' : false, color ? "text-" + color : false), cssModule);
|
6536 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6537 | className: classes
|
6538 | }));
|
6539 | };
|
6540 |
|
6541 | FormText.propTypes = propTypes$T;
|
6542 | FormText.defaultProps = defaultProps$P;
|
6543 |
|
6544 | var propTypes$U = {
|
6545 | children: propTypes.node,
|
6546 | type: propTypes.string,
|
6547 | size: propTypes.oneOfType([propTypes.number, propTypes.string]),
|
6548 | bsSize: propTypes.string,
|
6549 | valid: propTypes.bool,
|
6550 | invalid: propTypes.bool,
|
6551 | tag: tagPropType,
|
6552 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
|
6553 | plaintext: propTypes.bool,
|
6554 | addon: propTypes.bool,
|
6555 | className: propTypes.string,
|
6556 | cssModule: propTypes.object
|
6557 | };
|
6558 | var defaultProps$Q = {
|
6559 | type: 'text'
|
6560 | };
|
6561 |
|
6562 | var Input = function (_React$Component) {
|
6563 | _inheritsLoose(Input, _React$Component);
|
6564 |
|
6565 | function Input(props) {
|
6566 | var _this;
|
6567 |
|
6568 | _this = _React$Component.call(this, props) || this;
|
6569 | _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
|
6570 | _this.focus = _this.focus.bind(_assertThisInitialized(_this));
|
6571 | return _this;
|
6572 | }
|
6573 |
|
6574 | var _proto = Input.prototype;
|
6575 |
|
6576 | _proto.getRef = function getRef(ref) {
|
6577 | if (this.props.innerRef) {
|
6578 | this.props.innerRef(ref);
|
6579 | }
|
6580 |
|
6581 | this.ref = ref;
|
6582 | };
|
6583 |
|
6584 | _proto.focus = function focus() {
|
6585 | if (this.ref) {
|
6586 | this.ref.focus();
|
6587 | }
|
6588 | };
|
6589 |
|
6590 | _proto.render = function render() {
|
6591 | var _this$props = this.props,
|
6592 | className = _this$props.className,
|
6593 | cssModule = _this$props.cssModule,
|
6594 | type = _this$props.type,
|
6595 | bsSize = _this$props.bsSize,
|
6596 | valid = _this$props.valid,
|
6597 | invalid = _this$props.invalid,
|
6598 | tag = _this$props.tag,
|
6599 | addon = _this$props.addon,
|
6600 | plaintext = _this$props.plaintext,
|
6601 | innerRef = _this$props.innerRef,
|
6602 | attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "type", "bsSize", "valid", "invalid", "tag", "addon", "plaintext", "innerRef"]);
|
6603 |
|
6604 | var checkInput = ['radio', 'checkbox'].indexOf(type) > -1;
|
6605 | var isNotaNumber = new RegExp('\\D', 'g');
|
6606 | var fileInput = type === 'file';
|
6607 | var textareaInput = type === 'textarea';
|
6608 | var selectInput = type === 'select';
|
6609 | var rangeInput = type === 'range';
|
6610 | var Tag = tag || (selectInput || textareaInput ? type : 'input');
|
6611 | var formControlClass = 'form-control';
|
6612 |
|
6613 | if (plaintext) {
|
6614 | formControlClass = formControlClass + "-plaintext";
|
6615 | Tag = tag || 'input';
|
6616 | } else if (fileInput) {
|
6617 | formControlClass = formControlClass + "-file";
|
6618 | } else if (rangeInput) {
|
6619 | formControlClass = formControlClass + "-range";
|
6620 | } else if (checkInput) {
|
6621 | if (addon) {
|
6622 | formControlClass = null;
|
6623 | } else {
|
6624 | formControlClass = 'form-check-input';
|
6625 | }
|
6626 | }
|
6627 |
|
6628 | if (attributes.size && isNotaNumber.test(attributes.size)) {
|
6629 | warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.');
|
6630 | bsSize = attributes.size;
|
6631 | delete attributes.size;
|
6632 | }
|
6633 |
|
6634 | var classes = mapToCssModules(classnames(className, invalid && 'is-invalid', valid && 'is-valid', bsSize ? "form-control-" + bsSize : false, formControlClass), cssModule);
|
6635 |
|
6636 | if (Tag === 'input' || tag && typeof tag === 'function') {
|
6637 | attributes.type = type;
|
6638 | }
|
6639 |
|
6640 | if (attributes.children && !(plaintext || type === 'select' || typeof Tag !== 'string' || Tag === 'select')) {
|
6641 | warnOnce("Input with a type of \"" + type + "\" cannot have children. Please use \"value\"/\"defaultValue\" instead.");
|
6642 | delete attributes.children;
|
6643 | }
|
6644 |
|
6645 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6646 | ref: innerRef,
|
6647 | className: classes,
|
6648 | "aria-invalid": invalid
|
6649 | }));
|
6650 | };
|
6651 |
|
6652 | return Input;
|
6653 | }(React__default.Component);
|
6654 |
|
6655 | Input.propTypes = propTypes$U;
|
6656 | Input.defaultProps = defaultProps$Q;
|
6657 |
|
6658 | var propTypes$V = {
|
6659 | tag: tagPropType,
|
6660 | size: propTypes.string,
|
6661 | className: propTypes.string,
|
6662 | cssModule: propTypes.object
|
6663 | };
|
6664 | var defaultProps$R = {
|
6665 | tag: 'div'
|
6666 | };
|
6667 |
|
6668 | var InputGroup = function InputGroup(props) {
|
6669 | var className = props.className,
|
6670 | cssModule = props.cssModule,
|
6671 | Tag = props.tag,
|
6672 | size = props.size,
|
6673 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "size"]);
|
6674 |
|
6675 | var classes = mapToCssModules(classnames(className, 'input-group', size ? "input-group-" + size : null), cssModule);
|
6676 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6677 | className: classes
|
6678 | }));
|
6679 | };
|
6680 |
|
6681 | InputGroup.propTypes = propTypes$V;
|
6682 | InputGroup.defaultProps = defaultProps$R;
|
6683 |
|
6684 | var propTypes$W = {
|
6685 | tag: tagPropType,
|
6686 | className: propTypes.string,
|
6687 | cssModule: propTypes.object
|
6688 | };
|
6689 | var defaultProps$S = {
|
6690 | tag: 'span'
|
6691 | };
|
6692 |
|
6693 | var InputGroupText = function InputGroupText(props) {
|
6694 | var className = props.className,
|
6695 | cssModule = props.cssModule,
|
6696 | Tag = props.tag,
|
6697 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
6698 |
|
6699 | var classes = mapToCssModules(classnames(className, 'input-group-text'), cssModule);
|
6700 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6701 | className: classes
|
6702 | }));
|
6703 | };
|
6704 |
|
6705 | InputGroupText.propTypes = propTypes$W;
|
6706 | InputGroupText.defaultProps = defaultProps$S;
|
6707 |
|
6708 | var propTypes$X = {
|
6709 | tag: tagPropType,
|
6710 | addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
|
6711 | children: propTypes.node,
|
6712 | className: propTypes.string,
|
6713 | cssModule: propTypes.object
|
6714 | };
|
6715 | var defaultProps$T = {
|
6716 | tag: 'div'
|
6717 | };
|
6718 |
|
6719 | var InputGroupAddon = function InputGroupAddon(props) {
|
6720 | var className = props.className,
|
6721 | cssModule = props.cssModule,
|
6722 | Tag = props.tag,
|
6723 | addonType = props.addonType,
|
6724 | children = props.children,
|
6725 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "addonType", "children"]);
|
6726 |
|
6727 | var classes = mapToCssModules(classnames(className, 'input-group-' + addonType), cssModule);
|
6728 |
|
6729 | if (typeof children === 'string') {
|
6730 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6731 | className: classes
|
6732 | }), React__default.createElement(InputGroupText, {
|
6733 | children: children
|
6734 | }));
|
6735 | }
|
6736 |
|
6737 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6738 | className: classes,
|
6739 | children: children
|
6740 | }));
|
6741 | };
|
6742 |
|
6743 | InputGroupAddon.propTypes = propTypes$X;
|
6744 | InputGroupAddon.defaultProps = defaultProps$T;
|
6745 |
|
6746 | var propTypes$Y = {
|
6747 | addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
|
6748 | children: propTypes.node
|
6749 | };
|
6750 |
|
6751 | var InputGroupButtonDropdown = function InputGroupButtonDropdown(props) {
|
6752 | return React__default.createElement(Dropdown, props);
|
6753 | };
|
6754 |
|
6755 | InputGroupButtonDropdown.propTypes = propTypes$Y;
|
6756 |
|
6757 | var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl'];
|
6758 | var stringOrNumberProp$1 = propTypes.oneOfType([propTypes.number, propTypes.string]);
|
6759 | var columnProps$1 = propTypes.oneOfType([propTypes.bool, propTypes.string, propTypes.number, propTypes.shape({
|
6760 | size: stringOrNumberProp$1,
|
6761 | order: stringOrNumberProp$1,
|
6762 | offset: stringOrNumberProp$1
|
6763 | })]);
|
6764 | var propTypes$Z = {
|
6765 | children: propTypes.node,
|
6766 | hidden: propTypes.bool,
|
6767 | check: propTypes.bool,
|
6768 | size: propTypes.string,
|
6769 | for: propTypes.string,
|
6770 | tag: tagPropType,
|
6771 | className: propTypes.string,
|
6772 | cssModule: propTypes.object,
|
6773 | xs: columnProps$1,
|
6774 | sm: columnProps$1,
|
6775 | md: columnProps$1,
|
6776 | lg: columnProps$1,
|
6777 | xl: columnProps$1,
|
6778 | widths: propTypes.array
|
6779 | };
|
6780 | var defaultProps$U = {
|
6781 | tag: 'label',
|
6782 | widths: colWidths$1
|
6783 | };
|
6784 |
|
6785 | var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) {
|
6786 | if (colSize === true || colSize === '') {
|
6787 | return isXs ? 'col' : "col-" + colWidth;
|
6788 | } else if (colSize === 'auto') {
|
6789 | return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
|
6790 | }
|
6791 |
|
6792 | return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
|
6793 | };
|
6794 |
|
6795 | var Label = function Label(props) {
|
6796 | var className = props.className,
|
6797 | cssModule = props.cssModule,
|
6798 | hidden = props.hidden,
|
6799 | widths = props.widths,
|
6800 | Tag = props.tag,
|
6801 | check = props.check,
|
6802 | size = props.size,
|
6803 | htmlFor = props.for,
|
6804 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "hidden", "widths", "tag", "check", "size", "for"]);
|
6805 |
|
6806 | var colClasses = [];
|
6807 | widths.forEach(function (colWidth, i) {
|
6808 | var columnProp = props[colWidth];
|
6809 | delete attributes[colWidth];
|
6810 |
|
6811 | if (!columnProp && columnProp !== '') {
|
6812 | return;
|
6813 | }
|
6814 |
|
6815 | var isXs = !i;
|
6816 | var colClass;
|
6817 |
|
6818 | if (isObject(columnProp)) {
|
6819 | var _classNames;
|
6820 |
|
6821 | var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
|
6822 | colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size);
|
6823 | 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);
|
6824 | } else {
|
6825 | colClass = getColumnSizeClass$1(isXs, colWidth, columnProp);
|
6826 | colClasses.push(colClass);
|
6827 | }
|
6828 | });
|
6829 | 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);
|
6830 | return React__default.createElement(Tag, _extends({
|
6831 | htmlFor: htmlFor
|
6832 | }, attributes, {
|
6833 | className: classes
|
6834 | }));
|
6835 | };
|
6836 |
|
6837 | Label.propTypes = propTypes$Z;
|
6838 | Label.defaultProps = defaultProps$U;
|
6839 |
|
6840 | var propTypes$_ = {
|
6841 | body: propTypes.bool,
|
6842 | bottom: propTypes.bool,
|
6843 | children: propTypes.node,
|
6844 | className: propTypes.string,
|
6845 | cssModule: propTypes.object,
|
6846 | heading: propTypes.bool,
|
6847 | left: propTypes.bool,
|
6848 | list: propTypes.bool,
|
6849 | middle: propTypes.bool,
|
6850 | object: propTypes.bool,
|
6851 | right: propTypes.bool,
|
6852 | tag: tagPropType,
|
6853 | top: propTypes.bool
|
6854 | };
|
6855 |
|
6856 | var Media = function Media(props) {
|
6857 | var body = props.body,
|
6858 | bottom = props.bottom,
|
6859 | className = props.className,
|
6860 | cssModule = props.cssModule,
|
6861 | heading = props.heading,
|
6862 | left = props.left,
|
6863 | list = props.list,
|
6864 | middle = props.middle,
|
6865 | object = props.object,
|
6866 | right = props.right,
|
6867 | tag = props.tag,
|
6868 | top = props.top,
|
6869 | attributes = _objectWithoutPropertiesLoose(props, ["body", "bottom", "className", "cssModule", "heading", "left", "list", "middle", "object", "right", "tag", "top"]);
|
6870 |
|
6871 | var defaultTag;
|
6872 |
|
6873 | if (heading) {
|
6874 | defaultTag = 'h4';
|
6875 | } else if (attributes.href) {
|
6876 | defaultTag = 'a';
|
6877 | } else if (attributes.src || object) {
|
6878 | defaultTag = 'img';
|
6879 | } else if (list) {
|
6880 | defaultTag = 'ul';
|
6881 | } else {
|
6882 | defaultTag = 'div';
|
6883 | }
|
6884 |
|
6885 | var Tag = tag || defaultTag;
|
6886 | var classes = mapToCssModules(classnames(className, {
|
6887 | 'media-body': body,
|
6888 | 'media-heading': heading,
|
6889 | 'media-left': left,
|
6890 | 'media-right': right,
|
6891 | 'media-top': top,
|
6892 | 'media-bottom': bottom,
|
6893 | 'media-middle': middle,
|
6894 | 'media-object': object,
|
6895 | 'media-list': list,
|
6896 | media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list
|
6897 | }), cssModule);
|
6898 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6899 | className: classes
|
6900 | }));
|
6901 | };
|
6902 |
|
6903 | Media.propTypes = propTypes$_;
|
6904 |
|
6905 | var propTypes$$ = {
|
6906 | children: propTypes.node,
|
6907 | className: propTypes.string,
|
6908 | listClassName: propTypes.string,
|
6909 | cssModule: propTypes.object,
|
6910 | size: propTypes.string,
|
6911 | tag: tagPropType,
|
6912 | listTag: tagPropType,
|
6913 | 'aria-label': propTypes.string
|
6914 | };
|
6915 | var defaultProps$V = {
|
6916 | tag: 'nav',
|
6917 | listTag: 'ul',
|
6918 | 'aria-label': 'pagination'
|
6919 | };
|
6920 |
|
6921 | var Pagination = function Pagination(props) {
|
6922 | var _classNames;
|
6923 |
|
6924 | var className = props.className,
|
6925 | listClassName = props.listClassName,
|
6926 | cssModule = props.cssModule,
|
6927 | size = props.size,
|
6928 | Tag = props.tag,
|
6929 | ListTag = props.listTag,
|
6930 | label = props['aria-label'],
|
6931 | attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"]);
|
6932 |
|
6933 | var classes = mapToCssModules(classnames(className), cssModule);
|
6934 | var listClasses = mapToCssModules(classnames(listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
|
6935 | return React__default.createElement(Tag, {
|
6936 | className: classes,
|
6937 | "aria-label": label
|
6938 | }, React__default.createElement(ListTag, _extends({}, attributes, {
|
6939 | className: listClasses
|
6940 | })));
|
6941 | };
|
6942 |
|
6943 | Pagination.propTypes = propTypes$$;
|
6944 | Pagination.defaultProps = defaultProps$V;
|
6945 |
|
6946 | var propTypes$10 = {
|
6947 | active: propTypes.bool,
|
6948 | children: propTypes.node,
|
6949 | className: propTypes.string,
|
6950 | cssModule: propTypes.object,
|
6951 | disabled: propTypes.bool,
|
6952 | tag: tagPropType
|
6953 | };
|
6954 | var defaultProps$W = {
|
6955 | tag: 'li'
|
6956 | };
|
6957 |
|
6958 | var PaginationItem = function PaginationItem(props) {
|
6959 | var active = props.active,
|
6960 | className = props.className,
|
6961 | cssModule = props.cssModule,
|
6962 | disabled = props.disabled,
|
6963 | Tag = props.tag,
|
6964 | attributes = _objectWithoutPropertiesLoose(props, ["active", "className", "cssModule", "disabled", "tag"]);
|
6965 |
|
6966 | var classes = mapToCssModules(classnames(className, 'page-item', {
|
6967 | active: active,
|
6968 | disabled: disabled
|
6969 | }), cssModule);
|
6970 | return React__default.createElement(Tag, _extends({}, attributes, {
|
6971 | className: classes
|
6972 | }));
|
6973 | };
|
6974 |
|
6975 | PaginationItem.propTypes = propTypes$10;
|
6976 | PaginationItem.defaultProps = defaultProps$W;
|
6977 |
|
6978 | var propTypes$11 = {
|
6979 | 'aria-label': propTypes.string,
|
6980 | children: propTypes.node,
|
6981 | className: propTypes.string,
|
6982 | cssModule: propTypes.object,
|
6983 | next: propTypes.bool,
|
6984 | previous: propTypes.bool,
|
6985 | first: propTypes.bool,
|
6986 | last: propTypes.bool,
|
6987 | tag: tagPropType
|
6988 | };
|
6989 | var defaultProps$X = {
|
6990 | tag: 'a'
|
6991 | };
|
6992 |
|
6993 | var PaginationLink = function PaginationLink(props) {
|
6994 | var className = props.className,
|
6995 | cssModule = props.cssModule,
|
6996 | next = props.next,
|
6997 | previous = props.previous,
|
6998 | first = props.first,
|
6999 | last = props.last,
|
7000 | Tag = props.tag,
|
7001 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "next", "previous", "first", "last", "tag"]);
|
7002 |
|
7003 | var classes = mapToCssModules(classnames(className, 'page-link'), cssModule);
|
7004 | var defaultAriaLabel;
|
7005 |
|
7006 | if (previous) {
|
7007 | defaultAriaLabel = 'Previous';
|
7008 | } else if (next) {
|
7009 | defaultAriaLabel = 'Next';
|
7010 | } else if (first) {
|
7011 | defaultAriaLabel = 'First';
|
7012 | } else if (last) {
|
7013 | defaultAriaLabel = 'Last';
|
7014 | }
|
7015 |
|
7016 | var ariaLabel = props['aria-label'] || defaultAriaLabel;
|
7017 | var defaultCaret;
|
7018 |
|
7019 | if (previous) {
|
7020 | defaultCaret = "\u2039";
|
7021 | } else if (next) {
|
7022 | defaultCaret = "\u203A";
|
7023 | } else if (first) {
|
7024 | defaultCaret = "\xAB";
|
7025 | } else if (last) {
|
7026 | defaultCaret = "\xBB";
|
7027 | }
|
7028 |
|
7029 | var children = props.children;
|
7030 |
|
7031 | if (children && Array.isArray(children) && children.length === 0) {
|
7032 | children = null;
|
7033 | }
|
7034 |
|
7035 | if (!attributes.href && Tag === 'a') {
|
7036 | Tag = 'button';
|
7037 | }
|
7038 |
|
7039 | if (previous || next || first || last) {
|
7040 | children = [React__default.createElement("span", {
|
7041 | "aria-hidden": "true",
|
7042 | key: "caret"
|
7043 | }, children || defaultCaret), React__default.createElement("span", {
|
7044 | className: "sr-only",
|
7045 | key: "sr"
|
7046 | }, ariaLabel)];
|
7047 | }
|
7048 |
|
7049 | return React__default.createElement(Tag, _extends({}, attributes, {
|
7050 | className: classes,
|
7051 | "aria-label": ariaLabel
|
7052 | }), children);
|
7053 | };
|
7054 |
|
7055 | PaginationLink.propTypes = propTypes$11;
|
7056 | PaginationLink.defaultProps = defaultProps$X;
|
7057 |
|
7058 | |
7059 |
|
7060 |
|
7061 |
|
7062 |
|
7063 |
|
7064 |
|
7065 | var TabContext = React__default.createContext({});
|
7066 |
|
7067 | var propTypes$12 = {
|
7068 | tag: tagPropType,
|
7069 | activeTab: propTypes.any,
|
7070 | className: propTypes.string,
|
7071 | cssModule: propTypes.object
|
7072 | };
|
7073 | var defaultProps$Y = {
|
7074 | tag: 'div'
|
7075 | };
|
7076 |
|
7077 | var TabContent = function (_Component) {
|
7078 | _inheritsLoose(TabContent, _Component);
|
7079 |
|
7080 | TabContent.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
|
7081 | if (prevState.activeTab !== nextProps.activeTab) {
|
7082 | return {
|
7083 | activeTab: nextProps.activeTab
|
7084 | };
|
7085 | }
|
7086 |
|
7087 | return null;
|
7088 | };
|
7089 |
|
7090 | function TabContent(props) {
|
7091 | var _this;
|
7092 |
|
7093 | _this = _Component.call(this, props) || this;
|
7094 | _this.state = {
|
7095 | activeTab: _this.props.activeTab
|
7096 | };
|
7097 | return _this;
|
7098 | }
|
7099 |
|
7100 | var _proto = TabContent.prototype;
|
7101 |
|
7102 | _proto.render = function render() {
|
7103 | var _this$props = this.props,
|
7104 | className = _this$props.className,
|
7105 | cssModule = _this$props.cssModule,
|
7106 | Tag = _this$props.tag;
|
7107 | var attributes = omit(this.props, Object.keys(propTypes$12));
|
7108 | var classes = mapToCssModules(classnames('tab-content', className), cssModule);
|
7109 | return React__default.createElement(TabContext.Provider, {
|
7110 | value: {
|
7111 | activeTabId: this.state.activeTab
|
7112 | }
|
7113 | }, React__default.createElement(Tag, _extends({}, attributes, {
|
7114 | className: classes
|
7115 | })));
|
7116 | };
|
7117 |
|
7118 | return TabContent;
|
7119 | }(React.Component);
|
7120 | TabContent.propTypes = propTypes$12;
|
7121 | TabContent.defaultProps = defaultProps$Y;
|
7122 |
|
7123 | var propTypes$13 = {
|
7124 | tag: tagPropType,
|
7125 | className: propTypes.string,
|
7126 | cssModule: propTypes.object,
|
7127 | tabId: propTypes.any
|
7128 | };
|
7129 | var defaultProps$Z = {
|
7130 | tag: 'div'
|
7131 | };
|
7132 | function TabPane(props) {
|
7133 | var className = props.className,
|
7134 | cssModule = props.cssModule,
|
7135 | tabId = props.tabId,
|
7136 | Tag = props.tag,
|
7137 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabId", "tag"]);
|
7138 |
|
7139 | var getClasses = function getClasses(activeTabId) {
|
7140 | return mapToCssModules(classnames('tab-pane', className, {
|
7141 | active: tabId === activeTabId
|
7142 | }), cssModule);
|
7143 | };
|
7144 |
|
7145 | return React__default.createElement(TabContext.Consumer, null, function (_ref) {
|
7146 | var activeTabId = _ref.activeTabId;
|
7147 | return React__default.createElement(Tag, _extends({}, attributes, {
|
7148 | className: getClasses(activeTabId)
|
7149 | }));
|
7150 | });
|
7151 | }
|
7152 | TabPane.propTypes = propTypes$13;
|
7153 | TabPane.defaultProps = defaultProps$Z;
|
7154 |
|
7155 | var propTypes$14 = {
|
7156 | tag: tagPropType,
|
7157 | fluid: propTypes.bool,
|
7158 | className: propTypes.string,
|
7159 | cssModule: propTypes.object
|
7160 | };
|
7161 | var defaultProps$_ = {
|
7162 | tag: 'div'
|
7163 | };
|
7164 |
|
7165 | var Jumbotron = function Jumbotron(props) {
|
7166 | var className = props.className,
|
7167 | cssModule = props.cssModule,
|
7168 | Tag = props.tag,
|
7169 | fluid = props.fluid,
|
7170 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "fluid"]);
|
7171 |
|
7172 | var classes = mapToCssModules(classnames(className, 'jumbotron', fluid ? 'jumbotron-fluid' : false), cssModule);
|
7173 | return React__default.createElement(Tag, _extends({}, attributes, {
|
7174 | className: classes
|
7175 | }));
|
7176 | };
|
7177 |
|
7178 | Jumbotron.propTypes = propTypes$14;
|
7179 | Jumbotron.defaultProps = defaultProps$_;
|
7180 |
|
7181 | var propTypes$15 = {
|
7182 | children: propTypes.node,
|
7183 | className: propTypes.string,
|
7184 | closeClassName: propTypes.string,
|
7185 | closeAriaLabel: propTypes.string,
|
7186 | cssModule: propTypes.object,
|
7187 | color: propTypes.string,
|
7188 | fade: propTypes.bool,
|
7189 | isOpen: propTypes.bool,
|
7190 | toggle: propTypes.func,
|
7191 | tag: tagPropType,
|
7192 | transition: propTypes.shape(Fade.propTypes),
|
7193 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
|
7194 | };
|
7195 | var defaultProps$$ = {
|
7196 | color: 'success',
|
7197 | isOpen: true,
|
7198 | tag: 'div',
|
7199 | closeAriaLabel: 'Close',
|
7200 | fade: true,
|
7201 | transition: _extends({}, Fade.defaultProps, {
|
7202 | unmountOnExit: true
|
7203 | })
|
7204 | };
|
7205 |
|
7206 | function Alert(props) {
|
7207 | var className = props.className,
|
7208 | closeClassName = props.closeClassName,
|
7209 | closeAriaLabel = props.closeAriaLabel,
|
7210 | cssModule = props.cssModule,
|
7211 | Tag = props.tag,
|
7212 | color = props.color,
|
7213 | isOpen = props.isOpen,
|
7214 | toggle = props.toggle,
|
7215 | children = props.children,
|
7216 | transition = props.transition,
|
7217 | fade = props.fade,
|
7218 | innerRef = props.innerRef,
|
7219 | attributes = _objectWithoutPropertiesLoose(props, ["className", "closeClassName", "closeAriaLabel", "cssModule", "tag", "color", "isOpen", "toggle", "children", "transition", "fade", "innerRef"]);
|
7220 |
|
7221 | var classes = mapToCssModules(classnames(className, 'alert', "alert-" + color, {
|
7222 | 'alert-dismissible': toggle
|
7223 | }), cssModule);
|
7224 | var closeClasses = mapToCssModules(classnames('close', closeClassName), cssModule);
|
7225 |
|
7226 | var alertTransition = _extends({}, Fade.defaultProps, transition, {
|
7227 | baseClass: fade ? transition.baseClass : '',
|
7228 | timeout: fade ? transition.timeout : 0
|
7229 | });
|
7230 |
|
7231 | return React__default.createElement(Fade, _extends({}, attributes, alertTransition, {
|
7232 | tag: Tag,
|
7233 | className: classes,
|
7234 | in: isOpen,
|
7235 | role: "alert",
|
7236 | innerRef: innerRef
|
7237 | }), toggle ? React__default.createElement("button", {
|
7238 | type: "button",
|
7239 | className: closeClasses,
|
7240 | "aria-label": closeAriaLabel,
|
7241 | onClick: toggle
|
7242 | }, React__default.createElement("span", {
|
7243 | "aria-hidden": "true"
|
7244 | }, "\xD7")) : null, children);
|
7245 | }
|
7246 |
|
7247 | Alert.propTypes = propTypes$15;
|
7248 | Alert.defaultProps = defaultProps$$;
|
7249 |
|
7250 | var propTypes$16 = {
|
7251 | children: propTypes.node,
|
7252 | className: propTypes.string,
|
7253 | cssModule: propTypes.object,
|
7254 | fade: propTypes.bool,
|
7255 | isOpen: propTypes.bool,
|
7256 | tag: tagPropType,
|
7257 | transition: propTypes.shape(Fade.propTypes),
|
7258 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
|
7259 | };
|
7260 | var defaultProps$10 = {
|
7261 | isOpen: true,
|
7262 | tag: 'div',
|
7263 | fade: true,
|
7264 | transition: _extends({}, Fade.defaultProps, {
|
7265 | unmountOnExit: true
|
7266 | })
|
7267 | };
|
7268 |
|
7269 | function Toast(props) {
|
7270 | var className = props.className,
|
7271 | cssModule = props.cssModule,
|
7272 | Tag = props.tag,
|
7273 | isOpen = props.isOpen,
|
7274 | children = props.children,
|
7275 | transition = props.transition,
|
7276 | fade = props.fade,
|
7277 | innerRef = props.innerRef,
|
7278 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "isOpen", "children", "transition", "fade", "innerRef"]);
|
7279 |
|
7280 | var classes = mapToCssModules(classnames(className, 'toast'), cssModule);
|
7281 |
|
7282 | var toastTransition = _extends({}, Fade.defaultProps, transition, {
|
7283 | baseClass: fade ? transition.baseClass : '',
|
7284 | timeout: fade ? transition.timeout : 0
|
7285 | });
|
7286 |
|
7287 | return React__default.createElement(Fade, _extends({}, attributes, toastTransition, {
|
7288 | tag: Tag,
|
7289 | className: classes,
|
7290 | in: isOpen,
|
7291 | role: "alert",
|
7292 | innerRef: innerRef
|
7293 | }), children);
|
7294 | }
|
7295 |
|
7296 | Toast.propTypes = propTypes$16;
|
7297 | Toast.defaultProps = defaultProps$10;
|
7298 |
|
7299 | var propTypes$17 = {
|
7300 | tag: tagPropType,
|
7301 | className: propTypes.string,
|
7302 | cssModule: propTypes.object,
|
7303 | innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
|
7304 | };
|
7305 | var defaultProps$11 = {
|
7306 | tag: 'div'
|
7307 | };
|
7308 |
|
7309 | var ToastBody = function ToastBody(props) {
|
7310 | var className = props.className,
|
7311 | cssModule = props.cssModule,
|
7312 | innerRef = props.innerRef,
|
7313 | Tag = props.tag,
|
7314 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
|
7315 |
|
7316 | var classes = mapToCssModules(classnames(className, 'toast-body'), cssModule);
|
7317 | return React__default.createElement(Tag, _extends({}, attributes, {
|
7318 | className: classes,
|
7319 | ref: innerRef
|
7320 | }));
|
7321 | };
|
7322 |
|
7323 | ToastBody.propTypes = propTypes$17;
|
7324 | ToastBody.defaultProps = defaultProps$11;
|
7325 |
|
7326 | var propTypes$18 = {
|
7327 | tag: tagPropType,
|
7328 | icon: propTypes.oneOfType([propTypes.string, propTypes.node]),
|
7329 | wrapTag: tagPropType,
|
7330 | toggle: propTypes.func,
|
7331 | className: propTypes.string,
|
7332 | cssModule: propTypes.object,
|
7333 | children: propTypes.node,
|
7334 | closeAriaLabel: propTypes.string,
|
7335 | charCode: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
7336 | close: propTypes.object
|
7337 | };
|
7338 | var defaultProps$12 = {
|
7339 | tag: 'strong',
|
7340 | wrapTag: 'div',
|
7341 | tagClassName: 'mr-auto',
|
7342 | closeAriaLabel: 'Close',
|
7343 | charCode: 215
|
7344 | };
|
7345 |
|
7346 | var ToastHeader = function ToastHeader(props) {
|
7347 | var closeButton;
|
7348 | var icon;
|
7349 |
|
7350 | var className = props.className,
|
7351 | cssModule = props.cssModule,
|
7352 | children = props.children,
|
7353 | toggle = props.toggle,
|
7354 | Tag = props.tag,
|
7355 | WrapTag = props.wrapTag,
|
7356 | closeAriaLabel = props.closeAriaLabel,
|
7357 | charCode = props.charCode,
|
7358 | close = props.close,
|
7359 | tagClassName = props.tagClassName,
|
7360 | iconProp = props.icon,
|
7361 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close", "tagClassName", "icon"]);
|
7362 |
|
7363 | var classes = mapToCssModules(classnames(className, 'toast-header'), cssModule);
|
7364 |
|
7365 | if (!close && toggle) {
|
7366 | var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
|
7367 | closeButton = React__default.createElement("button", {
|
7368 | type: "button",
|
7369 | onClick: toggle,
|
7370 | className: mapToCssModules('close', cssModule),
|
7371 | "aria-label": closeAriaLabel
|
7372 | }, React__default.createElement("span", {
|
7373 | "aria-hidden": "true"
|
7374 | }, closeIcon));
|
7375 | }
|
7376 |
|
7377 | if (typeof iconProp === "string") {
|
7378 | icon = React__default.createElement("svg", {
|
7379 | className: mapToCssModules("rounded text-" + iconProp),
|
7380 | width: "20",
|
7381 | height: "20",
|
7382 | xmlns: "http://www.w3.org/2000/svg",
|
7383 | preserveAspectRatio: "xMidYMid slice",
|
7384 | focusable: "false",
|
7385 | role: "img"
|
7386 | }, React__default.createElement("rect", {
|
7387 | fill: "currentColor",
|
7388 | width: "100%",
|
7389 | height: "100%"
|
7390 | }));
|
7391 | } else if (iconProp) {
|
7392 | icon = iconProp;
|
7393 | }
|
7394 |
|
7395 | return React__default.createElement(WrapTag, _extends({}, attributes, {
|
7396 | className: classes
|
7397 | }), icon, React__default.createElement(Tag, {
|
7398 | className: mapToCssModules(classnames(tagClassName, {
|
7399 | "ml-2": icon != null
|
7400 | }), cssModule)
|
7401 | }, children), close || closeButton);
|
7402 | };
|
7403 |
|
7404 | ToastHeader.propTypes = propTypes$18;
|
7405 | ToastHeader.defaultProps = defaultProps$12;
|
7406 |
|
7407 | var _transitionStatusToCl;
|
7408 |
|
7409 | var propTypes$19 = _extends({}, reactTransitionGroup_1.propTypes, {
|
7410 | isOpen: propTypes.bool,
|
7411 | children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
|
7412 | tag: tagPropType,
|
7413 | className: propTypes.node,
|
7414 | navbar: propTypes.bool,
|
7415 | cssModule: propTypes.object,
|
7416 | innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object])
|
7417 | });
|
7418 |
|
7419 | var defaultProps$13 = _extends({}, reactTransitionGroup_1.defaultProps, {
|
7420 | isOpen: false,
|
7421 | appear: false,
|
7422 | enter: true,
|
7423 | exit: true,
|
7424 | tag: 'div',
|
7425 | timeout: TransitionTimeouts.Collapse
|
7426 | });
|
7427 |
|
7428 | var transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);
|
7429 |
|
7430 | function getTransitionClass(status) {
|
7431 | return transitionStatusToClassHash[status] || 'collapse';
|
7432 | }
|
7433 |
|
7434 | function getHeight(node) {
|
7435 | return node.scrollHeight;
|
7436 | }
|
7437 |
|
7438 | var Collapse = function (_Component) {
|
7439 | _inheritsLoose(Collapse, _Component);
|
7440 |
|
7441 | function Collapse(props) {
|
7442 | var _this;
|
7443 |
|
7444 | _this = _Component.call(this, props) || this;
|
7445 | _this.state = {
|
7446 | height: null
|
7447 | };
|
7448 | ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {
|
7449 | _this[name] = _this[name].bind(_assertThisInitialized(_this));
|
7450 | });
|
7451 | return _this;
|
7452 | }
|
7453 |
|
7454 | var _proto = Collapse.prototype;
|
7455 |
|
7456 | _proto.onEntering = function onEntering(node, isAppearing) {
|
7457 | this.setState({
|
7458 | height: getHeight(node)
|
7459 | });
|
7460 | this.props.onEntering(node, isAppearing);
|
7461 | };
|
7462 |
|
7463 | _proto.onEntered = function onEntered(node, isAppearing) {
|
7464 | this.setState({
|
7465 | height: null
|
7466 | });
|
7467 | this.props.onEntered(node, isAppearing);
|
7468 | };
|
7469 |
|
7470 | _proto.onExit = function onExit(node) {
|
7471 | this.setState({
|
7472 | height: getHeight(node)
|
7473 | });
|
7474 | this.props.onExit(node);
|
7475 | };
|
7476 |
|
7477 | _proto.onExiting = function onExiting(node) {
|
7478 |
|
7479 | var _unused = node.offsetHeight;
|
7480 |
|
7481 | this.setState({
|
7482 | height: 0
|
7483 | });
|
7484 | this.props.onExiting(node);
|
7485 | };
|
7486 |
|
7487 | _proto.onExited = function onExited(node) {
|
7488 | this.setState({
|
7489 | height: null
|
7490 | });
|
7491 | this.props.onExited(node);
|
7492 | };
|
7493 |
|
7494 | _proto.render = function render() {
|
7495 | var _this2 = this;
|
7496 |
|
7497 | var _this$props = this.props,
|
7498 | Tag = _this$props.tag,
|
7499 | isOpen = _this$props.isOpen,
|
7500 | className = _this$props.className,
|
7501 | navbar = _this$props.navbar,
|
7502 | cssModule = _this$props.cssModule,
|
7503 | children = _this$props.children,
|
7504 | innerRef = _this$props.innerRef,
|
7505 | otherProps = _objectWithoutPropertiesLoose(_this$props, ["tag", "isOpen", "className", "navbar", "cssModule", "children", "innerRef"]);
|
7506 |
|
7507 | var height = this.state.height;
|
7508 | var transitionProps = pick(otherProps, TransitionPropTypeKeys);
|
7509 | var childProps = omit(otherProps, TransitionPropTypeKeys);
|
7510 | return React__default.createElement(reactTransitionGroup_1, _extends({}, transitionProps, {
|
7511 | in: isOpen,
|
7512 | onEntering: this.onEntering,
|
7513 | onEntered: this.onEntered,
|
7514 | onExit: this.onExit,
|
7515 | onExiting: this.onExiting,
|
7516 | onExited: this.onExited
|
7517 | }), function (status) {
|
7518 | var collapseClass = getTransitionClass(status);
|
7519 | var classes = mapToCssModules(classnames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);
|
7520 | var style = height === null ? null : {
|
7521 | height: height
|
7522 | };
|
7523 | return React__default.createElement(Tag, _extends({}, childProps, {
|
7524 | style: _extends({}, childProps.style, style),
|
7525 | className: classes,
|
7526 | ref: _this2.props.innerRef
|
7527 | }), children);
|
7528 | });
|
7529 | };
|
7530 |
|
7531 | return Collapse;
|
7532 | }(React.Component);
|
7533 |
|
7534 | Collapse.propTypes = propTypes$19;
|
7535 | Collapse.defaultProps = defaultProps$13;
|
7536 |
|
7537 | var propTypes$1a = {
|
7538 | tag: tagPropType,
|
7539 | active: propTypes.bool,
|
7540 | disabled: propTypes.bool,
|
7541 | color: propTypes.string,
|
7542 | action: propTypes.bool,
|
7543 | className: propTypes.any,
|
7544 | cssModule: propTypes.object
|
7545 | };
|
7546 | var defaultProps$14 = {
|
7547 | tag: 'li'
|
7548 | };
|
7549 |
|
7550 | var handleDisabledOnClick = function handleDisabledOnClick(e) {
|
7551 | e.preventDefault();
|
7552 | };
|
7553 |
|
7554 | var ListGroupItem = function ListGroupItem(props) {
|
7555 | var className = props.className,
|
7556 | cssModule = props.cssModule,
|
7557 | Tag = props.tag,
|
7558 | active = props.active,
|
7559 | disabled = props.disabled,
|
7560 | action = props.action,
|
7561 | color = props.color,
|
7562 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "active", "disabled", "action", "color"]);
|
7563 |
|
7564 | 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);
|
7565 |
|
7566 | if (disabled) {
|
7567 | attributes.onClick = handleDisabledOnClick;
|
7568 | }
|
7569 |
|
7570 | return React__default.createElement(Tag, _extends({}, attributes, {
|
7571 | className: classes
|
7572 | }));
|
7573 | };
|
7574 |
|
7575 | ListGroupItem.propTypes = propTypes$1a;
|
7576 | ListGroupItem.defaultProps = defaultProps$14;
|
7577 |
|
7578 | var propTypes$1b = {
|
7579 | tag: tagPropType,
|
7580 | className: propTypes.any,
|
7581 | cssModule: propTypes.object
|
7582 | };
|
7583 | var defaultProps$15 = {
|
7584 | tag: 'h5'
|
7585 | };
|
7586 |
|
7587 | var ListGroupItemHeading = function ListGroupItemHeading(props) {
|
7588 | var className = props.className,
|
7589 | cssModule = props.cssModule,
|
7590 | Tag = props.tag,
|
7591 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
7592 |
|
7593 | var classes = mapToCssModules(classnames(className, 'list-group-item-heading'), cssModule);
|
7594 | return React__default.createElement(Tag, _extends({}, attributes, {
|
7595 | className: classes
|
7596 | }));
|
7597 | };
|
7598 |
|
7599 | ListGroupItemHeading.propTypes = propTypes$1b;
|
7600 | ListGroupItemHeading.defaultProps = defaultProps$15;
|
7601 |
|
7602 | var propTypes$1c = {
|
7603 | tag: tagPropType,
|
7604 | className: propTypes.any,
|
7605 | cssModule: propTypes.object
|
7606 | };
|
7607 | var defaultProps$16 = {
|
7608 | tag: 'p'
|
7609 | };
|
7610 |
|
7611 | var ListGroupItemText = function ListGroupItemText(props) {
|
7612 | var className = props.className,
|
7613 | cssModule = props.cssModule,
|
7614 | Tag = props.tag,
|
7615 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
|
7616 |
|
7617 | var classes = mapToCssModules(classnames(className, 'list-group-item-text'), cssModule);
|
7618 | return React__default.createElement(Tag, _extends({}, attributes, {
|
7619 | className: classes
|
7620 | }));
|
7621 | };
|
7622 |
|
7623 | ListGroupItemText.propTypes = propTypes$1c;
|
7624 | ListGroupItemText.defaultProps = defaultProps$16;
|
7625 |
|
7626 | var UncontrolledAlert = function (_Component) {
|
7627 | _inheritsLoose(UncontrolledAlert, _Component);
|
7628 |
|
7629 | function UncontrolledAlert(props) {
|
7630 | var _this;
|
7631 |
|
7632 | _this = _Component.call(this, props) || this;
|
7633 | _this.state = {
|
7634 | isOpen: true
|
7635 | };
|
7636 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
7637 | return _this;
|
7638 | }
|
7639 |
|
7640 | var _proto = UncontrolledAlert.prototype;
|
7641 |
|
7642 | _proto.toggle = function toggle() {
|
7643 | this.setState({
|
7644 | isOpen: !this.state.isOpen
|
7645 | });
|
7646 | };
|
7647 |
|
7648 | _proto.render = function render() {
|
7649 | return React__default.createElement(Alert, _extends({
|
7650 | isOpen: this.state.isOpen,
|
7651 | toggle: this.toggle
|
7652 | }, this.props));
|
7653 | };
|
7654 |
|
7655 | return UncontrolledAlert;
|
7656 | }(React.Component);
|
7657 |
|
7658 | var omitKeys$1 = ['defaultOpen'];
|
7659 |
|
7660 | var UncontrolledButtonDropdown = function (_Component) {
|
7661 | _inheritsLoose(UncontrolledButtonDropdown, _Component);
|
7662 |
|
7663 | function UncontrolledButtonDropdown(props) {
|
7664 | var _this;
|
7665 |
|
7666 | _this = _Component.call(this, props) || this;
|
7667 | _this.state = {
|
7668 | isOpen: props.defaultOpen || false
|
7669 | };
|
7670 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
7671 | return _this;
|
7672 | }
|
7673 |
|
7674 | var _proto = UncontrolledButtonDropdown.prototype;
|
7675 |
|
7676 | _proto.toggle = function toggle() {
|
7677 | this.setState({
|
7678 | isOpen: !this.state.isOpen
|
7679 | });
|
7680 | };
|
7681 |
|
7682 | _proto.render = function render() {
|
7683 | return React__default.createElement(ButtonDropdown, _extends({
|
7684 | isOpen: this.state.isOpen,
|
7685 | toggle: this.toggle
|
7686 | }, omit(this.props, omitKeys$1)));
|
7687 | };
|
7688 |
|
7689 | return UncontrolledButtonDropdown;
|
7690 | }(React.Component);
|
7691 | UncontrolledButtonDropdown.propTypes = _extends({
|
7692 | defaultOpen: propTypes.bool
|
7693 | }, ButtonDropdown.propTypes);
|
7694 |
|
7695 | var omitKeys$2 = ['toggleEvents', 'defaultOpen'];
|
7696 | var propTypes$1d = {
|
7697 | defaultOpen: propTypes.bool,
|
7698 | toggler: propTypes.string.isRequired,
|
7699 | toggleEvents: propTypes.arrayOf(propTypes.string)
|
7700 | };
|
7701 | var defaultProps$17 = {
|
7702 | toggleEvents: defaultToggleEvents
|
7703 | };
|
7704 |
|
7705 | var UncontrolledCollapse = function (_Component) {
|
7706 | _inheritsLoose(UncontrolledCollapse, _Component);
|
7707 |
|
7708 | function UncontrolledCollapse(props) {
|
7709 | var _this;
|
7710 |
|
7711 | _this = _Component.call(this, props) || this;
|
7712 | _this.togglers = null;
|
7713 | _this.removeEventListeners = null;
|
7714 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
7715 | _this.state = {
|
7716 | isOpen: props.defaultOpen || false
|
7717 | };
|
7718 | return _this;
|
7719 | }
|
7720 |
|
7721 | var _proto = UncontrolledCollapse.prototype;
|
7722 |
|
7723 | _proto.componentDidMount = function componentDidMount() {
|
7724 | this.togglers = findDOMElements(this.props.toggler);
|
7725 |
|
7726 | if (this.togglers.length) {
|
7727 | this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);
|
7728 | }
|
7729 | };
|
7730 |
|
7731 | _proto.componentWillUnmount = function componentWillUnmount() {
|
7732 | if (this.togglers.length && this.removeEventListeners) {
|
7733 | this.removeEventListeners();
|
7734 | }
|
7735 | };
|
7736 |
|
7737 | _proto.toggle = function toggle(e) {
|
7738 | this.setState(function (_ref) {
|
7739 | var isOpen = _ref.isOpen;
|
7740 | return {
|
7741 | isOpen: !isOpen
|
7742 | };
|
7743 | });
|
7744 | e.preventDefault();
|
7745 | };
|
7746 |
|
7747 | _proto.render = function render() {
|
7748 | return React__default.createElement(Collapse, _extends({
|
7749 | isOpen: this.state.isOpen
|
7750 | }, omit(this.props, omitKeys$2)));
|
7751 | };
|
7752 |
|
7753 | return UncontrolledCollapse;
|
7754 | }(React.Component);
|
7755 |
|
7756 | UncontrolledCollapse.propTypes = propTypes$1d;
|
7757 | UncontrolledCollapse.defaultProps = defaultProps$17;
|
7758 |
|
7759 | var omitKeys$3 = ['defaultOpen'];
|
7760 |
|
7761 | var UncontrolledDropdown = function (_Component) {
|
7762 | _inheritsLoose(UncontrolledDropdown, _Component);
|
7763 |
|
7764 | function UncontrolledDropdown(props) {
|
7765 | var _this;
|
7766 |
|
7767 | _this = _Component.call(this, props) || this;
|
7768 | _this.state = {
|
7769 | isOpen: props.defaultOpen || false
|
7770 | };
|
7771 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
7772 | return _this;
|
7773 | }
|
7774 |
|
7775 | var _proto = UncontrolledDropdown.prototype;
|
7776 |
|
7777 | _proto.toggle = function toggle(e) {
|
7778 | this.setState({
|
7779 | isOpen: !this.state.isOpen
|
7780 | });
|
7781 |
|
7782 | if (this.props.onToggle) {
|
7783 | this.props.onToggle(e, !this.state.isOpen);
|
7784 | }
|
7785 | };
|
7786 |
|
7787 | _proto.render = function render() {
|
7788 | return React__default.createElement(Dropdown, _extends({
|
7789 | isOpen: this.state.isOpen,
|
7790 | toggle: this.toggle
|
7791 | }, omit(this.props, omitKeys$3)));
|
7792 | };
|
7793 |
|
7794 | return UncontrolledDropdown;
|
7795 | }(React.Component);
|
7796 | UncontrolledDropdown.propTypes = _extends({
|
7797 | defaultOpen: propTypes.bool,
|
7798 | onToggle: propTypes.func
|
7799 | }, Dropdown.propTypes);
|
7800 |
|
7801 | var omitKeys$4 = ['defaultOpen'];
|
7802 |
|
7803 | var UncontrolledTooltip = function (_Component) {
|
7804 | _inheritsLoose(UncontrolledTooltip, _Component);
|
7805 |
|
7806 | function UncontrolledTooltip(props) {
|
7807 | var _this;
|
7808 |
|
7809 | _this = _Component.call(this, props) || this;
|
7810 | _this.state = {
|
7811 | isOpen: props.defaultOpen || false
|
7812 | };
|
7813 | _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
7814 | return _this;
|
7815 | }
|
7816 |
|
7817 | var _proto = UncontrolledTooltip.prototype;
|
7818 |
|
7819 | _proto.toggle = function toggle() {
|
7820 | this.setState({
|
7821 | isOpen: !this.state.isOpen
|
7822 | });
|
7823 | };
|
7824 |
|
7825 | _proto.render = function render() {
|
7826 | return React__default.createElement(Tooltip, _extends({
|
7827 | isOpen: this.state.isOpen,
|
7828 | toggle: this.toggle
|
7829 | }, omit(this.props, omitKeys$4)));
|
7830 | };
|
7831 |
|
7832 | return UncontrolledTooltip;
|
7833 | }(React.Component);
|
7834 | UncontrolledTooltip.propTypes = _extends({
|
7835 | defaultOpen: propTypes.bool
|
7836 | }, Tooltip.propTypes);
|
7837 |
|
7838 | var propTypes$1e = {
|
7839 | tag: tagPropType,
|
7840 | type: propTypes.string,
|
7841 | size: propTypes.string,
|
7842 | color: propTypes.string,
|
7843 | className: propTypes.string,
|
7844 | cssModule: propTypes.object,
|
7845 | children: propTypes.string
|
7846 | };
|
7847 | var defaultProps$18 = {
|
7848 | tag: 'div',
|
7849 | type: 'border',
|
7850 | children: 'Loading...'
|
7851 | };
|
7852 |
|
7853 | var Spinner = function Spinner(props) {
|
7854 | var className = props.className,
|
7855 | cssModule = props.cssModule,
|
7856 | type = props.type,
|
7857 | size = props.size,
|
7858 | color = props.color,
|
7859 | children = props.children,
|
7860 | Tag = props.tag,
|
7861 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "type", "size", "color", "children", "tag"]);
|
7862 |
|
7863 | var classes = mapToCssModules(classnames(className, size ? "spinner-" + type + "-" + size : false, "spinner-" + type, color ? "text-" + color : false), cssModule);
|
7864 | return React__default.createElement(Tag, _extends({
|
7865 | role: "status"
|
7866 | }, attributes, {
|
7867 | className: classes
|
7868 | }), children && React__default.createElement("span", {
|
7869 | className: mapToCssModules('sr-only', cssModule)
|
7870 | }, children));
|
7871 | };
|
7872 |
|
7873 | Spinner.propTypes = propTypes$1e;
|
7874 | Spinner.defaultProps = defaultProps$18;
|
7875 |
|
7876 | (function () {
|
7877 | if (typeof window !== 'object' || typeof window.CustomEvent === 'function') return;
|
7878 |
|
7879 | var CustomEvent = function CustomEvent(event, params) {
|
7880 | params = params || {
|
7881 | bubbles: false,
|
7882 | cancelable: false,
|
7883 | detail: null
|
7884 | };
|
7885 | var evt = document.createEvent('CustomEvent');
|
7886 | evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
7887 | return evt;
|
7888 | };
|
7889 |
|
7890 | window.CustomEvent = CustomEvent;
|
7891 | })();
|
7892 |
|
7893 | (function () {
|
7894 | if (typeof Object.values === 'function') return;
|
7895 |
|
7896 | var values = function values(O) {
|
7897 | return Object.keys(O).map(function (key) {
|
7898 | return O[key];
|
7899 | });
|
7900 | };
|
7901 |
|
7902 | Object.values = values;
|
7903 | })();
|
7904 |
|
7905 | var polyfill$1 = Object.freeze({
|
7906 | __proto__: null
|
7907 | });
|
7908 |
|
7909 | exports.Alert = Alert;
|
7910 | exports.Badge = Badge;
|
7911 | exports.Breadcrumb = Breadcrumb;
|
7912 | exports.BreadcrumbItem = BreadcrumbItem;
|
7913 | exports.Button = Button;
|
7914 | exports.ButtonDropdown = ButtonDropdown;
|
7915 | exports.ButtonGroup = ButtonGroup;
|
7916 | exports.ButtonToggle = ButtonToggle;
|
7917 | exports.ButtonToolbar = ButtonToolbar;
|
7918 | exports.Card = Card;
|
7919 | exports.CardBody = CardBody;
|
7920 | exports.CardColumns = CardColumns;
|
7921 | exports.CardDeck = CardDeck;
|
7922 | exports.CardFooter = CardFooter;
|
7923 | exports.CardGroup = CardGroup;
|
7924 | exports.CardHeader = CardHeader;
|
7925 | exports.CardImg = CardImg;
|
7926 | exports.CardImgOverlay = CardImgOverlay;
|
7927 | exports.CardLink = CardLink;
|
7928 | exports.CardSubtitle = CardSubtitle;
|
7929 | exports.CardText = CardText;
|
7930 | exports.CardTitle = CardTitle;
|
7931 | exports.Carousel = Carousel;
|
7932 | exports.CarouselCaption = CarouselCaption;
|
7933 | exports.CarouselControl = CarouselControl;
|
7934 | exports.CarouselIndicators = CarouselIndicators;
|
7935 | exports.CarouselItem = CarouselItem;
|
7936 | exports.Col = Col;
|
7937 | exports.Collapse = Collapse;
|
7938 | exports.Container = Container;
|
7939 | exports.CustomFileInput = CustomFileInput;
|
7940 | exports.CustomInput = CustomInput;
|
7941 | exports.Dropdown = Dropdown;
|
7942 | exports.DropdownContext = DropdownContext;
|
7943 | exports.DropdownItem = DropdownItem;
|
7944 | exports.DropdownMenu = DropdownMenu;
|
7945 | exports.DropdownToggle = DropdownToggle;
|
7946 | exports.Fade = Fade;
|
7947 | exports.Form = Form;
|
7948 | exports.FormFeedback = FormFeedback;
|
7949 | exports.FormGroup = FormGroup;
|
7950 | exports.FormText = FormText;
|
7951 | exports.Input = Input;
|
7952 | exports.InputGroup = InputGroup;
|
7953 | exports.InputGroupAddon = InputGroupAddon;
|
7954 | exports.InputGroupButtonDropdown = InputGroupButtonDropdown;
|
7955 | exports.InputGroupText = InputGroupText;
|
7956 | exports.Jumbotron = Jumbotron;
|
7957 | exports.Label = Label;
|
7958 | exports.ListGroup = ListGroup;
|
7959 | exports.ListGroupItem = ListGroupItem;
|
7960 | exports.ListGroupItemHeading = ListGroupItemHeading;
|
7961 | exports.ListGroupItemText = ListGroupItemText;
|
7962 | exports.Media = Media;
|
7963 | exports.Modal = Modal;
|
7964 | exports.ModalBody = ModalBody;
|
7965 | exports.ModalFooter = ModalFooter;
|
7966 | exports.ModalHeader = ModalHeader;
|
7967 | exports.Nav = Nav;
|
7968 | exports.NavItem = NavItem;
|
7969 | exports.NavLink = NavLink;
|
7970 | exports.Navbar = Navbar;
|
7971 | exports.NavbarBrand = NavbarBrand;
|
7972 | exports.NavbarText = NavbarText;
|
7973 | exports.NavbarToggler = NavbarToggler;
|
7974 | exports.Pagination = Pagination;
|
7975 | exports.PaginationItem = PaginationItem;
|
7976 | exports.PaginationLink = PaginationLink;
|
7977 | exports.Polyfill = polyfill$1;
|
7978 | exports.Popover = Popover;
|
7979 | exports.PopoverBody = PopoverBody;
|
7980 | exports.PopoverHeader = PopoverHeader;
|
7981 | exports.PopperContent = PopperContent;
|
7982 | exports.PopperTargetHelper = PopperTargetHelper;
|
7983 | exports.Progress = Progress;
|
7984 | exports.Row = Row;
|
7985 | exports.Spinner = Spinner;
|
7986 | exports.TabContent = TabContent;
|
7987 | exports.TabPane = TabPane;
|
7988 | exports.Table = Table;
|
7989 | exports.Toast = Toast;
|
7990 | exports.ToastBody = ToastBody;
|
7991 | exports.ToastHeader = ToastHeader;
|
7992 | exports.Tooltip = Tooltip;
|
7993 | exports.UncontrolledAlert = UncontrolledAlert;
|
7994 | exports.UncontrolledButtonDropdown = UncontrolledButtonDropdown;
|
7995 | exports.UncontrolledCarousel = UncontrolledCarousel;
|
7996 | exports.UncontrolledCollapse = UncontrolledCollapse;
|
7997 | exports.UncontrolledDropdown = UncontrolledDropdown;
|
7998 | exports.UncontrolledPopover = UncontrolledPopover;
|
7999 | exports.UncontrolledTooltip = UncontrolledTooltip;
|
8000 | exports.Util = utils;
|
8001 |
|
8002 | Object.defineProperty(exports, '__esModule', { value: true });
|
8003 |
|
8004 | })));
|
8005 |
|