1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory(require("react"), require("react-dom"));
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define(["react", "react-dom"], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["ReactBootstrap"] = factory(require("react"), require("react-dom"));
|
8 | else
|
9 | root["ReactBootstrap"] = factory(root["React"], root["ReactDOM"]);
|
10 | })(self, (__WEBPACK_EXTERNAL_MODULE__787__, __WEBPACK_EXTERNAL_MODULE__156__) => {
|
11 | return (() => {
|
12 | var __webpack_modules__ = ({
|
13 |
|
14 | 814:
|
15 | ((module, exports) => {
|
16 |
|
17 | var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | (function () {
|
25 | 'use strict';
|
26 |
|
27 | var hasOwn = {}.hasOwnProperty;
|
28 | var nativeCodeString = '[native code]';
|
29 | function classNames() {
|
30 | var classes = [];
|
31 | for (var i = 0; i < arguments.length; i++) {
|
32 | var arg = arguments[i];
|
33 | if (!arg) continue;
|
34 | var argType = typeof arg;
|
35 | if (argType === 'string' || argType === 'number') {
|
36 | classes.push(arg);
|
37 | } else if (Array.isArray(arg)) {
|
38 | if (arg.length) {
|
39 | var inner = classNames.apply(null, arg);
|
40 | if (inner) {
|
41 | classes.push(inner);
|
42 | }
|
43 | }
|
44 | } else if (argType === 'object') {
|
45 | if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
46 | classes.push(arg.toString());
|
47 | continue;
|
48 | }
|
49 | for (var key in arg) {
|
50 | if (hasOwn.call(arg, key) && arg[key]) {
|
51 | classes.push(key);
|
52 | }
|
53 | }
|
54 | }
|
55 | }
|
56 | return classes.join(' ');
|
57 | }
|
58 | if ( true && module.exports) {
|
59 | classNames.default = classNames;
|
60 | module.exports = classNames;
|
61 | } else if (true) {
|
62 |
|
63 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
64 | return classNames;
|
65 | }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
66 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
67 | } else {}
|
68 | })();
|
69 |
|
70 | }),
|
71 |
|
72 | 286:
|
73 | ((module) => {
|
74 |
|
75 | "use strict";
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | var invariant = function (condition, format, a, b, c, d, e, f) {
|
96 | if (false) {}
|
97 | if (!condition) {
|
98 | var error;
|
99 | if (format === undefined) {
|
100 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
101 | } else {
|
102 | var args = [a, b, c, d, e, f];
|
103 | var argIndex = 0;
|
104 | error = new Error(format.replace(/%s/g, function () {
|
105 | return args[argIndex++];
|
106 | }));
|
107 | error.name = 'Invariant Violation';
|
108 | }
|
109 | error.framesToPop = 1;
|
110 | throw error;
|
111 | }
|
112 | };
|
113 | module.exports = invariant;
|
114 |
|
115 | }),
|
116 |
|
117 | 946:
|
118 | ((module, exports, __webpack_require__) => {
|
119 |
|
120 | "use strict";
|
121 |
|
122 |
|
123 | Object.defineProperty(exports, "__esModule", ({
|
124 | value: true
|
125 | }));
|
126 | exports["default"] = all;
|
127 | var _createChainableTypeChecker = __webpack_require__(844);
|
128 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
129 | function _interopRequireDefault(obj) {
|
130 | return obj && obj.__esModule ? obj : {
|
131 | default: obj
|
132 | };
|
133 | }
|
134 | function all() {
|
135 | for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) {
|
136 | validators[_key] = arguments[_key];
|
137 | }
|
138 | function allPropTypes() {
|
139 | for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
140 | args[_key2] = arguments[_key2];
|
141 | }
|
142 | var error = null;
|
143 | validators.forEach(function (validator) {
|
144 | if (error != null) {
|
145 | return;
|
146 | }
|
147 | var result = validator.apply(undefined, args);
|
148 | if (result != null) {
|
149 | error = result;
|
150 | }
|
151 | });
|
152 | return error;
|
153 | }
|
154 | return (0, _createChainableTypeChecker2.default)(allPropTypes);
|
155 | }
|
156 | module.exports = exports['default'];
|
157 |
|
158 | }),
|
159 |
|
160 | 964:
|
161 | ((module, exports, __webpack_require__) => {
|
162 |
|
163 | "use strict";
|
164 |
|
165 |
|
166 | Object.defineProperty(exports, "__esModule", ({
|
167 | value: true
|
168 | }));
|
169 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
170 | return typeof obj;
|
171 | } : function (obj) {
|
172 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
173 | };
|
174 | var _react = __webpack_require__(787);
|
175 | var _react2 = _interopRequireDefault(_react);
|
176 | var _createChainableTypeChecker = __webpack_require__(844);
|
177 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
178 | function _interopRequireDefault(obj) {
|
179 | return obj && obj.__esModule ? obj : {
|
180 | default: obj
|
181 | };
|
182 | }
|
183 | function validate(props, propName, componentName, location, propFullName) {
|
184 | var propValue = props[propName];
|
185 | var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
|
186 | if (_react2.default.isValidElement(propValue)) {
|
187 | return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement. You can usually obtain a ReactComponent or DOMElement ' + 'from a ReactElement by attaching a ref to it.');
|
188 | }
|
189 | if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) {
|
190 | return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.');
|
191 | }
|
192 | return null;
|
193 | }
|
194 | exports["default"] = (0, _createChainableTypeChecker2.default)(validate);
|
195 | module.exports = exports['default'];
|
196 |
|
197 | }),
|
198 |
|
199 | 647:
|
200 | ((module, exports, __webpack_require__) => {
|
201 |
|
202 | "use strict";
|
203 |
|
204 |
|
205 | Object.defineProperty(exports, "__esModule", ({
|
206 | value: true
|
207 | }));
|
208 | exports["default"] = deprecated;
|
209 | var _warning = __webpack_require__(459);
|
210 | var _warning2 = _interopRequireDefault(_warning);
|
211 | function _interopRequireDefault(obj) {
|
212 | return obj && obj.__esModule ? obj : {
|
213 | default: obj
|
214 | };
|
215 | }
|
216 | var warned = {};
|
217 | function deprecated(validator, reason) {
|
218 | return function validate(props, propName, componentName, location, propFullName) {
|
219 | var componentNameSafe = componentName || '<<anonymous>>';
|
220 | var propFullNameSafe = propFullName || propName;
|
221 | if (props[propName] != null) {
|
222 | var messageKey = componentName + '.' + propName;
|
223 | (0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.'));
|
224 | warned[messageKey] = true;
|
225 | }
|
226 | for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
|
227 | args[_key - 5] = arguments[_key];
|
228 | }
|
229 | return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
|
230 | };
|
231 | }
|
232 |
|
233 |
|
234 | function _resetWarned() {
|
235 | warned = {};
|
236 | }
|
237 | deprecated._resetWarned = _resetWarned;
|
238 |
|
239 |
|
240 | module.exports = exports['default'];
|
241 |
|
242 | }),
|
243 |
|
244 | 835:
|
245 | ((module, exports, __webpack_require__) => {
|
246 |
|
247 | "use strict";
|
248 |
|
249 |
|
250 | Object.defineProperty(exports, "__esModule", ({
|
251 | value: true
|
252 | }));
|
253 | var _react = __webpack_require__(787);
|
254 | var _react2 = _interopRequireDefault(_react);
|
255 | var _reactIs = __webpack_require__(532);
|
256 | var _createChainableTypeChecker = __webpack_require__(844);
|
257 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
258 | function _interopRequireDefault(obj) {
|
259 | return obj && obj.__esModule ? obj : {
|
260 | default: obj
|
261 | };
|
262 | }
|
263 | function elementType(props, propName, componentName, location, propFullName) {
|
264 | var propValue = props[propName];
|
265 | if (_react2.default.isValidElement(propValue)) {
|
266 | return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`,expected an element type (a string ') + ', component class, or function component).');
|
267 | }
|
268 | if (!(0, _reactIs.isValidElementType)(propValue)) {
|
269 | return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + ', component class, or function component).');
|
270 | }
|
271 | return null;
|
272 | }
|
273 | exports["default"] = (0, _createChainableTypeChecker2.default)(elementType);
|
274 | module.exports = exports['default'];
|
275 |
|
276 | }),
|
277 |
|
278 | 517:
|
279 | ((__unused_webpack_module, exports, __webpack_require__) => {
|
280 |
|
281 | "use strict";
|
282 | var __webpack_unused_export__;
|
283 |
|
284 |
|
285 | __webpack_unused_export__ = ({
|
286 | value: true
|
287 | });
|
288 | __webpack_unused_export__ = exports.nm = __webpack_unused_export__ = exports.ax = __webpack_unused_export__ = undefined;
|
289 | var _all = __webpack_require__(946);
|
290 | var _all2 = _interopRequireDefault(_all);
|
291 | var _componentOrElement = __webpack_require__(964);
|
292 | var _componentOrElement2 = _interopRequireDefault(_componentOrElement);
|
293 | var _deprecated = __webpack_require__(647);
|
294 | var _deprecated2 = _interopRequireDefault(_deprecated);
|
295 | var _elementType = __webpack_require__(835);
|
296 | var _elementType2 = _interopRequireDefault(_elementType);
|
297 | var _isRequiredForA11y = __webpack_require__(422);
|
298 | var _isRequiredForA11y2 = _interopRequireDefault(_isRequiredForA11y);
|
299 | function _interopRequireDefault(obj) {
|
300 | return obj && obj.__esModule ? obj : {
|
301 | default: obj
|
302 | };
|
303 | }
|
304 | __webpack_unused_export__ = _all2.default;
|
305 | exports.ax = _componentOrElement2.default;
|
306 | __webpack_unused_export__ = _deprecated2.default;
|
307 | exports.nm = _elementType2.default;
|
308 | __webpack_unused_export__ = _isRequiredForA11y2.default;
|
309 |
|
310 | }),
|
311 |
|
312 | 422:
|
313 | ((module, exports) => {
|
314 |
|
315 | "use strict";
|
316 |
|
317 |
|
318 | Object.defineProperty(exports, "__esModule", ({
|
319 | value: true
|
320 | }));
|
321 | exports["default"] = isRequiredForA11y;
|
322 | function isRequiredForA11y(validator) {
|
323 | return function validate(props, propName, componentName, location, propFullName) {
|
324 | var componentNameSafe = componentName || '<<anonymous>>';
|
325 | var propFullNameSafe = propFullName || propName;
|
326 | if (props[propName] == null) {
|
327 | return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');
|
328 | }
|
329 | for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
|
330 | args[_key - 5] = arguments[_key];
|
331 | }
|
332 | return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
|
333 | };
|
334 | }
|
335 | module.exports = exports['default'];
|
336 |
|
337 | }),
|
338 |
|
339 | 844:
|
340 | ((module, exports) => {
|
341 |
|
342 | "use strict";
|
343 |
|
344 |
|
345 | Object.defineProperty(exports, "__esModule", ({
|
346 | value: true
|
347 | }));
|
348 | exports["default"] = createChainableTypeChecker;
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 | function createChainableTypeChecker(validate) {
|
361 | function checkType(isRequired, props, propName, componentName, location, propFullName) {
|
362 | var componentNameSafe = componentName || '<<anonymous>>';
|
363 | var propFullNameSafe = propFullName || propName;
|
364 | if (props[propName] == null) {
|
365 | if (isRequired) {
|
366 | return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
|
367 | }
|
368 | return null;
|
369 | }
|
370 | for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
|
371 | args[_key - 6] = arguments[_key];
|
372 | }
|
373 | return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
|
374 | }
|
375 | var chainedCheckType = checkType.bind(null, false);
|
376 | chainedCheckType.isRequired = checkType.bind(null, true);
|
377 | return chainedCheckType;
|
378 | }
|
379 | module.exports = exports['default'];
|
380 |
|
381 | }),
|
382 |
|
383 | 428:
|
384 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
385 |
|
386 | "use strict";
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 | var ReactPropTypesSecret = __webpack_require__(134);
|
397 | function emptyFunction() {}
|
398 | function emptyFunctionWithReset() {}
|
399 | emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
400 | module.exports = function () {
|
401 | function shim(props, propName, componentName, location, propFullName, secret) {
|
402 | if (secret === ReactPropTypesSecret) {
|
403 |
|
404 | return;
|
405 | }
|
406 | 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');
|
407 | err.name = 'Invariant Violation';
|
408 | throw err;
|
409 | }
|
410 | ;
|
411 | shim.isRequired = shim;
|
412 | function getShim() {
|
413 | return shim;
|
414 | }
|
415 | ;
|
416 |
|
417 |
|
418 | var ReactPropTypes = {
|
419 | array: shim,
|
420 | bigint: shim,
|
421 | bool: shim,
|
422 | func: shim,
|
423 | number: shim,
|
424 | object: shim,
|
425 | string: shim,
|
426 | symbol: shim,
|
427 | any: shim,
|
428 | arrayOf: getShim,
|
429 | element: shim,
|
430 | elementType: shim,
|
431 | instanceOf: getShim,
|
432 | node: shim,
|
433 | objectOf: getShim,
|
434 | oneOf: getShim,
|
435 | oneOfType: getShim,
|
436 | shape: getShim,
|
437 | exact: getShim,
|
438 | checkPropTypes: emptyFunctionWithReset,
|
439 | resetWarningCache: emptyFunction
|
440 | };
|
441 | ReactPropTypes.PropTypes = ReactPropTypes;
|
442 | return ReactPropTypes;
|
443 | };
|
444 |
|
445 | }),
|
446 |
|
447 | 526:
|
448 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 | if (false) { var throwOnDirectAccess, ReactIs; } else {
|
458 |
|
459 |
|
460 | module.exports = __webpack_require__(428)();
|
461 | }
|
462 |
|
463 | }),
|
464 |
|
465 | 134:
|
466 | ((module) => {
|
467 |
|
468 | "use strict";
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
479 | module.exports = ReactPropTypesSecret;
|
480 |
|
481 | }),
|
482 |
|
483 | 15:
|
484 | ((__unused_webpack_module, exports) => {
|
485 |
|
486 | "use strict";
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 | var b = "function" === typeof Symbol && Symbol.for,
|
499 | c = b ? Symbol.for("react.element") : 60103,
|
500 | d = b ? Symbol.for("react.portal") : 60106,
|
501 | e = b ? Symbol.for("react.fragment") : 60107,
|
502 | f = b ? Symbol.for("react.strict_mode") : 60108,
|
503 | g = b ? Symbol.for("react.profiler") : 60114,
|
504 | h = b ? Symbol.for("react.provider") : 60109,
|
505 | k = b ? Symbol.for("react.context") : 60110,
|
506 | l = b ? Symbol.for("react.async_mode") : 60111,
|
507 | m = b ? Symbol.for("react.concurrent_mode") : 60111,
|
508 | n = b ? Symbol.for("react.forward_ref") : 60112,
|
509 | p = b ? Symbol.for("react.suspense") : 60113,
|
510 | q = b ? Symbol.for("react.suspense_list") : 60120,
|
511 | r = b ? Symbol.for("react.memo") : 60115,
|
512 | t = b ? Symbol.for("react.lazy") : 60116,
|
513 | v = b ? Symbol.for("react.block") : 60121,
|
514 | w = b ? Symbol.for("react.fundamental") : 60117,
|
515 | x = b ? Symbol.for("react.responder") : 60118,
|
516 | y = b ? Symbol.for("react.scope") : 60119;
|
517 | function z(a) {
|
518 | if ("object" === typeof a && null !== a) {
|
519 | var u = a.$$typeof;
|
520 | switch (u) {
|
521 | case c:
|
522 | switch (a = a.type, a) {
|
523 | case l:
|
524 | case m:
|
525 | case e:
|
526 | case g:
|
527 | case f:
|
528 | case p:
|
529 | return a;
|
530 | default:
|
531 | switch (a = a && a.$$typeof, a) {
|
532 | case k:
|
533 | case n:
|
534 | case t:
|
535 | case r:
|
536 | case h:
|
537 | return a;
|
538 | default:
|
539 | return u;
|
540 | }
|
541 | }
|
542 | case d:
|
543 | return u;
|
544 | }
|
545 | }
|
546 | }
|
547 | function A(a) {
|
548 | return z(a) === m;
|
549 | }
|
550 | exports.AsyncMode = l;
|
551 | exports.ConcurrentMode = m;
|
552 | exports.ContextConsumer = k;
|
553 | exports.ContextProvider = h;
|
554 | exports.Element = c;
|
555 | exports.ForwardRef = n;
|
556 | exports.Fragment = e;
|
557 | exports.Lazy = t;
|
558 | exports.Memo = r;
|
559 | exports.Portal = d;
|
560 | exports.Profiler = g;
|
561 | exports.StrictMode = f;
|
562 | exports.Suspense = p;
|
563 | exports.isAsyncMode = function (a) {
|
564 | return A(a) || z(a) === l;
|
565 | };
|
566 | exports.isConcurrentMode = A;
|
567 | exports.isContextConsumer = function (a) {
|
568 | return z(a) === k;
|
569 | };
|
570 | exports.isContextProvider = function (a) {
|
571 | return z(a) === h;
|
572 | };
|
573 | exports.isElement = function (a) {
|
574 | return "object" === typeof a && null !== a && a.$$typeof === c;
|
575 | };
|
576 | exports.isForwardRef = function (a) {
|
577 | return z(a) === n;
|
578 | };
|
579 | exports.isFragment = function (a) {
|
580 | return z(a) === e;
|
581 | };
|
582 | exports.isLazy = function (a) {
|
583 | return z(a) === t;
|
584 | };
|
585 | exports.isMemo = function (a) {
|
586 | return z(a) === r;
|
587 | };
|
588 | exports.isPortal = function (a) {
|
589 | return z(a) === d;
|
590 | };
|
591 | exports.isProfiler = function (a) {
|
592 | return z(a) === g;
|
593 | };
|
594 | exports.isStrictMode = function (a) {
|
595 | return z(a) === f;
|
596 | };
|
597 | exports.isSuspense = function (a) {
|
598 | return z(a) === p;
|
599 | };
|
600 | exports.isValidElementType = function (a) {
|
601 | 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);
|
602 | };
|
603 | exports.typeOf = z;
|
604 |
|
605 | }),
|
606 |
|
607 | 532:
|
608 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
609 |
|
610 | "use strict";
|
611 |
|
612 |
|
613 | if (true) {
|
614 | module.exports = __webpack_require__(15);
|
615 | } else {}
|
616 |
|
617 | }),
|
618 |
|
619 | 955:
|
620 | ((__unused_webpack_module, exports, __webpack_require__) => {
|
621 |
|
622 | "use strict";
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 | __webpack_require__(787);
|
634 | exports.Fragment = 60107;
|
635 | if ("function" === typeof Symbol && Symbol.for) {
|
636 | var a = Symbol.for;
|
637 | exports.Fragment = a("react.fragment");
|
638 | }
|
639 | exports.jsxDEV = void 0;
|
640 |
|
641 | }),
|
642 |
|
643 | 356:
|
644 | ((__unused_webpack_module, exports, __webpack_require__) => {
|
645 |
|
646 | "use strict";
|
647 |
|
648 |
|
649 |
|
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 | var f = __webpack_require__(787),
|
658 | g = 60103;
|
659 | exports.Fragment = 60107;
|
660 | if ("function" === typeof Symbol && Symbol.for) {
|
661 | var h = Symbol.for;
|
662 | g = h("react.element");
|
663 | exports.Fragment = h("react.fragment");
|
664 | }
|
665 | var m = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
666 | n = Object.prototype.hasOwnProperty,
|
667 | p = {
|
668 | key: !0,
|
669 | ref: !0,
|
670 | __self: !0,
|
671 | __source: !0
|
672 | };
|
673 | function q(c, a, k) {
|
674 | var b,
|
675 | d = {},
|
676 | e = null,
|
677 | l = null;
|
678 | void 0 !== k && (e = "" + k);
|
679 | void 0 !== a.key && (e = "" + a.key);
|
680 | void 0 !== a.ref && (l = a.ref);
|
681 | for (b in a) n.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
682 | if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
683 | return {
|
684 | $$typeof: g,
|
685 | type: c,
|
686 | key: e,
|
687 | ref: l,
|
688 | props: d,
|
689 | _owner: m.current
|
690 | };
|
691 | }
|
692 | exports.jsx = q;
|
693 | exports.jsxs = q;
|
694 |
|
695 | }),
|
696 |
|
697 | 485:
|
698 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
699 |
|
700 | "use strict";
|
701 |
|
702 |
|
703 | if (true) {
|
704 | module.exports = __webpack_require__(955);
|
705 | } else {}
|
706 |
|
707 | }),
|
708 |
|
709 | 373:
|
710 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
711 |
|
712 | "use strict";
|
713 |
|
714 |
|
715 | if (true) {
|
716 | module.exports = __webpack_require__(356);
|
717 | } else {}
|
718 |
|
719 | }),
|
720 |
|
721 | 459:
|
722 | ((module) => {
|
723 |
|
724 | "use strict";
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 | var __DEV__ = "production" !== 'production';
|
741 | var warning = function () {};
|
742 | if (__DEV__) {
|
743 | var printWarning = function printWarning(format, args) {
|
744 | var len = arguments.length;
|
745 | args = new Array(len > 1 ? len - 1 : 0);
|
746 | for (var key = 1; key < len; key++) {
|
747 | args[key - 1] = arguments[key];
|
748 | }
|
749 | var argIndex = 0;
|
750 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
751 | return args[argIndex++];
|
752 | });
|
753 | if (typeof console !== 'undefined') {
|
754 | console.error(message);
|
755 | }
|
756 | try {
|
757 |
|
758 |
|
759 |
|
760 | throw new Error(message);
|
761 | } catch (x) {}
|
762 | };
|
763 | warning = function (condition, format, args) {
|
764 | var len = arguments.length;
|
765 | args = new Array(len > 2 ? len - 2 : 0);
|
766 | for (var key = 2; key < len; key++) {
|
767 | args[key - 2] = arguments[key];
|
768 | }
|
769 | if (format === undefined) {
|
770 | throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
771 | }
|
772 | if (!condition) {
|
773 | printWarning.apply(null, [format].concat(args));
|
774 | }
|
775 | };
|
776 | }
|
777 | module.exports = warning;
|
778 |
|
779 | }),
|
780 |
|
781 | 787:
|
782 | ((module) => {
|
783 |
|
784 | "use strict";
|
785 | module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
786 |
|
787 | }),
|
788 |
|
789 | 156:
|
790 | ((module) => {
|
791 |
|
792 | "use strict";
|
793 | module.exports = __WEBPACK_EXTERNAL_MODULE__156__;
|
794 |
|
795 | })
|
796 |
|
797 | });
|
798 |
|
799 |
|
800 | var __webpack_module_cache__ = {};
|
801 |
|
802 |
|
803 | function __webpack_require__(moduleId) {
|
804 |
|
805 | var cachedModule = __webpack_module_cache__[moduleId];
|
806 | if (cachedModule !== undefined) {
|
807 | return cachedModule.exports;
|
808 | }
|
809 |
|
810 | var module = __webpack_module_cache__[moduleId] = {
|
811 |
|
812 |
|
813 | exports: {}
|
814 | };
|
815 |
|
816 |
|
817 | __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
818 |
|
819 |
|
820 | return module.exports;
|
821 | }
|
822 |
|
823 |
|
824 |
|
825 | (() => {
|
826 |
|
827 | __webpack_require__.n = (module) => {
|
828 | var getter = module && module.__esModule ?
|
829 | () => (module['default']) :
|
830 | () => (module);
|
831 | __webpack_require__.d(getter, { a: getter });
|
832 | return getter;
|
833 | };
|
834 | })();
|
835 |
|
836 |
|
837 | (() => {
|
838 |
|
839 | __webpack_require__.d = (exports, definition) => {
|
840 | for(var key in definition) {
|
841 | if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
842 | Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
843 | }
|
844 | }
|
845 | };
|
846 | })();
|
847 |
|
848 |
|
849 | (() => {
|
850 | __webpack_require__.g = (function() {
|
851 | if (typeof globalThis === 'object') return globalThis;
|
852 | try {
|
853 | return this || new Function('return this')();
|
854 | } catch (e) {
|
855 | if (typeof window === 'object') return window;
|
856 | }
|
857 | })();
|
858 | })();
|
859 |
|
860 |
|
861 | (() => {
|
862 | __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
863 | })();
|
864 |
|
865 |
|
866 | (() => {
|
867 |
|
868 | __webpack_require__.r = (exports) => {
|
869 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
870 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
871 | }
|
872 | Object.defineProperty(exports, '__esModule', { value: true });
|
873 | };
|
874 | })();
|
875 |
|
876 |
|
877 | var __webpack_exports__ = {};
|
878 |
|
879 | (() => {
|
880 | "use strict";
|
881 |
|
882 | __webpack_require__.r(__webpack_exports__);
|
883 |
|
884 |
|
885 | __webpack_require__.d(__webpack_exports__, {
|
886 | Accordion: () => ( src_Accordion),
|
887 | AccordionButton: () => ( src_AccordionButton),
|
888 | AccordionCollapse: () => ( src_AccordionCollapse),
|
889 | AccordionContext: () => ( AccordionContext),
|
890 | AccordionHeader: () => ( src_AccordionHeader),
|
891 | AccordionItem: () => ( src_AccordionItem),
|
892 | Alert: () => ( src_Alert),
|
893 | AlertHeading: () => ( src_AlertHeading),
|
894 | AlertLink: () => ( src_AlertLink),
|
895 | Anchor: () => ( src_Anchor),
|
896 | Badge: () => ( src_Badge),
|
897 | Breadcrumb: () => ( src_Breadcrumb),
|
898 | BreadcrumbItem: () => ( src_BreadcrumbItem),
|
899 | Button: () => ( src_Button),
|
900 | ButtonGroup: () => ( src_ButtonGroup),
|
901 | ButtonToolbar: () => ( src_ButtonToolbar),
|
902 | Card: () => ( src_Card),
|
903 | CardBody: () => ( src_CardBody),
|
904 | CardFooter: () => ( src_CardFooter),
|
905 | CardGroup: () => ( src_CardGroup),
|
906 | CardHeader: () => ( src_CardHeader),
|
907 | CardImg: () => ( src_CardImg),
|
908 | CardImgOverlay: () => ( src_CardImgOverlay),
|
909 | CardLink: () => ( src_CardLink),
|
910 | CardSubtitle: () => ( src_CardSubtitle),
|
911 | CardText: () => ( src_CardText),
|
912 | CardTitle: () => ( src_CardTitle),
|
913 | Carousel: () => ( src_Carousel),
|
914 | CarouselCaption: () => ( src_CarouselCaption),
|
915 | CarouselItem: () => ( src_CarouselItem),
|
916 | CloseButton: () => ( src_CloseButton),
|
917 | Col: () => ( src_Col),
|
918 | Collapse: () => ( src_Collapse),
|
919 | Container: () => ( src_Container),
|
920 | Dropdown: () => ( src_Dropdown),
|
921 | DropdownButton: () => ( src_DropdownButton),
|
922 | DropdownDivider: () => ( src_DropdownDivider),
|
923 | DropdownHeader: () => ( src_DropdownHeader),
|
924 | DropdownItem: () => ( src_DropdownItem),
|
925 | DropdownItemText: () => ( src_DropdownItemText),
|
926 | DropdownMenu: () => ( src_DropdownMenu),
|
927 | DropdownToggle: () => ( src_DropdownToggle),
|
928 | Fade: () => ( src_Fade),
|
929 | Figure: () => ( src_Figure),
|
930 | FigureCaption: () => ( src_FigureCaption),
|
931 | FigureImage: () => ( src_FigureImage),
|
932 | FloatingLabel: () => ( src_FloatingLabel),
|
933 | Form: () => ( src_Form),
|
934 | FormCheck: () => ( src_FormCheck),
|
935 | FormControl: () => ( src_FormControl),
|
936 | FormFloating: () => ( src_FormFloating),
|
937 | FormGroup: () => ( src_FormGroup),
|
938 | FormLabel: () => ( src_FormLabel),
|
939 | FormSelect: () => ( src_FormSelect),
|
940 | FormText: () => ( src_FormText),
|
941 | Image: () => ( src_Image),
|
942 | InputGroup: () => ( src_InputGroup),
|
943 | ListGroup: () => ( src_ListGroup),
|
944 | ListGroupItem: () => ( src_ListGroupItem),
|
945 | Modal: () => ( src_Modal),
|
946 | ModalBody: () => ( src_ModalBody),
|
947 | ModalDialog: () => ( src_ModalDialog),
|
948 | ModalFooter: () => ( src_ModalFooter),
|
949 | ModalHeader: () => ( src_ModalHeader),
|
950 | ModalTitle: () => ( src_ModalTitle),
|
951 | Nav: () => ( src_Nav),
|
952 | NavDropdown: () => ( src_NavDropdown),
|
953 | NavItem: () => ( src_NavItem),
|
954 | NavLink: () => ( src_NavLink),
|
955 | Navbar: () => ( src_Navbar),
|
956 | NavbarBrand: () => ( src_NavbarBrand),
|
957 | NavbarCollapse: () => ( src_NavbarCollapse),
|
958 | NavbarOffcanvas: () => ( src_NavbarOffcanvas),
|
959 | NavbarText: () => ( src_NavbarText),
|
960 | NavbarToggle: () => ( src_NavbarToggle),
|
961 | Offcanvas: () => ( src_Offcanvas),
|
962 | OffcanvasBody: () => ( src_OffcanvasBody),
|
963 | OffcanvasHeader: () => ( src_OffcanvasHeader),
|
964 | OffcanvasTitle: () => ( src_OffcanvasTitle),
|
965 | OffcanvasToggling: () => ( src_OffcanvasToggling),
|
966 | Overlay: () => ( src_Overlay),
|
967 | OverlayTrigger: () => ( src_OverlayTrigger),
|
968 | PageItem: () => ( src_PageItem),
|
969 | Pagination: () => ( src_Pagination),
|
970 | Placeholder: () => ( src_Placeholder),
|
971 | PlaceholderButton: () => ( src_PlaceholderButton),
|
972 | Popover: () => ( src_Popover),
|
973 | PopoverBody: () => ( src_PopoverBody),
|
974 | PopoverHeader: () => ( src_PopoverHeader),
|
975 | ProgressBar: () => ( src_ProgressBar),
|
976 | Ratio: () => ( src_Ratio),
|
977 | Row: () => ( src_Row),
|
978 | SSRProvider: () => ( SSRProvider),
|
979 | Spinner: () => ( src_Spinner),
|
980 | SplitButton: () => ( src_SplitButton),
|
981 | Stack: () => ( src_Stack),
|
982 | Tab: () => ( src_Tab),
|
983 | TabContainer: () => ( src_TabContainer),
|
984 | TabContent: () => ( src_TabContent),
|
985 | TabPane: () => ( src_TabPane),
|
986 | Table: () => ( src_Table),
|
987 | Tabs: () => ( src_Tabs),
|
988 | ThemeProvider: () => ( src_ThemeProvider),
|
989 | Toast: () => ( src_Toast),
|
990 | ToastBody: () => ( src_ToastBody),
|
991 | ToastContainer: () => ( src_ToastContainer),
|
992 | ToastHeader: () => ( src_ToastHeader),
|
993 | ToggleButton: () => ( src_ToggleButton),
|
994 | ToggleButtonGroup: () => ( src_ToggleButtonGroup),
|
995 | Tooltip: () => ( src_Tooltip),
|
996 | useAccordionButton: () => ( useAccordionButton)
|
997 | });
|
998 |
|
999 |
|
1000 | var classnames = __webpack_require__(814);
|
1001 | var classnames_default = __webpack_require__.n(classnames);
|
1002 |
|
1003 | var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
|
1004 | var external_root_React_commonjs2_react_commonjs_react_amd_react_default = __webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
|
1005 |
|
1006 | var prop_types = __webpack_require__(526);
|
1007 | var prop_types_default = __webpack_require__.n(prop_types);
|
1008 | ;
|
1009 | function extends_extends() {
|
1010 | extends_extends = Object.assign ? Object.assign.bind() : function (target) {
|
1011 | for (var i = 1; i < arguments.length; i++) {
|
1012 | var source = arguments[i];
|
1013 | for (var key in source) {
|
1014 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1015 | target[key] = source[key];
|
1016 | }
|
1017 | }
|
1018 | }
|
1019 | return target;
|
1020 | };
|
1021 | return extends_extends.apply(this, arguments);
|
1022 | }
|
1023 | ;
|
1024 | function objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) {
|
1025 | if (source == null) return {};
|
1026 | var target = {};
|
1027 | var sourceKeys = Object.keys(source);
|
1028 | var key, i;
|
1029 | for (i = 0; i < sourceKeys.length; i++) {
|
1030 | key = sourceKeys[i];
|
1031 | if (excluded.indexOf(key) >= 0) continue;
|
1032 | target[key] = source[key];
|
1033 | }
|
1034 | return target;
|
1035 | }
|
1036 |
|
1037 | var browser = __webpack_require__(286);
|
1038 | var browser_default = __webpack_require__.n(browser);
|
1039 | ;
|
1040 |
|
1041 | var noop = function noop() {};
|
1042 | function readOnlyPropType(handler, name) {
|
1043 | return function (props, propName) {
|
1044 | if (props[propName] !== undefined) {
|
1045 | if (!props[handler]) {
|
1046 | return new Error("You have provided a `" + propName + "` prop to `" + name + "` " + ("without an `" + handler + "` handler prop. This will render a read-only field. ") + ("If the field should be mutable use `" + defaultKey(propName) + "`. ") + ("Otherwise, set `" + handler + "`."));
|
1047 | }
|
1048 | }
|
1049 | };
|
1050 | }
|
1051 | function uncontrolledPropTypes(controlledValues, displayName) {
|
1052 | var propTypes = {};
|
1053 | Object.keys(controlledValues).forEach(function (prop) {
|
1054 |
|
1055 | propTypes[defaultKey(prop)] = noop;
|
1056 | if (false) { var handler; }
|
1057 | });
|
1058 | return propTypes;
|
1059 | }
|
1060 | function isProp(props, prop) {
|
1061 | return props[prop] !== undefined;
|
1062 | }
|
1063 | function defaultKey(key) {
|
1064 | return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
|
1065 | }
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 |
|
1074 |
|
1075 | function canAcceptRef(component) {
|
1076 | return !!component && (typeof component !== 'function' || component.prototype && component.prototype.isReactComponent);
|
1077 | }
|
1078 | ;
|
1079 |
|
1080 |
|
1081 | function _toPropertyKey(arg) {
|
1082 | var key = _toPrimitive(arg, "string");
|
1083 | return typeof key === "symbol" ? key : String(key);
|
1084 | }
|
1085 | function _toPrimitive(input, hint) {
|
1086 | if (typeof input !== "object" || input === null) return input;
|
1087 | var prim = input[Symbol.toPrimitive];
|
1088 | if (prim !== undefined) {
|
1089 | var res = prim.call(input, hint || "default");
|
1090 | if (typeof res !== "object") return res;
|
1091 | throw new TypeError("@@toPrimitive must return a primitive value.");
|
1092 | }
|
1093 | return (hint === "string" ? String : Number)(input);
|
1094 | }
|
1095 |
|
1096 |
|
1097 | function useUncontrolledProp(propValue, defaultValue, handler) {
|
1098 | var wasPropRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(propValue !== undefined);
|
1099 | var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(defaultValue),
|
1100 | stateValue = _useState[0],
|
1101 | setState = _useState[1];
|
1102 | var isProp = propValue !== undefined;
|
1103 | var wasProp = wasPropRef.current;
|
1104 | wasPropRef.current = isProp;
|
1105 | |
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 | if (!isProp && wasProp && stateValue !== defaultValue) {
|
1111 | setState(defaultValue);
|
1112 | }
|
1113 | return [isProp ? propValue : stateValue, (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (value) {
|
1114 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
1115 | args[_key - 1] = arguments[_key];
|
1116 | }
|
1117 | if (handler) handler.apply(void 0, [value].concat(args));
|
1118 | setState(value);
|
1119 | }, [handler])];
|
1120 | }
|
1121 |
|
1122 | function useUncontrolled(props, config) {
|
1123 | return Object.keys(config).reduce(function (result, fieldName) {
|
1124 | var _extends2;
|
1125 | var _ref = result,
|
1126 | defaultValue = _ref[defaultKey(fieldName)],
|
1127 | propsValue = _ref[fieldName],
|
1128 | rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, [defaultKey(fieldName), fieldName].map(_toPropertyKey));
|
1129 | var handlerName = config[fieldName];
|
1130 | var _useUncontrolledProp = useUncontrolledProp(propsValue, defaultValue, props[handlerName]),
|
1131 | value = _useUncontrolledProp[0],
|
1132 | handler = _useUncontrolledProp[1];
|
1133 | return extends_extends({}, rest, (_extends2 = {}, _extends2[fieldName] = value, _extends2[handlerName] = handler, _extends2));
|
1134 | }, props);
|
1135 | }
|
1136 | ;
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 | function componentWillMount() {
|
1145 |
|
1146 | var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
|
1147 | if (state !== null && state !== undefined) {
|
1148 | this.setState(state);
|
1149 | }
|
1150 | }
|
1151 | function componentWillReceiveProps(nextProps) {
|
1152 |
|
1153 |
|
1154 | function updater(prevState) {
|
1155 | var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
|
1156 | return state !== null && state !== undefined ? state : null;
|
1157 | }
|
1158 |
|
1159 | this.setState(updater.bind(this));
|
1160 | }
|
1161 | function componentWillUpdate(nextProps, nextState) {
|
1162 | try {
|
1163 | var prevProps = this.props;
|
1164 | var prevState = this.state;
|
1165 | this.props = nextProps;
|
1166 | this.state = nextState;
|
1167 | this.__reactInternalSnapshotFlag = true;
|
1168 | this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
|
1169 | } finally {
|
1170 | this.props = prevProps;
|
1171 | this.state = prevState;
|
1172 | }
|
1173 | }
|
1174 |
|
1175 |
|
1176 |
|
1177 | componentWillMount.__suppressDeprecationWarning = true;
|
1178 | componentWillReceiveProps.__suppressDeprecationWarning = true;
|
1179 | componentWillUpdate.__suppressDeprecationWarning = true;
|
1180 | function react_lifecycles_compat_es_polyfill(Component) {
|
1181 | var prototype = Component.prototype;
|
1182 | if (!prototype || !prototype.isReactComponent) {
|
1183 | throw new Error('Can only polyfill class components');
|
1184 | }
|
1185 | if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
|
1186 | return Component;
|
1187 | }
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 | var foundWillMountName = null;
|
1193 | var foundWillReceivePropsName = null;
|
1194 | var foundWillUpdateName = null;
|
1195 | if (typeof prototype.componentWillMount === 'function') {
|
1196 | foundWillMountName = 'componentWillMount';
|
1197 | } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
|
1198 | foundWillMountName = 'UNSAFE_componentWillMount';
|
1199 | }
|
1200 | if (typeof prototype.componentWillReceiveProps === 'function') {
|
1201 | foundWillReceivePropsName = 'componentWillReceiveProps';
|
1202 | } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
|
1203 | foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
1204 | }
|
1205 | if (typeof prototype.componentWillUpdate === 'function') {
|
1206 | foundWillUpdateName = 'componentWillUpdate';
|
1207 | } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
|
1208 | foundWillUpdateName = 'UNSAFE_componentWillUpdate';
|
1209 | }
|
1210 | if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
|
1211 | var componentName = Component.displayName || Component.name;
|
1212 | var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
|
1213 | 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');
|
1214 | }
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 | if (typeof Component.getDerivedStateFromProps === 'function') {
|
1220 | prototype.componentWillMount = componentWillMount;
|
1221 | prototype.componentWillReceiveProps = componentWillReceiveProps;
|
1222 | }
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 | if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
|
1228 | if (typeof prototype.componentDidUpdate !== 'function') {
|
1229 | throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
|
1230 | }
|
1231 | prototype.componentWillUpdate = componentWillUpdate;
|
1232 | var componentDidUpdate = prototype.componentDidUpdate;
|
1233 | prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 | var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
|
1243 | componentDidUpdate.call(this, prevProps, prevState, snapshot);
|
1244 | };
|
1245 | }
|
1246 | return Component;
|
1247 | }
|
1248 |
|
1249 | ;
|
1250 |
|
1251 |
|
1252 |
|
1253 | var _jsxFileName = "/Users/jquense/src/uncontrollable/src/uncontrollable.js";
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 | function uncontrollable(Component, controlledValues, methods) {
|
1259 | if (methods === void 0) {
|
1260 | methods = [];
|
1261 | }
|
1262 | var displayName = Component.displayName || Component.name || 'Component';
|
1263 | var canAcceptRef = Utils.canAcceptRef(Component);
|
1264 | var controlledProps = Object.keys(controlledValues);
|
1265 | var PROPS_TO_OMIT = controlledProps.map(Utils.defaultKey);
|
1266 | !(canAcceptRef || !methods.length) ? false ? 0 : invariant(false) : void 0;
|
1267 | var UncontrolledComponent =
|
1268 | function (_React$Component) {
|
1269 | _inheritsLoose(UncontrolledComponent, _React$Component);
|
1270 | function UncontrolledComponent() {
|
1271 | var _this;
|
1272 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
1273 | args[_key] = arguments[_key];
|
1274 | }
|
1275 | _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
1276 | _this.handlers = Object.create(null);
|
1277 | controlledProps.forEach(function (propName) {
|
1278 | var handlerName = controlledValues[propName];
|
1279 | var handleChange = function handleChange(value) {
|
1280 | if (_this.props[handlerName]) {
|
1281 | var _this$props;
|
1282 | _this._notifying = true;
|
1283 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
1284 | args[_key2 - 1] = arguments[_key2];
|
1285 | }
|
1286 | (_this$props = _this.props)[handlerName].apply(_this$props, [value].concat(args));
|
1287 | _this._notifying = false;
|
1288 | }
|
1289 | if (!_this.unmounted) _this.setState(function (_ref) {
|
1290 | var _extends2;
|
1291 | var values = _ref.values;
|
1292 | return {
|
1293 | values: _extends(Object.create(null), values, (_extends2 = {}, _extends2[propName] = value, _extends2))
|
1294 | };
|
1295 | });
|
1296 | };
|
1297 | _this.handlers[handlerName] = handleChange;
|
1298 | });
|
1299 | if (methods.length) _this.attachRef = function (ref) {
|
1300 | _this.inner = ref;
|
1301 | };
|
1302 | var values = Object.create(null);
|
1303 | controlledProps.forEach(function (key) {
|
1304 | values[key] = _this.props[Utils.defaultKey(key)];
|
1305 | });
|
1306 | _this.state = {
|
1307 | values: values,
|
1308 | prevProps: {}
|
1309 | };
|
1310 | return _this;
|
1311 | }
|
1312 | var _proto = UncontrolledComponent.prototype;
|
1313 | _proto.shouldComponentUpdate = function shouldComponentUpdate() {
|
1314 |
|
1315 | return !this._notifying;
|
1316 | };
|
1317 | UncontrolledComponent.getDerivedStateFromProps = function getDerivedStateFromProps(props, _ref2) {
|
1318 | var values = _ref2.values,
|
1319 | prevProps = _ref2.prevProps;
|
1320 | var nextState = {
|
1321 | values: _extends(Object.create(null), values),
|
1322 | prevProps: {}
|
1323 | };
|
1324 | controlledProps.forEach(function (key) {
|
1325 | |
1326 |
|
1327 |
|
1328 |
|
1329 | nextState.prevProps[key] = props[key];
|
1330 | if (!Utils.isProp(props, key) && Utils.isProp(prevProps, key)) {
|
1331 | nextState.values[key] = props[Utils.defaultKey(key)];
|
1332 | }
|
1333 | });
|
1334 | return nextState;
|
1335 | };
|
1336 | _proto.componentWillUnmount = function componentWillUnmount() {
|
1337 | this.unmounted = true;
|
1338 | };
|
1339 | _proto.render = function render() {
|
1340 | var _this2 = this;
|
1341 | var _this$props2 = this.props,
|
1342 | innerRef = _this$props2.innerRef,
|
1343 | props = _objectWithoutPropertiesLoose(_this$props2, ["innerRef"]);
|
1344 | PROPS_TO_OMIT.forEach(function (prop) {
|
1345 | delete props[prop];
|
1346 | });
|
1347 | var newProps = {};
|
1348 | controlledProps.forEach(function (propName) {
|
1349 | var propValue = _this2.props[propName];
|
1350 | newProps[propName] = propValue !== undefined ? propValue : _this2.state.values[propName];
|
1351 | });
|
1352 | return React.createElement(Component, _extends({}, props, newProps, this.handlers, {
|
1353 | ref: innerRef || this.attachRef
|
1354 | }));
|
1355 | };
|
1356 | return UncontrolledComponent;
|
1357 | }(React.Component);
|
1358 | polyfill(UncontrolledComponent);
|
1359 | UncontrolledComponent.displayName = "Uncontrolled(" + displayName + ")";
|
1360 | UncontrolledComponent.propTypes = _extends({
|
1361 | innerRef: function innerRef() {}
|
1362 | }, Utils.uncontrolledPropTypes(controlledValues, displayName));
|
1363 | methods.forEach(function (method) {
|
1364 | UncontrolledComponent.prototype[method] = function $proxiedMethod() {
|
1365 | var _this$inner;
|
1366 | return (_this$inner = this.inner)[method].apply(_this$inner, arguments);
|
1367 | };
|
1368 | });
|
1369 | var WrappedComponent = UncontrolledComponent;
|
1370 | if (React.forwardRef) {
|
1371 | WrappedComponent = React.forwardRef(function (props, ref) {
|
1372 | return React.createElement(UncontrolledComponent, _extends({}, props, {
|
1373 | innerRef: ref,
|
1374 | __source: {
|
1375 | fileName: _jsxFileName,
|
1376 | lineNumber: 128
|
1377 | },
|
1378 | __self: this
|
1379 | }));
|
1380 | });
|
1381 | WrappedComponent.propTypes = UncontrolledComponent.propTypes;
|
1382 | }
|
1383 | WrappedComponent.ControlledComponent = Component;
|
1384 | |
1385 |
|
1386 |
|
1387 |
|
1388 |
|
1389 | WrappedComponent.deferControlTo = function (newComponent, additions, nextMethods) {
|
1390 | if (additions === void 0) {
|
1391 | additions = {};
|
1392 | }
|
1393 | return uncontrollable(newComponent, _extends({}, controlledValues, additions), nextMethods);
|
1394 | };
|
1395 | return WrappedComponent;
|
1396 | }
|
1397 | ;
|
1398 |
|
1399 |
|
1400 |
|
1401 | var jsx_dev_runtime = __webpack_require__(485);
|
1402 | ;
|
1403 | var ThemeProvider_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ThemeProvider.tsx";
|
1404 |
|
1405 |
|
1406 |
|
1407 |
|
1408 | const DEFAULT_BREAKPOINTS = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
1409 | const DEFAULT_MIN_BREAKPOINT = 'xs';
|
1410 | const ThemeContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
|
1411 | prefixes: {},
|
1412 | breakpoints: DEFAULT_BREAKPOINTS,
|
1413 | minBreakpoint: DEFAULT_MIN_BREAKPOINT
|
1414 | });
|
1415 | const {
|
1416 | Consumer,
|
1417 | Provider
|
1418 | } = ThemeContext;
|
1419 | function ThemeProvider({
|
1420 | prefixes = {},
|
1421 | breakpoints = DEFAULT_BREAKPOINTS,
|
1422 | minBreakpoint = DEFAULT_MIN_BREAKPOINT,
|
1423 | dir,
|
1424 | children
|
1425 | }) {
|
1426 | const contextValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
1427 | prefixes: {
|
1428 | ...prefixes
|
1429 | },
|
1430 | breakpoints,
|
1431 | minBreakpoint,
|
1432 | dir
|
1433 | }), [prefixes, breakpoints, minBreakpoint, dir]);
|
1434 | return (0,jsx_dev_runtime.jsxDEV)(Provider, {
|
1435 | value: contextValue,
|
1436 | children: children
|
1437 | }, void 0, false, {
|
1438 | fileName: ThemeProvider_jsxFileName,
|
1439 | lineNumber: 43,
|
1440 | columnNumber: 10
|
1441 | }, this);
|
1442 | }
|
1443 | ThemeProvider.propTypes = {
|
1444 | |
1445 |
|
1446 |
|
1447 |
|
1448 |
|
1449 |
|
1450 |
|
1451 |
|
1452 |
|
1453 | prefixes: (prop_types_default()).object,
|
1454 | |
1455 |
|
1456 |
|
1457 |
|
1458 | breakpoints: prop_types_default().arrayOf((prop_types_default()).string),
|
1459 | |
1460 |
|
1461 |
|
1462 |
|
1463 | minBreakpoint: (prop_types_default()).string,
|
1464 | |
1465 |
|
1466 |
|
1467 |
|
1468 |
|
1469 | dir: (prop_types_default()).string
|
1470 | };
|
1471 | function useBootstrapPrefix(prefix, defaultPrefix) {
|
1472 | const {
|
1473 | prefixes
|
1474 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(ThemeContext);
|
1475 | return prefix || prefixes[defaultPrefix] || defaultPrefix;
|
1476 | }
|
1477 | function useBootstrapBreakpoints() {
|
1478 | const {
|
1479 | breakpoints
|
1480 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(ThemeContext);
|
1481 | return breakpoints;
|
1482 | }
|
1483 | function useBootstrapMinBreakpoint() {
|
1484 | const {
|
1485 | minBreakpoint
|
1486 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(ThemeContext);
|
1487 | return minBreakpoint;
|
1488 | }
|
1489 | function useIsRTL() {
|
1490 | const {
|
1491 | dir
|
1492 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(ThemeContext);
|
1493 | return dir === 'rtl';
|
1494 | }
|
1495 | function createBootstrapComponent(Component, opts) {
|
1496 | if (typeof opts === 'string') opts = {
|
1497 | prefix: opts
|
1498 | };
|
1499 | const isClassy = Component.prototype && Component.prototype.isReactComponent;
|
1500 |
|
1501 | const {
|
1502 | prefix,
|
1503 | forwardRefAs = isClassy ? 'ref' : 'innerRef'
|
1504 | } = opts;
|
1505 | const Wrapped = React.forwardRef(({
|
1506 | ...props
|
1507 | }, ref) => {
|
1508 | props[forwardRefAs] = ref;
|
1509 | const bsPrefix = useBootstrapPrefix(props.bsPrefix, prefix);
|
1510 | return _jsxDEV(Component, {
|
1511 | ...props,
|
1512 | bsPrefix: bsPrefix
|
1513 | }, void 0, false, {
|
1514 | fileName: ThemeProvider_jsxFileName,
|
1515 | lineNumber: 111,
|
1516 | columnNumber: 14
|
1517 | }, this);
|
1518 | });
|
1519 | Wrapped.displayName = `Bootstrap(${Component.displayName || Component.name})`;
|
1520 | return Wrapped;
|
1521 | }
|
1522 |
|
1523 | const src_ThemeProvider = (ThemeProvider);
|
1524 | ;
|
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 | function ownerDocument(node) {
|
1531 | return node && node.ownerDocument || document;
|
1532 | }
|
1533 | ;
|
1534 |
|
1535 |
|
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 |
|
1541 | function ownerWindow(node) {
|
1542 | var doc = ownerDocument(node);
|
1543 | return doc && doc.defaultView || window;
|
1544 | }
|
1545 | ;
|
1546 |
|
1547 |
|
1548 |
|
1549 |
|
1550 |
|
1551 |
|
1552 |
|
1553 |
|
1554 | function getComputedStyle_getComputedStyle(node, psuedoElement) {
|
1555 | return ownerWindow(node).getComputedStyle(node, psuedoElement);
|
1556 | }
|
1557 | ;
|
1558 | var rUpper = /([A-Z])/g;
|
1559 | function hyphenate(string) {
|
1560 | return string.replace(rUpper, '-$1').toLowerCase();
|
1561 | }
|
1562 | ;
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 |
|
1568 |
|
1569 | var msPattern = /^ms-/;
|
1570 | function hyphenateStyleName(string) {
|
1571 | return hyphenate(string).replace(msPattern, '-ms-');
|
1572 | }
|
1573 | ;
|
1574 | var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
|
1575 | function isTransform(value) {
|
1576 | return !!(value && supportedTransforms.test(value));
|
1577 | }
|
1578 | ;
|
1579 |
|
1580 |
|
1581 |
|
1582 | function style(node, property) {
|
1583 | var css = '';
|
1584 | var transforms = '';
|
1585 | if (typeof property === 'string') {
|
1586 | return node.style.getPropertyValue(hyphenateStyleName(property)) || getComputedStyle_getComputedStyle(node).getPropertyValue(hyphenateStyleName(property));
|
1587 | }
|
1588 | Object.keys(property).forEach(function (key) {
|
1589 | var value = property[key];
|
1590 | if (!value && value !== 0) {
|
1591 | node.style.removeProperty(hyphenateStyleName(key));
|
1592 | } else if (isTransform(key)) {
|
1593 | transforms += key + "(" + value + ") ";
|
1594 | } else {
|
1595 | css += hyphenateStyleName(key) + ": " + value + ";";
|
1596 | }
|
1597 | });
|
1598 | if (transforms) {
|
1599 | css += "transform: " + transforms + ";";
|
1600 | }
|
1601 | node.style.cssText += ";" + css;
|
1602 | }
|
1603 | const css = (style);
|
1604 | ;
|
1605 | function _setPrototypeOf(o, p) {
|
1606 | _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
1607 | o.__proto__ = p;
|
1608 | return o;
|
1609 | };
|
1610 | return _setPrototypeOf(o, p);
|
1611 | }
|
1612 | ;
|
1613 |
|
1614 | function inheritsLoose_inheritsLoose(subClass, superClass) {
|
1615 | subClass.prototype = Object.create(superClass.prototype);
|
1616 | subClass.prototype.constructor = subClass;
|
1617 | _setPrototypeOf(subClass, superClass);
|
1618 | }
|
1619 |
|
1620 | var external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_ = __webpack_require__(156);
|
1621 | var external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default = __webpack_require__.n(external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_);
|
1622 | ;
|
1623 | const config = ({
|
1624 | disabled: false
|
1625 | });
|
1626 | ;
|
1627 |
|
1628 | const TransitionGroupContext = (external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext(null));
|
1629 | ;
|
1630 | var forceReflow = function forceReflow(node) {
|
1631 | return node.scrollTop;
|
1632 | };
|
1633 | ;
|
1634 |
|
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 | var UNMOUNTED = 'unmounted';
|
1644 | var EXITED = 'exited';
|
1645 | var ENTERING = 'entering';
|
1646 | var ENTERED = 'entered';
|
1647 | var EXITING = 'exiting';
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 |
|
1658 |
|
1659 |
|
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 |
|
1667 |
|
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 |
|
1719 |
|
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 |
|
1727 |
|
1728 |
|
1729 |
|
1730 |
|
1731 |
|
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 |
|
1737 |
|
1738 |
|
1739 |
|
1740 | var Transition = function (_React$Component) {
|
1741 | inheritsLoose_inheritsLoose(Transition, _React$Component);
|
1742 | function Transition(props, context) {
|
1743 | var _this;
|
1744 | _this = _React$Component.call(this, props, context) || this;
|
1745 | var parentGroup = context;
|
1746 |
|
1747 | var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
|
1748 | var initialStatus;
|
1749 | _this.appearStatus = null;
|
1750 | if (props.in) {
|
1751 | if (appear) {
|
1752 | initialStatus = EXITED;
|
1753 | _this.appearStatus = ENTERING;
|
1754 | } else {
|
1755 | initialStatus = ENTERED;
|
1756 | }
|
1757 | } else {
|
1758 | if (props.unmountOnExit || props.mountOnEnter) {
|
1759 | initialStatus = UNMOUNTED;
|
1760 | } else {
|
1761 | initialStatus = EXITED;
|
1762 | }
|
1763 | }
|
1764 | _this.state = {
|
1765 | status: initialStatus
|
1766 | };
|
1767 | _this.nextCallback = null;
|
1768 | return _this;
|
1769 | }
|
1770 | Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
|
1771 | var nextIn = _ref.in;
|
1772 | if (nextIn && prevState.status === UNMOUNTED) {
|
1773 | return {
|
1774 | status: EXITED
|
1775 | };
|
1776 | }
|
1777 | return null;
|
1778 | }
|
1779 |
|
1780 |
|
1781 |
|
1782 |
|
1783 |
|
1784 |
|
1785 |
|
1786 |
|
1787 |
|
1788 |
|
1789 |
|
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 | ;
|
1795 |
|
1796 | var _proto = Transition.prototype;
|
1797 | _proto.componentDidMount = function componentDidMount() {
|
1798 | this.updateStatus(true, this.appearStatus);
|
1799 | };
|
1800 | _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
1801 | var nextStatus = null;
|
1802 | if (prevProps !== this.props) {
|
1803 | var status = this.state.status;
|
1804 | if (this.props.in) {
|
1805 | if (status !== ENTERING && status !== ENTERED) {
|
1806 | nextStatus = ENTERING;
|
1807 | }
|
1808 | } else {
|
1809 | if (status === ENTERING || status === ENTERED) {
|
1810 | nextStatus = EXITING;
|
1811 | }
|
1812 | }
|
1813 | }
|
1814 | this.updateStatus(false, nextStatus);
|
1815 | };
|
1816 | _proto.componentWillUnmount = function componentWillUnmount() {
|
1817 | this.cancelNextCallback();
|
1818 | };
|
1819 | _proto.getTimeouts = function getTimeouts() {
|
1820 | var timeout = this.props.timeout;
|
1821 | var exit, enter, appear;
|
1822 | exit = enter = appear = timeout;
|
1823 | if (timeout != null && typeof timeout !== 'number') {
|
1824 | exit = timeout.exit;
|
1825 | enter = timeout.enter;
|
1826 |
|
1827 | appear = timeout.appear !== undefined ? timeout.appear : enter;
|
1828 | }
|
1829 | return {
|
1830 | exit: exit,
|
1831 | enter: enter,
|
1832 | appear: appear
|
1833 | };
|
1834 | };
|
1835 | _proto.updateStatus = function updateStatus(mounting, nextStatus) {
|
1836 | if (mounting === void 0) {
|
1837 | mounting = false;
|
1838 | }
|
1839 | if (nextStatus !== null) {
|
1840 |
|
1841 | this.cancelNextCallback();
|
1842 | if (nextStatus === ENTERING) {
|
1843 | if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
1844 | var node = this.props.nodeRef ? this.props.nodeRef.current : external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(this);
|
1845 |
|
1846 |
|
1847 |
|
1848 | if (node) forceReflow(node);
|
1849 | }
|
1850 | this.performEnter(mounting);
|
1851 | } else {
|
1852 | this.performExit();
|
1853 | }
|
1854 | } else if (this.props.unmountOnExit && this.state.status === EXITED) {
|
1855 | this.setState({
|
1856 | status: UNMOUNTED
|
1857 | });
|
1858 | }
|
1859 | };
|
1860 | _proto.performEnter = function performEnter(mounting) {
|
1861 | var _this2 = this;
|
1862 | var enter = this.props.enter;
|
1863 | var appearing = this.context ? this.context.isMounting : mounting;
|
1864 | var _ref2 = this.props.nodeRef ? [appearing] : [external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(this), appearing],
|
1865 | maybeNode = _ref2[0],
|
1866 | maybeAppearing = _ref2[1];
|
1867 | var timeouts = this.getTimeouts();
|
1868 | var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
|
1869 |
|
1870 |
|
1871 | if (!mounting && !enter || config.disabled) {
|
1872 | this.safeSetState({
|
1873 | status: ENTERED
|
1874 | }, function () {
|
1875 | _this2.props.onEntered(maybeNode);
|
1876 | });
|
1877 | return;
|
1878 | }
|
1879 | this.props.onEnter(maybeNode, maybeAppearing);
|
1880 | this.safeSetState({
|
1881 | status: ENTERING
|
1882 | }, function () {
|
1883 | _this2.props.onEntering(maybeNode, maybeAppearing);
|
1884 | _this2.onTransitionEnd(enterTimeout, function () {
|
1885 | _this2.safeSetState({
|
1886 | status: ENTERED
|
1887 | }, function () {
|
1888 | _this2.props.onEntered(maybeNode, maybeAppearing);
|
1889 | });
|
1890 | });
|
1891 | });
|
1892 | };
|
1893 | _proto.performExit = function performExit() {
|
1894 | var _this3 = this;
|
1895 | var exit = this.props.exit;
|
1896 | var timeouts = this.getTimeouts();
|
1897 | var maybeNode = this.props.nodeRef ? undefined : external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(this);
|
1898 |
|
1899 | if (!exit || config.disabled) {
|
1900 | this.safeSetState({
|
1901 | status: EXITED
|
1902 | }, function () {
|
1903 | _this3.props.onExited(maybeNode);
|
1904 | });
|
1905 | return;
|
1906 | }
|
1907 | this.props.onExit(maybeNode);
|
1908 | this.safeSetState({
|
1909 | status: EXITING
|
1910 | }, function () {
|
1911 | _this3.props.onExiting(maybeNode);
|
1912 | _this3.onTransitionEnd(timeouts.exit, function () {
|
1913 | _this3.safeSetState({
|
1914 | status: EXITED
|
1915 | }, function () {
|
1916 | _this3.props.onExited(maybeNode);
|
1917 | });
|
1918 | });
|
1919 | });
|
1920 | };
|
1921 | _proto.cancelNextCallback = function cancelNextCallback() {
|
1922 | if (this.nextCallback !== null) {
|
1923 | this.nextCallback.cancel();
|
1924 | this.nextCallback = null;
|
1925 | }
|
1926 | };
|
1927 | _proto.safeSetState = function safeSetState(nextState, callback) {
|
1928 |
|
1929 |
|
1930 |
|
1931 | callback = this.setNextCallback(callback);
|
1932 | this.setState(nextState, callback);
|
1933 | };
|
1934 | _proto.setNextCallback = function setNextCallback(callback) {
|
1935 | var _this4 = this;
|
1936 | var active = true;
|
1937 | this.nextCallback = function (event) {
|
1938 | if (active) {
|
1939 | active = false;
|
1940 | _this4.nextCallback = null;
|
1941 | callback(event);
|
1942 | }
|
1943 | };
|
1944 | this.nextCallback.cancel = function () {
|
1945 | active = false;
|
1946 | };
|
1947 | return this.nextCallback;
|
1948 | };
|
1949 | _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
|
1950 | this.setNextCallback(handler);
|
1951 | var node = this.props.nodeRef ? this.props.nodeRef.current : external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(this);
|
1952 | var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
|
1953 | if (!node || doesNotHaveTimeoutOrListener) {
|
1954 | setTimeout(this.nextCallback, 0);
|
1955 | return;
|
1956 | }
|
1957 | if (this.props.addEndListener) {
|
1958 | var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
|
1959 | maybeNode = _ref3[0],
|
1960 | maybeNextCallback = _ref3[1];
|
1961 | this.props.addEndListener(maybeNode, maybeNextCallback);
|
1962 | }
|
1963 | if (timeout != null) {
|
1964 | setTimeout(this.nextCallback, timeout);
|
1965 | }
|
1966 | };
|
1967 | _proto.render = function render() {
|
1968 | var status = this.state.status;
|
1969 | if (status === UNMOUNTED) {
|
1970 | return null;
|
1971 | }
|
1972 | var _this$props = this.props,
|
1973 | children = _this$props.children,
|
1974 | _in = _this$props.in,
|
1975 | _mountOnEnter = _this$props.mountOnEnter,
|
1976 | _unmountOnExit = _this$props.unmountOnExit,
|
1977 | _appear = _this$props.appear,
|
1978 | _enter = _this$props.enter,
|
1979 | _exit = _this$props.exit,
|
1980 | _timeout = _this$props.timeout,
|
1981 | _addEndListener = _this$props.addEndListener,
|
1982 | _onEnter = _this$props.onEnter,
|
1983 | _onEntering = _this$props.onEntering,
|
1984 | _onEntered = _this$props.onEntered,
|
1985 | _onExit = _this$props.onExit,
|
1986 | _onExiting = _this$props.onExiting,
|
1987 | _onExited = _this$props.onExited,
|
1988 | _nodeRef = _this$props.nodeRef,
|
1989 | childProps = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
1990 | return (
|
1991 |
|
1992 | external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(TransitionGroupContext.Provider, {
|
1993 | value: null
|
1994 | }, typeof children === 'function' ? children(status, childProps) : external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.only(children), childProps))
|
1995 | );
|
1996 | };
|
1997 | return Transition;
|
1998 | }((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Component);
|
1999 | Transition.contextType = TransitionGroupContext;
|
2000 | Transition.propTypes = false ? 0 : {};
|
2001 |
|
2002 | function Transition_noop() {}
|
2003 | Transition.defaultProps = {
|
2004 | in: false,
|
2005 | mountOnEnter: false,
|
2006 | unmountOnExit: false,
|
2007 | appear: false,
|
2008 | enter: true,
|
2009 | exit: true,
|
2010 | onEnter: Transition_noop,
|
2011 | onEntering: Transition_noop,
|
2012 | onEntered: Transition_noop,
|
2013 | onExit: Transition_noop,
|
2014 | onExiting: Transition_noop,
|
2015 | onExited: Transition_noop
|
2016 | };
|
2017 | Transition.UNMOUNTED = UNMOUNTED;
|
2018 | Transition.EXITED = EXITED;
|
2019 | Transition.ENTERING = ENTERING;
|
2020 | Transition.ENTERED = ENTERED;
|
2021 | Transition.EXITING = EXITING;
|
2022 | const esm_Transition = (Transition);
|
2023 | ;
|
2024 | const canUseDOM = (!!(typeof window !== 'undefined' && window.document && window.document.createElement));
|
2025 | ;
|
2026 |
|
2027 |
|
2028 | var optionsSupported = false;
|
2029 | var onceSupported = false;
|
2030 | try {
|
2031 | var options = {
|
2032 | get passive() {
|
2033 | return optionsSupported = true;
|
2034 | },
|
2035 | get once() {
|
2036 |
|
2037 | return onceSupported = optionsSupported = true;
|
2038 | }
|
2039 | };
|
2040 | if (canUseDOM) {
|
2041 | window.addEventListener('test', options, options);
|
2042 | window.removeEventListener('test', options, true);
|
2043 | }
|
2044 | } catch (e) {
|
2045 |
|
2046 | }
|
2047 |
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 | function addEventListener(node, eventName, handler, options) {
|
2057 | if (options && typeof options !== 'boolean' && !onceSupported) {
|
2058 | var once = options.once,
|
2059 | capture = options.capture;
|
2060 | var wrappedHandler = handler;
|
2061 | if (!onceSupported && once) {
|
2062 | wrappedHandler = handler.__once || function onceHandler(event) {
|
2063 | this.removeEventListener(eventName, onceHandler, capture);
|
2064 | handler.call(this, event);
|
2065 | };
|
2066 | handler.__once = wrappedHandler;
|
2067 | }
|
2068 | node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);
|
2069 | }
|
2070 | node.addEventListener(eventName, handler, options);
|
2071 | }
|
2072 | const esm_addEventListener = (addEventListener);
|
2073 | ;
|
2074 |
|
2075 |
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 | function removeEventListener(node, eventName, handler, options) {
|
2083 | var capture = options && typeof options !== 'boolean' ? options.capture : options;
|
2084 | node.removeEventListener(eventName, handler, capture);
|
2085 | if (handler.__once) {
|
2086 | node.removeEventListener(eventName, handler.__once, capture);
|
2087 | }
|
2088 | }
|
2089 | const esm_removeEventListener = (removeEventListener);
|
2090 | ;
|
2091 |
|
2092 |
|
2093 | function listen(node, eventName, handler, options) {
|
2094 | esm_addEventListener(node, eventName, handler, options);
|
2095 | return function () {
|
2096 | esm_removeEventListener(node, eventName, handler, options);
|
2097 | };
|
2098 | }
|
2099 | const esm_listen = (listen);
|
2100 | ;
|
2101 |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 | function triggerEvent(node, eventName, bubbles, cancelable) {
|
2110 | if (bubbles === void 0) {
|
2111 | bubbles = false;
|
2112 | }
|
2113 | if (cancelable === void 0) {
|
2114 | cancelable = true;
|
2115 | }
|
2116 | if (node) {
|
2117 | var event = document.createEvent('HTMLEvents');
|
2118 | event.initEvent(eventName, bubbles, cancelable);
|
2119 | node.dispatchEvent(event);
|
2120 | }
|
2121 | }
|
2122 | ;
|
2123 |
|
2124 |
|
2125 |
|
2126 | function parseDuration(node) {
|
2127 | var str = css(node, 'transitionDuration') || '';
|
2128 | var mult = str.indexOf('ms') === -1 ? 1000 : 1;
|
2129 | return parseFloat(str) * mult;
|
2130 | }
|
2131 | function emulateTransitionEnd(element, duration, padding) {
|
2132 | if (padding === void 0) {
|
2133 | padding = 5;
|
2134 | }
|
2135 | var called = false;
|
2136 | var handle = setTimeout(function () {
|
2137 | if (!called) triggerEvent(element, 'transitionend', true);
|
2138 | }, duration + padding);
|
2139 | var remove = esm_listen(element, 'transitionend', function () {
|
2140 | called = true;
|
2141 | }, {
|
2142 | once: true
|
2143 | });
|
2144 | return function () {
|
2145 | clearTimeout(handle);
|
2146 | remove();
|
2147 | };
|
2148 | }
|
2149 | function transitionEnd(element, handler, duration, padding) {
|
2150 | if (duration == null) duration = parseDuration(element) || 0;
|
2151 | var removeEmulate = emulateTransitionEnd(element, duration, padding);
|
2152 | var remove = esm_listen(element, 'transitionend', handler);
|
2153 | return function () {
|
2154 | removeEmulate();
|
2155 | remove();
|
2156 | };
|
2157 | }
|
2158 | ;
|
2159 |
|
2160 |
|
2161 | function transitionEndListener_parseDuration(node, property) {
|
2162 | const str = css(node, property) || '';
|
2163 | const mult = str.indexOf('ms') === -1 ? 1000 : 1;
|
2164 | return parseFloat(str) * mult;
|
2165 | }
|
2166 | function transitionEndListener(element, handler) {
|
2167 | const duration = transitionEndListener_parseDuration(element, 'transitionDuration');
|
2168 | const delay = transitionEndListener_parseDuration(element, 'transitionDelay');
|
2169 | const remove = transitionEnd(element, e => {
|
2170 | if (e.target === element) {
|
2171 | remove();
|
2172 | handler(e);
|
2173 | }
|
2174 | }, duration + delay);
|
2175 | }
|
2176 | ;
|
2177 |
|
2178 |
|
2179 |
|
2180 |
|
2181 |
|
2182 |
|
2183 |
|
2184 |
|
2185 |
|
2186 | function createChainedFunction(...funcs) {
|
2187 | return funcs.filter(f => f != null).reduce((acc, f) => {
|
2188 | if (typeof f !== 'function') {
|
2189 | throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
|
2190 | }
|
2191 | if (acc === null) return f;
|
2192 | return function chainedFunction(...args) {
|
2193 |
|
2194 | acc.apply(this, args);
|
2195 |
|
2196 | f.apply(this, args);
|
2197 | };
|
2198 | }, null);
|
2199 | }
|
2200 | const src_createChainedFunction = (createChainedFunction);
|
2201 | ;
|
2202 |
|
2203 |
|
2204 | function triggerBrowserReflow(node) {
|
2205 |
|
2206 | node.offsetHeight;
|
2207 | }
|
2208 | ;
|
2209 |
|
2210 | var toFnRef = function toFnRef(ref) {
|
2211 | return !ref || typeof ref === 'function' ? ref : function (value) {
|
2212 | ref.current = value;
|
2213 | };
|
2214 | };
|
2215 | function mergeRefs(refA, refB) {
|
2216 | var a = toFnRef(refA);
|
2217 | var b = toFnRef(refB);
|
2218 | return function (value) {
|
2219 | if (a) a(value);
|
2220 | if (b) b(value);
|
2221 | };
|
2222 | }
|
2223 |
|
2224 |
|
2225 |
|
2226 |
|
2227 |
|
2228 |
|
2229 |
|
2230 |
|
2231 |
|
2232 |
|
2233 |
|
2234 |
|
2235 |
|
2236 |
|
2237 |
|
2238 |
|
2239 |
|
2240 | function useMergedRefs(refA, refB) {
|
2241 | return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
2242 | return mergeRefs(refA, refB);
|
2243 | }, [refA, refB]);
|
2244 | }
|
2245 | const esm_useMergedRefs = (useMergedRefs);
|
2246 | ;
|
2247 |
|
2248 | function safeFindDOMNode(componentOrElement) {
|
2249 | if (componentOrElement && 'setState' in componentOrElement) {
|
2250 | return external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(componentOrElement);
|
2251 | }
|
2252 | return componentOrElement != null ? componentOrElement : null;
|
2253 | }
|
2254 | ;
|
2255 | var TransitionWrapper_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/TransitionWrapper.tsx";
|
2256 |
|
2257 |
|
2258 |
|
2259 |
|
2260 |
|
2261 |
|
2262 | const TransitionWrapper = external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(({
|
2263 | onEnter,
|
2264 | onEntering,
|
2265 | onEntered,
|
2266 | onExit,
|
2267 | onExiting,
|
2268 | onExited,
|
2269 | addEndListener,
|
2270 | children,
|
2271 | childRef,
|
2272 | ...props
|
2273 | }, ref) => {
|
2274 | const nodeRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
2275 | const mergedRef = esm_useMergedRefs(nodeRef, childRef);
|
2276 | const attachRef = r => {
|
2277 | mergedRef(safeFindDOMNode(r));
|
2278 | };
|
2279 | const normalize = callback => param => {
|
2280 | if (callback && nodeRef.current) {
|
2281 | callback(nodeRef.current, param);
|
2282 | }
|
2283 | };
|
2284 |
|
2285 |
|
2286 | const handleEnter = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(normalize(onEnter), [onEnter]);
|
2287 | const handleEntering = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(normalize(onEntering), [onEntering]);
|
2288 | const handleEntered = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(normalize(onEntered), [onEntered]);
|
2289 | const handleExit = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(normalize(onExit), [onExit]);
|
2290 | const handleExiting = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(normalize(onExiting), [onExiting]);
|
2291 | const handleExited = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(normalize(onExited), [onExited]);
|
2292 | const handleAddEndListener = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(normalize(addEndListener), [addEndListener]);
|
2293 |
|
2294 |
|
2295 | return (0,jsx_dev_runtime.jsxDEV)(esm_Transition, {
|
2296 | ref: ref,
|
2297 | ...props,
|
2298 | onEnter: handleEnter,
|
2299 | onEntered: handleEntered,
|
2300 | onEntering: handleEntering,
|
2301 | onExit: handleExit,
|
2302 | onExited: handleExited,
|
2303 | onExiting: handleExiting,
|
2304 | addEndListener: handleAddEndListener,
|
2305 | nodeRef: nodeRef,
|
2306 | children: typeof children === 'function' ? (status, innerProps) =>
|
2307 |
|
2308 | children(status, {
|
2309 | ...innerProps,
|
2310 | ref: attachRef
|
2311 | }) : external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children, {
|
2312 | ref: attachRef
|
2313 | })
|
2314 | }, void 0, false, {
|
2315 | fileName: TransitionWrapper_jsxFileName,
|
2316 | lineNumber: 66,
|
2317 | columnNumber: 7
|
2318 | }, undefined);
|
2319 | });
|
2320 | const src_TransitionWrapper = (TransitionWrapper);
|
2321 | ;
|
2322 | var Collapse_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Collapse.tsx";
|
2323 |
|
2324 |
|
2325 |
|
2326 |
|
2327 |
|
2328 |
|
2329 |
|
2330 |
|
2331 |
|
2332 |
|
2333 | const MARGINS = {
|
2334 | height: ['marginTop', 'marginBottom'],
|
2335 | width: ['marginLeft', 'marginRight']
|
2336 | };
|
2337 | function getDefaultDimensionValue(dimension, elem) {
|
2338 | const offset = `offset${dimension[0].toUpperCase()}${dimension.slice(1)}`;
|
2339 | const value = elem[offset];
|
2340 | const margins = MARGINS[dimension];
|
2341 | return value +
|
2342 |
|
2343 | parseInt(css(elem, margins[0]), 10) +
|
2344 |
|
2345 | parseInt(css(elem, margins[1]), 10);
|
2346 | }
|
2347 | const collapseStyles = {
|
2348 | [EXITED]: 'collapse',
|
2349 | [EXITING]: 'collapsing',
|
2350 | [ENTERING]: 'collapsing',
|
2351 | [ENTERED]: 'collapse show'
|
2352 | };
|
2353 | const propTypes = {
|
2354 | |
2355 |
|
2356 |
|
2357 | in: (prop_types_default()).bool,
|
2358 | |
2359 |
|
2360 |
|
2361 | mountOnEnter: (prop_types_default()).bool,
|
2362 | |
2363 |
|
2364 |
|
2365 | unmountOnExit: (prop_types_default()).bool,
|
2366 | |
2367 |
|
2368 |
|
2369 |
|
2370 | appear: (prop_types_default()).bool,
|
2371 | |
2372 |
|
2373 |
|
2374 |
|
2375 |
|
2376 | timeout: (prop_types_default()).number,
|
2377 | |
2378 |
|
2379 |
|
2380 | onEnter: (prop_types_default()).func,
|
2381 | |
2382 |
|
2383 |
|
2384 | onEntering: (prop_types_default()).func,
|
2385 | |
2386 |
|
2387 |
|
2388 | onEntered: (prop_types_default()).func,
|
2389 | |
2390 |
|
2391 |
|
2392 | onExit: (prop_types_default()).func,
|
2393 | |
2394 |
|
2395 |
|
2396 | onExiting: (prop_types_default()).func,
|
2397 | |
2398 |
|
2399 |
|
2400 | onExited: (prop_types_default()).func,
|
2401 | |
2402 |
|
2403 |
|
2404 |
|
2405 | dimension: prop_types_default().oneOfType([prop_types_default().oneOf(['height', 'width']), (prop_types_default()).func]),
|
2406 | |
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 | getDimensionValue: (prop_types_default()).func,
|
2416 | |
2417 |
|
2418 |
|
2419 | role: (prop_types_default()).string,
|
2420 | |
2421 |
|
2422 |
|
2423 | children: (prop_types_default()).element.isRequired
|
2424 | };
|
2425 | const Collapse = external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(({
|
2426 | onEnter,
|
2427 | onEntering,
|
2428 | onEntered,
|
2429 | onExit,
|
2430 | onExiting,
|
2431 | className,
|
2432 | children,
|
2433 | dimension = 'height',
|
2434 | in: inProp = false,
|
2435 | timeout = 300,
|
2436 | mountOnEnter = false,
|
2437 | unmountOnExit = false,
|
2438 | appear = false,
|
2439 | getDimensionValue = getDefaultDimensionValue,
|
2440 | ...props
|
2441 | }, ref) => {
|
2442 |
|
2443 | const computedDimension = typeof dimension === 'function' ? dimension() : dimension;
|
2444 |
|
2445 |
|
2446 | const handleEnter = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => src_createChainedFunction(elem => {
|
2447 | elem.style[computedDimension] = '0';
|
2448 | }, onEnter), [computedDimension, onEnter]);
|
2449 | const handleEntering = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => src_createChainedFunction(elem => {
|
2450 | const scroll = `scroll${computedDimension[0].toUpperCase()}${computedDimension.slice(1)}`;
|
2451 | elem.style[computedDimension] = `${elem[scroll]}px`;
|
2452 | }, onEntering), [computedDimension, onEntering]);
|
2453 | const handleEntered = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => src_createChainedFunction(elem => {
|
2454 | elem.style[computedDimension] = null;
|
2455 | }, onEntered), [computedDimension, onEntered]);
|
2456 |
|
2457 |
|
2458 | const handleExit = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => src_createChainedFunction(elem => {
|
2459 | elem.style[computedDimension] = `${getDimensionValue(computedDimension, elem)}px`;
|
2460 | triggerBrowserReflow(elem);
|
2461 | }, onExit), [onExit, getDimensionValue, computedDimension]);
|
2462 | const handleExiting = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => src_createChainedFunction(elem => {
|
2463 | elem.style[computedDimension] = null;
|
2464 | }, onExiting), [computedDimension, onExiting]);
|
2465 | return (0,jsx_dev_runtime.jsxDEV)(src_TransitionWrapper, {
|
2466 | ref: ref,
|
2467 | addEndListener: transitionEndListener,
|
2468 | ...props,
|
2469 | "aria-expanded": props.role ? inProp : null,
|
2470 | onEnter: handleEnter,
|
2471 | onEntering: handleEntering,
|
2472 | onEntered: handleEntered,
|
2473 | onExit: handleExit,
|
2474 | onExiting: handleExiting,
|
2475 | childRef: children.ref,
|
2476 | in: inProp,
|
2477 | timeout: timeout,
|
2478 | mountOnEnter: mountOnEnter,
|
2479 | unmountOnExit: unmountOnExit,
|
2480 | appear: appear,
|
2481 | children: (state, innerProps) => external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children, {
|
2482 | ...innerProps,
|
2483 | className: classnames_default()(className, children.props.className, collapseStyles[state], computedDimension === 'width' && 'collapse-horizontal')
|
2484 | })
|
2485 | }, void 0, false, {
|
2486 | fileName: Collapse_jsxFileName,
|
2487 | lineNumber: 222,
|
2488 | columnNumber: 7
|
2489 | }, undefined);
|
2490 | });
|
2491 |
|
2492 |
|
2493 | Collapse.propTypes = propTypes;
|
2494 | const src_Collapse = (Collapse);
|
2495 | ;
|
2496 |
|
2497 | function isAccordionItemSelected(activeEventKey, eventKey) {
|
2498 | return Array.isArray(activeEventKey) ? activeEventKey.includes(eventKey) : activeEventKey === eventKey;
|
2499 | }
|
2500 | const context = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
|
2501 | context.displayName = 'AccordionContext';
|
2502 | const AccordionContext = (context);
|
2503 | ;
|
2504 | var AccordionCollapse_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/AccordionCollapse.tsx";
|
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 | const AccordionCollapse_propTypes = {
|
2514 |
|
2515 | as: (prop_types_default()).elementType,
|
2516 | |
2517 |
|
2518 |
|
2519 | eventKey: (prop_types_default()).string.isRequired,
|
2520 |
|
2521 | children: (prop_types_default()).element.isRequired
|
2522 | };
|
2523 |
|
2524 |
|
2525 |
|
2526 |
|
2527 | const AccordionCollapse = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
2528 | as: Component = 'div',
|
2529 | bsPrefix,
|
2530 | className,
|
2531 | children,
|
2532 | eventKey,
|
2533 | ...props
|
2534 | }, ref) => {
|
2535 | const {
|
2536 | activeEventKey
|
2537 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AccordionContext);
|
2538 | bsPrefix = useBootstrapPrefix(bsPrefix, 'accordion-collapse');
|
2539 | return (0,jsx_dev_runtime.jsxDEV)(src_Collapse, {
|
2540 | ref: ref,
|
2541 | in: isAccordionItemSelected(activeEventKey, eventKey),
|
2542 | ...props,
|
2543 | className: classnames_default()(className, bsPrefix),
|
2544 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
2545 | children: external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.only(children)
|
2546 | }, void 0, false, {
|
2547 | fileName: AccordionCollapse_jsxFileName,
|
2548 | lineNumber: 56,
|
2549 | columnNumber: 9
|
2550 | }, undefined)
|
2551 | }, void 0, false, {
|
2552 | fileName: AccordionCollapse_jsxFileName,
|
2553 | lineNumber: 50,
|
2554 | columnNumber: 7
|
2555 | }, undefined);
|
2556 | });
|
2557 | AccordionCollapse.propTypes = AccordionCollapse_propTypes;
|
2558 | AccordionCollapse.displayName = 'AccordionCollapse';
|
2559 | const src_AccordionCollapse = (AccordionCollapse);
|
2560 | ;
|
2561 |
|
2562 | const AccordionItemContext_context = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
|
2563 | eventKey: ''
|
2564 | });
|
2565 | AccordionItemContext_context.displayName = 'AccordionItemContext';
|
2566 | const AccordionItemContext = (AccordionItemContext_context);
|
2567 | ;
|
2568 | var AccordionBody_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/AccordionBody.tsx";
|
2569 |
|
2570 |
|
2571 |
|
2572 |
|
2573 |
|
2574 |
|
2575 |
|
2576 |
|
2577 | const AccordionBody_propTypes = {
|
2578 |
|
2579 | as: (prop_types_default()).elementType,
|
2580 |
|
2581 | bsPrefix: (prop_types_default()).string,
|
2582 | |
2583 |
|
2584 |
|
2585 | onEnter: (prop_types_default()).func,
|
2586 | |
2587 |
|
2588 |
|
2589 | onEntering: (prop_types_default()).func,
|
2590 | |
2591 |
|
2592 |
|
2593 | onEntered: (prop_types_default()).func,
|
2594 | |
2595 |
|
2596 |
|
2597 | onExit: (prop_types_default()).func,
|
2598 | |
2599 |
|
2600 |
|
2601 | onExiting: (prop_types_default()).func,
|
2602 | |
2603 |
|
2604 |
|
2605 | onExited: (prop_types_default()).func
|
2606 | };
|
2607 | const AccordionBody = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
2608 |
|
2609 | as: Component = 'div',
|
2610 | bsPrefix,
|
2611 | className,
|
2612 | onEnter,
|
2613 | onEntering,
|
2614 | onEntered,
|
2615 | onExit,
|
2616 | onExiting,
|
2617 | onExited,
|
2618 | ...props
|
2619 | }, ref) => {
|
2620 | bsPrefix = useBootstrapPrefix(bsPrefix, 'accordion-body');
|
2621 | const {
|
2622 | eventKey
|
2623 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AccordionItemContext);
|
2624 | return (0,jsx_dev_runtime.jsxDEV)(src_AccordionCollapse, {
|
2625 | eventKey: eventKey,
|
2626 | onEnter: onEnter,
|
2627 | onEntering: onEntering,
|
2628 | onEntered: onEntered,
|
2629 | onExit: onExit,
|
2630 | onExiting: onExiting,
|
2631 | onExited: onExited,
|
2632 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
2633 | ref: ref,
|
2634 | ...props,
|
2635 | className: classnames_default()(className, bsPrefix)
|
2636 | }, void 0, false, {
|
2637 | fileName: AccordionBody_jsxFileName,
|
2638 | lineNumber: 80,
|
2639 | columnNumber: 11
|
2640 | }, undefined)
|
2641 | }, void 0, false, {
|
2642 | fileName: AccordionBody_jsxFileName,
|
2643 | lineNumber: 71,
|
2644 | columnNumber: 9
|
2645 | }, undefined);
|
2646 | });
|
2647 | AccordionBody.propTypes = AccordionBody_propTypes;
|
2648 | AccordionBody.displayName = 'AccordionBody';
|
2649 | const src_AccordionBody = (AccordionBody);
|
2650 | ;
|
2651 | var AccordionButton_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/AccordionButton.tsx";
|
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 | const AccordionButton_propTypes = {
|
2661 |
|
2662 | as: (prop_types_default()).elementType,
|
2663 |
|
2664 | bsPrefix: (prop_types_default()).string,
|
2665 |
|
2666 | onClick: (prop_types_default()).func
|
2667 | };
|
2668 | function useAccordionButton(eventKey, onClick) {
|
2669 | const {
|
2670 | activeEventKey,
|
2671 | onSelect,
|
2672 | alwaysOpen
|
2673 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AccordionContext);
|
2674 | return e => {
|
2675 | |
2676 |
|
2677 |
|
2678 |
|
2679 | let eventKeyPassed = eventKey === activeEventKey ? null : eventKey;
|
2680 | if (alwaysOpen) {
|
2681 | if (Array.isArray(activeEventKey)) {
|
2682 | if (activeEventKey.includes(eventKey)) {
|
2683 | eventKeyPassed = activeEventKey.filter(k => k !== eventKey);
|
2684 | } else {
|
2685 | eventKeyPassed = [...activeEventKey, eventKey];
|
2686 | }
|
2687 | } else {
|
2688 |
|
2689 | eventKeyPassed = [eventKey];
|
2690 | }
|
2691 | }
|
2692 | onSelect == null ? void 0 : onSelect(eventKeyPassed, e);
|
2693 | onClick == null ? void 0 : onClick(e);
|
2694 | };
|
2695 | }
|
2696 | const AccordionButton = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
2697 |
|
2698 | as: Component = 'button',
|
2699 | bsPrefix,
|
2700 | className,
|
2701 | onClick,
|
2702 | ...props
|
2703 | }, ref) => {
|
2704 | bsPrefix = useBootstrapPrefix(bsPrefix, 'accordion-button');
|
2705 | const {
|
2706 | eventKey
|
2707 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AccordionItemContext);
|
2708 | const accordionOnClick = useAccordionButton(eventKey, onClick);
|
2709 | const {
|
2710 | activeEventKey
|
2711 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AccordionContext);
|
2712 | if (Component === 'button') {
|
2713 | props.type = 'button';
|
2714 | }
|
2715 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
2716 | ref: ref,
|
2717 | onClick: accordionOnClick,
|
2718 | ...props,
|
2719 | "aria-expanded": Array.isArray(activeEventKey) ? activeEventKey.includes(eventKey) : eventKey === activeEventKey,
|
2720 | className: classnames_default()(className, bsPrefix, !isAccordionItemSelected(activeEventKey, eventKey) && 'collapsed')
|
2721 | }, void 0, false, {
|
2722 | fileName: AccordionButton_jsxFileName,
|
2723 | lineNumber: 86,
|
2724 | columnNumber: 7
|
2725 | }, undefined);
|
2726 | });
|
2727 | AccordionButton.propTypes = AccordionButton_propTypes;
|
2728 | AccordionButton.displayName = 'AccordionButton';
|
2729 | const src_AccordionButton = (AccordionButton);
|
2730 | ;
|
2731 | var AccordionHeader_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/AccordionHeader.tsx";
|
2732 |
|
2733 |
|
2734 |
|
2735 |
|
2736 |
|
2737 |
|
2738 | const AccordionHeader_propTypes = {
|
2739 |
|
2740 | as: (prop_types_default()).elementType,
|
2741 |
|
2742 | bsPrefix: (prop_types_default()).string,
|
2743 |
|
2744 | onClick: (prop_types_default()).func
|
2745 | };
|
2746 | const AccordionHeader = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
2747 |
|
2748 | as: Component = 'h2',
|
2749 | bsPrefix,
|
2750 | className,
|
2751 | children,
|
2752 | onClick,
|
2753 | ...props
|
2754 | }, ref) => {
|
2755 | bsPrefix = useBootstrapPrefix(bsPrefix, 'accordion-header');
|
2756 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
2757 | ref: ref,
|
2758 | ...props,
|
2759 | className: classnames_default()(className, bsPrefix),
|
2760 | children: (0,jsx_dev_runtime.jsxDEV)(src_AccordionButton, {
|
2761 | onClick: onClick,
|
2762 | children: children
|
2763 | }, void 0, false, {
|
2764 | fileName: AccordionHeader_jsxFileName,
|
2765 | lineNumber: 47,
|
2766 | columnNumber: 9
|
2767 | }, undefined)
|
2768 | }, void 0, false, {
|
2769 | fileName: AccordionHeader_jsxFileName,
|
2770 | lineNumber: 42,
|
2771 | columnNumber: 7
|
2772 | }, undefined);
|
2773 | });
|
2774 | AccordionHeader.propTypes = AccordionHeader_propTypes;
|
2775 | AccordionHeader.displayName = 'AccordionHeader';
|
2776 | const src_AccordionHeader = (AccordionHeader);
|
2777 | ;
|
2778 | var AccordionItem_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/AccordionItem.tsx";
|
2779 |
|
2780 |
|
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 | const AccordionItem_propTypes = {
|
2787 |
|
2788 | as: (prop_types_default()).elementType,
|
2789 |
|
2790 | bsPrefix: (prop_types_default()).string,
|
2791 | |
2792 |
|
2793 |
|
2794 |
|
2795 | eventKey: (prop_types_default()).string.isRequired
|
2796 | };
|
2797 | const AccordionItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
2798 |
|
2799 | as: Component = 'div',
|
2800 | bsPrefix,
|
2801 | className,
|
2802 | eventKey,
|
2803 | ...props
|
2804 | }, ref) => {
|
2805 | bsPrefix = useBootstrapPrefix(bsPrefix, 'accordion-item');
|
2806 | const contextValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
2807 | eventKey
|
2808 | }), [eventKey]);
|
2809 | return (0,jsx_dev_runtime.jsxDEV)(AccordionItemContext.Provider, {
|
2810 | value: contextValue,
|
2811 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
2812 | ref: ref,
|
2813 | ...props,
|
2814 | className: classnames_default()(className, bsPrefix)
|
2815 | }, void 0, false, {
|
2816 | fileName: AccordionItem_jsxFileName,
|
2817 | lineNumber: 54,
|
2818 | columnNumber: 11
|
2819 | }, undefined)
|
2820 | }, void 0, false, {
|
2821 | fileName: AccordionItem_jsxFileName,
|
2822 | lineNumber: 53,
|
2823 | columnNumber: 9
|
2824 | }, undefined);
|
2825 | });
|
2826 | AccordionItem.propTypes = AccordionItem_propTypes;
|
2827 | AccordionItem.displayName = 'AccordionItem';
|
2828 | const src_AccordionItem = (AccordionItem);
|
2829 | ;
|
2830 | var Accordion_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Accordion.tsx";
|
2831 |
|
2832 |
|
2833 |
|
2834 |
|
2835 |
|
2836 |
|
2837 |
|
2838 |
|
2839 |
|
2840 |
|
2841 |
|
2842 |
|
2843 |
|
2844 | const Accordion_propTypes = {
|
2845 |
|
2846 | as: (prop_types_default()).elementType,
|
2847 |
|
2848 | bsPrefix: (prop_types_default()).string,
|
2849 |
|
2850 | activeKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).array]),
|
2851 |
|
2852 | defaultActiveKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).array]),
|
2853 | |
2854 |
|
2855 |
|
2856 |
|
2857 |
|
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 | onSelect: (prop_types_default()).func,
|
2863 |
|
2864 | flush: (prop_types_default()).bool,
|
2865 |
|
2866 | alwaysOpen: (prop_types_default()).bool
|
2867 | };
|
2868 | const Accordion = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
|
2869 | const {
|
2870 |
|
2871 | as: Component = 'div',
|
2872 | activeKey,
|
2873 | bsPrefix,
|
2874 | className,
|
2875 | onSelect,
|
2876 | flush,
|
2877 | alwaysOpen,
|
2878 | ...controlledProps
|
2879 | } = useUncontrolled(props, {
|
2880 | activeKey: 'onSelect'
|
2881 | });
|
2882 | const prefix = useBootstrapPrefix(bsPrefix, 'accordion');
|
2883 | const contextValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
2884 | activeEventKey: activeKey,
|
2885 | onSelect,
|
2886 | alwaysOpen
|
2887 | }), [activeKey, onSelect, alwaysOpen]);
|
2888 | return (0,jsx_dev_runtime.jsxDEV)(AccordionContext.Provider, {
|
2889 | value: contextValue,
|
2890 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
2891 | ref: ref,
|
2892 | ...controlledProps,
|
2893 | className: classnames_default()(className, prefix, flush && `${prefix}-flush`)
|
2894 | }, void 0, false, {
|
2895 | fileName: Accordion_jsxFileName,
|
2896 | lineNumber: 87,
|
2897 | columnNumber: 9
|
2898 | }, undefined)
|
2899 | }, void 0, false, {
|
2900 | fileName: Accordion_jsxFileName,
|
2901 | lineNumber: 86,
|
2902 | columnNumber: 7
|
2903 | }, undefined);
|
2904 | });
|
2905 | Accordion.displayName = 'Accordion';
|
2906 | Accordion.propTypes = Accordion_propTypes;
|
2907 | const src_Accordion = (Object.assign(Accordion, {
|
2908 | Button: src_AccordionButton,
|
2909 | Collapse: src_AccordionCollapse,
|
2910 | Item: src_AccordionItem,
|
2911 | Header: src_AccordionHeader,
|
2912 | Body: src_AccordionBody
|
2913 | }));
|
2914 |
|
2915 | var lib = __webpack_require__(517);
|
2916 | ;
|
2917 |
|
2918 |
|
2919 |
|
2920 |
|
2921 |
|
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 |
|
2927 |
|
2928 | function useCommittedRef_useCommittedRef(value) {
|
2929 | var ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(value);
|
2930 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
2931 | ref.current = value;
|
2932 | }, [value]);
|
2933 | return ref;
|
2934 | }
|
2935 | const esm_useCommittedRef = (useCommittedRef_useCommittedRef);
|
2936 | ;
|
2937 |
|
2938 |
|
2939 | function useEventCallback(fn) {
|
2940 | var ref = esm_useCommittedRef(fn);
|
2941 | return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function () {
|
2942 | return ref.current && ref.current.apply(ref, arguments);
|
2943 | }, [ref]);
|
2944 | }
|
2945 | ;
|
2946 | var divWithClassName_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/divWithClassName.tsx";
|
2947 |
|
2948 |
|
2949 |
|
2950 | const divWithClassName = (className => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((p, ref) => (0,jsx_dev_runtime.jsxDEV)("div", {
|
2951 | ...p,
|
2952 | ref: ref,
|
2953 | className: classnames_default()(p.className, className)
|
2954 | }, void 0, false, {
|
2955 | fileName: divWithClassName_jsxFileName,
|
2956 | lineNumber: 6,
|
2957 | columnNumber: 5
|
2958 | }, undefined)));
|
2959 | ;
|
2960 | var AlertHeading_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/AlertHeading.tsx";
|
2961 |
|
2962 |
|
2963 |
|
2964 |
|
2965 |
|
2966 | const DivStyledAsH4 = divWithClassName('h4');
|
2967 | DivStyledAsH4.displayName = 'DivStyledAsH4';
|
2968 | const AlertHeading = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
2969 | className,
|
2970 | bsPrefix,
|
2971 | as: Component = DivStyledAsH4,
|
2972 | ...props
|
2973 | }, ref) => {
|
2974 | bsPrefix = useBootstrapPrefix(bsPrefix, 'alert-heading');
|
2975 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
2976 | ref: ref,
|
2977 | className: classnames_default()(className, bsPrefix),
|
2978 | ...props
|
2979 | }, void 0, false, {
|
2980 | fileName: AlertHeading_jsxFileName,
|
2981 | lineNumber: 19,
|
2982 | columnNumber: 9
|
2983 | }, undefined);
|
2984 | });
|
2985 | AlertHeading.displayName = 'AlertHeading';
|
2986 | const src_AlertHeading = (AlertHeading);
|
2987 | ;
|
2988 |
|
2989 |
|
2990 |
|
2991 |
|
2992 |
|
2993 |
|
2994 |
|
2995 |
|
2996 |
|
2997 |
|
2998 |
|
2999 |
|
3000 |
|
3001 |
|
3002 |
|
3003 |
|
3004 |
|
3005 |
|
3006 |
|
3007 |
|
3008 |
|
3009 |
|
3010 |
|
3011 |
|
3012 |
|
3013 |
|
3014 | function useCallbackRef() {
|
3015 | return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null);
|
3016 | }
|
3017 | ;
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 | function useEventListener_useEventListener(eventTarget, event, listener, capture) {
|
3031 | if (capture === void 0) {
|
3032 | capture = false;
|
3033 | }
|
3034 | var handler = useEventCallback(listener);
|
3035 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
3036 | var target = typeof eventTarget === 'function' ? eventTarget() : eventTarget;
|
3037 | target.addEventListener(event, handler, capture);
|
3038 | return function () {
|
3039 | return target.removeEventListener(event, handler, capture);
|
3040 | };
|
3041 | }, [eventTarget]);
|
3042 | }
|
3043 | ;
|
3044 |
|
3045 |
|
3046 |
|
3047 |
|
3048 |
|
3049 |
|
3050 |
|
3051 |
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
3058 |
|
3059 |
|
3060 |
|
3061 | function useGlobalListener(event, handler, capture) {
|
3062 | if (capture === void 0) {
|
3063 | capture = false;
|
3064 | }
|
3065 | var documentTarget = useCallback(function () {
|
3066 | return document;
|
3067 | }, []);
|
3068 | return useEventListener(documentTarget, event, handler, capture);
|
3069 | }
|
3070 | ;
|
3071 |
|
3072 |
|
3073 |
|
3074 |
|
3075 |
|
3076 |
|
3077 |
|
3078 |
|
3079 |
|
3080 |
|
3081 |
|
3082 |
|
3083 |
|
3084 |
|
3085 |
|
3086 |
|
3087 |
|
3088 |
|
3089 | function useInterval(fn, ms, paused, runImmediately) {
|
3090 | if (paused === void 0) {
|
3091 | paused = false;
|
3092 | }
|
3093 | if (runImmediately === void 0) {
|
3094 | runImmediately = false;
|
3095 | }
|
3096 | var handle;
|
3097 | var fnRef = useCommittedRef(fn);
|
3098 |
|
3099 |
|
3100 | var pausedRef = useCommittedRef(paused);
|
3101 | var tick = function tick() {
|
3102 | if (pausedRef.current) return;
|
3103 | fnRef.current();
|
3104 | schedule();
|
3105 | };
|
3106 |
|
3107 | var schedule = function schedule() {
|
3108 | clearTimeout(handle);
|
3109 | handle = setTimeout(tick, ms);
|
3110 | };
|
3111 | useEffect(function () {
|
3112 | if (runImmediately) {
|
3113 | tick();
|
3114 | } else {
|
3115 | schedule();
|
3116 | }
|
3117 | return function () {
|
3118 | return clearTimeout(handle);
|
3119 | };
|
3120 | }, [paused, runImmediately]);
|
3121 | }
|
3122 | const esm_useInterval = (( null && (useInterval)));
|
3123 | ;
|
3124 |
|
3125 |
|
3126 | function useRafInterval(fn, ms, paused) {
|
3127 | if (paused === void 0) {
|
3128 | paused = false;
|
3129 | }
|
3130 | var handle;
|
3131 | var start = new Date().getTime();
|
3132 | var fnRef = useCommittedRef(fn);
|
3133 |
|
3134 |
|
3135 | var pausedRef = useCommittedRef(paused);
|
3136 | function loop() {
|
3137 | var current = new Date().getTime();
|
3138 | var delta = current - start;
|
3139 | if (pausedRef.current) return;
|
3140 | if (delta >= ms && fnRef.current) {
|
3141 | fnRef.current();
|
3142 | start = new Date().getTime();
|
3143 | }
|
3144 | cancelAnimationFrame(handle);
|
3145 | handle = requestAnimationFrame(loop);
|
3146 | }
|
3147 | useEffect(function () {
|
3148 | handle = requestAnimationFrame(loop);
|
3149 | return function () {
|
3150 | return cancelAnimationFrame(handle);
|
3151 | };
|
3152 | }, []);
|
3153 | }
|
3154 | const esm_useRafInterval = (( null && (useRafInterval)));
|
3155 | ;
|
3156 | function useMergeState_extends() {
|
3157 | useMergeState_extends = Object.assign || function (target) {
|
3158 | for (var i = 1; i < arguments.length; i++) {
|
3159 | var source = arguments[i];
|
3160 | for (var key in source) {
|
3161 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
3162 | target[key] = source[key];
|
3163 | }
|
3164 | }
|
3165 | }
|
3166 | return target;
|
3167 | };
|
3168 | return useMergeState_extends.apply(this, arguments);
|
3169 | }
|
3170 |
|
3171 |
|
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 | function useMergeState_useMergeState(initialState) {
|
3188 | var _useState = useState(initialState),
|
3189 | state = _useState[0],
|
3190 | setState = _useState[1];
|
3191 | var updater = useCallback(function (update) {
|
3192 | if (update === null) return;
|
3193 | if (typeof update === 'function') {
|
3194 | setState(function (state) {
|
3195 | var nextState = update(state);
|
3196 | return nextState == null ? state : useMergeState_extends({}, state, nextState);
|
3197 | });
|
3198 | } else {
|
3199 | setState(function (state) {
|
3200 | return useMergeState_extends({}, state, update);
|
3201 | });
|
3202 | }
|
3203 | }, [setState]);
|
3204 | return [state, updater];
|
3205 | }
|
3206 | ;
|
3207 |
|
3208 | function useMergeStateFromProps(props, gDSFP, initialState) {
|
3209 | var _useMergeState = useMergeState(initialState),
|
3210 | state = _useMergeState[0],
|
3211 | setState = _useMergeState[1];
|
3212 | var nextState = gDSFP(props, state);
|
3213 | if (nextState !== null) setState(nextState);
|
3214 | return [state, setState];
|
3215 | }
|
3216 | ;
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 |
|
3224 |
|
3225 |
|
3226 |
|
3227 |
|
3228 |
|
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 | function useMounted() {
|
3240 | var mounted = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(true);
|
3241 | var isMounted = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(function () {
|
3242 | return mounted.current;
|
3243 | });
|
3244 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
3245 | mounted.current = true;
|
3246 | return function () {
|
3247 | mounted.current = false;
|
3248 | };
|
3249 | }, []);
|
3250 | return isMounted.current;
|
3251 | }
|
3252 | ;
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 |
|
3264 |
|
3265 |
|
3266 |
|
3267 |
|
3268 |
|
3269 |
|
3270 |
|
3271 |
|
3272 | function usePrevious(value) {
|
3273 | var ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
3274 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
3275 | ref.current = value;
|
3276 | });
|
3277 | return ref.current;
|
3278 | }
|
3279 | ;
|
3280 |
|
3281 |
|
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 |
|
3290 |
|
3291 |
|
3292 |
|
3293 |
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 |
|
3299 |
|
3300 |
|
3301 |
|
3302 |
|
3303 |
|
3304 |
|
3305 |
|
3306 |
|
3307 | function useImage(imageOrUrl, crossOrigin) {
|
3308 | var _useState = useState({
|
3309 | image: null,
|
3310 | error: null
|
3311 | }),
|
3312 | state = _useState[0],
|
3313 | setState = _useState[1];
|
3314 | useEffect(function () {
|
3315 | if (!imageOrUrl) return undefined;
|
3316 | var image;
|
3317 | if (typeof imageOrUrl === 'string') {
|
3318 | image = new Image();
|
3319 | if (crossOrigin) image.crossOrigin = crossOrigin;
|
3320 | image.src = imageOrUrl;
|
3321 | } else {
|
3322 | image = imageOrUrl;
|
3323 | if (image.complete && image.naturalHeight > 0) {
|
3324 | setState({
|
3325 | image: image,
|
3326 | error: null
|
3327 | });
|
3328 | return;
|
3329 | }
|
3330 | }
|
3331 | function onLoad() {
|
3332 | setState({
|
3333 | image: image,
|
3334 | error: null
|
3335 | });
|
3336 | }
|
3337 | function onError(error) {
|
3338 | setState({
|
3339 | image: image,
|
3340 | error: error
|
3341 | });
|
3342 | }
|
3343 | image.addEventListener('load', onLoad);
|
3344 | image.addEventListener('error', onError);
|
3345 | return function () {
|
3346 | image.removeEventListener('load', onLoad);
|
3347 | image.removeEventListener('error', onError);
|
3348 | };
|
3349 | }, [imageOrUrl, crossOrigin]);
|
3350 | return state;
|
3351 | }
|
3352 | ;
|
3353 |
|
3354 | var isReactNative = typeof __webpack_require__.g !== 'undefined' &&
|
3355 |
|
3356 | __webpack_require__.g.navigator &&
|
3357 |
|
3358 | __webpack_require__.g.navigator.product === 'ReactNative';
|
3359 | var isDOM = typeof document !== 'undefined';
|
3360 |
|
3361 |
|
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 |
|
3367 |
|
3368 |
|
3369 | const useIsomorphicEffect = (isDOM || isReactNative ? external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect : external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect);
|
3370 | ;
|
3371 |
|
3372 |
|
3373 | var targetMap = new WeakMap();
|
3374 | var resizeObserver;
|
3375 | function getResizeObserver() {
|
3376 |
|
3377 | return resizeObserver = resizeObserver || new window.ResizeObserver(function (entries) {
|
3378 | entries.forEach(function (entry) {
|
3379 | var handler = targetMap.get(entry.target);
|
3380 | if (handler) handler(entry.contentRect);
|
3381 | });
|
3382 | });
|
3383 | }
|
3384 |
|
3385 |
|
3386 |
|
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 |
|
3395 |
|
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 |
|
3402 |
|
3403 | function useResizeObserver(element) {
|
3404 | var _useState = useState(null),
|
3405 | rect = _useState[0],
|
3406 | setRect = _useState[1];
|
3407 | useEffect(function () {
|
3408 | if (!element) return;
|
3409 | getResizeObserver().observe(element);
|
3410 | setRect(element.getBoundingClientRect());
|
3411 | targetMap.set(element, function (rect) {
|
3412 | setRect(rect);
|
3413 | });
|
3414 | return function () {
|
3415 | targetMap.delete(element);
|
3416 | };
|
3417 | }, [element]);
|
3418 | return rect;
|
3419 | }
|
3420 | ;
|
3421 |
|
3422 |
|
3423 |
|
3424 |
|
3425 |
|
3426 |
|
3427 |
|
3428 |
|
3429 |
|
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 | var jsx_runtime = __webpack_require__(373);
|
3437 | ;
|
3438 | const _excluded = ["as", "disabled"];
|
3439 | function Button_objectWithoutPropertiesLoose(source, excluded) {
|
3440 | if (source == null) return {};
|
3441 | var target = {};
|
3442 | var sourceKeys = Object.keys(source);
|
3443 | var key, i;
|
3444 | for (i = 0; i < sourceKeys.length; i++) {
|
3445 | key = sourceKeys[i];
|
3446 | if (excluded.indexOf(key) >= 0) continue;
|
3447 | target[key] = source[key];
|
3448 | }
|
3449 | return target;
|
3450 | }
|
3451 |
|
3452 |
|
3453 | function isTrivialHref(href) {
|
3454 | return !href || href.trim() === '#';
|
3455 | }
|
3456 | function useButtonProps({
|
3457 | tagName,
|
3458 | disabled,
|
3459 | href,
|
3460 | target,
|
3461 | rel,
|
3462 | role,
|
3463 | onClick,
|
3464 | tabIndex = 0,
|
3465 | type
|
3466 | }) {
|
3467 | if (!tagName) {
|
3468 | if (href != null || target != null || rel != null) {
|
3469 | tagName = 'a';
|
3470 | } else {
|
3471 | tagName = 'button';
|
3472 | }
|
3473 | }
|
3474 | const meta = {
|
3475 | tagName
|
3476 | };
|
3477 | if (tagName === 'button') {
|
3478 | return [{
|
3479 | type: type || 'button',
|
3480 | disabled
|
3481 | }, meta];
|
3482 | }
|
3483 | const handleClick = event => {
|
3484 | if (disabled || tagName === 'a' && isTrivialHref(href)) {
|
3485 | event.preventDefault();
|
3486 | }
|
3487 | if (disabled) {
|
3488 | event.stopPropagation();
|
3489 | return;
|
3490 | }
|
3491 | onClick == null ? void 0 : onClick(event);
|
3492 | };
|
3493 | const handleKeyDown = event => {
|
3494 | if (event.key === ' ') {
|
3495 | event.preventDefault();
|
3496 | handleClick(event);
|
3497 | }
|
3498 | };
|
3499 | if (tagName === 'a') {
|
3500 |
|
3501 | href || (href = '#');
|
3502 | if (disabled) {
|
3503 | href = undefined;
|
3504 | }
|
3505 | }
|
3506 | return [{
|
3507 | role: role != null ? role : 'button',
|
3508 |
|
3509 |
|
3510 | disabled: undefined,
|
3511 | tabIndex: disabled ? undefined : tabIndex,
|
3512 | href,
|
3513 | target: tagName === 'a' ? target : undefined,
|
3514 | 'aria-disabled': !disabled ? undefined : disabled,
|
3515 | rel: tagName === 'a' ? rel : undefined,
|
3516 | onClick: handleClick,
|
3517 | onKeyDown: handleKeyDown
|
3518 | }, meta];
|
3519 | }
|
3520 | const Button = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_ref, ref) => {
|
3521 | let {
|
3522 | as: asProp,
|
3523 | disabled
|
3524 | } = _ref,
|
3525 | props = Button_objectWithoutPropertiesLoose(_ref, _excluded);
|
3526 | const [buttonProps, {
|
3527 | tagName: Component
|
3528 | }] = useButtonProps(Object.assign({
|
3529 | tagName: asProp,
|
3530 | disabled
|
3531 | }, props));
|
3532 | return (0,jsx_runtime.jsx)(Component, Object.assign({}, props, buttonProps, {
|
3533 | ref: ref
|
3534 | }));
|
3535 | });
|
3536 | Button.displayName = 'Button';
|
3537 | const esm_Button = (Button);
|
3538 | ;
|
3539 | const Anchor_excluded = ["onKeyDown"];
|
3540 | function Anchor_objectWithoutPropertiesLoose(source, excluded) {
|
3541 | if (source == null) return {};
|
3542 | var target = {};
|
3543 | var sourceKeys = Object.keys(source);
|
3544 | var key, i;
|
3545 | for (i = 0; i < sourceKeys.length; i++) {
|
3546 | key = sourceKeys[i];
|
3547 | if (excluded.indexOf(key) >= 0) continue;
|
3548 | target[key] = source[key];
|
3549 | }
|
3550 | return target;
|
3551 | }
|
3552 |
|
3553 |
|
3554 |
|
3555 |
|
3556 |
|
3557 |
|
3558 |
|
3559 | function Anchor_isTrivialHref(href) {
|
3560 | return !href || href.trim() === '#';
|
3561 | }
|
3562 |
|
3563 |
|
3564 |
|
3565 |
|
3566 | const Anchor = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_ref, ref) => {
|
3567 | let {
|
3568 | onKeyDown
|
3569 | } = _ref,
|
3570 | props = Anchor_objectWithoutPropertiesLoose(_ref, Anchor_excluded);
|
3571 | const [buttonProps] = useButtonProps(Object.assign({
|
3572 | tagName: 'a'
|
3573 | }, props));
|
3574 | const handleKeyDown = useEventCallback(e => {
|
3575 | buttonProps.onKeyDown(e);
|
3576 | onKeyDown == null ? void 0 : onKeyDown(e);
|
3577 | });
|
3578 | if (Anchor_isTrivialHref(props.href) || props.role === 'button') {
|
3579 | return (0,jsx_runtime.jsx)("a", Object.assign({
|
3580 | ref: ref
|
3581 | }, props, buttonProps, {
|
3582 | onKeyDown: handleKeyDown
|
3583 | }));
|
3584 | }
|
3585 | return (0,jsx_runtime.jsx)("a", Object.assign({
|
3586 | ref: ref
|
3587 | }, props, {
|
3588 | onKeyDown: onKeyDown
|
3589 | }));
|
3590 | });
|
3591 | Anchor.displayName = 'Anchor';
|
3592 | const esm_Anchor = (Anchor);
|
3593 | ;
|
3594 | var AlertLink_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/AlertLink.tsx";
|
3595 |
|
3596 |
|
3597 |
|
3598 |
|
3599 |
|
3600 | const AlertLink = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
3601 | className,
|
3602 | bsPrefix,
|
3603 | as: Component = esm_Anchor,
|
3604 | ...props
|
3605 | }, ref) => {
|
3606 | bsPrefix = useBootstrapPrefix(bsPrefix, 'alert-link');
|
3607 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
3608 | ref: ref,
|
3609 | className: classnames_default()(className, bsPrefix),
|
3610 | ...props
|
3611 | }, void 0, false, {
|
3612 | fileName: AlertLink_jsxFileName,
|
3613 | lineNumber: 16,
|
3614 | columnNumber: 9
|
3615 | }, undefined);
|
3616 | });
|
3617 | AlertLink.displayName = 'AlertLink';
|
3618 | const src_AlertLink = (AlertLink);
|
3619 | ;
|
3620 | var Fade_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Fade.tsx";
|
3621 |
|
3622 |
|
3623 |
|
3624 |
|
3625 |
|
3626 |
|
3627 |
|
3628 |
|
3629 |
|
3630 | const Fade_propTypes = {
|
3631 | |
3632 |
|
3633 |
|
3634 | in: (prop_types_default()).bool,
|
3635 | |
3636 |
|
3637 |
|
3638 | mountOnEnter: (prop_types_default()).bool,
|
3639 | |
3640 |
|
3641 |
|
3642 | unmountOnExit: (prop_types_default()).bool,
|
3643 | |
3644 |
|
3645 |
|
3646 |
|
3647 | appear: (prop_types_default()).bool,
|
3648 | |
3649 |
|
3650 |
|
3651 |
|
3652 |
|
3653 | timeout: (prop_types_default()).number,
|
3654 | |
3655 |
|
3656 |
|
3657 | onEnter: (prop_types_default()).func,
|
3658 | |
3659 |
|
3660 |
|
3661 | onEntering: (prop_types_default()).func,
|
3662 | |
3663 |
|
3664 |
|
3665 | onEntered: (prop_types_default()).func,
|
3666 | |
3667 |
|
3668 |
|
3669 | onExit: (prop_types_default()).func,
|
3670 | |
3671 |
|
3672 |
|
3673 | onExiting: (prop_types_default()).func,
|
3674 | |
3675 |
|
3676 |
|
3677 | onExited: (prop_types_default()).func,
|
3678 | |
3679 |
|
3680 |
|
3681 | children: (prop_types_default()).element.isRequired,
|
3682 | |
3683 |
|
3684 |
|
3685 |
|
3686 | transitionClasses: (prop_types_default()).object
|
3687 | };
|
3688 | const fadeStyles = {
|
3689 | [ENTERING]: 'show',
|
3690 | [ENTERED]: 'show'
|
3691 | };
|
3692 | const Fade = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
3693 | className,
|
3694 | children,
|
3695 | transitionClasses = {},
|
3696 | onEnter,
|
3697 | ...rest
|
3698 | }, ref) => {
|
3699 | const props = {
|
3700 | in: false,
|
3701 | timeout: 300,
|
3702 | mountOnEnter: false,
|
3703 | unmountOnExit: false,
|
3704 | appear: false,
|
3705 | ...rest
|
3706 | };
|
3707 | const handleEnter = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, isAppearing) => {
|
3708 | triggerBrowserReflow(node);
|
3709 | onEnter == null ? void 0 : onEnter(node, isAppearing);
|
3710 | }, [onEnter]);
|
3711 | return (0,jsx_dev_runtime.jsxDEV)(src_TransitionWrapper, {
|
3712 | ref: ref,
|
3713 | addEndListener: transitionEndListener,
|
3714 | ...props,
|
3715 | onEnter: handleEnter,
|
3716 | childRef: children.ref,
|
3717 | children: (status, innerProps) => external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(children, {
|
3718 | ...innerProps,
|
3719 | className: classnames_default()('fade', className, children.props.className, fadeStyles[status], transitionClasses[status])
|
3720 | })
|
3721 | }, void 0, false, {
|
3722 | fileName: Fade_jsxFileName,
|
3723 | lineNumber: 117,
|
3724 | columnNumber: 7
|
3725 | }, undefined);
|
3726 | });
|
3727 | Fade.propTypes = Fade_propTypes;
|
3728 | Fade.displayName = 'Fade';
|
3729 | const src_Fade = (Fade);
|
3730 | ;
|
3731 | var CloseButton_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CloseButton.tsx";
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 | const CloseButton_propTypes = {
|
3737 |
|
3738 | 'aria-label': (prop_types_default()).string,
|
3739 |
|
3740 | onClick: (prop_types_default()).func,
|
3741 | |
3742 |
|
3743 |
|
3744 |
|
3745 |
|
3746 | variant: prop_types_default().oneOf(['white'])
|
3747 | };
|
3748 | const CloseButton = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
3749 | className,
|
3750 | variant,
|
3751 | 'aria-label': ariaLabel = 'Close',
|
3752 | ...props
|
3753 | }, ref) => (0,jsx_dev_runtime.jsxDEV)("button", {
|
3754 | ref: ref,
|
3755 | type: "button",
|
3756 | className: classnames_default()('btn-close', variant && `btn-close-${variant}`, className),
|
3757 | "aria-label": ariaLabel,
|
3758 | ...props
|
3759 | }, void 0, false, {
|
3760 | fileName: CloseButton_jsxFileName,
|
3761 | lineNumber: 32,
|
3762 | columnNumber: 5
|
3763 | }, undefined));
|
3764 | CloseButton.displayName = 'CloseButton';
|
3765 | CloseButton.propTypes = CloseButton_propTypes;
|
3766 | const src_CloseButton = (CloseButton);
|
3767 | ;
|
3768 | var Alert_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Alert.tsx";
|
3769 |
|
3770 |
|
3771 |
|
3772 |
|
3773 |
|
3774 |
|
3775 |
|
3776 |
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 | const Alert_propTypes = {
|
3782 | |
3783 |
|
3784 |
|
3785 | bsPrefix: (prop_types_default()).string,
|
3786 | |
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 | variant: (prop_types_default()).string,
|
3792 | |
3793 |
|
3794 |
|
3795 |
|
3796 | dismissible: (prop_types_default()).bool,
|
3797 | |
3798 |
|
3799 |
|
3800 |
|
3801 |
|
3802 | show: (prop_types_default()).bool,
|
3803 | |
3804 |
|
3805 |
|
3806 |
|
3807 |
|
3808 | onClose: (prop_types_default()).func,
|
3809 | |
3810 |
|
3811 |
|
3812 | closeLabel: (prop_types_default()).string,
|
3813 | |
3814 |
|
3815 |
|
3816 | closeVariant: prop_types_default().oneOf(['white']),
|
3817 | |
3818 |
|
3819 |
|
3820 |
|
3821 |
|
3822 | transition: prop_types_default().oneOfType([(prop_types_default()).bool, lib.nm])
|
3823 | };
|
3824 | const Alert = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((uncontrolledProps, ref) => {
|
3825 | const {
|
3826 | bsPrefix,
|
3827 | show = true,
|
3828 | closeLabel = 'Close alert',
|
3829 | closeVariant,
|
3830 | className,
|
3831 | children,
|
3832 | variant = 'primary',
|
3833 | onClose,
|
3834 | dismissible,
|
3835 | transition = src_Fade,
|
3836 | ...props
|
3837 | } = useUncontrolled(uncontrolledProps, {
|
3838 | show: 'onClose'
|
3839 | });
|
3840 | const prefix = useBootstrapPrefix(bsPrefix, 'alert');
|
3841 | const handleClose = useEventCallback(e => {
|
3842 | if (onClose) {
|
3843 | onClose(false, e);
|
3844 | }
|
3845 | });
|
3846 | const Transition = transition === true ? src_Fade : transition;
|
3847 | const alert = (0,jsx_dev_runtime.jsxDEV)("div", {
|
3848 | role: "alert",
|
3849 | ...(!Transition ? props : undefined),
|
3850 | ref: ref,
|
3851 | className: classnames_default()(className, prefix, variant && `${prefix}-${variant}`, dismissible && `${prefix}-dismissible`),
|
3852 | children: [dismissible && (0,jsx_dev_runtime.jsxDEV)(src_CloseButton, {
|
3853 | onClick: handleClose,
|
3854 | "aria-label": closeLabel,
|
3855 | variant: closeVariant
|
3856 | }, void 0, false, {
|
3857 | fileName: Alert_jsxFileName,
|
3858 | lineNumber: 115,
|
3859 | columnNumber: 11
|
3860 | }, undefined), children]
|
3861 | }, void 0, true, {
|
3862 | fileName: Alert_jsxFileName,
|
3863 | lineNumber: 103,
|
3864 | columnNumber: 7
|
3865 | }, undefined);
|
3866 | if (!Transition) return show ? alert : null;
|
3867 | return (0,jsx_dev_runtime.jsxDEV)(Transition, {
|
3868 | unmountOnExit: true,
|
3869 | ...props,
|
3870 | ref: undefined,
|
3871 | in: show,
|
3872 | children: alert
|
3873 | }, void 0, false, {
|
3874 | fileName: Alert_jsxFileName,
|
3875 | lineNumber: 128,
|
3876 | columnNumber: 7
|
3877 | }, undefined);
|
3878 | });
|
3879 | Alert.displayName = 'Alert';
|
3880 | Alert.propTypes = Alert_propTypes;
|
3881 | const src_Alert = (Object.assign(Alert, {
|
3882 | Link: src_AlertLink,
|
3883 | Heading: src_AlertHeading
|
3884 | }));
|
3885 | ;
|
3886 |
|
3887 | const src_Anchor = (esm_Anchor);
|
3888 | ;
|
3889 | var Badge_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Badge.tsx";
|
3890 |
|
3891 |
|
3892 |
|
3893 |
|
3894 |
|
3895 | const Badge_propTypes = {
|
3896 |
|
3897 | bsPrefix: (prop_types_default()).string,
|
3898 | |
3899 |
|
3900 |
|
3901 |
|
3902 |
|
3903 | bg: (prop_types_default()).string,
|
3904 | |
3905 |
|
3906 |
|
3907 |
|
3908 | pill: (prop_types_default()).bool,
|
3909 | |
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 | text: (prop_types_default()).string,
|
3915 |
|
3916 | as: (prop_types_default()).elementType
|
3917 | };
|
3918 | const Badge = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
3919 | bsPrefix,
|
3920 | bg = 'primary',
|
3921 | pill = false,
|
3922 | text,
|
3923 | className,
|
3924 | as: Component = 'span',
|
3925 | ...props
|
3926 | }, ref) => {
|
3927 | const prefix = useBootstrapPrefix(bsPrefix, 'badge');
|
3928 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
3929 | ref: ref,
|
3930 | ...props,
|
3931 | className: classnames_default()(className, prefix, pill && `rounded-pill`, text && `text-${text}`, bg && `bg-${bg}`)
|
3932 | }, void 0, false, {
|
3933 | fileName: Badge_jsxFileName,
|
3934 | lineNumber: 61,
|
3935 | columnNumber: 9
|
3936 | }, undefined);
|
3937 | });
|
3938 | Badge.displayName = 'Badge';
|
3939 | Badge.propTypes = Badge_propTypes;
|
3940 | const src_Badge = (Badge);
|
3941 | ;
|
3942 | var BreadcrumbItem_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/BreadcrumbItem.tsx";
|
3943 |
|
3944 |
|
3945 |
|
3946 |
|
3947 |
|
3948 |
|
3949 | const BreadcrumbItem_propTypes = {
|
3950 | |
3951 |
|
3952 |
|
3953 | bsPrefix: (prop_types_default()).string,
|
3954 | |
3955 |
|
3956 |
|
3957 |
|
3958 | active: (prop_types_default()).bool,
|
3959 | |
3960 |
|
3961 |
|
3962 | href: (prop_types_default()).string,
|
3963 | |
3964 |
|
3965 |
|
3966 | linkAs: (prop_types_default()).elementType,
|
3967 | |
3968 |
|
3969 |
|
3970 | title: (prop_types_default()).node,
|
3971 | |
3972 |
|
3973 |
|
3974 | target: (prop_types_default()).string,
|
3975 | |
3976 |
|
3977 |
|
3978 | linkProps: (prop_types_default()).object,
|
3979 | as: (prop_types_default()).elementType
|
3980 | };
|
3981 | const BreadcrumbItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
3982 | bsPrefix,
|
3983 | active = false,
|
3984 | children,
|
3985 | className,
|
3986 |
|
3987 | as: Component = 'li',
|
3988 | linkAs: LinkComponent = esm_Anchor,
|
3989 | linkProps = {},
|
3990 | href,
|
3991 | title,
|
3992 | target,
|
3993 | ...props
|
3994 | }, ref) => {
|
3995 | const prefix = useBootstrapPrefix(bsPrefix, 'breadcrumb-item');
|
3996 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
3997 | ref: ref,
|
3998 | ...props,
|
3999 | className: classnames_default()(prefix, className, {
|
4000 | active
|
4001 | }),
|
4002 | "aria-current": active ? 'page' : undefined,
|
4003 | children: active ? children : (0,jsx_dev_runtime.jsxDEV)(LinkComponent, {
|
4004 | ...linkProps,
|
4005 | href: href,
|
4006 | title: title,
|
4007 | target: target,
|
4008 | children: children
|
4009 | }, void 0, false, {
|
4010 | fileName: BreadcrumbItem_jsxFileName,
|
4011 | lineNumber: 86,
|
4012 | columnNumber: 11
|
4013 | }, undefined)
|
4014 | }, void 0, false, {
|
4015 | fileName: BreadcrumbItem_jsxFileName,
|
4016 | lineNumber: 77,
|
4017 | columnNumber: 7
|
4018 | }, undefined);
|
4019 | });
|
4020 | BreadcrumbItem.displayName = 'BreadcrumbItem';
|
4021 | BreadcrumbItem.propTypes = BreadcrumbItem_propTypes;
|
4022 | const src_BreadcrumbItem = (BreadcrumbItem);
|
4023 | ;
|
4024 | var Breadcrumb_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Breadcrumb.tsx";
|
4025 |
|
4026 |
|
4027 |
|
4028 |
|
4029 |
|
4030 |
|
4031 | const Breadcrumb_propTypes = {
|
4032 | |
4033 |
|
4034 |
|
4035 | bsPrefix: (prop_types_default()).string,
|
4036 | |
4037 |
|
4038 |
|
4039 |
|
4040 | label: (prop_types_default()).string,
|
4041 | |
4042 |
|
4043 |
|
4044 | listProps: (prop_types_default()).object,
|
4045 | as: (prop_types_default()).elementType
|
4046 | };
|
4047 | const Breadcrumb = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4048 | bsPrefix,
|
4049 | className,
|
4050 | listProps = {},
|
4051 | children,
|
4052 | label = 'breadcrumb',
|
4053 |
|
4054 | as: Component = 'nav',
|
4055 | ...props
|
4056 | }, ref) => {
|
4057 | const prefix = useBootstrapPrefix(bsPrefix, 'breadcrumb');
|
4058 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4059 | "aria-label": label,
|
4060 | className: className,
|
4061 | ref: ref,
|
4062 | ...props,
|
4063 | children: (0,jsx_dev_runtime.jsxDEV)("ol", {
|
4064 | ...listProps,
|
4065 | className: classnames_default()(prefix, listProps == null ? void 0 : listProps.className),
|
4066 | children: children
|
4067 | }, void 0, false, {
|
4068 | fileName: Breadcrumb_jsxFileName,
|
4069 | lineNumber: 60,
|
4070 | columnNumber: 11
|
4071 | }, undefined)
|
4072 | }, void 0, false, {
|
4073 | fileName: Breadcrumb_jsxFileName,
|
4074 | lineNumber: 54,
|
4075 | columnNumber: 9
|
4076 | }, undefined);
|
4077 | });
|
4078 | Breadcrumb.displayName = 'Breadcrumb';
|
4079 | Breadcrumb.propTypes = Breadcrumb_propTypes;
|
4080 | const src_Breadcrumb = (Object.assign(Breadcrumb, {
|
4081 | Item: src_BreadcrumbItem
|
4082 | }));
|
4083 | ;
|
4084 | var Button_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Button.tsx";
|
4085 |
|
4086 |
|
4087 |
|
4088 |
|
4089 |
|
4090 |
|
4091 | const Button_propTypes = {
|
4092 | |
4093 |
|
4094 |
|
4095 | bsPrefix: (prop_types_default()).string,
|
4096 | |
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 |
|
4102 |
|
4103 |
|
4104 |
|
4105 |
|
4106 |
|
4107 | variant: (prop_types_default()).string,
|
4108 | |
4109 |
|
4110 |
|
4111 | onClick: (prop_types_default()).func,
|
4112 | |
4113 |
|
4114 |
|
4115 |
|
4116 |
|
4117 | size: (prop_types_default()).string,
|
4118 |
|
4119 | active: (prop_types_default()).bool,
|
4120 | |
4121 |
|
4122 |
|
4123 |
|
4124 | disabled: (prop_types_default()).bool,
|
4125 |
|
4126 | href: (prop_types_default()).string,
|
4127 | |
4128 |
|
4129 |
|
4130 |
|
4131 |
|
4132 | type: prop_types_default().oneOf(['button', 'reset', 'submit', null]),
|
4133 | as: (prop_types_default()).elementType
|
4134 | };
|
4135 | const Button_Button = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4136 | as,
|
4137 | bsPrefix,
|
4138 | variant = 'primary',
|
4139 | size,
|
4140 | active = false,
|
4141 | disabled = false,
|
4142 | className,
|
4143 | ...props
|
4144 | }, ref) => {
|
4145 | const prefix = useBootstrapPrefix(bsPrefix, 'btn');
|
4146 | const [buttonProps, {
|
4147 | tagName
|
4148 | }] = useButtonProps({
|
4149 | tagName: as,
|
4150 | disabled,
|
4151 | ...props
|
4152 | });
|
4153 | const Component = tagName;
|
4154 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4155 | ...buttonProps,
|
4156 | ...props,
|
4157 | ref: ref,
|
4158 | disabled: disabled,
|
4159 | className: classnames_default()(className, prefix, active && 'active', variant && `${prefix}-${variant}`, size && `${prefix}-${size}`, props.href && disabled && 'disabled')
|
4160 | }, void 0, false, {
|
4161 | fileName: Button_jsxFileName,
|
4162 | lineNumber: 100,
|
4163 | columnNumber: 9
|
4164 | }, undefined);
|
4165 | });
|
4166 | Button_Button.displayName = 'Button';
|
4167 | Button_Button.propTypes = Button_propTypes;
|
4168 | const src_Button = (Button_Button);
|
4169 | ;
|
4170 | var ButtonGroup_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ButtonGroup.tsx";
|
4171 |
|
4172 |
|
4173 |
|
4174 |
|
4175 |
|
4176 | const ButtonGroup_propTypes = {
|
4177 | |
4178 |
|
4179 |
|
4180 | bsPrefix: (prop_types_default()).string,
|
4181 | |
4182 |
|
4183 |
|
4184 |
|
4185 |
|
4186 | size: (prop_types_default()).string,
|
4187 |
|
4188 | vertical: (prop_types_default()).bool,
|
4189 | |
4190 |
|
4191 |
|
4192 |
|
4193 |
|
4194 | role: (prop_types_default()).string,
|
4195 | as: (prop_types_default()).elementType
|
4196 | };
|
4197 | const ButtonGroup = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4198 | bsPrefix,
|
4199 | size,
|
4200 | vertical = false,
|
4201 | className,
|
4202 | role = 'group',
|
4203 |
|
4204 | as: Component = 'div',
|
4205 | ...rest
|
4206 | }, ref) => {
|
4207 | const prefix = useBootstrapPrefix(bsPrefix, 'btn-group');
|
4208 | let baseClass = prefix;
|
4209 | if (vertical) baseClass = `${prefix}-vertical`;
|
4210 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4211 | ...rest,
|
4212 | ref: ref,
|
4213 | role: role,
|
4214 | className: classnames_default()(className, baseClass, size && `${prefix}-${size}`)
|
4215 | }, void 0, false, {
|
4216 | fileName: ButtonGroup_jsxFileName,
|
4217 | lineNumber: 62,
|
4218 | columnNumber: 9
|
4219 | }, undefined);
|
4220 | });
|
4221 | ButtonGroup.displayName = 'ButtonGroup';
|
4222 | ButtonGroup.propTypes = ButtonGroup_propTypes;
|
4223 | const src_ButtonGroup = (ButtonGroup);
|
4224 | ;
|
4225 | var ButtonToolbar_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ButtonToolbar.tsx";
|
4226 |
|
4227 |
|
4228 |
|
4229 |
|
4230 |
|
4231 | const ButtonToolbar_propTypes = {
|
4232 | |
4233 |
|
4234 |
|
4235 | bsPrefix: (prop_types_default()).string,
|
4236 | |
4237 |
|
4238 |
|
4239 |
|
4240 |
|
4241 | role: (prop_types_default()).string
|
4242 | };
|
4243 | const ButtonToolbar = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4244 | bsPrefix,
|
4245 | className,
|
4246 | role = 'toolbar',
|
4247 | ...props
|
4248 | }, ref) => {
|
4249 | const prefix = useBootstrapPrefix(bsPrefix, 'btn-toolbar');
|
4250 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
4251 | ...props,
|
4252 | ref: ref,
|
4253 | className: classnames_default()(className, prefix),
|
4254 | role: role
|
4255 | }, void 0, false, {
|
4256 | fileName: ButtonToolbar_jsxFileName,
|
4257 | lineNumber: 32,
|
4258 | columnNumber: 7
|
4259 | }, undefined);
|
4260 | });
|
4261 | ButtonToolbar.displayName = 'ButtonToolbar';
|
4262 | ButtonToolbar.propTypes = ButtonToolbar_propTypes;
|
4263 | const src_ButtonToolbar = (ButtonToolbar);
|
4264 | ;
|
4265 | var CardBody_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardBody.tsx";
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 | const CardBody = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4271 | className,
|
4272 | bsPrefix,
|
4273 | as: Component = 'div',
|
4274 | ...props
|
4275 | }, ref) => {
|
4276 | bsPrefix = useBootstrapPrefix(bsPrefix, 'card-body');
|
4277 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4278 | ref: ref,
|
4279 | className: classnames_default()(className, bsPrefix),
|
4280 | ...props
|
4281 | }, void 0, false, {
|
4282 | fileName: CardBody_jsxFileName,
|
4283 | lineNumber: 15,
|
4284 | columnNumber: 9
|
4285 | }, undefined);
|
4286 | });
|
4287 | CardBody.displayName = 'CardBody';
|
4288 | const src_CardBody = (CardBody);
|
4289 | ;
|
4290 | var CardFooter_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardFooter.tsx";
|
4291 |
|
4292 |
|
4293 |
|
4294 |
|
4295 | const CardFooter = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4296 | className,
|
4297 | bsPrefix,
|
4298 | as: Component = 'div',
|
4299 | ...props
|
4300 | }, ref) => {
|
4301 | bsPrefix = useBootstrapPrefix(bsPrefix, 'card-footer');
|
4302 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4303 | ref: ref,
|
4304 | className: classnames_default()(className, bsPrefix),
|
4305 | ...props
|
4306 | }, void 0, false, {
|
4307 | fileName: CardFooter_jsxFileName,
|
4308 | lineNumber: 15,
|
4309 | columnNumber: 9
|
4310 | }, undefined);
|
4311 | });
|
4312 | CardFooter.displayName = 'CardFooter';
|
4313 | const src_CardFooter = (CardFooter);
|
4314 | ;
|
4315 |
|
4316 | const CardHeaderContext_context = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
|
4317 | CardHeaderContext_context.displayName = 'CardHeaderContext';
|
4318 | const CardHeaderContext = (CardHeaderContext_context);
|
4319 | ;
|
4320 | var CardHeader_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardHeader.tsx";
|
4321 |
|
4322 |
|
4323 |
|
4324 |
|
4325 |
|
4326 |
|
4327 |
|
4328 | const CardHeader_propTypes = {
|
4329 | |
4330 |
|
4331 |
|
4332 | bsPrefix: (prop_types_default()).string,
|
4333 | as: (prop_types_default()).elementType
|
4334 | };
|
4335 | const CardHeader = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4336 | bsPrefix,
|
4337 | className,
|
4338 |
|
4339 | as: Component = 'div',
|
4340 | ...props
|
4341 | }, ref) => {
|
4342 | const prefix = useBootstrapPrefix(bsPrefix, 'card-header');
|
4343 | const contextValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
4344 | cardHeaderBsPrefix: prefix
|
4345 | }), [prefix]);
|
4346 | return (0,jsx_dev_runtime.jsxDEV)(CardHeaderContext.Provider, {
|
4347 | value: contextValue,
|
4348 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4349 | ref: ref,
|
4350 | ...props,
|
4351 | className: classnames_default()(className, prefix)
|
4352 | }, void 0, false, {
|
4353 | fileName: CardHeader_jsxFileName,
|
4354 | lineNumber: 45,
|
4355 | columnNumber: 11
|
4356 | }, undefined)
|
4357 | }, void 0, false, {
|
4358 | fileName: CardHeader_jsxFileName,
|
4359 | lineNumber: 44,
|
4360 | columnNumber: 9
|
4361 | }, undefined);
|
4362 | });
|
4363 | CardHeader.displayName = 'CardHeader';
|
4364 | CardHeader.propTypes = CardHeader_propTypes;
|
4365 | const src_CardHeader = (CardHeader);
|
4366 | ;
|
4367 | var CardImg_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardImg.tsx";
|
4368 |
|
4369 |
|
4370 |
|
4371 |
|
4372 |
|
4373 | const CardImg_propTypes = {
|
4374 | |
4375 |
|
4376 |
|
4377 | bsPrefix: (prop_types_default()).string,
|
4378 | |
4379 |
|
4380 |
|
4381 |
|
4382 |
|
4383 |
|
4384 | variant: prop_types_default().oneOf(['top', 'bottom']),
|
4385 | as: (prop_types_default()).elementType
|
4386 | };
|
4387 | const CardImg = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(
|
4388 |
|
4389 | ({
|
4390 | bsPrefix,
|
4391 | className,
|
4392 | variant,
|
4393 | as: Component = 'img',
|
4394 | ...props
|
4395 | }, ref) => {
|
4396 | const prefix = useBootstrapPrefix(bsPrefix, 'card-img');
|
4397 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4398 | ref: ref,
|
4399 | className: classnames_default()(variant ? `${prefix}-${variant}` : prefix, className),
|
4400 | ...props
|
4401 | }, void 0, false, {
|
4402 | fileName: CardImg_jsxFileName,
|
4403 | lineNumber: 47,
|
4404 | columnNumber: 9
|
4405 | }, undefined);
|
4406 | });
|
4407 | CardImg.displayName = 'CardImg';
|
4408 | CardImg.propTypes = CardImg_propTypes;
|
4409 | const src_CardImg = (CardImg);
|
4410 | ;
|
4411 | var CardImgOverlay_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardImgOverlay.tsx";
|
4412 |
|
4413 |
|
4414 |
|
4415 |
|
4416 | const CardImgOverlay = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4417 | className,
|
4418 | bsPrefix,
|
4419 | as: Component = 'div',
|
4420 | ...props
|
4421 | }, ref) => {
|
4422 | bsPrefix = useBootstrapPrefix(bsPrefix, 'card-img-overlay');
|
4423 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4424 | ref: ref,
|
4425 | className: classnames_default()(className, bsPrefix),
|
4426 | ...props
|
4427 | }, void 0, false, {
|
4428 | fileName: CardImgOverlay_jsxFileName,
|
4429 | lineNumber: 17,
|
4430 | columnNumber: 7
|
4431 | }, undefined);
|
4432 | });
|
4433 | CardImgOverlay.displayName = 'CardImgOverlay';
|
4434 | const src_CardImgOverlay = (CardImgOverlay);
|
4435 | ;
|
4436 | var CardLink_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardLink.tsx";
|
4437 |
|
4438 |
|
4439 |
|
4440 |
|
4441 | const CardLink = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4442 | className,
|
4443 | bsPrefix,
|
4444 | as: Component = 'a',
|
4445 | ...props
|
4446 | }, ref) => {
|
4447 | bsPrefix = useBootstrapPrefix(bsPrefix, 'card-link');
|
4448 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4449 | ref: ref,
|
4450 | className: classnames_default()(className, bsPrefix),
|
4451 | ...props
|
4452 | }, void 0, false, {
|
4453 | fileName: CardLink_jsxFileName,
|
4454 | lineNumber: 15,
|
4455 | columnNumber: 9
|
4456 | }, undefined);
|
4457 | });
|
4458 | CardLink.displayName = 'CardLink';
|
4459 | const src_CardLink = (CardLink);
|
4460 | ;
|
4461 | var CardSubtitle_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardSubtitle.tsx";
|
4462 |
|
4463 |
|
4464 |
|
4465 |
|
4466 |
|
4467 | const DivStyledAsH6 = divWithClassName('h6');
|
4468 | const CardSubtitle = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4469 | className,
|
4470 | bsPrefix,
|
4471 | as: Component = DivStyledAsH6,
|
4472 | ...props
|
4473 | }, ref) => {
|
4474 | bsPrefix = useBootstrapPrefix(bsPrefix, 'card-subtitle');
|
4475 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4476 | ref: ref,
|
4477 | className: classnames_default()(className, bsPrefix),
|
4478 | ...props
|
4479 | }, void 0, false, {
|
4480 | fileName: CardSubtitle_jsxFileName,
|
4481 | lineNumber: 18,
|
4482 | columnNumber: 9
|
4483 | }, undefined);
|
4484 | });
|
4485 | CardSubtitle.displayName = 'CardSubtitle';
|
4486 | const src_CardSubtitle = (CardSubtitle);
|
4487 | ;
|
4488 | var CardText_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardText.tsx";
|
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 | const CardText = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4494 | className,
|
4495 | bsPrefix,
|
4496 | as: Component = 'p',
|
4497 | ...props
|
4498 | }, ref) => {
|
4499 | bsPrefix = useBootstrapPrefix(bsPrefix, 'card-text');
|
4500 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4501 | ref: ref,
|
4502 | className: classnames_default()(className, bsPrefix),
|
4503 | ...props
|
4504 | }, void 0, false, {
|
4505 | fileName: CardText_jsxFileName,
|
4506 | lineNumber: 15,
|
4507 | columnNumber: 9
|
4508 | }, undefined);
|
4509 | });
|
4510 | CardText.displayName = 'CardText';
|
4511 | const src_CardText = (CardText);
|
4512 | ;
|
4513 | var CardTitle_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardTitle.tsx";
|
4514 |
|
4515 |
|
4516 |
|
4517 |
|
4518 |
|
4519 | const DivStyledAsH5 = divWithClassName('h5');
|
4520 | const CardTitle = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4521 | className,
|
4522 | bsPrefix,
|
4523 | as: Component = DivStyledAsH5,
|
4524 | ...props
|
4525 | }, ref) => {
|
4526 | bsPrefix = useBootstrapPrefix(bsPrefix, 'card-title');
|
4527 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4528 | ref: ref,
|
4529 | className: classnames_default()(className, bsPrefix),
|
4530 | ...props
|
4531 | }, void 0, false, {
|
4532 | fileName: CardTitle_jsxFileName,
|
4533 | lineNumber: 18,
|
4534 | columnNumber: 9
|
4535 | }, undefined);
|
4536 | });
|
4537 | CardTitle.displayName = 'CardTitle';
|
4538 | const src_CardTitle = (CardTitle);
|
4539 | ;
|
4540 | var Card_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Card.tsx";
|
4541 |
|
4542 |
|
4543 |
|
4544 |
|
4545 |
|
4546 |
|
4547 |
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 |
|
4553 |
|
4554 |
|
4555 | const Card_propTypes = {
|
4556 | |
4557 |
|
4558 |
|
4559 | bsPrefix: (prop_types_default()).string,
|
4560 | |
4561 |
|
4562 |
|
4563 |
|
4564 |
|
4565 | bg: (prop_types_default()).string,
|
4566 | |
4567 |
|
4568 |
|
4569 |
|
4570 |
|
4571 | text: (prop_types_default()).string,
|
4572 | |
4573 |
|
4574 |
|
4575 |
|
4576 |
|
4577 | border: (prop_types_default()).string,
|
4578 | |
4579 |
|
4580 |
|
4581 |
|
4582 | body: (prop_types_default()).bool,
|
4583 | as: (prop_types_default()).elementType
|
4584 | };
|
4585 | const Card = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4586 | bsPrefix,
|
4587 | className,
|
4588 | bg,
|
4589 | text,
|
4590 | border,
|
4591 | body = false,
|
4592 | children,
|
4593 |
|
4594 | as: Component = 'div',
|
4595 | ...props
|
4596 | }, ref) => {
|
4597 | const prefix = useBootstrapPrefix(bsPrefix, 'card');
|
4598 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4599 | ref: ref,
|
4600 | ...props,
|
4601 | className: classnames_default()(className, prefix, bg && `bg-${bg}`, text && `text-${text}`, border && `border-${border}`),
|
4602 | children: body ? (0,jsx_dev_runtime.jsxDEV)(src_CardBody, {
|
4603 | children: children
|
4604 | }, void 0, false, {
|
4605 | fileName: Card_jsxFileName,
|
4606 | lineNumber: 96,
|
4607 | columnNumber: 17
|
4608 | }, undefined) : children
|
4609 | }, void 0, false, {
|
4610 | fileName: Card_jsxFileName,
|
4611 | lineNumber: 85,
|
4612 | columnNumber: 7
|
4613 | }, undefined);
|
4614 | });
|
4615 | Card.displayName = 'Card';
|
4616 | Card.propTypes = Card_propTypes;
|
4617 | const src_Card = (Object.assign(Card, {
|
4618 | Img: src_CardImg,
|
4619 | Title: src_CardTitle,
|
4620 | Subtitle: src_CardSubtitle,
|
4621 | Body: src_CardBody,
|
4622 | Link: src_CardLink,
|
4623 | Text: src_CardText,
|
4624 | Header: src_CardHeader,
|
4625 | Footer: src_CardFooter,
|
4626 | ImgOverlay: src_CardImgOverlay
|
4627 | }));
|
4628 | ;
|
4629 | var CardGroup_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CardGroup.tsx";
|
4630 |
|
4631 |
|
4632 |
|
4633 |
|
4634 | const CardGroup = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4635 | className,
|
4636 | bsPrefix,
|
4637 | as: Component = 'div',
|
4638 | ...props
|
4639 | }, ref) => {
|
4640 | bsPrefix = useBootstrapPrefix(bsPrefix, 'card-group');
|
4641 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4642 | ref: ref,
|
4643 | className: classnames_default()(className, bsPrefix),
|
4644 | ...props
|
4645 | }, void 0, false, {
|
4646 | fileName: CardGroup_jsxFileName,
|
4647 | lineNumber: 15,
|
4648 | columnNumber: 9
|
4649 | }, undefined);
|
4650 | });
|
4651 | CardGroup.displayName = 'CardGroup';
|
4652 | const src_CardGroup = (CardGroup);
|
4653 | ;
|
4654 |
|
4655 |
|
4656 |
|
4657 |
|
4658 |
|
4659 |
|
4660 |
|
4661 |
|
4662 |
|
4663 |
|
4664 |
|
4665 |
|
4666 |
|
4667 |
|
4668 |
|
4669 |
|
4670 |
|
4671 |
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 | function useUpdateEffect(fn, deps) {
|
4677 | var isFirst = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(true);
|
4678 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
4679 | if (isFirst.current) {
|
4680 | isFirst.current = false;
|
4681 | return;
|
4682 | }
|
4683 | return fn();
|
4684 | }, deps);
|
4685 | }
|
4686 | const esm_useUpdateEffect = (useUpdateEffect);
|
4687 | ;
|
4688 |
|
4689 |
|
4690 |
|
4691 |
|
4692 |
|
4693 |
|
4694 |
|
4695 |
|
4696 | function useUpdatedRef(value) {
|
4697 | var valueRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(value);
|
4698 | valueRef.current = value;
|
4699 | return valueRef;
|
4700 | }
|
4701 | ;
|
4702 |
|
4703 |
|
4704 |
|
4705 |
|
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 |
|
4711 | function useWillUnmount(fn) {
|
4712 | var onUnmount = useUpdatedRef(fn);
|
4713 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
4714 | return function () {
|
4715 | return onUnmount.current();
|
4716 | };
|
4717 | }, []);
|
4718 | }
|
4719 | ;
|
4720 |
|
4721 |
|
4722 |
|
4723 |
|
4724 |
|
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 | var MAX_DELAY_MS = Math.pow(2, 31) - 1;
|
4733 | function setChainedTimeout(handleRef, fn, timeoutAtMs) {
|
4734 | var delayMs = timeoutAtMs - Date.now();
|
4735 | handleRef.current = delayMs <= MAX_DELAY_MS ? setTimeout(fn, delayMs) : setTimeout(function () {
|
4736 | return setChainedTimeout(handleRef, fn, timeoutAtMs);
|
4737 | }, MAX_DELAY_MS);
|
4738 | }
|
4739 |
|
4740 |
|
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 |
|
4746 |
|
4747 |
|
4748 |
|
4749 |
|
4750 |
|
4751 |
|
4752 |
|
4753 |
|
4754 |
|
4755 |
|
4756 |
|
4757 |
|
4758 | function useTimeout() {
|
4759 | var isMounted = useMounted();
|
4760 |
|
4761 | var handleRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
4762 | useWillUnmount(function () {
|
4763 | return clearTimeout(handleRef.current);
|
4764 | });
|
4765 | return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
4766 | var clear = function clear() {
|
4767 | return clearTimeout(handleRef.current);
|
4768 | };
|
4769 | function set(fn, delayMs) {
|
4770 | if (delayMs === void 0) {
|
4771 | delayMs = 0;
|
4772 | }
|
4773 | if (!isMounted()) return;
|
4774 | clear();
|
4775 | if (delayMs <= MAX_DELAY_MS) {
|
4776 |
|
4777 | handleRef.current = setTimeout(fn, delayMs);
|
4778 | } else {
|
4779 | setChainedTimeout(handleRef, fn, Date.now() + delayMs);
|
4780 | }
|
4781 | }
|
4782 | return {
|
4783 | set: set,
|
4784 | clear: clear
|
4785 | };
|
4786 | }, []);
|
4787 | }
|
4788 | ;// CONCATENATED MODULE: ./src/CarouselCaption.tsx
|
4789 | var CarouselCaption_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CarouselCaption.tsx";
|
4790 |
|
4791 |
|
4792 |
|
4793 |
|
4794 | const CarouselCaption = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4795 | className,
|
4796 | bsPrefix,
|
4797 | as: Component = 'div',
|
4798 | ...props
|
4799 | }, ref) => {
|
4800 | bsPrefix = useBootstrapPrefix(bsPrefix, 'carousel-caption');
|
4801 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4802 | ref: ref,
|
4803 | className: classnames_default()(className, bsPrefix),
|
4804 | ...props
|
4805 | }, void 0, false, {
|
4806 | fileName: CarouselCaption_jsxFileName,
|
4807 | lineNumber: 17,
|
4808 | columnNumber: 7
|
4809 | }, undefined);
|
4810 | });
|
4811 | CarouselCaption.displayName = 'CarouselCaption';
|
4812 | const src_CarouselCaption = (CarouselCaption);
|
4813 | ;
|
4814 | var CarouselItem_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/CarouselItem.tsx";
|
4815 |
|
4816 |
|
4817 |
|
4818 |
|
4819 |
|
4820 | const CarouselItem_propTypes = {
|
4821 |
|
4822 | as: (prop_types_default()).elementType,
|
4823 |
|
4824 | bsPrefix: (prop_types_default()).string,
|
4825 |
|
4826 | interval: (prop_types_default()).number
|
4827 | };
|
4828 | const CarouselItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
4829 |
|
4830 | as: Component = 'div',
|
4831 | bsPrefix,
|
4832 | className,
|
4833 | ...props
|
4834 | }, ref) => {
|
4835 | const finalClassName = classnames_default()(className, useBootstrapPrefix(bsPrefix, 'carousel-item'));
|
4836 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
4837 | ref: ref,
|
4838 | ...props,
|
4839 | className: finalClassName
|
4840 | }, void 0, false, {
|
4841 | fileName: CarouselItem_jsxFileName,
|
4842 | lineNumber: 40,
|
4843 | columnNumber: 14
|
4844 | }, undefined);
|
4845 | });
|
4846 | CarouselItem.displayName = 'CarouselItem';
|
4847 | CarouselItem.propTypes = CarouselItem_propTypes;
|
4848 | const src_CarouselItem = (CarouselItem);
|
4849 | ;
|
4850 |
|
4851 |
|
4852 |
|
4853 |
|
4854 |
|
4855 |
|
4856 |
|
4857 |
|
4858 |
|
4859 |
|
4860 | function map(children, func) {
|
4861 | let index = 0;
|
4862 | return external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.map(children, child => external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child) ? func(child, index++) : child);
|
4863 | }
|
4864 |
|
4865 |
|
4866 |
|
4867 |
|
4868 |
|
4869 |
|
4870 |
|
4871 | function forEach(children, func) {
|
4872 | let index = 0;
|
4873 | external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.forEach(children, child => {
|
4874 | if ( external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child)) func(child, index++);
|
4875 | });
|
4876 | }
|
4877 |
|
4878 |
|
4879 |
|
4880 |
|
4881 |
|
4882 | function hasChildOfType(children, type) {
|
4883 | return external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.toArray(children).some(child => external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child) && child.type === type);
|
4884 | }
|
4885 |
|
4886 | ;
|
4887 | var Carousel_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Carousel.tsx";
|
4888 |
|
4889 |
|
4890 |
|
4891 |
|
4892 |
|
4893 |
|
4894 |
|
4895 |
|
4896 |
|
4897 |
|
4898 |
|
4899 |
|
4900 |
|
4901 |
|
4902 |
|
4903 |
|
4904 |
|
4905 |
|
4906 |
|
4907 | const SWIPE_THRESHOLD = 40;
|
4908 | const Carousel_propTypes = {
|
4909 | |
4910 |
|
4911 |
|
4912 | bsPrefix: (prop_types_default()).string,
|
4913 | as: (prop_types_default()).elementType,
|
4914 | |
4915 |
|
4916 |
|
4917 | slide: (prop_types_default()).bool,
|
4918 |
|
4919 | fade: (prop_types_default()).bool,
|
4920 | |
4921 |
|
4922 |
|
4923 | controls: (prop_types_default()).bool,
|
4924 | |
4925 |
|
4926 |
|
4927 | indicators: (prop_types_default()).bool,
|
4928 | |
4929 |
|
4930 |
|
4931 | indicatorLabels: (prop_types_default()).array,
|
4932 | |
4933 |
|
4934 |
|
4935 |
|
4936 |
|
4937 | activeIndex: (prop_types_default()).number,
|
4938 | |
4939 |
|
4940 |
|
4941 |
|
4942 |
|
4943 |
|
4944 |
|
4945 |
|
4946 |
|
4947 | onSelect: (prop_types_default()).func,
|
4948 | |
4949 |
|
4950 |
|
4951 |
|
4952 |
|
4953 |
|
4954 | onSlide: (prop_types_default()).func,
|
4955 | |
4956 |
|
4957 |
|
4958 |
|
4959 |
|
4960 |
|
4961 | onSlid: (prop_types_default()).func,
|
4962 | |
4963 |
|
4964 |
|
4965 | interval: prop_types_default().oneOfType([(prop_types_default()).number, prop_types_default().oneOf([null])]),
|
4966 |
|
4967 | keyboard: (prop_types_default()).bool,
|
4968 | |
4969 |
|
4970 |
|
4971 |
|
4972 |
|
4973 | pause: prop_types_default().oneOf(['hover', false]),
|
4974 |
|
4975 | wrap: (prop_types_default()).bool,
|
4976 | |
4977 |
|
4978 |
|
4979 | touch: (prop_types_default()).bool,
|
4980 |
|
4981 | prevIcon: (prop_types_default()).node,
|
4982 | |
4983 |
|
4984 |
|
4985 |
|
4986 |
|
4987 | prevLabel: (prop_types_default()).string,
|
4988 |
|
4989 | nextIcon: (prop_types_default()).node,
|
4990 | |
4991 |
|
4992 |
|
4993 |
|
4994 |
|
4995 | nextLabel: (prop_types_default()).string,
|
4996 | |
4997 |
|
4998 |
|
4999 |
|
5000 | variant: prop_types_default().oneOf(['dark'])
|
5001 | };
|
5002 | function isVisible(element) {
|
5003 | if (!element || !element.style || !element.parentNode || !element.parentNode.style) {
|
5004 | return false;
|
5005 | }
|
5006 | const elementStyle = getComputedStyle(element);
|
5007 | return elementStyle.display !== 'none' && elementStyle.visibility !== 'hidden' && getComputedStyle(element.parentNode).display !== 'none';
|
5008 | }
|
5009 | const Carousel = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
5010 | defaultActiveIndex = 0,
|
5011 | ...uncontrolledProps
|
5012 | }, ref) => {
|
5013 | const {
|
5014 |
|
5015 | as: Component = 'div',
|
5016 | bsPrefix,
|
5017 | slide = true,
|
5018 | fade = false,
|
5019 | controls = true,
|
5020 | indicators = true,
|
5021 | indicatorLabels = [],
|
5022 | activeIndex,
|
5023 | onSelect,
|
5024 | onSlide,
|
5025 | onSlid,
|
5026 | interval = 5000,
|
5027 | keyboard = true,
|
5028 | onKeyDown,
|
5029 | pause = 'hover',
|
5030 | onMouseOver,
|
5031 | onMouseOut,
|
5032 | wrap = true,
|
5033 | touch = true,
|
5034 | onTouchStart,
|
5035 | onTouchMove,
|
5036 | onTouchEnd,
|
5037 | prevIcon = (0,jsx_dev_runtime.jsxDEV)("span", {
|
5038 | "aria-hidden": "true",
|
5039 | className: "carousel-control-prev-icon"
|
5040 | }, void 0, false, {
|
5041 | fileName: Carousel_jsxFileName,
|
5042 | lineNumber: 225,
|
5043 | columnNumber: 11
|
5044 | }, undefined),
|
5045 | prevLabel = 'Previous',
|
5046 | nextIcon = (0,jsx_dev_runtime.jsxDEV)("span", {
|
5047 | "aria-hidden": "true",
|
5048 | className: "carousel-control-next-icon"
|
5049 | }, void 0, false, {
|
5050 | fileName: Carousel_jsxFileName,
|
5051 | lineNumber: 229,
|
5052 | columnNumber: 11
|
5053 | }, undefined),
|
5054 | nextLabel = 'Next',
|
5055 | variant,
|
5056 | className,
|
5057 | children,
|
5058 | ...props
|
5059 | } = useUncontrolled({
|
5060 | defaultActiveIndex,
|
5061 | ...uncontrolledProps
|
5062 | }, {
|
5063 | activeIndex: 'onSelect'
|
5064 | });
|
5065 | const prefix = useBootstrapPrefix(bsPrefix, 'carousel');
|
5066 | const isRTL = useIsRTL();
|
5067 | const nextDirectionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
5068 | const [direction, setDirection] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('next');
|
5069 | const [paused, setPaused] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
5070 | const [isSliding, setIsSliding] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
5071 | const [renderedActiveIndex, setRenderedActiveIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(activeIndex || 0);
|
5072 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
5073 | if (!isSliding && activeIndex !== renderedActiveIndex) {
|
5074 | if (nextDirectionRef.current) {
|
5075 | setDirection(nextDirectionRef.current);
|
5076 | } else {
|
5077 | setDirection((activeIndex || 0) > renderedActiveIndex ? 'next' : 'prev');
|
5078 | }
|
5079 | if (slide) {
|
5080 | setIsSliding(true);
|
5081 | }
|
5082 | setRenderedActiveIndex(activeIndex || 0);
|
5083 | }
|
5084 | }, [activeIndex, isSliding, renderedActiveIndex, slide]);
|
5085 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
5086 | if (nextDirectionRef.current) {
|
5087 | nextDirectionRef.current = null;
|
5088 | }
|
5089 | });
|
5090 | let numChildren = 0;
|
5091 | let activeChildInterval;
|
5092 |
|
5093 |
|
5094 |
|
5095 | forEach(children, (child, index) => {
|
5096 | ++numChildren;
|
5097 | if (index === activeIndex) {
|
5098 | activeChildInterval = child.props.interval;
|
5099 | }
|
5100 | });
|
5101 | const activeChildIntervalRef = esm_useCommittedRef(activeChildInterval);
|
5102 | const prev = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
|
5103 | if (isSliding) {
|
5104 | return;
|
5105 | }
|
5106 | let nextActiveIndex = renderedActiveIndex - 1;
|
5107 | if (nextActiveIndex < 0) {
|
5108 | if (!wrap) {
|
5109 | return;
|
5110 | }
|
5111 | nextActiveIndex = numChildren - 1;
|
5112 | }
|
5113 | nextDirectionRef.current = 'prev';
|
5114 | onSelect == null ? void 0 : onSelect(nextActiveIndex, event);
|
5115 | }, [isSliding, renderedActiveIndex, onSelect, wrap, numChildren]);
|
5116 |
|
5117 |
|
5118 | const next = useEventCallback(event => {
|
5119 | if (isSliding) {
|
5120 | return;
|
5121 | }
|
5122 | let nextActiveIndex = renderedActiveIndex + 1;
|
5123 | if (nextActiveIndex >= numChildren) {
|
5124 | if (!wrap) {
|
5125 | return;
|
5126 | }
|
5127 | nextActiveIndex = 0;
|
5128 | }
|
5129 | nextDirectionRef.current = 'next';
|
5130 | onSelect == null ? void 0 : onSelect(nextActiveIndex, event);
|
5131 | });
|
5132 | const elementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
5133 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => ({
|
5134 | element: elementRef.current,
|
5135 | prev,
|
5136 | next
|
5137 | }));
|
5138 |
|
5139 |
|
5140 | const nextWhenVisible = useEventCallback(() => {
|
5141 | if (!document.hidden && isVisible(elementRef.current)) {
|
5142 | if (isRTL) {
|
5143 | prev();
|
5144 | } else {
|
5145 | next();
|
5146 | }
|
5147 | }
|
5148 | });
|
5149 | const slideDirection = direction === 'next' ? 'start' : 'end';
|
5150 | esm_useUpdateEffect(() => {
|
5151 | if (slide) {
|
5152 |
|
5153 | return;
|
5154 | }
|
5155 | onSlide == null ? void 0 : onSlide(renderedActiveIndex, slideDirection);
|
5156 | onSlid == null ? void 0 : onSlid(renderedActiveIndex, slideDirection);
|
5157 | }, [renderedActiveIndex]);
|
5158 | const orderClassName = `${prefix}-item-${direction}`;
|
5159 | const directionalClassName = `${prefix}-item-${slideDirection}`;
|
5160 | const handleEnter = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(node => {
|
5161 | triggerBrowserReflow(node);
|
5162 | onSlide == null ? void 0 : onSlide(renderedActiveIndex, slideDirection);
|
5163 | }, [onSlide, renderedActiveIndex, slideDirection]);
|
5164 | const handleEntered = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
|
5165 | setIsSliding(false);
|
5166 | onSlid == null ? void 0 : onSlid(renderedActiveIndex, slideDirection);
|
5167 | }, [onSlid, renderedActiveIndex, slideDirection]);
|
5168 | const handleKeyDown = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
|
5169 | if (keyboard && !/input|textarea/i.test(event.target.tagName)) {
|
5170 | switch (event.key) {
|
5171 | case 'ArrowLeft':
|
5172 | event.preventDefault();
|
5173 | if (isRTL) {
|
5174 | next(event);
|
5175 | } else {
|
5176 | prev(event);
|
5177 | }
|
5178 | return;
|
5179 | case 'ArrowRight':
|
5180 | event.preventDefault();
|
5181 | if (isRTL) {
|
5182 | prev(event);
|
5183 | } else {
|
5184 | next(event);
|
5185 | }
|
5186 | return;
|
5187 | default:
|
5188 | }
|
5189 | }
|
5190 | onKeyDown == null ? void 0 : onKeyDown(event);
|
5191 | }, [keyboard, onKeyDown, prev, next, isRTL]);
|
5192 | const handleMouseOver = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
|
5193 | if (pause === 'hover') {
|
5194 | setPaused(true);
|
5195 | }
|
5196 | onMouseOver == null ? void 0 : onMouseOver(event);
|
5197 | }, [pause, onMouseOver]);
|
5198 | const handleMouseOut = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
|
5199 | setPaused(false);
|
5200 | onMouseOut == null ? void 0 : onMouseOut(event);
|
5201 | }, [onMouseOut]);
|
5202 | const touchStartXRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
|
5203 | const touchDeltaXRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
|
5204 | const touchUnpauseTimeout = useTimeout();
|
5205 | const handleTouchStart = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
|
5206 | touchStartXRef.current = event.touches[0].clientX;
|
5207 | touchDeltaXRef.current = 0;
|
5208 | if (pause === 'hover') {
|
5209 | setPaused(true);
|
5210 | }
|
5211 | onTouchStart == null ? void 0 : onTouchStart(event);
|
5212 | }, [pause, onTouchStart]);
|
5213 | const handleTouchMove = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
|
5214 | if (event.touches && event.touches.length > 1) {
|
5215 | touchDeltaXRef.current = 0;
|
5216 | } else {
|
5217 | touchDeltaXRef.current = event.touches[0].clientX - touchStartXRef.current;
|
5218 | }
|
5219 | onTouchMove == null ? void 0 : onTouchMove(event);
|
5220 | }, [onTouchMove]);
|
5221 | const handleTouchEnd = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
|
5222 | if (touch) {
|
5223 | const touchDeltaX = touchDeltaXRef.current;
|
5224 | if (Math.abs(touchDeltaX) > SWIPE_THRESHOLD) {
|
5225 | if (touchDeltaX > 0) {
|
5226 | prev(event);
|
5227 | } else {
|
5228 | next(event);
|
5229 | }
|
5230 | }
|
5231 | }
|
5232 | if (pause === 'hover') {
|
5233 | touchUnpauseTimeout.set(() => {
|
5234 | setPaused(false);
|
5235 | }, interval || undefined);
|
5236 | }
|
5237 | onTouchEnd == null ? void 0 : onTouchEnd(event);
|
5238 | }, [touch, pause, prev, next, touchUnpauseTimeout, interval, onTouchEnd]);
|
5239 | const shouldPlay = interval != null && !paused && !isSliding;
|
5240 | const intervalHandleRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
5241 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
5242 | var _ref, _activeChildIntervalR;
|
5243 | if (!shouldPlay) {
|
5244 | return undefined;
|
5245 | }
|
5246 | const nextFunc = isRTL ? prev : next;
|
5247 | intervalHandleRef.current = window.setInterval(document.visibilityState ? nextWhenVisible : nextFunc, (_ref = (_activeChildIntervalR = activeChildIntervalRef.current) != null ? _activeChildIntervalR : interval) != null ? _ref : undefined);
|
5248 | return () => {
|
5249 | if (intervalHandleRef.current !== null) {
|
5250 | clearInterval(intervalHandleRef.current);
|
5251 | }
|
5252 | };
|
5253 | }, [shouldPlay, prev, next, activeChildIntervalRef, interval, nextWhenVisible, isRTL]);
|
5254 | const indicatorOnClicks = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => indicators && Array.from({
|
5255 | length: numChildren
|
5256 | }, (_, index) => event => {
|
5257 | onSelect == null ? void 0 : onSelect(index, event);
|
5258 | }), [indicators, numChildren, onSelect]);
|
5259 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
5260 | ref: elementRef,
|
5261 | ...props,
|
5262 | onKeyDown: handleKeyDown,
|
5263 | onMouseOver: handleMouseOver,
|
5264 | onMouseOut: handleMouseOut,
|
5265 | onTouchStart: handleTouchStart,
|
5266 | onTouchMove: handleTouchMove,
|
5267 | onTouchEnd: handleTouchEnd,
|
5268 | className: classnames_default()(className, prefix, slide && 'slide', fade && `${prefix}-fade`, variant && `${prefix}-${variant}`),
|
5269 | children: [indicators && (0,jsx_dev_runtime.jsxDEV)("div", {
|
5270 | className: `${prefix}-indicators`,
|
5271 | children: map(children, (_, index) => (0,jsx_dev_runtime.jsxDEV)("button", {
|
5272 | type: "button",
|
5273 | "data-bs-target": ""
|
5274 | ,
|
5275 | "aria-label": indicatorLabels != null && indicatorLabels.length ? indicatorLabels[index] : `Slide ${index + 1}`,
|
5276 | className: index === renderedActiveIndex ? 'active' : undefined,
|
5277 | onClick: indicatorOnClicks ? indicatorOnClicks[index] : undefined,
|
5278 | "aria-current": index === renderedActiveIndex
|
5279 | }, index, false, {
|
5280 | fileName: Carousel_jsxFileName,
|
5281 | lineNumber: 548,
|
5282 | columnNumber: 17
|
5283 | }, undefined))
|
5284 | }, void 0, false, {
|
5285 | fileName: Carousel_jsxFileName,
|
5286 | lineNumber: 546,
|
5287 | columnNumber: 13
|
5288 | }, undefined), (0,jsx_dev_runtime.jsxDEV)("div", {
|
5289 | className: `${prefix}-inner`,
|
5290 | children: map(children, (child, index) => {
|
5291 | const isActive = index === renderedActiveIndex;
|
5292 | return slide ? (0,jsx_dev_runtime.jsxDEV)(src_TransitionWrapper, {
|
5293 | in: isActive,
|
5294 | onEnter: isActive ? handleEnter : undefined,
|
5295 | onEntered: isActive ? handleEntered : undefined,
|
5296 | addEndListener: transitionEndListener,
|
5297 | children: (status, innerProps) => external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(child, {
|
5298 | ...innerProps,
|
5299 | className: classnames_default()(child.props.className, isActive && status !== 'entered' && orderClassName, (status === 'entered' || status === 'exiting') && 'active', (status === 'entering' || status === 'exiting') && directionalClassName)
|
5300 | })
|
5301 | }, void 0, false, {
|
5302 | fileName: Carousel_jsxFileName,
|
5303 | lineNumber: 574,
|
5304 | columnNumber: 17
|
5305 | }, undefined) : external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(child, {
|
5306 | className: classnames_default()(child.props.className, isActive && 'active')
|
5307 | });
|
5308 | })
|
5309 | }, void 0, false, {
|
5310 | fileName: Carousel_jsxFileName,
|
5311 | lineNumber: 569,
|
5312 | columnNumber: 11
|
5313 | }, undefined), controls && (0,jsx_dev_runtime.jsxDEV)(jsx_dev_runtime.Fragment, {
|
5314 | children: [(wrap || activeIndex !== 0) && (0,jsx_dev_runtime.jsxDEV)(esm_Anchor, {
|
5315 | className: `${prefix}-control-prev`,
|
5316 | onClick: prev,
|
5317 | children: [prevIcon, prevLabel && (0,jsx_dev_runtime.jsxDEV)("span", {
|
5318 | className: "visually-hidden",
|
5319 | children: prevLabel
|
5320 | }, void 0, false, {
|
5321 | fileName: Carousel_jsxFileName,
|
5322 | lineNumber: 614,
|
5323 | columnNumber: 21
|
5324 | }, undefined)]
|
5325 | }, void 0, true, {
|
5326 | fileName: Carousel_jsxFileName,
|
5327 | lineNumber: 611,
|
5328 | columnNumber: 17
|
5329 | }, undefined), (wrap || activeIndex !== numChildren - 1) && (0,jsx_dev_runtime.jsxDEV)(esm_Anchor, {
|
5330 | className: `${prefix}-control-next`,
|
5331 | onClick: next,
|
5332 | children: [nextIcon, nextLabel && (0,jsx_dev_runtime.jsxDEV)("span", {
|
5333 | className: "visually-hidden",
|
5334 | children: nextLabel
|
5335 | }, void 0, false, {
|
5336 | fileName: Carousel_jsxFileName,
|
5337 | lineNumber: 622,
|
5338 | columnNumber: 21
|
5339 | }, undefined)]
|
5340 | }, void 0, true, {
|
5341 | fileName: Carousel_jsxFileName,
|
5342 | lineNumber: 619,
|
5343 | columnNumber: 17
|
5344 | }, undefined)]
|
5345 | }, void 0, true)]
|
5346 | }, void 0, true, {
|
5347 | fileName: Carousel_jsxFileName,
|
5348 | lineNumber: 528,
|
5349 | columnNumber: 9
|
5350 | }, undefined);
|
5351 | });
|
5352 | Carousel.displayName = 'Carousel';
|
5353 | Carousel.propTypes = Carousel_propTypes;
|
5354 | const src_Carousel = (Object.assign(Carousel, {
|
5355 | Caption: src_CarouselCaption,
|
5356 | Item: src_CarouselItem
|
5357 | }));
|
5358 | ;
|
5359 | var Col_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Col.tsx";
|
5360 |
|
5361 |
|
5362 |
|
5363 |
|
5364 |
|
5365 | const colSize = prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).number, (prop_types_default()).string, prop_types_default().oneOf(['auto'])]);
|
5366 | const stringOrNumber = prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]);
|
5367 | const column = prop_types_default().oneOfType([colSize, prop_types_default().shape({
|
5368 | size: colSize,
|
5369 | order: stringOrNumber,
|
5370 | offset: stringOrNumber
|
5371 | })]);
|
5372 | const Col_propTypes = {
|
5373 | |
5374 |
|
5375 |
|
5376 | bsPrefix: (prop_types_default()).string,
|
5377 | as: (prop_types_default()).elementType,
|
5378 | |
5379 |
|
5380 |
|
5381 |
|
5382 |
|
5383 | xs: column,
|
5384 | |
5385 |
|
5386 |
|
5387 |
|
5388 |
|
5389 | sm: column,
|
5390 | |
5391 |
|
5392 |
|
5393 |
|
5394 |
|
5395 | md: column,
|
5396 | |
5397 |
|
5398 |
|
5399 |
|
5400 |
|
5401 | lg: column,
|
5402 | |
5403 |
|
5404 |
|
5405 |
|
5406 |
|
5407 | xl: column,
|
5408 | |
5409 |
|
5410 |
|
5411 |
|
5412 |
|
5413 | xxl: column
|
5414 | };
|
5415 | function useCol({
|
5416 | as,
|
5417 | bsPrefix,
|
5418 | className,
|
5419 | ...props
|
5420 | }) {
|
5421 | bsPrefix = useBootstrapPrefix(bsPrefix, 'col');
|
5422 | const breakpoints = useBootstrapBreakpoints();
|
5423 | const minBreakpoint = useBootstrapMinBreakpoint();
|
5424 | const spans = [];
|
5425 | const classes = [];
|
5426 | breakpoints.forEach(brkPoint => {
|
5427 | const propValue = props[brkPoint];
|
5428 | delete props[brkPoint];
|
5429 | let span;
|
5430 | let offset;
|
5431 | let order;
|
5432 | if (typeof propValue === 'object' && propValue != null) {
|
5433 | ({
|
5434 | span,
|
5435 | offset,
|
5436 | order
|
5437 | } = propValue);
|
5438 | } else {
|
5439 | span = propValue;
|
5440 | }
|
5441 | const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
5442 | if (span) spans.push(span === true ? `${bsPrefix}${infix}` : `${bsPrefix}${infix}-${span}`);
|
5443 | if (order != null) classes.push(`order${infix}-${order}`);
|
5444 | if (offset != null) classes.push(`offset${infix}-${offset}`);
|
5445 | });
|
5446 | return [{
|
5447 | ...props,
|
5448 | className: classnames_default()(className, ...spans, ...classes)
|
5449 | }, {
|
5450 | as,
|
5451 | bsPrefix,
|
5452 | spans
|
5453 | }];
|
5454 | }
|
5455 | const Col = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(
|
5456 |
|
5457 | (props, ref) => {
|
5458 | const [{
|
5459 | className,
|
5460 | ...colProps
|
5461 | }, {
|
5462 | as: Component = 'div',
|
5463 | bsPrefix,
|
5464 | spans
|
5465 | }] = useCol(props);
|
5466 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
5467 | ...colProps,
|
5468 | ref: ref,
|
5469 | className: classnames_default()(className, !spans.length && bsPrefix)
|
5470 | }, void 0, false, {
|
5471 | fileName: Col_jsxFileName,
|
5472 | lineNumber: 184,
|
5473 | columnNumber: 7
|
5474 | }, undefined);
|
5475 | });
|
5476 | Col.displayName = 'Col';
|
5477 | Col.propTypes = Col_propTypes;
|
5478 | const src_Col = (Col);
|
5479 | ;
|
5480 | var Container_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Container.tsx";
|
5481 |
|
5482 |
|
5483 |
|
5484 |
|
5485 |
|
5486 | const Container_propTypes = {
|
5487 | |
5488 |
|
5489 |
|
5490 | bsPrefix: (prop_types_default()).string,
|
5491 | |
5492 |
|
5493 |
|
5494 |
|
5495 | fluid: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).string]),
|
5496 | |
5497 |
|
5498 |
|
5499 | as: (prop_types_default()).elementType
|
5500 | };
|
5501 | const Container = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
5502 | bsPrefix,
|
5503 | fluid = false,
|
5504 |
|
5505 | as: Component = 'div',
|
5506 | className,
|
5507 | ...props
|
5508 | }, ref) => {
|
5509 | const prefix = useBootstrapPrefix(bsPrefix, 'container');
|
5510 | const suffix = typeof fluid === 'string' ? `-${fluid}` : '-fluid';
|
5511 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
5512 | ref: ref,
|
5513 | ...props,
|
5514 | className: classnames_default()(className, fluid ? `${prefix}${suffix}` : prefix)
|
5515 | }, void 0, false, {
|
5516 | fileName: Container_jsxFileName,
|
5517 | lineNumber: 47,
|
5518 | columnNumber: 9
|
5519 | }, undefined);
|
5520 | });
|
5521 | Container.displayName = 'Container';
|
5522 | Container.propTypes = Container_propTypes;
|
5523 | const src_Container = (Container);
|
5524 | ;
|
5525 | var toArray = Function.prototype.bind.call(Function.prototype.call, [].slice);
|
5526 |
|
5527 |
|
5528 |
|
5529 |
|
5530 |
|
5531 |
|
5532 |
|
5533 | function qsa(element, selector) {
|
5534 | return toArray(element.querySelectorAll(selector));
|
5535 | }
|
5536 | ;
|
5537 | function esm_objectWithoutPropertiesLoose(source, excluded) {
|
5538 | if (source == null) return {};
|
5539 | var target = {};
|
5540 | var sourceKeys = Object.keys(source);
|
5541 | var key, i;
|
5542 | for (i = 0; i < sourceKeys.length; i++) {
|
5543 | key = sourceKeys[i];
|
5544 | if (excluded.indexOf(key) >= 0) continue;
|
5545 | target[key] = source[key];
|
5546 | }
|
5547 | return target;
|
5548 | }
|
5549 | function esm_toPropertyKey(arg) {
|
5550 | var key = esm_toPrimitive(arg, "string");
|
5551 | return typeof key === "symbol" ? key : String(key);
|
5552 | }
|
5553 | function esm_toPrimitive(input, hint) {
|
5554 | if (typeof input !== "object" || input === null) return input;
|
5555 | var prim = input[Symbol.toPrimitive];
|
5556 | if (prim !== undefined) {
|
5557 | var res = prim.call(input, hint || "default");
|
5558 | if (typeof res !== "object") return res;
|
5559 | throw new TypeError("@@toPrimitive must return a primitive value.");
|
5560 | }
|
5561 | return (hint === "string" ? String : Number)(input);
|
5562 | }
|
5563 |
|
5564 | function esm_defaultKey(key) {
|
5565 | return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
|
5566 | }
|
5567 | function esm_useUncontrolledProp(propValue, defaultValue, handler) {
|
5568 | const wasPropRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(propValue !== undefined);
|
5569 | const [stateValue, setState] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(defaultValue);
|
5570 | const isProp = propValue !== undefined;
|
5571 | const wasProp = wasPropRef.current;
|
5572 | wasPropRef.current = isProp;
|
5573 |
|
5574 | |
5575 |
|
5576 |
|
5577 |
|
5578 | if (!isProp && wasProp && stateValue !== defaultValue) {
|
5579 | setState(defaultValue);
|
5580 | }
|
5581 | return [isProp ? propValue : stateValue, (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((value, ...args) => {
|
5582 | if (handler) handler(value, ...args);
|
5583 | setState(value);
|
5584 | }, [handler])];
|
5585 | }
|
5586 |
|
5587 | function esm_useUncontrolled(props, config) {
|
5588 | return Object.keys(config).reduce((result, fieldName) => {
|
5589 | const _ref = result,
|
5590 | _defaultKey = esm_defaultKey(fieldName),
|
5591 | {
|
5592 | [_defaultKey]: defaultValue,
|
5593 | [fieldName]: propsValue
|
5594 | } = _ref,
|
5595 | rest = esm_objectWithoutPropertiesLoose(_ref, [_defaultKey, fieldName].map(esm_toPropertyKey));
|
5596 | const handlerName = config[fieldName];
|
5597 | const [value, handler] = esm_useUncontrolledProp(propsValue, defaultValue, props[handlerName]);
|
5598 | return Object.assign({}, rest, {
|
5599 | [fieldName]: value,
|
5600 | [handlerName]: handler
|
5601 | });
|
5602 | }, props);
|
5603 | }
|
5604 | ;
|
5605 |
|
5606 |
|
5607 |
|
5608 |
|
5609 |
|
5610 |
|
5611 |
|
5612 |
|
5613 |
|
5614 |
|
5615 |
|
5616 |
|
5617 |
|
5618 |
|
5619 |
|
5620 |
|
5621 |
|
5622 |
|
5623 | function useForceUpdate() {
|
5624 |
|
5625 |
|
5626 | var _useReducer = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useReducer)(function (state) {
|
5627 | return !state;
|
5628 | }, false),
|
5629 | dispatch = _useReducer[1];
|
5630 | return dispatch;
|
5631 | }
|
5632 | ;
|
5633 |
|
5634 | const DropdownContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
|
5635 | const esm_DropdownContext = (DropdownContext);
|
5636 | ;
|
5637 | var has = Object.prototype.hasOwnProperty;
|
5638 |
|
5639 | function find(iter, tar, key) {
|
5640 | for (key of iter.keys()) {
|
5641 | if (dequal(key, tar)) return key;
|
5642 | }
|
5643 | }
|
5644 |
|
5645 | function dequal(foo, bar) {
|
5646 | var ctor, len, tmp;
|
5647 | if (foo === bar) return true;
|
5648 |
|
5649 | if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
|
5650 | if (ctor === Date) return foo.getTime() === bar.getTime();
|
5651 | if (ctor === RegExp) return foo.toString() === bar.toString();
|
5652 |
|
5653 | if (ctor === Array) {
|
5654 | if ((len=foo.length) === bar.length) {
|
5655 | while (len-- && dequal(foo[len], bar[len]));
|
5656 | }
|
5657 | return len === -1;
|
5658 | }
|
5659 |
|
5660 | if (ctor === Set) {
|
5661 | if (foo.size !== bar.size) {
|
5662 | return false;
|
5663 | }
|
5664 | for (len of foo) {
|
5665 | tmp = len;
|
5666 | if (tmp && typeof tmp === 'object') {
|
5667 | tmp = find(bar, tmp);
|
5668 | if (!tmp) return false;
|
5669 | }
|
5670 | if (!bar.has(tmp)) return false;
|
5671 | }
|
5672 | return true;
|
5673 | }
|
5674 |
|
5675 | if (ctor === Map) {
|
5676 | if (foo.size !== bar.size) {
|
5677 | return false;
|
5678 | }
|
5679 | for (len of foo) {
|
5680 | tmp = len[0];
|
5681 | if (tmp && typeof tmp === 'object') {
|
5682 | tmp = find(bar, tmp);
|
5683 | if (!tmp) return false;
|
5684 | }
|
5685 | if (!dequal(len[1], bar.get(tmp))) {
|
5686 | return false;
|
5687 | }
|
5688 | }
|
5689 | return true;
|
5690 | }
|
5691 |
|
5692 | if (ctor === ArrayBuffer) {
|
5693 | foo = new Uint8Array(foo);
|
5694 | bar = new Uint8Array(bar);
|
5695 | } else if (ctor === DataView) {
|
5696 | if ((len=foo.byteLength) === bar.byteLength) {
|
5697 | while (len-- && foo.getInt8(len) === bar.getInt8(len));
|
5698 | }
|
5699 | return len === -1;
|
5700 | }
|
5701 |
|
5702 | if (ArrayBuffer.isView(foo)) {
|
5703 | if ((len=foo.byteLength) === bar.byteLength) {
|
5704 | while (len-- && foo[len] === bar[len]);
|
5705 | }
|
5706 | return len === -1;
|
5707 | }
|
5708 |
|
5709 | if (!ctor || typeof foo === 'object') {
|
5710 | len = 0;
|
5711 | for (ctor in foo) {
|
5712 | if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
5713 | if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
5714 | }
|
5715 | return Object.keys(bar).length === len;
|
5716 | }
|
5717 | }
|
5718 |
|
5719 | return foo !== foo && bar !== bar;
|
5720 | }
|
5721 |
|
5722 | ;
|
5723 |
|
5724 |
|
5725 | function useSafeState(state) {
|
5726 | var isMounted = useMounted();
|
5727 | return [state[0], (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (nextState) {
|
5728 | if (!isMounted()) return;
|
5729 | return state[1](nextState);
|
5730 | }, [isMounted, state[1]])];
|
5731 | }
|
5732 | const esm_useSafeState = (useSafeState);
|
5733 | ;
|
5734 |
|
5735 | function getBasePlacement(placement) {
|
5736 | return placement.split('-')[0];
|
5737 | }
|
5738 | ;
|
5739 | function getWindow(node) {
|
5740 | if (node == null) {
|
5741 | return window;
|
5742 | }
|
5743 | if (node.toString() !== '[object Window]') {
|
5744 | var ownerDocument = node.ownerDocument;
|
5745 | return ownerDocument ? ownerDocument.defaultView || window : window;
|
5746 | }
|
5747 | return node;
|
5748 | }
|
5749 | ;
|
5750 |
|
5751 | function isElement(node) {
|
5752 | var OwnElement = getWindow(node).Element;
|
5753 | return node instanceof OwnElement || node instanceof Element;
|
5754 | }
|
5755 | function isHTMLElement(node) {
|
5756 | var OwnElement = getWindow(node).HTMLElement;
|
5757 | return node instanceof OwnElement || node instanceof HTMLElement;
|
5758 | }
|
5759 | function isShadowRoot(node) {
|
5760 |
|
5761 | if (typeof ShadowRoot === 'undefined') {
|
5762 | return false;
|
5763 | }
|
5764 | var OwnElement = getWindow(node).ShadowRoot;
|
5765 | return node instanceof OwnElement || node instanceof ShadowRoot;
|
5766 | }
|
5767 |
|
5768 | ;
|
5769 | var math_max = Math.max;
|
5770 | var math_min = Math.min;
|
5771 | var round = Math.round;
|
5772 | ;
|
5773 | function getUAString() {
|
5774 | var uaData = navigator.userAgentData;
|
5775 | if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
5776 | return uaData.brands.map(function (item) {
|
5777 | return item.brand + "/" + item.version;
|
5778 | }).join(' ');
|
5779 | }
|
5780 | return navigator.userAgent;
|
5781 | }
|
5782 | ;
|
5783 |
|
5784 | function isLayoutViewport() {
|
5785 | return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
5786 | }
|
5787 | ;
|
5788 |
|
5789 |
|
5790 |
|
5791 |
|
5792 | function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
5793 | if (includeScale === void 0) {
|
5794 | includeScale = false;
|
5795 | }
|
5796 | if (isFixedStrategy === void 0) {
|
5797 | isFixedStrategy = false;
|
5798 | }
|
5799 | var clientRect = element.getBoundingClientRect();
|
5800 | var scaleX = 1;
|
5801 | var scaleY = 1;
|
5802 | if (includeScale && isHTMLElement(element)) {
|
5803 | scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
5804 | scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
5805 | }
|
5806 | var _ref = isElement(element) ? getWindow(element) : window,
|
5807 | visualViewport = _ref.visualViewport;
|
5808 | var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
5809 | var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
5810 | var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
5811 | var width = clientRect.width / scaleX;
|
5812 | var height = clientRect.height / scaleY;
|
5813 | return {
|
5814 | width: width,
|
5815 | height: height,
|
5816 | top: y,
|
5817 | right: x + width,
|
5818 | bottom: y + height,
|
5819 | left: x,
|
5820 | x: x,
|
5821 | y: y
|
5822 | };
|
5823 | }
|
5824 | ;
|
5825 |
|
5826 |
|
5827 |
|
5828 | function getLayoutRect(element) {
|
5829 | var clientRect = getBoundingClientRect(element);
|
5830 |
|
5831 |
|
5832 | var width = element.offsetWidth;
|
5833 | var height = element.offsetHeight;
|
5834 | if (Math.abs(clientRect.width - width) <= 1) {
|
5835 | width = clientRect.width;
|
5836 | }
|
5837 | if (Math.abs(clientRect.height - height) <= 1) {
|
5838 | height = clientRect.height;
|
5839 | }
|
5840 | return {
|
5841 | x: element.offsetLeft,
|
5842 | y: element.offsetTop,
|
5843 | width: width,
|
5844 | height: height
|
5845 | };
|
5846 | }
|
5847 | ;
|
5848 |
|
5849 | function contains(parent, child) {
|
5850 | var rootNode = child.getRootNode && child.getRootNode();
|
5851 |
|
5852 | if (parent.contains(child)) {
|
5853 | return true;
|
5854 | }
|
5855 | else if (rootNode && isShadowRoot(rootNode)) {
|
5856 | var next = child;
|
5857 | do {
|
5858 | if (next && parent.isSameNode(next)) {
|
5859 | return true;
|
5860 | }
|
5861 |
|
5862 | next = next.parentNode || next.host;
|
5863 | } while (next);
|
5864 | }
|
5865 |
|
5866 | return false;
|
5867 | }
|
5868 | ;
|
5869 | function getNodeName(element) {
|
5870 | return element ? (element.nodeName || '').toLowerCase() : null;
|
5871 | }
|
5872 | ;
|
5873 |
|
5874 | function dom_utils_getComputedStyle_getComputedStyle(element) {
|
5875 | return getWindow(element).getComputedStyle(element);
|
5876 | }
|
5877 | ;
|
5878 |
|
5879 | function isTableElement(element) {
|
5880 | return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
5881 | }
|
5882 | ;
|
5883 |
|
5884 | function getDocumentElement(element) {
|
5885 |
|
5886 | return ((isElement(element) ? element.ownerDocument :
|
5887 |
|
5888 | element.document) || window.document).documentElement;
|
5889 | }
|
5890 | ;
|
5891 |
|
5892 |
|
5893 |
|
5894 | function getParentNode(element) {
|
5895 | if (getNodeName(element) === 'html') {
|
5896 | return element;
|
5897 | }
|
5898 | return (
|
5899 |
|
5900 |
|
5901 |
|
5902 | element.assignedSlot ||
|
5903 |
|
5904 | element.parentNode || (
|
5905 |
|
5906 | isShadowRoot(element) ? element.host : null) ||
|
5907 |
|
5908 |
|
5909 | getDocumentElement(element)
|
5910 | );
|
5911 | }
|
5912 | ;
|
5913 |
|
5914 |
|
5915 |
|
5916 |
|
5917 |
|
5918 |
|
5919 |
|
5920 | function getTrueOffsetParent(element) {
|
5921 | if (!isHTMLElement(element) ||
|
5922 |
|
5923 | dom_utils_getComputedStyle_getComputedStyle(element).position === 'fixed') {
|
5924 | return null;
|
5925 | }
|
5926 | return element.offsetParent;
|
5927 | }
|
5928 |
|
5929 |
|
5930 | function getContainingBlock(element) {
|
5931 | var isFirefox = /firefox/i.test(getUAString());
|
5932 | var isIE = /Trident/i.test(getUAString());
|
5933 | if (isIE && isHTMLElement(element)) {
|
5934 |
|
5935 | var elementCss = dom_utils_getComputedStyle_getComputedStyle(element);
|
5936 | if (elementCss.position === 'fixed') {
|
5937 | return null;
|
5938 | }
|
5939 | }
|
5940 | var currentNode = getParentNode(element);
|
5941 | if (isShadowRoot(currentNode)) {
|
5942 | currentNode = currentNode.host;
|
5943 | }
|
5944 | while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
5945 | var css = dom_utils_getComputedStyle_getComputedStyle(currentNode);
|
5946 |
|
5947 |
|
5948 |
|
5949 | if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
|
5950 | return currentNode;
|
5951 | } else {
|
5952 | currentNode = currentNode.parentNode;
|
5953 | }
|
5954 | }
|
5955 | return null;
|
5956 | }
|
5957 |
|
5958 |
|
5959 | function getOffsetParent(element) {
|
5960 | var window = getWindow(element);
|
5961 | var offsetParent = getTrueOffsetParent(element);
|
5962 | while (offsetParent && isTableElement(offsetParent) && dom_utils_getComputedStyle_getComputedStyle(offsetParent).position === 'static') {
|
5963 | offsetParent = getTrueOffsetParent(offsetParent);
|
5964 | }
|
5965 | if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && dom_utils_getComputedStyle_getComputedStyle(offsetParent).position === 'static')) {
|
5966 | return window;
|
5967 | }
|
5968 | return offsetParent || getContainingBlock(element) || window;
|
5969 | }
|
5970 | ;
|
5971 | function getMainAxisFromPlacement(placement) {
|
5972 | return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
5973 | }
|
5974 | ;
|
5975 |
|
5976 | function within(min, value, max) {
|
5977 | return math_max(min, math_min(value, max));
|
5978 | }
|
5979 | function withinMaxClamp(min, value, max) {
|
5980 | var v = within(min, value, max);
|
5981 | return v > max ? max : v;
|
5982 | }
|
5983 | ;
|
5984 | function getFreshSideObject() {
|
5985 | return {
|
5986 | top: 0,
|
5987 | right: 0,
|
5988 | bottom: 0,
|
5989 | left: 0
|
5990 | };
|
5991 | }
|
5992 | ;
|
5993 |
|
5994 | function mergePaddingObject(paddingObject) {
|
5995 | return Object.assign({}, getFreshSideObject(), paddingObject);
|
5996 | }
|
5997 | ;
|
5998 | function expandToHashMap(value, keys) {
|
5999 | return keys.reduce(function (hashMap, key) {
|
6000 | hashMap[key] = value;
|
6001 | return hashMap;
|
6002 | }, {});
|
6003 | }
|
6004 | ;
|
6005 | var enums_top = 'top';
|
6006 | var bottom = 'bottom';
|
6007 | var right = 'right';
|
6008 | var left = 'left';
|
6009 | var auto = 'auto';
|
6010 | var basePlacements = [enums_top, bottom, right, left];
|
6011 | var start = 'start';
|
6012 | var end = 'end';
|
6013 | var clippingParents = 'clippingParents';
|
6014 | var viewport = 'viewport';
|
6015 | var popper = 'popper';
|
6016 | var reference = 'reference';
|
6017 | var variationPlacements = basePlacements.reduce(function (acc, placement) {
|
6018 | return acc.concat([placement + "-" + start, placement + "-" + end]);
|
6019 | }, []);
|
6020 | var enums_placements = [].concat(basePlacements, [auto]).reduce(function (acc, placement) {
|
6021 | return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
6022 | }, []);
|
6023 |
|
6024 | var beforeRead = 'beforeRead';
|
6025 | var read = 'read';
|
6026 | var afterRead = 'afterRead';
|
6027 |
|
6028 | var beforeMain = 'beforeMain';
|
6029 | var main = 'main';
|
6030 | var afterMain = 'afterMain';
|
6031 |
|
6032 | var beforeWrite = 'beforeWrite';
|
6033 | var write = 'write';
|
6034 | var afterWrite = 'afterWrite';
|
6035 | var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
6036 | ;
|
6037 |
|
6038 |
|
6039 |
|
6040 |
|
6041 |
|
6042 |
|
6043 |
|
6044 |
|
6045 |
|
6046 |
|
6047 |
|
6048 | var toPaddingObject = function toPaddingObject(padding, state) {
|
6049 | padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
6050 | placement: state.placement
|
6051 | })) : padding;
|
6052 | return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
6053 | };
|
6054 | function arrow(_ref) {
|
6055 | var _state$modifiersData$;
|
6056 | var state = _ref.state,
|
6057 | name = _ref.name,
|
6058 | options = _ref.options;
|
6059 | var arrowElement = state.elements.arrow;
|
6060 | var popperOffsets = state.modifiersData.popperOffsets;
|
6061 | var basePlacement = getBasePlacement(state.placement);
|
6062 | var axis = getMainAxisFromPlacement(basePlacement);
|
6063 | var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
6064 | var len = isVertical ? 'height' : 'width';
|
6065 | if (!arrowElement || !popperOffsets) {
|
6066 | return;
|
6067 | }
|
6068 | var paddingObject = toPaddingObject(options.padding, state);
|
6069 | var arrowRect = getLayoutRect(arrowElement);
|
6070 | var minProp = axis === 'y' ? enums_top : left;
|
6071 | var maxProp = axis === 'y' ? bottom : right;
|
6072 | var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
6073 | var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
6074 | var arrowOffsetParent = getOffsetParent(arrowElement);
|
6075 | var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
6076 | var centerToReference = endDiff / 2 - startDiff / 2;
|
6077 |
|
6078 |
|
6079 | var min = paddingObject[minProp];
|
6080 | var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
6081 | var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
6082 | var offset = within(min, center, max);
|
6083 |
|
6084 | var axisProp = axis;
|
6085 | state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
6086 | }
|
6087 | function effect(_ref2) {
|
6088 | var state = _ref2.state,
|
6089 | options = _ref2.options;
|
6090 | var _options$element = options.element,
|
6091 | arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
6092 | if (arrowElement == null) {
|
6093 | return;
|
6094 | }
|
6095 |
|
6096 | if (typeof arrowElement === 'string') {
|
6097 | arrowElement = state.elements.popper.querySelector(arrowElement);
|
6098 | if (!arrowElement) {
|
6099 | return;
|
6100 | }
|
6101 | }
|
6102 | if (false) {}
|
6103 | if (!contains(state.elements.popper, arrowElement)) {
|
6104 | if (false) {}
|
6105 | return;
|
6106 | }
|
6107 | state.elements.arrow = arrowElement;
|
6108 | }
|
6109 |
|
6110 | const modifiers_arrow = ({
|
6111 | name: 'arrow',
|
6112 | enabled: true,
|
6113 | phase: 'main',
|
6114 | fn: arrow,
|
6115 | effect: effect,
|
6116 | requires: ['popperOffsets'],
|
6117 | requiresIfExists: ['preventOverflow']
|
6118 | });
|
6119 | ;
|
6120 | function getVariation(placement) {
|
6121 | return placement.split('-')[1];
|
6122 | }
|
6123 | ;
|
6124 |
|
6125 |
|
6126 |
|
6127 |
|
6128 |
|
6129 |
|
6130 |
|
6131 |
|
6132 |
|
6133 | var unsetSides = {
|
6134 | top: 'auto',
|
6135 | right: 'auto',
|
6136 | bottom: 'auto',
|
6137 | left: 'auto'
|
6138 | };
|
6139 |
|
6140 |
|
6141 |
|
6142 | function roundOffsetsByDPR(_ref, win) {
|
6143 | var x = _ref.x,
|
6144 | y = _ref.y;
|
6145 | var dpr = win.devicePixelRatio || 1;
|
6146 | return {
|
6147 | x: round(x * dpr) / dpr || 0,
|
6148 | y: round(y * dpr) / dpr || 0
|
6149 | };
|
6150 | }
|
6151 | function mapToStyles(_ref2) {
|
6152 | var _Object$assign2;
|
6153 | var popper = _ref2.popper,
|
6154 | popperRect = _ref2.popperRect,
|
6155 | placement = _ref2.placement,
|
6156 | variation = _ref2.variation,
|
6157 | offsets = _ref2.offsets,
|
6158 | position = _ref2.position,
|
6159 | gpuAcceleration = _ref2.gpuAcceleration,
|
6160 | adaptive = _ref2.adaptive,
|
6161 | roundOffsets = _ref2.roundOffsets,
|
6162 | isFixed = _ref2.isFixed;
|
6163 | var _offsets$x = offsets.x,
|
6164 | x = _offsets$x === void 0 ? 0 : _offsets$x,
|
6165 | _offsets$y = offsets.y,
|
6166 | y = _offsets$y === void 0 ? 0 : _offsets$y;
|
6167 | var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
6168 | x: x,
|
6169 | y: y
|
6170 | }) : {
|
6171 | x: x,
|
6172 | y: y
|
6173 | };
|
6174 | x = _ref3.x;
|
6175 | y = _ref3.y;
|
6176 | var hasX = offsets.hasOwnProperty('x');
|
6177 | var hasY = offsets.hasOwnProperty('y');
|
6178 | var sideX = left;
|
6179 | var sideY = enums_top;
|
6180 | var win = window;
|
6181 | if (adaptive) {
|
6182 | var offsetParent = getOffsetParent(popper);
|
6183 | var heightProp = 'clientHeight';
|
6184 | var widthProp = 'clientWidth';
|
6185 | if (offsetParent === getWindow(popper)) {
|
6186 | offsetParent = getDocumentElement(popper);
|
6187 | if (dom_utils_getComputedStyle_getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
|
6188 | heightProp = 'scrollHeight';
|
6189 | widthProp = 'scrollWidth';
|
6190 | }
|
6191 | }
|
6192 |
|
6193 | offsetParent = offsetParent;
|
6194 | if (placement === enums_top || (placement === left || placement === right) && variation === end) {
|
6195 | sideY = bottom;
|
6196 | var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height :
|
6197 |
|
6198 | offsetParent[heightProp];
|
6199 | y -= offsetY - popperRect.height;
|
6200 | y *= gpuAcceleration ? 1 : -1;
|
6201 | }
|
6202 | if (placement === left || (placement === enums_top || placement === bottom) && variation === end) {
|
6203 | sideX = right;
|
6204 | var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width :
|
6205 |
|
6206 | offsetParent[widthProp];
|
6207 | x -= offsetX - popperRect.width;
|
6208 | x *= gpuAcceleration ? 1 : -1;
|
6209 | }
|
6210 | }
|
6211 | var commonStyles = Object.assign({
|
6212 | position: position
|
6213 | }, adaptive && unsetSides);
|
6214 | var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
6215 | x: x,
|
6216 | y: y
|
6217 | }, getWindow(popper)) : {
|
6218 | x: x,
|
6219 | y: y
|
6220 | };
|
6221 | x = _ref4.x;
|
6222 | y = _ref4.y;
|
6223 | if (gpuAcceleration) {
|
6224 | var _Object$assign;
|
6225 | return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
6226 | }
|
6227 | return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
6228 | }
|
6229 | function computeStyles(_ref5) {
|
6230 | var state = _ref5.state,
|
6231 | options = _ref5.options;
|
6232 | var _options$gpuAccelerat = options.gpuAcceleration,
|
6233 | gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
6234 | _options$adaptive = options.adaptive,
|
6235 | adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
6236 | _options$roundOffsets = options.roundOffsets,
|
6237 | roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
6238 | if (false) { var transitionProperty; }
|
6239 | var commonStyles = {
|
6240 | placement: getBasePlacement(state.placement),
|
6241 | variation: getVariation(state.placement),
|
6242 | popper: state.elements.popper,
|
6243 | popperRect: state.rects.popper,
|
6244 | gpuAcceleration: gpuAcceleration,
|
6245 | isFixed: state.options.strategy === 'fixed'
|
6246 | };
|
6247 | if (state.modifiersData.popperOffsets != null) {
|
6248 | state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
6249 | offsets: state.modifiersData.popperOffsets,
|
6250 | position: state.options.strategy,
|
6251 | adaptive: adaptive,
|
6252 | roundOffsets: roundOffsets
|
6253 | })));
|
6254 | }
|
6255 | if (state.modifiersData.arrow != null) {
|
6256 | state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
6257 | offsets: state.modifiersData.arrow,
|
6258 | position: 'absolute',
|
6259 | adaptive: false,
|
6260 | roundOffsets: roundOffsets
|
6261 | })));
|
6262 | }
|
6263 | state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
6264 | 'data-popper-placement': state.placement
|
6265 | });
|
6266 | }
|
6267 |
|
6268 | const modifiers_computeStyles = ({
|
6269 | name: 'computeStyles',
|
6270 | enabled: true,
|
6271 | phase: 'beforeWrite',
|
6272 | fn: computeStyles,
|
6273 | data: {}
|
6274 | });
|
6275 | ;
|
6276 |
|
6277 |
|
6278 | var passive = {
|
6279 | passive: true
|
6280 | };
|
6281 | function eventListeners_effect(_ref) {
|
6282 | var state = _ref.state,
|
6283 | instance = _ref.instance,
|
6284 | options = _ref.options;
|
6285 | var _options$scroll = options.scroll,
|
6286 | scroll = _options$scroll === void 0 ? true : _options$scroll,
|
6287 | _options$resize = options.resize,
|
6288 | resize = _options$resize === void 0 ? true : _options$resize;
|
6289 | var window = getWindow(state.elements.popper);
|
6290 | var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
6291 | if (scroll) {
|
6292 | scrollParents.forEach(function (scrollParent) {
|
6293 | scrollParent.addEventListener('scroll', instance.update, passive);
|
6294 | });
|
6295 | }
|
6296 | if (resize) {
|
6297 | window.addEventListener('resize', instance.update, passive);
|
6298 | }
|
6299 | return function () {
|
6300 | if (scroll) {
|
6301 | scrollParents.forEach(function (scrollParent) {
|
6302 | scrollParent.removeEventListener('scroll', instance.update, passive);
|
6303 | });
|
6304 | }
|
6305 | if (resize) {
|
6306 | window.removeEventListener('resize', instance.update, passive);
|
6307 | }
|
6308 | };
|
6309 | }
|
6310 |
|
6311 | const eventListeners = ({
|
6312 | name: 'eventListeners',
|
6313 | enabled: true,
|
6314 | phase: 'write',
|
6315 | fn: function fn() {},
|
6316 | effect: eventListeners_effect,
|
6317 | data: {}
|
6318 | });
|
6319 | ;
|
6320 | var hash = {
|
6321 | left: 'right',
|
6322 | right: 'left',
|
6323 | bottom: 'top',
|
6324 | top: 'bottom'
|
6325 | };
|
6326 | function getOppositePlacement(placement) {
|
6327 | return placement.replace(/left|right|bottom|top/g, function (matched) {
|
6328 | return hash[matched];
|
6329 | });
|
6330 | }
|
6331 | ;
|
6332 | var getOppositeVariationPlacement_hash = {
|
6333 | start: 'end',
|
6334 | end: 'start'
|
6335 | };
|
6336 | function getOppositeVariationPlacement(placement) {
|
6337 | return placement.replace(/start|end/g, function (matched) {
|
6338 | return getOppositeVariationPlacement_hash[matched];
|
6339 | });
|
6340 | }
|
6341 | ;
|
6342 |
|
6343 | function getWindowScroll(node) {
|
6344 | var win = getWindow(node);
|
6345 | var scrollLeft = win.pageXOffset;
|
6346 | var scrollTop = win.pageYOffset;
|
6347 | return {
|
6348 | scrollLeft: scrollLeft,
|
6349 | scrollTop: scrollTop
|
6350 | };
|
6351 | }
|
6352 | ;
|
6353 |
|
6354 |
|
6355 |
|
6356 | function getWindowScrollBarX(element) {
|
6357 |
|
6358 |
|
6359 |
|
6360 |
|
6361 |
|
6362 |
|
6363 |
|
6364 | return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
6365 | }
|
6366 | ;
|
6367 |
|
6368 |
|
6369 |
|
6370 |
|
6371 | function getViewportRect(element, strategy) {
|
6372 | var win = getWindow(element);
|
6373 | var html = getDocumentElement(element);
|
6374 | var visualViewport = win.visualViewport;
|
6375 | var width = html.clientWidth;
|
6376 | var height = html.clientHeight;
|
6377 | var x = 0;
|
6378 | var y = 0;
|
6379 | if (visualViewport) {
|
6380 | width = visualViewport.width;
|
6381 | height = visualViewport.height;
|
6382 | var layoutViewport = isLayoutViewport();
|
6383 | if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
6384 | x = visualViewport.offsetLeft;
|
6385 | y = visualViewport.offsetTop;
|
6386 | }
|
6387 | }
|
6388 | return {
|
6389 | width: width,
|
6390 | height: height,
|
6391 | x: x + getWindowScrollBarX(element),
|
6392 | y: y
|
6393 | };
|
6394 | }
|
6395 | ;
|
6396 |
|
6397 |
|
6398 |
|
6399 |
|
6400 |
|
6401 |
|
6402 |
|
6403 | function getDocumentRect(element) {
|
6404 | var _element$ownerDocumen;
|
6405 | var html = getDocumentElement(element);
|
6406 | var winScroll = getWindowScroll(element);
|
6407 | var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
6408 | var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
6409 | var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
6410 | var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
6411 | var y = -winScroll.scrollTop;
|
6412 | if (dom_utils_getComputedStyle_getComputedStyle(body || html).direction === 'rtl') {
|
6413 | x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
6414 | }
|
6415 | return {
|
6416 | width: width,
|
6417 | height: height,
|
6418 | x: x,
|
6419 | y: y
|
6420 | };
|
6421 | }
|
6422 | ;
|
6423 |
|
6424 | function isScrollParent(element) {
|
6425 |
|
6426 | var _getComputedStyle = dom_utils_getComputedStyle_getComputedStyle(element),
|
6427 | overflow = _getComputedStyle.overflow,
|
6428 | overflowX = _getComputedStyle.overflowX,
|
6429 | overflowY = _getComputedStyle.overflowY;
|
6430 | return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
6431 | }
|
6432 | ;
|
6433 |
|
6434 |
|
6435 |
|
6436 |
|
6437 | function getScrollParent(node) {
|
6438 | if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
6439 |
|
6440 | return node.ownerDocument.body;
|
6441 | }
|
6442 | if (isHTMLElement(node) && isScrollParent(node)) {
|
6443 | return node;
|
6444 | }
|
6445 | return getScrollParent(getParentNode(node));
|
6446 | }
|
6447 | ;
|
6448 |
|
6449 |
|
6450 |
|
6451 |
|
6452 |
|
6453 |
|
6454 |
|
6455 |
|
6456 |
|
6457 |
|
6458 |
|
6459 | function listScrollParents(element, list) {
|
6460 | var _element$ownerDocumen;
|
6461 | if (list === void 0) {
|
6462 | list = [];
|
6463 | }
|
6464 | var scrollParent = getScrollParent(element);
|
6465 | var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
6466 | var win = getWindow(scrollParent);
|
6467 | var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
6468 | var updatedList = list.concat(target);
|
6469 | return isBody ? updatedList :
|
6470 |
|
6471 | updatedList.concat(listScrollParents(getParentNode(target)));
|
6472 | }
|
6473 | ;
|
6474 | function rectToClientRect(rect) {
|
6475 | return Object.assign({}, rect, {
|
6476 | left: rect.x,
|
6477 | top: rect.y,
|
6478 | right: rect.x + rect.width,
|
6479 | bottom: rect.y + rect.height
|
6480 | });
|
6481 | }
|
6482 | ;
|
6483 |
|
6484 |
|
6485 |
|
6486 |
|
6487 |
|
6488 |
|
6489 |
|
6490 |
|
6491 |
|
6492 |
|
6493 |
|
6494 |
|
6495 |
|
6496 |
|
6497 | function getInnerBoundingClientRect(element, strategy) {
|
6498 | var rect = getBoundingClientRect(element, false, strategy === 'fixed');
|
6499 | rect.top = rect.top + element.clientTop;
|
6500 | rect.left = rect.left + element.clientLeft;
|
6501 | rect.bottom = rect.top + element.clientHeight;
|
6502 | rect.right = rect.left + element.clientWidth;
|
6503 | rect.width = element.clientWidth;
|
6504 | rect.height = element.clientHeight;
|
6505 | rect.x = rect.left;
|
6506 | rect.y = rect.top;
|
6507 | return rect;
|
6508 | }
|
6509 | function getClientRectFromMixedType(element, clippingParent, strategy) {
|
6510 | return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
6511 | }
|
6512 |
|
6513 |
|
6514 |
|
6515 | function getClippingParents(element) {
|
6516 | var clippingParents = listScrollParents(getParentNode(element));
|
6517 | var canEscapeClipping = ['absolute', 'fixed'].indexOf(dom_utils_getComputedStyle_getComputedStyle(element).position) >= 0;
|
6518 | var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
6519 | if (!isElement(clipperElement)) {
|
6520 | return [];
|
6521 | }
|
6522 |
|
6523 | return clippingParents.filter(function (clippingParent) {
|
6524 | return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
6525 | });
|
6526 | }
|
6527 |
|
6528 |
|
6529 | function getClippingRect(element, boundary, rootBoundary, strategy) {
|
6530 | var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
6531 | var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
6532 | var firstClippingParent = clippingParents[0];
|
6533 | var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
6534 | var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
6535 | accRect.top = math_max(rect.top, accRect.top);
|
6536 | accRect.right = math_min(rect.right, accRect.right);
|
6537 | accRect.bottom = math_min(rect.bottom, accRect.bottom);
|
6538 | accRect.left = math_max(rect.left, accRect.left);
|
6539 | return accRect;
|
6540 | }, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
6541 | clippingRect.width = clippingRect.right - clippingRect.left;
|
6542 | clippingRect.height = clippingRect.bottom - clippingRect.top;
|
6543 | clippingRect.x = clippingRect.left;
|
6544 | clippingRect.y = clippingRect.top;
|
6545 | return clippingRect;
|
6546 | }
|
6547 | ;
|
6548 |
|
6549 |
|
6550 |
|
6551 |
|
6552 | function computeOffsets(_ref) {
|
6553 | var reference = _ref.reference,
|
6554 | element = _ref.element,
|
6555 | placement = _ref.placement;
|
6556 | var basePlacement = placement ? getBasePlacement(placement) : null;
|
6557 | var variation = placement ? getVariation(placement) : null;
|
6558 | var commonX = reference.x + reference.width / 2 - element.width / 2;
|
6559 | var commonY = reference.y + reference.height / 2 - element.height / 2;
|
6560 | var offsets;
|
6561 | switch (basePlacement) {
|
6562 | case enums_top:
|
6563 | offsets = {
|
6564 | x: commonX,
|
6565 | y: reference.y - element.height
|
6566 | };
|
6567 | break;
|
6568 | case bottom:
|
6569 | offsets = {
|
6570 | x: commonX,
|
6571 | y: reference.y + reference.height
|
6572 | };
|
6573 | break;
|
6574 | case right:
|
6575 | offsets = {
|
6576 | x: reference.x + reference.width,
|
6577 | y: commonY
|
6578 | };
|
6579 | break;
|
6580 | case left:
|
6581 | offsets = {
|
6582 | x: reference.x - element.width,
|
6583 | y: commonY
|
6584 | };
|
6585 | break;
|
6586 | default:
|
6587 | offsets = {
|
6588 | x: reference.x,
|
6589 | y: reference.y
|
6590 | };
|
6591 | }
|
6592 | var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
6593 | if (mainAxis != null) {
|
6594 | var len = mainAxis === 'y' ? 'height' : 'width';
|
6595 | switch (variation) {
|
6596 | case start:
|
6597 | offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
6598 | break;
|
6599 | case end:
|
6600 | offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
6601 | break;
|
6602 | default:
|
6603 | }
|
6604 | }
|
6605 | return offsets;
|
6606 | }
|
6607 | ;
|
6608 |
|
6609 |
|
6610 |
|
6611 |
|
6612 |
|
6613 |
|
6614 |
|
6615 |
|
6616 |
|
6617 |
|
6618 | function detectOverflow(state, options) {
|
6619 | if (options === void 0) {
|
6620 | options = {};
|
6621 | }
|
6622 | var _options = options,
|
6623 | _options$placement = _options.placement,
|
6624 | placement = _options$placement === void 0 ? state.placement : _options$placement,
|
6625 | _options$strategy = _options.strategy,
|
6626 | strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
|
6627 | _options$boundary = _options.boundary,
|
6628 | boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
|
6629 | _options$rootBoundary = _options.rootBoundary,
|
6630 | rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
|
6631 | _options$elementConte = _options.elementContext,
|
6632 | elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
|
6633 | _options$altBoundary = _options.altBoundary,
|
6634 | altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
|
6635 | _options$padding = _options.padding,
|
6636 | padding = _options$padding === void 0 ? 0 : _options$padding;
|
6637 | var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
6638 | var altContext = elementContext === popper ? reference : popper;
|
6639 | var popperRect = state.rects.popper;
|
6640 | var element = state.elements[altBoundary ? altContext : elementContext];
|
6641 | var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
6642 | var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
6643 | var popperOffsets = computeOffsets({
|
6644 | reference: referenceClientRect,
|
6645 | element: popperRect,
|
6646 | strategy: 'absolute',
|
6647 | placement: placement
|
6648 | });
|
6649 | var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
6650 | var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
6651 |
|
6652 |
|
6653 | var overflowOffsets = {
|
6654 | top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
6655 | bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
6656 | left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
6657 | right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
6658 | };
|
6659 | var offsetData = state.modifiersData.offset;
|
6660 |
|
6661 | if (elementContext === popper && offsetData) {
|
6662 | var offset = offsetData[placement];
|
6663 | Object.keys(overflowOffsets).forEach(function (key) {
|
6664 | var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
6665 | var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
|
6666 | overflowOffsets[key] += offset[axis] * multiply;
|
6667 | });
|
6668 | }
|
6669 | return overflowOffsets;
|
6670 | }
|
6671 | ;
|
6672 |
|
6673 |
|
6674 |
|
6675 |
|
6676 | function computeAutoPlacement(state, options) {
|
6677 | if (options === void 0) {
|
6678 | options = {};
|
6679 | }
|
6680 | var _options = options,
|
6681 | placement = _options.placement,
|
6682 | boundary = _options.boundary,
|
6683 | rootBoundary = _options.rootBoundary,
|
6684 | padding = _options.padding,
|
6685 | flipVariations = _options.flipVariations,
|
6686 | _options$allowedAutoP = _options.allowedAutoPlacements,
|
6687 | allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP;
|
6688 | var variation = getVariation(placement);
|
6689 | var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
6690 | return getVariation(placement) === variation;
|
6691 | }) : basePlacements;
|
6692 | var allowedPlacements = placements.filter(function (placement) {
|
6693 | return allowedAutoPlacements.indexOf(placement) >= 0;
|
6694 | });
|
6695 | if (allowedPlacements.length === 0) {
|
6696 | allowedPlacements = placements;
|
6697 | if (false) {}
|
6698 | }
|
6699 |
|
6700 | var overflows = allowedPlacements.reduce(function (acc, placement) {
|
6701 | acc[placement] = detectOverflow(state, {
|
6702 | placement: placement,
|
6703 | boundary: boundary,
|
6704 | rootBoundary: rootBoundary,
|
6705 | padding: padding
|
6706 | })[getBasePlacement(placement)];
|
6707 | return acc;
|
6708 | }, {});
|
6709 | return Object.keys(overflows).sort(function (a, b) {
|
6710 | return overflows[a] - overflows[b];
|
6711 | });
|
6712 | }
|
6713 | ;
|
6714 |
|
6715 |
|
6716 |
|
6717 |
|
6718 |
|
6719 |
|
6720 |
|
6721 |
|
6722 | function getExpandedFallbackPlacements(placement) {
|
6723 | if (getBasePlacement(placement) === auto) {
|
6724 | return [];
|
6725 | }
|
6726 | var oppositePlacement = getOppositePlacement(placement);
|
6727 | return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
6728 | }
|
6729 | function flip(_ref) {
|
6730 | var state = _ref.state,
|
6731 | options = _ref.options,
|
6732 | name = _ref.name;
|
6733 | if (state.modifiersData[name]._skip) {
|
6734 | return;
|
6735 | }
|
6736 | var _options$mainAxis = options.mainAxis,
|
6737 | checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
6738 | _options$altAxis = options.altAxis,
|
6739 | checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
|
6740 | specifiedFallbackPlacements = options.fallbackPlacements,
|
6741 | padding = options.padding,
|
6742 | boundary = options.boundary,
|
6743 | rootBoundary = options.rootBoundary,
|
6744 | altBoundary = options.altBoundary,
|
6745 | _options$flipVariatio = options.flipVariations,
|
6746 | flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
|
6747 | allowedAutoPlacements = options.allowedAutoPlacements;
|
6748 | var preferredPlacement = state.options.placement;
|
6749 | var basePlacement = getBasePlacement(preferredPlacement);
|
6750 | var isBasePlacement = basePlacement === preferredPlacement;
|
6751 | var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
6752 | var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
6753 | return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
6754 | placement: placement,
|
6755 | boundary: boundary,
|
6756 | rootBoundary: rootBoundary,
|
6757 | padding: padding,
|
6758 | flipVariations: flipVariations,
|
6759 | allowedAutoPlacements: allowedAutoPlacements
|
6760 | }) : placement);
|
6761 | }, []);
|
6762 | var referenceRect = state.rects.reference;
|
6763 | var popperRect = state.rects.popper;
|
6764 | var checksMap = new Map();
|
6765 | var makeFallbackChecks = true;
|
6766 | var firstFittingPlacement = placements[0];
|
6767 | for (var i = 0; i < placements.length; i++) {
|
6768 | var placement = placements[i];
|
6769 | var _basePlacement = getBasePlacement(placement);
|
6770 | var isStartVariation = getVariation(placement) === start;
|
6771 | var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0;
|
6772 | var len = isVertical ? 'width' : 'height';
|
6773 | var overflow = detectOverflow(state, {
|
6774 | placement: placement,
|
6775 | boundary: boundary,
|
6776 | rootBoundary: rootBoundary,
|
6777 | altBoundary: altBoundary,
|
6778 | padding: padding
|
6779 | });
|
6780 | var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top;
|
6781 | if (referenceRect[len] > popperRect[len]) {
|
6782 | mainVariationSide = getOppositePlacement(mainVariationSide);
|
6783 | }
|
6784 | var altVariationSide = getOppositePlacement(mainVariationSide);
|
6785 | var checks = [];
|
6786 | if (checkMainAxis) {
|
6787 | checks.push(overflow[_basePlacement] <= 0);
|
6788 | }
|
6789 | if (checkAltAxis) {
|
6790 | checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
6791 | }
|
6792 | if (checks.every(function (check) {
|
6793 | return check;
|
6794 | })) {
|
6795 | firstFittingPlacement = placement;
|
6796 | makeFallbackChecks = false;
|
6797 | break;
|
6798 | }
|
6799 | checksMap.set(placement, checks);
|
6800 | }
|
6801 | if (makeFallbackChecks) {
|
6802 |
|
6803 | var numberOfChecks = flipVariations ? 3 : 1;
|
6804 | var _loop = function _loop(_i) {
|
6805 | var fittingPlacement = placements.find(function (placement) {
|
6806 | var checks = checksMap.get(placement);
|
6807 | if (checks) {
|
6808 | return checks.slice(0, _i).every(function (check) {
|
6809 | return check;
|
6810 | });
|
6811 | }
|
6812 | });
|
6813 | if (fittingPlacement) {
|
6814 | firstFittingPlacement = fittingPlacement;
|
6815 | return "break";
|
6816 | }
|
6817 | };
|
6818 | for (var _i = numberOfChecks; _i > 0; _i--) {
|
6819 | var _ret = _loop(_i);
|
6820 | if (_ret === "break") break;
|
6821 | }
|
6822 | }
|
6823 | if (state.placement !== firstFittingPlacement) {
|
6824 | state.modifiersData[name]._skip = true;
|
6825 | state.placement = firstFittingPlacement;
|
6826 | state.reset = true;
|
6827 | }
|
6828 | }
|
6829 |
|
6830 | const modifiers_flip = ({
|
6831 | name: 'flip',
|
6832 | enabled: true,
|
6833 | phase: 'main',
|
6834 | fn: flip,
|
6835 | requiresIfExists: ['offset'],
|
6836 | data: {
|
6837 | _skip: false
|
6838 | }
|
6839 | });
|
6840 | ;
|
6841 |
|
6842 |
|
6843 | function getSideOffsets(overflow, rect, preventedOffsets) {
|
6844 | if (preventedOffsets === void 0) {
|
6845 | preventedOffsets = {
|
6846 | x: 0,
|
6847 | y: 0
|
6848 | };
|
6849 | }
|
6850 | return {
|
6851 | top: overflow.top - rect.height - preventedOffsets.y,
|
6852 | right: overflow.right - rect.width + preventedOffsets.x,
|
6853 | bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
6854 | left: overflow.left - rect.width - preventedOffsets.x
|
6855 | };
|
6856 | }
|
6857 | function isAnySideFullyClipped(overflow) {
|
6858 | return [enums_top, right, bottom, left].some(function (side) {
|
6859 | return overflow[side] >= 0;
|
6860 | });
|
6861 | }
|
6862 | function hide(_ref) {
|
6863 | var state = _ref.state,
|
6864 | name = _ref.name;
|
6865 | var referenceRect = state.rects.reference;
|
6866 | var popperRect = state.rects.popper;
|
6867 | var preventedOffsets = state.modifiersData.preventOverflow;
|
6868 | var referenceOverflow = detectOverflow(state, {
|
6869 | elementContext: 'reference'
|
6870 | });
|
6871 | var popperAltOverflow = detectOverflow(state, {
|
6872 | altBoundary: true
|
6873 | });
|
6874 | var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
6875 | var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
6876 | var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
6877 | var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
6878 | state.modifiersData[name] = {
|
6879 | referenceClippingOffsets: referenceClippingOffsets,
|
6880 | popperEscapeOffsets: popperEscapeOffsets,
|
6881 | isReferenceHidden: isReferenceHidden,
|
6882 | hasPopperEscaped: hasPopperEscaped
|
6883 | };
|
6884 | state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
6885 | 'data-popper-reference-hidden': isReferenceHidden,
|
6886 | 'data-popper-escaped': hasPopperEscaped
|
6887 | });
|
6888 | }
|
6889 |
|
6890 | const modifiers_hide = ({
|
6891 | name: 'hide',
|
6892 | enabled: true,
|
6893 | phase: 'main',
|
6894 | requiresIfExists: ['preventOverflow'],
|
6895 | fn: hide
|
6896 | });
|
6897 | ;
|
6898 |
|
6899 |
|
6900 |
|
6901 | function distanceAndSkiddingToXY(placement, rects, offset) {
|
6902 | var basePlacement = getBasePlacement(placement);
|
6903 | var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
6904 | var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
6905 | placement: placement
|
6906 | })) : offset,
|
6907 | skidding = _ref[0],
|
6908 | distance = _ref[1];
|
6909 | skidding = skidding || 0;
|
6910 | distance = (distance || 0) * invertDistance;
|
6911 | return [left, right].indexOf(basePlacement) >= 0 ? {
|
6912 | x: distance,
|
6913 | y: skidding
|
6914 | } : {
|
6915 | x: skidding,
|
6916 | y: distance
|
6917 | };
|
6918 | }
|
6919 | function offset(_ref2) {
|
6920 | var state = _ref2.state,
|
6921 | options = _ref2.options,
|
6922 | name = _ref2.name;
|
6923 | var _options$offset = options.offset,
|
6924 | offset = _options$offset === void 0 ? [0, 0] : _options$offset;
|
6925 | var data = enums_placements.reduce(function (acc, placement) {
|
6926 | acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
6927 | return acc;
|
6928 | }, {});
|
6929 | var _data$state$placement = data[state.placement],
|
6930 | x = _data$state$placement.x,
|
6931 | y = _data$state$placement.y;
|
6932 | if (state.modifiersData.popperOffsets != null) {
|
6933 | state.modifiersData.popperOffsets.x += x;
|
6934 | state.modifiersData.popperOffsets.y += y;
|
6935 | }
|
6936 | state.modifiersData[name] = data;
|
6937 | }
|
6938 |
|
6939 | const modifiers_offset = ({
|
6940 | name: 'offset',
|
6941 | enabled: true,
|
6942 | phase: 'main',
|
6943 | requires: ['popperOffsets'],
|
6944 | fn: offset
|
6945 | });
|
6946 | ;
|
6947 |
|
6948 | function popperOffsets(_ref) {
|
6949 | var state = _ref.state,
|
6950 | name = _ref.name;
|
6951 |
|
6952 |
|
6953 |
|
6954 |
|
6955 | state.modifiersData[name] = computeOffsets({
|
6956 | reference: state.rects.reference,
|
6957 | element: state.rects.popper,
|
6958 | strategy: 'absolute',
|
6959 | placement: state.placement
|
6960 | });
|
6961 | }
|
6962 |
|
6963 | const modifiers_popperOffsets = ({
|
6964 | name: 'popperOffsets',
|
6965 | enabled: true,
|
6966 | phase: 'read',
|
6967 | fn: popperOffsets,
|
6968 | data: {}
|
6969 | });
|
6970 | ;
|
6971 | function getAltAxis(axis) {
|
6972 | return axis === 'x' ? 'y' : 'x';
|
6973 | }
|
6974 | ;
|
6975 |
|
6976 |
|
6977 |
|
6978 |
|
6979 |
|
6980 |
|
6981 |
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 | function preventOverflow(_ref) {
|
6987 | var state = _ref.state,
|
6988 | options = _ref.options,
|
6989 | name = _ref.name;
|
6990 | var _options$mainAxis = options.mainAxis,
|
6991 | checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
6992 | _options$altAxis = options.altAxis,
|
6993 | checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
|
6994 | boundary = options.boundary,
|
6995 | rootBoundary = options.rootBoundary,
|
6996 | altBoundary = options.altBoundary,
|
6997 | padding = options.padding,
|
6998 | _options$tether = options.tether,
|
6999 | tether = _options$tether === void 0 ? true : _options$tether,
|
7000 | _options$tetherOffset = options.tetherOffset,
|
7001 | tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
7002 | var overflow = detectOverflow(state, {
|
7003 | boundary: boundary,
|
7004 | rootBoundary: rootBoundary,
|
7005 | padding: padding,
|
7006 | altBoundary: altBoundary
|
7007 | });
|
7008 | var basePlacement = getBasePlacement(state.placement);
|
7009 | var variation = getVariation(state.placement);
|
7010 | var isBasePlacement = !variation;
|
7011 | var mainAxis = getMainAxisFromPlacement(basePlacement);
|
7012 | var altAxis = getAltAxis(mainAxis);
|
7013 | var popperOffsets = state.modifiersData.popperOffsets;
|
7014 | var referenceRect = state.rects.reference;
|
7015 | var popperRect = state.rects.popper;
|
7016 | var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
7017 | placement: state.placement
|
7018 | })) : tetherOffset;
|
7019 | var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
7020 | mainAxis: tetherOffsetValue,
|
7021 | altAxis: tetherOffsetValue
|
7022 | } : Object.assign({
|
7023 | mainAxis: 0,
|
7024 | altAxis: 0
|
7025 | }, tetherOffsetValue);
|
7026 | var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
7027 | var data = {
|
7028 | x: 0,
|
7029 | y: 0
|
7030 | };
|
7031 | if (!popperOffsets) {
|
7032 | return;
|
7033 | }
|
7034 | if (checkMainAxis) {
|
7035 | var _offsetModifierState$;
|
7036 | var mainSide = mainAxis === 'y' ? enums_top : left;
|
7037 | var altSide = mainAxis === 'y' ? bottom : right;
|
7038 | var len = mainAxis === 'y' ? 'height' : 'width';
|
7039 | var offset = popperOffsets[mainAxis];
|
7040 | var min = offset + overflow[mainSide];
|
7041 | var max = offset - overflow[altSide];
|
7042 | var additive = tether ? -popperRect[len] / 2 : 0;
|
7043 | var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
7044 | var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
7045 |
|
7046 |
|
7047 | var arrowElement = state.elements.arrow;
|
7048 | var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
7049 | width: 0,
|
7050 | height: 0
|
7051 | };
|
7052 | var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
|
7053 | var arrowPaddingMin = arrowPaddingObject[mainSide];
|
7054 | var arrowPaddingMax = arrowPaddingObject[altSide];
|
7055 |
|
7056 |
|
7057 |
|
7058 |
|
7059 |
|
7060 | var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
7061 | var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
7062 | var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
7063 | var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
7064 | var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
7065 | var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
7066 | var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
7067 | var tetherMax = offset + maxOffset - offsetModifierValue;
|
7068 | var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max);
|
7069 | popperOffsets[mainAxis] = preventedOffset;
|
7070 | data[mainAxis] = preventedOffset - offset;
|
7071 | }
|
7072 | if (checkAltAxis) {
|
7073 | var _offsetModifierState$2;
|
7074 | var _mainSide = mainAxis === 'x' ? enums_top : left;
|
7075 | var _altSide = mainAxis === 'x' ? bottom : right;
|
7076 | var _offset = popperOffsets[altAxis];
|
7077 | var _len = altAxis === 'y' ? 'height' : 'width';
|
7078 | var _min = _offset + overflow[_mainSide];
|
7079 | var _max = _offset - overflow[_altSide];
|
7080 | var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1;
|
7081 | var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
7082 | var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
7083 | var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
7084 | var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
7085 | popperOffsets[altAxis] = _preventedOffset;
|
7086 | data[altAxis] = _preventedOffset - _offset;
|
7087 | }
|
7088 | state.modifiersData[name] = data;
|
7089 | }
|
7090 |
|
7091 | const modifiers_preventOverflow = ({
|
7092 | name: 'preventOverflow',
|
7093 | enabled: true,
|
7094 | phase: 'main',
|
7095 | fn: preventOverflow,
|
7096 | requiresIfExists: ['offset']
|
7097 | });
|
7098 | ;
|
7099 | function getHTMLElementScroll(element) {
|
7100 | return {
|
7101 | scrollLeft: element.scrollLeft,
|
7102 | scrollTop: element.scrollTop
|
7103 | };
|
7104 | }
|
7105 | ;
|
7106 |
|
7107 |
|
7108 |
|
7109 |
|
7110 | function getNodeScroll(node) {
|
7111 | if (node === getWindow(node) || !isHTMLElement(node)) {
|
7112 | return getWindowScroll(node);
|
7113 | } else {
|
7114 | return getHTMLElementScroll(node);
|
7115 | }
|
7116 | }
|
7117 | ;
|
7118 |
|
7119 |
|
7120 |
|
7121 |
|
7122 |
|
7123 |
|
7124 |
|
7125 |
|
7126 | function isElementScaled(element) {
|
7127 | var rect = element.getBoundingClientRect();
|
7128 | var scaleX = round(rect.width) / element.offsetWidth || 1;
|
7129 | var scaleY = round(rect.height) / element.offsetHeight || 1;
|
7130 | return scaleX !== 1 || scaleY !== 1;
|
7131 | }
|
7132 |
|
7133 |
|
7134 | function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
7135 | if (isFixed === void 0) {
|
7136 | isFixed = false;
|
7137 | }
|
7138 | var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
7139 | var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
7140 | var documentElement = getDocumentElement(offsetParent);
|
7141 | var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
7142 | var scroll = {
|
7143 | scrollLeft: 0,
|
7144 | scrollTop: 0
|
7145 | };
|
7146 | var offsets = {
|
7147 | x: 0,
|
7148 | y: 0
|
7149 | };
|
7150 | if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
7151 | if (getNodeName(offsetParent) !== 'body' ||
|
7152 |
|
7153 | isScrollParent(documentElement)) {
|
7154 | scroll = getNodeScroll(offsetParent);
|
7155 | }
|
7156 | if (isHTMLElement(offsetParent)) {
|
7157 | offsets = getBoundingClientRect(offsetParent, true);
|
7158 | offsets.x += offsetParent.clientLeft;
|
7159 | offsets.y += offsetParent.clientTop;
|
7160 | } else if (documentElement) {
|
7161 | offsets.x = getWindowScrollBarX(documentElement);
|
7162 | }
|
7163 | }
|
7164 | return {
|
7165 | x: rect.left + scroll.scrollLeft - offsets.x,
|
7166 | y: rect.top + scroll.scrollTop - offsets.y,
|
7167 | width: rect.width,
|
7168 | height: rect.height
|
7169 | };
|
7170 | }
|
7171 | ;
|
7172 |
|
7173 |
|
7174 | function order(modifiers) {
|
7175 | var map = new Map();
|
7176 | var visited = new Set();
|
7177 | var result = [];
|
7178 | modifiers.forEach(function (modifier) {
|
7179 | map.set(modifier.name, modifier);
|
7180 | });
|
7181 |
|
7182 | function sort(modifier) {
|
7183 | visited.add(modifier.name);
|
7184 | var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
7185 | requires.forEach(function (dep) {
|
7186 | if (!visited.has(dep)) {
|
7187 | var depModifier = map.get(dep);
|
7188 | if (depModifier) {
|
7189 | sort(depModifier);
|
7190 | }
|
7191 | }
|
7192 | });
|
7193 | result.push(modifier);
|
7194 | }
|
7195 | modifiers.forEach(function (modifier) {
|
7196 | if (!visited.has(modifier.name)) {
|
7197 |
|
7198 | sort(modifier);
|
7199 | }
|
7200 | });
|
7201 | return result;
|
7202 | }
|
7203 | function orderModifiers(modifiers) {
|
7204 |
|
7205 | var orderedModifiers = order(modifiers);
|
7206 |
|
7207 | return modifierPhases.reduce(function (acc, phase) {
|
7208 | return acc.concat(orderedModifiers.filter(function (modifier) {
|
7209 | return modifier.phase === phase;
|
7210 | }));
|
7211 | }, []);
|
7212 | }
|
7213 | ;
|
7214 | function debounce(fn) {
|
7215 | var pending;
|
7216 | return function () {
|
7217 | if (!pending) {
|
7218 | pending = new Promise(function (resolve) {
|
7219 | Promise.resolve().then(function () {
|
7220 | pending = undefined;
|
7221 | resolve(fn());
|
7222 | });
|
7223 | });
|
7224 | }
|
7225 | return pending;
|
7226 | };
|
7227 | }
|
7228 | ;
|
7229 | function mergeByName(modifiers) {
|
7230 | var merged = modifiers.reduce(function (merged, current) {
|
7231 | var existing = merged[current.name];
|
7232 | merged[current.name] = existing ? Object.assign({}, existing, current, {
|
7233 | options: Object.assign({}, existing.options, current.options),
|
7234 | data: Object.assign({}, existing.data, current.data)
|
7235 | }) : current;
|
7236 | return merged;
|
7237 | }, {});
|
7238 |
|
7239 | return Object.keys(merged).map(function (key) {
|
7240 | return merged[key];
|
7241 | });
|
7242 | }
|
7243 | ;
|
7244 |
|
7245 |
|
7246 |
|
7247 |
|
7248 |
|
7249 |
|
7250 |
|
7251 |
|
7252 |
|
7253 |
|
7254 |
|
7255 |
|
7256 |
|
7257 |
|
7258 | var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
|
7259 | var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
|
7260 | var DEFAULT_OPTIONS = {
|
7261 | placement: 'bottom',
|
7262 | modifiers: [],
|
7263 | strategy: 'absolute'
|
7264 | };
|
7265 | function areValidElements() {
|
7266 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
7267 | args[_key] = arguments[_key];
|
7268 | }
|
7269 | return !args.some(function (element) {
|
7270 | return !(element && typeof element.getBoundingClientRect === 'function');
|
7271 | });
|
7272 | }
|
7273 | function popperGenerator(generatorOptions) {
|
7274 | if (generatorOptions === void 0) {
|
7275 | generatorOptions = {};
|
7276 | }
|
7277 | var _generatorOptions = generatorOptions,
|
7278 | _generatorOptions$def = _generatorOptions.defaultModifiers,
|
7279 | defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
|
7280 | _generatorOptions$def2 = _generatorOptions.defaultOptions,
|
7281 | defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
7282 | return function createPopper(reference, popper, options) {
|
7283 | if (options === void 0) {
|
7284 | options = defaultOptions;
|
7285 | }
|
7286 | var state = {
|
7287 | placement: 'bottom',
|
7288 | orderedModifiers: [],
|
7289 | options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
7290 | modifiersData: {},
|
7291 | elements: {
|
7292 | reference: reference,
|
7293 | popper: popper
|
7294 | },
|
7295 | attributes: {},
|
7296 | styles: {}
|
7297 | };
|
7298 | var effectCleanupFns = [];
|
7299 | var isDestroyed = false;
|
7300 | var instance = {
|
7301 | state: state,
|
7302 | setOptions: function setOptions(setOptionsAction) {
|
7303 | var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
7304 | cleanupModifierEffects();
|
7305 | state.options = Object.assign({}, defaultOptions, state.options, options);
|
7306 | state.scrollParents = {
|
7307 | reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
7308 | popper: listScrollParents(popper)
|
7309 | };
|
7310 |
|
7311 |
|
7312 | var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers)));
|
7313 |
|
7314 | state.orderedModifiers = orderedModifiers.filter(function (m) {
|
7315 | return m.enabled;
|
7316 | });
|
7317 |
|
7318 |
|
7319 | if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; }
|
7320 | runModifierEffects();
|
7321 | return instance.update();
|
7322 | },
|
7323 |
|
7324 |
|
7325 |
|
7326 |
|
7327 |
|
7328 | forceUpdate: function forceUpdate() {
|
7329 | if (isDestroyed) {
|
7330 | return;
|
7331 | }
|
7332 | var _state$elements = state.elements,
|
7333 | reference = _state$elements.reference,
|
7334 | popper = _state$elements.popper;
|
7335 |
|
7336 |
|
7337 | if (!areValidElements(reference, popper)) {
|
7338 | if (false) {}
|
7339 | return;
|
7340 | }
|
7341 |
|
7342 | state.rects = {
|
7343 | reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
7344 | popper: getLayoutRect(popper)
|
7345 | };
|
7346 |
|
7347 |
|
7348 |
|
7349 |
|
7350 |
|
7351 | state.reset = false;
|
7352 | state.placement = state.options.placement;
|
7353 |
|
7354 |
|
7355 |
|
7356 |
|
7357 | state.orderedModifiers.forEach(function (modifier) {
|
7358 | return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
7359 | });
|
7360 | var __debug_loops__ = 0;
|
7361 | for (var index = 0; index < state.orderedModifiers.length; index++) {
|
7362 | if (false) {}
|
7363 | if (state.reset === true) {
|
7364 | state.reset = false;
|
7365 | index = -1;
|
7366 | continue;
|
7367 | }
|
7368 | var _state$orderedModifie = state.orderedModifiers[index],
|
7369 | fn = _state$orderedModifie.fn,
|
7370 | _state$orderedModifie2 = _state$orderedModifie.options,
|
7371 | _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
7372 | name = _state$orderedModifie.name;
|
7373 | if (typeof fn === 'function') {
|
7374 | state = fn({
|
7375 | state: state,
|
7376 | options: _options,
|
7377 | name: name,
|
7378 | instance: instance
|
7379 | }) || state;
|
7380 | }
|
7381 | }
|
7382 | },
|
7383 |
|
7384 |
|
7385 | update: debounce(function () {
|
7386 | return new Promise(function (resolve) {
|
7387 | instance.forceUpdate();
|
7388 | resolve(state);
|
7389 | });
|
7390 | }),
|
7391 | destroy: function destroy() {
|
7392 | cleanupModifierEffects();
|
7393 | isDestroyed = true;
|
7394 | }
|
7395 | };
|
7396 | if (!areValidElements(reference, popper)) {
|
7397 | if (false) {}
|
7398 | return instance;
|
7399 | }
|
7400 | instance.setOptions(options).then(function (state) {
|
7401 | if (!isDestroyed && options.onFirstUpdate) {
|
7402 | options.onFirstUpdate(state);
|
7403 | }
|
7404 | });
|
7405 |
|
7406 |
|
7407 |
|
7408 |
|
7409 |
|
7410 | function runModifierEffects() {
|
7411 | state.orderedModifiers.forEach(function (_ref3) {
|
7412 | var name = _ref3.name,
|
7413 | _ref3$options = _ref3.options,
|
7414 | options = _ref3$options === void 0 ? {} : _ref3$options,
|
7415 | effect = _ref3.effect;
|
7416 | if (typeof effect === 'function') {
|
7417 | var cleanupFn = effect({
|
7418 | state: state,
|
7419 | name: name,
|
7420 | instance: instance,
|
7421 | options: options
|
7422 | });
|
7423 | var noopFn = function noopFn() {};
|
7424 | effectCleanupFns.push(cleanupFn || noopFn);
|
7425 | }
|
7426 | });
|
7427 | }
|
7428 | function cleanupModifierEffects() {
|
7429 | effectCleanupFns.forEach(function (fn) {
|
7430 | return fn();
|
7431 | });
|
7432 | effectCleanupFns = [];
|
7433 | }
|
7434 | return instance;
|
7435 | };
|
7436 | }
|
7437 | var createPopper = ( null && (popperGenerator()));
|
7438 |
|
7439 |
|
7440 | ;
|
7441 |
|
7442 |
|
7443 |
|
7444 |
|
7445 |
|
7446 |
|
7447 |
|
7448 |
|
7449 |
|
7450 |
|
7451 |
|
7452 |
|
7453 |
|
7454 | const popper_createPopper = popperGenerator({
|
7455 | defaultModifiers: [modifiers_hide, modifiers_popperOffsets, modifiers_computeStyles, eventListeners, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow]
|
7456 | });
|
7457 |
|
7458 | ;
|
7459 | const usePopper_excluded = ["enabled", "placement", "strategy", "modifiers"];
|
7460 | function usePopper_objectWithoutPropertiesLoose(source, excluded) {
|
7461 | if (source == null) return {};
|
7462 | var target = {};
|
7463 | var sourceKeys = Object.keys(source);
|
7464 | var key, i;
|
7465 | for (i = 0; i < sourceKeys.length; i++) {
|
7466 | key = sourceKeys[i];
|
7467 | if (excluded.indexOf(key) >= 0) continue;
|
7468 | target[key] = source[key];
|
7469 | }
|
7470 | return target;
|
7471 | }
|
7472 |
|
7473 |
|
7474 |
|
7475 |
|
7476 | const disabledApplyStylesModifier = {
|
7477 | name: 'applyStyles',
|
7478 | enabled: false,
|
7479 | phase: 'afterWrite',
|
7480 | fn: () => undefined
|
7481 | };
|
7482 |
|
7483 |
|
7484 |
|
7485 | const ariaDescribedByModifier = {
|
7486 | name: 'ariaDescribedBy',
|
7487 | enabled: true,
|
7488 | phase: 'afterWrite',
|
7489 | effect: ({
|
7490 | state
|
7491 | }) => () => {
|
7492 | const {
|
7493 | reference,
|
7494 | popper
|
7495 | } = state.elements;
|
7496 | if ('removeAttribute' in reference) {
|
7497 | const ids = (reference.getAttribute('aria-describedby') || '').split(',').filter(id => id.trim() !== popper.id);
|
7498 | if (!ids.length) reference.removeAttribute('aria-describedby');else reference.setAttribute('aria-describedby', ids.join(','));
|
7499 | }
|
7500 | },
|
7501 | fn: ({
|
7502 | state
|
7503 | }) => {
|
7504 | var _popper$getAttribute;
|
7505 | const {
|
7506 | popper,
|
7507 | reference
|
7508 | } = state.elements;
|
7509 | const role = (_popper$getAttribute = popper.getAttribute('role')) == null ? void 0 : _popper$getAttribute.toLowerCase();
|
7510 | if (popper.id && role === 'tooltip' && 'setAttribute' in reference) {
|
7511 | const ids = reference.getAttribute('aria-describedby');
|
7512 | if (ids && ids.split(',').indexOf(popper.id) !== -1) {
|
7513 | return;
|
7514 | }
|
7515 | reference.setAttribute('aria-describedby', ids ? `${ids},${popper.id}` : popper.id);
|
7516 | }
|
7517 | }
|
7518 | };
|
7519 | const EMPTY_MODIFIERS = [];
|
7520 |
|
7521 |
|
7522 |
|
7523 |
|
7524 |
|
7525 |
|
7526 |
|
7527 |
|
7528 |
|
7529 |
|
7530 |
|
7531 |
|
7532 |
|
7533 |
|
7534 |
|
7535 | function usePopper(referenceElement, popperElement, _ref = {}) {
|
7536 | let {
|
7537 | enabled = true,
|
7538 | placement = 'bottom',
|
7539 | strategy = 'absolute',
|
7540 | modifiers = EMPTY_MODIFIERS
|
7541 | } = _ref,
|
7542 | config = usePopper_objectWithoutPropertiesLoose(_ref, usePopper_excluded);
|
7543 | const prevModifiers = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(modifiers);
|
7544 | const popperInstanceRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
7545 | const update = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
|
7546 | var _popperInstanceRef$cu;
|
7547 | (_popperInstanceRef$cu = popperInstanceRef.current) == null ? void 0 : _popperInstanceRef$cu.update();
|
7548 | }, []);
|
7549 | const forceUpdate = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
|
7550 | var _popperInstanceRef$cu2;
|
7551 | (_popperInstanceRef$cu2 = popperInstanceRef.current) == null ? void 0 : _popperInstanceRef$cu2.forceUpdate();
|
7552 | }, []);
|
7553 | const [popperState, setState] = esm_useSafeState((0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
|
7554 | placement,
|
7555 | update,
|
7556 | forceUpdate,
|
7557 | attributes: {},
|
7558 | styles: {
|
7559 | popper: {},
|
7560 | arrow: {}
|
7561 | }
|
7562 | }));
|
7563 | const updateModifier = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
7564 | name: 'updateStateModifier',
|
7565 | enabled: true,
|
7566 | phase: 'write',
|
7567 | requires: ['computeStyles'],
|
7568 | fn: ({
|
7569 | state
|
7570 | }) => {
|
7571 | const styles = {};
|
7572 | const attributes = {};
|
7573 | Object.keys(state.elements).forEach(element => {
|
7574 | styles[element] = state.styles[element];
|
7575 | attributes[element] = state.attributes[element];
|
7576 | });
|
7577 | setState({
|
7578 | state,
|
7579 | styles,
|
7580 | attributes,
|
7581 | update,
|
7582 | forceUpdate,
|
7583 | placement: state.placement
|
7584 | });
|
7585 | }
|
7586 | }), [update, forceUpdate, setState]);
|
7587 | const nextModifiers = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
|
7588 | if (!dequal(prevModifiers.current, modifiers)) {
|
7589 | prevModifiers.current = modifiers;
|
7590 | }
|
7591 | return prevModifiers.current;
|
7592 | }, [modifiers]);
|
7593 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
7594 | if (!popperInstanceRef.current || !enabled) return;
|
7595 | popperInstanceRef.current.setOptions({
|
7596 | placement,
|
7597 | strategy,
|
7598 | modifiers: [...nextModifiers, updateModifier, disabledApplyStylesModifier]
|
7599 | });
|
7600 | }, [strategy, placement, updateModifier, enabled, nextModifiers]);
|
7601 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
7602 | if (!enabled || referenceElement == null || popperElement == null) {
|
7603 | return undefined;
|
7604 | }
|
7605 | popperInstanceRef.current = popper_createPopper(referenceElement, popperElement, Object.assign({}, config, {
|
7606 | placement,
|
7607 | strategy,
|
7608 | modifiers: [...nextModifiers, ariaDescribedByModifier, updateModifier]
|
7609 | }));
|
7610 | return () => {
|
7611 | if (popperInstanceRef.current != null) {
|
7612 | popperInstanceRef.current.destroy();
|
7613 | popperInstanceRef.current = undefined;
|
7614 | setState(s => Object.assign({}, s, {
|
7615 | attributes: {},
|
7616 | styles: {
|
7617 | popper: {}
|
7618 | }
|
7619 | }));
|
7620 | }
|
7621 | };
|
7622 |
|
7623 |
|
7624 | }, [enabled, referenceElement, popperElement]);
|
7625 | return popperState;
|
7626 | }
|
7627 | const esm_usePopper = (usePopper);
|
7628 | ;
|
7629 |
|
7630 |
|
7631 |
|
7632 |
|
7633 |
|
7634 |
|
7635 |
|
7636 |
|
7637 | function contains_contains(context, node) {
|
7638 |
|
7639 |
|
7640 | if (context.contains) return context.contains(node);
|
7641 | if (context.compareDocumentPosition) return context === node || !!(context.compareDocumentPosition(node) & 16);
|
7642 | }
|
7643 |
|
7644 | var warning = __webpack_require__(459);
|
7645 | var warning_default = __webpack_require__.n(warning);
|
7646 | ;
|
7647 |
|
7648 |
|
7649 |
|
7650 |
|
7651 |
|
7652 |
|
7653 | const useClickOutside_noop = () => {};
|
7654 | function isLeftClickEvent(event) {
|
7655 | return event.button === 0;
|
7656 | }
|
7657 | function isModifiedEvent(event) {
|
7658 | return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
7659 | }
|
7660 | const getRefTarget = ref => ref && ('current' in ref ? ref.current : ref);
|
7661 | const InitialTriggerEvents = {
|
7662 | click: 'mousedown',
|
7663 | mouseup: 'mousedown',
|
7664 | pointerup: 'pointerdown'
|
7665 | };
|
7666 |
|
7667 |
|
7668 |
|
7669 |
|
7670 |
|
7671 |
|
7672 |
|
7673 |
|
7674 |
|
7675 |
|
7676 |
|
7677 | function useClickOutside(ref, onClickOutside = useClickOutside_noop, {
|
7678 | disabled,
|
7679 | clickTrigger = 'click'
|
7680 | } = {}) {
|
7681 | const preventMouseClickOutsideRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
7682 | const waitingForTrigger = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
7683 | const handleMouseCapture = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(e => {
|
7684 | const currentTarget = getRefTarget(ref);
|
7685 | warning_default()(!!currentTarget, 'ClickOutside captured a close event but does not have a ref to compare it to. ' + 'useClickOutside(), should be passed a ref that resolves to a DOM node');
|
7686 | preventMouseClickOutsideRef.current = !currentTarget || isModifiedEvent(e) || !isLeftClickEvent(e) || !!contains_contains(currentTarget, e.target) || waitingForTrigger.current;
|
7687 | waitingForTrigger.current = false;
|
7688 | }, [ref]);
|
7689 | const handleInitialMouse = useEventCallback(e => {
|
7690 | const currentTarget = getRefTarget(ref);
|
7691 | if (currentTarget && contains_contains(currentTarget, e.target)) {
|
7692 | waitingForTrigger.current = true;
|
7693 | }
|
7694 | });
|
7695 | const handleMouse = useEventCallback(e => {
|
7696 | if (!preventMouseClickOutsideRef.current) {
|
7697 | onClickOutside(e);
|
7698 | }
|
7699 | });
|
7700 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
7701 | var _ownerWindow$event, _ownerWindow$parent;
|
7702 | if (disabled || ref == null) return undefined;
|
7703 | const doc = ownerDocument(getRefTarget(ref));
|
7704 | const ownerWindow = doc.defaultView || window;
|
7705 |
|
7706 |
|
7707 |
|
7708 |
|
7709 |
|
7710 | let currentEvent = (_ownerWindow$event = ownerWindow.event) != null ? _ownerWindow$event : (_ownerWindow$parent = ownerWindow.parent) == null ? void 0 : _ownerWindow$parent.event;
|
7711 | let removeInitialTriggerListener = null;
|
7712 | if (InitialTriggerEvents[clickTrigger]) {
|
7713 | removeInitialTriggerListener = esm_listen(doc, InitialTriggerEvents[clickTrigger], handleInitialMouse, true);
|
7714 | }
|
7715 |
|
7716 |
|
7717 |
|
7718 |
|
7719 | const removeMouseCaptureListener = esm_listen(doc, clickTrigger, handleMouseCapture, true);
|
7720 | const removeMouseListener = esm_listen(doc, clickTrigger, e => {
|
7721 |
|
7722 | if (e === currentEvent) {
|
7723 | currentEvent = undefined;
|
7724 | return;
|
7725 | }
|
7726 | handleMouse(e);
|
7727 | });
|
7728 | let mobileSafariHackListeners = [];
|
7729 | if ('ontouchstart' in doc.documentElement) {
|
7730 | mobileSafariHackListeners = [].slice.call(doc.body.children).map(el => esm_listen(el, 'mousemove', useClickOutside_noop));
|
7731 | }
|
7732 | return () => {
|
7733 | removeInitialTriggerListener == null ? void 0 : removeInitialTriggerListener();
|
7734 | removeMouseCaptureListener();
|
7735 | removeMouseListener();
|
7736 | mobileSafariHackListeners.forEach(remove => remove());
|
7737 | };
|
7738 | }, [ref, disabled, clickTrigger, handleMouseCapture, handleInitialMouse, handleMouse]);
|
7739 | }
|
7740 | const esm_useClickOutside = (useClickOutside);
|
7741 | ;
|
7742 | function toModifierMap(modifiers) {
|
7743 | const result = {};
|
7744 | if (!Array.isArray(modifiers)) {
|
7745 | return modifiers || result;
|
7746 | }
|
7747 |
|
7748 |
|
7749 | modifiers == null ? void 0 : modifiers.forEach(m => {
|
7750 | result[m.name] = m;
|
7751 | });
|
7752 | return result;
|
7753 | }
|
7754 | function toModifierArray(map = {}) {
|
7755 | if (Array.isArray(map)) return map;
|
7756 | return Object.keys(map).map(k => {
|
7757 | map[k].name = k;
|
7758 | return map[k];
|
7759 | });
|
7760 | }
|
7761 | function mergeOptionsWithPopperConfig({
|
7762 | enabled,
|
7763 | enableEvents,
|
7764 | placement,
|
7765 | flip,
|
7766 | offset,
|
7767 | fixed,
|
7768 | containerPadding,
|
7769 | arrowElement,
|
7770 | popperConfig = {}
|
7771 | }) {
|
7772 | var _modifiers$eventListe, _modifiers$preventOve, _modifiers$preventOve2, _modifiers$offset, _modifiers$arrow;
|
7773 | const modifiers = toModifierMap(popperConfig.modifiers);
|
7774 | return Object.assign({}, popperConfig, {
|
7775 | placement,
|
7776 | enabled,
|
7777 | strategy: fixed ? 'fixed' : popperConfig.strategy,
|
7778 | modifiers: toModifierArray(Object.assign({}, modifiers, {
|
7779 | eventListeners: {
|
7780 | enabled: enableEvents,
|
7781 | options: (_modifiers$eventListe = modifiers.eventListeners) == null ? void 0 : _modifiers$eventListe.options
|
7782 | },
|
7783 | preventOverflow: Object.assign({}, modifiers.preventOverflow, {
|
7784 | options: containerPadding ? Object.assign({
|
7785 | padding: containerPadding
|
7786 | }, (_modifiers$preventOve = modifiers.preventOverflow) == null ? void 0 : _modifiers$preventOve.options) : (_modifiers$preventOve2 = modifiers.preventOverflow) == null ? void 0 : _modifiers$preventOve2.options
|
7787 | }),
|
7788 | offset: {
|
7789 | options: Object.assign({
|
7790 | offset
|
7791 | }, (_modifiers$offset = modifiers.offset) == null ? void 0 : _modifiers$offset.options)
|
7792 | },
|
7793 | arrow: Object.assign({}, modifiers.arrow, {
|
7794 | enabled: !!arrowElement,
|
7795 | options: Object.assign({}, (_modifiers$arrow = modifiers.arrow) == null ? void 0 : _modifiers$arrow.options, {
|
7796 | element: arrowElement
|
7797 | })
|
7798 | }),
|
7799 | flip: Object.assign({
|
7800 | enabled: !!flip
|
7801 | }, modifiers.flip)
|
7802 | }))
|
7803 | });
|
7804 | }
|
7805 | ;
|
7806 | const DropdownMenu_excluded = ["children"];
|
7807 | function DropdownMenu_objectWithoutPropertiesLoose(source, excluded) {
|
7808 | if (source == null) return {};
|
7809 | var target = {};
|
7810 | var sourceKeys = Object.keys(source);
|
7811 | var key, i;
|
7812 | for (i = 0; i < sourceKeys.length; i++) {
|
7813 | key = sourceKeys[i];
|
7814 | if (excluded.indexOf(key) >= 0) continue;
|
7815 | target[key] = source[key];
|
7816 | }
|
7817 | return target;
|
7818 | }
|
7819 |
|
7820 |
|
7821 |
|
7822 |
|
7823 |
|
7824 |
|
7825 |
|
7826 |
|
7827 |
|
7828 | const DropdownMenu_noop = () => {};
|
7829 |
|
7830 |
|
7831 |
|
7832 |
|
7833 |
|
7834 |
|
7835 |
|
7836 |
|
7837 |
|
7838 |
|
7839 |
|
7840 | function useDropdownMenu(options = {}) {
|
7841 | const context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_DropdownContext);
|
7842 | const [arrowElement, attachArrowRef] = useCallbackRef();
|
7843 | const hasShownRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
7844 | const {
|
7845 | flip,
|
7846 | offset,
|
7847 | rootCloseEvent,
|
7848 | fixed = false,
|
7849 | placement: placementOverride,
|
7850 | popperConfig = {},
|
7851 | enableEventListeners = true,
|
7852 | usePopper: shouldUsePopper = !!context
|
7853 | } = options;
|
7854 | const show = (context == null ? void 0 : context.show) == null ? !!options.show : context.show;
|
7855 | if (show && !hasShownRef.current) {
|
7856 | hasShownRef.current = true;
|
7857 | }
|
7858 | const handleClose = e => {
|
7859 | context == null ? void 0 : context.toggle(false, e);
|
7860 | };
|
7861 | const {
|
7862 | placement,
|
7863 | setMenu,
|
7864 | menuElement,
|
7865 | toggleElement
|
7866 | } = context || {};
|
7867 | const popper = esm_usePopper(toggleElement, menuElement, mergeOptionsWithPopperConfig({
|
7868 | placement: placementOverride || placement || 'bottom-start',
|
7869 | enabled: shouldUsePopper,
|
7870 | enableEvents: enableEventListeners == null ? show : enableEventListeners,
|
7871 | offset,
|
7872 | flip,
|
7873 | fixed,
|
7874 | arrowElement,
|
7875 | popperConfig
|
7876 | }));
|
7877 | const menuProps = Object.assign({
|
7878 | ref: setMenu || DropdownMenu_noop,
|
7879 | 'aria-labelledby': toggleElement == null ? void 0 : toggleElement.id
|
7880 | }, popper.attributes.popper, {
|
7881 | style: popper.styles.popper
|
7882 | });
|
7883 | const metadata = {
|
7884 | show,
|
7885 | placement,
|
7886 | hasShown: hasShownRef.current,
|
7887 | toggle: context == null ? void 0 : context.toggle,
|
7888 | popper: shouldUsePopper ? popper : null,
|
7889 | arrowProps: shouldUsePopper ? Object.assign({
|
7890 | ref: attachArrowRef
|
7891 | }, popper.attributes.arrow, {
|
7892 | style: popper.styles.arrow
|
7893 | }) : {}
|
7894 | };
|
7895 | esm_useClickOutside(menuElement, handleClose, {
|
7896 | clickTrigger: rootCloseEvent,
|
7897 | disabled: !show
|
7898 | });
|
7899 | return [menuProps, metadata];
|
7900 | }
|
7901 | const defaultProps = {
|
7902 | usePopper: true
|
7903 | };
|
7904 |
|
7905 |
|
7906 |
|
7907 |
|
7908 |
|
7909 |
|
7910 | function DropdownMenu(_ref) {
|
7911 | let {
|
7912 | children
|
7913 | } = _ref,
|
7914 | options = DropdownMenu_objectWithoutPropertiesLoose(_ref, DropdownMenu_excluded);
|
7915 | const [props, meta] = useDropdownMenu(options);
|
7916 | return (0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
7917 | children: children(props, meta)
|
7918 | });
|
7919 | }
|
7920 | DropdownMenu.displayName = 'DropdownMenu';
|
7921 | DropdownMenu.defaultProps = defaultProps;
|
7922 |
|
7923 |
|
7924 | const esm_DropdownMenu = (DropdownMenu);
|
7925 | ;
|
7926 |
|
7927 |
|
7928 |
|
7929 |
|
7930 |
|
7931 |
|
7932 |
|
7933 |
|
7934 |
|
7935 |
|
7936 |
|
7937 |
|
7938 | |
7939 |
|
7940 |
|
7941 |
|
7942 |
|
7943 |
|
7944 |
|
7945 |
|
7946 |
|
7947 |
|
7948 |
|
7949 |
|
7950 |
|
7951 |
|
7952 |
|
7953 |
|
7954 |
|
7955 |
|
7956 |
|
7957 | const $704cf1d3b684cc5c$var$defaultContext = {
|
7958 | prefix: String(Math.round(Math.random() * 10000000000)),
|
7959 | current: 0,
|
7960 | isSSR: false
|
7961 | };
|
7962 | const $704cf1d3b684cc5c$var$SSRContext = (0, external_root_React_commonjs2_react_commonjs_react_amd_react_).createContext($704cf1d3b684cc5c$var$defaultContext);
|
7963 | function $704cf1d3b684cc5c$export$9f8ac96af4b1b2ae(props) {
|
7964 | let cur = (0, external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)($704cf1d3b684cc5c$var$SSRContext);
|
7965 | let counter = $704cf1d3b684cc5c$var$useCounter(cur === $704cf1d3b684cc5c$var$defaultContext);
|
7966 | let [isSSR, setIsSSR] = (0, external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(true);
|
7967 | let value = (0, external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(()=>({
|
7968 |
|
7969 |
|
7970 | prefix: cur === $704cf1d3b684cc5c$var$defaultContext ? "" : `${cur.prefix}-${counter}`,
|
7971 | current: 0,
|
7972 | isSSR: isSSR
|
7973 | }), [
|
7974 | cur,
|
7975 | counter,
|
7976 | isSSR
|
7977 | ]);
|
7978 |
|
7979 |
|
7980 | if (typeof window !== "undefined")
|
7981 |
|
7982 |
|
7983 | (0, external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(()=>{
|
7984 | setIsSSR(false);
|
7985 | }, []);
|
7986 | return (0, external_root_React_commonjs2_react_commonjs_react_amd_react_).createElement($704cf1d3b684cc5c$var$SSRContext.Provider, {
|
7987 | value: value
|
7988 | }, props.children);
|
7989 | }
|
7990 | let $704cf1d3b684cc5c$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
|
7991 | let $704cf1d3b684cc5c$var$componentIds = new WeakMap();
|
7992 | function $704cf1d3b684cc5c$var$useCounter(isDisabled = false) {
|
7993 | let ctx = (0, external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)($704cf1d3b684cc5c$var$SSRContext);
|
7994 | let ref = (0, external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
7995 | if (ref.current === null && !isDisabled) {
|
7996 | var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner;
|
7997 |
|
7998 |
|
7999 |
|
8000 |
|
8001 |
|
8002 |
|
8003 |
|
8004 |
|
8005 |
|
8006 |
|
8007 | let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = (0, external_root_React_commonjs2_react_commonjs_react_amd_react_).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
|
8008 | if (currentOwner) {
|
8009 | let prevComponentValue = $704cf1d3b684cc5c$var$componentIds.get(currentOwner);
|
8010 | if (prevComponentValue == null)
|
8011 | $704cf1d3b684cc5c$var$componentIds.set(currentOwner, {
|
8012 | id: ctx.current,
|
8013 | state: currentOwner.memoizedState
|
8014 | });
|
8015 | else if (currentOwner.memoizedState !== prevComponentValue.state) {
|
8016 |
|
8017 |
|
8018 |
|
8019 | ctx.current = prevComponentValue.id;
|
8020 | $704cf1d3b684cc5c$var$componentIds.delete(currentOwner);
|
8021 | }
|
8022 | }
|
8023 | ref.current = ++ctx.current;
|
8024 | }
|
8025 | return ref.current;
|
8026 | }
|
8027 | function $704cf1d3b684cc5c$export$619500959fc48b26(defaultId) {
|
8028 | let ctx = (0, external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)($704cf1d3b684cc5c$var$SSRContext);
|
8029 |
|
8030 |
|
8031 | if (ctx === $704cf1d3b684cc5c$var$defaultContext && !$704cf1d3b684cc5c$var$canUseDOM) console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
|
8032 | let counter = $704cf1d3b684cc5c$var$useCounter(!!defaultId);
|
8033 | return defaultId || `react-aria${ctx.prefix}-${counter}`;
|
8034 | }
|
8035 | function $704cf1d3b684cc5c$export$535bd6ca7f90a273() {
|
8036 | let cur = (0, $89yE2$useContext)($704cf1d3b684cc5c$var$SSRContext);
|
8037 | return cur.isSSR;
|
8038 | }
|
8039 |
|
8040 |
|
8041 |
|
8042 |
|
8043 |
|
8044 |
|
8045 |
|
8046 | ;
|
8047 |
|
8048 |
|
8049 |
|
8050 |
|
8051 |
|
8052 |
|
8053 | const isRoleMenu = el => {
|
8054 | var _el$getAttribute;
|
8055 | return ((_el$getAttribute = el.getAttribute('role')) == null ? void 0 : _el$getAttribute.toLowerCase()) === 'menu';
|
8056 | };
|
8057 | const DropdownToggle_noop = () => {};
|
8058 |
|
8059 |
|
8060 |
|
8061 |
|
8062 |
|
8063 |
|
8064 |
|
8065 | function useDropdownToggle() {
|
8066 | const id = $704cf1d3b684cc5c$export$619500959fc48b26();
|
8067 | const {
|
8068 | show = false,
|
8069 | toggle = DropdownToggle_noop,
|
8070 | setToggle,
|
8071 | menuElement
|
8072 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_DropdownContext) || {};
|
8073 | const handleClick = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(e => {
|
8074 | toggle(!show, e);
|
8075 | }, [show, toggle]);
|
8076 | const props = {
|
8077 | id,
|
8078 | ref: setToggle || DropdownToggle_noop,
|
8079 | onClick: handleClick,
|
8080 | 'aria-expanded': !!show
|
8081 | };
|
8082 |
|
8083 |
|
8084 |
|
8085 |
|
8086 | if (menuElement && isRoleMenu(menuElement)) {
|
8087 | props['aria-haspopup'] = true;
|
8088 | }
|
8089 | return [props, {
|
8090 | show,
|
8091 | toggle
|
8092 | }];
|
8093 | }
|
8094 |
|
8095 |
|
8096 |
|
8097 |
|
8098 |
|
8099 |
|
8100 | function DropdownToggle({
|
8101 | children
|
8102 | }) {
|
8103 | const [props, meta] = useDropdownToggle();
|
8104 | return (0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
8105 | children: children(props, meta)
|
8106 | });
|
8107 | }
|
8108 | DropdownToggle.displayName = 'DropdownToggle';
|
8109 |
|
8110 |
|
8111 | const esm_DropdownToggle = (DropdownToggle);
|
8112 | ;
|
8113 |
|
8114 | const SelectableContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
|
8115 | const makeEventKey = (eventKey, href = null) => {
|
8116 | if (eventKey != null) return String(eventKey);
|
8117 | return href || null;
|
8118 | };
|
8119 | const esm_SelectableContext = (SelectableContext);
|
8120 | ;
|
8121 |
|
8122 | const NavContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
|
8123 | NavContext.displayName = 'NavContext';
|
8124 | const esm_NavContext = (NavContext);
|
8125 | ;
|
8126 | const ATTRIBUTE_PREFIX = `data-rr-ui-`;
|
8127 | const PROPERTY_PREFIX = `rrUi`;
|
8128 | function dataAttr(property) {
|
8129 | return `${ATTRIBUTE_PREFIX}${property}`;
|
8130 | }
|
8131 | function dataProp(property) {
|
8132 | return `${PROPERTY_PREFIX}${property}`;
|
8133 | }
|
8134 | ;
|
8135 | const DropdownItem_excluded = ["eventKey", "disabled", "onClick", "active", "as"];
|
8136 | function DropdownItem_objectWithoutPropertiesLoose(source, excluded) {
|
8137 | if (source == null) return {};
|
8138 | var target = {};
|
8139 | var sourceKeys = Object.keys(source);
|
8140 | var key, i;
|
8141 | for (i = 0; i < sourceKeys.length; i++) {
|
8142 | key = sourceKeys[i];
|
8143 | if (excluded.indexOf(key) >= 0) continue;
|
8144 | target[key] = source[key];
|
8145 | }
|
8146 | return target;
|
8147 | }
|
8148 |
|
8149 |
|
8150 |
|
8151 |
|
8152 |
|
8153 |
|
8154 |
|
8155 |
|
8156 |
|
8157 |
|
8158 |
|
8159 |
|
8160 | function useDropdownItem({
|
8161 | key,
|
8162 | href,
|
8163 | active,
|
8164 | disabled,
|
8165 | onClick
|
8166 | }) {
|
8167 | const onSelectCtx = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_SelectableContext);
|
8168 | const navContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_NavContext);
|
8169 | const {
|
8170 | activeKey
|
8171 | } = navContext || {};
|
8172 | const eventKey = makeEventKey(key, href);
|
8173 | const isActive = active == null && key != null ? makeEventKey(activeKey) === eventKey : active;
|
8174 | const handleClick = useEventCallback(event => {
|
8175 | if (disabled) return;
|
8176 | onClick == null ? void 0 : onClick(event);
|
8177 | if (onSelectCtx && !event.isPropagationStopped()) {
|
8178 | onSelectCtx(eventKey, event);
|
8179 | }
|
8180 | });
|
8181 | return [{
|
8182 | onClick: handleClick,
|
8183 | 'aria-disabled': disabled || undefined,
|
8184 | 'aria-selected': isActive,
|
8185 | [dataAttr('dropdown-item')]: ''
|
8186 | }, {
|
8187 | isActive
|
8188 | }];
|
8189 | }
|
8190 | const DropdownItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_ref, ref) => {
|
8191 | let {
|
8192 | eventKey,
|
8193 | disabled,
|
8194 | onClick,
|
8195 | active,
|
8196 | as: Component = esm_Button
|
8197 | } = _ref,
|
8198 | props = DropdownItem_objectWithoutPropertiesLoose(_ref, DropdownItem_excluded);
|
8199 | const [dropdownItemProps] = useDropdownItem({
|
8200 | key: eventKey,
|
8201 | href: props.href,
|
8202 | disabled,
|
8203 | onClick,
|
8204 | active
|
8205 | });
|
8206 | return (0,jsx_runtime.jsx)(Component, Object.assign({}, props, {
|
8207 | ref: ref
|
8208 | }, dropdownItemProps));
|
8209 | });
|
8210 | DropdownItem.displayName = 'DropdownItem';
|
8211 | const esm_DropdownItem = (DropdownItem);
|
8212 | ;
|
8213 |
|
8214 |
|
8215 | const Context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)(canUseDOM ? window : undefined);
|
8216 | const WindowProvider = Context.Provider;
|
8217 |
|
8218 |
|
8219 |
|
8220 |
|
8221 |
|
8222 |
|
8223 |
|
8224 | function useWindow() {
|
8225 | return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(Context);
|
8226 | }
|
8227 | ;
|
8228 |
|
8229 |
|
8230 |
|
8231 |
|
8232 |
|
8233 |
|
8234 |
|
8235 |
|
8236 |
|
8237 |
|
8238 |
|
8239 |
|
8240 |
|
8241 |
|
8242 |
|
8243 |
|
8244 |
|
8245 | function useRefWithUpdate() {
|
8246 | const forceUpdate = useForceUpdate();
|
8247 | const ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
8248 | const attachRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(element => {
|
8249 | ref.current = element;
|
8250 |
|
8251 | forceUpdate();
|
8252 | }, [forceUpdate]);
|
8253 | return [ref, attachRef];
|
8254 | }
|
8255 |
|
8256 |
|
8257 |
|
8258 |
|
8259 |
|
8260 | function Dropdown({
|
8261 | defaultShow,
|
8262 | show: rawShow,
|
8263 | onSelect,
|
8264 | onToggle: rawOnToggle,
|
8265 | itemSelector = `* [${dataAttr('dropdown-item')}]`,
|
8266 | focusFirstItemOnShow,
|
8267 | placement = 'bottom-start',
|
8268 | children
|
8269 | }) {
|
8270 | const window = useWindow();
|
8271 | const [show, onToggle] = esm_useUncontrolledProp(rawShow, defaultShow, rawOnToggle);
|
8272 |
|
8273 |
|
8274 |
|
8275 |
|
8276 | const [menuRef, setMenu] = useRefWithUpdate();
|
8277 | const menuElement = menuRef.current;
|
8278 | const [toggleRef, setToggle] = useRefWithUpdate();
|
8279 | const toggleElement = toggleRef.current;
|
8280 | const lastShow = usePrevious(show);
|
8281 | const lastSourceEvent = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
8282 | const focusInDropdown = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
8283 | const onSelectCtx = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_SelectableContext);
|
8284 | const toggle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((nextShow, event, source = event == null ? void 0 : event.type) => {
|
8285 | onToggle(nextShow, {
|
8286 | originalEvent: event,
|
8287 | source
|
8288 | });
|
8289 | }, [onToggle]);
|
8290 | const handleSelect = useEventCallback((key, event) => {
|
8291 | onSelect == null ? void 0 : onSelect(key, event);
|
8292 | toggle(false, event, 'select');
|
8293 | if (!event.isPropagationStopped()) {
|
8294 | onSelectCtx == null ? void 0 : onSelectCtx(key, event);
|
8295 | }
|
8296 | });
|
8297 | const context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
8298 | toggle,
|
8299 | placement,
|
8300 | show,
|
8301 | menuElement,
|
8302 | toggleElement,
|
8303 | setMenu,
|
8304 | setToggle
|
8305 | }), [toggle, placement, show, menuElement, toggleElement, setMenu, setToggle]);
|
8306 | if (menuElement && lastShow && !show) {
|
8307 | focusInDropdown.current = menuElement.contains(menuElement.ownerDocument.activeElement);
|
8308 | }
|
8309 | const focusToggle = useEventCallback(() => {
|
8310 | if (toggleElement && toggleElement.focus) {
|
8311 | toggleElement.focus();
|
8312 | }
|
8313 | });
|
8314 | const maybeFocusFirst = useEventCallback(() => {
|
8315 | const type = lastSourceEvent.current;
|
8316 | let focusType = focusFirstItemOnShow;
|
8317 | if (focusType == null) {
|
8318 | focusType = menuRef.current && isRoleMenu(menuRef.current) ? 'keyboard' : false;
|
8319 | }
|
8320 | if (focusType === false || focusType === 'keyboard' && !/^key.+$/.test(type)) {
|
8321 | return;
|
8322 | }
|
8323 | const first = qsa(menuRef.current, itemSelector)[0];
|
8324 | if (first && first.focus) first.focus();
|
8325 | });
|
8326 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
8327 | if (show) maybeFocusFirst();else if (focusInDropdown.current) {
|
8328 | focusInDropdown.current = false;
|
8329 | focusToggle();
|
8330 | }
|
8331 |
|
8332 | }, [show, focusInDropdown, focusToggle, maybeFocusFirst]);
|
8333 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
8334 | lastSourceEvent.current = null;
|
8335 | });
|
8336 | const getNextFocusedChild = (current, offset) => {
|
8337 | if (!menuRef.current) return null;
|
8338 | const items = qsa(menuRef.current, itemSelector);
|
8339 | let index = items.indexOf(current) + offset;
|
8340 | index = Math.max(0, Math.min(index, items.length));
|
8341 | return items[index];
|
8342 | };
|
8343 | useEventListener_useEventListener((0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => window.document, [window]), 'keydown', event => {
|
8344 | var _menuRef$current, _toggleRef$current;
|
8345 | const {
|
8346 | key
|
8347 | } = event;
|
8348 | const target = event.target;
|
8349 | const fromMenu = (_menuRef$current = menuRef.current) == null ? void 0 : _menuRef$current.contains(target);
|
8350 | const fromToggle = (_toggleRef$current = toggleRef.current) == null ? void 0 : _toggleRef$current.contains(target);
|
8351 |
|
8352 |
|
8353 |
|
8354 | const isInput = /input|textarea/i.test(target.tagName);
|
8355 | if (isInput && (key === ' ' || key !== 'Escape' && fromMenu || key === 'Escape' && target.type === 'search')) {
|
8356 | return;
|
8357 | }
|
8358 | if (!fromMenu && !fromToggle) {
|
8359 | return;
|
8360 | }
|
8361 | if (key === 'Tab' && (!menuRef.current || !show)) {
|
8362 | return;
|
8363 | }
|
8364 | lastSourceEvent.current = event.type;
|
8365 | const meta = {
|
8366 | originalEvent: event,
|
8367 | source: event.type
|
8368 | };
|
8369 | switch (key) {
|
8370 | case 'ArrowUp':
|
8371 | {
|
8372 | const next = getNextFocusedChild(target, -1);
|
8373 | if (next && next.focus) next.focus();
|
8374 | event.preventDefault();
|
8375 | return;
|
8376 | }
|
8377 | case 'ArrowDown':
|
8378 | event.preventDefault();
|
8379 | if (!show) {
|
8380 | onToggle(true, meta);
|
8381 | } else {
|
8382 | const next = getNextFocusedChild(target, 1);
|
8383 | if (next && next.focus) next.focus();
|
8384 | }
|
8385 | return;
|
8386 | case 'Tab':
|
8387 |
|
8388 |
|
8389 |
|
8390 |
|
8391 | esm_addEventListener(target.ownerDocument, 'keyup', e => {
|
8392 | var _menuRef$current2;
|
8393 | if (e.key === 'Tab' && !e.target || !((_menuRef$current2 = menuRef.current) != null && _menuRef$current2.contains(e.target))) {
|
8394 | onToggle(false, meta);
|
8395 | }
|
8396 | }, {
|
8397 | once: true
|
8398 | });
|
8399 | break;
|
8400 | case 'Escape':
|
8401 | if (key === 'Escape') {
|
8402 | event.preventDefault();
|
8403 | event.stopPropagation();
|
8404 | }
|
8405 | onToggle(false, meta);
|
8406 | break;
|
8407 | default:
|
8408 | }
|
8409 | });
|
8410 | return (0,jsx_runtime.jsx)(esm_SelectableContext.Provider, {
|
8411 | value: handleSelect,
|
8412 | children: (0,jsx_runtime.jsx)(esm_DropdownContext.Provider, {
|
8413 | value: context,
|
8414 | children: children
|
8415 | })
|
8416 | });
|
8417 | }
|
8418 | Dropdown.displayName = 'Dropdown';
|
8419 | Dropdown.Menu = esm_DropdownMenu;
|
8420 | Dropdown.Toggle = esm_DropdownToggle;
|
8421 | Dropdown.Item = esm_DropdownItem;
|
8422 | const esm_Dropdown = (Dropdown);
|
8423 | ;
|
8424 |
|
8425 | const DropdownContext_DropdownContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
|
8426 | DropdownContext_DropdownContext.displayName = 'DropdownContext';
|
8427 | const src_DropdownContext = (DropdownContext_DropdownContext);
|
8428 | ;
|
8429 | var DropdownDivider_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/DropdownDivider.tsx";
|
8430 |
|
8431 |
|
8432 |
|
8433 |
|
8434 | const DropdownDivider = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
8435 | className,
|
8436 | bsPrefix,
|
8437 | as: Component = 'hr',
|
8438 | role = 'separator',
|
8439 | ...props
|
8440 | }, ref) => {
|
8441 | bsPrefix = useBootstrapPrefix(bsPrefix, 'dropdown-divider');
|
8442 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
8443 | ref: ref,
|
8444 | className: classnames_default()(className, bsPrefix),
|
8445 | role: role,
|
8446 | ...props
|
8447 | }, void 0, false, {
|
8448 | fileName: DropdownDivider_jsxFileName,
|
8449 | lineNumber: 20,
|
8450 | columnNumber: 7
|
8451 | }, undefined);
|
8452 | });
|
8453 | DropdownDivider.displayName = 'DropdownDivider';
|
8454 | const src_DropdownDivider = (DropdownDivider);
|
8455 | ;
|
8456 | var DropdownHeader_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/DropdownHeader.tsx";
|
8457 |
|
8458 |
|
8459 |
|
8460 |
|
8461 | const DropdownHeader = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
8462 | className,
|
8463 | bsPrefix,
|
8464 | as: Component = 'div',
|
8465 | role = 'heading',
|
8466 | ...props
|
8467 | }, ref) => {
|
8468 | bsPrefix = useBootstrapPrefix(bsPrefix, 'dropdown-header');
|
8469 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
8470 | ref: ref,
|
8471 | className: classnames_default()(className, bsPrefix),
|
8472 | role: role,
|
8473 | ...props
|
8474 | }, void 0, false, {
|
8475 | fileName: DropdownHeader_jsxFileName,
|
8476 | lineNumber: 20,
|
8477 | columnNumber: 7
|
8478 | }, undefined);
|
8479 | });
|
8480 | DropdownHeader.displayName = 'DropdownHeader';
|
8481 | const src_DropdownHeader = (DropdownHeader);
|
8482 | ;
|
8483 | var DropdownItem_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/DropdownItem.tsx";
|
8484 |
|
8485 |
|
8486 |
|
8487 |
|
8488 |
|
8489 |
|
8490 |
|
8491 | const DropdownItem_propTypes = {
|
8492 |
|
8493 | bsPrefix: (prop_types_default()).string,
|
8494 | |
8495 |
|
8496 |
|
8497 | active: (prop_types_default()).bool,
|
8498 | |
8499 |
|
8500 |
|
8501 | disabled: (prop_types_default()).bool,
|
8502 | |
8503 |
|
8504 |
|
8505 | eventKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
8506 | |
8507 |
|
8508 |
|
8509 | href: (prop_types_default()).string,
|
8510 | |
8511 |
|
8512 |
|
8513 | onClick: (prop_types_default()).func,
|
8514 | as: (prop_types_default()).elementType
|
8515 | };
|
8516 | const DropdownItem_DropdownItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
8517 | bsPrefix,
|
8518 | className,
|
8519 | eventKey,
|
8520 | disabled = false,
|
8521 | onClick,
|
8522 | active,
|
8523 | as: Component = esm_Anchor,
|
8524 | ...props
|
8525 | }, ref) => {
|
8526 | const prefix = useBootstrapPrefix(bsPrefix, 'dropdown-item');
|
8527 | const [dropdownItemProps, meta] = useDropdownItem({
|
8528 | key: eventKey,
|
8529 | href: props.href,
|
8530 | disabled,
|
8531 | onClick,
|
8532 | active
|
8533 | });
|
8534 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
8535 | ...props,
|
8536 | ...dropdownItemProps,
|
8537 | ref: ref,
|
8538 | className: classnames_default()(className, prefix, meta.isActive && 'active', disabled && 'disabled')
|
8539 | }, void 0, false, {
|
8540 | fileName: DropdownItem_jsxFileName,
|
8541 | lineNumber: 73,
|
8542 | columnNumber: 9
|
8543 | }, undefined);
|
8544 | });
|
8545 | DropdownItem_DropdownItem.displayName = 'DropdownItem';
|
8546 | DropdownItem_DropdownItem.propTypes = DropdownItem_propTypes;
|
8547 | const src_DropdownItem = (DropdownItem_DropdownItem);
|
8548 | ;
|
8549 | var DropdownItemText_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/DropdownItemText.tsx";
|
8550 |
|
8551 |
|
8552 |
|
8553 |
|
8554 | const DropdownItemText = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
8555 | className,
|
8556 | bsPrefix,
|
8557 | as: Component = 'span',
|
8558 | ...props
|
8559 | }, ref) => {
|
8560 | bsPrefix = useBootstrapPrefix(bsPrefix, 'dropdown-item-text');
|
8561 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
8562 | ref: ref,
|
8563 | className: classnames_default()(className, bsPrefix),
|
8564 | ...props
|
8565 | }, void 0, false, {
|
8566 | fileName: DropdownItemText_jsxFileName,
|
8567 | lineNumber: 17,
|
8568 | columnNumber: 7
|
8569 | }, undefined);
|
8570 | });
|
8571 | DropdownItemText.displayName = 'DropdownItemText';
|
8572 | const src_DropdownItemText = (DropdownItemText);
|
8573 | ;
|
8574 |
|
8575 | const InputGroupContext_context = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
|
8576 | InputGroupContext_context.displayName = 'InputGroupContext';
|
8577 | const InputGroupContext = (InputGroupContext_context);
|
8578 | ;
|
8579 |
|
8580 |
|
8581 |
|
8582 |
|
8583 | const NavbarContext_context = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
|
8584 | NavbarContext_context.displayName = 'NavbarContext';
|
8585 | const NavbarContext = (NavbarContext_context);
|
8586 | ;
|
8587 |
|
8588 |
|
8589 |
|
8590 | function useWrappedRefWithWarning(ref, componentName) {
|
8591 |
|
8592 | if (true) return ref;
|
8593 |
|
8594 |
|
8595 | const warningRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(refValue => {
|
8596 | !(refValue == null || !refValue.isReactComponent) ? false ? 0 : browser_default()(false) : void 0;
|
8597 | }, [componentName]);
|
8598 |
|
8599 | return esm_useMergedRefs(warningRef, ref);
|
8600 | }
|
8601 | ;
|
8602 |
|
8603 | const alignDirection = prop_types_default().oneOf(['start', 'end']);
|
8604 | const alignPropType = prop_types_default().oneOfType([alignDirection, prop_types_default().shape({
|
8605 | sm: alignDirection
|
8606 | }), prop_types_default().shape({
|
8607 | md: alignDirection
|
8608 | }), prop_types_default().shape({
|
8609 | lg: alignDirection
|
8610 | }), prop_types_default().shape({
|
8611 | xl: alignDirection
|
8612 | }), prop_types_default().shape({
|
8613 | xxl: alignDirection
|
8614 | }), (prop_types_default()).object]);
|
8615 | ;
|
8616 | var DropdownMenu_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/DropdownMenu.tsx";
|
8617 |
|
8618 |
|
8619 |
|
8620 |
|
8621 |
|
8622 |
|
8623 |
|
8624 |
|
8625 |
|
8626 |
|
8627 |
|
8628 |
|
8629 |
|
8630 |
|
8631 |
|
8632 | const DropdownMenu_propTypes = {
|
8633 | |
8634 |
|
8635 |
|
8636 | bsPrefix: (prop_types_default()).string,
|
8637 |
|
8638 | show: (prop_types_default()).bool,
|
8639 |
|
8640 | renderOnMount: (prop_types_default()).bool,
|
8641 |
|
8642 | flip: (prop_types_default()).bool,
|
8643 | |
8644 |
|
8645 |
|
8646 |
|
8647 |
|
8648 |
|
8649 |
|
8650 |
|
8651 |
|
8652 | align: alignPropType,
|
8653 | |
8654 |
|
8655 |
|
8656 |
|
8657 |
|
8658 |
|
8659 |
|
8660 | rootCloseEvent: prop_types_default().oneOf(['click', 'mousedown']),
|
8661 | |
8662 |
|
8663 |
|
8664 |
|
8665 |
|
8666 |
|
8667 |
|
8668 | as: (prop_types_default()).elementType,
|
8669 | |
8670 |
|
8671 |
|
8672 | popperConfig: (prop_types_default()).object,
|
8673 | |
8674 |
|
8675 |
|
8676 |
|
8677 |
|
8678 | variant: (prop_types_default()).string
|
8679 | };
|
8680 | function getDropdownMenuPlacement(alignEnd, dropDirection, isRTL) {
|
8681 | const topStart = isRTL ? 'top-end' : 'top-start';
|
8682 | const topEnd = isRTL ? 'top-start' : 'top-end';
|
8683 | const bottomStart = isRTL ? 'bottom-end' : 'bottom-start';
|
8684 | const bottomEnd = isRTL ? 'bottom-start' : 'bottom-end';
|
8685 | const leftStart = isRTL ? 'right-start' : 'left-start';
|
8686 | const leftEnd = isRTL ? 'right-end' : 'left-end';
|
8687 | const rightStart = isRTL ? 'left-start' : 'right-start';
|
8688 | const rightEnd = isRTL ? 'left-end' : 'right-end';
|
8689 | let placement = alignEnd ? bottomEnd : bottomStart;
|
8690 | if (dropDirection === 'up') placement = alignEnd ? topEnd : topStart;else if (dropDirection === 'end') placement = alignEnd ? rightEnd : rightStart;else if (dropDirection === 'start') placement = alignEnd ? leftEnd : leftStart;else if (dropDirection === 'down-centered') placement = 'bottom';else if (dropDirection === 'up-centered') placement = 'top';
|
8691 | return placement;
|
8692 | }
|
8693 | const DropdownMenu_DropdownMenu = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
8694 | bsPrefix,
|
8695 | className,
|
8696 | align,
|
8697 | rootCloseEvent,
|
8698 | flip = true,
|
8699 | show: showProps,
|
8700 | renderOnMount,
|
8701 |
|
8702 | as: Component = 'div',
|
8703 | popperConfig,
|
8704 | variant,
|
8705 | ...props
|
8706 | }, ref) => {
|
8707 | let alignEnd = false;
|
8708 | const isNavbar = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(NavbarContext);
|
8709 | const prefix = useBootstrapPrefix(bsPrefix, 'dropdown-menu');
|
8710 | const {
|
8711 | align: contextAlign,
|
8712 | drop,
|
8713 | isRTL
|
8714 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_DropdownContext);
|
8715 | align = align || contextAlign;
|
8716 | const isInputGroup = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(InputGroupContext);
|
8717 | const alignClasses = [];
|
8718 | if (align) {
|
8719 | if (typeof align === 'object') {
|
8720 | const keys = Object.keys(align);
|
8721 | false ? 0 : void 0;
|
8722 | if (keys.length) {
|
8723 | const brkPoint = keys[0];
|
8724 | const direction = align[brkPoint];
|
8725 |
|
8726 |
|
8727 |
|
8728 | alignEnd = direction === 'start';
|
8729 | alignClasses.push(`${prefix}-${brkPoint}-${direction}`);
|
8730 | }
|
8731 | } else if (align === 'end') {
|
8732 | alignEnd = true;
|
8733 | }
|
8734 | }
|
8735 | const placement = getDropdownMenuPlacement(alignEnd, drop, isRTL);
|
8736 | const [menuProps, {
|
8737 | hasShown,
|
8738 | popper,
|
8739 | show,
|
8740 | toggle
|
8741 | }] = useDropdownMenu({
|
8742 | flip,
|
8743 | rootCloseEvent,
|
8744 | show: showProps,
|
8745 | usePopper: !isNavbar && alignClasses.length === 0,
|
8746 | offset: [0, 2],
|
8747 | popperConfig,
|
8748 | placement
|
8749 | });
|
8750 | menuProps.ref = esm_useMergedRefs(useWrappedRefWithWarning(ref, 'DropdownMenu'), menuProps.ref);
|
8751 | useIsomorphicEffect(() => {
|
8752 |
|
8753 |
|
8754 | if (show) popper == null ? void 0 : popper.update();
|
8755 | }, [show]);
|
8756 | if (!hasShown && !renderOnMount && !isInputGroup) return null;
|
8757 |
|
8758 |
|
8759 | if (typeof Component !== 'string') {
|
8760 | menuProps.show = show;
|
8761 | menuProps.close = () => toggle == null ? void 0 : toggle(false);
|
8762 | menuProps.align = align;
|
8763 | }
|
8764 | let style = props.style;
|
8765 | if (popper != null && popper.placement) {
|
8766 |
|
8767 |
|
8768 | style = {
|
8769 | ...props.style,
|
8770 | ...menuProps.style
|
8771 | };
|
8772 | props['x-placement'] = popper.placement;
|
8773 | }
|
8774 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
8775 | ...props,
|
8776 | ...menuProps,
|
8777 | style: style
|
8778 |
|
8779 | ,
|
8780 | ...((alignClasses.length || isNavbar) && {
|
8781 | 'data-bs-popper': 'static'
|
8782 | }),
|
8783 | className: classnames_default()(className, prefix, show && 'show', alignEnd && `${prefix}-end`, variant && `${prefix}-${variant}`, ...alignClasses)
|
8784 | }, void 0, false, {
|
8785 | fileName: DropdownMenu_jsxFileName,
|
8786 | lineNumber: 207,
|
8787 | columnNumber: 9
|
8788 | }, undefined);
|
8789 | });
|
8790 | DropdownMenu_DropdownMenu.displayName = 'DropdownMenu';
|
8791 | DropdownMenu_DropdownMenu.propTypes = DropdownMenu_propTypes;
|
8792 | const src_DropdownMenu = (DropdownMenu_DropdownMenu);
|
8793 | ;
|
8794 | var DropdownToggle_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/DropdownToggle.tsx";
|
8795 |
|
8796 |
|
8797 |
|
8798 |
|
8799 |
|
8800 |
|
8801 |
|
8802 |
|
8803 |
|
8804 |
|
8805 |
|
8806 | const DropdownToggle_propTypes = {
|
8807 | |
8808 |
|
8809 |
|
8810 | bsPrefix: (prop_types_default()).string,
|
8811 | |
8812 |
|
8813 |
|
8814 |
|
8815 | id: (prop_types_default()).string,
|
8816 | split: (prop_types_default()).bool,
|
8817 | as: (prop_types_default()).elementType,
|
8818 | |
8819 |
|
8820 |
|
8821 |
|
8822 | childBsPrefix: (prop_types_default()).string
|
8823 | };
|
8824 | const DropdownToggle_DropdownToggle = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
8825 | bsPrefix,
|
8826 | split,
|
8827 | className,
|
8828 | childBsPrefix,
|
8829 |
|
8830 | as: Component = src_Button,
|
8831 | ...props
|
8832 | }, ref) => {
|
8833 | const prefix = useBootstrapPrefix(bsPrefix, 'dropdown-toggle');
|
8834 | const dropdownContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_DropdownContext);
|
8835 | if (childBsPrefix !== undefined) {
|
8836 | props.bsPrefix = childBsPrefix;
|
8837 | }
|
8838 | const [toggleProps] = useDropdownToggle();
|
8839 | toggleProps.ref = esm_useMergedRefs(toggleProps.ref, useWrappedRefWithWarning(ref, 'DropdownToggle'));
|
8840 |
|
8841 |
|
8842 |
|
8843 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
8844 | className: classnames_default()(className, prefix, split && `${prefix}-split`, (dropdownContext == null ? void 0 : dropdownContext.show) && 'show'),
|
8845 | ...toggleProps,
|
8846 | ...props
|
8847 | }, void 0, false, {
|
8848 | fileName: DropdownToggle_jsxFileName,
|
8849 | lineNumber: 81,
|
8850 | columnNumber: 7
|
8851 | }, undefined);
|
8852 | });
|
8853 | DropdownToggle_DropdownToggle.displayName = 'DropdownToggle';
|
8854 | DropdownToggle_DropdownToggle.propTypes = DropdownToggle_propTypes;
|
8855 | const src_DropdownToggle = (DropdownToggle_DropdownToggle);
|
8856 | ;
|
8857 | var Dropdown_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Dropdown.tsx";
|
8858 |
|
8859 |
|
8860 |
|
8861 |
|
8862 |
|
8863 |
|
8864 |
|
8865 |
|
8866 |
|
8867 |
|
8868 |
|
8869 |
|
8870 |
|
8871 |
|
8872 |
|
8873 |
|
8874 |
|
8875 |
|
8876 | const Dropdown_propTypes = {
|
8877 |
|
8878 | bsPrefix: (prop_types_default()).string,
|
8879 | |
8880 |
|
8881 |
|
8882 | drop: prop_types_default().oneOf(['up', 'up-centered', 'start', 'end', 'down', 'down-centered']),
|
8883 | as: (prop_types_default()).elementType,
|
8884 | |
8885 |
|
8886 |
|
8887 |
|
8888 |
|
8889 |
|
8890 |
|
8891 |
|
8892 |
|
8893 | align: alignPropType,
|
8894 | |
8895 |
|
8896 |
|
8897 |
|
8898 |
|
8899 | show: (prop_types_default()).bool,
|
8900 | |
8901 |
|
8902 |
|
8903 |
|
8904 |
|
8905 |
|
8906 |
|
8907 |
|
8908 |
|
8909 |
|
8910 |
|
8911 |
|
8912 |
|
8913 | onToggle: (prop_types_default()).func,
|
8914 | |
8915 |
|
8916 |
|
8917 |
|
8918 |
|
8919 |
|
8920 |
|
8921 | onSelect: (prop_types_default()).func,
|
8922 | |
8923 |
|
8924 |
|
8925 |
|
8926 |
|
8927 |
|
8928 |
|
8929 |
|
8930 | focusFirstItemOnShow: prop_types_default().oneOf([false, true, 'keyboard']),
|
8931 |
|
8932 | navbar: (prop_types_default()).bool,
|
8933 | |
8934 |
|
8935 |
|
8936 |
|
8937 | autoClose: prop_types_default().oneOf([true, 'outside', 'inside', false])
|
8938 | };
|
8939 | const Dropdown_Dropdown = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((pProps, ref) => {
|
8940 | const {
|
8941 | bsPrefix,
|
8942 | drop = 'down',
|
8943 | show,
|
8944 | className,
|
8945 | align = 'start',
|
8946 | onSelect,
|
8947 | onToggle,
|
8948 | focusFirstItemOnShow,
|
8949 |
|
8950 | as: Component = 'div',
|
8951 | navbar: _4,
|
8952 | autoClose = true,
|
8953 | ...props
|
8954 | } = useUncontrolled(pProps, {
|
8955 | show: 'onToggle'
|
8956 | });
|
8957 | const isInputGroup = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(InputGroupContext);
|
8958 | const prefix = useBootstrapPrefix(bsPrefix, 'dropdown');
|
8959 | const isRTL = useIsRTL();
|
8960 | const isClosingPermitted = source => {
|
8961 |
|
8962 | if (autoClose === false) return source === 'click';
|
8963 |
|
8964 |
|
8965 | if (autoClose === 'inside') return source !== 'rootClose';
|
8966 |
|
8967 |
|
8968 | if (autoClose === 'outside') return source !== 'select';
|
8969 | return true;
|
8970 | };
|
8971 | const handleToggle = useEventCallback((nextShow, meta) => {
|
8972 | if (meta.originalEvent.currentTarget === document && (meta.source !== 'keydown' || meta.originalEvent.key === 'Escape')) meta.source = 'rootClose';
|
8973 | if (isClosingPermitted(meta.source)) onToggle == null ? void 0 : onToggle(nextShow, meta);
|
8974 | });
|
8975 | const alignEnd = align === 'end';
|
8976 | const placement = getDropdownMenuPlacement(alignEnd, drop, isRTL);
|
8977 | const contextValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
8978 | align,
|
8979 | drop,
|
8980 | isRTL
|
8981 | }), [align, drop, isRTL]);
|
8982 | const directionClasses = {
|
8983 | down: prefix,
|
8984 | 'down-centered': `${prefix}-center`,
|
8985 | up: 'dropup',
|
8986 | 'up-centered': 'dropup-center dropup',
|
8987 | end: 'dropend',
|
8988 | start: 'dropstart'
|
8989 | };
|
8990 | return (0,jsx_dev_runtime.jsxDEV)(src_DropdownContext.Provider, {
|
8991 | value: contextValue,
|
8992 | children: (0,jsx_dev_runtime.jsxDEV)(esm_Dropdown, {
|
8993 | placement: placement,
|
8994 | show: show,
|
8995 | onSelect: onSelect,
|
8996 | onToggle: handleToggle,
|
8997 | focusFirstItemOnShow: focusFirstItemOnShow,
|
8998 | itemSelector: `.${prefix}-item:not(.disabled):not(:disabled)`,
|
8999 | children: isInputGroup ? props.children : (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9000 | ...props,
|
9001 | ref: ref,
|
9002 | className: classnames_default()(className, show && 'show', directionClasses[drop])
|
9003 | }, void 0, false, {
|
9004 | fileName: Dropdown_jsxFileName,
|
9005 | lineNumber: 195,
|
9006 | columnNumber: 13
|
9007 | }, undefined)
|
9008 | }, void 0, false, {
|
9009 | fileName: Dropdown_jsxFileName,
|
9010 | lineNumber: 184,
|
9011 | columnNumber: 9
|
9012 | }, undefined)
|
9013 | }, void 0, false, {
|
9014 | fileName: Dropdown_jsxFileName,
|
9015 | lineNumber: 183,
|
9016 | columnNumber: 7
|
9017 | }, undefined);
|
9018 | });
|
9019 | Dropdown_Dropdown.displayName = 'Dropdown';
|
9020 | Dropdown_Dropdown.propTypes = Dropdown_propTypes;
|
9021 | const src_Dropdown = (Object.assign(Dropdown_Dropdown, {
|
9022 | Toggle: src_DropdownToggle,
|
9023 | Menu: src_DropdownMenu,
|
9024 | Item: src_DropdownItem,
|
9025 | ItemText: src_DropdownItemText,
|
9026 | Divider: src_DropdownDivider,
|
9027 | Header: src_DropdownHeader
|
9028 | }));
|
9029 | ;
|
9030 | var DropdownButton_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/DropdownButton.tsx";
|
9031 |
|
9032 |
|
9033 |
|
9034 |
|
9035 |
|
9036 |
|
9037 |
|
9038 | const DropdownButton_propTypes = {
|
9039 | |
9040 |
|
9041 |
|
9042 |
|
9043 | id: (prop_types_default()).string,
|
9044 |
|
9045 | href: (prop_types_default()).string,
|
9046 |
|
9047 | onClick: (prop_types_default()).func,
|
9048 |
|
9049 | title: (prop_types_default()).node.isRequired,
|
9050 |
|
9051 | disabled: (prop_types_default()).bool,
|
9052 | |
9053 |
|
9054 |
|
9055 |
|
9056 |
|
9057 |
|
9058 |
|
9059 | align: alignPropType,
|
9060 |
|
9061 | menuRole: (prop_types_default()).string,
|
9062 |
|
9063 | renderMenuOnMount: (prop_types_default()).bool,
|
9064 | |
9065 |
|
9066 |
|
9067 |
|
9068 |
|
9069 | rootCloseEvent: (prop_types_default()).string,
|
9070 | |
9071 |
|
9072 |
|
9073 |
|
9074 |
|
9075 | menuVariant: prop_types_default().oneOf(['dark']),
|
9076 | |
9077 |
|
9078 |
|
9079 |
|
9080 |
|
9081 | flip: (prop_types_default()).bool,
|
9082 |
|
9083 | bsPrefix: (prop_types_default()).string,
|
9084 |
|
9085 | variant: (prop_types_default()).string,
|
9086 |
|
9087 | size: (prop_types_default()).string
|
9088 | };
|
9089 |
|
9090 |
|
9091 |
|
9092 |
|
9093 |
|
9094 |
|
9095 |
|
9096 |
|
9097 |
|
9098 |
|
9099 | const DropdownButton = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9100 | title,
|
9101 | children,
|
9102 | bsPrefix,
|
9103 | rootCloseEvent,
|
9104 | variant,
|
9105 | size,
|
9106 | menuRole,
|
9107 | renderMenuOnMount,
|
9108 | disabled,
|
9109 | href,
|
9110 | id,
|
9111 | menuVariant,
|
9112 | flip,
|
9113 | ...props
|
9114 | }, ref) => (0,jsx_dev_runtime.jsxDEV)(src_Dropdown, {
|
9115 | ref: ref,
|
9116 | ...props,
|
9117 | children: [(0,jsx_dev_runtime.jsxDEV)(src_DropdownToggle, {
|
9118 | id: id,
|
9119 | href: href,
|
9120 | size: size,
|
9121 | variant: variant,
|
9122 | disabled: disabled,
|
9123 | childBsPrefix: bsPrefix,
|
9124 | children: title
|
9125 | }, void 0, false, {
|
9126 | fileName: DropdownButton_jsxFileName,
|
9127 | lineNumber: 118,
|
9128 | columnNumber: 7
|
9129 | }, undefined), (0,jsx_dev_runtime.jsxDEV)(src_DropdownMenu, {
|
9130 | role: menuRole,
|
9131 | renderOnMount: renderMenuOnMount,
|
9132 | rootCloseEvent: rootCloseEvent,
|
9133 | variant: menuVariant,
|
9134 | flip: flip,
|
9135 | children: children
|
9136 | }, void 0, false, {
|
9137 | fileName: DropdownButton_jsxFileName,
|
9138 | lineNumber: 128,
|
9139 | columnNumber: 7
|
9140 | }, undefined)]
|
9141 | }, void 0, true, {
|
9142 | fileName: DropdownButton_jsxFileName,
|
9143 | lineNumber: 117,
|
9144 | columnNumber: 5
|
9145 | }, undefined));
|
9146 | DropdownButton.displayName = 'DropdownButton';
|
9147 | DropdownButton.propTypes = DropdownButton_propTypes;
|
9148 | const src_DropdownButton = (DropdownButton);
|
9149 | ;
|
9150 | var Image_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Image.tsx";
|
9151 |
|
9152 |
|
9153 |
|
9154 |
|
9155 |
|
9156 | const Image_propTypes = {
|
9157 | |
9158 |
|
9159 |
|
9160 | bsPrefix: (prop_types_default()).string,
|
9161 | |
9162 |
|
9163 |
|
9164 | fluid: (prop_types_default()).bool,
|
9165 | |
9166 |
|
9167 |
|
9168 | rounded: (prop_types_default()).bool,
|
9169 | |
9170 |
|
9171 |
|
9172 | roundedCircle: (prop_types_default()).bool,
|
9173 | |
9174 |
|
9175 |
|
9176 | thumbnail: (prop_types_default()).bool
|
9177 | };
|
9178 | const Image_Image = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9179 | bsPrefix,
|
9180 | className,
|
9181 | fluid = false,
|
9182 | rounded = false,
|
9183 | roundedCircle = false,
|
9184 | thumbnail = false,
|
9185 | ...props
|
9186 | }, ref) => {
|
9187 | bsPrefix = useBootstrapPrefix(bsPrefix, 'img');
|
9188 | return (0,jsx_dev_runtime.jsxDEV)("img", {
|
9189 |
|
9190 | ref: ref,
|
9191 | ...props,
|
9192 | className: classnames_default()(className, fluid && `${bsPrefix}-fluid`, rounded && `rounded`, roundedCircle && `rounded-circle`, thumbnail && `${bsPrefix}-thumbnail`)
|
9193 | }, void 0, false, {
|
9194 | fileName: Image_jsxFileName,
|
9195 | lineNumber: 58,
|
9196 | columnNumber: 7
|
9197 | }, undefined);
|
9198 | });
|
9199 | Image_Image.displayName = 'Image';
|
9200 | Image_Image.propTypes = Image_propTypes;
|
9201 | const src_Image = (Image_Image);
|
9202 | ;
|
9203 | var FigureImage_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FigureImage.tsx";
|
9204 |
|
9205 |
|
9206 |
|
9207 |
|
9208 | const FigureImage = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9209 | className,
|
9210 | fluid = true,
|
9211 | ...props
|
9212 | }, ref) => (0,jsx_dev_runtime.jsxDEV)(src_Image, {
|
9213 | ref: ref,
|
9214 | ...props,
|
9215 | fluid: fluid,
|
9216 | className: classnames_default()(className, 'figure-img')
|
9217 | }, void 0, false, {
|
9218 | fileName: FigureImage_jsxFileName,
|
9219 | lineNumber: 8,
|
9220 | columnNumber: 5
|
9221 | }, undefined));
|
9222 | FigureImage.displayName = 'FigureImage';
|
9223 | FigureImage.propTypes = Image_propTypes;
|
9224 | const src_FigureImage = (FigureImage);
|
9225 | ;
|
9226 | var FigureCaption_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FigureCaption.tsx";
|
9227 |
|
9228 |
|
9229 |
|
9230 |
|
9231 | const FigureCaption = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9232 | className,
|
9233 | bsPrefix,
|
9234 | as: Component = 'figcaption',
|
9235 | ...props
|
9236 | }, ref) => {
|
9237 | bsPrefix = useBootstrapPrefix(bsPrefix, 'figure-caption');
|
9238 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9239 | ref: ref,
|
9240 | className: classnames_default()(className, bsPrefix),
|
9241 | ...props
|
9242 | }, void 0, false, {
|
9243 | fileName: FigureCaption_jsxFileName,
|
9244 | lineNumber: 17,
|
9245 | columnNumber: 7
|
9246 | }, undefined);
|
9247 | });
|
9248 | FigureCaption.displayName = 'FigureCaption';
|
9249 | const src_FigureCaption = (FigureCaption);
|
9250 | ;
|
9251 | var Figure_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Figure.tsx";
|
9252 |
|
9253 |
|
9254 |
|
9255 |
|
9256 |
|
9257 |
|
9258 | const Figure = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9259 | className,
|
9260 | bsPrefix,
|
9261 | as: Component = 'figure',
|
9262 | ...props
|
9263 | }, ref) => {
|
9264 | bsPrefix = useBootstrapPrefix(bsPrefix, 'figure');
|
9265 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9266 | ref: ref,
|
9267 | className: classnames_default()(className, bsPrefix),
|
9268 | ...props
|
9269 | }, void 0, false, {
|
9270 | fileName: Figure_jsxFileName,
|
9271 | lineNumber: 17,
|
9272 | columnNumber: 9
|
9273 | }, undefined);
|
9274 | });
|
9275 | Figure.displayName = 'Figure';
|
9276 | const src_Figure = (Object.assign(Figure, {
|
9277 | Image: src_FigureImage,
|
9278 | Caption: src_FigureCaption
|
9279 | }));
|
9280 | ;
|
9281 | var Feedback_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Feedback.tsx";
|
9282 |
|
9283 |
|
9284 |
|
9285 |
|
9286 | const Feedback_propTypes = {
|
9287 | |
9288 |
|
9289 |
|
9290 |
|
9291 |
|
9292 | type: (prop_types_default()).string,
|
9293 |
|
9294 | tooltip: (prop_types_default()).bool,
|
9295 | as: (prop_types_default()).elementType
|
9296 | };
|
9297 | const Feedback = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(
|
9298 |
|
9299 | ({
|
9300 | as: Component = 'div',
|
9301 | className,
|
9302 | type = 'valid',
|
9303 | tooltip = false,
|
9304 | ...props
|
9305 | }, ref) => (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9306 | ...props,
|
9307 | ref: ref,
|
9308 | className: classnames_default()(className, `${type}-${tooltip ? 'tooltip' : 'feedback'}`)
|
9309 | }, void 0, false, {
|
9310 | fileName: Feedback_jsxFileName,
|
9311 | lineNumber: 45,
|
9312 | columnNumber: 7
|
9313 | }, undefined));
|
9314 | Feedback.displayName = 'Feedback';
|
9315 | Feedback.propTypes = Feedback_propTypes;
|
9316 | const src_Feedback = (Feedback);
|
9317 | ;
|
9318 |
|
9319 |
|
9320 |
|
9321 |
|
9322 | const FormContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
|
9323 | const src_FormContext = (FormContext);
|
9324 | ;
|
9325 | var FormCheckInput_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormCheckInput.tsx";
|
9326 |
|
9327 |
|
9328 |
|
9329 |
|
9330 |
|
9331 |
|
9332 |
|
9333 | const FormCheckInput_propTypes = {
|
9334 | |
9335 |
|
9336 |
|
9337 | bsPrefix: (prop_types_default()).string,
|
9338 | |
9339 |
|
9340 |
|
9341 |
|
9342 |
|
9343 | as: (prop_types_default()).elementType,
|
9344 |
|
9345 | id: (prop_types_default()).string,
|
9346 |
|
9347 | type: prop_types_default().oneOf(['radio', 'checkbox']).isRequired,
|
9348 |
|
9349 | isValid: (prop_types_default()).bool,
|
9350 |
|
9351 | isInvalid: (prop_types_default()).bool
|
9352 | };
|
9353 | const FormCheckInput = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9354 | id,
|
9355 | bsPrefix,
|
9356 | className,
|
9357 | type = 'checkbox',
|
9358 | isValid = false,
|
9359 | isInvalid = false,
|
9360 |
|
9361 | as: Component = 'input',
|
9362 | ...props
|
9363 | }, ref) => {
|
9364 | const {
|
9365 | controlId
|
9366 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_FormContext);
|
9367 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-check-input');
|
9368 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9369 | ...props,
|
9370 | ref: ref,
|
9371 | type: type,
|
9372 | id: id || controlId,
|
9373 | className: classnames_default()(className, bsPrefix, isValid && 'is-valid', isInvalid && 'is-invalid')
|
9374 | }, void 0, false, {
|
9375 | fileName: FormCheckInput_jsxFileName,
|
9376 | lineNumber: 67,
|
9377 | columnNumber: 7
|
9378 | }, undefined);
|
9379 | });
|
9380 | FormCheckInput.displayName = 'FormCheckInput';
|
9381 | FormCheckInput.propTypes = FormCheckInput_propTypes;
|
9382 | const src_FormCheckInput = (FormCheckInput);
|
9383 | ;
|
9384 | var FormCheckLabel_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormCheckLabel.tsx";
|
9385 |
|
9386 |
|
9387 |
|
9388 |
|
9389 |
|
9390 |
|
9391 |
|
9392 | const FormCheckLabel_propTypes = {
|
9393 | |
9394 |
|
9395 |
|
9396 | bsPrefix: (prop_types_default()).string,
|
9397 |
|
9398 | htmlFor: (prop_types_default()).string
|
9399 | };
|
9400 | const FormCheckLabel = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9401 | bsPrefix,
|
9402 | className,
|
9403 | htmlFor,
|
9404 | ...props
|
9405 | }, ref) => {
|
9406 | const {
|
9407 | controlId
|
9408 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_FormContext);
|
9409 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-check-label');
|
9410 | return (0,jsx_dev_runtime.jsxDEV)("label", {
|
9411 | ...props,
|
9412 | ref: ref,
|
9413 | htmlFor: htmlFor || controlId,
|
9414 | className: classnames_default()(className, bsPrefix)
|
9415 | }, void 0, false, {
|
9416 | fileName: FormCheckLabel_jsxFileName,
|
9417 | lineNumber: 31,
|
9418 | columnNumber: 7
|
9419 | }, undefined);
|
9420 | });
|
9421 | FormCheckLabel.displayName = 'FormCheckLabel';
|
9422 | FormCheckLabel.propTypes = FormCheckLabel_propTypes;
|
9423 | const src_FormCheckLabel = (FormCheckLabel);
|
9424 | ;
|
9425 | var FormCheck_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormCheck.tsx";
|
9426 |
|
9427 |
|
9428 |
|
9429 |
|
9430 |
|
9431 |
|
9432 |
|
9433 |
|
9434 |
|
9435 |
|
9436 |
|
9437 |
|
9438 | const FormCheck_propTypes = {
|
9439 | |
9440 |
|
9441 |
|
9442 | bsPrefix: (prop_types_default()).string,
|
9443 | |
9444 |
|
9445 |
|
9446 |
|
9447 |
|
9448 | bsSwitchPrefix: (prop_types_default()).string,
|
9449 | |
9450 |
|
9451 |
|
9452 |
|
9453 |
|
9454 |
|
9455 |
|
9456 | _ref: (prop_types_default()).any,
|
9457 | |
9458 |
|
9459 |
|
9460 |
|
9461 |
|
9462 | as: (prop_types_default()).elementType,
|
9463 | |
9464 |
|
9465 |
|
9466 |
|
9467 |
|
9468 |
|
9469 | id: (prop_types_default()).string,
|
9470 | |
9471 |
|
9472 |
|
9473 |
|
9474 |
|
9475 |
|
9476 |
|
9477 |
|
9478 |
|
9479 |
|
9480 |
|
9481 | children: (prop_types_default()).node,
|
9482 | |
9483 |
|
9484 |
|
9485 | inline: (prop_types_default()).bool,
|
9486 | |
9487 |
|
9488 |
|
9489 | reverse: (prop_types_default()).bool,
|
9490 | |
9491 |
|
9492 |
|
9493 | disabled: (prop_types_default()).bool,
|
9494 | |
9495 |
|
9496 |
|
9497 | title: (prop_types_default()).string,
|
9498 | |
9499 |
|
9500 |
|
9501 | label: (prop_types_default()).node,
|
9502 | |
9503 |
|
9504 |
|
9505 |
|
9506 | type: prop_types_default().oneOf(['radio', 'checkbox', 'switch']),
|
9507 |
|
9508 | isValid: (prop_types_default()).bool,
|
9509 |
|
9510 | isInvalid: (prop_types_default()).bool,
|
9511 |
|
9512 | feedbackTooltip: (prop_types_default()).bool,
|
9513 |
|
9514 | feedback: (prop_types_default()).node
|
9515 | };
|
9516 | const FormCheck = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9517 | id,
|
9518 | bsPrefix,
|
9519 | bsSwitchPrefix,
|
9520 | inline = false,
|
9521 | reverse = false,
|
9522 | disabled = false,
|
9523 | isValid = false,
|
9524 | isInvalid = false,
|
9525 | feedbackTooltip = false,
|
9526 | feedback,
|
9527 | feedbackType,
|
9528 | className,
|
9529 | style,
|
9530 | title = '',
|
9531 | type = 'checkbox',
|
9532 | label,
|
9533 | children,
|
9534 |
|
9535 | as = 'input',
|
9536 | ...props
|
9537 | }, ref) => {
|
9538 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-check');
|
9539 | bsSwitchPrefix = useBootstrapPrefix(bsSwitchPrefix, 'form-switch');
|
9540 | const {
|
9541 | controlId
|
9542 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_FormContext);
|
9543 | const innerFormContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
9544 | controlId: id || controlId
|
9545 | }), [controlId, id]);
|
9546 | const hasLabel = !children && label != null && label !== false || hasChildOfType(children, src_FormCheckLabel);
|
9547 | const input = (0,jsx_dev_runtime.jsxDEV)(src_FormCheckInput, {
|
9548 | ...props,
|
9549 | type: type === 'switch' ? 'checkbox' : type,
|
9550 | ref: ref,
|
9551 | isValid: isValid,
|
9552 | isInvalid: isInvalid,
|
9553 | disabled: disabled,
|
9554 | as: as
|
9555 | }, void 0, false, {
|
9556 | fileName: FormCheck_jsxFileName,
|
9557 | lineNumber: 168,
|
9558 | columnNumber: 9
|
9559 | }, undefined);
|
9560 | return (0,jsx_dev_runtime.jsxDEV)(src_FormContext.Provider, {
|
9561 | value: innerFormContext,
|
9562 | children: (0,jsx_dev_runtime.jsxDEV)("div", {
|
9563 | style: style,
|
9564 | className: classnames_default()(className, hasLabel && bsPrefix, inline && `${bsPrefix}-inline`, reverse && `${bsPrefix}-reverse`, type === 'switch' && bsSwitchPrefix),
|
9565 | children: children || (0,jsx_dev_runtime.jsxDEV)(jsx_dev_runtime.Fragment, {
|
9566 | children: [input, hasLabel && (0,jsx_dev_runtime.jsxDEV)(src_FormCheckLabel, {
|
9567 | title: title,
|
9568 | children: label
|
9569 | }, void 0, false, {
|
9570 | fileName: FormCheck_jsxFileName,
|
9571 | lineNumber: 195,
|
9572 | columnNumber: 19
|
9573 | }, undefined), feedback && (0,jsx_dev_runtime.jsxDEV)(src_Feedback, {
|
9574 | type: feedbackType,
|
9575 | tooltip: feedbackTooltip,
|
9576 | children: feedback
|
9577 | }, void 0, false, {
|
9578 | fileName: FormCheck_jsxFileName,
|
9579 | lineNumber: 198,
|
9580 | columnNumber: 19
|
9581 | }, undefined)]
|
9582 | }, void 0, true)
|
9583 | }, void 0, false, {
|
9584 | fileName: FormCheck_jsxFileName,
|
9585 | lineNumber: 181,
|
9586 | columnNumber: 11
|
9587 | }, undefined)
|
9588 | }, void 0, false, {
|
9589 | fileName: FormCheck_jsxFileName,
|
9590 | lineNumber: 180,
|
9591 | columnNumber: 9
|
9592 | }, undefined);
|
9593 | });
|
9594 | FormCheck.displayName = 'FormCheck';
|
9595 | FormCheck.propTypes = FormCheck_propTypes;
|
9596 | const src_FormCheck = (Object.assign(FormCheck, {
|
9597 | Input: src_FormCheckInput,
|
9598 | Label: src_FormCheckLabel
|
9599 | }));
|
9600 | ;
|
9601 | var FormControl_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormControl.tsx";
|
9602 |
|
9603 |
|
9604 |
|
9605 |
|
9606 |
|
9607 |
|
9608 |
|
9609 |
|
9610 |
|
9611 | const FormControl_propTypes = {
|
9612 | |
9613 |
|
9614 |
|
9615 | bsPrefix: (prop_types_default()).string,
|
9616 | |
9617 |
|
9618 |
|
9619 |
|
9620 |
|
9621 |
|
9622 |
|
9623 |
|
9624 | _ref: (prop_types_default()).any,
|
9625 | |
9626 |
|
9627 |
|
9628 |
|
9629 |
|
9630 | size: (prop_types_default()).string,
|
9631 | |
9632 |
|
9633 |
|
9634 |
|
9635 | htmlSize: (prop_types_default()).number,
|
9636 | |
9637 |
|
9638 |
|
9639 |
|
9640 |
|
9641 | as: (prop_types_default()).elementType,
|
9642 | |
9643 |
|
9644 |
|
9645 | plaintext: (prop_types_default()).bool,
|
9646 |
|
9647 | readOnly: (prop_types_default()).bool,
|
9648 |
|
9649 | disabled: (prop_types_default()).bool,
|
9650 | |
9651 |
|
9652 |
|
9653 |
|
9654 |
|
9655 | value: prop_types_default().oneOfType([(prop_types_default()).string, prop_types_default().arrayOf((prop_types_default()).string), (prop_types_default()).number]),
|
9656 |
|
9657 | onChange: (prop_types_default()).func,
|
9658 | |
9659 |
|
9660 |
|
9661 | type: (prop_types_default()).string,
|
9662 | |
9663 |
|
9664 |
|
9665 | id: (prop_types_default()).string,
|
9666 |
|
9667 | isValid: (prop_types_default()).bool,
|
9668 |
|
9669 | isInvalid: (prop_types_default()).bool
|
9670 | };
|
9671 | const FormControl = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9672 | bsPrefix,
|
9673 | type,
|
9674 | size,
|
9675 | htmlSize,
|
9676 | id,
|
9677 | className,
|
9678 | isValid = false,
|
9679 | isInvalid = false,
|
9680 | plaintext,
|
9681 | readOnly,
|
9682 |
|
9683 | as: Component = 'input',
|
9684 | ...props
|
9685 | }, ref) => {
|
9686 | const {
|
9687 | controlId
|
9688 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_FormContext);
|
9689 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-control');
|
9690 | false ? 0 : void 0;
|
9691 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9692 | ...props,
|
9693 | type: type,
|
9694 | size: htmlSize,
|
9695 | ref: ref,
|
9696 | readOnly: readOnly,
|
9697 | id: id || controlId,
|
9698 | className: classnames_default()(className, plaintext ? `${bsPrefix}-plaintext` : bsPrefix, size && `${bsPrefix}-${size}`, type === 'color' && `${bsPrefix}-color`, isValid && 'is-valid', isInvalid && 'is-invalid')
|
9699 | }, void 0, false, {
|
9700 | fileName: FormControl_jsxFileName,
|
9701 | lineNumber: 135,
|
9702 | columnNumber: 9
|
9703 | }, undefined);
|
9704 | });
|
9705 | FormControl.displayName = 'FormControl';
|
9706 | FormControl.propTypes = FormControl_propTypes;
|
9707 | const src_FormControl = (Object.assign(FormControl, {
|
9708 | Feedback: src_Feedback
|
9709 | }));
|
9710 | ;
|
9711 | var FormFloating_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormFloating.tsx";
|
9712 |
|
9713 |
|
9714 |
|
9715 |
|
9716 | const FormFloating = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9717 | className,
|
9718 | bsPrefix,
|
9719 | as: Component = 'div',
|
9720 | ...props
|
9721 | }, ref) => {
|
9722 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-floating');
|
9723 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9724 | ref: ref,
|
9725 | className: classnames_default()(className, bsPrefix),
|
9726 | ...props
|
9727 | }, void 0, false, {
|
9728 | fileName: FormFloating_jsxFileName,
|
9729 | lineNumber: 15,
|
9730 | columnNumber: 9
|
9731 | }, undefined);
|
9732 | });
|
9733 | FormFloating.displayName = 'FormFloating';
|
9734 | const src_FormFloating = (FormFloating);
|
9735 | ;
|
9736 | var FormGroup_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormGroup.tsx";
|
9737 |
|
9738 |
|
9739 |
|
9740 |
|
9741 |
|
9742 | const FormGroup_propTypes = {
|
9743 | as: (prop_types_default()).elementType,
|
9744 | |
9745 |
|
9746 |
|
9747 | controlId: (prop_types_default()).string,
|
9748 | |
9749 |
|
9750 |
|
9751 |
|
9752 |
|
9753 |
|
9754 |
|
9755 |
|
9756 | _ref: (prop_types_default()).any
|
9757 | };
|
9758 | const FormGroup = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9759 | controlId,
|
9760 |
|
9761 | as: Component = 'div',
|
9762 | ...props
|
9763 | }, ref) => {
|
9764 | const context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
9765 | controlId
|
9766 | }), [controlId]);
|
9767 | return (0,jsx_dev_runtime.jsxDEV)(src_FormContext.Provider, {
|
9768 | value: context,
|
9769 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9770 | ...props,
|
9771 | ref: ref
|
9772 | }, void 0, false, {
|
9773 | fileName: FormGroup_jsxFileName,
|
9774 | lineNumber: 48,
|
9775 | columnNumber: 11
|
9776 | }, undefined)
|
9777 | }, void 0, false, {
|
9778 | fileName: FormGroup_jsxFileName,
|
9779 | lineNumber: 47,
|
9780 | columnNumber: 9
|
9781 | }, undefined);
|
9782 | });
|
9783 | FormGroup.displayName = 'FormGroup';
|
9784 | FormGroup.propTypes = FormGroup_propTypes;
|
9785 | const src_FormGroup = (FormGroup);
|
9786 | ;
|
9787 | var FormLabel_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormLabel.tsx";
|
9788 |
|
9789 |
|
9790 |
|
9791 |
|
9792 |
|
9793 |
|
9794 |
|
9795 |
|
9796 |
|
9797 | const FormLabel_propTypes = {
|
9798 | |
9799 |
|
9800 |
|
9801 | bsPrefix: (prop_types_default()).string,
|
9802 | |
9803 |
|
9804 |
|
9805 | htmlFor: (prop_types_default()).string,
|
9806 | |
9807 |
|
9808 |
|
9809 |
|
9810 | column: prop_types_default().oneOfType([(prop_types_default()).bool, prop_types_default().oneOf(['sm', 'lg'])]),
|
9811 | |
9812 |
|
9813 |
|
9814 |
|
9815 |
|
9816 |
|
9817 |
|
9818 |
|
9819 | _ref: (prop_types_default()).any,
|
9820 | |
9821 |
|
9822 |
|
9823 |
|
9824 | visuallyHidden: (prop_types_default()).bool,
|
9825 |
|
9826 | as: (prop_types_default()).elementType
|
9827 | };
|
9828 | const FormLabel = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9829 |
|
9830 | as: Component = 'label',
|
9831 | bsPrefix,
|
9832 | column = false,
|
9833 | visuallyHidden = false,
|
9834 | className,
|
9835 | htmlFor,
|
9836 | ...props
|
9837 | }, ref) => {
|
9838 | const {
|
9839 | controlId
|
9840 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_FormContext);
|
9841 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-label');
|
9842 | let columnClass = 'col-form-label';
|
9843 | if (typeof column === 'string') columnClass = `${columnClass} ${columnClass}-${column}`;
|
9844 | const classes = classnames_default()(className, bsPrefix, visuallyHidden && 'visually-hidden', column && columnClass);
|
9845 | false ? 0 : void 0;
|
9846 | htmlFor = htmlFor || controlId;
|
9847 | if (column) return (0,jsx_dev_runtime.jsxDEV)(src_Col, {
|
9848 | ref: ref,
|
9849 | as: "label",
|
9850 | className: classes,
|
9851 | htmlFor: htmlFor,
|
9852 | ...props
|
9853 | }, void 0, false, {
|
9854 | fileName: FormLabel_jsxFileName,
|
9855 | lineNumber: 104,
|
9856 | columnNumber: 11
|
9857 | }, undefined);
|
9858 | return (
|
9859 |
|
9860 |
|
9861 | (0,jsx_dev_runtime.jsxDEV)(Component, {
|
9862 | ref: ref,
|
9863 | className: classes,
|
9864 | htmlFor: htmlFor,
|
9865 | ...props
|
9866 | }, void 0, false, {
|
9867 | fileName: FormLabel_jsxFileName,
|
9868 | lineNumber: 115,
|
9869 | columnNumber: 9
|
9870 | }, undefined)
|
9871 | );
|
9872 | });
|
9873 | FormLabel.displayName = 'FormLabel';
|
9874 | FormLabel.propTypes = FormLabel_propTypes;
|
9875 | const src_FormLabel = (FormLabel);
|
9876 | ;
|
9877 | var FormRange_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormRange.tsx";
|
9878 |
|
9879 |
|
9880 |
|
9881 |
|
9882 |
|
9883 |
|
9884 |
|
9885 | const FormRange_propTypes = {
|
9886 | |
9887 |
|
9888 |
|
9889 | bsPrefix: (prop_types_default()).string,
|
9890 |
|
9891 | disabled: (prop_types_default()).bool,
|
9892 | |
9893 |
|
9894 |
|
9895 |
|
9896 |
|
9897 | value: prop_types_default().oneOfType([(prop_types_default()).string, prop_types_default().arrayOf((prop_types_default()).string.isRequired), (prop_types_default()).number]),
|
9898 |
|
9899 | onChange: (prop_types_default()).func,
|
9900 | |
9901 |
|
9902 |
|
9903 | id: (prop_types_default()).string
|
9904 | };
|
9905 | const FormRange = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9906 | bsPrefix,
|
9907 | className,
|
9908 | id,
|
9909 | ...props
|
9910 | }, ref) => {
|
9911 | const {
|
9912 | controlId
|
9913 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_FormContext);
|
9914 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-range');
|
9915 | return (0,jsx_dev_runtime.jsxDEV)("input", {
|
9916 | ...props,
|
9917 | type: "range",
|
9918 | ref: ref,
|
9919 | className: classnames_default()(className, bsPrefix),
|
9920 | id: id || controlId
|
9921 | }, void 0, false, {
|
9922 | fileName: FormRange_jsxFileName,
|
9923 | lineNumber: 48,
|
9924 | columnNumber: 7
|
9925 | }, undefined);
|
9926 | });
|
9927 | FormRange.displayName = 'FormRange';
|
9928 | FormRange.propTypes = FormRange_propTypes;
|
9929 | const src_FormRange = (FormRange);
|
9930 | ;
|
9931 | var FormSelect_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormSelect.tsx";
|
9932 |
|
9933 |
|
9934 |
|
9935 |
|
9936 |
|
9937 |
|
9938 |
|
9939 | const FormSelect_propTypes = {
|
9940 | |
9941 |
|
9942 |
|
9943 | bsPrefix: (prop_types_default()).string,
|
9944 | |
9945 |
|
9946 |
|
9947 |
|
9948 |
|
9949 | size: (prop_types_default()).string,
|
9950 | |
9951 |
|
9952 |
|
9953 |
|
9954 | htmlSize: (prop_types_default()).number,
|
9955 |
|
9956 | disabled: (prop_types_default()).bool,
|
9957 | |
9958 |
|
9959 |
|
9960 |
|
9961 |
|
9962 | value: prop_types_default().oneOfType([(prop_types_default()).string, prop_types_default().arrayOf((prop_types_default()).string), (prop_types_default()).number]),
|
9963 |
|
9964 | onChange: (prop_types_default()).func,
|
9965 |
|
9966 | isValid: (prop_types_default()).bool,
|
9967 |
|
9968 | isInvalid: (prop_types_default()).bool
|
9969 | };
|
9970 | const FormSelect = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
9971 | bsPrefix,
|
9972 | size,
|
9973 | htmlSize,
|
9974 | className,
|
9975 | isValid = false,
|
9976 | isInvalid = false,
|
9977 | id,
|
9978 | ...props
|
9979 | }, ref) => {
|
9980 | const {
|
9981 | controlId
|
9982 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_FormContext);
|
9983 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-select');
|
9984 | return (0,jsx_dev_runtime.jsxDEV)("select", {
|
9985 | ...props,
|
9986 | size: htmlSize,
|
9987 | ref: ref,
|
9988 | className: classnames_default()(className, bsPrefix, size && `${bsPrefix}-${size}`, isValid && `is-valid`, isInvalid && `is-invalid`),
|
9989 | id: id || controlId
|
9990 | }, void 0, false, {
|
9991 | fileName: FormSelect_jsxFileName,
|
9992 | lineNumber: 80,
|
9993 | columnNumber: 9
|
9994 | }, undefined);
|
9995 | });
|
9996 | FormSelect.displayName = 'FormSelect';
|
9997 | FormSelect.propTypes = FormSelect_propTypes;
|
9998 | const src_FormSelect = (FormSelect);
|
9999 | ;
|
10000 | var FormText_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FormText.tsx";
|
10001 |
|
10002 |
|
10003 |
|
10004 |
|
10005 |
|
10006 | const FormText_propTypes = {
|
10007 |
|
10008 | bsPrefix: (prop_types_default()).string,
|
10009 | |
10010 |
|
10011 |
|
10012 |
|
10013 |
|
10014 |
|
10015 |
|
10016 |
|
10017 | _ref: (prop_types_default()).any,
|
10018 | |
10019 |
|
10020 |
|
10021 |
|
10022 | muted: (prop_types_default()).bool,
|
10023 | as: (prop_types_default()).elementType
|
10024 | };
|
10025 | const FormText = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(
|
10026 |
|
10027 | ({
|
10028 | bsPrefix,
|
10029 | className,
|
10030 | as: Component = 'small',
|
10031 | muted,
|
10032 | ...props
|
10033 | }, ref) => {
|
10034 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-text');
|
10035 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
10036 | ...props,
|
10037 | ref: ref,
|
10038 | className: classnames_default()(className, bsPrefix, muted && 'text-muted')
|
10039 | }, void 0, false, {
|
10040 | fileName: FormText_jsxFileName,
|
10041 | lineNumber: 48,
|
10042 | columnNumber: 9
|
10043 | }, undefined);
|
10044 | });
|
10045 | FormText.displayName = 'FormText';
|
10046 | FormText.propTypes = FormText_propTypes;
|
10047 | const src_FormText = (FormText);
|
10048 | ;
|
10049 | var Switch_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Switch.tsx";
|
10050 |
|
10051 |
|
10052 |
|
10053 | const Switch = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => (0,jsx_dev_runtime.jsxDEV)(src_FormCheck, {
|
10054 | ...props,
|
10055 | ref: ref,
|
10056 | type: "switch"
|
10057 | }, void 0, false, {
|
10058 | fileName: Switch_jsxFileName,
|
10059 | lineNumber: 9,
|
10060 | columnNumber: 5
|
10061 | }, undefined));
|
10062 | Switch.displayName = 'Switch';
|
10063 | const src_Switch = (Object.assign(Switch, {
|
10064 | Input: src_FormCheck.Input,
|
10065 | Label: src_FormCheck.Label
|
10066 | }));
|
10067 | ;
|
10068 | var FloatingLabel_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/FloatingLabel.tsx";
|
10069 |
|
10070 |
|
10071 |
|
10072 |
|
10073 |
|
10074 |
|
10075 | const FloatingLabel_propTypes = {
|
10076 | as: (prop_types_default()).elementType,
|
10077 | |
10078 |
|
10079 |
|
10080 | controlId: (prop_types_default()).string,
|
10081 | |
10082 |
|
10083 |
|
10084 | label: (prop_types_default()).node.isRequired
|
10085 | };
|
10086 | const FloatingLabel = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
10087 | bsPrefix,
|
10088 | className,
|
10089 | children,
|
10090 | controlId,
|
10091 | label,
|
10092 | ...props
|
10093 | }, ref) => {
|
10094 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-floating');
|
10095 | return (0,jsx_dev_runtime.jsxDEV)(src_FormGroup, {
|
10096 | ref: ref,
|
10097 | className: classnames_default()(className, bsPrefix),
|
10098 | controlId: controlId,
|
10099 | ...props,
|
10100 | children: [children, (0,jsx_dev_runtime.jsxDEV)("label", {
|
10101 | htmlFor: controlId,
|
10102 | children: label
|
10103 | }, void 0, false, {
|
10104 | fileName: FloatingLabel_jsxFileName,
|
10105 | lineNumber: 41,
|
10106 | columnNumber: 11
|
10107 | }, undefined)]
|
10108 | }, void 0, true, {
|
10109 | fileName: FloatingLabel_jsxFileName,
|
10110 | lineNumber: 34,
|
10111 | columnNumber: 9
|
10112 | }, undefined);
|
10113 | });
|
10114 | FloatingLabel.displayName = 'FloatingLabel';
|
10115 | FloatingLabel.propTypes = FloatingLabel_propTypes;
|
10116 | const src_FloatingLabel = (FloatingLabel);
|
10117 | ;
|
10118 | var Form_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Form.tsx";
|
10119 |
|
10120 |
|
10121 |
|
10122 |
|
10123 |
|
10124 |
|
10125 |
|
10126 |
|
10127 |
|
10128 |
|
10129 |
|
10130 |
|
10131 |
|
10132 |
|
10133 | const Form_propTypes = {
|
10134 | |
10135 |
|
10136 |
|
10137 |
|
10138 |
|
10139 |
|
10140 |
|
10141 |
|
10142 | _ref: (prop_types_default()).any,
|
10143 | |
10144 |
|
10145 |
|
10146 |
|
10147 | validated: (prop_types_default()).bool,
|
10148 | as: (prop_types_default()).elementType
|
10149 | };
|
10150 | const Form = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
10151 | className,
|
10152 | validated,
|
10153 |
|
10154 | as: Component = 'form',
|
10155 | ...props
|
10156 | }, ref) => (0,jsx_dev_runtime.jsxDEV)(Component, {
|
10157 | ...props,
|
10158 | ref: ref,
|
10159 | className: classnames_default()(className, validated && 'was-validated')
|
10160 | }, void 0, false, {
|
10161 | fileName: Form_jsxFileName,
|
10162 | lineNumber: 53,
|
10163 | columnNumber: 7
|
10164 | }, undefined));
|
10165 | Form.displayName = 'Form';
|
10166 | Form.propTypes = Form_propTypes;
|
10167 | const src_Form = (Object.assign(Form, {
|
10168 | Group: src_FormGroup,
|
10169 | Control: src_FormControl,
|
10170 | Floating: src_FormFloating,
|
10171 | Check: src_FormCheck,
|
10172 | Switch: src_Switch,
|
10173 | Label: src_FormLabel,
|
10174 | Text: src_FormText,
|
10175 | Range: src_FormRange,
|
10176 | Select: src_FormSelect,
|
10177 | FloatingLabel: src_FloatingLabel
|
10178 | }));
|
10179 | ;
|
10180 | var InputGroupText_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/InputGroupText.tsx";
|
10181 |
|
10182 |
|
10183 |
|
10184 |
|
10185 | const InputGroupText = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
10186 | className,
|
10187 | bsPrefix,
|
10188 | as: Component = 'span',
|
10189 | ...props
|
10190 | }, ref) => {
|
10191 | bsPrefix = useBootstrapPrefix(bsPrefix, 'input-group-text');
|
10192 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
10193 | ref: ref,
|
10194 | className: classnames_default()(className, bsPrefix),
|
10195 | ...props
|
10196 | }, void 0, false, {
|
10197 | fileName: InputGroupText_jsxFileName,
|
10198 | lineNumber: 17,
|
10199 | columnNumber: 7
|
10200 | }, undefined);
|
10201 | });
|
10202 | InputGroupText.displayName = 'InputGroupText';
|
10203 | const src_InputGroupText = (InputGroupText);
|
10204 | ;
|
10205 | var InputGroup_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/InputGroup.tsx";
|
10206 |
|
10207 |
|
10208 |
|
10209 |
|
10210 |
|
10211 |
|
10212 |
|
10213 |
|
10214 |
|
10215 | const InputGroupCheckbox = props => (0,jsx_dev_runtime.jsxDEV)(src_InputGroupText, {
|
10216 | children: (0,jsx_dev_runtime.jsxDEV)(src_FormCheckInput, {
|
10217 | type: "checkbox",
|
10218 | ...props
|
10219 | }, void 0, false, {
|
10220 | fileName: InputGroup_jsxFileName,
|
10221 | lineNumber: 15,
|
10222 | columnNumber: 5
|
10223 | }, undefined)
|
10224 | }, void 0, false, {
|
10225 | fileName: InputGroup_jsxFileName,
|
10226 | lineNumber: 14,
|
10227 | columnNumber: 3
|
10228 | }, undefined);
|
10229 | const InputGroupRadio = props => (0,jsx_dev_runtime.jsxDEV)(src_InputGroupText, {
|
10230 | children: (0,jsx_dev_runtime.jsxDEV)(src_FormCheckInput, {
|
10231 | type: "radio",
|
10232 | ...props
|
10233 | }, void 0, false, {
|
10234 | fileName: InputGroup_jsxFileName,
|
10235 | lineNumber: 21,
|
10236 | columnNumber: 5
|
10237 | }, undefined)
|
10238 | }, void 0, false, {
|
10239 | fileName: InputGroup_jsxFileName,
|
10240 | lineNumber: 20,
|
10241 | columnNumber: 3
|
10242 | }, undefined);
|
10243 | const InputGroup_propTypes = {
|
10244 |
|
10245 | bsPrefix: (prop_types_default()).string,
|
10246 | |
10247 |
|
10248 |
|
10249 |
|
10250 |
|
10251 | size: (prop_types_default()).string,
|
10252 | |
10253 |
|
10254 |
|
10255 |
|
10256 |
|
10257 | hasValidation: (prop_types_default()).bool,
|
10258 | as: (prop_types_default()).elementType
|
10259 | };
|
10260 | const InputGroup = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
10261 | bsPrefix,
|
10262 | size,
|
10263 | hasValidation,
|
10264 | className,
|
10265 |
|
10266 | as: Component = 'div',
|
10267 | ...props
|
10268 | }, ref) => {
|
10269 | bsPrefix = useBootstrapPrefix(bsPrefix, 'input-group');
|
10270 |
|
10271 |
|
10272 |
|
10273 | const contextValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({}), []);
|
10274 | return (0,jsx_dev_runtime.jsxDEV)(InputGroupContext.Provider, {
|
10275 | value: contextValue,
|
10276 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
10277 | ref: ref,
|
10278 | ...props,
|
10279 | className: classnames_default()(className, bsPrefix, size && `${bsPrefix}-${size}`, hasValidation && 'has-validation')
|
10280 | }, void 0, false, {
|
10281 | fileName: InputGroup_jsxFileName,
|
10282 | lineNumber: 75,
|
10283 | columnNumber: 11
|
10284 | }, undefined)
|
10285 | }, void 0, false, {
|
10286 | fileName: InputGroup_jsxFileName,
|
10287 | lineNumber: 74,
|
10288 | columnNumber: 9
|
10289 | }, undefined);
|
10290 | });
|
10291 | InputGroup.propTypes = InputGroup_propTypes;
|
10292 | InputGroup.displayName = 'InputGroup';
|
10293 | const src_InputGroup = (Object.assign(InputGroup, {
|
10294 | Text: src_InputGroupText,
|
10295 | Radio: InputGroupRadio,
|
10296 | Checkbox: InputGroupCheckbox
|
10297 | }));
|
10298 | ;
|
10299 |
|
10300 | const TabContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
|
10301 | const esm_TabContext = (TabContext);
|
10302 | ;
|
10303 | const NavItem_excluded = ["as", "active", "eventKey"];
|
10304 | function NavItem_objectWithoutPropertiesLoose(source, excluded) {
|
10305 | if (source == null) return {};
|
10306 | var target = {};
|
10307 | var sourceKeys = Object.keys(source);
|
10308 | var key, i;
|
10309 | for (i = 0; i < sourceKeys.length; i++) {
|
10310 | key = sourceKeys[i];
|
10311 | if (excluded.indexOf(key) >= 0) continue;
|
10312 | target[key] = source[key];
|
10313 | }
|
10314 | return target;
|
10315 | }
|
10316 |
|
10317 |
|
10318 |
|
10319 |
|
10320 |
|
10321 |
|
10322 |
|
10323 |
|
10324 |
|
10325 | function useNavItem({
|
10326 | key,
|
10327 | onClick,
|
10328 | active,
|
10329 | id,
|
10330 | role,
|
10331 | disabled
|
10332 | }) {
|
10333 | const parentOnSelect = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_SelectableContext);
|
10334 | const navContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_NavContext);
|
10335 | const tabContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_TabContext);
|
10336 | let isActive = active;
|
10337 | const props = {
|
10338 | role
|
10339 | };
|
10340 | if (navContext) {
|
10341 | if (!role && navContext.role === 'tablist') props.role = 'tab';
|
10342 | const contextControllerId = navContext.getControllerId(key != null ? key : null);
|
10343 | const contextControlledId = navContext.getControlledId(key != null ? key : null);
|
10344 |
|
10345 |
|
10346 | props[dataAttr('event-key')] = key;
|
10347 | props.id = contextControllerId || id;
|
10348 | isActive = active == null && key != null ? navContext.activeKey === key : active;
|
10349 |
|
10350 | |
10351 |
|
10352 |
|
10353 |
|
10354 |
|
10355 |
|
10356 |
|
10357 |
|
10358 |
|
10359 | if (isActive || !(tabContext != null && tabContext.unmountOnExit) && !(tabContext != null && tabContext.mountOnEnter)) props['aria-controls'] = contextControlledId;
|
10360 | }
|
10361 | if (props.role === 'tab') {
|
10362 | props['aria-selected'] = isActive;
|
10363 | if (!isActive) {
|
10364 | props.tabIndex = -1;
|
10365 | }
|
10366 | if (disabled) {
|
10367 | props.tabIndex = -1;
|
10368 | props['aria-disabled'] = true;
|
10369 | }
|
10370 | }
|
10371 | props.onClick = useEventCallback(e => {
|
10372 | if (disabled) return;
|
10373 | onClick == null ? void 0 : onClick(e);
|
10374 | if (key == null) {
|
10375 | return;
|
10376 | }
|
10377 | if (parentOnSelect && !e.isPropagationStopped()) {
|
10378 | parentOnSelect(key, e);
|
10379 | }
|
10380 | });
|
10381 | return [props, {
|
10382 | isActive
|
10383 | }];
|
10384 | }
|
10385 | const NavItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_ref, ref) => {
|
10386 | let {
|
10387 | as: Component = esm_Button,
|
10388 | active,
|
10389 | eventKey
|
10390 | } = _ref,
|
10391 | options = NavItem_objectWithoutPropertiesLoose(_ref, NavItem_excluded);
|
10392 | const [props, meta] = useNavItem(Object.assign({
|
10393 | key: makeEventKey(eventKey, options.href),
|
10394 | active
|
10395 | }, options));
|
10396 |
|
10397 |
|
10398 | props[dataAttr('active')] = meta.isActive;
|
10399 | return (0,jsx_runtime.jsx)(Component, Object.assign({}, options, props, {
|
10400 | ref: ref
|
10401 | }));
|
10402 | });
|
10403 | NavItem.displayName = 'NavItem';
|
10404 | const esm_NavItem = (NavItem);
|
10405 | ;
|
10406 | const Nav_excluded = ["as", "onSelect", "activeKey", "role", "onKeyDown"];
|
10407 | function Nav_objectWithoutPropertiesLoose(source, excluded) {
|
10408 | if (source == null) return {};
|
10409 | var target = {};
|
10410 | var sourceKeys = Object.keys(source);
|
10411 | var key, i;
|
10412 | for (i = 0; i < sourceKeys.length; i++) {
|
10413 | key = sourceKeys[i];
|
10414 | if (excluded.indexOf(key) >= 0) continue;
|
10415 | target[key] = source[key];
|
10416 | }
|
10417 | return target;
|
10418 | }
|
10419 |
|
10420 |
|
10421 |
|
10422 |
|
10423 |
|
10424 |
|
10425 |
|
10426 |
|
10427 |
|
10428 |
|
10429 |
|
10430 |
|
10431 | const Nav_noop = () => {};
|
10432 | const EVENT_KEY_ATTR = dataAttr('event-key');
|
10433 | const Nav = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_ref, ref) => {
|
10434 | let {
|
10435 |
|
10436 | as: Component = 'div',
|
10437 | onSelect,
|
10438 | activeKey,
|
10439 | role,
|
10440 | onKeyDown
|
10441 | } = _ref,
|
10442 | props = Nav_objectWithoutPropertiesLoose(_ref, Nav_excluded);
|
10443 |
|
10444 |
|
10445 | const forceUpdate = useForceUpdate();
|
10446 | const needsRefocusRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
10447 | const parentOnSelect = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_SelectableContext);
|
10448 | const tabContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_TabContext);
|
10449 | let getControlledId, getControllerId;
|
10450 | if (tabContext) {
|
10451 | role = role || 'tablist';
|
10452 | activeKey = tabContext.activeKey;
|
10453 |
|
10454 | getControlledId = tabContext.getControlledId;
|
10455 | getControllerId = tabContext.getControllerId;
|
10456 | }
|
10457 | const listNode = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
10458 | const getNextActiveTab = offset => {
|
10459 | const currentListNode = listNode.current;
|
10460 | if (!currentListNode) return null;
|
10461 | const items = qsa(currentListNode, `[${EVENT_KEY_ATTR}]:not([aria-disabled=true])`);
|
10462 | const activeChild = currentListNode.querySelector('[aria-selected=true]');
|
10463 | if (!activeChild || activeChild !== document.activeElement) return null;
|
10464 | const index = items.indexOf(activeChild);
|
10465 | if (index === -1) return null;
|
10466 | let nextIndex = index + offset;
|
10467 | if (nextIndex >= items.length) nextIndex = 0;
|
10468 | if (nextIndex < 0) nextIndex = items.length - 1;
|
10469 | return items[nextIndex];
|
10470 | };
|
10471 | const handleSelect = (key, event) => {
|
10472 | if (key == null) return;
|
10473 | onSelect == null ? void 0 : onSelect(key, event);
|
10474 | parentOnSelect == null ? void 0 : parentOnSelect(key, event);
|
10475 | };
|
10476 | const handleKeyDown = event => {
|
10477 | onKeyDown == null ? void 0 : onKeyDown(event);
|
10478 | if (!tabContext) {
|
10479 | return;
|
10480 | }
|
10481 | let nextActiveChild;
|
10482 | switch (event.key) {
|
10483 | case 'ArrowLeft':
|
10484 | case 'ArrowUp':
|
10485 | nextActiveChild = getNextActiveTab(-1);
|
10486 | break;
|
10487 | case 'ArrowRight':
|
10488 | case 'ArrowDown':
|
10489 | nextActiveChild = getNextActiveTab(1);
|
10490 | break;
|
10491 | default:
|
10492 | return;
|
10493 | }
|
10494 | if (!nextActiveChild) return;
|
10495 | event.preventDefault();
|
10496 | handleSelect(nextActiveChild.dataset[dataProp('EventKey')] || null, event);
|
10497 | needsRefocusRef.current = true;
|
10498 | forceUpdate();
|
10499 | };
|
10500 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
10501 | if (listNode.current && needsRefocusRef.current) {
|
10502 | const activeChild = listNode.current.querySelector(`[${EVENT_KEY_ATTR}][aria-selected=true]`);
|
10503 | activeChild == null ? void 0 : activeChild.focus();
|
10504 | }
|
10505 | needsRefocusRef.current = false;
|
10506 | });
|
10507 | const mergedRef = esm_useMergedRefs(ref, listNode);
|
10508 | return (0,jsx_runtime.jsx)(esm_SelectableContext.Provider, {
|
10509 | value: handleSelect,
|
10510 | children: (0,jsx_runtime.jsx)(esm_NavContext.Provider, {
|
10511 | value: {
|
10512 | role,
|
10513 |
|
10514 | activeKey: makeEventKey(activeKey),
|
10515 | getControlledId: getControlledId || Nav_noop,
|
10516 | getControllerId: getControllerId || Nav_noop
|
10517 | },
|
10518 | children: (0,jsx_runtime.jsx)(Component, Object.assign({}, props, {
|
10519 | onKeyDown: handleKeyDown,
|
10520 | ref: mergedRef,
|
10521 | role: role
|
10522 | }))
|
10523 | })
|
10524 | });
|
10525 | });
|
10526 | Nav.displayName = 'Nav';
|
10527 | const esm_Nav = (Object.assign(Nav, {
|
10528 | Item: esm_NavItem
|
10529 | }));
|
10530 | ;
|
10531 | var ListGroupItem_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ListGroupItem.tsx";
|
10532 |
|
10533 |
|
10534 |
|
10535 |
|
10536 |
|
10537 |
|
10538 |
|
10539 |
|
10540 |
|
10541 | const ListGroupItem_propTypes = {
|
10542 | |
10543 |
|
10544 |
|
10545 | bsPrefix: (prop_types_default()).string,
|
10546 | |
10547 |
|
10548 |
|
10549 |
|
10550 | variant: (prop_types_default()).string,
|
10551 | |
10552 |
|
10553 |
|
10554 |
|
10555 | action: (prop_types_default()).bool,
|
10556 | |
10557 |
|
10558 |
|
10559 | active: (prop_types_default()).bool,
|
10560 | |
10561 |
|
10562 |
|
10563 | disabled: (prop_types_default()).bool,
|
10564 | eventKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
10565 |
|
10566 | onClick: (prop_types_default()).func,
|
10567 |
|
10568 | href: (prop_types_default()).string,
|
10569 | |
10570 |
|
10571 |
|
10572 |
|
10573 |
|
10574 |
|
10575 | as: (prop_types_default()).elementType
|
10576 | };
|
10577 | const ListGroupItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
10578 | bsPrefix,
|
10579 | active,
|
10580 | disabled,
|
10581 | eventKey,
|
10582 | className,
|
10583 | variant,
|
10584 | action,
|
10585 | as,
|
10586 | ...props
|
10587 | }, ref) => {
|
10588 | bsPrefix = useBootstrapPrefix(bsPrefix, 'list-group-item');
|
10589 | const [navItemProps, meta] = useNavItem({
|
10590 | key: makeEventKey(eventKey, props.href),
|
10591 | active,
|
10592 | ...props
|
10593 | });
|
10594 | const handleClick = useEventCallback(event => {
|
10595 | if (disabled) {
|
10596 | event.preventDefault();
|
10597 | event.stopPropagation();
|
10598 | return;
|
10599 | }
|
10600 | navItemProps.onClick(event);
|
10601 | });
|
10602 | if (disabled && props.tabIndex === undefined) {
|
10603 | props.tabIndex = -1;
|
10604 | props['aria-disabled'] = true;
|
10605 | }
|
10606 |
|
10607 |
|
10608 | const Component = as || (action ? props.href ? 'a' : 'button' : 'div');
|
10609 | false ? 0 : void 0;
|
10610 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
10611 | ref: ref,
|
10612 | ...props,
|
10613 | ...navItemProps,
|
10614 | onClick: handleClick,
|
10615 | className: classnames_default()(className, bsPrefix, meta.isActive && 'active', disabled && 'disabled', variant && `${bsPrefix}-${variant}`, action && `${bsPrefix}-action`)
|
10616 | }, void 0, false, {
|
10617 | fileName: ListGroupItem_jsxFileName,
|
10618 | lineNumber: 113,
|
10619 | columnNumber: 9
|
10620 | }, undefined);
|
10621 | });
|
10622 | ListGroupItem.propTypes = ListGroupItem_propTypes;
|
10623 | ListGroupItem.displayName = 'ListGroupItem';
|
10624 | const src_ListGroupItem = (ListGroupItem);
|
10625 | ;
|
10626 | var ListGroup_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ListGroup.tsx";
|
10627 |
|
10628 |
|
10629 |
|
10630 |
|
10631 |
|
10632 |
|
10633 |
|
10634 |
|
10635 |
|
10636 | const ListGroup_propTypes = {
|
10637 | |
10638 |
|
10639 |
|
10640 | bsPrefix: (prop_types_default()).string,
|
10641 | |
10642 |
|
10643 |
|
10644 |
|
10645 |
|
10646 | variant: prop_types_default().oneOf(['flush']),
|
10647 | |
10648 |
|
10649 |
|
10650 |
|
10651 |
|
10652 |
|
10653 |
|
10654 | horizontal: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).string]),
|
10655 | |
10656 |
|
10657 |
|
10658 | numbered: (prop_types_default()).bool,
|
10659 | |
10660 |
|
10661 |
|
10662 | as: (prop_types_default()).elementType
|
10663 | };
|
10664 | const ListGroup = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
|
10665 | const {
|
10666 | className,
|
10667 | bsPrefix: initialBsPrefix,
|
10668 | variant,
|
10669 | horizontal,
|
10670 | numbered,
|
10671 |
|
10672 | as = 'div',
|
10673 | ...controlledProps
|
10674 | } = useUncontrolled(props, {
|
10675 | activeKey: 'onSelect'
|
10676 | });
|
10677 | const bsPrefix = useBootstrapPrefix(initialBsPrefix, 'list-group');
|
10678 | let horizontalVariant;
|
10679 | if (horizontal) {
|
10680 | horizontalVariant = horizontal === true ? 'horizontal' : `horizontal-${horizontal}`;
|
10681 | }
|
10682 | false ? 0 : void 0;
|
10683 | return (0,jsx_dev_runtime.jsxDEV)(esm_Nav, {
|
10684 | ref: ref,
|
10685 | ...controlledProps,
|
10686 | as: as,
|
10687 | className: classnames_default()(className, bsPrefix, variant && `${bsPrefix}-${variant}`, horizontalVariant && `${bsPrefix}-${horizontalVariant}`, numbered && `${bsPrefix}-numbered`)
|
10688 | }, void 0, false, {
|
10689 | fileName: ListGroup_jsxFileName,
|
10690 | lineNumber: 81,
|
10691 | columnNumber: 7
|
10692 | }, undefined);
|
10693 | });
|
10694 | ListGroup.propTypes = ListGroup_propTypes;
|
10695 | ListGroup.displayName = 'ListGroup';
|
10696 | const src_ListGroup = (Object.assign(ListGroup, {
|
10697 | Item: src_ListGroupItem
|
10698 | }));
|
10699 | ;
|
10700 |
|
10701 | var size;
|
10702 | function scrollbarSize(recalc) {
|
10703 | if (!size && size !== 0 || recalc) {
|
10704 | if (canUseDOM) {
|
10705 | var scrollDiv = document.createElement('div');
|
10706 | scrollDiv.style.position = 'absolute';
|
10707 | scrollDiv.style.top = '-9999px';
|
10708 | scrollDiv.style.width = '50px';
|
10709 | scrollDiv.style.height = '50px';
|
10710 | scrollDiv.style.overflow = 'scroll';
|
10711 | document.body.appendChild(scrollDiv);
|
10712 | size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
10713 | document.body.removeChild(scrollDiv);
|
10714 | }
|
10715 | }
|
10716 | return size;
|
10717 | }
|
10718 | ;
|
10719 |
|
10720 |
|
10721 |
|
10722 |
|
10723 |
|
10724 |
|
10725 |
|
10726 | function activeElement(doc) {
|
10727 | if (doc === void 0) {
|
10728 | doc = ownerDocument();
|
10729 | }
|
10730 |
|
10731 |
|
10732 |
|
10733 | try {
|
10734 | var active = doc.activeElement;
|
10735 |
|
10736 |
|
10737 | if (!active || !active.nodeName) return null;
|
10738 | return active;
|
10739 | } catch (e) {
|
10740 |
|
10741 | return doc.body;
|
10742 | }
|
10743 | }
|
10744 | ;
|
10745 |
|
10746 |
|
10747 |
|
10748 | function getBodyScrollbarWidth(ownerDocument = document) {
|
10749 | const window = ownerDocument.defaultView;
|
10750 | return Math.abs(window.innerWidth - ownerDocument.documentElement.clientWidth);
|
10751 | }
|
10752 | ;
|
10753 |
|
10754 |
|
10755 |
|
10756 | const OPEN_DATA_ATTRIBUTE = dataAttr('modal-open');
|
10757 |
|
10758 |
|
10759 |
|
10760 |
|
10761 |
|
10762 | class ModalManager {
|
10763 | constructor({
|
10764 | ownerDocument,
|
10765 | handleContainerOverflow = true,
|
10766 | isRTL = false
|
10767 | } = {}) {
|
10768 | this.handleContainerOverflow = handleContainerOverflow;
|
10769 | this.isRTL = isRTL;
|
10770 | this.modals = [];
|
10771 | this.ownerDocument = ownerDocument;
|
10772 | }
|
10773 | getScrollbarWidth() {
|
10774 | return getBodyScrollbarWidth(this.ownerDocument);
|
10775 | }
|
10776 | getElement() {
|
10777 | return (this.ownerDocument || document).body;
|
10778 | }
|
10779 | setModalAttributes(_modal) {
|
10780 |
|
10781 | }
|
10782 | removeModalAttributes(_modal) {
|
10783 |
|
10784 | }
|
10785 | setContainerStyle(containerState) {
|
10786 | const style = {
|
10787 | overflow: 'hidden'
|
10788 | };
|
10789 |
|
10790 |
|
10791 |
|
10792 | const paddingProp = this.isRTL ? 'paddingLeft' : 'paddingRight';
|
10793 | const container = this.getElement();
|
10794 | containerState.style = {
|
10795 | overflow: container.style.overflow,
|
10796 | [paddingProp]: container.style[paddingProp]
|
10797 | };
|
10798 | if (containerState.scrollBarWidth) {
|
10799 |
|
10800 |
|
10801 | style[paddingProp] = `${parseInt(css(container, paddingProp) || '0', 10) + containerState.scrollBarWidth}px`;
|
10802 | }
|
10803 | container.setAttribute(OPEN_DATA_ATTRIBUTE, '');
|
10804 | css(container, style);
|
10805 | }
|
10806 | reset() {
|
10807 | [...this.modals].forEach(m => this.remove(m));
|
10808 | }
|
10809 | removeContainerStyle(containerState) {
|
10810 | const container = this.getElement();
|
10811 | container.removeAttribute(OPEN_DATA_ATTRIBUTE);
|
10812 | Object.assign(container.style, containerState.style);
|
10813 | }
|
10814 | add(modal) {
|
10815 | let modalIdx = this.modals.indexOf(modal);
|
10816 | if (modalIdx !== -1) {
|
10817 | return modalIdx;
|
10818 | }
|
10819 | modalIdx = this.modals.length;
|
10820 | this.modals.push(modal);
|
10821 | this.setModalAttributes(modal);
|
10822 | if (modalIdx !== 0) {
|
10823 | return modalIdx;
|
10824 | }
|
10825 | this.state = {
|
10826 | scrollBarWidth: this.getScrollbarWidth(),
|
10827 | style: {}
|
10828 | };
|
10829 | if (this.handleContainerOverflow) {
|
10830 | this.setContainerStyle(this.state);
|
10831 | }
|
10832 | return modalIdx;
|
10833 | }
|
10834 | remove(modal) {
|
10835 | const modalIdx = this.modals.indexOf(modal);
|
10836 | if (modalIdx === -1) {
|
10837 | return;
|
10838 | }
|
10839 | this.modals.splice(modalIdx, 1);
|
10840 |
|
10841 |
|
10842 |
|
10843 | if (!this.modals.length && this.handleContainerOverflow) {
|
10844 | this.removeContainerStyle(this.state);
|
10845 | }
|
10846 | this.removeModalAttributes(modal);
|
10847 | }
|
10848 | isTopModal(modal) {
|
10849 | return !!this.modals.length && this.modals[this.modals.length - 1] === modal;
|
10850 | }
|
10851 | }
|
10852 | const esm_ModalManager = (ModalManager);
|
10853 | ;
|
10854 |
|
10855 |
|
10856 |
|
10857 |
|
10858 | const resolveContainerRef = (ref, document) => {
|
10859 | if (!canUseDOM) return null;
|
10860 | if (ref == null) return (document || ownerDocument()).body;
|
10861 | if (typeof ref === 'function') ref = ref();
|
10862 | if (ref && 'current' in ref) ref = ref.current;
|
10863 | if (ref && ('nodeType' in ref || ref.getBoundingClientRect)) return ref;
|
10864 | return null;
|
10865 | };
|
10866 | function useWaitForDOMRef(ref, onResolved) {
|
10867 | const window = useWindow();
|
10868 | const [resolvedRef, setRef] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(() => resolveContainerRef(ref, window == null ? void 0 : window.document));
|
10869 | if (!resolvedRef) {
|
10870 | const earlyRef = resolveContainerRef(ref);
|
10871 | if (earlyRef) setRef(earlyRef);
|
10872 | }
|
10873 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
10874 | if (onResolved && resolvedRef) {
|
10875 | onResolved(resolvedRef);
|
10876 | }
|
10877 | }, [onResolved, resolvedRef]);
|
10878 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
10879 | const nextRef = resolveContainerRef(ref);
|
10880 | if (nextRef !== resolvedRef) {
|
10881 | setRef(nextRef);
|
10882 | }
|
10883 | }, [ref, resolvedRef]);
|
10884 | return resolvedRef;
|
10885 | }
|
10886 | ;
|
10887 |
|
10888 |
|
10889 |
|
10890 | function NoopTransition({
|
10891 | children,
|
10892 | in: inProp,
|
10893 | onExited,
|
10894 | mountOnEnter,
|
10895 | unmountOnExit
|
10896 | }) {
|
10897 | const ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
10898 | const hasEnteredRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(inProp);
|
10899 | const handleExited = useEventCallback(onExited);
|
10900 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
10901 | if (inProp) hasEnteredRef.current = true;else {
|
10902 | handleExited(ref.current);
|
10903 | }
|
10904 | }, [inProp, handleExited]);
|
10905 | const combinedRef = esm_useMergedRefs(ref, children.ref);
|
10906 | const child = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(children, {
|
10907 | ref: combinedRef
|
10908 | });
|
10909 | if (inProp) return child;
|
10910 | if (unmountOnExit) {
|
10911 | return null;
|
10912 | }
|
10913 | if (!hasEnteredRef.current && mountOnEnter) {
|
10914 | return null;
|
10915 | }
|
10916 | return child;
|
10917 | }
|
10918 | const esm_NoopTransition = (NoopTransition);
|
10919 | ;
|
10920 |
|
10921 |
|
10922 |
|
10923 |
|
10924 |
|
10925 |
|
10926 | function useTransition({
|
10927 | in: inProp,
|
10928 | onTransition
|
10929 | }) {
|
10930 | const ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
10931 | const isInitialRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(true);
|
10932 | const handleTransition = useEventCallback(onTransition);
|
10933 | useIsomorphicEffect(() => {
|
10934 | if (!ref.current) {
|
10935 | return undefined;
|
10936 | }
|
10937 | let stale = false;
|
10938 | handleTransition({
|
10939 | in: inProp,
|
10940 | element: ref.current,
|
10941 | initial: isInitialRef.current,
|
10942 | isStale: () => stale
|
10943 | });
|
10944 | return () => {
|
10945 | stale = true;
|
10946 | };
|
10947 | }, [inProp, handleTransition]);
|
10948 | useIsomorphicEffect(() => {
|
10949 | isInitialRef.current = false;
|
10950 |
|
10951 | return () => {
|
10952 | isInitialRef.current = true;
|
10953 | };
|
10954 | }, []);
|
10955 | return ref;
|
10956 | }
|
10957 |
|
10958 |
|
10959 |
|
10960 |
|
10961 |
|
10962 |
|
10963 | function ImperativeTransition({
|
10964 | children,
|
10965 | in: inProp,
|
10966 | onExited,
|
10967 | onEntered,
|
10968 | transition
|
10969 | }) {
|
10970 | const [exited, setExited] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(!inProp);
|
10971 |
|
10972 |
|
10973 | if (inProp && exited) {
|
10974 | setExited(false);
|
10975 | }
|
10976 | const ref = useTransition({
|
10977 | in: !!inProp,
|
10978 | onTransition: options => {
|
10979 | const onFinish = () => {
|
10980 | if (options.isStale()) return;
|
10981 | if (options.in) {
|
10982 | onEntered == null ? void 0 : onEntered(options.element, options.initial);
|
10983 | } else {
|
10984 | setExited(true);
|
10985 | onExited == null ? void 0 : onExited(options.element);
|
10986 | }
|
10987 | };
|
10988 | Promise.resolve(transition(options)).then(onFinish, error => {
|
10989 | if (!options.in) setExited(true);
|
10990 | throw error;
|
10991 | });
|
10992 | }
|
10993 | });
|
10994 | const combinedRef = esm_useMergedRefs(ref, children.ref);
|
10995 | return exited && !inProp ? null : (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(children, {
|
10996 | ref: combinedRef
|
10997 | });
|
10998 | }
|
10999 | function renderTransition(Component, runTransition, props) {
|
11000 | if (Component) {
|
11001 | return (0,jsx_runtime.jsx)(Component, Object.assign({}, props));
|
11002 | }
|
11003 | if (runTransition) {
|
11004 | return (0,jsx_runtime.jsx)(ImperativeTransition, Object.assign({}, props, {
|
11005 | transition: runTransition
|
11006 | }));
|
11007 | }
|
11008 | return (0,jsx_runtime.jsx)(esm_NoopTransition, Object.assign({}, props));
|
11009 | }
|
11010 | ;
|
11011 |
|
11012 | function isEscKey(e) {
|
11013 | return e.code === 'Escape' || e.keyCode === 27;
|
11014 | }
|
11015 | ;
|
11016 | const Modal_excluded = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
|
11017 | function Modal_objectWithoutPropertiesLoose(source, excluded) {
|
11018 | if (source == null) return {};
|
11019 | var target = {};
|
11020 | var sourceKeys = Object.keys(source);
|
11021 | var key, i;
|
11022 | for (i = 0; i < sourceKeys.length; i++) {
|
11023 | key = sourceKeys[i];
|
11024 | if (excluded.indexOf(key) >= 0) continue;
|
11025 | target[key] = source[key];
|
11026 | }
|
11027 | return target;
|
11028 | }
|
11029 |
|
11030 |
|
11031 |
|
11032 |
|
11033 |
|
11034 |
|
11035 |
|
11036 |
|
11037 |
|
11038 |
|
11039 |
|
11040 |
|
11041 |
|
11042 |
|
11043 |
|
11044 |
|
11045 |
|
11046 |
|
11047 |
|
11048 |
|
11049 |
|
11050 | let manager;
|
11051 | function getManager(window) {
|
11052 | if (!manager) manager = new esm_ModalManager({
|
11053 | ownerDocument: window == null ? void 0 : window.document
|
11054 | });
|
11055 | return manager;
|
11056 | }
|
11057 | function useModalManager(provided) {
|
11058 | const window = useWindow();
|
11059 | const modalManager = provided || getManager(window);
|
11060 | const modal = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
11061 | dialog: null,
|
11062 | backdrop: null
|
11063 | });
|
11064 | return Object.assign(modal.current, {
|
11065 | add: () => modalManager.add(modal.current),
|
11066 | remove: () => modalManager.remove(modal.current),
|
11067 | isTopModal: () => modalManager.isTopModal(modal.current),
|
11068 | setDialogRef: (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(ref => {
|
11069 | modal.current.dialog = ref;
|
11070 | }, []),
|
11071 | setBackdropRef: (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(ref => {
|
11072 | modal.current.backdrop = ref;
|
11073 | }, [])
|
11074 | });
|
11075 | }
|
11076 | const Modal = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((_ref, ref) => {
|
11077 | let {
|
11078 | show = false,
|
11079 | role = 'dialog',
|
11080 | className,
|
11081 | style,
|
11082 | children,
|
11083 | backdrop = true,
|
11084 | keyboard = true,
|
11085 | onBackdropClick,
|
11086 | onEscapeKeyDown,
|
11087 | transition,
|
11088 | runTransition,
|
11089 | backdropTransition,
|
11090 | runBackdropTransition,
|
11091 | autoFocus = true,
|
11092 | enforceFocus = true,
|
11093 | restoreFocus = true,
|
11094 | restoreFocusOptions,
|
11095 | renderDialog,
|
11096 | renderBackdrop = props => (0,jsx_runtime.jsx)("div", Object.assign({}, props)),
|
11097 | manager: providedManager,
|
11098 | container: containerRef,
|
11099 | onShow,
|
11100 | onHide = () => {},
|
11101 | onExit,
|
11102 | onExited,
|
11103 | onExiting,
|
11104 | onEnter,
|
11105 | onEntering,
|
11106 | onEntered
|
11107 | } = _ref,
|
11108 | rest = Modal_objectWithoutPropertiesLoose(_ref, Modal_excluded);
|
11109 | const ownerWindow = useWindow();
|
11110 | const container = useWaitForDOMRef(containerRef);
|
11111 | const modal = useModalManager(providedManager);
|
11112 | const isMounted = useMounted();
|
11113 | const prevShow = usePrevious(show);
|
11114 | const [exited, setExited] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(!show);
|
11115 | const lastFocusRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
11116 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => modal, [modal]);
|
11117 | if (canUseDOM && !prevShow && show) {
|
11118 | lastFocusRef.current = activeElement(ownerWindow == null ? void 0 : ownerWindow.document);
|
11119 | }
|
11120 |
|
11121 |
|
11122 | if (show && exited) {
|
11123 | setExited(false);
|
11124 | }
|
11125 | const handleShow = useEventCallback(() => {
|
11126 | modal.add();
|
11127 | removeKeydownListenerRef.current = esm_listen(document, 'keydown', handleDocumentKeyDown);
|
11128 | removeFocusListenerRef.current = esm_listen(document, 'focus',
|
11129 |
|
11130 |
|
11131 | () => setTimeout(handleEnforceFocus), true);
|
11132 | if (onShow) {
|
11133 | onShow();
|
11134 | }
|
11135 |
|
11136 |
|
11137 |
|
11138 | if (autoFocus) {
|
11139 | var _modal$dialog$ownerDo, _modal$dialog;
|
11140 | const currentActiveElement = activeElement((_modal$dialog$ownerDo = (_modal$dialog = modal.dialog) == null ? void 0 : _modal$dialog.ownerDocument) != null ? _modal$dialog$ownerDo : ownerWindow == null ? void 0 : ownerWindow.document);
|
11141 | if (modal.dialog && currentActiveElement && !contains_contains(modal.dialog, currentActiveElement)) {
|
11142 | lastFocusRef.current = currentActiveElement;
|
11143 | modal.dialog.focus();
|
11144 | }
|
11145 | }
|
11146 | });
|
11147 | const handleHide = useEventCallback(() => {
|
11148 | modal.remove();
|
11149 | removeKeydownListenerRef.current == null ? void 0 : removeKeydownListenerRef.current();
|
11150 | removeFocusListenerRef.current == null ? void 0 : removeFocusListenerRef.current();
|
11151 | if (restoreFocus) {
|
11152 | var _lastFocusRef$current;
|
11153 |
|
11154 | (_lastFocusRef$current = lastFocusRef.current) == null ? void 0 : _lastFocusRef$current.focus == null ? void 0 : _lastFocusRef$current.focus(restoreFocusOptions);
|
11155 | lastFocusRef.current = null;
|
11156 | }
|
11157 | });
|
11158 |
|
11159 |
|
11160 |
|
11161 |
|
11162 |
|
11163 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
11164 | if (!show || !container) return;
|
11165 | handleShow();
|
11166 | }, [show, container, handleShow]);
|
11167 |
|
11168 |
|
11169 |
|
11170 |
|
11171 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
11172 | if (!exited) return;
|
11173 | handleHide();
|
11174 | }, [exited, handleHide]);
|
11175 | useWillUnmount(() => {
|
11176 | handleHide();
|
11177 | });
|
11178 |
|
11179 |
|
11180 |
|
11181 | const handleEnforceFocus = useEventCallback(() => {
|
11182 | if (!enforceFocus || !isMounted() || !modal.isTopModal()) {
|
11183 | return;
|
11184 | }
|
11185 | const currentActiveElement = activeElement(ownerWindow == null ? void 0 : ownerWindow.document);
|
11186 | if (modal.dialog && currentActiveElement && !contains_contains(modal.dialog, currentActiveElement)) {
|
11187 | modal.dialog.focus();
|
11188 | }
|
11189 | });
|
11190 | const handleBackdropClick = useEventCallback(e => {
|
11191 | if (e.target !== e.currentTarget) {
|
11192 | return;
|
11193 | }
|
11194 | onBackdropClick == null ? void 0 : onBackdropClick(e);
|
11195 | if (backdrop === true) {
|
11196 | onHide();
|
11197 | }
|
11198 | });
|
11199 | const handleDocumentKeyDown = useEventCallback(e => {
|
11200 | if (keyboard && isEscKey(e) && modal.isTopModal()) {
|
11201 | onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(e);
|
11202 | if (!e.defaultPrevented) {
|
11203 | onHide();
|
11204 | }
|
11205 | }
|
11206 | });
|
11207 | const removeFocusListenerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
11208 | const removeKeydownListenerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
11209 | const handleHidden = (...args) => {
|
11210 | setExited(true);
|
11211 | onExited == null ? void 0 : onExited(...args);
|
11212 | };
|
11213 | if (!container) {
|
11214 | return null;
|
11215 | }
|
11216 | const dialogProps = Object.assign({
|
11217 | role,
|
11218 | ref: modal.setDialogRef,
|
11219 |
|
11220 | 'aria-modal': role === 'dialog' ? true : undefined
|
11221 | }, rest, {
|
11222 | style,
|
11223 | className,
|
11224 | tabIndex: -1
|
11225 | });
|
11226 | let dialog = renderDialog ? renderDialog(dialogProps) : (0,jsx_runtime.jsx)("div", Object.assign({}, dialogProps, {
|
11227 | children: external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(children, {
|
11228 | role: 'document'
|
11229 | })
|
11230 | }));
|
11231 | dialog = renderTransition(transition, runTransition, {
|
11232 | unmountOnExit: true,
|
11233 | mountOnEnter: true,
|
11234 | appear: true,
|
11235 | in: !!show,
|
11236 | onExit,
|
11237 | onExiting,
|
11238 | onExited: handleHidden,
|
11239 | onEnter,
|
11240 | onEntering,
|
11241 | onEntered,
|
11242 | children: dialog
|
11243 | });
|
11244 | let backdropElement = null;
|
11245 | if (backdrop) {
|
11246 | backdropElement = renderBackdrop({
|
11247 | ref: modal.setBackdropRef,
|
11248 | onClick: handleBackdropClick
|
11249 | });
|
11250 | backdropElement = renderTransition(backdropTransition, runBackdropTransition, {
|
11251 | in: !!show,
|
11252 | appear: true,
|
11253 | mountOnEnter: true,
|
11254 | unmountOnExit: true,
|
11255 | children: backdropElement
|
11256 | });
|
11257 | }
|
11258 | return (0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
11259 | children: external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().createPortal( (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
11260 | children: [backdropElement, dialog]
|
11261 | }), container)
|
11262 | });
|
11263 | });
|
11264 | Modal.displayName = 'Modal';
|
11265 | const esm_Modal = (Object.assign(Modal, {
|
11266 | Manager: esm_ModalManager
|
11267 | }));
|
11268 | ;
|
11269 |
|
11270 |
|
11271 |
|
11272 |
|
11273 |
|
11274 |
|
11275 | function hasClass(element, className) {
|
11276 | if (element.classList) return !!className && element.classList.contains(className);
|
11277 | return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
|
11278 | }
|
11279 | ;
|
11280 |
|
11281 |
|
11282 |
|
11283 |
|
11284 |
|
11285 |
|
11286 |
|
11287 |
|
11288 | function addClass(element, className) {
|
11289 | if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
|
11290 | }
|
11291 | ;
|
11292 | function replaceClassName(origClass, classToRemove) {
|
11293 | return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
|
11294 | }
|
11295 |
|
11296 |
|
11297 |
|
11298 |
|
11299 |
|
11300 |
|
11301 |
|
11302 | function removeClass(element, className) {
|
11303 | if (element.classList) {
|
11304 | element.classList.remove(className);
|
11305 | } else if (typeof element.className === 'string') {
|
11306 | element.className = replaceClassName(element.className, className);
|
11307 | } else {
|
11308 | element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
|
11309 | }
|
11310 | }
|
11311 | ;
|
11312 |
|
11313 |
|
11314 |
|
11315 |
|
11316 |
|
11317 | const Selector = {
|
11318 | FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
|
11319 | STICKY_CONTENT: '.sticky-top',
|
11320 | NAVBAR_TOGGLER: '.navbar-toggler'
|
11321 | };
|
11322 | class BootstrapModalManager extends esm_ModalManager {
|
11323 | adjustAndStore(prop, element, adjust) {
|
11324 | const actual = element.style[prop];
|
11325 |
|
11326 |
|
11327 | element.dataset[prop] = actual;
|
11328 | css(element, {
|
11329 | [prop]: `${parseFloat(css(element, prop)) + adjust}px`
|
11330 | });
|
11331 | }
|
11332 | restore(prop, element) {
|
11333 | const value = element.dataset[prop];
|
11334 | if (value !== undefined) {
|
11335 | delete element.dataset[prop];
|
11336 | css(element, {
|
11337 | [prop]: value
|
11338 | });
|
11339 | }
|
11340 | }
|
11341 | setContainerStyle(containerState) {
|
11342 | super.setContainerStyle(containerState);
|
11343 | const container = this.getElement();
|
11344 | addClass(container, 'modal-open');
|
11345 | if (!containerState.scrollBarWidth) return;
|
11346 | const paddingProp = this.isRTL ? 'paddingLeft' : 'paddingRight';
|
11347 | const marginProp = this.isRTL ? 'marginLeft' : 'marginRight';
|
11348 | qsa(container, Selector.FIXED_CONTENT).forEach(el => this.adjustAndStore(paddingProp, el, containerState.scrollBarWidth));
|
11349 | qsa(container, Selector.STICKY_CONTENT).forEach(el => this.adjustAndStore(marginProp, el, -containerState.scrollBarWidth));
|
11350 | qsa(container, Selector.NAVBAR_TOGGLER).forEach(el => this.adjustAndStore(marginProp, el, containerState.scrollBarWidth));
|
11351 | }
|
11352 | removeContainerStyle(containerState) {
|
11353 | super.removeContainerStyle(containerState);
|
11354 | const container = this.getElement();
|
11355 | removeClass(container, 'modal-open');
|
11356 | const paddingProp = this.isRTL ? 'paddingLeft' : 'paddingRight';
|
11357 | const marginProp = this.isRTL ? 'marginLeft' : 'marginRight';
|
11358 | qsa(container, Selector.FIXED_CONTENT).forEach(el => this.restore(paddingProp, el));
|
11359 | qsa(container, Selector.STICKY_CONTENT).forEach(el => this.restore(marginProp, el));
|
11360 | qsa(container, Selector.NAVBAR_TOGGLER).forEach(el => this.restore(marginProp, el));
|
11361 | }
|
11362 | }
|
11363 | let sharedManager;
|
11364 | function getSharedManager(options) {
|
11365 | if (!sharedManager) sharedManager = new BootstrapModalManager(options);
|
11366 | return sharedManager;
|
11367 | }
|
11368 | const src_BootstrapModalManager = (BootstrapModalManager);
|
11369 | ;
|
11370 | var ModalBody_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ModalBody.tsx";
|
11371 |
|
11372 |
|
11373 |
|
11374 |
|
11375 | const ModalBody = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
11376 | className,
|
11377 | bsPrefix,
|
11378 | as: Component = 'div',
|
11379 | ...props
|
11380 | }, ref) => {
|
11381 | bsPrefix = useBootstrapPrefix(bsPrefix, 'modal-body');
|
11382 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
11383 | ref: ref,
|
11384 | className: classnames_default()(className, bsPrefix),
|
11385 | ...props
|
11386 | }, void 0, false, {
|
11387 | fileName: ModalBody_jsxFileName,
|
11388 | lineNumber: 15,
|
11389 | columnNumber: 9
|
11390 | }, undefined);
|
11391 | });
|
11392 | ModalBody.displayName = 'ModalBody';
|
11393 | const src_ModalBody = (ModalBody);
|
11394 | ;
|
11395 |
|
11396 | const ModalContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
|
11397 |
|
11398 | onHide() {}
|
11399 | });
|
11400 | const src_ModalContext = (ModalContext);
|
11401 | ;
|
11402 | var ModalDialog_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ModalDialog.tsx";
|
11403 |
|
11404 |
|
11405 |
|
11406 |
|
11407 |
|
11408 | const ModalDialog_propTypes = {
|
11409 |
|
11410 | bsPrefix: (prop_types_default()).string,
|
11411 | contentClassName: (prop_types_default()).string,
|
11412 | |
11413 |
|
11414 |
|
11415 |
|
11416 |
|
11417 | size: (prop_types_default()).string,
|
11418 | |
11419 |
|
11420 |
|
11421 |
|
11422 |
|
11423 |
|
11424 | fullscreen: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).string]),
|
11425 | |
11426 |
|
11427 |
|
11428 | centered: (prop_types_default()).bool,
|
11429 | |
11430 |
|
11431 |
|
11432 | scrollable: (prop_types_default()).bool
|
11433 | };
|
11434 | const ModalDialog = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
11435 | bsPrefix,
|
11436 | className,
|
11437 | contentClassName,
|
11438 | centered,
|
11439 | size,
|
11440 | fullscreen,
|
11441 | children,
|
11442 | scrollable,
|
11443 | ...props
|
11444 | }, ref) => {
|
11445 | bsPrefix = useBootstrapPrefix(bsPrefix, 'modal');
|
11446 | const dialogClass = `${bsPrefix}-dialog`;
|
11447 | const fullScreenClass = typeof fullscreen === 'string' ? `${bsPrefix}-fullscreen-${fullscreen}` : `${bsPrefix}-fullscreen`;
|
11448 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
11449 | ...props,
|
11450 | ref: ref,
|
11451 | className: classnames_default()(dialogClass, className, size && `${bsPrefix}-${size}`, centered && `${dialogClass}-centered`, scrollable && `${dialogClass}-scrollable`, fullscreen && fullScreenClass),
|
11452 | children: (0,jsx_dev_runtime.jsxDEV)("div", {
|
11453 | className: classnames_default()(`${bsPrefix}-content`, contentClassName),
|
11454 | children: children
|
11455 | }, void 0, false, {
|
11456 | fileName: ModalDialog_jsxFileName,
|
11457 | lineNumber: 93,
|
11458 | columnNumber: 9
|
11459 | }, undefined)
|
11460 | }, void 0, false, {
|
11461 | fileName: ModalDialog_jsxFileName,
|
11462 | lineNumber: 81,
|
11463 | columnNumber: 7
|
11464 | }, undefined);
|
11465 | });
|
11466 | ModalDialog.displayName = 'ModalDialog';
|
11467 | ModalDialog.propTypes = ModalDialog_propTypes;
|
11468 | const src_ModalDialog = (ModalDialog);
|
11469 | ;
|
11470 | var ModalFooter_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ModalFooter.tsx";
|
11471 |
|
11472 |
|
11473 |
|
11474 |
|
11475 | const ModalFooter = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
11476 | className,
|
11477 | bsPrefix,
|
11478 | as: Component = 'div',
|
11479 | ...props
|
11480 | }, ref) => {
|
11481 | bsPrefix = useBootstrapPrefix(bsPrefix, 'modal-footer');
|
11482 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
11483 | ref: ref,
|
11484 | className: classnames_default()(className, bsPrefix),
|
11485 | ...props
|
11486 | }, void 0, false, {
|
11487 | fileName: ModalFooter_jsxFileName,
|
11488 | lineNumber: 15,
|
11489 | columnNumber: 9
|
11490 | }, undefined);
|
11491 | });
|
11492 | ModalFooter.displayName = 'ModalFooter';
|
11493 | const src_ModalFooter = (ModalFooter);
|
11494 | ;
|
11495 | var AbstractModalHeader_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/AbstractModalHeader.tsx";
|
11496 |
|
11497 |
|
11498 |
|
11499 |
|
11500 |
|
11501 |
|
11502 |
|
11503 | const AbstractModalHeader_propTypes = {
|
11504 | |
11505 |
|
11506 |
|
11507 |
|
11508 |
|
11509 | closeLabel: (prop_types_default()).string,
|
11510 | |
11511 |
|
11512 |
|
11513 | closeVariant: prop_types_default().oneOf(['white']),
|
11514 | |
11515 |
|
11516 |
|
11517 | closeButton: (prop_types_default()).bool,
|
11518 | |
11519 |
|
11520 |
|
11521 |
|
11522 |
|
11523 | onHide: (prop_types_default()).func
|
11524 | };
|
11525 | const AbstractModalHeader = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
11526 | closeLabel = 'Close',
|
11527 | closeVariant,
|
11528 | closeButton = false,
|
11529 | onHide,
|
11530 | children,
|
11531 | ...props
|
11532 | }, ref) => {
|
11533 | const context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_ModalContext);
|
11534 | const handleClick = useEventCallback(() => {
|
11535 | context == null ? void 0 : context.onHide();
|
11536 | onHide == null ? void 0 : onHide();
|
11537 | });
|
11538 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
11539 | ref: ref,
|
11540 | ...props,
|
11541 | children: [children, closeButton && (0,jsx_dev_runtime.jsxDEV)(src_CloseButton, {
|
11542 | "aria-label": closeLabel,
|
11543 | variant: closeVariant,
|
11544 | onClick: handleClick
|
11545 | }, void 0, false, {
|
11546 | fileName: AbstractModalHeader_jsxFileName,
|
11547 | lineNumber: 69,
|
11548 | columnNumber: 11
|
11549 | }, undefined)]
|
11550 | }, void 0, true, {
|
11551 | fileName: AbstractModalHeader_jsxFileName,
|
11552 | lineNumber: 65,
|
11553 | columnNumber: 7
|
11554 | }, undefined);
|
11555 | });
|
11556 | AbstractModalHeader.propTypes = AbstractModalHeader_propTypes;
|
11557 | const src_AbstractModalHeader = (AbstractModalHeader);
|
11558 | ;
|
11559 | var ModalHeader_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ModalHeader.tsx";
|
11560 |
|
11561 |
|
11562 |
|
11563 |
|
11564 |
|
11565 |
|
11566 | const ModalHeader_propTypes = {
|
11567 | |
11568 |
|
11569 |
|
11570 | bsPrefix: (prop_types_default()).string,
|
11571 | |
11572 |
|
11573 |
|
11574 |
|
11575 |
|
11576 | closeLabel: (prop_types_default()).string,
|
11577 | |
11578 |
|
11579 |
|
11580 | closeVariant: prop_types_default().oneOf(['white']),
|
11581 | |
11582 |
|
11583 |
|
11584 | closeButton: (prop_types_default()).bool,
|
11585 | |
11586 |
|
11587 |
|
11588 |
|
11589 |
|
11590 | onHide: (prop_types_default()).func
|
11591 | };
|
11592 | const ModalHeader = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
11593 | bsPrefix,
|
11594 | className,
|
11595 | closeLabel = 'Close',
|
11596 | closeButton = false,
|
11597 | ...props
|
11598 | }, ref) => {
|
11599 | bsPrefix = useBootstrapPrefix(bsPrefix, 'modal-header');
|
11600 | return (0,jsx_dev_runtime.jsxDEV)(src_AbstractModalHeader, {
|
11601 | ref: ref,
|
11602 | ...props,
|
11603 | className: classnames_default()(className, bsPrefix),
|
11604 | closeLabel: closeLabel,
|
11605 | closeButton: closeButton
|
11606 | }, void 0, false, {
|
11607 | fileName: ModalHeader_jsxFileName,
|
11608 | lineNumber: 59,
|
11609 | columnNumber: 7
|
11610 | }, undefined);
|
11611 | });
|
11612 | ModalHeader.displayName = 'ModalHeader';
|
11613 | ModalHeader.propTypes = ModalHeader_propTypes;
|
11614 | const src_ModalHeader = (ModalHeader);
|
11615 | ;
|
11616 | var ModalTitle_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ModalTitle.tsx";
|
11617 |
|
11618 |
|
11619 |
|
11620 |
|
11621 |
|
11622 | const ModalTitle_DivStyledAsH4 = divWithClassName('h4');
|
11623 | const ModalTitle = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
11624 | className,
|
11625 | bsPrefix,
|
11626 | as: Component = ModalTitle_DivStyledAsH4,
|
11627 | ...props
|
11628 | }, ref) => {
|
11629 | bsPrefix = useBootstrapPrefix(bsPrefix, 'modal-title');
|
11630 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
11631 | ref: ref,
|
11632 | className: classnames_default()(className, bsPrefix),
|
11633 | ...props
|
11634 | }, void 0, false, {
|
11635 | fileName: ModalTitle_jsxFileName,
|
11636 | lineNumber: 18,
|
11637 | columnNumber: 9
|
11638 | }, undefined);
|
11639 | });
|
11640 | ModalTitle.displayName = 'ModalTitle';
|
11641 | const src_ModalTitle = (ModalTitle);
|
11642 | ;
|
11643 | var Modal_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Modal.tsx";
|
11644 |
|
11645 |
|
11646 |
|
11647 |
|
11648 |
|
11649 |
|
11650 |
|
11651 |
|
11652 |
|
11653 |
|
11654 |
|
11655 |
|
11656 |
|
11657 |
|
11658 |
|
11659 |
|
11660 |
|
11661 |
|
11662 |
|
11663 |
|
11664 |
|
11665 |
|
11666 |
|
11667 |
|
11668 |
|
11669 | const Modal_propTypes = {
|
11670 | |
11671 |
|
11672 |
|
11673 | bsPrefix: (prop_types_default()).string,
|
11674 | |
11675 |
|
11676 |
|
11677 |
|
11678 |
|
11679 | size: (prop_types_default()).string,
|
11680 | |
11681 |
|
11682 |
|
11683 |
|
11684 |
|
11685 |
|
11686 | fullscreen: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).string]),
|
11687 | |
11688 |
|
11689 |
|
11690 | centered: (prop_types_default()).bool,
|
11691 | |
11692 |
|
11693 |
|
11694 |
|
11695 | backdrop: prop_types_default().oneOf(['static', true, false]),
|
11696 | |
11697 |
|
11698 |
|
11699 |
|
11700 | backdropClassName: (prop_types_default()).string,
|
11701 | |
11702 |
|
11703 |
|
11704 | keyboard: (prop_types_default()).bool,
|
11705 | |
11706 |
|
11707 |
|
11708 | scrollable: (prop_types_default()).bool,
|
11709 | |
11710 |
|
11711 |
|
11712 | animation: (prop_types_default()).bool,
|
11713 | |
11714 |
|
11715 |
|
11716 | dialogClassName: (prop_types_default()).string,
|
11717 | |
11718 |
|
11719 |
|
11720 | contentClassName: (prop_types_default()).string,
|
11721 | |
11722 |
|
11723 |
|
11724 |
|
11725 |
|
11726 | dialogAs: (prop_types_default()).elementType,
|
11727 | |
11728 |
|
11729 |
|
11730 |
|
11731 |
|
11732 |
|
11733 | autoFocus: (prop_types_default()).bool,
|
11734 | |
11735 |
|
11736 |
|
11737 |
|
11738 |
|
11739 | enforceFocus: (prop_types_default()).bool,
|
11740 | |
11741 |
|
11742 |
|
11743 |
|
11744 | restoreFocus: (prop_types_default()).bool,
|
11745 | |
11746 |
|
11747 |
|
11748 |
|
11749 |
|
11750 | restoreFocusOptions: prop_types_default().shape({
|
11751 | preventScroll: (prop_types_default()).bool
|
11752 | }),
|
11753 | |
11754 |
|
11755 |
|
11756 | show: (prop_types_default()).bool,
|
11757 | |
11758 |
|
11759 |
|
11760 | onShow: (prop_types_default()).func,
|
11761 | |
11762 |
|
11763 |
|
11764 |
|
11765 | onHide: (prop_types_default()).func,
|
11766 | |
11767 |
|
11768 |
|
11769 | onEscapeKeyDown: (prop_types_default()).func,
|
11770 | |
11771 |
|
11772 |
|
11773 | onEnter: (prop_types_default()).func,
|
11774 | |
11775 |
|
11776 |
|
11777 | onEntering: (prop_types_default()).func,
|
11778 | |
11779 |
|
11780 |
|
11781 | onEntered: (prop_types_default()).func,
|
11782 | |
11783 |
|
11784 |
|
11785 | onExit: (prop_types_default()).func,
|
11786 | |
11787 |
|
11788 |
|
11789 | onExiting: (prop_types_default()).func,
|
11790 | |
11791 |
|
11792 |
|
11793 | onExited: (prop_types_default()).func,
|
11794 | |
11795 |
|
11796 |
|
11797 |
|
11798 | manager: (prop_types_default()).object,
|
11799 | |
11800 |
|
11801 |
|
11802 | container: (prop_types_default()).any,
|
11803 | 'aria-labelledby': (prop_types_default()).string,
|
11804 | 'aria-describedby': (prop_types_default()).string,
|
11805 | 'aria-label': (prop_types_default()).string
|
11806 | };
|
11807 |
|
11808 |
|
11809 | function DialogTransition(props) {
|
11810 | return (0,jsx_dev_runtime.jsxDEV)(src_Fade, {
|
11811 | ...props,
|
11812 | timeout: null
|
11813 | }, void 0, false, {
|
11814 | fileName: Modal_jsxFileName,
|
11815 | lineNumber: 227,
|
11816 | columnNumber: 10
|
11817 | }, this);
|
11818 | }
|
11819 | function BackdropTransition(props) {
|
11820 | return (0,jsx_dev_runtime.jsxDEV)(src_Fade, {
|
11821 | ...props,
|
11822 | timeout: null
|
11823 | }, void 0, false, {
|
11824 | fileName: Modal_jsxFileName,
|
11825 | lineNumber: 231,
|
11826 | columnNumber: 10
|
11827 | }, this);
|
11828 | }
|
11829 |
|
11830 |
|
11831 | const Modal_Modal = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
11832 | bsPrefix,
|
11833 | className,
|
11834 | style,
|
11835 | dialogClassName,
|
11836 | contentClassName,
|
11837 | children,
|
11838 | dialogAs: Dialog = src_ModalDialog,
|
11839 | 'aria-labelledby': ariaLabelledby,
|
11840 | 'aria-describedby': ariaDescribedby,
|
11841 | 'aria-label': ariaLabel,
|
11842 |
|
11843 |
|
11844 | show = false,
|
11845 | animation = true,
|
11846 | backdrop = true,
|
11847 | keyboard = true,
|
11848 | onEscapeKeyDown,
|
11849 | onShow,
|
11850 | onHide,
|
11851 | container,
|
11852 | autoFocus = true,
|
11853 | enforceFocus = true,
|
11854 | restoreFocus = true,
|
11855 | restoreFocusOptions,
|
11856 | onEntered,
|
11857 | onExit,
|
11858 | onExiting,
|
11859 | onEnter,
|
11860 | onEntering,
|
11861 | onExited,
|
11862 | backdropClassName,
|
11863 | manager: propsManager,
|
11864 | ...props
|
11865 | }, ref) => {
|
11866 | const [modalStyle, setStyle] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({});
|
11867 | const [animateStaticModal, setAnimateStaticModal] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
11868 | const waitingForMouseUpRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
11869 | const ignoreBackdropClickRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
11870 | const removeStaticModalAnimationRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
11871 | const [modal, setModalRef] = useCallbackRef();
|
11872 | const mergedRef = esm_useMergedRefs(ref, setModalRef);
|
11873 | const handleHide = useEventCallback(onHide);
|
11874 | const isRTL = useIsRTL();
|
11875 | bsPrefix = useBootstrapPrefix(bsPrefix, 'modal');
|
11876 | const modalContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
11877 | onHide: handleHide
|
11878 | }), [handleHide]);
|
11879 | function getModalManager() {
|
11880 | if (propsManager) return propsManager;
|
11881 | return getSharedManager({
|
11882 | isRTL
|
11883 | });
|
11884 | }
|
11885 | function updateDialogStyle(node) {
|
11886 | if (!canUseDOM) return;
|
11887 | const containerIsOverflowing = getModalManager().getScrollbarWidth() > 0;
|
11888 | const modalIsOverflowing = node.scrollHeight > ownerDocument(node).documentElement.clientHeight;
|
11889 | setStyle({
|
11890 | paddingRight: containerIsOverflowing && !modalIsOverflowing ? scrollbarSize() : undefined,
|
11891 | paddingLeft: !containerIsOverflowing && modalIsOverflowing ? scrollbarSize() : undefined
|
11892 | });
|
11893 | }
|
11894 | const handleWindowResize = useEventCallback(() => {
|
11895 | if (modal) {
|
11896 | updateDialogStyle(modal.dialog);
|
11897 | }
|
11898 | });
|
11899 | useWillUnmount(() => {
|
11900 | esm_removeEventListener(window, 'resize', handleWindowResize);
|
11901 | removeStaticModalAnimationRef.current == null ? void 0 : removeStaticModalAnimationRef.current();
|
11902 | });
|
11903 |
|
11904 |
|
11905 |
|
11906 |
|
11907 | const handleDialogMouseDown = () => {
|
11908 | waitingForMouseUpRef.current = true;
|
11909 | };
|
11910 | const handleMouseUp = e => {
|
11911 | if (waitingForMouseUpRef.current && modal && e.target === modal.dialog) {
|
11912 | ignoreBackdropClickRef.current = true;
|
11913 | }
|
11914 | waitingForMouseUpRef.current = false;
|
11915 | };
|
11916 | const handleStaticModalAnimation = () => {
|
11917 | setAnimateStaticModal(true);
|
11918 | removeStaticModalAnimationRef.current = transitionEnd(modal.dialog, () => {
|
11919 | setAnimateStaticModal(false);
|
11920 | });
|
11921 | };
|
11922 | const handleStaticBackdropClick = e => {
|
11923 | if (e.target !== e.currentTarget) {
|
11924 | return;
|
11925 | }
|
11926 | handleStaticModalAnimation();
|
11927 | };
|
11928 | const handleClick = e => {
|
11929 | if (backdrop === 'static') {
|
11930 | handleStaticBackdropClick(e);
|
11931 | return;
|
11932 | }
|
11933 | if (ignoreBackdropClickRef.current || e.target !== e.currentTarget) {
|
11934 | ignoreBackdropClickRef.current = false;
|
11935 | return;
|
11936 | }
|
11937 | onHide == null ? void 0 : onHide();
|
11938 | };
|
11939 | const handleEscapeKeyDown = e => {
|
11940 | if (keyboard) {
|
11941 | onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(e);
|
11942 | } else {
|
11943 |
|
11944 | e.preventDefault();
|
11945 | if (backdrop === 'static') {
|
11946 |
|
11947 | handleStaticModalAnimation();
|
11948 | }
|
11949 | }
|
11950 | };
|
11951 | const handleEnter = (node, isAppearing) => {
|
11952 | if (node) {
|
11953 | updateDialogStyle(node);
|
11954 | }
|
11955 | onEnter == null ? void 0 : onEnter(node, isAppearing);
|
11956 | };
|
11957 | const handleExit = node => {
|
11958 | removeStaticModalAnimationRef.current == null ? void 0 : removeStaticModalAnimationRef.current();
|
11959 | onExit == null ? void 0 : onExit(node);
|
11960 | };
|
11961 | const handleEntering = (node, isAppearing) => {
|
11962 | onEntering == null ? void 0 : onEntering(node, isAppearing);
|
11963 |
|
11964 |
|
11965 | esm_addEventListener(window, 'resize', handleWindowResize);
|
11966 | };
|
11967 | const handleExited = node => {
|
11968 | if (node) node.style.display = '';
|
11969 | onExited == null ? void 0 : onExited(node);
|
11970 |
|
11971 |
|
11972 | esm_removeEventListener(window, 'resize', handleWindowResize);
|
11973 | };
|
11974 | const renderBackdrop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(backdropProps => (0,jsx_dev_runtime.jsxDEV)("div", {
|
11975 | ...backdropProps,
|
11976 | className: classnames_default()(`${bsPrefix}-backdrop`, backdropClassName, !animation && 'show')
|
11977 | }, void 0, false, {
|
11978 | fileName: Modal_jsxFileName,
|
11979 | lineNumber: 426,
|
11980 | columnNumber: 11
|
11981 | }, undefined), [animation, backdropClassName, bsPrefix]);
|
11982 | const baseModalStyle = {
|
11983 | ...style,
|
11984 | ...modalStyle
|
11985 | };
|
11986 |
|
11987 |
|
11988 |
|
11989 | baseModalStyle.display = 'block';
|
11990 | const renderDialog = dialogProps => (0,jsx_dev_runtime.jsxDEV)("div", {
|
11991 | role: "dialog",
|
11992 | ...dialogProps,
|
11993 | style: baseModalStyle,
|
11994 | className: classnames_default()(className, bsPrefix, animateStaticModal && `${bsPrefix}-static`, !animation && 'show'),
|
11995 | onClick: backdrop ? handleClick : undefined,
|
11996 | onMouseUp: handleMouseUp,
|
11997 | "aria-label": ariaLabel,
|
11998 | "aria-labelledby": ariaLabelledby,
|
11999 | "aria-describedby": ariaDescribedby,
|
12000 | children: (0,jsx_dev_runtime.jsxDEV)(Dialog, {
|
12001 | ...props,
|
12002 | onMouseDown: handleDialogMouseDown,
|
12003 | className: dialogClassName,
|
12004 | contentClassName: contentClassName,
|
12005 | children: children
|
12006 | }, void 0, false, {
|
12007 | fileName: Modal_jsxFileName,
|
12008 | lineNumber: 463,
|
12009 | columnNumber: 11
|
12010 | }, undefined)
|
12011 | }, void 0, false, {
|
12012 | fileName: Modal_jsxFileName,
|
12013 | lineNumber: 445,
|
12014 | columnNumber: 9
|
12015 | }, undefined);
|
12016 | return (0,jsx_dev_runtime.jsxDEV)(src_ModalContext.Provider, {
|
12017 | value: modalContext,
|
12018 | children: (0,jsx_dev_runtime.jsxDEV)(esm_Modal, {
|
12019 | show: show,
|
12020 | ref: mergedRef,
|
12021 | backdrop: backdrop,
|
12022 | container: container,
|
12023 | keyboard: true
|
12024 | ,
|
12025 | autoFocus: autoFocus,
|
12026 | enforceFocus: enforceFocus,
|
12027 | restoreFocus: restoreFocus,
|
12028 | restoreFocusOptions: restoreFocusOptions,
|
12029 | onEscapeKeyDown: handleEscapeKeyDown,
|
12030 | onShow: onShow,
|
12031 | onHide: onHide,
|
12032 | onEnter: handleEnter,
|
12033 | onEntering: handleEntering,
|
12034 | onEntered: onEntered,
|
12035 | onExit: handleExit,
|
12036 | onExiting: onExiting,
|
12037 | onExited: handleExited,
|
12038 | manager: getModalManager(),
|
12039 | transition: animation ? DialogTransition : undefined,
|
12040 | backdropTransition: animation ? BackdropTransition : undefined,
|
12041 | renderBackdrop: renderBackdrop,
|
12042 | renderDialog: renderDialog
|
12043 | }, void 0, false, {
|
12044 | fileName: Modal_jsxFileName,
|
12045 | lineNumber: 476,
|
12046 | columnNumber: 11
|
12047 | }, undefined)
|
12048 | }, void 0, false, {
|
12049 | fileName: Modal_jsxFileName,
|
12050 | lineNumber: 475,
|
12051 | columnNumber: 9
|
12052 | }, undefined);
|
12053 | });
|
12054 | Modal_Modal.displayName = 'Modal';
|
12055 | Modal_Modal.propTypes = Modal_propTypes;
|
12056 | const src_Modal = (Object.assign(Modal_Modal, {
|
12057 | Body: src_ModalBody,
|
12058 | Header: src_ModalHeader,
|
12059 | Title: src_ModalTitle,
|
12060 | Footer: src_ModalFooter,
|
12061 | Dialog: src_ModalDialog,
|
12062 | TRANSITION_DURATION: 300,
|
12063 | BACKDROP_TRANSITION_DURATION: 150
|
12064 | }));
|
12065 |
|
12066 | var lib_all = __webpack_require__(946);
|
12067 | var all_default = __webpack_require__.n(lib_all);
|
12068 | ;
|
12069 | var NavItem_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/NavItem.tsx";
|
12070 |
|
12071 |
|
12072 |
|
12073 |
|
12074 | const NavItem_NavItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12075 | className,
|
12076 | bsPrefix,
|
12077 | as: Component = 'div',
|
12078 | ...props
|
12079 | }, ref) => {
|
12080 | bsPrefix = useBootstrapPrefix(bsPrefix, 'nav-item');
|
12081 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
12082 | ref: ref,
|
12083 | className: classnames_default()(className, bsPrefix),
|
12084 | ...props
|
12085 | }, void 0, false, {
|
12086 | fileName: NavItem_jsxFileName,
|
12087 | lineNumber: 15,
|
12088 | columnNumber: 9
|
12089 | }, undefined);
|
12090 | });
|
12091 | NavItem_NavItem.displayName = 'NavItem';
|
12092 | const src_NavItem = (NavItem_NavItem);
|
12093 | ;
|
12094 | var NavLink_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/NavLink.tsx";
|
12095 |
|
12096 |
|
12097 |
|
12098 |
|
12099 |
|
12100 |
|
12101 |
|
12102 |
|
12103 | const NavLink_propTypes = {
|
12104 | |
12105 |
|
12106 |
|
12107 | bsPrefix: (prop_types_default()).string,
|
12108 | |
12109 |
|
12110 |
|
12111 | active: (prop_types_default()).bool,
|
12112 | |
12113 |
|
12114 |
|
12115 | disabled: (prop_types_default()).bool,
|
12116 | |
12117 |
|
12118 |
|
12119 |
|
12120 | role: (prop_types_default()).string,
|
12121 |
|
12122 | href: (prop_types_default()).string,
|
12123 | |
12124 |
|
12125 |
|
12126 |
|
12127 | eventKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
12128 |
|
12129 | as: (prop_types_default()).elementType
|
12130 | };
|
12131 | const NavLink = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12132 | bsPrefix,
|
12133 | className,
|
12134 | as: Component = esm_Anchor,
|
12135 | active,
|
12136 | eventKey,
|
12137 | disabled = false,
|
12138 | ...props
|
12139 | }, ref) => {
|
12140 | bsPrefix = useBootstrapPrefix(bsPrefix, 'nav-link');
|
12141 | const [navItemProps, meta] = useNavItem({
|
12142 | key: makeEventKey(eventKey, props.href),
|
12143 | active,
|
12144 | disabled,
|
12145 | ...props
|
12146 | });
|
12147 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
12148 | ...props,
|
12149 | ...navItemProps,
|
12150 | ref: ref,
|
12151 | disabled: disabled,
|
12152 | className: classnames_default()(className, bsPrefix, disabled && 'disabled', meta.isActive && 'active')
|
12153 | }, void 0, false, {
|
12154 | fileName: NavLink_jsxFileName,
|
12155 | lineNumber: 76,
|
12156 | columnNumber: 9
|
12157 | }, undefined);
|
12158 | });
|
12159 | NavLink.displayName = 'NavLink';
|
12160 | NavLink.propTypes = NavLink_propTypes;
|
12161 | const src_NavLink = (NavLink);
|
12162 | ;
|
12163 | var Nav_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Nav.tsx";
|
12164 |
|
12165 |
|
12166 |
|
12167 |
|
12168 |
|
12169 |
|
12170 |
|
12171 |
|
12172 |
|
12173 |
|
12174 |
|
12175 |
|
12176 |
|
12177 | const Nav_propTypes = {
|
12178 | |
12179 |
|
12180 |
|
12181 | bsPrefix: (prop_types_default()).string,
|
12182 |
|
12183 | navbarBsPrefix: (prop_types_default()).string,
|
12184 |
|
12185 | cardHeaderBsPrefix: (prop_types_default()).string,
|
12186 | |
12187 |
|
12188 |
|
12189 |
|
12190 |
|
12191 | variant: (prop_types_default()).string,
|
12192 | |
12193 |
|
12194 |
|
12195 | activeKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
12196 | |
12197 |
|
12198 |
|
12199 | defaultActiveKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
12200 | |
12201 |
|
12202 |
|
12203 | fill: (prop_types_default()).bool,
|
12204 | |
12205 |
|
12206 |
|
12207 |
|
12208 |
|
12209 | justify: all_default()((prop_types_default()).bool, ({
|
12210 | justify,
|
12211 | navbar
|
12212 | }) => justify && navbar ? Error('justify navbar `Nav`s are not supported') : null),
|
12213 | |
12214 |
|
12215 |
|
12216 |
|
12217 |
|
12218 |
|
12219 |
|
12220 |
|
12221 |
|
12222 |
|
12223 | onSelect: (prop_types_default()).func,
|
12224 | |
12225 |
|
12226 |
|
12227 |
|
12228 |
|
12229 |
|
12230 |
|
12231 |
|
12232 | role: (prop_types_default()).string,
|
12233 | |
12234 |
|
12235 |
|
12236 |
|
12237 | navbar: (prop_types_default()).bool,
|
12238 | |
12239 |
|
12240 |
|
12241 | navbarScroll: (prop_types_default()).bool,
|
12242 | as: (prop_types_default()).elementType,
|
12243 |
|
12244 | onKeyDown: (prop_types_default()).func
|
12245 | };
|
12246 | const Nav_Nav = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((uncontrolledProps, ref) => {
|
12247 | const {
|
12248 | as = 'div',
|
12249 | bsPrefix: initialBsPrefix,
|
12250 | variant,
|
12251 | fill = false,
|
12252 | justify = false,
|
12253 | navbar,
|
12254 | navbarScroll,
|
12255 | className,
|
12256 | activeKey,
|
12257 | ...props
|
12258 | } = useUncontrolled(uncontrolledProps, {
|
12259 | activeKey: 'onSelect'
|
12260 | });
|
12261 | const bsPrefix = useBootstrapPrefix(initialBsPrefix, 'nav');
|
12262 | let navbarBsPrefix;
|
12263 | let cardHeaderBsPrefix;
|
12264 | let isNavbar = false;
|
12265 | const navbarContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(NavbarContext);
|
12266 | const cardHeaderContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(CardHeaderContext);
|
12267 | if (navbarContext) {
|
12268 | navbarBsPrefix = navbarContext.bsPrefix;
|
12269 | isNavbar = navbar == null ? true : navbar;
|
12270 | } else if (cardHeaderContext) {
|
12271 | ({
|
12272 | cardHeaderBsPrefix
|
12273 | } = cardHeaderContext);
|
12274 | }
|
12275 | return (0,jsx_dev_runtime.jsxDEV)(esm_Nav, {
|
12276 | as: as,
|
12277 | ref: ref,
|
12278 | activeKey: activeKey,
|
12279 | className: classnames_default()(className, {
|
12280 | [bsPrefix]: !isNavbar,
|
12281 | [`${navbarBsPrefix}-nav`]: isNavbar,
|
12282 | [`${navbarBsPrefix}-nav-scroll`]: isNavbar && navbarScroll,
|
12283 | [`${cardHeaderBsPrefix}-${variant}`]: !!cardHeaderBsPrefix,
|
12284 | [`${bsPrefix}-${variant}`]: !!variant,
|
12285 | [`${bsPrefix}-fill`]: fill,
|
12286 | [`${bsPrefix}-justified`]: justify
|
12287 | }),
|
12288 | ...props
|
12289 | }, void 0, false, {
|
12290 | fileName: Nav_jsxFileName,
|
12291 | lineNumber: 143,
|
12292 | columnNumber: 5
|
12293 | }, undefined);
|
12294 | });
|
12295 | Nav_Nav.displayName = 'Nav';
|
12296 | Nav_Nav.propTypes = Nav_propTypes;
|
12297 | const src_Nav = (Object.assign(Nav_Nav, {
|
12298 | Item: src_NavItem,
|
12299 | Link: src_NavLink
|
12300 | }));
|
12301 | ;
|
12302 | var NavbarBrand_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/NavbarBrand.tsx";
|
12303 |
|
12304 |
|
12305 |
|
12306 |
|
12307 |
|
12308 | const NavbarBrand_propTypes = {
|
12309 |
|
12310 | bsPrefix: (prop_types_default()).string,
|
12311 | |
12312 |
|
12313 |
|
12314 | href: (prop_types_default()).string,
|
12315 | |
12316 |
|
12317 |
|
12318 | as: (prop_types_default()).elementType
|
12319 | };
|
12320 | const NavbarBrand = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12321 | bsPrefix,
|
12322 | className,
|
12323 | as,
|
12324 | ...props
|
12325 | }, ref) => {
|
12326 | bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-brand');
|
12327 | const Component = as || (props.href ? 'a' : 'span');
|
12328 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
12329 | ...props,
|
12330 | ref: ref,
|
12331 | className: classnames_default()(className, bsPrefix)
|
12332 | }, void 0, false, {
|
12333 | fileName: NavbarBrand_jsxFileName,
|
12334 | lineNumber: 37,
|
12335 | columnNumber: 9
|
12336 | }, undefined);
|
12337 | });
|
12338 | NavbarBrand.displayName = 'NavbarBrand';
|
12339 | NavbarBrand.propTypes = NavbarBrand_propTypes;
|
12340 | const src_NavbarBrand = (NavbarBrand);
|
12341 | ;
|
12342 | var NavbarCollapse_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/NavbarCollapse.tsx";
|
12343 |
|
12344 |
|
12345 |
|
12346 |
|
12347 |
|
12348 |
|
12349 |
|
12350 | const NavbarCollapse_propTypes = {
|
12351 |
|
12352 | bsPrefix: (prop_types_default()).string
|
12353 | };
|
12354 | const NavbarCollapse = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12355 | children,
|
12356 | bsPrefix,
|
12357 | ...props
|
12358 | }, ref) => {
|
12359 | bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-collapse');
|
12360 | const context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(NavbarContext);
|
12361 | return (0,jsx_dev_runtime.jsxDEV)(src_Collapse, {
|
12362 | in: !!(context && context.expanded),
|
12363 | ...props,
|
12364 | children: (0,jsx_dev_runtime.jsxDEV)("div", {
|
12365 | ref: ref,
|
12366 | className: bsPrefix,
|
12367 | children: children
|
12368 | }, void 0, false, {
|
12369 | fileName: NavbarCollapse_jsxFileName,
|
12370 | lineNumber: 27,
|
12371 | columnNumber: 9
|
12372 | }, undefined)
|
12373 | }, void 0, false, {
|
12374 | fileName: NavbarCollapse_jsxFileName,
|
12375 | lineNumber: 26,
|
12376 | columnNumber: 7
|
12377 | }, undefined);
|
12378 | });
|
12379 | NavbarCollapse.displayName = 'NavbarCollapse';
|
12380 | NavbarCollapse.propTypes = NavbarCollapse_propTypes;
|
12381 | const src_NavbarCollapse = (NavbarCollapse);
|
12382 | ;
|
12383 | var NavbarToggle_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/NavbarToggle.tsx";
|
12384 |
|
12385 |
|
12386 |
|
12387 |
|
12388 |
|
12389 |
|
12390 |
|
12391 |
|
12392 | const NavbarToggle_propTypes = {
|
12393 |
|
12394 | bsPrefix: (prop_types_default()).string,
|
12395 |
|
12396 | label: (prop_types_default()).string,
|
12397 |
|
12398 | onClick: (prop_types_default()).func,
|
12399 | |
12400 |
|
12401 |
|
12402 | children: (prop_types_default()).node,
|
12403 | as: (prop_types_default()).elementType
|
12404 | };
|
12405 | const NavbarToggle = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12406 | bsPrefix,
|
12407 | className,
|
12408 | children,
|
12409 | label = 'Toggle navigation',
|
12410 |
|
12411 | as: Component = 'button',
|
12412 | onClick,
|
12413 | ...props
|
12414 | }, ref) => {
|
12415 | bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-toggler');
|
12416 | const {
|
12417 | onToggle,
|
12418 | expanded
|
12419 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(NavbarContext) || {};
|
12420 | const handleClick = useEventCallback(e => {
|
12421 | if (onClick) onClick(e);
|
12422 | if (onToggle) onToggle();
|
12423 | });
|
12424 | if (Component === 'button') {
|
12425 | props.type = 'button';
|
12426 | }
|
12427 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
12428 | ...props,
|
12429 | ref: ref,
|
12430 | onClick: handleClick,
|
12431 | "aria-label": label,
|
12432 | className: classnames_default()(className, bsPrefix, !expanded && 'collapsed'),
|
12433 | children: children || (0,jsx_dev_runtime.jsxDEV)("span", {
|
12434 | className: `${bsPrefix}-icon`
|
12435 | }, void 0, false, {
|
12436 | fileName: NavbarToggle_jsxFileName,
|
12437 | lineNumber: 73,
|
12438 | columnNumber: 22
|
12439 | }, undefined)
|
12440 | }, void 0, false, {
|
12441 | fileName: NavbarToggle_jsxFileName,
|
12442 | lineNumber: 66,
|
12443 | columnNumber: 7
|
12444 | }, undefined);
|
12445 | });
|
12446 | NavbarToggle.displayName = 'NavbarToggle';
|
12447 | NavbarToggle.propTypes = NavbarToggle_propTypes;
|
12448 | const src_NavbarToggle = (NavbarToggle);
|
12449 | ;
|
12450 |
|
12451 |
|
12452 | var matchersByWindow = new WeakMap();
|
12453 | var getMatcher = function getMatcher(query, targetWindow) {
|
12454 | if (!query || !targetWindow) return undefined;
|
12455 | var matchers = matchersByWindow.get(targetWindow) || new Map();
|
12456 | matchersByWindow.set(targetWindow, matchers);
|
12457 | var mql = matchers.get(query);
|
12458 | if (!mql) {
|
12459 | mql = targetWindow.matchMedia(query);
|
12460 | mql.refCount = 0;
|
12461 | matchers.set(mql.media, mql);
|
12462 | }
|
12463 | return mql;
|
12464 | };
|
12465 |
|
12466 |
|
12467 |
|
12468 |
|
12469 |
|
12470 |
|
12471 |
|
12472 |
|
12473 |
|
12474 |
|
12475 |
|
12476 |
|
12477 |
|
12478 |
|
12479 |
|
12480 |
|
12481 |
|
12482 |
|
12483 |
|
12484 |
|
12485 | function useMediaQuery(query, targetWindow) {
|
12486 | if (targetWindow === void 0) {
|
12487 | targetWindow = typeof window === 'undefined' ? undefined : window;
|
12488 | }
|
12489 | var mql = getMatcher(query, targetWindow);
|
12490 | var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(function () {
|
12491 | return mql ? mql.matches : false;
|
12492 | }),
|
12493 | matches = _useState[0],
|
12494 | setMatches = _useState[1];
|
12495 | useIsomorphicEffect(function () {
|
12496 | var mql = getMatcher(query, targetWindow);
|
12497 | if (!mql) {
|
12498 | return setMatches(false);
|
12499 | }
|
12500 | var matchers = matchersByWindow.get(targetWindow);
|
12501 | var handleChange = function handleChange() {
|
12502 | setMatches(mql.matches);
|
12503 | };
|
12504 | mql.refCount++;
|
12505 | mql.addListener(handleChange);
|
12506 | handleChange();
|
12507 | return function () {
|
12508 | mql.removeListener(handleChange);
|
12509 | mql.refCount--;
|
12510 | if (mql.refCount <= 0) {
|
12511 | matchers == null ? void 0 : matchers.delete(mql.media);
|
12512 | }
|
12513 | mql = undefined;
|
12514 | };
|
12515 | }, [query]);
|
12516 | return matches;
|
12517 | }
|
12518 | ;
|
12519 |
|
12520 |
|
12521 |
|
12522 |
|
12523 |
|
12524 |
|
12525 |
|
12526 |
|
12527 |
|
12528 |
|
12529 |
|
12530 |
|
12531 |
|
12532 |
|
12533 |
|
12534 |
|
12535 |
|
12536 |
|
12537 |
|
12538 |
|
12539 |
|
12540 |
|
12541 |
|
12542 |
|
12543 |
|
12544 | function createBreakpointHook(breakpointValues) {
|
12545 | var names = Object.keys(breakpointValues);
|
12546 | function and(query, next) {
|
12547 | if (query === next) {
|
12548 | return next;
|
12549 | }
|
12550 | return query ? query + " and " + next : next;
|
12551 | }
|
12552 | function getNext(breakpoint) {
|
12553 | return names[Math.min(names.indexOf(breakpoint) + 1, names.length - 1)];
|
12554 | }
|
12555 | function getMaxQuery(breakpoint) {
|
12556 | var next = getNext(breakpoint);
|
12557 | var value = breakpointValues[next];
|
12558 | if (typeof value === 'number') value = value - 0.2 + "px";else value = "calc(" + value + " - 0.2px)";
|
12559 | return "(max-width: " + value + ")";
|
12560 | }
|
12561 | function getMinQuery(breakpoint) {
|
12562 | var value = breakpointValues[breakpoint];
|
12563 | if (typeof value === 'number') {
|
12564 | value = value + "px";
|
12565 | }
|
12566 | return "(min-width: " + value + ")";
|
12567 | }
|
12568 | |
12569 |
|
12570 |
|
12571 |
|
12572 |
|
12573 |
|
12574 |
|
12575 |
|
12576 |
|
12577 |
|
12578 |
|
12579 |
|
12580 |
|
12581 |
|
12582 |
|
12583 |
|
12584 | function useBreakpoint(breakpointOrMap, direction, window) {
|
12585 | var breakpointMap;
|
12586 | if (typeof breakpointOrMap === 'object') {
|
12587 | breakpointMap = breakpointOrMap;
|
12588 | window = direction;
|
12589 | direction = true;
|
12590 | } else {
|
12591 | var _breakpointMap;
|
12592 | direction = direction || true;
|
12593 | breakpointMap = (_breakpointMap = {}, _breakpointMap[breakpointOrMap] = direction, _breakpointMap);
|
12594 | }
|
12595 | var query = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
12596 | return Object.entries(breakpointMap).reduce(function (query, _ref) {
|
12597 | var key = _ref[0],
|
12598 | direction = _ref[1];
|
12599 | if (direction === 'up' || direction === true) {
|
12600 | query = and(query, getMinQuery(key));
|
12601 | }
|
12602 | if (direction === 'down' || direction === true) {
|
12603 | query = and(query, getMaxQuery(key));
|
12604 | }
|
12605 | return query;
|
12606 | }, '');
|
12607 | }, [JSON.stringify(breakpointMap)]);
|
12608 | return useMediaQuery(query, window);
|
12609 | }
|
12610 | return useBreakpoint;
|
12611 | }
|
12612 | var useBreakpoint = createBreakpointHook({
|
12613 | xs: 0,
|
12614 | sm: 576,
|
12615 | md: 768,
|
12616 | lg: 992,
|
12617 | xl: 1200,
|
12618 | xxl: 1400
|
12619 | });
|
12620 | const esm_useBreakpoint = (useBreakpoint);
|
12621 | ;
|
12622 | var OffcanvasBody_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/OffcanvasBody.tsx";
|
12623 |
|
12624 |
|
12625 |
|
12626 |
|
12627 | const OffcanvasBody = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12628 | className,
|
12629 | bsPrefix,
|
12630 | as: Component = 'div',
|
12631 | ...props
|
12632 | }, ref) => {
|
12633 | bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas-body');
|
12634 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
12635 | ref: ref,
|
12636 | className: classnames_default()(className, bsPrefix),
|
12637 | ...props
|
12638 | }, void 0, false, {
|
12639 | fileName: OffcanvasBody_jsxFileName,
|
12640 | lineNumber: 15,
|
12641 | columnNumber: 9
|
12642 | }, undefined);
|
12643 | });
|
12644 | OffcanvasBody.displayName = 'OffcanvasBody';
|
12645 | const src_OffcanvasBody = (OffcanvasBody);
|
12646 | ;
|
12647 | var OffcanvasToggling_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/OffcanvasToggling.tsx";
|
12648 |
|
12649 |
|
12650 |
|
12651 |
|
12652 |
|
12653 |
|
12654 |
|
12655 |
|
12656 | const OffcanvasToggling_propTypes = {
|
12657 | |
12658 |
|
12659 |
|
12660 | in: (prop_types_default()).bool,
|
12661 | |
12662 |
|
12663 |
|
12664 | mountOnEnter: (prop_types_default()).bool,
|
12665 | |
12666 |
|
12667 |
|
12668 | unmountOnExit: (prop_types_default()).bool,
|
12669 | |
12670 |
|
12671 |
|
12672 |
|
12673 | appear: (prop_types_default()).bool,
|
12674 | |
12675 |
|
12676 |
|
12677 |
|
12678 |
|
12679 | timeout: (prop_types_default()).number,
|
12680 | |
12681 |
|
12682 |
|
12683 | onEnter: (prop_types_default()).func,
|
12684 | |
12685 |
|
12686 |
|
12687 | onEntering: (prop_types_default()).func,
|
12688 | |
12689 |
|
12690 |
|
12691 | onEntered: (prop_types_default()).func,
|
12692 | |
12693 |
|
12694 |
|
12695 | onExit: (prop_types_default()).func,
|
12696 | |
12697 |
|
12698 |
|
12699 | onExiting: (prop_types_default()).func,
|
12700 | |
12701 |
|
12702 |
|
12703 | onExited: (prop_types_default()).func
|
12704 | };
|
12705 | const transitionStyles = {
|
12706 | [ENTERING]: 'show',
|
12707 | [ENTERED]: 'show'
|
12708 | };
|
12709 | const OffcanvasToggling = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12710 | bsPrefix,
|
12711 | className,
|
12712 | children,
|
12713 | in: inProp = false,
|
12714 | mountOnEnter = false,
|
12715 | unmountOnExit = false,
|
12716 | appear = false,
|
12717 | ...props
|
12718 | }, ref) => {
|
12719 | bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas');
|
12720 | return (0,jsx_dev_runtime.jsxDEV)(src_TransitionWrapper, {
|
12721 | ref: ref,
|
12722 | addEndListener: transitionEndListener,
|
12723 | in: inProp,
|
12724 | mountOnEnter: mountOnEnter,
|
12725 | unmountOnExit: unmountOnExit,
|
12726 | appear: appear,
|
12727 | ...props,
|
12728 | childRef: children.ref,
|
12729 | children: (status, innerProps) => external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(children, {
|
12730 | ...innerProps,
|
12731 | className: classnames_default()(className, children.props.className, (status === ENTERING || status === EXITING) && `${bsPrefix}-toggling`, transitionStyles[status])
|
12732 | })
|
12733 | }, void 0, false, {
|
12734 | fileName: OffcanvasToggling_jsxFileName,
|
12735 | lineNumber: 108,
|
12736 | columnNumber: 7
|
12737 | }, undefined);
|
12738 | });
|
12739 | OffcanvasToggling.propTypes = OffcanvasToggling_propTypes;
|
12740 | OffcanvasToggling.displayName = 'OffcanvasToggling';
|
12741 | const src_OffcanvasToggling = (OffcanvasToggling);
|
12742 | ;
|
12743 | var OffcanvasHeader_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/OffcanvasHeader.tsx";
|
12744 |
|
12745 |
|
12746 |
|
12747 |
|
12748 |
|
12749 |
|
12750 | const OffcanvasHeader_propTypes = {
|
12751 | |
12752 |
|
12753 |
|
12754 | bsPrefix: (prop_types_default()).string,
|
12755 | |
12756 |
|
12757 |
|
12758 |
|
12759 |
|
12760 | closeLabel: (prop_types_default()).string,
|
12761 | |
12762 |
|
12763 |
|
12764 | closeVariant: prop_types_default().oneOf(['white']),
|
12765 | |
12766 |
|
12767 |
|
12768 | closeButton: (prop_types_default()).bool,
|
12769 | |
12770 |
|
12771 |
|
12772 |
|
12773 |
|
12774 | onHide: (prop_types_default()).func
|
12775 | };
|
12776 | const OffcanvasHeader = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12777 | bsPrefix,
|
12778 | className,
|
12779 | closeLabel = 'Close',
|
12780 | closeButton = false,
|
12781 | ...props
|
12782 | }, ref) => {
|
12783 | bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas-header');
|
12784 | return (0,jsx_dev_runtime.jsxDEV)(src_AbstractModalHeader, {
|
12785 | ref: ref,
|
12786 | ...props,
|
12787 | className: classnames_default()(className, bsPrefix),
|
12788 | closeLabel: closeLabel,
|
12789 | closeButton: closeButton
|
12790 | }, void 0, false, {
|
12791 | fileName: OffcanvasHeader_jsxFileName,
|
12792 | lineNumber: 59,
|
12793 | columnNumber: 7
|
12794 | }, undefined);
|
12795 | });
|
12796 | OffcanvasHeader.displayName = 'OffcanvasHeader';
|
12797 | OffcanvasHeader.propTypes = OffcanvasHeader_propTypes;
|
12798 | const src_OffcanvasHeader = (OffcanvasHeader);
|
12799 | ;
|
12800 | var OffcanvasTitle_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/OffcanvasTitle.tsx";
|
12801 |
|
12802 |
|
12803 |
|
12804 |
|
12805 |
|
12806 | const OffcanvasTitle_DivStyledAsH5 = divWithClassName('h5');
|
12807 | const OffcanvasTitle = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12808 | className,
|
12809 | bsPrefix,
|
12810 | as: Component = OffcanvasTitle_DivStyledAsH5,
|
12811 | ...props
|
12812 | }, ref) => {
|
12813 | bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas-title');
|
12814 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
12815 | ref: ref,
|
12816 | className: classnames_default()(className, bsPrefix),
|
12817 | ...props
|
12818 | }, void 0, false, {
|
12819 | fileName: OffcanvasTitle_jsxFileName,
|
12820 | lineNumber: 20,
|
12821 | columnNumber: 7
|
12822 | }, undefined);
|
12823 | });
|
12824 | OffcanvasTitle.displayName = 'OffcanvasTitle';
|
12825 | const src_OffcanvasTitle = (OffcanvasTitle);
|
12826 | ;
|
12827 | var Offcanvas_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Offcanvas.tsx";
|
12828 |
|
12829 |
|
12830 |
|
12831 |
|
12832 |
|
12833 |
|
12834 |
|
12835 |
|
12836 |
|
12837 |
|
12838 |
|
12839 |
|
12840 |
|
12841 |
|
12842 |
|
12843 |
|
12844 |
|
12845 |
|
12846 | const Offcanvas_propTypes = {
|
12847 | |
12848 |
|
12849 |
|
12850 | bsPrefix: (prop_types_default()).string,
|
12851 | |
12852 |
|
12853 |
|
12854 |
|
12855 | backdrop: prop_types_default().oneOf(['static', true, false]),
|
12856 | |
12857 |
|
12858 |
|
12859 | backdropClassName: (prop_types_default()).string,
|
12860 | |
12861 |
|
12862 |
|
12863 | keyboard: (prop_types_default()).bool,
|
12864 | |
12865 |
|
12866 |
|
12867 | scroll: (prop_types_default()).bool,
|
12868 | |
12869 |
|
12870 |
|
12871 | placement: prop_types_default().oneOf(['start', 'end', 'top', 'bottom']),
|
12872 | |
12873 |
|
12874 |
|
12875 |
|
12876 | responsive: (prop_types_default()).string,
|
12877 | |
12878 |
|
12879 |
|
12880 |
|
12881 |
|
12882 |
|
12883 | autoFocus: (prop_types_default()).bool,
|
12884 | |
12885 |
|
12886 |
|
12887 |
|
12888 |
|
12889 | enforceFocus: (prop_types_default()).bool,
|
12890 | |
12891 |
|
12892 |
|
12893 |
|
12894 | restoreFocus: (prop_types_default()).bool,
|
12895 | |
12896 |
|
12897 |
|
12898 |
|
12899 |
|
12900 | restoreFocusOptions: prop_types_default().shape({
|
12901 | preventScroll: (prop_types_default()).bool
|
12902 | }),
|
12903 | |
12904 |
|
12905 |
|
12906 | show: (prop_types_default()).bool,
|
12907 | |
12908 |
|
12909 |
|
12910 | onShow: (prop_types_default()).func,
|
12911 | |
12912 |
|
12913 |
|
12914 |
|
12915 | onHide: (prop_types_default()).func,
|
12916 | |
12917 |
|
12918 |
|
12919 | onEscapeKeyDown: (prop_types_default()).func,
|
12920 | |
12921 |
|
12922 |
|
12923 | onEnter: (prop_types_default()).func,
|
12924 | |
12925 |
|
12926 |
|
12927 | onEntering: (prop_types_default()).func,
|
12928 | |
12929 |
|
12930 |
|
12931 | onEntered: (prop_types_default()).func,
|
12932 | |
12933 |
|
12934 |
|
12935 | onExit: (prop_types_default()).func,
|
12936 | |
12937 |
|
12938 |
|
12939 | onExiting: (prop_types_default()).func,
|
12940 | |
12941 |
|
12942 |
|
12943 | onExited: (prop_types_default()).func,
|
12944 | |
12945 |
|
12946 |
|
12947 | container: (prop_types_default()).any,
|
12948 | |
12949 |
|
12950 |
|
12951 |
|
12952 |
|
12953 | renderStaticNode: (prop_types_default()).bool,
|
12954 | 'aria-labelledby': (prop_types_default()).string
|
12955 | };
|
12956 | function Offcanvas_DialogTransition(props) {
|
12957 | return (0,jsx_dev_runtime.jsxDEV)(src_OffcanvasToggling, {
|
12958 | ...props
|
12959 | }, void 0, false, {
|
12960 | fileName: Offcanvas_jsxFileName,
|
12961 | lineNumber: 191,
|
12962 | columnNumber: 10
|
12963 | }, this);
|
12964 | }
|
12965 | function Offcanvas_BackdropTransition(props) {
|
12966 | return (0,jsx_dev_runtime.jsxDEV)(src_Fade, {
|
12967 | ...props
|
12968 | }, void 0, false, {
|
12969 | fileName: Offcanvas_jsxFileName,
|
12970 | lineNumber: 195,
|
12971 | columnNumber: 10
|
12972 | }, this);
|
12973 | }
|
12974 | const Offcanvas = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
12975 | bsPrefix,
|
12976 | className,
|
12977 | children,
|
12978 | 'aria-labelledby': ariaLabelledby,
|
12979 | placement = 'start',
|
12980 | responsive,
|
12981 |
|
12982 |
|
12983 | show = false,
|
12984 | backdrop = true,
|
12985 | keyboard = true,
|
12986 | scroll = false,
|
12987 | onEscapeKeyDown,
|
12988 | onShow,
|
12989 | onHide,
|
12990 | container,
|
12991 | autoFocus = true,
|
12992 | enforceFocus = true,
|
12993 | restoreFocus = true,
|
12994 | restoreFocusOptions,
|
12995 | onEntered,
|
12996 | onExit,
|
12997 | onExiting,
|
12998 | onEnter,
|
12999 | onEntering,
|
13000 | onExited,
|
13001 | backdropClassName,
|
13002 | manager: propsManager,
|
13003 | renderStaticNode = false,
|
13004 | ...props
|
13005 | }, ref) => {
|
13006 | const modalManager = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
13007 | bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas');
|
13008 | const {
|
13009 | onToggle
|
13010 | } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(NavbarContext) || {};
|
13011 | const [showOffcanvas, setShowOffcanvas] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
13012 | const hideResponsiveOffcanvas = esm_useBreakpoint(responsive || 'xs', 'up');
|
13013 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
13014 |
|
13015 |
|
13016 | setShowOffcanvas(responsive ? show && !hideResponsiveOffcanvas : show);
|
13017 | }, [show, responsive, hideResponsiveOffcanvas]);
|
13018 | const handleHide = useEventCallback(() => {
|
13019 | onToggle == null ? void 0 : onToggle();
|
13020 | onHide == null ? void 0 : onHide();
|
13021 | });
|
13022 | const modalContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
13023 | onHide: handleHide
|
13024 | }), [handleHide]);
|
13025 | function getModalManager() {
|
13026 | if (propsManager) return propsManager;
|
13027 | if (scroll) {
|
13028 |
|
13029 |
|
13030 | if (!modalManager.current) modalManager.current = new src_BootstrapModalManager({
|
13031 | handleContainerOverflow: false
|
13032 | });
|
13033 | return modalManager.current;
|
13034 | }
|
13035 | return getSharedManager();
|
13036 | }
|
13037 | const handleEnter = (node, ...args) => {
|
13038 | if (node) node.style.visibility = 'visible';
|
13039 | onEnter == null ? void 0 : onEnter(node, ...args);
|
13040 | };
|
13041 | const handleExited = (node, ...args) => {
|
13042 | if (node) node.style.visibility = '';
|
13043 | onExited == null ? void 0 : onExited(...args);
|
13044 | };
|
13045 | const renderBackdrop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(backdropProps => (0,jsx_dev_runtime.jsxDEV)("div", {
|
13046 | ...backdropProps,
|
13047 | className: classnames_default()(`${bsPrefix}-backdrop`, backdropClassName)
|
13048 | }, void 0, false, {
|
13049 | fileName: Offcanvas_jsxFileName,
|
13050 | lineNumber: 291,
|
13051 | columnNumber: 11
|
13052 | }, undefined), [backdropClassName, bsPrefix]);
|
13053 | const renderDialog = dialogProps => (0,jsx_dev_runtime.jsxDEV)("div", {
|
13054 | ...dialogProps,
|
13055 | ...props,
|
13056 | className: classnames_default()(className, responsive ? `${bsPrefix}-${responsive}` : bsPrefix, `${bsPrefix}-${placement}`),
|
13057 | "aria-labelledby": ariaLabelledby,
|
13058 | children: children
|
13059 | }, void 0, false, {
|
13060 | fileName: Offcanvas_jsxFileName,
|
13061 | lineNumber: 300,
|
13062 | columnNumber: 9
|
13063 | }, undefined);
|
13064 | return (0,jsx_dev_runtime.jsxDEV)(jsx_dev_runtime.Fragment, {
|
13065 | children: [!showOffcanvas && (responsive || renderStaticNode) && renderDialog({}), (0,jsx_dev_runtime.jsxDEV)(src_ModalContext.Provider, {
|
13066 | value: modalContext,
|
13067 | children: (0,jsx_dev_runtime.jsxDEV)(esm_Modal, {
|
13068 | show: showOffcanvas,
|
13069 | ref: ref,
|
13070 | backdrop: backdrop,
|
13071 | container: container,
|
13072 | keyboard: keyboard,
|
13073 | autoFocus: autoFocus,
|
13074 | enforceFocus: enforceFocus && !scroll,
|
13075 | restoreFocus: restoreFocus,
|
13076 | restoreFocusOptions: restoreFocusOptions,
|
13077 | onEscapeKeyDown: onEscapeKeyDown,
|
13078 | onShow: onShow,
|
13079 | onHide: handleHide,
|
13080 | onEnter: handleEnter,
|
13081 | onEntering: onEntering,
|
13082 | onEntered: onEntered,
|
13083 | onExit: onExit,
|
13084 | onExiting: onExiting,
|
13085 | onExited: handleExited,
|
13086 | manager: getModalManager(),
|
13087 | transition: Offcanvas_DialogTransition,
|
13088 | backdropTransition: Offcanvas_BackdropTransition,
|
13089 | renderBackdrop: renderBackdrop,
|
13090 | renderDialog: renderDialog
|
13091 | }, void 0, false, {
|
13092 | fileName: Offcanvas_jsxFileName,
|
13093 | lineNumber: 328,
|
13094 | columnNumber: 13
|
13095 | }, undefined)
|
13096 | }, void 0, false, {
|
13097 | fileName: Offcanvas_jsxFileName,
|
13098 | lineNumber: 327,
|
13099 | columnNumber: 11
|
13100 | }, undefined)]
|
13101 | }, void 0, true);
|
13102 | });
|
13103 | Offcanvas.displayName = 'Offcanvas';
|
13104 | Offcanvas.propTypes = Offcanvas_propTypes;
|
13105 | const src_Offcanvas = (Object.assign(Offcanvas, {
|
13106 | Body: src_OffcanvasBody,
|
13107 | Header: src_OffcanvasHeader,
|
13108 | Title: src_OffcanvasTitle
|
13109 | }));
|
13110 | ;
|
13111 | var NavbarOffcanvas_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/NavbarOffcanvas.tsx";
|
13112 |
|
13113 |
|
13114 |
|
13115 |
|
13116 |
|
13117 | const NavbarOffcanvas = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
|
13118 | const context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(NavbarContext);
|
13119 | return (0,jsx_dev_runtime.jsxDEV)(src_Offcanvas, {
|
13120 | ref: ref,
|
13121 | show: !!(context != null && context.expanded),
|
13122 | ...props,
|
13123 | renderStaticNode: true
|
13124 | }, void 0, false, {
|
13125 | fileName: NavbarOffcanvas_jsxFileName,
|
13126 | lineNumber: 13,
|
13127 | columnNumber: 7
|
13128 | }, undefined);
|
13129 | });
|
13130 | NavbarOffcanvas.displayName = 'NavbarOffcanvas';
|
13131 | const src_NavbarOffcanvas = (NavbarOffcanvas);
|
13132 | ;
|
13133 | var NavbarText_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/NavbarText.tsx";
|
13134 |
|
13135 |
|
13136 |
|
13137 |
|
13138 | const NavbarText = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
13139 | className,
|
13140 | bsPrefix,
|
13141 | as: Component = 'span',
|
13142 | ...props
|
13143 | }, ref) => {
|
13144 | bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-text');
|
13145 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
13146 | ref: ref,
|
13147 | className: classnames_default()(className, bsPrefix),
|
13148 | ...props
|
13149 | }, void 0, false, {
|
13150 | fileName: NavbarText_jsxFileName,
|
13151 | lineNumber: 15,
|
13152 | columnNumber: 9
|
13153 | }, undefined);
|
13154 | });
|
13155 | NavbarText.displayName = 'NavbarText';
|
13156 | const src_NavbarText = (NavbarText);
|
13157 | ;
|
13158 | var Navbar_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Navbar.tsx";
|
13159 |
|
13160 |
|
13161 |
|
13162 |
|
13163 |
|
13164 |
|
13165 |
|
13166 |
|
13167 |
|
13168 |
|
13169 |
|
13170 |
|
13171 |
|
13172 |
|
13173 | const Navbar_propTypes = {
|
13174 |
|
13175 | bsPrefix: (prop_types_default()).string,
|
13176 | |
13177 |
|
13178 |
|
13179 |
|
13180 |
|
13181 |
|
13182 |
|
13183 | variant: (prop_types_default()).string,
|
13184 | |
13185 |
|
13186 |
|
13187 |
|
13188 | expand: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).string]),
|
13189 | |
13190 |
|
13191 |
|
13192 |
|
13193 |
|
13194 |
|
13195 | bg: (prop_types_default()).string,
|
13196 | |
13197 |
|
13198 |
|
13199 |
|
13200 | fixed: prop_types_default().oneOf(['top', 'bottom']),
|
13201 | |
13202 |
|
13203 |
|
13204 |
|
13205 |
|
13206 |
|
13207 | sticky: prop_types_default().oneOf(['top']),
|
13208 | |
13209 |
|
13210 |
|
13211 | as: (prop_types_default()).elementType,
|
13212 | |
13213 |
|
13214 |
|
13215 |
|
13216 |
|
13217 |
|
13218 |
|
13219 | onToggle: (prop_types_default()).func,
|
13220 | |
13221 |
|
13222 |
|
13223 |
|
13224 |
|
13225 |
|
13226 |
|
13227 |
|
13228 |
|
13229 |
|
13230 |
|
13231 |
|
13232 |
|
13233 |
|
13234 |
|
13235 |
|
13236 |
|
13237 |
|
13238 |
|
13239 |
|
13240 |
|
13241 | onSelect: (prop_types_default()).func,
|
13242 | |
13243 |
|
13244 |
|
13245 |
|
13246 |
|
13247 |
|
13248 |
|
13249 |
|
13250 | collapseOnSelect: (prop_types_default()).bool,
|
13251 | |
13252 |
|
13253 |
|
13254 |
|
13255 |
|
13256 | expanded: (prop_types_default()).bool,
|
13257 | |
13258 |
|
13259 |
|
13260 |
|
13261 |
|
13262 |
|
13263 | role: (prop_types_default()).string
|
13264 | };
|
13265 | const Navbar = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
|
13266 | const {
|
13267 | bsPrefix: initialBsPrefix,
|
13268 | expand = true,
|
13269 | variant = 'light',
|
13270 | bg,
|
13271 | fixed,
|
13272 | sticky,
|
13273 | className,
|
13274 |
|
13275 | as: Component = 'nav',
|
13276 | expanded,
|
13277 | onToggle,
|
13278 | onSelect,
|
13279 | collapseOnSelect = false,
|
13280 | ...controlledProps
|
13281 | } = useUncontrolled(props, {
|
13282 | expanded: 'onToggle'
|
13283 | });
|
13284 | const bsPrefix = useBootstrapPrefix(initialBsPrefix, 'navbar');
|
13285 | const handleCollapse = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((...args) => {
|
13286 | onSelect == null ? void 0 : onSelect(...args);
|
13287 | if (collapseOnSelect && expanded) {
|
13288 | onToggle == null ? void 0 : onToggle(false);
|
13289 | }
|
13290 | }, [onSelect, collapseOnSelect, expanded, onToggle]);
|
13291 |
|
13292 |
|
13293 |
|
13294 |
|
13295 | if (controlledProps.role === undefined && Component !== 'nav') {
|
13296 | controlledProps.role = 'navigation';
|
13297 | }
|
13298 | let expandClass = `${bsPrefix}-expand`;
|
13299 | if (typeof expand === 'string') expandClass = `${expandClass}-${expand}`;
|
13300 | const navbarContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
13301 | onToggle: () => onToggle == null ? void 0 : onToggle(!expanded),
|
13302 | bsPrefix,
|
13303 | expanded: !!expanded,
|
13304 | expand
|
13305 | }), [bsPrefix, expanded, expand, onToggle]);
|
13306 | return (0,jsx_dev_runtime.jsxDEV)(NavbarContext.Provider, {
|
13307 | value: navbarContext,
|
13308 | children: (0,jsx_dev_runtime.jsxDEV)(esm_SelectableContext.Provider, {
|
13309 | value: handleCollapse,
|
13310 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
13311 | ref: ref,
|
13312 | ...controlledProps,
|
13313 | className: classnames_default()(className, bsPrefix, expand && expandClass, variant && `${bsPrefix}-${variant}`, bg && `bg-${bg}`, sticky && `sticky-${sticky}`, fixed && `fixed-${fixed}`)
|
13314 | }, void 0, false, {
|
13315 | fileName: Navbar_jsxFileName,
|
13316 | lineNumber: 191,
|
13317 | columnNumber: 11
|
13318 | }, undefined)
|
13319 | }, void 0, false, {
|
13320 | fileName: Navbar_jsxFileName,
|
13321 | lineNumber: 190,
|
13322 | columnNumber: 9
|
13323 | }, undefined)
|
13324 | }, void 0, false, {
|
13325 | fileName: Navbar_jsxFileName,
|
13326 | lineNumber: 189,
|
13327 | columnNumber: 7
|
13328 | }, undefined);
|
13329 | });
|
13330 | Navbar.propTypes = Navbar_propTypes;
|
13331 | Navbar.displayName = 'Navbar';
|
13332 | const src_Navbar = (Object.assign(Navbar, {
|
13333 | Brand: src_NavbarBrand,
|
13334 | Collapse: src_NavbarCollapse,
|
13335 | Offcanvas: src_NavbarOffcanvas,
|
13336 | Text: src_NavbarText,
|
13337 | Toggle: src_NavbarToggle
|
13338 | }));
|
13339 | ;
|
13340 | var NavDropdown_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/NavDropdown.tsx";
|
13341 |
|
13342 |
|
13343 |
|
13344 |
|
13345 |
|
13346 |
|
13347 |
|
13348 | const NavDropdown_propTypes = {
|
13349 | |
13350 |
|
13351 |
|
13352 |
|
13353 | id: (prop_types_default()).string,
|
13354 |
|
13355 | onClick: (prop_types_default()).func,
|
13356 |
|
13357 | title: (prop_types_default()).node.isRequired,
|
13358 |
|
13359 | disabled: (prop_types_default()).bool,
|
13360 |
|
13361 | active: (prop_types_default()).bool,
|
13362 |
|
13363 | menuRole: (prop_types_default()).string,
|
13364 |
|
13365 | renderMenuOnMount: (prop_types_default()).bool,
|
13366 | |
13367 |
|
13368 |
|
13369 |
|
13370 |
|
13371 | rootCloseEvent: (prop_types_default()).string,
|
13372 | |
13373 |
|
13374 |
|
13375 |
|
13376 |
|
13377 | menuVariant: prop_types_default().oneOf(['dark']),
|
13378 |
|
13379 | bsPrefix: (prop_types_default()).string
|
13380 | };
|
13381 | const NavDropdown = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
13382 | id,
|
13383 | title,
|
13384 | children,
|
13385 | bsPrefix,
|
13386 | className,
|
13387 | rootCloseEvent,
|
13388 | menuRole,
|
13389 | disabled,
|
13390 | active,
|
13391 | renderMenuOnMount,
|
13392 | menuVariant,
|
13393 | ...props
|
13394 | }, ref) => {
|
13395 |
|
13396 | const navItemPrefix = useBootstrapPrefix(undefined, 'nav-item');
|
13397 | return (0,jsx_dev_runtime.jsxDEV)(src_Dropdown, {
|
13398 | ref: ref,
|
13399 | ...props,
|
13400 | className: classnames_default()(className, navItemPrefix),
|
13401 | children: [(0,jsx_dev_runtime.jsxDEV)(src_Dropdown.Toggle, {
|
13402 | id: id,
|
13403 | eventKey: null,
|
13404 | active: active,
|
13405 | disabled: disabled,
|
13406 | childBsPrefix: bsPrefix,
|
13407 | as: src_NavLink,
|
13408 | children: title
|
13409 | }, void 0, false, {
|
13410 | fileName: NavDropdown_jsxFileName,
|
13411 | lineNumber: 92,
|
13412 | columnNumber: 11
|
13413 | }, undefined), (0,jsx_dev_runtime.jsxDEV)(src_Dropdown.Menu, {
|
13414 | role: menuRole,
|
13415 | renderOnMount: renderMenuOnMount,
|
13416 | rootCloseEvent: rootCloseEvent,
|
13417 | variant: menuVariant,
|
13418 | children: children
|
13419 | }, void 0, false, {
|
13420 | fileName: NavDropdown_jsxFileName,
|
13421 | lineNumber: 103,
|
13422 | columnNumber: 11
|
13423 | }, undefined)]
|
13424 | }, void 0, true, {
|
13425 | fileName: NavDropdown_jsxFileName,
|
13426 | lineNumber: 87,
|
13427 | columnNumber: 9
|
13428 | }, undefined);
|
13429 | });
|
13430 | NavDropdown.displayName = 'NavDropdown';
|
13431 | NavDropdown.propTypes = NavDropdown_propTypes;
|
13432 | const src_NavDropdown = (Object.assign(NavDropdown, {
|
13433 | Item: src_Dropdown.Item,
|
13434 | ItemText: src_Dropdown.ItemText,
|
13435 | Divider: src_Dropdown.Divider,
|
13436 | Header: src_Dropdown.Header
|
13437 | }));
|
13438 | ;
|
13439 |
|
13440 |
|
13441 |
|
13442 |
|
13443 |
|
13444 |
|
13445 | const useRootClose_noop = () => {};
|
13446 |
|
13447 |
|
13448 |
|
13449 |
|
13450 |
|
13451 |
|
13452 |
|
13453 |
|
13454 |
|
13455 |
|
13456 |
|
13457 |
|
13458 | function useRootClose(ref, onRootClose, {
|
13459 | disabled,
|
13460 | clickTrigger
|
13461 | } = {}) {
|
13462 | const onClose = onRootClose || useRootClose_noop;
|
13463 | esm_useClickOutside(ref, onClose, {
|
13464 | disabled,
|
13465 | clickTrigger
|
13466 | });
|
13467 | const handleKeyUp = useEventCallback(e => {
|
13468 | if (isEscKey(e)) {
|
13469 | onClose(e);
|
13470 | }
|
13471 | });
|
13472 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
13473 | if (disabled || ref == null) return undefined;
|
13474 | const doc = ownerDocument(getRefTarget(ref));
|
13475 |
|
13476 |
|
13477 |
|
13478 | let currentEvent = (doc.defaultView || window).event;
|
13479 | const removeKeyupListener = esm_listen(doc, 'keyup', e => {
|
13480 |
|
13481 | if (e === currentEvent) {
|
13482 | currentEvent = undefined;
|
13483 | return;
|
13484 | }
|
13485 | handleKeyUp(e);
|
13486 | });
|
13487 | return () => {
|
13488 | removeKeyupListener();
|
13489 | };
|
13490 | }, [ref, disabled, handleKeyUp]);
|
13491 | }
|
13492 | const esm_useRootClose = (useRootClose);
|
13493 | ;
|
13494 |
|
13495 |
|
13496 |
|
13497 |
|
13498 |
|
13499 |
|
13500 |
|
13501 |
|
13502 |
|
13503 |
|
13504 |
|
13505 |
|
13506 |
|
13507 |
|
13508 | const Overlay = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, outerRef) => {
|
13509 | const {
|
13510 | flip,
|
13511 | offset,
|
13512 | placement,
|
13513 | containerPadding,
|
13514 | popperConfig = {},
|
13515 | transition: Transition,
|
13516 | runTransition
|
13517 | } = props;
|
13518 | const [rootElement, attachRef] = useCallbackRef();
|
13519 | const [arrowElement, attachArrowRef] = useCallbackRef();
|
13520 | const mergedRef = esm_useMergedRefs(attachRef, outerRef);
|
13521 | const container = useWaitForDOMRef(props.container);
|
13522 | const target = useWaitForDOMRef(props.target);
|
13523 | const [exited, setExited] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(!props.show);
|
13524 | const popper = esm_usePopper(target, rootElement, mergeOptionsWithPopperConfig({
|
13525 | placement,
|
13526 | enableEvents: !!props.show,
|
13527 | containerPadding: containerPadding || 5,
|
13528 | flip,
|
13529 | offset,
|
13530 | arrowElement,
|
13531 | popperConfig
|
13532 | }));
|
13533 |
|
13534 |
|
13535 | if (props.show && exited) {
|
13536 | setExited(false);
|
13537 | }
|
13538 | const handleHidden = (...args) => {
|
13539 | setExited(true);
|
13540 | if (props.onExited) {
|
13541 | props.onExited(...args);
|
13542 | }
|
13543 | };
|
13544 |
|
13545 |
|
13546 | const mountOverlay = props.show || !exited;
|
13547 | esm_useRootClose(rootElement, props.onHide, {
|
13548 | disabled: !props.rootClose || props.rootCloseDisabled,
|
13549 | clickTrigger: props.rootCloseEvent
|
13550 | });
|
13551 | if (!mountOverlay) {
|
13552 |
|
13553 | return null;
|
13554 | }
|
13555 | const {
|
13556 | onExit,
|
13557 | onExiting,
|
13558 | onEnter,
|
13559 | onEntering,
|
13560 | onEntered
|
13561 | } = props;
|
13562 | let child = props.children(Object.assign({}, popper.attributes.popper, {
|
13563 | style: popper.styles.popper,
|
13564 | ref: mergedRef
|
13565 | }), {
|
13566 | popper,
|
13567 | placement,
|
13568 | show: !!props.show,
|
13569 | arrowProps: Object.assign({}, popper.attributes.arrow, {
|
13570 | style: popper.styles.arrow,
|
13571 | ref: attachArrowRef
|
13572 | })
|
13573 | });
|
13574 | child = renderTransition(Transition, runTransition, {
|
13575 | in: !!props.show,
|
13576 | appear: true,
|
13577 | mountOnEnter: true,
|
13578 | unmountOnExit: true,
|
13579 | children: child,
|
13580 | onExit,
|
13581 | onExiting,
|
13582 | onExited: handleHidden,
|
13583 | onEnter,
|
13584 | onEntering,
|
13585 | onEntered
|
13586 | });
|
13587 | return container ? external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().createPortal(child, container) : null;
|
13588 | });
|
13589 | Overlay.displayName = 'Overlay';
|
13590 | const esm_Overlay = (Overlay);
|
13591 | ;
|
13592 | var PopoverHeader_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/PopoverHeader.tsx";
|
13593 |
|
13594 |
|
13595 |
|
13596 |
|
13597 | const PopoverHeader = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
13598 | className,
|
13599 | bsPrefix,
|
13600 | as: Component = 'div',
|
13601 | ...props
|
13602 | }, ref) => {
|
13603 | bsPrefix = useBootstrapPrefix(bsPrefix, 'popover-header');
|
13604 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
13605 | ref: ref,
|
13606 | className: classnames_default()(className, bsPrefix),
|
13607 | ...props
|
13608 | }, void 0, false, {
|
13609 | fileName: PopoverHeader_jsxFileName,
|
13610 | lineNumber: 15,
|
13611 | columnNumber: 9
|
13612 | }, undefined);
|
13613 | });
|
13614 | PopoverHeader.displayName = 'PopoverHeader';
|
13615 | const src_PopoverHeader = (PopoverHeader);
|
13616 | ;
|
13617 | var PopoverBody_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/PopoverBody.tsx";
|
13618 |
|
13619 |
|
13620 |
|
13621 |
|
13622 | const PopoverBody = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
13623 | className,
|
13624 | bsPrefix,
|
13625 | as: Component = 'div',
|
13626 | ...props
|
13627 | }, ref) => {
|
13628 | bsPrefix = useBootstrapPrefix(bsPrefix, 'popover-body');
|
13629 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
13630 | ref: ref,
|
13631 | className: classnames_default()(className, bsPrefix),
|
13632 | ...props
|
13633 | }, void 0, false, {
|
13634 | fileName: PopoverBody_jsxFileName,
|
13635 | lineNumber: 15,
|
13636 | columnNumber: 9
|
13637 | }, undefined);
|
13638 | });
|
13639 | PopoverBody.displayName = 'PopoverBody';
|
13640 | const src_PopoverBody = (PopoverBody);
|
13641 | ;
|
13642 |
|
13643 | class BsPrefixComponent extends external_root_React_commonjs2_react_commonjs_react_amd_react_.Component {}
|
13644 |
|
13645 |
|
13646 |
|
13647 | function getOverlayDirection(placement, isRTL) {
|
13648 | let bsDirection = placement;
|
13649 | if (placement === 'left') {
|
13650 | bsDirection = isRTL ? 'end' : 'start';
|
13651 | } else if (placement === 'right') {
|
13652 | bsDirection = isRTL ? 'start' : 'end';
|
13653 | }
|
13654 | return bsDirection;
|
13655 | }
|
13656 | ;
|
13657 | function getInitialPopperStyles(position = 'absolute') {
|
13658 | return {
|
13659 | position,
|
13660 | top: '0',
|
13661 | left: '0',
|
13662 | opacity: '0',
|
13663 | pointerEvents: 'none'
|
13664 | };
|
13665 | }
|
13666 | ;
|
13667 | var Popover_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Popover.tsx";
|
13668 |
|
13669 |
|
13670 |
|
13671 |
|
13672 |
|
13673 |
|
13674 |
|
13675 |
|
13676 |
|
13677 | const Popover_propTypes = {
|
13678 | |
13679 |
|
13680 |
|
13681 | bsPrefix: (prop_types_default()).string,
|
13682 | |
13683 |
|
13684 |
|
13685 |
|
13686 |
|
13687 | id: (prop_types_default()).string,
|
13688 | |
13689 |
|
13690 |
|
13691 |
|
13692 |
|
13693 | placement: prop_types_default().oneOf(['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']),
|
13694 | |
13695 |
|
13696 |
|
13697 |
|
13698 |
|
13699 | arrowProps: prop_types_default().shape({
|
13700 | ref: (prop_types_default()).any,
|
13701 | style: (prop_types_default()).object
|
13702 | }),
|
13703 | |
13704 |
|
13705 |
|
13706 |
|
13707 | body: (prop_types_default()).bool,
|
13708 | |
13709 |
|
13710 |
|
13711 | hasDoneInitialMeasure: (prop_types_default()).bool,
|
13712 |
|
13713 | popper: (prop_types_default()).object,
|
13714 |
|
13715 | show: (prop_types_default()).bool
|
13716 | };
|
13717 | const Popover = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
13718 | bsPrefix,
|
13719 | placement = 'right',
|
13720 | className,
|
13721 | style,
|
13722 | children,
|
13723 | body,
|
13724 | arrowProps,
|
13725 | hasDoneInitialMeasure,
|
13726 | popper,
|
13727 | show,
|
13728 | ...props
|
13729 | }, ref) => {
|
13730 | const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'popover');
|
13731 | const isRTL = useIsRTL();
|
13732 | const [primaryPlacement] = (placement == null ? void 0 : placement.split('-')) || [];
|
13733 | const bsDirection = getOverlayDirection(primaryPlacement, isRTL);
|
13734 | let computedStyle = style;
|
13735 | if (show && !hasDoneInitialMeasure) {
|
13736 | computedStyle = {
|
13737 | ...style,
|
13738 | ...getInitialPopperStyles(popper == null ? void 0 : popper.strategy)
|
13739 | };
|
13740 | }
|
13741 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
13742 | ref: ref,
|
13743 | role: "tooltip",
|
13744 | style: computedStyle,
|
13745 | "x-placement": primaryPlacement,
|
13746 | className: classnames_default()(className, decoratedBsPrefix, primaryPlacement && `bs-popover-${bsDirection}`),
|
13747 | ...props,
|
13748 | children: [(0,jsx_dev_runtime.jsxDEV)("div", {
|
13749 | className: "popover-arrow",
|
13750 | ...arrowProps
|
13751 | }, void 0, false, {
|
13752 | fileName: Popover_jsxFileName,
|
13753 | lineNumber: 131,
|
13754 | columnNumber: 9
|
13755 | }, undefined), body ? (0,jsx_dev_runtime.jsxDEV)(src_PopoverBody, {
|
13756 | children: children
|
13757 | }, void 0, false, {
|
13758 | fileName: Popover_jsxFileName,
|
13759 | lineNumber: 132,
|
13760 | columnNumber: 17
|
13761 | }, undefined) : children]
|
13762 | }, void 0, true, {
|
13763 | fileName: Popover_jsxFileName,
|
13764 | lineNumber: 119,
|
13765 | columnNumber: 7
|
13766 | }, undefined);
|
13767 | });
|
13768 | Popover.propTypes = Popover_propTypes;
|
13769 | const src_Popover = (Object.assign(Popover, {
|
13770 | Header: src_PopoverHeader,
|
13771 | Body: src_PopoverBody,
|
13772 |
|
13773 |
|
13774 | POPPER_OFFSET: [0, 8]
|
13775 | }));
|
13776 | ;
|
13777 | var Tooltip_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Tooltip.tsx";
|
13778 |
|
13779 |
|
13780 |
|
13781 |
|
13782 |
|
13783 |
|
13784 |
|
13785 | const Tooltip_propTypes = {
|
13786 | |
13787 |
|
13788 |
|
13789 | bsPrefix: (prop_types_default()).string,
|
13790 | |
13791 |
|
13792 |
|
13793 |
|
13794 |
|
13795 | id: (prop_types_default()).string,
|
13796 | |
13797 |
|
13798 |
|
13799 |
|
13800 |
|
13801 | placement: prop_types_default().oneOf(['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']),
|
13802 | |
13803 |
|
13804 |
|
13805 |
|
13806 |
|
13807 |
|
13808 |
|
13809 | arrowProps: prop_types_default().shape({
|
13810 | ref: (prop_types_default()).any,
|
13811 | style: (prop_types_default()).object
|
13812 | }),
|
13813 | |
13814 |
|
13815 |
|
13816 | hasDoneInitialMeasure: (prop_types_default()).bool,
|
13817 |
|
13818 | popper: (prop_types_default()).object,
|
13819 |
|
13820 | show: (prop_types_default()).any
|
13821 | };
|
13822 | const Tooltip = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
13823 | bsPrefix,
|
13824 | placement = 'right',
|
13825 | className,
|
13826 | style,
|
13827 | children,
|
13828 | arrowProps,
|
13829 | hasDoneInitialMeasure,
|
13830 | popper,
|
13831 | show,
|
13832 | ...props
|
13833 | }, ref) => {
|
13834 | bsPrefix = useBootstrapPrefix(bsPrefix, 'tooltip');
|
13835 | const isRTL = useIsRTL();
|
13836 | const [primaryPlacement] = (placement == null ? void 0 : placement.split('-')) || [];
|
13837 | const bsDirection = getOverlayDirection(primaryPlacement, isRTL);
|
13838 | let computedStyle = style;
|
13839 | if (show && !hasDoneInitialMeasure) {
|
13840 | computedStyle = {
|
13841 | ...style,
|
13842 | ...getInitialPopperStyles(popper == null ? void 0 : popper.strategy)
|
13843 | };
|
13844 | }
|
13845 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
13846 | ref: ref,
|
13847 | style: computedStyle,
|
13848 | role: "tooltip",
|
13849 | "x-placement": primaryPlacement,
|
13850 | className: classnames_default()(className, bsPrefix, `bs-tooltip-${bsDirection}`),
|
13851 | ...props,
|
13852 | children: [(0,jsx_dev_runtime.jsxDEV)("div", {
|
13853 | className: "tooltip-arrow",
|
13854 | ...arrowProps
|
13855 | }, void 0, false, {
|
13856 | fileName: Tooltip_jsxFileName,
|
13857 | lineNumber: 119,
|
13858 | columnNumber: 9
|
13859 | }, undefined), (0,jsx_dev_runtime.jsxDEV)("div", {
|
13860 | className: `${bsPrefix}-inner`,
|
13861 | children: children
|
13862 | }, void 0, false, {
|
13863 | fileName: Tooltip_jsxFileName,
|
13864 | lineNumber: 120,
|
13865 | columnNumber: 9
|
13866 | }, undefined)]
|
13867 | }, void 0, true, {
|
13868 | fileName: Tooltip_jsxFileName,
|
13869 | lineNumber: 111,
|
13870 | columnNumber: 7
|
13871 | }, undefined);
|
13872 | });
|
13873 | Tooltip.propTypes = Tooltip_propTypes;
|
13874 | Tooltip.displayName = 'Tooltip';
|
13875 | const src_Tooltip = (Object.assign(Tooltip, {
|
13876 |
|
13877 |
|
13878 | TOOLTIP_OFFSET: [0, 6]
|
13879 | }));
|
13880 | ;
|
13881 |
|
13882 |
|
13883 |
|
13884 |
|
13885 |
|
13886 |
|
13887 |
|
13888 |
|
13889 | function useOverlayOffset(customOffset) {
|
13890 | const overlayRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
13891 | const popoverClass = useBootstrapPrefix(undefined, 'popover');
|
13892 | const tooltipClass = useBootstrapPrefix(undefined, 'tooltip');
|
13893 | const offset = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
13894 | name: 'offset',
|
13895 | options: {
|
13896 | offset: () => {
|
13897 | if (customOffset) {
|
13898 | return customOffset;
|
13899 | }
|
13900 | if (overlayRef.current) {
|
13901 | if (hasClass(overlayRef.current, popoverClass)) {
|
13902 | return src_Popover.POPPER_OFFSET;
|
13903 | }
|
13904 | if (hasClass(overlayRef.current, tooltipClass)) {
|
13905 | return src_Tooltip.TOOLTIP_OFFSET;
|
13906 | }
|
13907 | }
|
13908 | return [0, 0];
|
13909 | }
|
13910 | }
|
13911 | }), [customOffset, popoverClass, tooltipClass]);
|
13912 | return [overlayRef, [offset]];
|
13913 | }
|
13914 | ;
|
13915 | var Overlay_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Overlay.tsx";
|
13916 |
|
13917 |
|
13918 |
|
13919 |
|
13920 |
|
13921 |
|
13922 |
|
13923 |
|
13924 |
|
13925 |
|
13926 |
|
13927 |
|
13928 |
|
13929 | const Overlay_propTypes = {
|
13930 | |
13931 |
|
13932 |
|
13933 |
|
13934 | container: prop_types_default().oneOfType([lib.ax, (prop_types_default()).func]),
|
13935 | |
13936 |
|
13937 |
|
13938 |
|
13939 | target: prop_types_default().oneOfType([lib.ax, (prop_types_default()).func]),
|
13940 | |
13941 |
|
13942 |
|
13943 | show: (prop_types_default()).bool,
|
13944 | |
13945 |
|
13946 |
|
13947 | popperConfig: (prop_types_default()).object,
|
13948 | |
13949 |
|
13950 |
|
13951 | rootClose: (prop_types_default()).bool,
|
13952 | |
13953 |
|
13954 |
|
13955 | rootCloseEvent: prop_types_default().oneOf(['click', 'mousedown']),
|
13956 | |
13957 |
|
13958 |
|
13959 |
|
13960 | onHide: (prop_types_default()).func,
|
13961 | |
13962 |
|
13963 |
|
13964 |
|
13965 | transition: prop_types_default().oneOfType([(prop_types_default()).bool, lib.nm]),
|
13966 | |
13967 |
|
13968 |
|
13969 | onEnter: (prop_types_default()).func,
|
13970 | |
13971 |
|
13972 |
|
13973 | onEntering: (prop_types_default()).func,
|
13974 | |
13975 |
|
13976 |
|
13977 | onEntered: (prop_types_default()).func,
|
13978 | |
13979 |
|
13980 |
|
13981 | onExit: (prop_types_default()).func,
|
13982 | |
13983 |
|
13984 |
|
13985 | onExiting: (prop_types_default()).func,
|
13986 | |
13987 |
|
13988 |
|
13989 | onExited: (prop_types_default()).func,
|
13990 | |
13991 |
|
13992 |
|
13993 | placement: prop_types_default().oneOf(['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'])
|
13994 | };
|
13995 | function wrapRefs(props, arrowProps) {
|
13996 | const {
|
13997 | ref
|
13998 | } = props;
|
13999 | const {
|
14000 | ref: aRef
|
14001 | } = arrowProps;
|
14002 | props.ref = ref.__wrapped || (ref.__wrapped = r => ref(safeFindDOMNode(r)));
|
14003 | arrowProps.ref = aRef.__wrapped || (aRef.__wrapped = r => aRef(safeFindDOMNode(r)));
|
14004 | }
|
14005 | const Overlay_Overlay = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14006 | children: overlay,
|
14007 | transition = src_Fade,
|
14008 | popperConfig = {},
|
14009 | rootClose = false,
|
14010 | placement = 'top',
|
14011 | show: outerShow = false,
|
14012 | ...outerProps
|
14013 | }, outerRef) => {
|
14014 | const popperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({});
|
14015 | const [firstRenderedState, setFirstRenderedState] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null);
|
14016 | const [ref, modifiers] = useOverlayOffset(outerProps.offset);
|
14017 | const mergedRef = esm_useMergedRefs(outerRef, ref);
|
14018 | const actualTransition = transition === true ? src_Fade : transition || undefined;
|
14019 | const handleFirstUpdate = useEventCallback(state => {
|
14020 | setFirstRenderedState(state);
|
14021 | popperConfig == null ? void 0 : popperConfig.onFirstUpdate == null ? void 0 : popperConfig.onFirstUpdate(state);
|
14022 | });
|
14023 | useIsomorphicEffect(() => {
|
14024 | if (firstRenderedState && outerProps.target) {
|
14025 |
|
14026 | popperRef.current.scheduleUpdate == null ? void 0 : popperRef.current.scheduleUpdate();
|
14027 | }
|
14028 | }, [firstRenderedState, outerProps.target]);
|
14029 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
14030 | if (!outerShow) {
|
14031 | setFirstRenderedState(null);
|
14032 | }
|
14033 | }, [outerShow]);
|
14034 | return (0,jsx_dev_runtime.jsxDEV)(esm_Overlay, {
|
14035 | ...outerProps,
|
14036 | ref: mergedRef,
|
14037 | popperConfig: {
|
14038 | ...popperConfig,
|
14039 | modifiers: modifiers.concat(popperConfig.modifiers || []),
|
14040 | onFirstUpdate: handleFirstUpdate
|
14041 | },
|
14042 | transition: actualTransition,
|
14043 | rootClose: rootClose,
|
14044 | placement: placement,
|
14045 | show: outerShow,
|
14046 | children: (overlayProps, {
|
14047 | arrowProps,
|
14048 | popper: popperObj,
|
14049 | show
|
14050 | }) => {
|
14051 | var _popperObj$state, _popperObj$state$modi;
|
14052 | wrapRefs(overlayProps, arrowProps);
|
14053 |
|
14054 | const updatedPlacement = popperObj == null ? void 0 : popperObj.placement;
|
14055 | const popper = Object.assign(popperRef.current, {
|
14056 | state: popperObj == null ? void 0 : popperObj.state,
|
14057 | scheduleUpdate: popperObj == null ? void 0 : popperObj.update,
|
14058 | placement: updatedPlacement,
|
14059 | outOfBoundaries: (popperObj == null ? void 0 : (_popperObj$state = popperObj.state) == null ? void 0 : (_popperObj$state$modi = _popperObj$state.modifiersData.hide) == null ? void 0 : _popperObj$state$modi.isReferenceHidden) || false,
|
14060 | strategy: popperConfig.strategy
|
14061 | });
|
14062 | const hasDoneInitialMeasure = !!firstRenderedState;
|
14063 | if (typeof overlay === 'function') return overlay({
|
14064 | ...overlayProps,
|
14065 | placement: updatedPlacement,
|
14066 | show,
|
14067 | ...(!transition && show && {
|
14068 | className: 'show'
|
14069 | }),
|
14070 | popper,
|
14071 | arrowProps,
|
14072 | hasDoneInitialMeasure
|
14073 | });
|
14074 | return external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(overlay, {
|
14075 | ...overlayProps,
|
14076 | placement: updatedPlacement,
|
14077 | arrowProps,
|
14078 | popper,
|
14079 | hasDoneInitialMeasure,
|
14080 | className: classnames_default()(overlay.props.className, !transition && show && 'show'),
|
14081 | style: {
|
14082 | ...overlay.props.style,
|
14083 | ...overlayProps.style
|
14084 | }
|
14085 | });
|
14086 | }
|
14087 | }, void 0, false, {
|
14088 | fileName: Overlay_jsxFileName,
|
14089 | lineNumber: 195,
|
14090 | columnNumber: 7
|
14091 | }, undefined);
|
14092 | });
|
14093 | Overlay_Overlay.displayName = 'Overlay';
|
14094 | Overlay_Overlay.propTypes = Overlay_propTypes;
|
14095 | const src_Overlay = (Overlay_Overlay);
|
14096 | ;
|
14097 | var OverlayTrigger_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/OverlayTrigger.tsx";
|
14098 |
|
14099 |
|
14100 |
|
14101 |
|
14102 |
|
14103 |
|
14104 |
|
14105 |
|
14106 |
|
14107 |
|
14108 |
|
14109 |
|
14110 | function normalizeDelay(delay) {
|
14111 | return delay && typeof delay === 'object' ? delay : {
|
14112 | show: delay,
|
14113 | hide: delay
|
14114 | };
|
14115 | }
|
14116 |
|
14117 |
|
14118 |
|
14119 |
|
14120 |
|
14121 | function handleMouseOverOut(
|
14122 | // eslint-disable-next-line @typescript-eslint/no-shadow
|
14123 | handler, args, relatedNative) {
|
14124 | const [e] = args;
|
14125 | const target = e.currentTarget;
|
14126 | const related = e.relatedTarget || e.nativeEvent[relatedNative];
|
14127 | if ((!related || related !== target) && !contains_contains(target, related)) {
|
14128 | handler(...args);
|
14129 | }
|
14130 | }
|
14131 | const triggerType = prop_types_default().oneOf(['click', 'hover', 'focus']);
|
14132 | const OverlayTrigger_propTypes = {
|
14133 | children: prop_types_default().oneOfType([(prop_types_default()).element, (prop_types_default()).func]).isRequired,
|
14134 | |
14135 |
|
14136 |
|
14137 |
|
14138 |
|
14139 |
|
14140 |
|
14141 | trigger: prop_types_default().oneOfType([triggerType, prop_types_default().arrayOf(triggerType)]),
|
14142 | |
14143 |
|
14144 |
|
14145 | delay: prop_types_default().oneOfType([(prop_types_default()).number, prop_types_default().shape({
|
14146 | show: (prop_types_default()).number,
|
14147 | hide: (prop_types_default()).number
|
14148 | })]),
|
14149 | |
14150 |
|
14151 |
|
14152 |
|
14153 |
|
14154 |
|
14155 |
|
14156 |
|
14157 | show: (prop_types_default()).bool,
|
14158 | |
14159 |
|
14160 |
|
14161 | defaultShow: (prop_types_default()).bool,
|
14162 | |
14163 |
|
14164 |
|
14165 |
|
14166 |
|
14167 |
|
14168 |
|
14169 |
|
14170 | onToggle: (prop_types_default()).func,
|
14171 | |
14172 |
|
14173 |
|
14174 | flip: (prop_types_default()).bool,
|
14175 | |
14176 |
|
14177 |
|
14178 | overlay: prop_types_default().oneOfType([(prop_types_default()).func, (prop_types_default()).element.isRequired]),
|
14179 | |
14180 |
|
14181 |
|
14182 | popperConfig: (prop_types_default()).object,
|
14183 |
|
14184 | |
14185 |
|
14186 |
|
14187 | target: prop_types_default().oneOf([null]),
|
14188 | |
14189 |
|
14190 |
|
14191 | onHide: prop_types_default().oneOf([null]),
|
14192 | |
14193 |
|
14194 |
|
14195 | placement: prop_types_default().oneOf(['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'])
|
14196 | };
|
14197 | function OverlayTrigger({
|
14198 | trigger = ['hover', 'focus'],
|
14199 | overlay,
|
14200 | children,
|
14201 | popperConfig = {},
|
14202 | show: propsShow,
|
14203 | defaultShow = false,
|
14204 | onToggle,
|
14205 | delay: propsDelay,
|
14206 | placement,
|
14207 | flip = placement && placement.indexOf('auto') !== -1,
|
14208 | ...props
|
14209 | }) {
|
14210 | const triggerNodeRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
14211 | const mergedRef = esm_useMergedRefs(triggerNodeRef, children.ref);
|
14212 | const timeout = useTimeout();
|
14213 | const hoverStateRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)('');
|
14214 | const [show, setShow] = useUncontrolledProp(propsShow, defaultShow, onToggle);
|
14215 | const delay = normalizeDelay(propsDelay);
|
14216 | const {
|
14217 | onFocus,
|
14218 | onBlur,
|
14219 | onClick
|
14220 | } = typeof children !== 'function' ? external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.only(children).props : {};
|
14221 | const attachRef = r => {
|
14222 | mergedRef(safeFindDOMNode(r));
|
14223 | };
|
14224 | const handleShow = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
|
14225 | timeout.clear();
|
14226 | hoverStateRef.current = 'show';
|
14227 | if (!delay.show) {
|
14228 | setShow(true);
|
14229 | return;
|
14230 | }
|
14231 | timeout.set(() => {
|
14232 | if (hoverStateRef.current === 'show') setShow(true);
|
14233 | }, delay.show);
|
14234 | }, [delay.show, setShow, timeout]);
|
14235 | const handleHide = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
|
14236 | timeout.clear();
|
14237 | hoverStateRef.current = 'hide';
|
14238 | if (!delay.hide) {
|
14239 | setShow(false);
|
14240 | return;
|
14241 | }
|
14242 | timeout.set(() => {
|
14243 | if (hoverStateRef.current === 'hide') setShow(false);
|
14244 | }, delay.hide);
|
14245 | }, [delay.hide, setShow, timeout]);
|
14246 | const handleFocus = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((...args) => {
|
14247 | handleShow();
|
14248 | onFocus == null ? void 0 : onFocus(...args);
|
14249 | }, [handleShow, onFocus]);
|
14250 | const handleBlur = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((...args) => {
|
14251 | handleHide();
|
14252 | onBlur == null ? void 0 : onBlur(...args);
|
14253 | }, [handleHide, onBlur]);
|
14254 | const handleClick = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((...args) => {
|
14255 | setShow(!show);
|
14256 | onClick == null ? void 0 : onClick(...args);
|
14257 | }, [onClick, setShow, show]);
|
14258 | const handleMouseOver = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((...args) => {
|
14259 | handleMouseOverOut(handleShow, args, 'fromElement');
|
14260 | }, [handleShow]);
|
14261 | const handleMouseOut = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((...args) => {
|
14262 | handleMouseOverOut(handleHide, args, 'toElement');
|
14263 | }, [handleHide]);
|
14264 | const triggers = trigger == null ? [] : [].concat(trigger);
|
14265 | const triggerProps = {
|
14266 | ref: attachRef
|
14267 | };
|
14268 | if (triggers.indexOf('click') !== -1) {
|
14269 | triggerProps.onClick = handleClick;
|
14270 | }
|
14271 | if (triggers.indexOf('focus') !== -1) {
|
14272 | triggerProps.onFocus = handleFocus;
|
14273 | triggerProps.onBlur = handleBlur;
|
14274 | }
|
14275 | if (triggers.indexOf('hover') !== -1) {
|
14276 | false ? 0 : void 0;
|
14277 | triggerProps.onMouseOver = handleMouseOver;
|
14278 | triggerProps.onMouseOut = handleMouseOut;
|
14279 | }
|
14280 | return (0,jsx_dev_runtime.jsxDEV)(jsx_dev_runtime.Fragment, {
|
14281 | children: [typeof children === 'function' ? children(triggerProps) : (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(children, triggerProps), (0,jsx_dev_runtime.jsxDEV)(src_Overlay, {
|
14282 | ...props,
|
14283 | show: show,
|
14284 | onHide: handleHide,
|
14285 | flip: flip,
|
14286 | placement: placement,
|
14287 | popperConfig: popperConfig,
|
14288 | target: triggerNodeRef.current,
|
14289 | children: overlay
|
14290 | }, void 0, false, {
|
14291 | fileName: OverlayTrigger_jsxFileName,
|
14292 | lineNumber: 297,
|
14293 | columnNumber: 7
|
14294 | }, this)]
|
14295 | }, void 0, true);
|
14296 | }
|
14297 | OverlayTrigger.propTypes = OverlayTrigger_propTypes;
|
14298 | const src_OverlayTrigger = (OverlayTrigger);
|
14299 | ;
|
14300 | var PageItem_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/PageItem.tsx";
|
14301 |
|
14302 |
|
14303 |
|
14304 |
|
14305 |
|
14306 |
|
14307 | const PageItem_propTypes = {
|
14308 |
|
14309 | disabled: (prop_types_default()).bool,
|
14310 |
|
14311 | active: (prop_types_default()).bool,
|
14312 |
|
14313 | activeLabel: (prop_types_default()).string,
|
14314 |
|
14315 | href: (prop_types_default()).string,
|
14316 |
|
14317 | onClick: (prop_types_default()).func,
|
14318 |
|
14319 | linkStyle: (prop_types_default()).object,
|
14320 |
|
14321 | linkClassName: (prop_types_default()).string
|
14322 | };
|
14323 | const PageItem = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14324 | active = false,
|
14325 | disabled = false,
|
14326 | className,
|
14327 | style,
|
14328 | activeLabel = '(current)',
|
14329 | children,
|
14330 | linkStyle,
|
14331 | linkClassName,
|
14332 | ...props
|
14333 | }, ref) => {
|
14334 | const Component = active || disabled ? 'span' : esm_Anchor;
|
14335 | return (0,jsx_dev_runtime.jsxDEV)("li", {
|
14336 | ref: ref,
|
14337 | style: style,
|
14338 | className: classnames_default()(className, 'page-item', {
|
14339 | active,
|
14340 | disabled
|
14341 | }),
|
14342 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
14343 | className: classnames_default()('page-link', linkClassName),
|
14344 | style: linkStyle,
|
14345 | ...props,
|
14346 | children: [children, active && activeLabel && (0,jsx_dev_runtime.jsxDEV)("span", {
|
14347 | className: "visually-hidden",
|
14348 | children: activeLabel
|
14349 | }, void 0, false, {
|
14350 | fileName: PageItem_jsxFileName,
|
14351 | lineNumber: 73,
|
14352 | columnNumber: 15
|
14353 | }, undefined)]
|
14354 | }, void 0, true, {
|
14355 | fileName: PageItem_jsxFileName,
|
14356 | lineNumber: 66,
|
14357 | columnNumber: 11
|
14358 | }, undefined)
|
14359 | }, void 0, false, {
|
14360 | fileName: PageItem_jsxFileName,
|
14361 | lineNumber: 61,
|
14362 | columnNumber: 9
|
14363 | }, undefined);
|
14364 | });
|
14365 | PageItem.propTypes = PageItem_propTypes;
|
14366 | PageItem.displayName = 'PageItem';
|
14367 | const src_PageItem = (PageItem);
|
14368 | function createButton(name, defaultValue, label = name) {
|
14369 | const Button = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14370 | children,
|
14371 | ...props
|
14372 | }, ref) => (0,jsx_dev_runtime.jsxDEV)(PageItem, {
|
14373 | ...props,
|
14374 | ref: ref,
|
14375 | children: [(0,jsx_dev_runtime.jsxDEV)("span", {
|
14376 | "aria-hidden": "true",
|
14377 | children: children || defaultValue
|
14378 | }, void 0, false, {
|
14379 | fileName: PageItem_jsxFileName,
|
14380 | lineNumber: 90,
|
14381 | columnNumber: 9
|
14382 | }, this), (0,jsx_dev_runtime.jsxDEV)("span", {
|
14383 | className: "visually-hidden",
|
14384 | children: label
|
14385 | }, void 0, false, {
|
14386 | fileName: PageItem_jsxFileName,
|
14387 | lineNumber: 91,
|
14388 | columnNumber: 9
|
14389 | }, this)]
|
14390 | }, void 0, true, {
|
14391 | fileName: PageItem_jsxFileName,
|
14392 | lineNumber: 89,
|
14393 | columnNumber: 7
|
14394 | }, this));
|
14395 | Button.displayName = name;
|
14396 | return Button;
|
14397 | }
|
14398 | const First = createButton('First', '«');
|
14399 | const Prev = createButton('Prev', '‹', 'Previous');
|
14400 | const Ellipsis = createButton('Ellipsis', '…', 'More');
|
14401 | const Next = createButton('Next', '›');
|
14402 | const Last = createButton('Last', '»');
|
14403 | ;
|
14404 | var Pagination_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Pagination.tsx";
|
14405 |
|
14406 |
|
14407 |
|
14408 |
|
14409 |
|
14410 |
|
14411 | const Pagination_propTypes = {
|
14412 | |
14413 |
|
14414 |
|
14415 | bsPrefix: (prop_types_default()).string,
|
14416 | |
14417 |
|
14418 |
|
14419 |
|
14420 |
|
14421 | size: prop_types_default().oneOf(['sm', 'lg'])
|
14422 | };
|
14423 | const Pagination = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14424 | bsPrefix,
|
14425 | className,
|
14426 | size,
|
14427 | ...props
|
14428 | }, ref) => {
|
14429 | const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'pagination');
|
14430 | return (0,jsx_dev_runtime.jsxDEV)("ul", {
|
14431 | ref: ref,
|
14432 | ...props,
|
14433 | className: classnames_default()(className, decoratedBsPrefix, size && `${decoratedBsPrefix}-${size}`)
|
14434 | }, void 0, false, {
|
14435 | fileName: Pagination_jsxFileName,
|
14436 | lineNumber: 35,
|
14437 | columnNumber: 7
|
14438 | }, undefined);
|
14439 | });
|
14440 | Pagination.propTypes = Pagination_propTypes;
|
14441 | Pagination.displayName = 'Pagination';
|
14442 | const src_Pagination = (Object.assign(Pagination, {
|
14443 | First: First,
|
14444 | Prev: Prev,
|
14445 | Ellipsis: Ellipsis,
|
14446 | Item: src_PageItem,
|
14447 | Next: Next,
|
14448 | Last: Last
|
14449 | }));
|
14450 | ;
|
14451 |
|
14452 |
|
14453 |
|
14454 | function usePlaceholder({
|
14455 | animation,
|
14456 | bg,
|
14457 | bsPrefix,
|
14458 | size,
|
14459 | ...props
|
14460 | }) {
|
14461 | bsPrefix = useBootstrapPrefix(bsPrefix, 'placeholder');
|
14462 | const [{
|
14463 | className,
|
14464 | ...colProps
|
14465 | }] = useCol(props);
|
14466 | return {
|
14467 | ...colProps,
|
14468 | className: classnames_default()(className, animation ? `${bsPrefix}-${animation}` : bsPrefix, size && `${bsPrefix}-${size}`, bg && `bg-${bg}`)
|
14469 | };
|
14470 | }
|
14471 | ;
|
14472 | var PlaceholderButton_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/PlaceholderButton.tsx";
|
14473 |
|
14474 |
|
14475 |
|
14476 |
|
14477 |
|
14478 | const PlaceholderButton_propTypes = {
|
14479 | |
14480 |
|
14481 |
|
14482 | bsPrefix: (prop_types_default()).string,
|
14483 | |
14484 |
|
14485 |
|
14486 | animation: prop_types_default().oneOf(['glow', 'wave']),
|
14487 | size: prop_types_default().oneOf(['xs', 'sm', 'lg']),
|
14488 | |
14489 |
|
14490 |
|
14491 | variant: (prop_types_default()).string
|
14492 | };
|
14493 | const PlaceholderButton = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
|
14494 | const placeholderProps = usePlaceholder(props);
|
14495 | return (0,jsx_dev_runtime.jsxDEV)(src_Button, {
|
14496 | ...placeholderProps,
|
14497 | ref: ref,
|
14498 | disabled: true,
|
14499 | tabIndex: -1
|
14500 | }, void 0, false, {
|
14501 | fileName: PlaceholderButton_jsxFileName,
|
14502 | lineNumber: 38,
|
14503 | columnNumber: 12
|
14504 | }, undefined);
|
14505 | });
|
14506 | PlaceholderButton.displayName = 'PlaceholderButton';
|
14507 | PlaceholderButton.propTypes = PlaceholderButton_propTypes;
|
14508 | const src_PlaceholderButton = (PlaceholderButton);
|
14509 | ;
|
14510 | var Placeholder_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Placeholder.tsx";
|
14511 |
|
14512 |
|
14513 |
|
14514 |
|
14515 |
|
14516 | const Placeholder_propTypes = {
|
14517 | |
14518 |
|
14519 |
|
14520 | bsPrefix: (prop_types_default()).string,
|
14521 | |
14522 |
|
14523 |
|
14524 |
|
14525 |
|
14526 | animation: (prop_types_default()).string,
|
14527 | |
14528 |
|
14529 |
|
14530 |
|
14531 |
|
14532 | bg: (prop_types_default()).string,
|
14533 | |
14534 |
|
14535 |
|
14536 |
|
14537 |
|
14538 | size: (prop_types_default()).string
|
14539 | };
|
14540 | const Placeholder = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14541 | as: Component = 'span',
|
14542 | ...props
|
14543 | }, ref) => {
|
14544 | const placeholderProps = usePlaceholder(props);
|
14545 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
14546 | ...placeholderProps,
|
14547 | ref: ref
|
14548 | }, void 0, false, {
|
14549 | fileName: Placeholder_jsxFileName,
|
14550 | lineNumber: 42,
|
14551 | columnNumber: 14
|
14552 | }, undefined);
|
14553 | });
|
14554 | Placeholder.displayName = 'Placeholder';
|
14555 | Placeholder.propTypes = Placeholder_propTypes;
|
14556 | const src_Placeholder = (Object.assign(Placeholder, {
|
14557 | Button: src_PlaceholderButton
|
14558 | }));
|
14559 | ;
|
14560 | var ProgressBar_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ProgressBar.tsx";
|
14561 |
|
14562 |
|
14563 |
|
14564 |
|
14565 |
|
14566 |
|
14567 |
|
14568 | const ROUND_PRECISION = 1000;
|
14569 |
|
14570 |
|
14571 |
|
14572 |
|
14573 | function onlyProgressBar(props, propName, componentName) {
|
14574 | const children = props[propName];
|
14575 | if (!children) {
|
14576 | return null;
|
14577 | }
|
14578 | let error = null;
|
14579 | external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.forEach(children, child => {
|
14580 | if (error) {
|
14581 | return;
|
14582 | }
|
14583 |
|
14584 | |
14585 |
|
14586 |
|
14587 |
|
14588 |
|
14589 |
|
14590 |
|
14591 | const element = (0,jsx_dev_runtime.jsxDEV)(ProgressBar, {}, void 0, false, {
|
14592 | fileName: ProgressBar_jsxFileName,
|
14593 | lineNumber: 50,
|
14594 | columnNumber: 21
|
14595 | }, this);
|
14596 | if (child.type === element.type) return;
|
14597 | const childType = child.type;
|
14598 | const childIdentifier = external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child) ? childType.displayName || childType.name || childType : child;
|
14599 | error = new Error(`Children of ${componentName} can contain only ProgressBar ` + `components. Found ${childIdentifier}.`);
|
14600 | });
|
14601 | return error;
|
14602 | }
|
14603 | const ProgressBar_propTypes = {
|
14604 | |
14605 |
|
14606 |
|
14607 | min: (prop_types_default()).number,
|
14608 | |
14609 |
|
14610 |
|
14611 | now: (prop_types_default()).number,
|
14612 | |
14613 |
|
14614 |
|
14615 | max: (prop_types_default()).number,
|
14616 | |
14617 |
|
14618 |
|
14619 |
|
14620 | label: (prop_types_default()).node,
|
14621 | |
14622 |
|
14623 |
|
14624 | visuallyHidden: (prop_types_default()).bool,
|
14625 | |
14626 |
|
14627 |
|
14628 | striped: (prop_types_default()).bool,
|
14629 | |
14630 |
|
14631 |
|
14632 | animated: (prop_types_default()).bool,
|
14633 | |
14634 |
|
14635 |
|
14636 |
|
14637 | bsPrefix: (prop_types_default()).string,
|
14638 | |
14639 |
|
14640 |
|
14641 |
|
14642 |
|
14643 | variant: (prop_types_default()).string,
|
14644 | |
14645 |
|
14646 |
|
14647 | children: onlyProgressBar,
|
14648 | |
14649 |
|
14650 |
|
14651 | isChild: (prop_types_default()).bool
|
14652 | };
|
14653 | function getPercentage(now, min, max) {
|
14654 | const percentage = (now - min) / (max - min) * 100;
|
14655 | return Math.round(percentage * ROUND_PRECISION) / ROUND_PRECISION;
|
14656 | }
|
14657 | function renderProgressBar({
|
14658 | min,
|
14659 | now,
|
14660 | max,
|
14661 | label,
|
14662 | visuallyHidden,
|
14663 | striped,
|
14664 | animated,
|
14665 | className,
|
14666 | style,
|
14667 | variant,
|
14668 | bsPrefix,
|
14669 | ...props
|
14670 | }, ref) {
|
14671 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
14672 | ref: ref,
|
14673 | ...props,
|
14674 | role: "progressbar",
|
14675 | className: classnames_default()(className, `${bsPrefix}-bar`, {
|
14676 | [`bg-${variant}`]: variant,
|
14677 | [`${bsPrefix}-bar-animated`]: animated,
|
14678 | [`${bsPrefix}-bar-striped`]: animated || striped
|
14679 | }),
|
14680 | style: {
|
14681 | width: `${getPercentage(now, min, max)}%`,
|
14682 | ...style
|
14683 | },
|
14684 | "aria-valuenow": now,
|
14685 | "aria-valuemin": min,
|
14686 | "aria-valuemax": max,
|
14687 | children: visuallyHidden ? (0,jsx_dev_runtime.jsxDEV)("span", {
|
14688 | className: "visually-hidden",
|
14689 | children: label
|
14690 | }, void 0, false, {
|
14691 | fileName: ProgressBar_jsxFileName,
|
14692 | lineNumber: 165,
|
14693 | columnNumber: 9
|
14694 | }, this) : label
|
14695 | }, void 0, false, {
|
14696 | fileName: ProgressBar_jsxFileName,
|
14697 | lineNumber: 150,
|
14698 | columnNumber: 5
|
14699 | }, this);
|
14700 | }
|
14701 | renderProgressBar.propTypes = ProgressBar_propTypes;
|
14702 | const ProgressBar = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14703 | isChild = false,
|
14704 | ...rest
|
14705 | }, ref) => {
|
14706 | const props = {
|
14707 | min: 0,
|
14708 | max: 100,
|
14709 | animated: false,
|
14710 | visuallyHidden: false,
|
14711 | striped: false,
|
14712 | ...rest
|
14713 | };
|
14714 | props.bsPrefix = useBootstrapPrefix(props.bsPrefix, 'progress');
|
14715 | if (isChild) {
|
14716 | return renderProgressBar(props, ref);
|
14717 | }
|
14718 | const {
|
14719 | min,
|
14720 | now,
|
14721 | max,
|
14722 | label,
|
14723 | visuallyHidden,
|
14724 | striped,
|
14725 | animated,
|
14726 | bsPrefix,
|
14727 | variant,
|
14728 | className,
|
14729 | children,
|
14730 | ...wrapperProps
|
14731 | } = props;
|
14732 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
14733 | ref: ref,
|
14734 | ...wrapperProps,
|
14735 | className: classnames_default()(className, bsPrefix),
|
14736 | children: children ? map(children, child => (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(child, {
|
14737 | isChild: true
|
14738 | })) : renderProgressBar({
|
14739 | min,
|
14740 | now,
|
14741 | max,
|
14742 | label,
|
14743 | visuallyHidden,
|
14744 | striped,
|
14745 | animated,
|
14746 | bsPrefix,
|
14747 | variant
|
14748 | }, ref)
|
14749 | }, void 0, false, {
|
14750 | fileName: ProgressBar_jsxFileName,
|
14751 | lineNumber: 208,
|
14752 | columnNumber: 7
|
14753 | }, undefined);
|
14754 | });
|
14755 | ProgressBar.displayName = 'ProgressBar';
|
14756 | ProgressBar.propTypes = ProgressBar_propTypes;
|
14757 | const src_ProgressBar = (ProgressBar);
|
14758 | ;
|
14759 | var Ratio_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Ratio.tsx";
|
14760 |
|
14761 |
|
14762 |
|
14763 |
|
14764 |
|
14765 | const Ratio_propTypes = {
|
14766 | |
14767 |
|
14768 |
|
14769 | bsPrefix: (prop_types_default()).string,
|
14770 | |
14771 |
|
14772 |
|
14773 | children: (prop_types_default()).element.isRequired,
|
14774 | |
14775 |
|
14776 |
|
14777 |
|
14778 | aspectRatio: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string])
|
14779 | };
|
14780 | function toPercent(num) {
|
14781 | if (num <= 0) return '100%';
|
14782 | if (num < 1) return `${num * 100}%`;
|
14783 | return `${num}%`;
|
14784 | }
|
14785 | const Ratio = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14786 | bsPrefix,
|
14787 | className,
|
14788 | children,
|
14789 | aspectRatio = '1x1',
|
14790 | style,
|
14791 | ...props
|
14792 | }, ref) => {
|
14793 | bsPrefix = useBootstrapPrefix(bsPrefix, 'ratio');
|
14794 | const isCustomRatio = typeof aspectRatio === 'number';
|
14795 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
14796 | ref: ref,
|
14797 | ...props,
|
14798 | style: {
|
14799 | ...style,
|
14800 | ...(isCustomRatio && {
|
14801 | '--bs-aspect-ratio': toPercent(aspectRatio)
|
14802 | })
|
14803 | },
|
14804 | className: classnames_default()(bsPrefix, className, !isCustomRatio && `${bsPrefix}-${aspectRatio}`),
|
14805 | children: external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.only(children)
|
14806 | }, void 0, false, {
|
14807 | fileName: Ratio_jsxFileName,
|
14808 | lineNumber: 50,
|
14809 | columnNumber: 7
|
14810 | }, undefined);
|
14811 | });
|
14812 | Ratio.propTypes = Ratio_propTypes;
|
14813 | const src_Ratio = (Ratio);
|
14814 | ;
|
14815 | var Row_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Row.tsx";
|
14816 |
|
14817 |
|
14818 |
|
14819 |
|
14820 |
|
14821 | const rowColWidth = prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]);
|
14822 | const rowColumns = prop_types_default().oneOfType([rowColWidth, prop_types_default().shape({
|
14823 | cols: rowColWidth
|
14824 | })]);
|
14825 | const Row_propTypes = {
|
14826 | |
14827 |
|
14828 |
|
14829 | bsPrefix: (prop_types_default()).string,
|
14830 | as: (prop_types_default()).elementType,
|
14831 | |
14832 |
|
14833 |
|
14834 |
|
14835 |
|
14836 |
|
14837 | xs: rowColumns,
|
14838 | |
14839 |
|
14840 |
|
14841 |
|
14842 |
|
14843 |
|
14844 | sm: rowColumns,
|
14845 | |
14846 |
|
14847 |
|
14848 |
|
14849 |
|
14850 |
|
14851 | md: rowColumns,
|
14852 | |
14853 |
|
14854 |
|
14855 |
|
14856 |
|
14857 |
|
14858 | lg: rowColumns,
|
14859 | |
14860 |
|
14861 |
|
14862 |
|
14863 |
|
14864 |
|
14865 | xl: rowColumns,
|
14866 | |
14867 |
|
14868 |
|
14869 |
|
14870 |
|
14871 |
|
14872 | xxl: rowColumns
|
14873 | };
|
14874 | const Row = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14875 | bsPrefix,
|
14876 | className,
|
14877 |
|
14878 | as: Component = 'div',
|
14879 | ...props
|
14880 | }, ref) => {
|
14881 | const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'row');
|
14882 | const breakpoints = useBootstrapBreakpoints();
|
14883 | const minBreakpoint = useBootstrapMinBreakpoint();
|
14884 | const sizePrefix = `${decoratedBsPrefix}-cols`;
|
14885 | const classes = [];
|
14886 | breakpoints.forEach(brkPoint => {
|
14887 | const propValue = props[brkPoint];
|
14888 | delete props[brkPoint];
|
14889 | let cols;
|
14890 | if (propValue != null && typeof propValue === 'object') {
|
14891 | ({
|
14892 | cols
|
14893 | } = propValue);
|
14894 | } else {
|
14895 | cols = propValue;
|
14896 | }
|
14897 | const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
14898 | if (cols != null) classes.push(`${sizePrefix}${infix}-${cols}`);
|
14899 | });
|
14900 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
14901 | ref: ref,
|
14902 | ...props,
|
14903 | className: classnames_default()(className, decoratedBsPrefix, ...classes)
|
14904 | }, void 0, false, {
|
14905 | fileName: Row_jsxFileName,
|
14906 | lineNumber: 146,
|
14907 | columnNumber: 7
|
14908 | }, undefined);
|
14909 | });
|
14910 | Row.displayName = 'Row';
|
14911 | Row.propTypes = Row_propTypes;
|
14912 | const src_Row = (Row);
|
14913 | ;
|
14914 | var Spinner_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Spinner.tsx";
|
14915 |
|
14916 |
|
14917 |
|
14918 |
|
14919 |
|
14920 | const Spinner_propTypes = {
|
14921 | |
14922 |
|
14923 |
|
14924 | bsPrefix: (prop_types_default()).string,
|
14925 | |
14926 |
|
14927 |
|
14928 |
|
14929 |
|
14930 | variant: (prop_types_default()).string,
|
14931 | |
14932 |
|
14933 |
|
14934 |
|
14935 |
|
14936 |
|
14937 | animation: prop_types_default().oneOf(['border', 'grow']).isRequired,
|
14938 | |
14939 |
|
14940 |
|
14941 |
|
14942 |
|
14943 | size: (prop_types_default()).string,
|
14944 | |
14945 |
|
14946 |
|
14947 | children: (prop_types_default()).element,
|
14948 | |
14949 |
|
14950 |
|
14951 | role: (prop_types_default()).string,
|
14952 | |
14953 |
|
14954 |
|
14955 | as: (prop_types_default()).elementType
|
14956 | };
|
14957 | const Spinner = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
14958 | bsPrefix,
|
14959 | variant,
|
14960 | animation = 'border',
|
14961 | size,
|
14962 |
|
14963 | as: Component = 'div',
|
14964 | className,
|
14965 | ...props
|
14966 | }, ref) => {
|
14967 | bsPrefix = useBootstrapPrefix(bsPrefix, 'spinner');
|
14968 | const bsSpinnerPrefix = `${bsPrefix}-${animation}`;
|
14969 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
14970 | ref: ref,
|
14971 | ...props,
|
14972 | className: classnames_default()(className, bsSpinnerPrefix, size && `${bsSpinnerPrefix}-${size}`, variant && `text-${variant}`)
|
14973 | }, void 0, false, {
|
14974 | fileName: Spinner_jsxFileName,
|
14975 | lineNumber: 79,
|
14976 | columnNumber: 9
|
14977 | }, undefined);
|
14978 | });
|
14979 | Spinner.propTypes = Spinner_propTypes;
|
14980 | Spinner.displayName = 'Spinner';
|
14981 | const src_Spinner = (Spinner);
|
14982 | ;
|
14983 | var SplitButton_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/SplitButton.tsx";
|
14984 |
|
14985 |
|
14986 |
|
14987 |
|
14988 |
|
14989 |
|
14990 |
|
14991 | const SplitButton_propTypes = {
|
14992 | |
14993 |
|
14994 |
|
14995 |
|
14996 |
|
14997 | id: (prop_types_default()).string,
|
14998 | |
14999 |
|
15000 |
|
15001 | toggleLabel: (prop_types_default()).string,
|
15002 |
|
15003 | href: (prop_types_default()).string,
|
15004 |
|
15005 | target: (prop_types_default()).string,
|
15006 |
|
15007 | onClick: (prop_types_default()).func,
|
15008 |
|
15009 | title: (prop_types_default()).node.isRequired,
|
15010 |
|
15011 | type: (prop_types_default()).string,
|
15012 |
|
15013 | disabled: (prop_types_default()).bool,
|
15014 | |
15015 |
|
15016 |
|
15017 |
|
15018 |
|
15019 |
|
15020 |
|
15021 | align: alignPropType,
|
15022 |
|
15023 | menuRole: (prop_types_default()).string,
|
15024 |
|
15025 | renderMenuOnMount: (prop_types_default()).bool,
|
15026 | |
15027 |
|
15028 |
|
15029 |
|
15030 |
|
15031 | rootCloseEvent: (prop_types_default()).string,
|
15032 | |
15033 |
|
15034 |
|
15035 |
|
15036 |
|
15037 | flip: (prop_types_default()).bool,
|
15038 |
|
15039 | bsPrefix: (prop_types_default()).string,
|
15040 |
|
15041 | variant: (prop_types_default()).string,
|
15042 |
|
15043 | size: (prop_types_default()).string
|
15044 | };
|
15045 |
|
15046 |
|
15047 |
|
15048 |
|
15049 |
|
15050 |
|
15051 |
|
15052 |
|
15053 |
|
15054 |
|
15055 |
|
15056 | const SplitButton = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
15057 | id,
|
15058 | bsPrefix,
|
15059 | size,
|
15060 | variant,
|
15061 | title,
|
15062 | type = 'button',
|
15063 | toggleLabel = 'Toggle dropdown',
|
15064 | children,
|
15065 | onClick,
|
15066 | href,
|
15067 | target,
|
15068 | menuRole,
|
15069 | renderMenuOnMount,
|
15070 | rootCloseEvent,
|
15071 | flip,
|
15072 | ...props
|
15073 | }, ref) => (0,jsx_dev_runtime.jsxDEV)(src_Dropdown, {
|
15074 | ref: ref,
|
15075 | ...props,
|
15076 | as: src_ButtonGroup,
|
15077 | children: [(0,jsx_dev_runtime.jsxDEV)(src_Button, {
|
15078 | size: size,
|
15079 | variant: variant,
|
15080 | disabled: props.disabled,
|
15081 | bsPrefix: bsPrefix,
|
15082 | href: href,
|
15083 | target: target,
|
15084 | onClick: onClick,
|
15085 | type: type,
|
15086 | children: title
|
15087 | }, void 0, false, {
|
15088 | fileName: SplitButton_jsxFileName,
|
15089 | lineNumber: 126,
|
15090 | columnNumber: 7
|
15091 | }, undefined), (0,jsx_dev_runtime.jsxDEV)(src_Dropdown.Toggle, {
|
15092 | split: true,
|
15093 | id: id,
|
15094 | size: size,
|
15095 | variant: variant,
|
15096 | disabled: props.disabled,
|
15097 | childBsPrefix: bsPrefix,
|
15098 | children: (0,jsx_dev_runtime.jsxDEV)("span", {
|
15099 | className: "visually-hidden",
|
15100 | children: toggleLabel
|
15101 | }, void 0, false, {
|
15102 | fileName: SplitButton_jsxFileName,
|
15103 | lineNumber: 146,
|
15104 | columnNumber: 9
|
15105 | }, undefined)
|
15106 | }, void 0, false, {
|
15107 | fileName: SplitButton_jsxFileName,
|
15108 | lineNumber: 138,
|
15109 | columnNumber: 7
|
15110 | }, undefined), (0,jsx_dev_runtime.jsxDEV)(src_Dropdown.Menu, {
|
15111 | role: menuRole,
|
15112 | renderOnMount: renderMenuOnMount,
|
15113 | rootCloseEvent: rootCloseEvent,
|
15114 | flip: flip,
|
15115 | children: children
|
15116 | }, void 0, false, {
|
15117 | fileName: SplitButton_jsxFileName,
|
15118 | lineNumber: 149,
|
15119 | columnNumber: 7
|
15120 | }, undefined)]
|
15121 | }, void 0, true, {
|
15122 | fileName: SplitButton_jsxFileName,
|
15123 | lineNumber: 125,
|
15124 | columnNumber: 5
|
15125 | }, undefined));
|
15126 | SplitButton.propTypes = SplitButton_propTypes;
|
15127 | SplitButton.displayName = 'SplitButton';
|
15128 | const src_SplitButton = (SplitButton);
|
15129 | ;
|
15130 |
|
15131 | const SSRProvider = ($704cf1d3b684cc5c$export$9f8ac96af4b1b2ae);
|
15132 | ;
|
15133 |
|
15134 |
|
15135 | function responsivePropType(propType) {
|
15136 | return prop_types_default().oneOfType([propType, prop_types_default().shape({
|
15137 | xs: propType,
|
15138 | sm: propType,
|
15139 | md: propType,
|
15140 | lg: propType,
|
15141 | xl: propType,
|
15142 | xxl: propType
|
15143 | })]);
|
15144 | }
|
15145 | function createUtilityClassName(utilityValues, breakpoints = DEFAULT_BREAKPOINTS, minBreakpoint = DEFAULT_MIN_BREAKPOINT) {
|
15146 | const classes = [];
|
15147 | Object.entries(utilityValues).forEach(([utilName, utilValue]) => {
|
15148 | if (utilValue != null) {
|
15149 | if (typeof utilValue === 'object') {
|
15150 | breakpoints.forEach(brkPoint => {
|
15151 | const bpValue = utilValue[brkPoint];
|
15152 | if (bpValue != null) {
|
15153 | const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';
|
15154 | classes.push(`${utilName}${infix}-${bpValue}`);
|
15155 | }
|
15156 | });
|
15157 | } else {
|
15158 | classes.push(`${utilName}-${utilValue}`);
|
15159 | }
|
15160 | }
|
15161 | });
|
15162 | return classes;
|
15163 | }
|
15164 | ;
|
15165 | var Stack_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Stack.tsx";
|
15166 |
|
15167 |
|
15168 |
|
15169 |
|
15170 |
|
15171 |
|
15172 | const Stack_propTypes = {
|
15173 | |
15174 |
|
15175 |
|
15176 |
|
15177 |
|
15178 |
|
15179 |
|
15180 |
|
15181 |
|
15182 | bsPrefix: (prop_types_default()).string,
|
15183 | |
15184 |
|
15185 |
|
15186 | gap: responsivePropType((prop_types_default()).number)
|
15187 | };
|
15188 | const Stack = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
15189 | as: Component = 'div',
|
15190 | bsPrefix,
|
15191 | className,
|
15192 | direction,
|
15193 | gap,
|
15194 | ...props
|
15195 | }, ref) => {
|
15196 | bsPrefix = useBootstrapPrefix(bsPrefix, direction === 'horizontal' ? 'hstack' : 'vstack');
|
15197 | const breakpoints = useBootstrapBreakpoints();
|
15198 | const minBreakpoint = useBootstrapMinBreakpoint();
|
15199 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
15200 | ...props,
|
15201 | ref: ref,
|
15202 | className: classnames_default()(className, bsPrefix, ...createUtilityClassName({
|
15203 | gap
|
15204 | }, breakpoints, minBreakpoint))
|
15205 | }, void 0, false, {
|
15206 | fileName: Stack_jsxFileName,
|
15207 | lineNumber: 57,
|
15208 | columnNumber: 9
|
15209 | }, undefined);
|
15210 | });
|
15211 | Stack.displayName = 'Stack';
|
15212 | Stack.propTypes = Stack_propTypes;
|
15213 | const src_Stack = (Stack);
|
15214 | ;
|
15215 | const TabPanel_excluded = ["active", "eventKey", "mountOnEnter", "transition", "unmountOnExit", "role", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited"],
|
15216 | _excluded2 = ["activeKey", "getControlledId", "getControllerId"],
|
15217 | _excluded3 = ["as"];
|
15218 | function TabPanel_objectWithoutPropertiesLoose(source, excluded) {
|
15219 | if (source == null) return {};
|
15220 | var target = {};
|
15221 | var sourceKeys = Object.keys(source);
|
15222 | var key, i;
|
15223 | for (i = 0; i < sourceKeys.length; i++) {
|
15224 | key = sourceKeys[i];
|
15225 | if (excluded.indexOf(key) >= 0) continue;
|
15226 | target[key] = source[key];
|
15227 | }
|
15228 | return target;
|
15229 | }
|
15230 |
|
15231 |
|
15232 |
|
15233 |
|
15234 |
|
15235 |
|
15236 | function useTabPanel(_ref) {
|
15237 | let {
|
15238 | active,
|
15239 | eventKey,
|
15240 | mountOnEnter,
|
15241 | transition,
|
15242 | unmountOnExit,
|
15243 | role = 'tabpanel',
|
15244 | onEnter,
|
15245 | onEntering,
|
15246 | onEntered,
|
15247 | onExit,
|
15248 | onExiting,
|
15249 | onExited
|
15250 | } = _ref,
|
15251 | props = TabPanel_objectWithoutPropertiesLoose(_ref, TabPanel_excluded);
|
15252 | const context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(esm_TabContext);
|
15253 | if (!context) return [Object.assign({}, props, {
|
15254 | role
|
15255 | }), {
|
15256 | eventKey,
|
15257 | isActive: active,
|
15258 | mountOnEnter,
|
15259 | transition,
|
15260 | unmountOnExit,
|
15261 | onEnter,
|
15262 | onEntering,
|
15263 | onEntered,
|
15264 | onExit,
|
15265 | onExiting,
|
15266 | onExited
|
15267 | }];
|
15268 | const {
|
15269 | activeKey,
|
15270 | getControlledId,
|
15271 | getControllerId
|
15272 | } = context,
|
15273 | rest = TabPanel_objectWithoutPropertiesLoose(context, _excluded2);
|
15274 | const key = makeEventKey(eventKey);
|
15275 | return [Object.assign({}, props, {
|
15276 | role,
|
15277 | id: getControlledId(eventKey),
|
15278 | 'aria-labelledby': getControllerId(eventKey)
|
15279 | }), {
|
15280 | eventKey,
|
15281 | isActive: active == null && key != null ? makeEventKey(activeKey) === key : active,
|
15282 | transition: transition || rest.transition,
|
15283 | mountOnEnter: mountOnEnter != null ? mountOnEnter : rest.mountOnEnter,
|
15284 | unmountOnExit: unmountOnExit != null ? unmountOnExit : rest.unmountOnExit,
|
15285 | onEnter,
|
15286 | onEntering,
|
15287 | onEntered,
|
15288 | onExit,
|
15289 | onExiting,
|
15290 | onExited
|
15291 | }];
|
15292 | }
|
15293 | const TabPanel = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(
|
15294 |
|
15295 | (_ref2, ref) => {
|
15296 | let {
|
15297 | as: Component = 'div'
|
15298 | } = _ref2,
|
15299 | props = TabPanel_objectWithoutPropertiesLoose(_ref2, _excluded3);
|
15300 | const [tabPanelProps, {
|
15301 | isActive,
|
15302 | onEnter,
|
15303 | onEntering,
|
15304 | onEntered,
|
15305 | onExit,
|
15306 | onExiting,
|
15307 | onExited,
|
15308 | mountOnEnter,
|
15309 | unmountOnExit,
|
15310 | transition: Transition = esm_NoopTransition
|
15311 | }] = useTabPanel(props);
|
15312 |
|
15313 |
|
15314 | return (0,jsx_runtime.jsx)(esm_TabContext.Provider, {
|
15315 | value: null,
|
15316 | children: (0,jsx_runtime.jsx)(esm_SelectableContext.Provider, {
|
15317 | value: null,
|
15318 | children: (0,jsx_runtime.jsx)(Transition, {
|
15319 | in: isActive,
|
15320 | onEnter: onEnter,
|
15321 | onEntering: onEntering,
|
15322 | onEntered: onEntered,
|
15323 | onExit: onExit,
|
15324 | onExiting: onExiting,
|
15325 | onExited: onExited,
|
15326 | mountOnEnter: mountOnEnter,
|
15327 | unmountOnExit: unmountOnExit,
|
15328 | children: (0,jsx_runtime.jsx)(Component, Object.assign({}, tabPanelProps, {
|
15329 | ref: ref,
|
15330 | hidden: !isActive,
|
15331 | "aria-hidden": !isActive
|
15332 | }))
|
15333 | })
|
15334 | })
|
15335 | });
|
15336 | });
|
15337 | TabPanel.displayName = 'TabPanel';
|
15338 | const esm_TabPanel = (TabPanel);
|
15339 | ;
|
15340 |
|
15341 |
|
15342 |
|
15343 |
|
15344 |
|
15345 |
|
15346 |
|
15347 |
|
15348 | const Tabs = props => {
|
15349 | const {
|
15350 | id: userId,
|
15351 | generateChildId: generateCustomChildId,
|
15352 | onSelect: propsOnSelect,
|
15353 | activeKey: propsActiveKey,
|
15354 | defaultActiveKey,
|
15355 | transition,
|
15356 | mountOnEnter,
|
15357 | unmountOnExit,
|
15358 | children
|
15359 | } = props;
|
15360 | const [activeKey, onSelect] = esm_useUncontrolledProp(propsActiveKey, defaultActiveKey, propsOnSelect);
|
15361 | const id = $704cf1d3b684cc5c$export$619500959fc48b26(userId);
|
15362 | const generateChildId = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => generateCustomChildId || ((key, type) => id ? `${id}-${type}-${key}` : null), [id, generateCustomChildId]);
|
15363 | const tabContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
15364 | onSelect,
|
15365 | activeKey,
|
15366 | transition,
|
15367 | mountOnEnter: mountOnEnter || false,
|
15368 | unmountOnExit: unmountOnExit || false,
|
15369 | getControlledId: key => generateChildId(key, 'tabpane'),
|
15370 | getControllerId: key => generateChildId(key, 'tab')
|
15371 | }), [onSelect, activeKey, transition, mountOnEnter, unmountOnExit, generateChildId]);
|
15372 | return (0,jsx_runtime.jsx)(esm_TabContext.Provider, {
|
15373 | value: tabContext,
|
15374 | children: (0,jsx_runtime.jsx)(esm_SelectableContext.Provider, {
|
15375 | value: onSelect || null,
|
15376 | children: children
|
15377 | })
|
15378 | });
|
15379 | };
|
15380 | Tabs.Panel = esm_TabPanel;
|
15381 | const esm_Tabs = (Tabs);
|
15382 | ;
|
15383 |
|
15384 |
|
15385 | function getTabTransitionComponent(transition) {
|
15386 | if (typeof transition === 'boolean') {
|
15387 | return transition ? src_Fade : esm_NoopTransition;
|
15388 | }
|
15389 | return transition;
|
15390 | }
|
15391 | ;
|
15392 | var TabContainer_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/TabContainer.tsx";
|
15393 |
|
15394 |
|
15395 |
|
15396 |
|
15397 |
|
15398 | const TabContainer_propTypes = {
|
15399 | |
15400 |
|
15401 |
|
15402 |
|
15403 |
|
15404 |
|
15405 | id: (prop_types_default()).string,
|
15406 | |
15407 |
|
15408 |
|
15409 |
|
15410 |
|
15411 |
|
15412 |
|
15413 |
|
15414 | transition: prop_types_default().oneOfType([prop_types_default().oneOf([false]), (prop_types_default()).elementType]),
|
15415 | |
15416 |
|
15417 |
|
15418 | mountOnEnter: (prop_types_default()).bool,
|
15419 | |
15420 |
|
15421 |
|
15422 | unmountOnExit: (prop_types_default()).bool,
|
15423 | |
15424 |
|
15425 |
|
15426 |
|
15427 |
|
15428 |
|
15429 |
|
15430 |
|
15431 |
|
15432 |
|
15433 |
|
15434 | generateChildId: (prop_types_default()).func,
|
15435 | |
15436 |
|
15437 |
|
15438 |
|
15439 |
|
15440 | onSelect: (prop_types_default()).func,
|
15441 | |
15442 |
|
15443 |
|
15444 |
|
15445 |
|
15446 | activeKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number])
|
15447 | };
|
15448 | const TabContainer = ({
|
15449 | transition,
|
15450 | ...props
|
15451 | }) => (0,jsx_dev_runtime.jsxDEV)(esm_Tabs, {
|
15452 | ...props,
|
15453 | transition: getTabTransitionComponent(transition)
|
15454 | }, void 0, false, {
|
15455 | fileName: TabContainer_jsxFileName,
|
15456 | lineNumber: 71,
|
15457 | columnNumber: 3
|
15458 | }, undefined);
|
15459 | TabContainer.propTypes = TabContainer_propTypes;
|
15460 | TabContainer.displayName = 'TabContainer';
|
15461 | const src_TabContainer = (TabContainer);
|
15462 | ;
|
15463 | var TabContent_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/TabContent.tsx";
|
15464 |
|
15465 |
|
15466 |
|
15467 |
|
15468 | const TabContent = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
15469 | className,
|
15470 | bsPrefix,
|
15471 | as: Component = 'div',
|
15472 | ...props
|
15473 | }, ref) => {
|
15474 | bsPrefix = useBootstrapPrefix(bsPrefix, 'tab-content');
|
15475 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
15476 | ref: ref,
|
15477 | className: classnames_default()(className, bsPrefix),
|
15478 | ...props
|
15479 | }, void 0, false, {
|
15480 | fileName: TabContent_jsxFileName,
|
15481 | lineNumber: 15,
|
15482 | columnNumber: 9
|
15483 | }, undefined);
|
15484 | });
|
15485 | TabContent.displayName = 'TabContent';
|
15486 | const src_TabContent = (TabContent);
|
15487 | ;
|
15488 | var TabPane_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/TabPane.tsx";
|
15489 |
|
15490 |
|
15491 |
|
15492 |
|
15493 |
|
15494 |
|
15495 |
|
15496 |
|
15497 |
|
15498 |
|
15499 | const TabPane_propTypes = {
|
15500 | |
15501 |
|
15502 |
|
15503 | bsPrefix: (prop_types_default()).string,
|
15504 | as: (prop_types_default()).elementType,
|
15505 | |
15506 |
|
15507 |
|
15508 | eventKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
15509 | |
15510 |
|
15511 |
|
15512 |
|
15513 | active: (prop_types_default()).bool,
|
15514 | |
15515 |
|
15516 |
|
15517 |
|
15518 |
|
15519 | transition: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).elementType]),
|
15520 | |
15521 |
|
15522 |
|
15523 | onEnter: (prop_types_default()).func,
|
15524 | |
15525 |
|
15526 |
|
15527 | onEntering: (prop_types_default()).func,
|
15528 | |
15529 |
|
15530 |
|
15531 | onEntered: (prop_types_default()).func,
|
15532 | |
15533 |
|
15534 |
|
15535 | onExit: (prop_types_default()).func,
|
15536 | |
15537 |
|
15538 |
|
15539 | onExiting: (prop_types_default()).func,
|
15540 | |
15541 |
|
15542 |
|
15543 | onExited: (prop_types_default()).func,
|
15544 | |
15545 |
|
15546 |
|
15547 | mountOnEnter: (prop_types_default()).bool,
|
15548 | |
15549 |
|
15550 |
|
15551 | unmountOnExit: (prop_types_default()).bool,
|
15552 |
|
15553 | id: (prop_types_default()).string,
|
15554 |
|
15555 | 'aria-labelledby': (prop_types_default()).string
|
15556 | };
|
15557 | const TabPane = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
15558 | bsPrefix,
|
15559 | transition,
|
15560 | ...props
|
15561 | }, ref) => {
|
15562 | const [{
|
15563 | className,
|
15564 |
|
15565 | as: Component = 'div',
|
15566 | ...rest
|
15567 | }, {
|
15568 | isActive,
|
15569 | onEnter,
|
15570 | onEntering,
|
15571 | onEntered,
|
15572 | onExit,
|
15573 | onExiting,
|
15574 | onExited,
|
15575 | mountOnEnter,
|
15576 | unmountOnExit,
|
15577 | transition: Transition = src_Fade
|
15578 | }] = useTabPanel({
|
15579 | ...props,
|
15580 | transition: getTabTransitionComponent(transition)
|
15581 | });
|
15582 | const prefix = useBootstrapPrefix(bsPrefix, 'tab-pane');
|
15583 |
|
15584 |
|
15585 |
|
15586 | return (0,jsx_dev_runtime.jsxDEV)(esm_TabContext.Provider, {
|
15587 | value: null,
|
15588 | children: (0,jsx_dev_runtime.jsxDEV)(esm_SelectableContext.Provider, {
|
15589 | value: null,
|
15590 | children: (0,jsx_dev_runtime.jsxDEV)(Transition, {
|
15591 | in: isActive,
|
15592 | onEnter: onEnter,
|
15593 | onEntering: onEntering,
|
15594 | onEntered: onEntered,
|
15595 | onExit: onExit,
|
15596 | onExiting: onExiting,
|
15597 | onExited: onExited,
|
15598 | mountOnEnter: mountOnEnter,
|
15599 | unmountOnExit: unmountOnExit,
|
15600 | children: (0,jsx_dev_runtime.jsxDEV)(Component, {
|
15601 | ...rest,
|
15602 | ref: ref,
|
15603 | className: classnames_default()(className, prefix, isActive && 'active')
|
15604 | }, void 0, false, {
|
15605 | fileName: TabPane_jsxFileName,
|
15606 | lineNumber: 146,
|
15607 | columnNumber: 15
|
15608 | }, undefined)
|
15609 | }, void 0, false, {
|
15610 | fileName: TabPane_jsxFileName,
|
15611 | lineNumber: 135,
|
15612 | columnNumber: 13
|
15613 | }, undefined)
|
15614 | }, void 0, false, {
|
15615 | fileName: TabPane_jsxFileName,
|
15616 | lineNumber: 134,
|
15617 | columnNumber: 11
|
15618 | }, undefined)
|
15619 | }, void 0, false, {
|
15620 | fileName: TabPane_jsxFileName,
|
15621 | lineNumber: 133,
|
15622 | columnNumber: 9
|
15623 | }, undefined);
|
15624 | });
|
15625 | TabPane.displayName = 'TabPane';
|
15626 | TabPane.propTypes = TabPane_propTypes;
|
15627 | const src_TabPane = (TabPane);
|
15628 | ;
|
15629 |
|
15630 |
|
15631 |
|
15632 |
|
15633 |
|
15634 | const Tab_propTypes = {
|
15635 | eventKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
15636 | |
15637 |
|
15638 |
|
15639 | title: (prop_types_default()).node.isRequired,
|
15640 | |
15641 |
|
15642 |
|
15643 | disabled: (prop_types_default()).bool,
|
15644 | |
15645 |
|
15646 |
|
15647 | tabClassName: (prop_types_default()).string,
|
15648 | |
15649 |
|
15650 |
|
15651 | tabAttrs: (prop_types_default()).object
|
15652 | };
|
15653 | const Tab = () => {
|
15654 | throw new Error('ReactBootstrap: The `Tab` component is not meant to be rendered! ' + "It's an abstract component that is only valid as a direct Child of the `Tabs` Component. " + 'For custom tabs components use TabPane and TabsContainer directly');
|
15655 | };
|
15656 | Tab.propTypes = Tab_propTypes;
|
15657 | const src_Tab = (Object.assign(Tab, {
|
15658 | Container: src_TabContainer,
|
15659 | Content: src_TabContent,
|
15660 | Pane: src_TabPane
|
15661 | }));
|
15662 | ;
|
15663 | var Table_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Table.tsx";
|
15664 |
|
15665 |
|
15666 |
|
15667 |
|
15668 |
|
15669 | const Table_propTypes = {
|
15670 | |
15671 |
|
15672 |
|
15673 | bsPrefix: (prop_types_default()).string,
|
15674 | |
15675 |
|
15676 |
|
15677 |
|
15678 | striped: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).string]),
|
15679 | |
15680 |
|
15681 |
|
15682 | bordered: (prop_types_default()).bool,
|
15683 | |
15684 |
|
15685 |
|
15686 | borderless: (prop_types_default()).bool,
|
15687 | |
15688 |
|
15689 |
|
15690 | hover: (prop_types_default()).bool,
|
15691 | |
15692 |
|
15693 |
|
15694 |
|
15695 | size: (prop_types_default()).string,
|
15696 | |
15697 |
|
15698 |
|
15699 |
|
15700 | variant: (prop_types_default()).string,
|
15701 | |
15702 |
|
15703 |
|
15704 |
|
15705 |
|
15706 |
|
15707 |
|
15708 |
|
15709 |
|
15710 | responsive: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).string])
|
15711 | };
|
15712 | const Table = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
15713 | bsPrefix,
|
15714 | className,
|
15715 | striped,
|
15716 | bordered,
|
15717 | borderless,
|
15718 | hover,
|
15719 | size,
|
15720 | variant,
|
15721 | responsive,
|
15722 | ...props
|
15723 | }, ref) => {
|
15724 | const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'table');
|
15725 | const classes = classnames_default()(className, decoratedBsPrefix, variant && `${decoratedBsPrefix}-${variant}`, size && `${decoratedBsPrefix}-${size}`, striped && `${decoratedBsPrefix}-${typeof striped === 'string' ? `striped-${striped}` : 'striped'}`, bordered && `${decoratedBsPrefix}-bordered`, borderless && `${decoratedBsPrefix}-borderless`, hover && `${decoratedBsPrefix}-hover`);
|
15726 | const table = (0,jsx_dev_runtime.jsxDEV)("table", {
|
15727 | ...props,
|
15728 | className: classes,
|
15729 | ref: ref
|
15730 | }, void 0, false, {
|
15731 | fileName: Table_jsxFileName,
|
15732 | lineNumber: 103,
|
15733 | columnNumber: 19
|
15734 | }, undefined);
|
15735 | if (responsive) {
|
15736 | let responsiveClass = `${decoratedBsPrefix}-responsive`;
|
15737 | if (typeof responsive === 'string') {
|
15738 | responsiveClass = `${responsiveClass}-${responsive}`;
|
15739 | }
|
15740 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
15741 | className: responsiveClass,
|
15742 | children: table
|
15743 | }, void 0, false, {
|
15744 | fileName: Table_jsxFileName,
|
15745 | lineNumber: 110,
|
15746 | columnNumber: 14
|
15747 | }, undefined);
|
15748 | }
|
15749 | return table;
|
15750 | });
|
15751 | Table.propTypes = Table_propTypes;
|
15752 | const src_Table = (Table);
|
15753 | ;
|
15754 | var Tabs_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Tabs.tsx";
|
15755 |
|
15756 |
|
15757 |
|
15758 |
|
15759 |
|
15760 |
|
15761 |
|
15762 |
|
15763 |
|
15764 |
|
15765 |
|
15766 |
|
15767 | const Tabs_propTypes = {
|
15768 | |
15769 |
|
15770 |
|
15771 |
|
15772 |
|
15773 | activeKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
15774 |
|
15775 | defaultActiveKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
|
15776 | |
15777 |
|
15778 |
|
15779 |
|
15780 |
|
15781 | variant: (prop_types_default()).string,
|
15782 | |
15783 |
|
15784 |
|
15785 |
|
15786 |
|
15787 |
|
15788 |
|
15789 |
|
15790 |
|
15791 | transition: prop_types_default().oneOfType([prop_types_default().oneOf([false]), (prop_types_default()).elementType]),
|
15792 | |
15793 |
|
15794 |
|
15795 |
|
15796 |
|
15797 |
|
15798 | id: (prop_types_default()).string,
|
15799 | |
15800 |
|
15801 |
|
15802 |
|
15803 |
|
15804 |
|
15805 |
|
15806 |
|
15807 |
|
15808 |
|
15809 |
|
15810 |
|
15811 | onSelect: (prop_types_default()).func,
|
15812 | |
15813 |
|
15814 |
|
15815 | mountOnEnter: (prop_types_default()).bool,
|
15816 | |
15817 |
|
15818 |
|
15819 | unmountOnExit: (prop_types_default()).bool,
|
15820 | |
15821 |
|
15822 |
|
15823 | fill: (prop_types_default()).bool,
|
15824 | |
15825 |
|
15826 |
|
15827 | justify: (prop_types_default()).bool
|
15828 | };
|
15829 | function getDefaultActiveKey(children) {
|
15830 | let defaultActiveKey;
|
15831 | forEach(children, child => {
|
15832 | if (defaultActiveKey == null) {
|
15833 | defaultActiveKey = child.props.eventKey;
|
15834 | }
|
15835 | });
|
15836 | return defaultActiveKey;
|
15837 | }
|
15838 | function renderTab(child) {
|
15839 | const {
|
15840 | title,
|
15841 | eventKey,
|
15842 | disabled,
|
15843 | tabClassName,
|
15844 | tabAttrs,
|
15845 | id
|
15846 | } = child.props;
|
15847 | if (title == null) {
|
15848 | return null;
|
15849 | }
|
15850 | return (0,jsx_dev_runtime.jsxDEV)(src_NavItem, {
|
15851 | as: "li",
|
15852 | role: "presentation",
|
15853 | children: (0,jsx_dev_runtime.jsxDEV)(src_NavLink, {
|
15854 | as: "button",
|
15855 | type: "button",
|
15856 | eventKey: eventKey,
|
15857 | disabled: disabled,
|
15858 | id: id,
|
15859 | className: tabClassName,
|
15860 | ...tabAttrs,
|
15861 | children: title
|
15862 | }, void 0, false, {
|
15863 | fileName: Tabs_jsxFileName,
|
15864 | lineNumber: 116,
|
15865 | columnNumber: 7
|
15866 | }, this)
|
15867 | }, void 0, false, {
|
15868 | fileName: Tabs_jsxFileName,
|
15869 | lineNumber: 115,
|
15870 | columnNumber: 5
|
15871 | }, this);
|
15872 | }
|
15873 | const Tabs_Tabs = props => {
|
15874 | const {
|
15875 | id,
|
15876 | onSelect,
|
15877 | transition,
|
15878 | mountOnEnter = false,
|
15879 | unmountOnExit = false,
|
15880 | variant = 'tabs',
|
15881 | children,
|
15882 | activeKey = getDefaultActiveKey(children),
|
15883 | ...controlledProps
|
15884 | } = useUncontrolled(props, {
|
15885 | activeKey: 'onSelect'
|
15886 | });
|
15887 | return (0,jsx_dev_runtime.jsxDEV)(esm_Tabs, {
|
15888 | id: id,
|
15889 | activeKey: activeKey,
|
15890 | onSelect: onSelect,
|
15891 | transition: getTabTransitionComponent(transition),
|
15892 | mountOnEnter: mountOnEnter,
|
15893 | unmountOnExit: unmountOnExit,
|
15894 | children: [(0,jsx_dev_runtime.jsxDEV)(src_Nav, {
|
15895 | ...controlledProps,
|
15896 | role: "tablist",
|
15897 | as: "ul",
|
15898 | variant: variant,
|
15899 | children: map(children, renderTab)
|
15900 | }, void 0, false, {
|
15901 | fileName: Tabs_jsxFileName,
|
15902 | lineNumber: 155,
|
15903 | columnNumber: 7
|
15904 | }, undefined), (0,jsx_dev_runtime.jsxDEV)(src_TabContent, {
|
15905 | children: map(children, child => {
|
15906 | const childProps = {
|
15907 | ...child.props
|
15908 | };
|
15909 | delete childProps.title;
|
15910 | delete childProps.disabled;
|
15911 | delete childProps.tabClassName;
|
15912 | delete childProps.tabAttrs;
|
15913 | return (0,jsx_dev_runtime.jsxDEV)(src_TabPane, {
|
15914 | ...childProps
|
15915 | }, void 0, false, {
|
15916 | fileName: Tabs_jsxFileName,
|
15917 | lineNumber: 168,
|
15918 | columnNumber: 18
|
15919 | }, undefined);
|
15920 | })
|
15921 | }, void 0, false, {
|
15922 | fileName: Tabs_jsxFileName,
|
15923 | lineNumber: 159,
|
15924 | columnNumber: 7
|
15925 | }, undefined)]
|
15926 | }, void 0, true, {
|
15927 | fileName: Tabs_jsxFileName,
|
15928 | lineNumber: 147,
|
15929 | columnNumber: 5
|
15930 | }, undefined);
|
15931 | };
|
15932 | Tabs_Tabs.propTypes = Tabs_propTypes;
|
15933 | Tabs_Tabs.displayName = 'Tabs';
|
15934 | const src_Tabs = (Tabs_Tabs);
|
15935 | ;
|
15936 | var ToastFade_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ToastFade.tsx";
|
15937 |
|
15938 |
|
15939 |
|
15940 |
|
15941 | const ToastFade_fadeStyles = {
|
15942 | [ENTERING]: 'showing',
|
15943 | [EXITING]: 'showing show'
|
15944 | };
|
15945 | const ToastFade = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => (0,jsx_dev_runtime.jsxDEV)(src_Fade, {
|
15946 | ...props,
|
15947 | ref: ref,
|
15948 | transitionClasses: ToastFade_fadeStyles
|
15949 | }, void 0, false, {
|
15950 | fileName: ToastFade_jsxFileName,
|
15951 | lineNumber: 14,
|
15952 | columnNumber: 3
|
15953 | }, undefined));
|
15954 | ToastFade.displayName = 'ToastFade';
|
15955 | const src_ToastFade = (ToastFade);
|
15956 | ;
|
15957 |
|
15958 | const ToastContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
|
15959 |
|
15960 | onClose() {}
|
15961 | });
|
15962 | const src_ToastContext = (ToastContext);
|
15963 | ;
|
15964 | var ToastHeader_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ToastHeader.tsx";
|
15965 |
|
15966 |
|
15967 |
|
15968 |
|
15969 |
|
15970 |
|
15971 |
|
15972 |
|
15973 |
|
15974 | const ToastHeader_propTypes = {
|
15975 | bsPrefix: (prop_types_default()).string,
|
15976 | |
15977 |
|
15978 |
|
15979 |
|
15980 |
|
15981 | closeLabel: (prop_types_default()).string,
|
15982 | |
15983 |
|
15984 |
|
15985 | closeVariant: prop_types_default().oneOf(['white']),
|
15986 | |
15987 |
|
15988 |
|
15989 | closeButton: (prop_types_default()).bool
|
15990 | };
|
15991 | const ToastHeader = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
15992 | bsPrefix,
|
15993 | closeLabel = 'Close',
|
15994 | closeVariant,
|
15995 | closeButton = true,
|
15996 | className,
|
15997 | children,
|
15998 | ...props
|
15999 | }, ref) => {
|
16000 | bsPrefix = useBootstrapPrefix(bsPrefix, 'toast-header');
|
16001 | const context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(src_ToastContext);
|
16002 | const handleClick = useEventCallback(e => {
|
16003 | context == null ? void 0 : context.onClose == null ? void 0 : context.onClose(e);
|
16004 | });
|
16005 | return (0,jsx_dev_runtime.jsxDEV)("div", {
|
16006 | ref: ref,
|
16007 | ...props,
|
16008 | className: classnames_default()(bsPrefix, className),
|
16009 | children: [children, closeButton && (0,jsx_dev_runtime.jsxDEV)(src_CloseButton, {
|
16010 | "aria-label": closeLabel,
|
16011 | variant: closeVariant,
|
16012 | onClick: handleClick,
|
16013 | "data-dismiss": "toast"
|
16014 | }, void 0, false, {
|
16015 | fileName: ToastHeader_jsxFileName,
|
16016 | lineNumber: 67,
|
16017 | columnNumber: 11
|
16018 | }, undefined)]
|
16019 | }, void 0, true, {
|
16020 | fileName: ToastHeader_jsxFileName,
|
16021 | lineNumber: 63,
|
16022 | columnNumber: 7
|
16023 | }, undefined);
|
16024 | });
|
16025 | ToastHeader.displayName = 'ToastHeader';
|
16026 | ToastHeader.propTypes = ToastHeader_propTypes;
|
16027 | const src_ToastHeader = (ToastHeader);
|
16028 | ;
|
16029 | var ToastBody_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ToastBody.tsx";
|
16030 |
|
16031 |
|
16032 |
|
16033 |
|
16034 | const ToastBody = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
16035 | className,
|
16036 | bsPrefix,
|
16037 | as: Component = 'div',
|
16038 | ...props
|
16039 | }, ref) => {
|
16040 | bsPrefix = useBootstrapPrefix(bsPrefix, 'toast-body');
|
16041 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
16042 | ref: ref,
|
16043 | className: classnames_default()(className, bsPrefix),
|
16044 | ...props
|
16045 | }, void 0, false, {
|
16046 | fileName: ToastBody_jsxFileName,
|
16047 | lineNumber: 15,
|
16048 | columnNumber: 9
|
16049 | }, undefined);
|
16050 | });
|
16051 | ToastBody.displayName = 'ToastBody';
|
16052 | const src_ToastBody = (ToastBody);
|
16053 | ;
|
16054 | var Toast_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/Toast.tsx";
|
16055 |
|
16056 |
|
16057 |
|
16058 |
|
16059 |
|
16060 |
|
16061 |
|
16062 |
|
16063 |
|
16064 |
|
16065 |
|
16066 | const Toast_propTypes = {
|
16067 | |
16068 |
|
16069 |
|
16070 | bsPrefix: (prop_types_default()).string,
|
16071 | |
16072 |
|
16073 |
|
16074 | animation: (prop_types_default()).bool,
|
16075 | |
16076 |
|
16077 |
|
16078 | autohide: (prop_types_default()).bool,
|
16079 | |
16080 |
|
16081 |
|
16082 | delay: (prop_types_default()).number,
|
16083 | |
16084 |
|
16085 |
|
16086 | onClose: (prop_types_default()).func,
|
16087 | |
16088 |
|
16089 |
|
16090 | onEnter: (prop_types_default()).func,
|
16091 | |
16092 |
|
16093 |
|
16094 | onEntering: (prop_types_default()).func,
|
16095 | |
16096 |
|
16097 |
|
16098 | onEntered: (prop_types_default()).func,
|
16099 | |
16100 |
|
16101 |
|
16102 | onExit: (prop_types_default()).func,
|
16103 | |
16104 |
|
16105 |
|
16106 | onExiting: (prop_types_default()).func,
|
16107 | |
16108 |
|
16109 |
|
16110 | onExited: (prop_types_default()).func,
|
16111 | |
16112 |
|
16113 |
|
16114 | show: (prop_types_default()).bool,
|
16115 | |
16116 |
|
16117 |
|
16118 | transition: (prop_types_default()).elementType,
|
16119 | |
16120 |
|
16121 |
|
16122 |
|
16123 |
|
16124 | bg: (prop_types_default()).string
|
16125 | };
|
16126 | const Toast = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
16127 | bsPrefix,
|
16128 | className,
|
16129 | transition: Transition = src_ToastFade,
|
16130 | show = true,
|
16131 | animation = true,
|
16132 | delay = 5000,
|
16133 | autohide = false,
|
16134 | onClose,
|
16135 | onEntered,
|
16136 | onExit,
|
16137 | onExiting,
|
16138 | onEnter,
|
16139 | onEntering,
|
16140 | onExited,
|
16141 | bg,
|
16142 | ...props
|
16143 | }, ref) => {
|
16144 | bsPrefix = useBootstrapPrefix(bsPrefix, 'toast');
|
16145 |
|
16146 |
|
16147 |
|
16148 | const delayRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(delay);
|
16149 | const onCloseRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(onClose);
|
16150 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
16151 | delayRef.current = delay;
|
16152 | onCloseRef.current = onClose;
|
16153 | }, [delay, onClose]);
|
16154 | const autohideTimeout = useTimeout();
|
16155 | const autohideToast = !!(autohide && show);
|
16156 | const autohideFunc = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
|
16157 | if (autohideToast) {
|
16158 | onCloseRef.current == null ? void 0 : onCloseRef.current();
|
16159 | }
|
16160 | }, [autohideToast]);
|
16161 | (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
16162 |
|
16163 | autohideTimeout.set(autohideFunc, delayRef.current);
|
16164 | }, [autohideTimeout, autohideFunc]);
|
16165 | const toastContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
16166 | onClose
|
16167 | }), [onClose]);
|
16168 | const hasAnimation = !!(Transition && animation);
|
16169 | const toast = (0,jsx_dev_runtime.jsxDEV)("div", {
|
16170 | ...props,
|
16171 | ref: ref,
|
16172 | className: classnames_default()(bsPrefix, className, bg && `bg-${bg}`, !hasAnimation && (show ? 'show' : 'hide')),
|
16173 | role: "alert",
|
16174 | "aria-live": "assertive",
|
16175 | "aria-atomic": "true"
|
16176 | }, void 0, false, {
|
16177 | fileName: Toast_jsxFileName,
|
16178 | lineNumber: 163,
|
16179 | columnNumber: 9
|
16180 | }, undefined);
|
16181 | return (0,jsx_dev_runtime.jsxDEV)(src_ToastContext.Provider, {
|
16182 | value: toastContext,
|
16183 | children: hasAnimation && Transition ? (0,jsx_dev_runtime.jsxDEV)(Transition, {
|
16184 | in: show,
|
16185 | onEnter: onEnter,
|
16186 | onEntering: onEntering,
|
16187 | onEntered: onEntered,
|
16188 | onExit: onExit,
|
16189 | onExiting: onExiting,
|
16190 | onExited: onExited,
|
16191 | unmountOnExit: true,
|
16192 | children: toast
|
16193 | }, void 0, false, {
|
16194 | fileName: Toast_jsxFileName,
|
16195 | lineNumber: 181,
|
16196 | columnNumber: 13
|
16197 | }, undefined) : toast
|
16198 | }, void 0, false, {
|
16199 | fileName: Toast_jsxFileName,
|
16200 | lineNumber: 179,
|
16201 | columnNumber: 9
|
16202 | }, undefined);
|
16203 | });
|
16204 | Toast.propTypes = Toast_propTypes;
|
16205 | Toast.displayName = 'Toast';
|
16206 | const src_Toast = (Object.assign(Toast, {
|
16207 | Body: src_ToastBody,
|
16208 | Header: src_ToastHeader
|
16209 | }));
|
16210 | ;
|
16211 | var ToastContainer_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ToastContainer.tsx";
|
16212 |
|
16213 |
|
16214 |
|
16215 |
|
16216 |
|
16217 | const ToastContainer_propTypes = {
|
16218 | |
16219 |
|
16220 |
|
16221 | bsPrefix: (prop_types_default()).string,
|
16222 | |
16223 |
|
16224 |
|
16225 | position: prop_types_default().oneOf(['top-start', 'top-center', 'top-end', 'middle-start', 'middle-center', 'middle-end', 'bottom-start', 'bottom-center', 'bottom-end']),
|
16226 | |
16227 |
|
16228 |
|
16229 | containerPosition: (prop_types_default()).string
|
16230 | };
|
16231 | const positionClasses = {
|
16232 | 'top-start': 'top-0 start-0',
|
16233 | 'top-center': 'top-0 start-50 translate-middle-x',
|
16234 | 'top-end': 'top-0 end-0',
|
16235 | 'middle-start': 'top-50 start-0 translate-middle-y',
|
16236 | 'middle-center': 'top-50 start-50 translate-middle',
|
16237 | 'middle-end': 'top-50 end-0 translate-middle-y',
|
16238 | 'bottom-start': 'bottom-0 start-0',
|
16239 | 'bottom-center': 'bottom-0 start-50 translate-middle-x',
|
16240 | 'bottom-end': 'bottom-0 end-0'
|
16241 | };
|
16242 | const ToastContainer = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
16243 | bsPrefix,
|
16244 | position,
|
16245 | containerPosition,
|
16246 | className,
|
16247 |
|
16248 | as: Component = 'div',
|
16249 | ...props
|
16250 | }, ref) => {
|
16251 | bsPrefix = useBootstrapPrefix(bsPrefix, 'toast-container');
|
16252 | return (0,jsx_dev_runtime.jsxDEV)(Component, {
|
16253 | ref: ref,
|
16254 | ...props,
|
16255 | className: classnames_default()(bsPrefix, position && positionClasses[position], containerPosition && `position-${containerPosition}`, className)
|
16256 | }, void 0, false, {
|
16257 | fileName: ToastContainer_jsxFileName,
|
16258 | lineNumber: 83,
|
16259 | columnNumber: 7
|
16260 | }, undefined);
|
16261 | });
|
16262 | ToastContainer.displayName = 'ToastContainer';
|
16263 | ToastContainer.propTypes = ToastContainer_propTypes;
|
16264 | const src_ToastContainer = (ToastContainer);
|
16265 | ;
|
16266 | var ToggleButton_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ToggleButton.tsx";
|
16267 |
|
16268 |
|
16269 |
|
16270 |
|
16271 |
|
16272 |
|
16273 |
|
16274 | const ToggleButton_noop = () => undefined;
|
16275 | const ToggleButton_propTypes = {
|
16276 | |
16277 |
|
16278 |
|
16279 | bsPrefix: (prop_types_default()).string,
|
16280 | |
16281 |
|
16282 |
|
16283 | type: prop_types_default().oneOf(['checkbox', 'radio']),
|
16284 | |
16285 |
|
16286 |
|
16287 |
|
16288 | name: (prop_types_default()).string,
|
16289 | |
16290 |
|
16291 |
|
16292 | checked: (prop_types_default()).bool,
|
16293 | |
16294 |
|
16295 |
|
16296 | disabled: (prop_types_default()).bool,
|
16297 | |
16298 |
|
16299 |
|
16300 | id: (prop_types_default()).string.isRequired,
|
16301 | |
16302 |
|
16303 |
|
16304 |
|
16305 | onChange: (prop_types_default()).func,
|
16306 | |
16307 |
|
16308 |
|
16309 |
|
16310 | value: prop_types_default().oneOfType([(prop_types_default()).string, prop_types_default().arrayOf((prop_types_default()).string.isRequired), (prop_types_default()).number]).isRequired,
|
16311 | |
16312 |
|
16313 |
|
16314 |
|
16315 | inputRef: prop_types_default().oneOfType([(prop_types_default()).func, (prop_types_default()).any])
|
16316 | };
|
16317 | const ToggleButton = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
16318 | bsPrefix,
|
16319 | name,
|
16320 | className,
|
16321 | checked,
|
16322 | type,
|
16323 | onChange,
|
16324 | value,
|
16325 | disabled,
|
16326 | id,
|
16327 | inputRef,
|
16328 | ...props
|
16329 | }, ref) => {
|
16330 | bsPrefix = useBootstrapPrefix(bsPrefix, 'btn-check');
|
16331 | return (0,jsx_dev_runtime.jsxDEV)(jsx_dev_runtime.Fragment, {
|
16332 | children: [(0,jsx_dev_runtime.jsxDEV)("input", {
|
16333 | className: bsPrefix,
|
16334 | name: name,
|
16335 | type: type,
|
16336 | value: value,
|
16337 | ref: inputRef,
|
16338 | autoComplete: "off",
|
16339 | checked: !!checked,
|
16340 | disabled: !!disabled,
|
16341 | onChange: onChange || ToggleButton_noop,
|
16342 | id: id
|
16343 | }, void 0, false, {
|
16344 | fileName: ToggleButton_jsxFileName,
|
16345 | lineNumber: 99,
|
16346 | columnNumber: 9
|
16347 | }, undefined), (0,jsx_dev_runtime.jsxDEV)(src_Button, {
|
16348 | ...props,
|
16349 | ref: ref,
|
16350 | className: classnames_default()(className, disabled && 'disabled'),
|
16351 | type: undefined,
|
16352 | role: undefined,
|
16353 | as: "label",
|
16354 | htmlFor: id
|
16355 | }, void 0, false, {
|
16356 | fileName: ToggleButton_jsxFileName,
|
16357 | lineNumber: 111,
|
16358 | columnNumber: 9
|
16359 | }, undefined)]
|
16360 | }, void 0, true);
|
16361 | });
|
16362 | ToggleButton.propTypes = ToggleButton_propTypes;
|
16363 | ToggleButton.displayName = 'ToggleButton';
|
16364 | const src_ToggleButton = (ToggleButton);
|
16365 | ;
|
16366 | var ToggleButtonGroup_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstrap/src/ToggleButtonGroup.tsx";
|
16367 |
|
16368 |
|
16369 |
|
16370 |
|
16371 |
|
16372 |
|
16373 |
|
16374 |
|
16375 |
|
16376 | const ToggleButtonGroup_propTypes = {
|
16377 | |
16378 |
|
16379 |
|
16380 |
|
16381 |
|
16382 | name: (prop_types_default()).string,
|
16383 | |
16384 |
|
16385 |
|
16386 |
|
16387 |
|
16388 | value: (prop_types_default()).any,
|
16389 | |
16390 |
|
16391 |
|
16392 |
|
16393 |
|
16394 |
|
16395 |
|
16396 | onChange: (prop_types_default()).func,
|
16397 | |
16398 |
|
16399 |
|
16400 |
|
16401 | type: prop_types_default().oneOf(['checkbox', 'radio']).isRequired,
|
16402 | |
16403 |
|
16404 |
|
16405 |
|
16406 |
|
16407 | size: (prop_types_default()).string,
|
16408 |
|
16409 | vertical: (prop_types_default()).bool
|
16410 | };
|
16411 | const ToggleButtonGroup = external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
|
16412 | const {
|
16413 | children,
|
16414 | type = 'radio',
|
16415 | name,
|
16416 | value,
|
16417 | onChange,
|
16418 | vertical = false,
|
16419 | ...controlledProps
|
16420 | } = useUncontrolled(props, {
|
16421 | value: 'onChange'
|
16422 | });
|
16423 | const getValues = () => value == null ? [] : [].concat(value);
|
16424 | const handleToggle = (inputVal, event) => {
|
16425 | if (!onChange) {
|
16426 | return;
|
16427 | }
|
16428 | const values = getValues();
|
16429 | const isActive = values.indexOf(inputVal) !== -1;
|
16430 | if (type === 'radio') {
|
16431 | if (!isActive) onChange(inputVal, event);
|
16432 | return;
|
16433 | }
|
16434 | if (isActive) {
|
16435 | onChange(values.filter(n => n !== inputVal), event);
|
16436 | } else {
|
16437 | onChange([...values, inputVal], event);
|
16438 | }
|
16439 | };
|
16440 | !(type !== 'radio' || !!name) ? false ? 0 : browser_default()(false) : void 0;
|
16441 | return (0,jsx_dev_runtime.jsxDEV)(src_ButtonGroup, {
|
16442 | ...controlledProps,
|
16443 | ref: ref,
|
16444 | vertical: vertical,
|
16445 | children: map(children, child => {
|
16446 | const values = getValues();
|
16447 | const {
|
16448 | value: childVal,
|
16449 | onChange: childOnChange
|
16450 | } = child.props;
|
16451 | const handler = e => handleToggle(childVal, e);
|
16452 | return external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(child, {
|
16453 | type,
|
16454 | name: child.name || name,
|
16455 | checked: values.indexOf(childVal) !== -1,
|
16456 | onChange: src_createChainedFunction(childOnChange, handler)
|
16457 | });
|
16458 | })
|
16459 | }, void 0, false, {
|
16460 | fileName: ToggleButtonGroup_jsxFileName,
|
16461 | lineNumber: 125,
|
16462 | columnNumber: 5
|
16463 | }, undefined);
|
16464 | });
|
16465 | ToggleButtonGroup.propTypes = ToggleButtonGroup_propTypes;
|
16466 | const src_ToggleButtonGroup = (Object.assign(ToggleButtonGroup, {
|
16467 | Button: src_ToggleButton
|
16468 | }));
|
16469 | ;
|
16470 |
|
16471 |
|
16472 |
|
16473 |
|
16474 |
|
16475 |
|
16476 |
|
16477 |
|
16478 |
|
16479 |
|
16480 |
|
16481 |
|
16482 |
|
16483 |
|
16484 |
|
16485 |
|
16486 |
|
16487 |
|
16488 |
|
16489 |
|
16490 |
|
16491 |
|
16492 |
|
16493 |
|
16494 |
|
16495 |
|
16496 |
|
16497 |
|
16498 |
|
16499 |
|
16500 |
|
16501 |
|
16502 |
|
16503 |
|
16504 |
|
16505 |
|
16506 |
|
16507 |
|
16508 |
|
16509 |
|
16510 |
|
16511 |
|
16512 |
|
16513 |
|
16514 |
|
16515 |
|
16516 |
|
16517 |
|
16518 |
|
16519 |
|
16520 |
|
16521 |
|
16522 |
|
16523 |
|
16524 |
|
16525 |
|
16526 |
|
16527 |
|
16528 |
|
16529 |
|
16530 |
|
16531 |
|
16532 |
|
16533 |
|
16534 |
|
16535 |
|
16536 |
|
16537 |
|
16538 |
|
16539 |
|
16540 |
|
16541 |
|
16542 |
|
16543 |
|
16544 |
|
16545 |
|
16546 |
|
16547 |
|
16548 |
|
16549 |
|
16550 |
|
16551 |
|
16552 |
|
16553 |
|
16554 |
|
16555 |
|
16556 |
|
16557 |
|
16558 |
|
16559 |
|
16560 |
|
16561 |
|
16562 |
|
16563 |
|
16564 |
|
16565 |
|
16566 |
|
16567 |
|
16568 |
|
16569 |
|
16570 |
|
16571 |
|
16572 |
|
16573 |
|
16574 |
|
16575 |
|
16576 |
|
16577 |
|
16578 |
|
16579 |
|
16580 | })();
|
16581 |
|
16582 | return __webpack_exports__;
|
16583 | })()
|
16584 | ;
|
16585 | }); |
\ | No newline at end of file |