@coreui/react 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/accordion/index.d.ts +7 -0
- package/dist/components/alert/index.d.ts +4 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/backdrop/index.d.ts +2 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button-group/index.d.ts +3 -0
- package/dist/components/callout/index.d.ts +2 -0
- package/dist/components/card/index.d.ts +12 -0
- package/dist/components/carousel/index.d.ts +4 -0
- package/dist/components/close-button/index.d.ts +2 -0
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/dropdown/CDropdown.d.ts +10 -1
- package/dist/components/dropdown/CDropdownToggle.d.ts +4 -0
- package/dist/components/dropdown/index.d.ts +8 -0
- package/dist/components/footer/index.d.ts +2 -0
- package/dist/components/form/CForm.d.ts +2 -2
- package/dist/components/form/CFormCheck.d.ts +2 -1
- package/dist/components/form/CFormControlValidation.d.ts +46 -0
- package/dist/components/form/CFormControlWrapper.d.ts +31 -0
- package/dist/components/form/CFormInput.d.ts +6 -9
- package/dist/components/form/CFormRange.d.ts +7 -1
- package/dist/components/form/CFormSelect.d.ts +3 -10
- package/dist/components/form/CFormTextarea.d.ts +2 -9
- package/dist/components/form/index.d.ts +14 -0
- package/dist/components/grid/index.d.ts +4 -0
- package/dist/components/header/index.d.ts +7 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/list-group/index.d.ts +3 -0
- package/dist/components/modal/CModal.d.ts +4 -0
- package/dist/components/modal/index.d.ts +8 -0
- package/dist/components/nav/index.d.ts +7 -0
- package/dist/components/navbar/index.d.ts +6 -0
- package/dist/components/offcanvas/index.d.ts +5 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/placeholder/index.d.ts +2 -0
- package/dist/components/popover/CPopover.d.ts +4 -4
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/sidebar/index.d.ts +7 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/table/index.d.ts +9 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/toast/index.d.ts +6 -0
- package/dist/components/tooltip/CTooltip.d.ts +7 -3
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/index.d.ts +0 -120
- package/dist/index.es.js +676 -559
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +676 -559
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
- package/src/components/accordion/CAccordionButton.tsx +2 -1
- package/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap +2 -0
- package/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap +2 -0
- package/src/components/accordion/index.ts +15 -0
- package/src/components/alert/CAlert.tsx +14 -3
- package/src/components/alert/index.ts +5 -0
- package/src/components/avatar/index.ts +3 -0
- package/src/components/backdrop/CBackdrop.tsx +10 -3
- package/src/components/backdrop/index.ts +3 -0
- package/src/components/badge/index.ts +3 -0
- package/src/components/breadcrumb/index.ts +4 -0
- package/src/components/button/index.ts +3 -0
- package/src/components/button-group/index.ts +4 -0
- package/src/components/callout/index.ts +3 -0
- package/src/components/card/index.ts +25 -0
- package/src/components/carousel/index.ts +5 -0
- package/src/components/close-button/index.ts +3 -0
- package/src/components/collapse/CCollapse.tsx +1 -0
- package/src/components/collapse/index.ts +3 -0
- package/src/components/dropdown/CDropdown.tsx +19 -24
- package/src/components/dropdown/CDropdownItem.tsx +1 -1
- package/src/components/dropdown/CDropdownMenu.tsx +55 -3
- package/src/components/dropdown/CDropdownToggle.tsx +28 -5
- package/src/components/dropdown/index.ts +17 -0
- package/src/components/footer/index.ts +3 -0
- package/src/components/form/CForm.tsx +2 -2
- package/src/components/form/CFormCheck.tsx +32 -7
- package/src/components/form/CFormControlValidation.tsx +97 -0
- package/src/components/form/CFormControlWrapper.tsx +85 -0
- package/src/components/form/CFormInput.tsx +75 -19
- package/src/components/form/CFormRange.tsx +18 -4
- package/src/components/form/CFormSelect.tsx +60 -32
- package/src/components/form/CFormTextarea.tsx +45 -17
- package/src/components/form/index.ts +29 -0
- package/src/components/grid/index.ts +5 -0
- package/src/components/header/index.ts +8 -0
- package/src/components/image/index.ts +3 -0
- package/src/components/index.ts +35 -0
- package/src/components/link/index.ts +3 -0
- package/src/components/list-group/index.ts +4 -0
- package/src/components/modal/CModal.tsx +43 -19
- package/src/components/modal/__tests__/CModal.spec.tsx +1 -1
- package/src/components/modal/__tests__/__snapshots__/CModal.spec.tsx.snap +2 -10
- package/src/components/modal/index.ts +9 -0
- package/src/components/nav/CNavGroup.tsx +1 -0
- package/src/components/nav/index.ts +8 -0
- package/src/components/navbar/index.ts +7 -0
- package/src/components/offcanvas/COffcanvas.tsx +1 -0
- package/src/components/offcanvas/index.ts +6 -0
- package/src/components/pagination/index.ts +4 -0
- package/src/components/placeholder/index.ts +3 -0
- package/src/components/popover/CPopover.tsx +63 -61
- package/src/components/popover/index.ts +3 -0
- package/src/components/progress/index.ts +4 -0
- package/src/components/sidebar/index.ts +8 -0
- package/src/components/spinner/index.ts +3 -0
- package/src/components/table/index.ts +19 -0
- package/src/components/tabs/CTabPane.tsx +7 -3
- package/src/components/tabs/index.ts +4 -0
- package/src/components/toast/CToast.tsx +6 -1
- package/src/components/toast/index.ts +7 -0
- package/src/components/tooltip/CTooltip.tsx +65 -47
- package/src/components/tooltip/index.ts +3 -0
- package/src/index.ts +0 -242
- package/src/utils/hooks/useForkedRef.ts +5 -0
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import React__default, { createContext, forwardRef, useState, useRef, useContext, useEffect, useMemo, Children, useLayoutEffect, useCallback } from 'react';
|
|
3
3
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/******************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
7
7
|
|
|
8
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -358,6 +358,8 @@ var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
358
358
|
|
|
359
359
|
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
360
360
|
|
|
361
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
362
|
+
|
|
361
363
|
/**
|
|
362
364
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
363
365
|
*
|
|
@@ -370,7 +372,7 @@ var printWarning$2 = function() {};
|
|
|
370
372
|
if (process.env.NODE_ENV !== 'production') {
|
|
371
373
|
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
372
374
|
var loggedTypeFailures = {};
|
|
373
|
-
var has$1 =
|
|
375
|
+
var has$1 = has$2;
|
|
374
376
|
|
|
375
377
|
printWarning$2 = function(text) {
|
|
376
378
|
var message = 'Warning: ' + text;
|
|
@@ -382,7 +384,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
382
384
|
// This error was thrown as a convenience so that you can use this stack
|
|
383
385
|
// to find the callsite that caused this warning to fire.
|
|
384
386
|
throw new Error(message);
|
|
385
|
-
} catch (x) {}
|
|
387
|
+
} catch (x) { /**/ }
|
|
386
388
|
};
|
|
387
389
|
}
|
|
388
390
|
|
|
@@ -411,7 +413,8 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
411
413
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
412
414
|
var err = Error(
|
|
413
415
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
414
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
416
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
417
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
415
418
|
);
|
|
416
419
|
err.name = 'Invariant Violation';
|
|
417
420
|
throw err;
|
|
@@ -470,9 +473,9 @@ var ReactIs$1 = reactIs.exports;
|
|
|
470
473
|
var assign = objectAssign;
|
|
471
474
|
|
|
472
475
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
476
|
+
var has = has$2;
|
|
473
477
|
var checkPropTypes = checkPropTypes_1;
|
|
474
478
|
|
|
475
|
-
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
476
479
|
var printWarning$1 = function() {};
|
|
477
480
|
|
|
478
481
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -573,6 +576,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
573
576
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
574
577
|
var ReactPropTypes = {
|
|
575
578
|
array: createPrimitiveTypeChecker('array'),
|
|
579
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
576
580
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
577
581
|
func: createPrimitiveTypeChecker('function'),
|
|
578
582
|
number: createPrimitiveTypeChecker('number'),
|
|
@@ -618,8 +622,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
618
622
|
* is prohibitively expensive if they are created too often, such as what
|
|
619
623
|
* happens in oneOfType() for any type before the one that matched.
|
|
620
624
|
*/
|
|
621
|
-
function PropTypeError(message) {
|
|
625
|
+
function PropTypeError(message, data) {
|
|
622
626
|
this.message = message;
|
|
627
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
623
628
|
this.stack = '';
|
|
624
629
|
}
|
|
625
630
|
// Make `instanceof Error` still work for returned errors.
|
|
@@ -654,7 +659,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
654
659
|
) {
|
|
655
660
|
printWarning$1(
|
|
656
661
|
'You are manually calling a React.PropTypes validation ' +
|
|
657
|
-
'function for the `' + propFullName + '` prop on `' + componentName
|
|
662
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
658
663
|
'and will throw in the standalone `prop-types` package. ' +
|
|
659
664
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
660
665
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
@@ -693,7 +698,10 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
693
698
|
// 'of type `object`'.
|
|
694
699
|
var preciseType = getPreciseType(propValue);
|
|
695
700
|
|
|
696
|
-
return new PropTypeError(
|
|
701
|
+
return new PropTypeError(
|
|
702
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
703
|
+
{expectedType: expectedType}
|
|
704
|
+
);
|
|
697
705
|
}
|
|
698
706
|
return null;
|
|
699
707
|
}
|
|
@@ -837,14 +845,19 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
837
845
|
}
|
|
838
846
|
|
|
839
847
|
function validate(props, propName, componentName, location, propFullName) {
|
|
848
|
+
var expectedTypes = [];
|
|
840
849
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
841
850
|
var checker = arrayOfTypeCheckers[i];
|
|
842
|
-
|
|
851
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
852
|
+
if (checkerResult == null) {
|
|
843
853
|
return null;
|
|
844
854
|
}
|
|
855
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
856
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
857
|
+
}
|
|
845
858
|
}
|
|
846
|
-
|
|
847
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '
|
|
859
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
860
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
848
861
|
}
|
|
849
862
|
return createChainableTypeChecker(validate);
|
|
850
863
|
}
|
|
@@ -859,6 +872,13 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
859
872
|
return createChainableTypeChecker(validate);
|
|
860
873
|
}
|
|
861
874
|
|
|
875
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
876
|
+
return new PropTypeError(
|
|
877
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
878
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
|
|
862
882
|
function createShapeTypeChecker(shapeTypes) {
|
|
863
883
|
function validate(props, propName, componentName, location, propFullName) {
|
|
864
884
|
var propValue = props[propName];
|
|
@@ -868,8 +888,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
868
888
|
}
|
|
869
889
|
for (var key in shapeTypes) {
|
|
870
890
|
var checker = shapeTypes[key];
|
|
871
|
-
if (
|
|
872
|
-
|
|
891
|
+
if (typeof checker !== 'function') {
|
|
892
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
873
893
|
}
|
|
874
894
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
875
895
|
if (error) {
|
|
@@ -888,16 +908,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
888
908
|
if (propType !== 'object') {
|
|
889
909
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
890
910
|
}
|
|
891
|
-
// We need to check all keys in case some are required but missing from
|
|
892
|
-
// props.
|
|
911
|
+
// We need to check all keys in case some are required but missing from props.
|
|
893
912
|
var allKeys = assign({}, props[propName], shapeTypes);
|
|
894
913
|
for (var key in allKeys) {
|
|
895
914
|
var checker = shapeTypes[key];
|
|
915
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
916
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
917
|
+
}
|
|
896
918
|
if (!checker) {
|
|
897
919
|
return new PropTypeError(
|
|
898
920
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
899
921
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
900
|
-
'\nValid keys: ' +
|
|
922
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
901
923
|
);
|
|
902
924
|
}
|
|
903
925
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
@@ -1082,6 +1104,7 @@ var factoryWithThrowingShims = function() {
|
|
|
1082
1104
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1083
1105
|
var ReactPropTypes = {
|
|
1084
1106
|
array: shim,
|
|
1107
|
+
bigint: shim,
|
|
1085
1108
|
bool: shim,
|
|
1086
1109
|
func: shim,
|
|
1087
1110
|
number: shim,
|
|
@@ -2360,6 +2383,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2360
2383
|
var CSSTransition$1 = CSSTransition;
|
|
2361
2384
|
|
|
2362
2385
|
// code borrowed from https://github.com/reach/reach-ui
|
|
2386
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2363
2387
|
function useForkedRef() {
|
|
2364
2388
|
var refs = [];
|
|
2365
2389
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -2369,6 +2393,7 @@ function useForkedRef() {
|
|
|
2369
2393
|
if (refs.every(function (ref) { return ref == null; })) {
|
|
2370
2394
|
return null;
|
|
2371
2395
|
}
|
|
2396
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2372
2397
|
return function (node) {
|
|
2373
2398
|
refs.forEach(function (ref) {
|
|
2374
2399
|
assignRef(ref, node);
|
|
@@ -2376,7 +2401,10 @@ function useForkedRef() {
|
|
|
2376
2401
|
};
|
|
2377
2402
|
}, refs);
|
|
2378
2403
|
}
|
|
2379
|
-
|
|
2404
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2405
|
+
function assignRef(ref,
|
|
2406
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2407
|
+
value) {
|
|
2380
2408
|
if (ref == null)
|
|
2381
2409
|
return;
|
|
2382
2410
|
if (isFunction(ref)) {
|
|
@@ -2391,6 +2419,7 @@ function assignRef(ref, value) {
|
|
|
2391
2419
|
}
|
|
2392
2420
|
}
|
|
2393
2421
|
}
|
|
2422
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
2394
2423
|
function isFunction(value) {
|
|
2395
2424
|
return !!(value && {}.toString.call(value) == '[object Function]');
|
|
2396
2425
|
}
|
|
@@ -2450,7 +2479,7 @@ var CCollapse = forwardRef(function (_a, ref) {
|
|
|
2450
2479
|
var _className = classNames({
|
|
2451
2480
|
'collapse-horizontal': horizontal,
|
|
2452
2481
|
}, className);
|
|
2453
|
-
return (React__default.createElement(CSSTransition$1, { in: visible, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 350 }, function (state) {
|
|
2482
|
+
return (React__default.createElement(CSSTransition$1, { in: visible, nodeRef: collapseRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 350 }, function (state) {
|
|
2454
2483
|
var transitionClass = getTransitionClass(state);
|
|
2455
2484
|
var currentHeight = height === 0 ? null : { height: height };
|
|
2456
2485
|
var currentWidth = width === 0 ? null : { width: width };
|
|
@@ -2484,7 +2513,7 @@ var CAccordionButton = forwardRef(function (_a, ref) {
|
|
|
2484
2513
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2485
2514
|
var _b = useContext(CAccordionItemContext), visible = _b.visible, setVisible = _b.setVisible;
|
|
2486
2515
|
var _className = classNames('accordion-button', { collapsed: !visible }, className);
|
|
2487
|
-
return (React__default.createElement("button", __assign({ className: _className
|
|
2516
|
+
return (React__default.createElement("button", __assign({ type: "button", className: _className, "aria-expanded": !visible, onClick: function () { return setVisible(!visible); } }, rest, { ref: ref }), children));
|
|
2488
2517
|
});
|
|
2489
2518
|
CAccordionButton.propTypes = {
|
|
2490
2519
|
children: PropTypes.node,
|
|
@@ -2582,6 +2611,8 @@ CCloseButton.displayName = 'CCloseButton';
|
|
|
2582
2611
|
|
|
2583
2612
|
var CAlert = forwardRef(function (_a, ref) {
|
|
2584
2613
|
var children = _a.children, className = _a.className, _b = _a.color, color = _b === void 0 ? 'primary' : _b, dismissible = _a.dismissible, variant = _a.variant, _c = _a.visible, visible = _c === void 0 ? true : _c, onClose = _a.onClose, rest = __rest(_a, ["children", "className", "color", "dismissible", "variant", "visible", "onClose"]);
|
|
2614
|
+
var alertRef = useRef(null);
|
|
2615
|
+
var forkedRef = useForkedRef(ref, alertRef);
|
|
2585
2616
|
var _d = useState(visible), _visible = _d[0], setVisible = _d[1];
|
|
2586
2617
|
useEffect(function () {
|
|
2587
2618
|
setVisible(visible);
|
|
@@ -2592,9 +2623,9 @@ var CAlert = forwardRef(function (_a, ref) {
|
|
|
2592
2623
|
var getTransitionClass = function (state) {
|
|
2593
2624
|
return state === 'entered' && 'show';
|
|
2594
2625
|
};
|
|
2595
|
-
return (React__default.createElement(Transition$1, { in: _visible, mountOnEnter: true, onExit: onClose, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2626
|
+
return (React__default.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: alertRef, onExit: onClose, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2596
2627
|
var transitionClass = getTransitionClass(state);
|
|
2597
|
-
return (React__default.createElement("div", __assign({ className: classNames(_className, transitionClass), role: "alert" }, rest, { ref:
|
|
2628
|
+
return (React__default.createElement("div", __assign({ className: classNames(_className, transitionClass), role: "alert" }, rest, { ref: forkedRef }),
|
|
2598
2629
|
children,
|
|
2599
2630
|
dismissible && React__default.createElement(CCloseButton, { onClick: function () { return setVisible(false); } })));
|
|
2600
2631
|
}));
|
|
@@ -2678,6 +2709,25 @@ CAvatar.propTypes = {
|
|
|
2678
2709
|
};
|
|
2679
2710
|
CAvatar.displayName = 'CAvatar';
|
|
2680
2711
|
|
|
2712
|
+
var CBackdrop = forwardRef(function (_a, ref) {
|
|
2713
|
+
var _b = _a.className, className = _b === void 0 ? 'modal-backdrop' : _b, visible = _a.visible, rest = __rest(_a, ["className", "visible"]);
|
|
2714
|
+
var backdropRef = useRef(null);
|
|
2715
|
+
var forkedRef = useForkedRef(ref, backdropRef);
|
|
2716
|
+
var _className = classNames(className, 'fade');
|
|
2717
|
+
var getTransitionClass = function (state) {
|
|
2718
|
+
return state === 'entered' && 'show';
|
|
2719
|
+
};
|
|
2720
|
+
return (React__default.createElement(Transition$1, { in: visible, mountOnEnter: true, nodeRef: backdropRef, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2721
|
+
var transitionClass = getTransitionClass(state);
|
|
2722
|
+
return (React__default.createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: forkedRef })));
|
|
2723
|
+
}));
|
|
2724
|
+
});
|
|
2725
|
+
CBackdrop.propTypes = {
|
|
2726
|
+
className: PropTypes.string,
|
|
2727
|
+
visible: PropTypes.bool,
|
|
2728
|
+
};
|
|
2729
|
+
CBackdrop.displayName = 'CBackdrop';
|
|
2730
|
+
|
|
2681
2731
|
var CBadge = forwardRef(function (_a, ref) {
|
|
2682
2732
|
var _b;
|
|
2683
2733
|
var children = _a.children, className = _a.className, color = _a.color, _c = _a.component, Component = _c === void 0 ? 'span' : _c, position = _a.position, shape = _a.shape, size = _a.size, textColor = _a.textColor, rest = __rest(_a, ["children", "className", "color", "component", "position", "shape", "size", "textColor"]);
|
|
@@ -2705,23 +2755,6 @@ CBadge.propTypes = {
|
|
|
2705
2755
|
};
|
|
2706
2756
|
CBadge.displayName = 'CBadge';
|
|
2707
2757
|
|
|
2708
|
-
var CBackdrop = forwardRef(function (_a, ref) {
|
|
2709
|
-
var _b = _a.className, className = _b === void 0 ? 'modal-backdrop' : _b, visible = _a.visible, rest = __rest(_a, ["className", "visible"]);
|
|
2710
|
-
var _className = classNames(className, 'fade');
|
|
2711
|
-
var getTransitionClass = function (state) {
|
|
2712
|
-
return state === 'entered' && 'show';
|
|
2713
|
-
};
|
|
2714
|
-
return (React__default.createElement(Transition$1, { in: visible, mountOnEnter: true, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2715
|
-
var transitionClass = getTransitionClass(state);
|
|
2716
|
-
return React__default.createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: ref }));
|
|
2717
|
-
}));
|
|
2718
|
-
});
|
|
2719
|
-
CBackdrop.propTypes = {
|
|
2720
|
-
className: PropTypes.string,
|
|
2721
|
-
visible: PropTypes.bool,
|
|
2722
|
-
};
|
|
2723
|
-
CBackdrop.displayName = 'CBackdrop';
|
|
2724
|
-
|
|
2725
2758
|
var CBreadcrumb = forwardRef(function (_a, ref) {
|
|
2726
2759
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2727
2760
|
var _className = classNames('breadcrumb', className);
|
|
@@ -2767,6 +2800,17 @@ CButton.propTypes = {
|
|
|
2767
2800
|
};
|
|
2768
2801
|
CButton.displayName = 'CButton';
|
|
2769
2802
|
|
|
2803
|
+
var CButtonToolbar = forwardRef(function (_a, ref) {
|
|
2804
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2805
|
+
var _className = classNames('btn-toolbar', className);
|
|
2806
|
+
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
2807
|
+
});
|
|
2808
|
+
CButtonToolbar.propTypes = {
|
|
2809
|
+
children: PropTypes.node,
|
|
2810
|
+
className: PropTypes.string,
|
|
2811
|
+
};
|
|
2812
|
+
CButtonToolbar.displayName = 'CButtonToolbar';
|
|
2813
|
+
|
|
2770
2814
|
var CButtonGroup = forwardRef(function (_a, ref) {
|
|
2771
2815
|
var _b;
|
|
2772
2816
|
var children = _a.children, className = _a.className, size = _a.size, vertical = _a.vertical, rest = __rest(_a, ["children", "className", "size", "vertical"]);
|
|
@@ -2781,17 +2825,6 @@ CButtonGroup.propTypes = {
|
|
|
2781
2825
|
};
|
|
2782
2826
|
CButtonGroup.displayName = 'CButtonGroup';
|
|
2783
2827
|
|
|
2784
|
-
var CButtonToolbar = forwardRef(function (_a, ref) {
|
|
2785
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2786
|
-
var _className = classNames('btn-toolbar', className);
|
|
2787
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
2788
|
-
});
|
|
2789
|
-
CButtonToolbar.propTypes = {
|
|
2790
|
-
children: PropTypes.node,
|
|
2791
|
-
className: PropTypes.string,
|
|
2792
|
-
};
|
|
2793
|
-
CButtonToolbar.displayName = 'CButtonToolbar';
|
|
2794
|
-
|
|
2795
2828
|
var CCallout = forwardRef(function (_a, ref) {
|
|
2796
2829
|
var _b;
|
|
2797
2830
|
var children = _a.children, className = _a.className, color = _a.color, rest = __rest(_a, ["children", "className", "color"]);
|
|
@@ -3542,6 +3575,10 @@ function getContainingBlock(element) {
|
|
|
3542
3575
|
|
|
3543
3576
|
var currentNode = getParentNode(element);
|
|
3544
3577
|
|
|
3578
|
+
if (isShadowRoot(currentNode)) {
|
|
3579
|
+
currentNode = currentNode.host;
|
|
3580
|
+
}
|
|
3581
|
+
|
|
3545
3582
|
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
3546
3583
|
var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
3547
3584
|
// create a containing block.
|
|
@@ -3734,13 +3771,21 @@ function mapToStyles(_ref2) {
|
|
|
3734
3771
|
adaptive = _ref2.adaptive,
|
|
3735
3772
|
roundOffsets = _ref2.roundOffsets,
|
|
3736
3773
|
isFixed = _ref2.isFixed;
|
|
3774
|
+
var _offsets$x = offsets.x,
|
|
3775
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
3776
|
+
_offsets$y = offsets.y,
|
|
3777
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
3737
3778
|
|
|
3738
|
-
var _ref3 =
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3779
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
3780
|
+
x: x,
|
|
3781
|
+
y: y
|
|
3782
|
+
}) : {
|
|
3783
|
+
x: x,
|
|
3784
|
+
y: y
|
|
3785
|
+
};
|
|
3743
3786
|
|
|
3787
|
+
x = _ref3.x;
|
|
3788
|
+
y = _ref3.y;
|
|
3744
3789
|
var hasX = offsets.hasOwnProperty('x');
|
|
3745
3790
|
var hasY = offsets.hasOwnProperty('y');
|
|
3746
3791
|
var sideX = left;
|
|
@@ -3766,7 +3811,7 @@ function mapToStyles(_ref2) {
|
|
|
3766
3811
|
|
|
3767
3812
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
3768
3813
|
sideY = bottom;
|
|
3769
|
-
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
3814
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
3770
3815
|
offsetParent[heightProp];
|
|
3771
3816
|
y -= offsetY - popperRect.height;
|
|
3772
3817
|
y *= gpuAcceleration ? 1 : -1;
|
|
@@ -3774,7 +3819,7 @@ function mapToStyles(_ref2) {
|
|
|
3774
3819
|
|
|
3775
3820
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
3776
3821
|
sideX = right;
|
|
3777
|
-
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
3822
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
3778
3823
|
offsetParent[widthProp];
|
|
3779
3824
|
x -= offsetX - popperRect.width;
|
|
3780
3825
|
x *= gpuAcceleration ? 1 : -1;
|
|
@@ -3785,6 +3830,17 @@ function mapToStyles(_ref2) {
|
|
|
3785
3830
|
position: position
|
|
3786
3831
|
}, adaptive && unsetSides);
|
|
3787
3832
|
|
|
3833
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
3834
|
+
x: x,
|
|
3835
|
+
y: y
|
|
3836
|
+
}) : {
|
|
3837
|
+
x: x,
|
|
3838
|
+
y: y
|
|
3839
|
+
};
|
|
3840
|
+
|
|
3841
|
+
x = _ref4.x;
|
|
3842
|
+
y = _ref4.y;
|
|
3843
|
+
|
|
3788
3844
|
if (gpuAcceleration) {
|
|
3789
3845
|
var _Object$assign;
|
|
3790
3846
|
|
|
@@ -3794,9 +3850,9 @@ function mapToStyles(_ref2) {
|
|
|
3794
3850
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
3795
3851
|
}
|
|
3796
3852
|
|
|
3797
|
-
function computeStyles(
|
|
3798
|
-
var state =
|
|
3799
|
-
options =
|
|
3853
|
+
function computeStyles(_ref5) {
|
|
3854
|
+
var state = _ref5.state,
|
|
3855
|
+
options = _ref5.options;
|
|
3800
3856
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
3801
3857
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
3802
3858
|
_options$adaptive = options.adaptive,
|
|
@@ -4095,7 +4151,7 @@ function getClippingParents(element) {
|
|
|
4095
4151
|
|
|
4096
4152
|
|
|
4097
4153
|
return clippingParents.filter(function (clippingParent) {
|
|
4098
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'
|
|
4154
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
4099
4155
|
});
|
|
4100
4156
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
4101
4157
|
// clipping parents
|
|
@@ -5570,9 +5626,10 @@ function Reference(_ref) {
|
|
|
5570
5626
|
|
|
5571
5627
|
var CDropdownContext = createContext({});
|
|
5572
5628
|
var CDropdown = forwardRef(function (_a, ref) {
|
|
5573
|
-
var children = _a.children, alignment = _a.alignment, className = _a.className, dark = _a.dark, direction = _a.direction, onHide = _a.onHide, onShow = _a.onShow,
|
|
5574
|
-
var
|
|
5629
|
+
var children = _a.children, alignment = _a.alignment, _b = _a.autoClose, autoClose = _b === void 0 ? true : _b, className = _a.className, dark = _a.dark, direction = _a.direction, onHide = _a.onHide, onShow = _a.onShow, _c = _a.placement, placement = _c === void 0 ? 'bottom-start' : _c, _d = _a.popper, popper = _d === void 0 ? true : _d, _e = _a.variant, variant = _e === void 0 ? 'btn-group' : _e, _f = _a.component, component = _f === void 0 ? 'div' : _f, _g = _a.visible, visible = _g === void 0 ? false : _g, rest = __rest(_a, ["children", "alignment", "autoClose", "className", "dark", "direction", "onHide", "onShow", "placement", "popper", "variant", "component", "visible"]);
|
|
5630
|
+
var _h = useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
5575
5631
|
var dropdownRef = useRef(null);
|
|
5632
|
+
var dropdownToggleRef = useRef(null);
|
|
5576
5633
|
var forkedRef = useForkedRef(ref, dropdownRef);
|
|
5577
5634
|
var Component = variant === 'nav-item' ? 'li' : component;
|
|
5578
5635
|
// Disable popper if responsive aligment is set.
|
|
@@ -5581,8 +5638,10 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
5581
5638
|
}
|
|
5582
5639
|
var contextValues = {
|
|
5583
5640
|
alignment: alignment,
|
|
5641
|
+
autoClose: autoClose,
|
|
5584
5642
|
dark: dark,
|
|
5585
5643
|
direction: direction,
|
|
5644
|
+
dropdownToggleRef: dropdownToggleRef,
|
|
5586
5645
|
placement: placement,
|
|
5587
5646
|
popper: popper,
|
|
5588
5647
|
variant: variant,
|
|
@@ -5592,17 +5651,6 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
5592
5651
|
var _className = classNames(variant === 'nav-item' ? 'nav-item dropdown' : variant, {
|
|
5593
5652
|
show: _visible,
|
|
5594
5653
|
}, direction, className);
|
|
5595
|
-
useEffect(function () {
|
|
5596
|
-
_visible &&
|
|
5597
|
-
setTimeout(function () {
|
|
5598
|
-
window.addEventListener('click', handleClickOutside);
|
|
5599
|
-
window.addEventListener('keyup', handleKeyup);
|
|
5600
|
-
});
|
|
5601
|
-
return function () {
|
|
5602
|
-
window.removeEventListener('click', handleClickOutside);
|
|
5603
|
-
window.removeEventListener('keyup', handleKeyup);
|
|
5604
|
-
};
|
|
5605
|
-
}, [_visible]);
|
|
5606
5654
|
useEffect(function () {
|
|
5607
5655
|
setVisible(visible);
|
|
5608
5656
|
}, [visible]);
|
|
@@ -5610,18 +5658,6 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
5610
5658
|
_visible && onShow && onShow();
|
|
5611
5659
|
!_visible && onHide && onHide();
|
|
5612
5660
|
}, [_visible]);
|
|
5613
|
-
var handleKeyup = function (event) {
|
|
5614
|
-
var _a;
|
|
5615
|
-
if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
5616
|
-
setVisible(false);
|
|
5617
|
-
}
|
|
5618
|
-
};
|
|
5619
|
-
var handleClickOutside = function (event) {
|
|
5620
|
-
var _a;
|
|
5621
|
-
if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
5622
|
-
setVisible(false);
|
|
5623
|
-
}
|
|
5624
|
-
};
|
|
5625
5661
|
var dropdownContent = function () {
|
|
5626
5662
|
return variant === 'input-group' ? (React__default.createElement(React__default.Fragment, null, children)) : (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: forkedRef }), children));
|
|
5627
5663
|
};
|
|
@@ -5640,6 +5676,10 @@ CDropdown.propTypes = {
|
|
|
5640
5676
|
PropTypes.shape({ xl: alignmentDirection }),
|
|
5641
5677
|
PropTypes.shape({ xxl: alignmentDirection }),
|
|
5642
5678
|
]),
|
|
5679
|
+
autoClose: PropTypes.oneOfType([
|
|
5680
|
+
PropTypes.bool,
|
|
5681
|
+
PropTypes.oneOf(['inside', 'outside']),
|
|
5682
|
+
]),
|
|
5643
5683
|
children: PropTypes.node,
|
|
5644
5684
|
className: PropTypes.string,
|
|
5645
5685
|
component: PropTypes.elementType,
|
|
@@ -5679,7 +5719,7 @@ CDropdownHeader.displayName = 'CDropdownHeader';
|
|
|
5679
5719
|
var CDropdownItem = forwardRef(function (_a, ref) {
|
|
5680
5720
|
var children = _a.children, className = _a.className, _b = _a.component, component = _b === void 0 ? 'a' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
5681
5721
|
var _className = classNames('dropdown-item', className);
|
|
5682
|
-
return (React__default.createElement(CLink, __assign({ component: component }, rest, {
|
|
5722
|
+
return (React__default.createElement(CLink, __assign({ className: _className, component: component }, rest, { ref: ref }), children));
|
|
5683
5723
|
});
|
|
5684
5724
|
CDropdownItem.propTypes = {
|
|
5685
5725
|
children: PropTypes.node,
|
|
@@ -5702,7 +5742,36 @@ CDropdownItemPlain.displayName = 'CDropdownItemPlain';
|
|
|
5702
5742
|
|
|
5703
5743
|
var CDropdownMenu = function (_a) {
|
|
5704
5744
|
var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'ul' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
5705
|
-
var _c = useContext(CDropdownContext), alignment = _c.alignment, dark = _c.dark, direction = _c.direction, placement = _c.placement, popper = _c.popper, visible = _c.visible;
|
|
5745
|
+
var _c = useContext(CDropdownContext), alignment = _c.alignment, autoClose = _c.autoClose, dark = _c.dark, direction = _c.direction, dropdownToggleRef = _c.dropdownToggleRef, placement = _c.placement, popper = _c.popper, visible = _c.visible, setVisible = _c.setVisible;
|
|
5746
|
+
var dropdownMenuRef = useRef(null);
|
|
5747
|
+
useEffect(function () {
|
|
5748
|
+
visible && window.addEventListener('mouseup', handleMouseUp);
|
|
5749
|
+
visible && window.addEventListener('keyup', handleKeyup);
|
|
5750
|
+
return function () {
|
|
5751
|
+
window.removeEventListener('mouseup', handleMouseUp);
|
|
5752
|
+
window.removeEventListener('keyup', handleKeyup);
|
|
5753
|
+
};
|
|
5754
|
+
}, [visible]);
|
|
5755
|
+
var handleKeyup = function (event) {
|
|
5756
|
+
if (autoClose === false) {
|
|
5757
|
+
return;
|
|
5758
|
+
}
|
|
5759
|
+
if (event.key === 'Escape') {
|
|
5760
|
+
setVisible(false);
|
|
5761
|
+
}
|
|
5762
|
+
};
|
|
5763
|
+
var handleMouseUp = function (event) {
|
|
5764
|
+
var _a, _b;
|
|
5765
|
+
if (dropdownToggleRef && dropdownToggleRef.current.contains(event.target)) {
|
|
5766
|
+
return;
|
|
5767
|
+
}
|
|
5768
|
+
if (autoClose === true ||
|
|
5769
|
+
(autoClose === 'inside' && ((_a = dropdownMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) ||
|
|
5770
|
+
(autoClose === 'outside' && !((_b = dropdownMenuRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)))) {
|
|
5771
|
+
setTimeout(function () { return setVisible(false); }, 1);
|
|
5772
|
+
return;
|
|
5773
|
+
}
|
|
5774
|
+
};
|
|
5706
5775
|
var _placement = placement;
|
|
5707
5776
|
if (direction === 'dropup') {
|
|
5708
5777
|
_placement = 'top-start';
|
|
@@ -5742,7 +5811,7 @@ var CDropdownMenu = function (_a) {
|
|
|
5742
5811
|
})
|
|
5743
5812
|
: children));
|
|
5744
5813
|
};
|
|
5745
|
-
return popper && visible ? (React__default.createElement(Popper, { placement: _placement }, function (_a) {
|
|
5814
|
+
return popper && visible ? (React__default.createElement(Popper, { innerRef: dropdownMenuRef, placement: _placement }, function (_a) {
|
|
5746
5815
|
var ref = _a.ref, style = _a.style;
|
|
5747
5816
|
return dropdownMenuComponent(style, ref);
|
|
5748
5817
|
})) : (dropdownMenuComponent());
|
|
@@ -5755,8 +5824,8 @@ CDropdownMenu.propTypes = {
|
|
|
5755
5824
|
CDropdownMenu.displayName = 'CDropdownMenu';
|
|
5756
5825
|
|
|
5757
5826
|
var CDropdownToggle = function (_a) {
|
|
5758
|
-
var children = _a.children, _b = _a.caret, caret = _b === void 0 ? true : _b, className = _a.className, split = _a.split, _c = _a.trigger, trigger = _c === void 0 ? 'click' : _c, rest = __rest(_a, ["children", "caret", "className", "split", "trigger"]);
|
|
5759
|
-
var _d = useContext(CDropdownContext), popper = _d.popper, variant = _d.variant, visible = _d.visible, setVisible = _d.setVisible;
|
|
5827
|
+
var children = _a.children, _b = _a.caret, caret = _b === void 0 ? true : _b, custom = _a.custom, className = _a.className, split = _a.split, _c = _a.trigger, trigger = _c === void 0 ? 'click' : _c, rest = __rest(_a, ["children", "caret", "custom", "className", "split", "trigger"]);
|
|
5828
|
+
var _d = useContext(CDropdownContext), dropdownToggleRef = _d.dropdownToggleRef, popper = _d.popper, variant = _d.variant, visible = _d.visible, setVisible = _d.setVisible;
|
|
5760
5829
|
var _className = classNames({
|
|
5761
5830
|
'dropdown-toggle': caret,
|
|
5762
5831
|
'dropdown-toggle-split': split,
|
|
@@ -5771,199 +5840,90 @@ var CDropdownToggle = function (_a) {
|
|
|
5771
5840
|
onFocus: function () { return setVisible(true); },
|
|
5772
5841
|
onBlur: function () { return setVisible(false); },
|
|
5773
5842
|
}));
|
|
5774
|
-
var togglerProps = __assign({ className: _className, 'aria-expanded': visible }, triggers);
|
|
5843
|
+
var togglerProps = __assign(__assign({ className: _className, 'aria-expanded': visible }, (!rest.disabled && __assign({}, triggers))), triggers);
|
|
5775
5844
|
// We use any because Toggler can be `a` as well as `button`.
|
|
5776
5845
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5777
5846
|
var Toggler = function (ref) {
|
|
5778
|
-
return variant === 'nav-item' ? (React__default.createElement("a", __assign({ href: "#" }, togglerProps, { ref: ref }), children)) : (React__default.createElement(CButton, __assign({ type: "button" }, togglerProps, { tabIndex: 0 }, rest, { ref: ref }),
|
|
5847
|
+
return custom && React__default.isValidElement(children) ? (React__default.createElement(React__default.Fragment, null, React__default.cloneElement(children, __assign(__assign({ 'aria-expanded': visible }, (!rest.disabled && __assign({}, triggers))), { ref: useForkedRef(ref, dropdownToggleRef) })))) : variant === 'nav-item' ? (React__default.createElement("a", __assign({ href: "#" }, togglerProps, { ref: useForkedRef(ref, dropdownToggleRef) }), children)) : (React__default.createElement(CButton, __assign({ type: "button" }, togglerProps, { tabIndex: 0 }, rest, { ref: useForkedRef(ref, dropdownToggleRef) }),
|
|
5779
5848
|
children,
|
|
5780
5849
|
split && React__default.createElement("span", { className: "visually-hidden" }, "Toggle Dropdown")));
|
|
5781
5850
|
};
|
|
5782
5851
|
return popper ? React__default.createElement(Reference, null, function (_a) {
|
|
5783
5852
|
var ref = _a.ref;
|
|
5784
5853
|
return Toggler(ref);
|
|
5785
|
-
}) : Toggler();
|
|
5854
|
+
}) : Toggler(dropdownToggleRef);
|
|
5786
5855
|
};
|
|
5787
5856
|
CDropdownToggle.propTypes = {
|
|
5788
5857
|
caret: PropTypes.bool,
|
|
5789
5858
|
children: PropTypes.node,
|
|
5790
5859
|
className: PropTypes.string,
|
|
5860
|
+
custom: PropTypes.bool,
|
|
5791
5861
|
split: PropTypes.bool,
|
|
5792
5862
|
trigger: triggerPropType,
|
|
5793
5863
|
};
|
|
5794
5864
|
CDropdownToggle.displayName = 'CDropdownToggle';
|
|
5795
5865
|
|
|
5796
|
-
var
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
'
|
|
5800
|
-
'md',
|
|
5801
|
-
'sm',
|
|
5802
|
-
'xs',
|
|
5803
|
-
];
|
|
5804
|
-
var CCol = forwardRef(function (_a, ref) {
|
|
5805
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5806
|
-
var repsonsiveClassNames = [];
|
|
5807
|
-
BREAKPOINTS$3.forEach(function (bp) {
|
|
5808
|
-
var breakpoint = rest[bp];
|
|
5809
|
-
delete rest[bp];
|
|
5810
|
-
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
5811
|
-
if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
|
|
5812
|
-
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint));
|
|
5813
|
-
}
|
|
5814
|
-
if (typeof breakpoint === 'boolean') {
|
|
5815
|
-
repsonsiveClassNames.push("col".concat(infix));
|
|
5816
|
-
}
|
|
5817
|
-
if (breakpoint && typeof breakpoint === 'object') {
|
|
5818
|
-
if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
|
|
5819
|
-
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint.span));
|
|
5820
|
-
}
|
|
5821
|
-
if (typeof breakpoint.span === 'boolean') {
|
|
5822
|
-
repsonsiveClassNames.push("col".concat(infix));
|
|
5823
|
-
}
|
|
5824
|
-
if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
|
|
5825
|
-
repsonsiveClassNames.push("order".concat(infix, "-").concat(breakpoint.order));
|
|
5826
|
-
}
|
|
5827
|
-
if (typeof breakpoint.offset === 'number') {
|
|
5828
|
-
repsonsiveClassNames.push("offset".concat(infix, "-").concat(breakpoint.offset));
|
|
5829
|
-
}
|
|
5830
|
-
}
|
|
5831
|
-
});
|
|
5832
|
-
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'col', className);
|
|
5866
|
+
var CFooter = forwardRef(function (_a, ref) {
|
|
5867
|
+
var _b;
|
|
5868
|
+
var children = _a.children, className = _a.className, position = _a.position, rest = __rest(_a, ["children", "className", "position"]);
|
|
5869
|
+
var _className = classNames('footer', (_b = {}, _b["footer-".concat(position)] = position, _b), className);
|
|
5833
5870
|
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5834
5871
|
});
|
|
5835
|
-
|
|
5836
|
-
PropTypes.bool,
|
|
5837
|
-
PropTypes.number,
|
|
5838
|
-
PropTypes.string,
|
|
5839
|
-
PropTypes.oneOf(['auto']),
|
|
5840
|
-
]);
|
|
5841
|
-
var col = PropTypes.oneOfType([
|
|
5842
|
-
span,
|
|
5843
|
-
PropTypes.shape({
|
|
5844
|
-
span: span,
|
|
5845
|
-
offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
5846
|
-
order: PropTypes.oneOfType([
|
|
5847
|
-
PropTypes.oneOf(['first', 'last']),
|
|
5848
|
-
PropTypes.number,
|
|
5849
|
-
PropTypes.string,
|
|
5850
|
-
]),
|
|
5851
|
-
}),
|
|
5852
|
-
]);
|
|
5853
|
-
CCol.propTypes = {
|
|
5872
|
+
CFooter.propTypes = {
|
|
5854
5873
|
children: PropTypes.node,
|
|
5855
5874
|
className: PropTypes.string,
|
|
5856
|
-
|
|
5857
|
-
sm: col,
|
|
5875
|
+
position: PropTypes.oneOf(['fixed', 'sticky']),
|
|
5858
5876
|
};
|
|
5859
|
-
|
|
5877
|
+
CFooter.displayName = 'CFooter';
|
|
5860
5878
|
|
|
5861
|
-
var
|
|
5862
|
-
|
|
5863
|
-
'
|
|
5864
|
-
|
|
5865
|
-
'md',
|
|
5866
|
-
'sm',
|
|
5867
|
-
'fluid',
|
|
5868
|
-
];
|
|
5869
|
-
var CContainer = forwardRef(function (_a, ref) {
|
|
5870
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5871
|
-
var repsonsiveClassNames = [];
|
|
5872
|
-
BREAKPOINTS$2.forEach(function (bp) {
|
|
5873
|
-
var breakpoint = rest[bp];
|
|
5874
|
-
delete rest[bp];
|
|
5875
|
-
breakpoint && repsonsiveClassNames.push("container-".concat(bp));
|
|
5876
|
-
});
|
|
5877
|
-
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'container', className);
|
|
5878
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5879
|
+
var CForm = forwardRef(function (_a, ref) {
|
|
5880
|
+
var children = _a.children, className = _a.className, validated = _a.validated, rest = __rest(_a, ["children", "className", "validated"]);
|
|
5881
|
+
var _className = classNames({ 'was-validated': validated }, className);
|
|
5882
|
+
return (React__default.createElement("form", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5879
5883
|
});
|
|
5880
|
-
|
|
5884
|
+
CForm.propTypes = {
|
|
5881
5885
|
children: PropTypes.node,
|
|
5882
5886
|
className: PropTypes.string,
|
|
5883
|
-
|
|
5884
|
-
md: PropTypes.bool,
|
|
5885
|
-
lg: PropTypes.bool,
|
|
5886
|
-
xl: PropTypes.bool,
|
|
5887
|
-
xxl: PropTypes.bool,
|
|
5888
|
-
fluid: PropTypes.bool,
|
|
5887
|
+
validated: PropTypes.bool,
|
|
5889
5888
|
};
|
|
5890
|
-
|
|
5889
|
+
CForm.displayName = 'CForm';
|
|
5891
5890
|
|
|
5892
|
-
var
|
|
5893
|
-
|
|
5894
|
-
'
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
var CRow = forwardRef(function (_a, ref) {
|
|
5901
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5902
|
-
var repsonsiveClassNames = [];
|
|
5903
|
-
BREAKPOINTS$1.forEach(function (bp) {
|
|
5904
|
-
var breakpoint = rest[bp];
|
|
5905
|
-
delete rest[bp];
|
|
5906
|
-
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
5907
|
-
if (typeof breakpoint === 'object') {
|
|
5908
|
-
if (breakpoint.cols) {
|
|
5909
|
-
repsonsiveClassNames.push("row-cols".concat(infix, "-").concat(breakpoint.cols));
|
|
5910
|
-
}
|
|
5911
|
-
if (typeof breakpoint.gutter === 'number') {
|
|
5912
|
-
repsonsiveClassNames.push("g".concat(infix, "-").concat(breakpoint.gutter));
|
|
5913
|
-
}
|
|
5914
|
-
if (typeof breakpoint.gutterX === 'number') {
|
|
5915
|
-
repsonsiveClassNames.push("gx".concat(infix, "-").concat(breakpoint.gutterX));
|
|
5916
|
-
}
|
|
5917
|
-
if (typeof breakpoint.gutterY === 'number') {
|
|
5918
|
-
repsonsiveClassNames.push("gy".concat(infix, "-").concat(breakpoint.gutterY));
|
|
5919
|
-
}
|
|
5920
|
-
}
|
|
5921
|
-
});
|
|
5922
|
-
var _className = classNames('row', repsonsiveClassNames, className);
|
|
5923
|
-
return (React__default.createElement("div", { className: _className, ref: ref }, children));
|
|
5891
|
+
var CFormFeedback = forwardRef(function (_a, ref) {
|
|
5892
|
+
var _b;
|
|
5893
|
+
var children = _a.children, className = _a.className, _c = _a.component, Component = _c === void 0 ? 'div' : _c, invalid = _a.invalid, tooltip = _a.tooltip, valid = _a.valid, rest = __rest(_a, ["children", "className", "component", "invalid", "tooltip", "valid"]);
|
|
5894
|
+
var _className = classNames((_b = {},
|
|
5895
|
+
_b["invalid-".concat(tooltip ? 'tooltip' : 'feedback')] = invalid,
|
|
5896
|
+
_b["valid-".concat(tooltip ? 'tooltip' : 'feedback')] = valid,
|
|
5897
|
+
_b), className);
|
|
5898
|
+
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5924
5899
|
});
|
|
5925
|
-
|
|
5926
|
-
cols: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.string]),
|
|
5927
|
-
gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5928
|
-
gutterX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5929
|
-
gutterY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5930
|
-
});
|
|
5931
|
-
CRow.propTypes = {
|
|
5932
|
-
children: PropTypes.node,
|
|
5933
|
-
className: PropTypes.string,
|
|
5934
|
-
xs: bp,
|
|
5935
|
-
sm: bp,
|
|
5936
|
-
md: bp,
|
|
5937
|
-
lg: bp,
|
|
5938
|
-
xl: bp,
|
|
5939
|
-
xxl: bp,
|
|
5940
|
-
};
|
|
5941
|
-
CRow.displayName = 'CRow';
|
|
5942
|
-
|
|
5943
|
-
var CFooter = forwardRef(function (_a, ref) {
|
|
5944
|
-
var _b;
|
|
5945
|
-
var children = _a.children, className = _a.className, position = _a.position, rest = __rest(_a, ["children", "className", "position"]);
|
|
5946
|
-
var _className = classNames('footer', (_b = {}, _b["footer-".concat(position)] = position, _b), className);
|
|
5947
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5948
|
-
});
|
|
5949
|
-
CFooter.propTypes = {
|
|
5900
|
+
CFormFeedback.propTypes = {
|
|
5950
5901
|
children: PropTypes.node,
|
|
5951
5902
|
className: PropTypes.string,
|
|
5952
|
-
|
|
5903
|
+
component: PropTypes.elementType,
|
|
5904
|
+
invalid: PropTypes.bool,
|
|
5905
|
+
tooltip: PropTypes.bool,
|
|
5906
|
+
valid: PropTypes.bool,
|
|
5953
5907
|
};
|
|
5954
|
-
|
|
5908
|
+
CFormFeedback.displayName = 'CFormFeedback';
|
|
5955
5909
|
|
|
5956
|
-
var
|
|
5957
|
-
var
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
})
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5910
|
+
var CFormControlValidation = function (_a) {
|
|
5911
|
+
var describedby = _a.describedby, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, invalid = _a.invalid, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid;
|
|
5912
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
5913
|
+
feedback && (valid || invalid) && (React__default.createElement(CFormFeedback, __assign({}, (invalid && { id: describedby }), { invalid: invalid, tooltip: tooltipFeedback, valid: valid }), feedback)),
|
|
5914
|
+
feedbackInvalid && (React__default.createElement(CFormFeedback, { id: describedby, invalid: true, tooltip: tooltipFeedback }, feedbackInvalid)),
|
|
5915
|
+
feedbackValid && (React__default.createElement(CFormFeedback, { valid: true, tooltip: tooltipFeedback }, feedbackValid))));
|
|
5916
|
+
};
|
|
5917
|
+
CFormControlValidation.propTypes = {
|
|
5918
|
+
describedby: PropTypes.string,
|
|
5919
|
+
feedback: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
5920
|
+
feedbackValid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
5921
|
+
feedbackInvalid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
5922
|
+
invalid: PropTypes.bool,
|
|
5923
|
+
tooltipFeedback: PropTypes.bool,
|
|
5924
|
+
valid: PropTypes.bool,
|
|
5965
5925
|
};
|
|
5966
|
-
|
|
5926
|
+
CFormControlValidation.displayName = 'CFormControlValidation';
|
|
5967
5927
|
|
|
5968
5928
|
var CFormLabel = forwardRef(function (_a, ref) {
|
|
5969
5929
|
var children = _a.children, className = _a.className, customClassName = _a.customClassName, rest = __rest(_a, ["children", "className", "customClassName"]);
|
|
@@ -5979,7 +5939,7 @@ CFormLabel.displayName = 'CFormLabel';
|
|
|
5979
5939
|
|
|
5980
5940
|
var CFormCheck = forwardRef(function (_a, ref) {
|
|
5981
5941
|
var _b;
|
|
5982
|
-
var className = _a.className, button = _a.button, hitArea = _a.hitArea, id = _a.id, indeterminate = _a.indeterminate, inline = _a.inline, invalid = _a.invalid, label = _a.label, _c = _a.type, type = _c === void 0 ? 'checkbox' : _c, valid = _a.valid, rest = __rest(_a, ["className", "button", "hitArea", "id", "indeterminate", "inline", "invalid", "label", "type", "valid"]);
|
|
5942
|
+
var className = _a.className, button = _a.button, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, tooltipFeedback = _a.tooltipFeedback, hitArea = _a.hitArea, id = _a.id, indeterminate = _a.indeterminate, inline = _a.inline, invalid = _a.invalid, label = _a.label, _c = _a.type, type = _c === void 0 ? 'checkbox' : _c, valid = _a.valid, rest = __rest(_a, ["className", "button", "feedback", "feedbackInvalid", "feedbackValid", "floatingLabel", "tooltipFeedback", "hitArea", "id", "indeterminate", "inline", "invalid", "label", "type", "valid"]);
|
|
5983
5943
|
var inputRef = useRef(null);
|
|
5984
5944
|
var forkedRef = useForkedRef(ref, inputRef);
|
|
5985
5945
|
useEffect(function () {
|
|
@@ -6005,50 +5965,25 @@ var CFormCheck = forwardRef(function (_a, ref) {
|
|
|
6005
5965
|
var formControl = function () {
|
|
6006
5966
|
return React__default.createElement("input", __assign({ type: type, className: inputClassName, id: id }, rest, { ref: forkedRef }));
|
|
6007
5967
|
};
|
|
5968
|
+
var formValidation = function () { return (React__default.createElement(CFormControlValidation, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, invalid: invalid, tooltipFeedback: tooltipFeedback, valid: valid })); };
|
|
6008
5969
|
var formLabel = function () {
|
|
6009
5970
|
return (React__default.createElement(CFormLabel, __assign({ customClassName: labelClassName }, (id && { htmlFor: id })), label));
|
|
6010
5971
|
};
|
|
6011
5972
|
return button ? (React__default.createElement(React__default.Fragment, null,
|
|
6012
5973
|
formControl(),
|
|
6013
|
-
label && formLabel()
|
|
6014
|
-
|
|
6015
|
-
|
|
5974
|
+
label && formLabel(),
|
|
5975
|
+
formValidation())) : label ? (hitArea ? (React__default.createElement(React__default.Fragment, null,
|
|
5976
|
+
React__default.createElement(CFormLabel, __assign({ customClassName: className }, (id && { htmlFor: id })),
|
|
5977
|
+
formControl(),
|
|
5978
|
+
label),
|
|
5979
|
+
formValidation())) : (React__default.createElement("div", { className: _className },
|
|
6016
5980
|
formControl(),
|
|
6017
|
-
formLabel()
|
|
5981
|
+
formLabel(),
|
|
5982
|
+
formValidation()))) : (formControl());
|
|
6018
5983
|
});
|
|
6019
|
-
CFormCheck.propTypes = {
|
|
6020
|
-
button: PropTypes.object,
|
|
6021
|
-
className: PropTypes.string,
|
|
6022
|
-
hitArea: PropTypes.oneOf(['full']),
|
|
6023
|
-
id: PropTypes.string,
|
|
6024
|
-
indeterminate: PropTypes.bool,
|
|
6025
|
-
inline: PropTypes.bool,
|
|
6026
|
-
invalid: PropTypes.bool,
|
|
6027
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
6028
|
-
type: PropTypes.oneOf(['checkbox', 'radio']),
|
|
6029
|
-
valid: PropTypes.bool,
|
|
6030
|
-
};
|
|
5984
|
+
CFormCheck.propTypes = __assign({ button: PropTypes.object, className: PropTypes.string, hitArea: PropTypes.oneOf(['full']), id: PropTypes.string, indeterminate: PropTypes.bool, inline: PropTypes.bool, label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), type: PropTypes.oneOf(['checkbox', 'radio']) }, CFormControlValidation.propTypes);
|
|
6031
5985
|
CFormCheck.displayName = 'CFormCheck';
|
|
6032
5986
|
|
|
6033
|
-
var CFormFeedback = forwardRef(function (_a, ref) {
|
|
6034
|
-
var _b;
|
|
6035
|
-
var children = _a.children, className = _a.className, _c = _a.component, Component = _c === void 0 ? 'div' : _c, invalid = _a.invalid, tooltip = _a.tooltip, valid = _a.valid, rest = __rest(_a, ["children", "className", "component", "invalid", "tooltip", "valid"]);
|
|
6036
|
-
var _className = classNames((_b = {},
|
|
6037
|
-
_b["invalid-".concat(tooltip ? 'tooltip' : 'feedback')] = invalid,
|
|
6038
|
-
_b["valid-".concat(tooltip ? 'tooltip' : 'feedback')] = valid,
|
|
6039
|
-
_b), className);
|
|
6040
|
-
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6041
|
-
});
|
|
6042
|
-
CFormFeedback.propTypes = {
|
|
6043
|
-
children: PropTypes.node,
|
|
6044
|
-
className: PropTypes.string,
|
|
6045
|
-
component: PropTypes.elementType,
|
|
6046
|
-
invalid: PropTypes.bool,
|
|
6047
|
-
tooltip: PropTypes.bool,
|
|
6048
|
-
valid: PropTypes.bool,
|
|
6049
|
-
};
|
|
6050
|
-
CFormFeedback.displayName = 'CFormFeedback';
|
|
6051
|
-
|
|
6052
5987
|
var CFormFloating = forwardRef(function (_a, ref) {
|
|
6053
5988
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6054
5989
|
var _className = classNames('form-floating', className);
|
|
@@ -6060,62 +5995,81 @@ CFormFloating.propTypes = {
|
|
|
6060
5995
|
};
|
|
6061
5996
|
CFormFloating.displayName = 'CFormFloating';
|
|
6062
5997
|
|
|
5998
|
+
var CFormText = forwardRef(function (_a, ref) {
|
|
5999
|
+
var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'div' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
6000
|
+
var _className = classNames('form-text', className);
|
|
6001
|
+
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6002
|
+
});
|
|
6003
|
+
CFormText.propTypes = {
|
|
6004
|
+
children: PropTypes.node,
|
|
6005
|
+
className: PropTypes.string,
|
|
6006
|
+
component: PropTypes.elementType,
|
|
6007
|
+
};
|
|
6008
|
+
CFormText.displayName = 'CFormText';
|
|
6009
|
+
|
|
6010
|
+
var CFormControlWrapper = function (_a) {
|
|
6011
|
+
var children = _a.children, describedby = _a.describedby, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, id = _a.id, invalid = _a.invalid, label = _a.label, text = _a.text, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid;
|
|
6012
|
+
return floatingLabel ? (React__default.createElement(CFormFloating, null,
|
|
6013
|
+
children,
|
|
6014
|
+
React__default.createElement(CFormLabel, { htmlFor: id }, label || floatingLabel))) : (React__default.createElement(React__default.Fragment, null,
|
|
6015
|
+
label && React__default.createElement(CFormLabel, { htmlFor: id }, label),
|
|
6016
|
+
children,
|
|
6017
|
+
text && React__default.createElement(CFormText, { id: describedby }, text),
|
|
6018
|
+
React__default.createElement(CFormControlValidation, { describedby: describedby, feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, invalid: invalid, tooltipFeedback: tooltipFeedback, valid: valid })));
|
|
6019
|
+
};
|
|
6020
|
+
CFormControlWrapper.propTypes = __assign({ children: PropTypes.node, floatingLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), text: PropTypes.oneOfType([PropTypes.node, PropTypes.string]) }, CFormControlValidation.propTypes);
|
|
6021
|
+
CFormControlWrapper.displayName = 'CFormControlWrapper';
|
|
6022
|
+
|
|
6063
6023
|
var CFormInput = forwardRef(function (_a, ref) {
|
|
6064
6024
|
var _b;
|
|
6065
|
-
var children = _a.children, className = _a.className, invalid = _a.invalid, plainText = _a.plainText, size = _a.size,
|
|
6025
|
+
var children = _a.children, className = _a.className, _c = _a.delay, delay = _c === void 0 ? false : _c, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, id = _a.id, invalid = _a.invalid, label = _a.label, onChange = _a.onChange, plainText = _a.plainText, size = _a.size, text = _a.text, tooltipFeedback = _a.tooltipFeedback, _d = _a.type, type = _d === void 0 ? 'text' : _d, valid = _a.valid, rest = __rest(_a, ["children", "className", "delay", "feedback", "feedbackInvalid", "feedbackValid", "floatingLabel", "id", "invalid", "label", "onChange", "plainText", "size", "text", "tooltipFeedback", "type", "valid"]);
|
|
6026
|
+
var _e = useState(), value = _e[0], setValue = _e[1];
|
|
6027
|
+
useEffect(function () {
|
|
6028
|
+
var timeOutId = setTimeout(function () { return value && onChange && onChange(value); }, typeof delay === 'number' ? delay : 500);
|
|
6029
|
+
return function () { return clearTimeout(timeOutId); };
|
|
6030
|
+
}, [value]);
|
|
6066
6031
|
var _className = classNames(plainText ? 'form-control-plaintext' : 'form-control', (_b = {},
|
|
6067
6032
|
_b["form-control-".concat(size)] = size,
|
|
6068
6033
|
_b['form-control-color'] = type === 'color',
|
|
6069
6034
|
_b['is-invalid'] = invalid,
|
|
6070
6035
|
_b['is-valid'] = valid,
|
|
6071
6036
|
_b), className);
|
|
6072
|
-
return (React__default.createElement(
|
|
6037
|
+
return (React__default.createElement(CFormControlWrapper, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, id: id, invalid: invalid, label: label, text: text, tooltipFeedback: tooltipFeedback, valid: valid },
|
|
6038
|
+
React__default.createElement("input", __assign({ className: _className, id: id, type: type, onChange: function (event) { return (delay ? setValue(event) : onChange && onChange(event)); } }, rest, { ref: ref }), children)));
|
|
6073
6039
|
});
|
|
6074
|
-
CFormInput.propTypes = {
|
|
6075
|
-
children: PropTypes.node,
|
|
6076
|
-
className: PropTypes.string,
|
|
6077
|
-
invalid: PropTypes.bool,
|
|
6078
|
-
plainText: PropTypes.bool,
|
|
6079
|
-
size: PropTypes.oneOf(['sm', 'lg']),
|
|
6080
|
-
type: PropTypes.oneOfType([PropTypes.oneOf(['color', 'file', 'text']), PropTypes.string]),
|
|
6081
|
-
valid: PropTypes.bool,
|
|
6082
|
-
};
|
|
6040
|
+
CFormInput.propTypes = __assign({ className: PropTypes.string, id: PropTypes.string, delay: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]), plainText: PropTypes.bool, size: PropTypes.oneOf(['sm', 'lg']), type: PropTypes.oneOfType([PropTypes.oneOf(['color', 'file', 'text']), PropTypes.string]) }, CFormControlWrapper.propTypes);
|
|
6083
6041
|
CFormInput.displayName = 'CFormInput';
|
|
6084
6042
|
|
|
6085
6043
|
var CFormRange = forwardRef(function (_a, ref) {
|
|
6086
|
-
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
6044
|
+
var className = _a.className, label = _a.label, rest = __rest(_a, ["className", "label"]);
|
|
6087
6045
|
var _className = classNames('form-range', className);
|
|
6088
|
-
return React__default.createElement(
|
|
6046
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
6047
|
+
label && React__default.createElement(CFormLabel, { htmlFor: rest.id }, label),
|
|
6048
|
+
React__default.createElement("input", __assign({ type: "range", className: _className }, rest, { ref: ref }))));
|
|
6089
6049
|
});
|
|
6090
6050
|
CFormRange.propTypes = {
|
|
6091
6051
|
className: PropTypes.string,
|
|
6052
|
+
label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
6092
6053
|
};
|
|
6093
6054
|
CFormRange.displayName = 'CFormRange';
|
|
6094
6055
|
|
|
6095
6056
|
var CFormSelect = forwardRef(function (_a, ref) {
|
|
6096
6057
|
var _b;
|
|
6097
|
-
var children = _a.children, className = _a.className, htmlSize = _a.htmlSize, invalid = _a.invalid, options = _a.options, size = _a.size, valid = _a.valid, rest = __rest(_a, ["children", "className", "htmlSize", "invalid", "options", "size", "valid"]);
|
|
6058
|
+
var children = _a.children, className = _a.className, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, htmlSize = _a.htmlSize, id = _a.id, invalid = _a.invalid, label = _a.label, options = _a.options, size = _a.size, text = _a.text, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid, rest = __rest(_a, ["children", "className", "feedback", "feedbackInvalid", "feedbackValid", "floatingLabel", "htmlSize", "id", "invalid", "label", "options", "size", "text", "tooltipFeedback", "valid"]);
|
|
6098
6059
|
var _className = classNames('form-select', (_b = {},
|
|
6099
6060
|
_b["form-select-".concat(size)] = size,
|
|
6100
6061
|
_b['is-invalid'] = invalid,
|
|
6101
6062
|
_b['is-valid'] = valid,
|
|
6102
6063
|
_b), className);
|
|
6103
|
-
return (React__default.createElement(
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6064
|
+
return (React__default.createElement(CFormControlWrapper, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, id: id, invalid: invalid, label: label, text: text, tooltipFeedback: tooltipFeedback, valid: valid },
|
|
6065
|
+
React__default.createElement("select", __assign({ id: id, className: _className, size: htmlSize }, rest, { ref: ref }), options
|
|
6066
|
+
? options.map(function (option, index) {
|
|
6067
|
+
return (React__default.createElement("option", __assign({}, (typeof option === 'object' &&
|
|
6068
|
+
option.disabled && { disabled: option.disabled }), (typeof option === 'object' && option.value && { value: option.value }), { key: index }), typeof option === 'string' ? option : option.label));
|
|
6069
|
+
})
|
|
6070
|
+
: children)));
|
|
6109
6071
|
});
|
|
6110
|
-
CFormSelect.propTypes = {
|
|
6111
|
-
children: PropTypes.node,
|
|
6112
|
-
className: PropTypes.string,
|
|
6113
|
-
htmlSize: PropTypes.number,
|
|
6114
|
-
invalid: PropTypes.bool,
|
|
6115
|
-
options: PropTypes.array,
|
|
6116
|
-
size: PropTypes.oneOf(['sm', 'lg']),
|
|
6117
|
-
valid: PropTypes.bool,
|
|
6118
|
-
};
|
|
6072
|
+
CFormSelect.propTypes = __assign({ className: PropTypes.string, htmlSize: PropTypes.number, options: PropTypes.array }, CFormControlWrapper.propTypes);
|
|
6119
6073
|
CFormSelect.displayName = 'CFormSelect';
|
|
6120
6074
|
|
|
6121
6075
|
var CFormSwitch = forwardRef(function (_a, ref) {
|
|
@@ -6146,33 +6100,16 @@ CFormSwitch.propTypes = {
|
|
|
6146
6100
|
};
|
|
6147
6101
|
CFormSwitch.displayName = 'CFormSwitch';
|
|
6148
6102
|
|
|
6149
|
-
var CFormText = forwardRef(function (_a, ref) {
|
|
6150
|
-
var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'div' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
6151
|
-
var _className = classNames('form-text', className);
|
|
6152
|
-
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6153
|
-
});
|
|
6154
|
-
CFormText.propTypes = {
|
|
6155
|
-
children: PropTypes.node,
|
|
6156
|
-
className: PropTypes.string,
|
|
6157
|
-
component: PropTypes.elementType,
|
|
6158
|
-
};
|
|
6159
|
-
CFormText.displayName = 'CFormText';
|
|
6160
|
-
|
|
6161
6103
|
var CFormTextarea = forwardRef(function (_a, ref) {
|
|
6162
|
-
var children = _a.children, className = _a.className, invalid = _a.invalid, plainText = _a.plainText, valid = _a.valid, rest = __rest(_a, ["children", "className", "invalid", "plainText", "valid"]);
|
|
6104
|
+
var children = _a.children, className = _a.className, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingLabel = _a.floatingLabel, id = _a.id, invalid = _a.invalid, label = _a.label, plainText = _a.plainText, text = _a.text, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid, rest = __rest(_a, ["children", "className", "feedback", "feedbackInvalid", "feedbackValid", "floatingLabel", "id", "invalid", "label", "plainText", "text", "tooltipFeedback", "valid"]);
|
|
6163
6105
|
var _className = classNames(plainText ? 'form-control-plaintext' : 'form-control', {
|
|
6164
6106
|
'is-invalid': invalid,
|
|
6165
6107
|
'is-valid': valid,
|
|
6166
6108
|
}, className);
|
|
6167
|
-
return (React__default.createElement(
|
|
6109
|
+
return (React__default.createElement(CFormControlWrapper, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, id: id, invalid: invalid, label: label, text: text, tooltipFeedback: tooltipFeedback, valid: valid },
|
|
6110
|
+
React__default.createElement("textarea", __assign({ className: _className }, rest, { ref: ref }), children)));
|
|
6168
6111
|
});
|
|
6169
|
-
CFormTextarea.propTypes = {
|
|
6170
|
-
children: PropTypes.node,
|
|
6171
|
-
className: PropTypes.string,
|
|
6172
|
-
invalid: PropTypes.bool,
|
|
6173
|
-
plainText: PropTypes.bool,
|
|
6174
|
-
valid: PropTypes.bool,
|
|
6175
|
-
};
|
|
6112
|
+
CFormTextarea.propTypes = __assign({ className: PropTypes.string, id: PropTypes.string, plainText: PropTypes.bool }, CFormControlWrapper.propTypes);
|
|
6176
6113
|
CFormTextarea.displayName = 'CFormTextarea';
|
|
6177
6114
|
|
|
6178
6115
|
var CInputGroup = forwardRef(function (_a, ref) {
|
|
@@ -6202,6 +6139,153 @@ CInputGroupText.propTypes = {
|
|
|
6202
6139
|
};
|
|
6203
6140
|
CInputGroupText.displayName = 'CInputGroupText';
|
|
6204
6141
|
|
|
6142
|
+
var BREAKPOINTS$3 = [
|
|
6143
|
+
'xxl',
|
|
6144
|
+
'xl',
|
|
6145
|
+
'lg',
|
|
6146
|
+
'md',
|
|
6147
|
+
'sm',
|
|
6148
|
+
'xs',
|
|
6149
|
+
];
|
|
6150
|
+
var CCol = forwardRef(function (_a, ref) {
|
|
6151
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6152
|
+
var repsonsiveClassNames = [];
|
|
6153
|
+
BREAKPOINTS$3.forEach(function (bp) {
|
|
6154
|
+
var breakpoint = rest[bp];
|
|
6155
|
+
delete rest[bp];
|
|
6156
|
+
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
6157
|
+
if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
|
|
6158
|
+
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint));
|
|
6159
|
+
}
|
|
6160
|
+
if (typeof breakpoint === 'boolean') {
|
|
6161
|
+
repsonsiveClassNames.push("col".concat(infix));
|
|
6162
|
+
}
|
|
6163
|
+
if (breakpoint && typeof breakpoint === 'object') {
|
|
6164
|
+
if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
|
|
6165
|
+
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint.span));
|
|
6166
|
+
}
|
|
6167
|
+
if (typeof breakpoint.span === 'boolean') {
|
|
6168
|
+
repsonsiveClassNames.push("col".concat(infix));
|
|
6169
|
+
}
|
|
6170
|
+
if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
|
|
6171
|
+
repsonsiveClassNames.push("order".concat(infix, "-").concat(breakpoint.order));
|
|
6172
|
+
}
|
|
6173
|
+
if (typeof breakpoint.offset === 'number') {
|
|
6174
|
+
repsonsiveClassNames.push("offset".concat(infix, "-").concat(breakpoint.offset));
|
|
6175
|
+
}
|
|
6176
|
+
}
|
|
6177
|
+
});
|
|
6178
|
+
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'col', className);
|
|
6179
|
+
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6180
|
+
});
|
|
6181
|
+
var span = PropTypes.oneOfType([
|
|
6182
|
+
PropTypes.bool,
|
|
6183
|
+
PropTypes.number,
|
|
6184
|
+
PropTypes.string,
|
|
6185
|
+
PropTypes.oneOf(['auto']),
|
|
6186
|
+
]);
|
|
6187
|
+
var col = PropTypes.oneOfType([
|
|
6188
|
+
span,
|
|
6189
|
+
PropTypes.shape({
|
|
6190
|
+
span: span,
|
|
6191
|
+
offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
6192
|
+
order: PropTypes.oneOfType([
|
|
6193
|
+
PropTypes.oneOf(['first', 'last']),
|
|
6194
|
+
PropTypes.number,
|
|
6195
|
+
PropTypes.string,
|
|
6196
|
+
]),
|
|
6197
|
+
}),
|
|
6198
|
+
]);
|
|
6199
|
+
CCol.propTypes = {
|
|
6200
|
+
children: PropTypes.node,
|
|
6201
|
+
className: PropTypes.string,
|
|
6202
|
+
xs: col,
|
|
6203
|
+
sm: col,
|
|
6204
|
+
};
|
|
6205
|
+
CCol.displayName = 'CCol';
|
|
6206
|
+
|
|
6207
|
+
var BREAKPOINTS$2 = [
|
|
6208
|
+
'xxl',
|
|
6209
|
+
'xl',
|
|
6210
|
+
'lg',
|
|
6211
|
+
'md',
|
|
6212
|
+
'sm',
|
|
6213
|
+
'fluid',
|
|
6214
|
+
];
|
|
6215
|
+
var CContainer = forwardRef(function (_a, ref) {
|
|
6216
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6217
|
+
var repsonsiveClassNames = [];
|
|
6218
|
+
BREAKPOINTS$2.forEach(function (bp) {
|
|
6219
|
+
var breakpoint = rest[bp];
|
|
6220
|
+
delete rest[bp];
|
|
6221
|
+
breakpoint && repsonsiveClassNames.push("container-".concat(bp));
|
|
6222
|
+
});
|
|
6223
|
+
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'container', className);
|
|
6224
|
+
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6225
|
+
});
|
|
6226
|
+
CContainer.propTypes = {
|
|
6227
|
+
children: PropTypes.node,
|
|
6228
|
+
className: PropTypes.string,
|
|
6229
|
+
sm: PropTypes.bool,
|
|
6230
|
+
md: PropTypes.bool,
|
|
6231
|
+
lg: PropTypes.bool,
|
|
6232
|
+
xl: PropTypes.bool,
|
|
6233
|
+
xxl: PropTypes.bool,
|
|
6234
|
+
fluid: PropTypes.bool,
|
|
6235
|
+
};
|
|
6236
|
+
CContainer.displayName = 'CContainer';
|
|
6237
|
+
|
|
6238
|
+
var BREAKPOINTS$1 = [
|
|
6239
|
+
'xxl',
|
|
6240
|
+
'xl',
|
|
6241
|
+
'lg',
|
|
6242
|
+
'md',
|
|
6243
|
+
'sm',
|
|
6244
|
+
'xs',
|
|
6245
|
+
];
|
|
6246
|
+
var CRow = forwardRef(function (_a, ref) {
|
|
6247
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6248
|
+
var repsonsiveClassNames = [];
|
|
6249
|
+
BREAKPOINTS$1.forEach(function (bp) {
|
|
6250
|
+
var breakpoint = rest[bp];
|
|
6251
|
+
delete rest[bp];
|
|
6252
|
+
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
6253
|
+
if (typeof breakpoint === 'object') {
|
|
6254
|
+
if (breakpoint.cols) {
|
|
6255
|
+
repsonsiveClassNames.push("row-cols".concat(infix, "-").concat(breakpoint.cols));
|
|
6256
|
+
}
|
|
6257
|
+
if (typeof breakpoint.gutter === 'number') {
|
|
6258
|
+
repsonsiveClassNames.push("g".concat(infix, "-").concat(breakpoint.gutter));
|
|
6259
|
+
}
|
|
6260
|
+
if (typeof breakpoint.gutterX === 'number') {
|
|
6261
|
+
repsonsiveClassNames.push("gx".concat(infix, "-").concat(breakpoint.gutterX));
|
|
6262
|
+
}
|
|
6263
|
+
if (typeof breakpoint.gutterY === 'number') {
|
|
6264
|
+
repsonsiveClassNames.push("gy".concat(infix, "-").concat(breakpoint.gutterY));
|
|
6265
|
+
}
|
|
6266
|
+
}
|
|
6267
|
+
});
|
|
6268
|
+
var _className = classNames('row', repsonsiveClassNames, className);
|
|
6269
|
+
return (React__default.createElement("div", { className: _className, ref: ref }, children));
|
|
6270
|
+
});
|
|
6271
|
+
var bp = PropTypes.shape({
|
|
6272
|
+
cols: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.string]),
|
|
6273
|
+
gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
6274
|
+
gutterX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
6275
|
+
gutterY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
6276
|
+
});
|
|
6277
|
+
CRow.propTypes = {
|
|
6278
|
+
children: PropTypes.node,
|
|
6279
|
+
className: PropTypes.string,
|
|
6280
|
+
xs: bp,
|
|
6281
|
+
sm: bp,
|
|
6282
|
+
md: bp,
|
|
6283
|
+
lg: bp,
|
|
6284
|
+
xl: bp,
|
|
6285
|
+
xxl: bp,
|
|
6286
|
+
};
|
|
6287
|
+
CRow.displayName = 'CRow';
|
|
6288
|
+
|
|
6205
6289
|
var CHeader = forwardRef(function (_a, ref) {
|
|
6206
6290
|
var _b;
|
|
6207
6291
|
var children = _a.children, className = _a.className, container = _a.container, position = _a.position, rest = __rest(_a, ["children", "className", "container", "position"]);
|
|
@@ -6404,11 +6488,12 @@ CModalDialog.displayName = 'CModalDialog';
|
|
|
6404
6488
|
|
|
6405
6489
|
var CModalContext = createContext({});
|
|
6406
6490
|
var CModal = forwardRef(function (_a, ref) {
|
|
6407
|
-
var children = _a.children, alignment = _a.alignment, _b = _a.backdrop, backdrop = _b === void 0 ? true : _b, className = _a.className, _c = _a.duration, duration = _c === void 0 ? 150 : _c, fullscreen = _a.fullscreen, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onClose = _a.onClose, onClosePrevented = _a.onClosePrevented, onShow = _a.onShow, _e = _a.portal, portal = _e === void 0 ? true : _e, scrollable = _a.scrollable, size = _a.size, _f = _a.transition, transition = _f === void 0 ? true : _f, visible = _a.visible;
|
|
6491
|
+
var children = _a.children, alignment = _a.alignment, _b = _a.backdrop, backdrop = _b === void 0 ? true : _b, className = _a.className, _c = _a.duration, duration = _c === void 0 ? 150 : _c, fullscreen = _a.fullscreen, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onClose = _a.onClose, onClosePrevented = _a.onClosePrevented, onShow = _a.onShow, _e = _a.portal, portal = _e === void 0 ? true : _e, scrollable = _a.scrollable, size = _a.size, _f = _a.transition, transition = _f === void 0 ? true : _f, _g = _a.unmountOnClose, unmountOnClose = _g === void 0 ? true : _g, visible = _a.visible;
|
|
6408
6492
|
var modalRef = useRef(null);
|
|
6493
|
+
var modalContentRef = useRef(null);
|
|
6409
6494
|
var forkedRef = useForkedRef(ref, modalRef);
|
|
6410
|
-
var
|
|
6411
|
-
var
|
|
6495
|
+
var _h = useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
6496
|
+
var _j = useState(false), staticBackdrop = _j[0], setStaticBackdrop = _j[1];
|
|
6412
6497
|
useEffect(function () {
|
|
6413
6498
|
setVisible(visible);
|
|
6414
6499
|
}, [visible]);
|
|
@@ -6416,6 +6501,14 @@ var CModal = forwardRef(function (_a, ref) {
|
|
|
6416
6501
|
visible: _visible,
|
|
6417
6502
|
setVisible: setVisible,
|
|
6418
6503
|
};
|
|
6504
|
+
useEffect(function () {
|
|
6505
|
+
modalRef.current && modalRef.current.addEventListener('click', handleClickOutside);
|
|
6506
|
+
modalRef.current && modalRef.current.addEventListener('keyup', handleKeyDown);
|
|
6507
|
+
return function () {
|
|
6508
|
+
modalRef.current && modalRef.current.removeEventListener('click', handleClickOutside);
|
|
6509
|
+
modalRef.current && modalRef.current.removeEventListener('keyup', handleKeyDown);
|
|
6510
|
+
};
|
|
6511
|
+
}, [_visible]);
|
|
6419
6512
|
var handleDismiss = function () {
|
|
6420
6513
|
if (backdrop === 'static') {
|
|
6421
6514
|
return setStaticBackdrop(true);
|
|
@@ -6453,6 +6546,12 @@ var CModal = forwardRef(function (_a, ref) {
|
|
|
6453
6546
|
}
|
|
6454
6547
|
return function () { return document.body.classList.remove('modal-open'); };
|
|
6455
6548
|
}, [_visible]);
|
|
6549
|
+
var handleClickOutside = function (event) {
|
|
6550
|
+
if (modalContentRef.current &&
|
|
6551
|
+
!modalContentRef.current.contains(event.target)) {
|
|
6552
|
+
handleDismiss();
|
|
6553
|
+
}
|
|
6554
|
+
};
|
|
6456
6555
|
var handleKeyDown = useCallback(function (event) {
|
|
6457
6556
|
if (event.key === 'Escape' && keyboard) {
|
|
6458
6557
|
return handleDismiss();
|
|
@@ -6461,17 +6560,16 @@ var CModal = forwardRef(function (_a, ref) {
|
|
|
6461
6560
|
var modal = function (ref, transitionClass) {
|
|
6462
6561
|
return (React__default.createElement(CModalContext.Provider, { value: contextValues },
|
|
6463
6562
|
React__default.createElement("div", { className: classNames(_className, transitionClass), tabIndex: -1, role: "dialog", ref: ref },
|
|
6464
|
-
React__default.createElement(CModalDialog, { alignment: alignment, fullscreen: fullscreen, scrollable: scrollable, size: size
|
|
6465
|
-
React__default.createElement(CModalContent,
|
|
6563
|
+
React__default.createElement(CModalDialog, { alignment: alignment, fullscreen: fullscreen, scrollable: scrollable, size: size },
|
|
6564
|
+
React__default.createElement(CModalContent, { ref: modalContentRef }, children)))));
|
|
6466
6565
|
};
|
|
6467
6566
|
return (React__default.createElement(React__default.Fragment, null,
|
|
6468
|
-
React__default.createElement(
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
})),
|
|
6567
|
+
React__default.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: modalRef, onEnter: onShow, onExit: onClose, unmountOnExit: unmountOnClose, timeout: !transition ? 0 : duration }, function (state) {
|
|
6568
|
+
var transitionClass = getTransitionClass(state);
|
|
6569
|
+
return typeof window !== 'undefined' && portal
|
|
6570
|
+
? createPortal(modal(forkedRef, transitionClass), document.body)
|
|
6571
|
+
: modal(forkedRef, transitionClass);
|
|
6572
|
+
}),
|
|
6475
6573
|
typeof window !== 'undefined' && portal
|
|
6476
6574
|
? backdrop && createPortal(React__default.createElement(CBackdrop, { visible: _visible }), document.body)
|
|
6477
6575
|
: backdrop && React__default.createElement(CBackdrop, { visible: _visible })));
|
|
@@ -6494,6 +6592,7 @@ CModal.propTypes = {
|
|
|
6494
6592
|
scrollable: PropTypes.bool,
|
|
6495
6593
|
size: PropTypes.oneOf(['sm', 'lg', 'xl']),
|
|
6496
6594
|
transition: PropTypes.bool,
|
|
6595
|
+
unmountOnClose: PropTypes.bool,
|
|
6497
6596
|
visible: PropTypes.bool,
|
|
6498
6597
|
};
|
|
6499
6598
|
CModal.displayName = 'CModal';
|
|
@@ -6644,7 +6743,7 @@ var CNavGroup = forwardRef(function (_a, ref) {
|
|
|
6644
6743
|
var _className = classNames('nav-group', { show: _visible }, className);
|
|
6645
6744
|
return (React__default.createElement("li", __assign({ className: _className }, rest, { ref: ref }),
|
|
6646
6745
|
toggler && (React__default.createElement("a", { className: "nav-link nav-group-toggle", onClick: function (event) { return handleTogglerOnCLick(event); } }, toggler)),
|
|
6647
|
-
React__default.createElement(Transition$1, { in: _visible, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 300 }, function (state) { return (React__default.createElement("ul", { className: classNames('nav-group-items', {
|
|
6746
|
+
React__default.createElement(Transition$1, { in: _visible, nodeRef: navItemsRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 300 }, function (state) { return (React__default.createElement("ul", { className: classNames('nav-group-items', {
|
|
6648
6747
|
compact: compact,
|
|
6649
6748
|
}), style: __assign(__assign({}, style), transitionStyles[state]), ref: navItemsRef }, React__default.Children.map(children, function (child, index) {
|
|
6650
6749
|
if (React__default.isValidElement(child)) {
|
|
@@ -6756,46 +6855,150 @@ var CNavbarBrand = forwardRef(function (_a, ref) {
|
|
|
6756
6855
|
var _className = classNames('navbar-brand', className);
|
|
6757
6856
|
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6758
6857
|
});
|
|
6759
|
-
CNavbarBrand.propTypes = {
|
|
6858
|
+
CNavbarBrand.propTypes = {
|
|
6859
|
+
children: PropTypes.node,
|
|
6860
|
+
className: PropTypes.string,
|
|
6861
|
+
component: PropTypes.elementType,
|
|
6862
|
+
};
|
|
6863
|
+
CNavbarBrand.displayName = 'CNavbarBrand';
|
|
6864
|
+
|
|
6865
|
+
var CNavbarNav = forwardRef(function (_a, ref) {
|
|
6866
|
+
var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'ul' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
|
|
6867
|
+
var _className = classNames('navbar-nav', className);
|
|
6868
|
+
return (React__default.createElement(Component, __assign({ className: _className, role: "navigation" }, rest, { ref: ref }), children));
|
|
6869
|
+
});
|
|
6870
|
+
CNavbarNav.propTypes = {
|
|
6871
|
+
children: PropTypes.node,
|
|
6872
|
+
className: PropTypes.string,
|
|
6873
|
+
component: PropTypes.elementType,
|
|
6874
|
+
};
|
|
6875
|
+
CNavbarNav.displayName = 'CNavbarNav';
|
|
6876
|
+
|
|
6877
|
+
var CNavbarText = forwardRef(function (_a, ref) {
|
|
6878
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6879
|
+
var _className = classNames('navbar-text', className);
|
|
6880
|
+
return (React__default.createElement("span", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6881
|
+
});
|
|
6882
|
+
CNavbarText.propTypes = {
|
|
6883
|
+
children: PropTypes.node,
|
|
6884
|
+
className: PropTypes.string,
|
|
6885
|
+
};
|
|
6886
|
+
CNavbarText.displayName = 'CNavbarText';
|
|
6887
|
+
|
|
6888
|
+
var CNavbarToggler = forwardRef(function (_a, ref) {
|
|
6889
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6890
|
+
var _className = classNames('navbar-toggler', className);
|
|
6891
|
+
return (React__default.createElement("button", __assign({ type: "button", className: _className }, rest, { ref: ref }), children ? children : React__default.createElement("span", { className: "navbar-toggler-icon" })));
|
|
6892
|
+
});
|
|
6893
|
+
CNavbarToggler.propTypes = {
|
|
6894
|
+
children: PropTypes.node,
|
|
6895
|
+
className: PropTypes.string,
|
|
6896
|
+
};
|
|
6897
|
+
CNavbarToggler.displayName = 'CNavbarToggler';
|
|
6898
|
+
|
|
6899
|
+
var COffcanvas = forwardRef(function (_a, ref) {
|
|
6900
|
+
var _b;
|
|
6901
|
+
var children = _a.children, _c = _a.backdrop, backdrop = _c === void 0 ? true : _c, className = _a.className, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onHide = _a.onHide, onShow = _a.onShow, placement = _a.placement, _e = _a.portal, portal = _e === void 0 ? true : _e, _f = _a.scroll, scroll = _f === void 0 ? false : _f, _g = _a.visible, visible = _g === void 0 ? false : _g, rest = __rest(_a, ["children", "backdrop", "className", "keyboard", "onHide", "onShow", "placement", "portal", "scroll", "visible"]);
|
|
6902
|
+
var _h = useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
6903
|
+
var offcanvasRef = useRef(null);
|
|
6904
|
+
var forkedRef = useForkedRef(ref, offcanvasRef);
|
|
6905
|
+
useEffect(function () {
|
|
6906
|
+
setVisible(visible);
|
|
6907
|
+
}, [visible]);
|
|
6908
|
+
useEffect(function () {
|
|
6909
|
+
if (_visible) {
|
|
6910
|
+
if (!scroll) {
|
|
6911
|
+
document.body.style.overflow = 'hidden';
|
|
6912
|
+
document.body.style.paddingRight = '0px';
|
|
6913
|
+
}
|
|
6914
|
+
return;
|
|
6915
|
+
}
|
|
6916
|
+
if (!scroll) {
|
|
6917
|
+
document.body.style.removeProperty('overflow');
|
|
6918
|
+
document.body.style.removeProperty('padding-right');
|
|
6919
|
+
}
|
|
6920
|
+
}, [_visible]);
|
|
6921
|
+
var _className = classNames('offcanvas', (_b = {},
|
|
6922
|
+
_b["offcanvas-".concat(placement)] = placement,
|
|
6923
|
+
_b.show = _visible,
|
|
6924
|
+
_b), className);
|
|
6925
|
+
var transitionStyles = {
|
|
6926
|
+
entering: { visibility: 'visible' },
|
|
6927
|
+
entered: { visibility: 'visible' },
|
|
6928
|
+
exiting: { visibility: 'visible' },
|
|
6929
|
+
exited: { visibility: 'hidden' },
|
|
6930
|
+
};
|
|
6931
|
+
var handleDismiss = function () {
|
|
6932
|
+
setVisible(false);
|
|
6933
|
+
};
|
|
6934
|
+
var handleKeyDown = useCallback(function (event) {
|
|
6935
|
+
if (event.key === 'Escape' && keyboard) {
|
|
6936
|
+
return handleDismiss();
|
|
6937
|
+
}
|
|
6938
|
+
}, [ref, handleDismiss]);
|
|
6939
|
+
var offcanvas = function (ref, state) {
|
|
6940
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
6941
|
+
React__default.createElement("div", __assign({ className: _className, role: "dialog", style: __assign({}, transitionStyles[state]), tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: ref }), children)));
|
|
6942
|
+
};
|
|
6943
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
6944
|
+
React__default.createElement(Transition$1, { in: _visible, nodeRef: offcanvasRef, onEnter: onShow, onEntered: function () { var _a; return (_a = offcanvasRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, onExit: onHide, timeout: 300 }, function (state) {
|
|
6945
|
+
return typeof window !== 'undefined' && portal
|
|
6946
|
+
? createPortal(offcanvas(forkedRef, state), document.body)
|
|
6947
|
+
: offcanvas(forkedRef, state);
|
|
6948
|
+
}),
|
|
6949
|
+
typeof window !== 'undefined' && portal
|
|
6950
|
+
? backdrop &&
|
|
6951
|
+
createPortal(React__default.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }), document.body)
|
|
6952
|
+
: backdrop && (React__default.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }))));
|
|
6953
|
+
});
|
|
6954
|
+
COffcanvas.propTypes = {
|
|
6955
|
+
backdrop: PropTypes.bool,
|
|
6760
6956
|
children: PropTypes.node,
|
|
6761
6957
|
className: PropTypes.string,
|
|
6762
|
-
|
|
6958
|
+
keyboard: PropTypes.bool,
|
|
6959
|
+
onHide: PropTypes.func,
|
|
6960
|
+
onShow: PropTypes.func,
|
|
6961
|
+
placement: PropTypes.oneOf(['start', 'end', 'top', 'bottom'])
|
|
6962
|
+
.isRequired,
|
|
6963
|
+
portal: PropTypes.bool,
|
|
6964
|
+
scroll: PropTypes.bool,
|
|
6965
|
+
visible: PropTypes.bool,
|
|
6763
6966
|
};
|
|
6764
|
-
|
|
6967
|
+
COffcanvas.displayName = 'COffcanvas';
|
|
6765
6968
|
|
|
6766
|
-
var
|
|
6767
|
-
var children = _a.children,
|
|
6768
|
-
var _className = classNames('
|
|
6769
|
-
return (React__default.createElement(
|
|
6969
|
+
var COffcanvasBody = forwardRef(function (_a, ref) {
|
|
6970
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6971
|
+
var _className = classNames('offcanvas-body', className);
|
|
6972
|
+
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6770
6973
|
});
|
|
6771
|
-
|
|
6974
|
+
COffcanvasBody.propTypes = {
|
|
6772
6975
|
children: PropTypes.node,
|
|
6773
6976
|
className: PropTypes.string,
|
|
6774
|
-
component: PropTypes.elementType,
|
|
6775
6977
|
};
|
|
6776
|
-
|
|
6978
|
+
COffcanvasBody.displayName = 'COffcanvasBody';
|
|
6777
6979
|
|
|
6778
|
-
var
|
|
6980
|
+
var COffcanvasHeader = forwardRef(function (_a, ref) {
|
|
6779
6981
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6780
|
-
var _className = classNames('
|
|
6781
|
-
return (React__default.createElement("
|
|
6982
|
+
var _className = classNames('offcanvas-header', className);
|
|
6983
|
+
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6782
6984
|
});
|
|
6783
|
-
|
|
6985
|
+
COffcanvasHeader.propTypes = {
|
|
6784
6986
|
children: PropTypes.node,
|
|
6785
6987
|
className: PropTypes.string,
|
|
6786
6988
|
};
|
|
6787
|
-
|
|
6989
|
+
COffcanvasHeader.displayName = 'COffcanvasHeader';
|
|
6788
6990
|
|
|
6789
|
-
var
|
|
6790
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6791
|
-
var _className = classNames('
|
|
6792
|
-
return (React__default.createElement(
|
|
6991
|
+
var COffcanvasTitle = forwardRef(function (_a, ref) {
|
|
6992
|
+
var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'h5' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
|
|
6993
|
+
var _className = classNames('offcanvas-title', className);
|
|
6994
|
+
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6793
6995
|
});
|
|
6794
|
-
|
|
6996
|
+
COffcanvasTitle.propTypes = {
|
|
6795
6997
|
children: PropTypes.node,
|
|
6796
6998
|
className: PropTypes.string,
|
|
6999
|
+
component: PropTypes.elementType,
|
|
6797
7000
|
};
|
|
6798
|
-
|
|
7001
|
+
COffcanvasTitle.displayName = 'COffcanvasTitle';
|
|
6799
7002
|
|
|
6800
7003
|
var CPagination = forwardRef(function (_a, ref) {
|
|
6801
7004
|
var _b;
|
|
@@ -6870,66 +7073,6 @@ CPlaceholder.propTypes = {
|
|
|
6870
7073
|
};
|
|
6871
7074
|
CPlaceholder.displayName = 'CPlaceholder';
|
|
6872
7075
|
|
|
6873
|
-
var CPopover = function (_a) {
|
|
6874
|
-
var children = _a.children, content = _a.content, _b = _a.placement, placement = _b === void 0 ? 'top' : _b, _c = _a.offset, offset = _c === void 0 ? [0, 8] : _c, onHide = _a.onHide, onShow = _a.onShow, title = _a.title, _d = _a.trigger, trigger = _d === void 0 ? 'click' : _d, visible = _a.visible, rest = __rest(_a, ["children", "content", "placement", "offset", "onHide", "onShow", "title", "trigger", "visible"]);
|
|
6875
|
-
var _e = useState(visible), _visible = _e[0], setVisible = _e[1];
|
|
6876
|
-
var getTransitionClass = function (state) {
|
|
6877
|
-
return state === 'entering'
|
|
6878
|
-
? 'fade'
|
|
6879
|
-
: state === 'entered'
|
|
6880
|
-
? 'fade show'
|
|
6881
|
-
: state === 'exiting'
|
|
6882
|
-
? 'fade'
|
|
6883
|
-
: 'fade';
|
|
6884
|
-
};
|
|
6885
|
-
return (React__default.createElement(Manager, null,
|
|
6886
|
-
React__default.createElement(Reference, null, function (_a) {
|
|
6887
|
-
var ref = _a.ref;
|
|
6888
|
-
return React__default.cloneElement(children, __assign(__assign(__assign({ ref: ref }, ((trigger === 'click' || trigger.includes('click')) && {
|
|
6889
|
-
onClick: function () { return setVisible(!_visible); },
|
|
6890
|
-
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
6891
|
-
onFocus: function () { return setVisible(true); },
|
|
6892
|
-
onBlur: function () { return setVisible(false); },
|
|
6893
|
-
})), ((trigger === 'hover' || trigger.includes('hover')) && {
|
|
6894
|
-
onMouseEnter: function () { return setVisible(true); },
|
|
6895
|
-
onMouseLeave: function () { return setVisible(false); },
|
|
6896
|
-
})));
|
|
6897
|
-
}),
|
|
6898
|
-
typeof window !== 'undefined' &&
|
|
6899
|
-
createPortal(React__default.createElement(Transition$1, { in: _visible, onEnter: onShow, onExit: onHide, mountOnEnter: true, timeout: {
|
|
6900
|
-
enter: 0,
|
|
6901
|
-
exit: 200,
|
|
6902
|
-
}, unmountOnExit: true }, function (state) {
|
|
6903
|
-
var transitionClass = getTransitionClass(state);
|
|
6904
|
-
return (React__default.createElement(Popper, { placement: placement, modifiers: [
|
|
6905
|
-
{
|
|
6906
|
-
name: 'offset',
|
|
6907
|
-
options: {
|
|
6908
|
-
offset: offset,
|
|
6909
|
-
},
|
|
6910
|
-
},
|
|
6911
|
-
] }, function (_a) {
|
|
6912
|
-
var arrowProps = _a.arrowProps, style = _a.style, ref = _a.ref;
|
|
6913
|
-
return (React__default.createElement("div", __assign({ className: classNames("popover bs-popover-".concat(placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement), transitionClass), ref: ref, role: "tooltip", style: style }, rest),
|
|
6914
|
-
React__default.createElement("div", __assign({ className: "popover-arrow" }, arrowProps)),
|
|
6915
|
-
React__default.createElement("div", { className: "popover-header" }, title),
|
|
6916
|
-
React__default.createElement("div", { className: "popover-body" }, content)));
|
|
6917
|
-
}));
|
|
6918
|
-
}), document.body)));
|
|
6919
|
-
};
|
|
6920
|
-
CPopover.propTypes = {
|
|
6921
|
-
children: PropTypes.any,
|
|
6922
|
-
content: PropTypes.node,
|
|
6923
|
-
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
6924
|
-
offset: PropTypes.any,
|
|
6925
|
-
onHide: PropTypes.func,
|
|
6926
|
-
onShow: PropTypes.func,
|
|
6927
|
-
title: PropTypes.string,
|
|
6928
|
-
trigger: triggerPropType,
|
|
6929
|
-
visible: PropTypes.bool,
|
|
6930
|
-
};
|
|
6931
|
-
CPopover.displayName = 'CPopover';
|
|
6932
|
-
|
|
6933
7076
|
var CProgressBar = forwardRef(function (_a, ref) {
|
|
6934
7077
|
var _b;
|
|
6935
7078
|
var children = _a.children, animated = _a.animated, className = _a.className, color = _a.color, _c = _a.value, value = _c === void 0 ? 0 : _c, variant = _a.variant, rest = __rest(_a, ["children", "animated", "className", "color", "value", "variant"]);
|
|
@@ -6968,6 +7111,69 @@ CProgress.propTypes = {
|
|
|
6968
7111
|
};
|
|
6969
7112
|
CProgress.displayName = 'CProgress';
|
|
6970
7113
|
|
|
7114
|
+
var CPopover = function (_a) {
|
|
7115
|
+
var children = _a.children, content = _a.content, _b = _a.offset, offset = _b === void 0 ? [0, 8] : _b, onHide = _a.onHide, onShow = _a.onShow, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, title = _a.title, _d = _a.trigger, trigger = _d === void 0 ? 'click' : _d, visible = _a.visible, rest = __rest(_a, ["children", "content", "offset", "onHide", "onShow", "placement", "title", "trigger", "visible"]);
|
|
7116
|
+
var _e = useState(visible), _visible = _e[0], setVisible = _e[1];
|
|
7117
|
+
var popoverRef = useRef();
|
|
7118
|
+
var _f = useState(null), referenceElement = _f[0], setReferenceElement = _f[1];
|
|
7119
|
+
var _g = useState(null), popperElement = _g[0], setPopperElement = _g[1];
|
|
7120
|
+
var _h = useState(null), arrowElement = _h[0], setArrowElement = _h[1];
|
|
7121
|
+
var _j = usePopper(referenceElement, popperElement, {
|
|
7122
|
+
modifiers: [
|
|
7123
|
+
{ name: 'arrow', options: { element: arrowElement } },
|
|
7124
|
+
{
|
|
7125
|
+
name: 'offset',
|
|
7126
|
+
options: {
|
|
7127
|
+
offset: offset,
|
|
7128
|
+
},
|
|
7129
|
+
},
|
|
7130
|
+
],
|
|
7131
|
+
placement: placement,
|
|
7132
|
+
}), styles = _j.styles, attributes = _j.attributes;
|
|
7133
|
+
var getTransitionClass = function (state) {
|
|
7134
|
+
return state === 'entering'
|
|
7135
|
+
? 'fade'
|
|
7136
|
+
: state === 'entered'
|
|
7137
|
+
? 'fade show'
|
|
7138
|
+
: state === 'exiting'
|
|
7139
|
+
? 'fade'
|
|
7140
|
+
: 'fade';
|
|
7141
|
+
};
|
|
7142
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
7143
|
+
React__default.cloneElement(children, __assign(__assign(__assign({ ref: setReferenceElement }, ((trigger === 'click' || trigger.includes('click')) && {
|
|
7144
|
+
onClick: function () { return setVisible(!_visible); },
|
|
7145
|
+
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
7146
|
+
onFocus: function () { return setVisible(true); },
|
|
7147
|
+
onBlur: function () { return setVisible(false); },
|
|
7148
|
+
})), ((trigger === 'hover' || trigger.includes('hover')) && {
|
|
7149
|
+
onMouseEnter: function () { return setVisible(true); },
|
|
7150
|
+
onMouseLeave: function () { return setVisible(false); },
|
|
7151
|
+
}))),
|
|
7152
|
+
typeof window !== 'undefined' &&
|
|
7153
|
+
createPortal(React__default.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: popoverRef, onEnter: onShow, onExit: onHide, timeout: {
|
|
7154
|
+
enter: 0,
|
|
7155
|
+
exit: 200,
|
|
7156
|
+
}, unmountOnExit: true }, function (state) {
|
|
7157
|
+
var transitionClass = getTransitionClass(state);
|
|
7158
|
+
return (React__default.createElement("div", __assign({ className: classNames("popover bs-popover-".concat(placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement), transitionClass), ref: setPopperElement, role: "tooltip", style: styles.popper }, attributes.popper, rest),
|
|
7159
|
+
React__default.createElement("div", { className: "popover-arrow", style: styles.arrow, ref: setArrowElement }),
|
|
7160
|
+
React__default.createElement("div", { className: "popover-header" }, title),
|
|
7161
|
+
React__default.createElement("div", { className: "popover-body" }, content)));
|
|
7162
|
+
}), document.body)));
|
|
7163
|
+
};
|
|
7164
|
+
CPopover.propTypes = {
|
|
7165
|
+
children: PropTypes.any,
|
|
7166
|
+
content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
7167
|
+
offset: PropTypes.any,
|
|
7168
|
+
onHide: PropTypes.func,
|
|
7169
|
+
onShow: PropTypes.func,
|
|
7170
|
+
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
7171
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
7172
|
+
trigger: triggerPropType,
|
|
7173
|
+
visible: PropTypes.bool,
|
|
7174
|
+
};
|
|
7175
|
+
CPopover.displayName = 'CPopover';
|
|
7176
|
+
|
|
6971
7177
|
var isOnMobile = function (element) {
|
|
6972
7178
|
return Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'));
|
|
6973
7179
|
};
|
|
@@ -7080,110 +7286,6 @@ CSidebar.propTypes = {
|
|
|
7080
7286
|
};
|
|
7081
7287
|
CSidebar.displayName = 'CSidebar';
|
|
7082
7288
|
|
|
7083
|
-
var COffcanvas = forwardRef(function (_a, ref) {
|
|
7084
|
-
var _b;
|
|
7085
|
-
var children = _a.children, _c = _a.backdrop, backdrop = _c === void 0 ? true : _c, className = _a.className, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onHide = _a.onHide, onShow = _a.onShow, placement = _a.placement, _e = _a.portal, portal = _e === void 0 ? true : _e, _f = _a.scroll, scroll = _f === void 0 ? false : _f, _g = _a.visible, visible = _g === void 0 ? false : _g, rest = __rest(_a, ["children", "backdrop", "className", "keyboard", "onHide", "onShow", "placement", "portal", "scroll", "visible"]);
|
|
7086
|
-
var _h = useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
7087
|
-
var offcanvasRef = useRef(null);
|
|
7088
|
-
var forkedRef = useForkedRef(ref, offcanvasRef);
|
|
7089
|
-
useEffect(function () {
|
|
7090
|
-
setVisible(visible);
|
|
7091
|
-
}, [visible]);
|
|
7092
|
-
useEffect(function () {
|
|
7093
|
-
if (_visible) {
|
|
7094
|
-
if (!scroll) {
|
|
7095
|
-
document.body.style.overflow = 'hidden';
|
|
7096
|
-
document.body.style.paddingRight = '0px';
|
|
7097
|
-
}
|
|
7098
|
-
return;
|
|
7099
|
-
}
|
|
7100
|
-
if (!scroll) {
|
|
7101
|
-
document.body.style.removeProperty('overflow');
|
|
7102
|
-
document.body.style.removeProperty('padding-right');
|
|
7103
|
-
}
|
|
7104
|
-
}, [_visible]);
|
|
7105
|
-
var _className = classNames('offcanvas', (_b = {},
|
|
7106
|
-
_b["offcanvas-".concat(placement)] = placement,
|
|
7107
|
-
_b.show = _visible,
|
|
7108
|
-
_b), className);
|
|
7109
|
-
var transitionStyles = {
|
|
7110
|
-
entering: { visibility: 'visible' },
|
|
7111
|
-
entered: { visibility: 'visible' },
|
|
7112
|
-
exiting: { visibility: 'visible' },
|
|
7113
|
-
exited: { visibility: 'hidden' },
|
|
7114
|
-
};
|
|
7115
|
-
var handleDismiss = function () {
|
|
7116
|
-
setVisible(false);
|
|
7117
|
-
};
|
|
7118
|
-
var handleKeyDown = useCallback(function (event) {
|
|
7119
|
-
if (event.key === 'Escape' && keyboard) {
|
|
7120
|
-
return handleDismiss();
|
|
7121
|
-
}
|
|
7122
|
-
}, [ref, handleDismiss]);
|
|
7123
|
-
var offcanvas = function (ref, state) {
|
|
7124
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
7125
|
-
React__default.createElement("div", __assign({ className: _className, role: "dialog", style: __assign({}, transitionStyles[state]), tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: ref }), children)));
|
|
7126
|
-
};
|
|
7127
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
7128
|
-
React__default.createElement(Transition$1, { in: _visible, onEnter: onShow, onEntered: function () { var _a; return (_a = offcanvasRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, onExit: onHide, timeout: 300 }, function (state) {
|
|
7129
|
-
return typeof window !== 'undefined' && portal
|
|
7130
|
-
? createPortal(offcanvas(forkedRef, state), document.body)
|
|
7131
|
-
: offcanvas(forkedRef, state);
|
|
7132
|
-
}),
|
|
7133
|
-
typeof window !== 'undefined' && portal
|
|
7134
|
-
? backdrop &&
|
|
7135
|
-
createPortal(React__default.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }), document.body)
|
|
7136
|
-
: backdrop && (React__default.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }))));
|
|
7137
|
-
});
|
|
7138
|
-
COffcanvas.propTypes = {
|
|
7139
|
-
backdrop: PropTypes.bool,
|
|
7140
|
-
children: PropTypes.node,
|
|
7141
|
-
className: PropTypes.string,
|
|
7142
|
-
keyboard: PropTypes.bool,
|
|
7143
|
-
onHide: PropTypes.func,
|
|
7144
|
-
onShow: PropTypes.func,
|
|
7145
|
-
placement: PropTypes.oneOf(['start', 'end', 'top', 'bottom'])
|
|
7146
|
-
.isRequired,
|
|
7147
|
-
portal: PropTypes.bool,
|
|
7148
|
-
scroll: PropTypes.bool,
|
|
7149
|
-
visible: PropTypes.bool,
|
|
7150
|
-
};
|
|
7151
|
-
COffcanvas.displayName = 'COffcanvas';
|
|
7152
|
-
|
|
7153
|
-
var COffcanvasBody = forwardRef(function (_a, ref) {
|
|
7154
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7155
|
-
var _className = classNames('offcanvas-body', className);
|
|
7156
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7157
|
-
});
|
|
7158
|
-
COffcanvasBody.propTypes = {
|
|
7159
|
-
children: PropTypes.node,
|
|
7160
|
-
className: PropTypes.string,
|
|
7161
|
-
};
|
|
7162
|
-
COffcanvasBody.displayName = 'COffcanvasBody';
|
|
7163
|
-
|
|
7164
|
-
var COffcanvasHeader = forwardRef(function (_a, ref) {
|
|
7165
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7166
|
-
var _className = classNames('offcanvas-header', className);
|
|
7167
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7168
|
-
});
|
|
7169
|
-
COffcanvasHeader.propTypes = {
|
|
7170
|
-
children: PropTypes.node,
|
|
7171
|
-
className: PropTypes.string,
|
|
7172
|
-
};
|
|
7173
|
-
COffcanvasHeader.displayName = 'COffcanvasHeader';
|
|
7174
|
-
|
|
7175
|
-
var COffcanvasTitle = forwardRef(function (_a, ref) {
|
|
7176
|
-
var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'h5' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
|
|
7177
|
-
var _className = classNames('offcanvas-title', className);
|
|
7178
|
-
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7179
|
-
});
|
|
7180
|
-
COffcanvasTitle.propTypes = {
|
|
7181
|
-
children: PropTypes.node,
|
|
7182
|
-
className: PropTypes.string,
|
|
7183
|
-
component: PropTypes.elementType,
|
|
7184
|
-
};
|
|
7185
|
-
COffcanvasTitle.displayName = 'COffcanvasTitle';
|
|
7186
|
-
|
|
7187
7289
|
var CSidebarBrand = forwardRef(function (_a, ref) {
|
|
7188
7290
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7189
7291
|
var _className = classNames('sidebar-brand', className);
|
|
@@ -7400,15 +7502,17 @@ CTabContent.displayName = 'CTabContent';
|
|
|
7400
7502
|
|
|
7401
7503
|
var CTabPane = forwardRef(function (_a, ref) {
|
|
7402
7504
|
var children = _a.children, className = _a.className, onHide = _a.onHide, onShow = _a.onShow, visible = _a.visible, rest = __rest(_a, ["children", "className", "onHide", "onShow", "visible"]);
|
|
7505
|
+
var tabPaneRef = useRef();
|
|
7506
|
+
var forkedRef = useForkedRef(ref, tabPaneRef);
|
|
7403
7507
|
var getTransitionClass = function (state) {
|
|
7404
7508
|
return state === 'entered' && 'show';
|
|
7405
7509
|
};
|
|
7406
7510
|
var _className = classNames('tab-pane', 'fade', {
|
|
7407
7511
|
active: visible,
|
|
7408
7512
|
}, className);
|
|
7409
|
-
return (React__default.createElement(Transition$1, { in: visible, onEnter: onShow, onExit: onHide, timeout: 150 }, function (state) {
|
|
7513
|
+
return (React__default.createElement(Transition$1, { in: visible, nodeRef: tabPaneRef, onEnter: onShow, onExit: onHide, timeout: 150 }, function (state) {
|
|
7410
7514
|
var transitionClass = getTransitionClass(state);
|
|
7411
|
-
return (React__default.createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref:
|
|
7515
|
+
return (React__default.createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: forkedRef }), children));
|
|
7412
7516
|
}));
|
|
7413
7517
|
});
|
|
7414
7518
|
CTabPane.propTypes = {
|
|
@@ -7424,6 +7528,8 @@ var CToastContext = createContext({});
|
|
|
7424
7528
|
var CToast = forwardRef(function (_a, ref) {
|
|
7425
7529
|
var _b;
|
|
7426
7530
|
var children = _a.children, _c = _a.animation, animation = _c === void 0 ? true : _c, _d = _a.autohide, autohide = _d === void 0 ? true : _d, className = _a.className, color = _a.color, _e = _a.delay, delay = _e === void 0 ? 5000 : _e, index = _a.index, key = _a.key, _f = _a.visible, visible = _f === void 0 ? false : _f, onClose = _a.onClose, onShow = _a.onShow, rest = __rest(_a, ["children", "animation", "autohide", "className", "color", "delay", "index", "key", "visible", "onClose", "onShow"]);
|
|
7531
|
+
var toastRef = useRef();
|
|
7532
|
+
var forkedRef = useForkedRef(ref, toastRef);
|
|
7427
7533
|
var _g = useState(false), _visible = _g[0], setVisible = _g[1];
|
|
7428
7534
|
var timeout = useRef();
|
|
7429
7535
|
useEffect(function () {
|
|
@@ -7461,10 +7567,10 @@ var CToast = forwardRef(function (_a, ref) {
|
|
|
7461
7567
|
? 'showing'
|
|
7462
7568
|
: 'fade';
|
|
7463
7569
|
};
|
|
7464
|
-
return (React__default.createElement(Transition$1, { in: _visible, onEnter: function () { return onShow && onShow(index ? index : null); }, onExited: function () { return onClose && onClose(index ? index : null); }, timeout: 250, unmountOnExit: true }, function (state) {
|
|
7570
|
+
return (React__default.createElement(Transition$1, { in: _visible, nodeRef: toastRef, onEnter: function () { return onShow && onShow(index ? index : null); }, onExited: function () { return onClose && onClose(index ? index : null); }, timeout: 250, unmountOnExit: true }, function (state) {
|
|
7465
7571
|
var transitionClass = getTransitionClass(state);
|
|
7466
7572
|
return (React__default.createElement(CToastContext.Provider, { value: contextValues },
|
|
7467
|
-
React__default.createElement("div", __assign({ className: classNames(_className, transitionClass), "aria-live": "assertive", "aria-atomic": "true", role: "alert", onMouseEnter: function () { return clearTimeout(timeout.current); }, onMouseLeave: function () { return _autohide; } }, rest, { key: key, ref:
|
|
7573
|
+
React__default.createElement("div", __assign({ className: classNames(_className, transitionClass), "aria-live": "assertive", "aria-atomic": "true", role: "alert", onMouseEnter: function () { return clearTimeout(timeout.current); }, onMouseLeave: function () { return _autohide; } }, rest, { key: key, ref: forkedRef }), children)));
|
|
7468
7574
|
}));
|
|
7469
7575
|
});
|
|
7470
7576
|
CToast.propTypes = {
|
|
@@ -7574,8 +7680,24 @@ CToaster.propTypes = {
|
|
|
7574
7680
|
CToaster.displayName = 'CToaster';
|
|
7575
7681
|
|
|
7576
7682
|
var CTooltip = function (_a) {
|
|
7577
|
-
var children = _a.children, content = _a.content, _b = _a.
|
|
7578
|
-
var
|
|
7683
|
+
var children = _a.children, content = _a.content, _b = _a.offset, offset = _b === void 0 ? [0, 0] : _b, onHide = _a.onHide, onShow = _a.onShow, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, _d = _a.trigger, trigger = _d === void 0 ? 'hover' : _d, visible = _a.visible, rest = __rest(_a, ["children", "content", "offset", "onHide", "onShow", "placement", "trigger", "visible"]);
|
|
7684
|
+
var tooltipRef = useRef();
|
|
7685
|
+
var _e = useState(visible), _visible = _e[0], setVisible = _e[1];
|
|
7686
|
+
var _f = useState(null), referenceElement = _f[0], setReferenceElement = _f[1];
|
|
7687
|
+
var _g = useState(null), popperElement = _g[0], setPopperElement = _g[1];
|
|
7688
|
+
var _h = useState(null), arrowElement = _h[0], setArrowElement = _h[1];
|
|
7689
|
+
var _j = usePopper(referenceElement, popperElement, {
|
|
7690
|
+
modifiers: [
|
|
7691
|
+
{ name: 'arrow', options: { element: arrowElement } },
|
|
7692
|
+
{
|
|
7693
|
+
name: 'offset',
|
|
7694
|
+
options: {
|
|
7695
|
+
offset: offset,
|
|
7696
|
+
},
|
|
7697
|
+
},
|
|
7698
|
+
],
|
|
7699
|
+
placement: placement,
|
|
7700
|
+
}), styles = _j.styles, attributes = _j.attributes;
|
|
7579
7701
|
var getTransitionClass = function (state) {
|
|
7580
7702
|
return state === 'entering'
|
|
7581
7703
|
? 'fade'
|
|
@@ -7585,39 +7707,34 @@ var CTooltip = function (_a) {
|
|
|
7585
7707
|
? 'fade'
|
|
7586
7708
|
: 'fade';
|
|
7587
7709
|
};
|
|
7588
|
-
return (React__default.createElement(
|
|
7589
|
-
React__default.
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
onMouseLeave: function () { return setVisible(false); },
|
|
7599
|
-
})));
|
|
7600
|
-
}),
|
|
7710
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
7711
|
+
React__default.cloneElement(children, __assign(__assign(__assign({ ref: setReferenceElement }, ((trigger === 'click' || trigger.includes('click')) && {
|
|
7712
|
+
onClick: function () { return setVisible(!_visible); },
|
|
7713
|
+
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
7714
|
+
onFocus: function () { return setVisible(true); },
|
|
7715
|
+
onBlur: function () { return setVisible(false); },
|
|
7716
|
+
})), ((trigger === 'hover' || trigger.includes('hover')) && {
|
|
7717
|
+
onMouseEnter: function () { return setVisible(true); },
|
|
7718
|
+
onMouseLeave: function () { return setVisible(false); },
|
|
7719
|
+
}))),
|
|
7601
7720
|
typeof window !== 'undefined' &&
|
|
7602
|
-
createPortal(React__default.createElement(Transition$1, { in: _visible, mountOnEnter: true, onEnter: onShow, onExit: onHide, timeout: {
|
|
7721
|
+
createPortal(React__default.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: tooltipRef, onEnter: onShow, onExit: onHide, timeout: {
|
|
7603
7722
|
enter: 0,
|
|
7604
7723
|
exit: 200,
|
|
7605
7724
|
}, unmountOnExit: true }, function (state) {
|
|
7606
7725
|
var transitionClass = getTransitionClass(state);
|
|
7607
|
-
return (React__default.createElement(
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
React__default.createElement("div", __assign({ className: "tooltip-arrow" }, arrowProps)),
|
|
7611
|
-
React__default.createElement("div", { className: "tooltip-inner" }, content)));
|
|
7612
|
-
}));
|
|
7726
|
+
return (React__default.createElement("div", __assign({ className: classNames("tooltip bs-tooltip-".concat(placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement), transitionClass), ref: setPopperElement, role: "tooltip", style: styles.popper }, attributes.popper, rest),
|
|
7727
|
+
React__default.createElement("div", { className: "tooltip-arrow", style: styles.arrow, ref: setArrowElement }),
|
|
7728
|
+
React__default.createElement("div", { className: "tooltip-inner" }, content)));
|
|
7613
7729
|
}), document.body)));
|
|
7614
7730
|
};
|
|
7615
7731
|
CTooltip.propTypes = {
|
|
7616
7732
|
children: PropTypes.any,
|
|
7617
|
-
content: PropTypes.node,
|
|
7618
|
-
|
|
7733
|
+
content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
7734
|
+
offset: PropTypes.any,
|
|
7619
7735
|
onHide: PropTypes.func,
|
|
7620
7736
|
onShow: PropTypes.func,
|
|
7737
|
+
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
7621
7738
|
trigger: triggerPropType,
|
|
7622
7739
|
visible: PropTypes.bool,
|
|
7623
7740
|
};
|