@coreui/react 4.1.1 → 4.2.1
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/CCardImage.d.ts +2 -2
- 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 +2 -2
- 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 +6 -2
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/index.d.ts +0 -120
- package/dist/index.es.js +668 -557
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +668 -557
- 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/CCardImage.tsx +2 -2
- 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 +59 -57
- 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 +63 -45
- package/src/components/tooltip/index.ts +3 -0
- package/src/index.ts +0 -242
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
29
29
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
30
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
/******************************************************************************
|
|
33
33
|
Copyright (c) Microsoft Corporation.
|
|
34
34
|
|
|
35
35
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -385,6 +385,8 @@ var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
385
385
|
|
|
386
386
|
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
387
387
|
|
|
388
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
389
|
+
|
|
388
390
|
/**
|
|
389
391
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
390
392
|
*
|
|
@@ -397,7 +399,7 @@ var printWarning$2 = function() {};
|
|
|
397
399
|
if (process.env.NODE_ENV !== 'production') {
|
|
398
400
|
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
399
401
|
var loggedTypeFailures = {};
|
|
400
|
-
var has$1 =
|
|
402
|
+
var has$1 = has$2;
|
|
401
403
|
|
|
402
404
|
printWarning$2 = function(text) {
|
|
403
405
|
var message = 'Warning: ' + text;
|
|
@@ -409,7 +411,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
409
411
|
// This error was thrown as a convenience so that you can use this stack
|
|
410
412
|
// to find the callsite that caused this warning to fire.
|
|
411
413
|
throw new Error(message);
|
|
412
|
-
} catch (x) {}
|
|
414
|
+
} catch (x) { /**/ }
|
|
413
415
|
};
|
|
414
416
|
}
|
|
415
417
|
|
|
@@ -438,7 +440,8 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
438
440
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
439
441
|
var err = Error(
|
|
440
442
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
441
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
443
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
444
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
442
445
|
);
|
|
443
446
|
err.name = 'Invariant Violation';
|
|
444
447
|
throw err;
|
|
@@ -497,9 +500,9 @@ var ReactIs$1 = reactIs.exports;
|
|
|
497
500
|
var assign = objectAssign;
|
|
498
501
|
|
|
499
502
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
503
|
+
var has = has$2;
|
|
500
504
|
var checkPropTypes = checkPropTypes_1;
|
|
501
505
|
|
|
502
|
-
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
503
506
|
var printWarning$1 = function() {};
|
|
504
507
|
|
|
505
508
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -600,6 +603,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
600
603
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
601
604
|
var ReactPropTypes = {
|
|
602
605
|
array: createPrimitiveTypeChecker('array'),
|
|
606
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
603
607
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
604
608
|
func: createPrimitiveTypeChecker('function'),
|
|
605
609
|
number: createPrimitiveTypeChecker('number'),
|
|
@@ -645,8 +649,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
645
649
|
* is prohibitively expensive if they are created too often, such as what
|
|
646
650
|
* happens in oneOfType() for any type before the one that matched.
|
|
647
651
|
*/
|
|
648
|
-
function PropTypeError(message) {
|
|
652
|
+
function PropTypeError(message, data) {
|
|
649
653
|
this.message = message;
|
|
654
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
650
655
|
this.stack = '';
|
|
651
656
|
}
|
|
652
657
|
// Make `instanceof Error` still work for returned errors.
|
|
@@ -681,7 +686,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
681
686
|
) {
|
|
682
687
|
printWarning$1(
|
|
683
688
|
'You are manually calling a React.PropTypes validation ' +
|
|
684
|
-
'function for the `' + propFullName + '` prop on `' + componentName
|
|
689
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
685
690
|
'and will throw in the standalone `prop-types` package. ' +
|
|
686
691
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
687
692
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
@@ -720,7 +725,10 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
720
725
|
// 'of type `object`'.
|
|
721
726
|
var preciseType = getPreciseType(propValue);
|
|
722
727
|
|
|
723
|
-
return new PropTypeError(
|
|
728
|
+
return new PropTypeError(
|
|
729
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
730
|
+
{expectedType: expectedType}
|
|
731
|
+
);
|
|
724
732
|
}
|
|
725
733
|
return null;
|
|
726
734
|
}
|
|
@@ -864,14 +872,19 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
864
872
|
}
|
|
865
873
|
|
|
866
874
|
function validate(props, propName, componentName, location, propFullName) {
|
|
875
|
+
var expectedTypes = [];
|
|
867
876
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
868
877
|
var checker = arrayOfTypeCheckers[i];
|
|
869
|
-
|
|
878
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
879
|
+
if (checkerResult == null) {
|
|
870
880
|
return null;
|
|
871
881
|
}
|
|
882
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
883
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
884
|
+
}
|
|
872
885
|
}
|
|
873
|
-
|
|
874
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '
|
|
886
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
887
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
875
888
|
}
|
|
876
889
|
return createChainableTypeChecker(validate);
|
|
877
890
|
}
|
|
@@ -886,6 +899,13 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
886
899
|
return createChainableTypeChecker(validate);
|
|
887
900
|
}
|
|
888
901
|
|
|
902
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
903
|
+
return new PropTypeError(
|
|
904
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
905
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
906
|
+
);
|
|
907
|
+
}
|
|
908
|
+
|
|
889
909
|
function createShapeTypeChecker(shapeTypes) {
|
|
890
910
|
function validate(props, propName, componentName, location, propFullName) {
|
|
891
911
|
var propValue = props[propName];
|
|
@@ -895,8 +915,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
895
915
|
}
|
|
896
916
|
for (var key in shapeTypes) {
|
|
897
917
|
var checker = shapeTypes[key];
|
|
898
|
-
if (
|
|
899
|
-
|
|
918
|
+
if (typeof checker !== 'function') {
|
|
919
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
900
920
|
}
|
|
901
921
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
902
922
|
if (error) {
|
|
@@ -915,16 +935,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
915
935
|
if (propType !== 'object') {
|
|
916
936
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
917
937
|
}
|
|
918
|
-
// We need to check all keys in case some are required but missing from
|
|
919
|
-
// props.
|
|
938
|
+
// We need to check all keys in case some are required but missing from props.
|
|
920
939
|
var allKeys = assign({}, props[propName], shapeTypes);
|
|
921
940
|
for (var key in allKeys) {
|
|
922
941
|
var checker = shapeTypes[key];
|
|
942
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
943
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
944
|
+
}
|
|
923
945
|
if (!checker) {
|
|
924
946
|
return new PropTypeError(
|
|
925
947
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
926
948
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
927
|
-
'\nValid keys: ' +
|
|
949
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
928
950
|
);
|
|
929
951
|
}
|
|
930
952
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
@@ -1109,6 +1131,7 @@ var factoryWithThrowingShims = function() {
|
|
|
1109
1131
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1110
1132
|
var ReactPropTypes = {
|
|
1111
1133
|
array: shim,
|
|
1134
|
+
bigint: shim,
|
|
1112
1135
|
bool: shim,
|
|
1113
1136
|
func: shim,
|
|
1114
1137
|
number: shim,
|
|
@@ -2483,7 +2506,7 @@ var CCollapse = React.forwardRef(function (_a, ref) {
|
|
|
2483
2506
|
var _className = classNames({
|
|
2484
2507
|
'collapse-horizontal': horizontal,
|
|
2485
2508
|
}, className);
|
|
2486
|
-
return (React__default["default"].createElement(CSSTransition$1, { in: visible, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 350 }, function (state) {
|
|
2509
|
+
return (React__default["default"].createElement(CSSTransition$1, { in: visible, nodeRef: collapseRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 350 }, function (state) {
|
|
2487
2510
|
var transitionClass = getTransitionClass(state);
|
|
2488
2511
|
var currentHeight = height === 0 ? null : { height: height };
|
|
2489
2512
|
var currentWidth = width === 0 ? null : { width: width };
|
|
@@ -2517,7 +2540,7 @@ var CAccordionButton = React.forwardRef(function (_a, ref) {
|
|
|
2517
2540
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2518
2541
|
var _b = React.useContext(CAccordionItemContext), visible = _b.visible, setVisible = _b.setVisible;
|
|
2519
2542
|
var _className = classNames('accordion-button', { collapsed: !visible }, className);
|
|
2520
|
-
return (React__default["default"].createElement("button", __assign({ className: _className
|
|
2543
|
+
return (React__default["default"].createElement("button", __assign({ type: "button", className: _className, "aria-expanded": !visible, onClick: function () { return setVisible(!visible); } }, rest, { ref: ref }), children));
|
|
2521
2544
|
});
|
|
2522
2545
|
CAccordionButton.propTypes = {
|
|
2523
2546
|
children: PropTypes.node,
|
|
@@ -2615,6 +2638,8 @@ CCloseButton.displayName = 'CCloseButton';
|
|
|
2615
2638
|
|
|
2616
2639
|
var CAlert = React.forwardRef(function (_a, ref) {
|
|
2617
2640
|
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"]);
|
|
2641
|
+
var alertRef = React.useRef(null);
|
|
2642
|
+
var forkedRef = useForkedRef(ref, alertRef);
|
|
2618
2643
|
var _d = React.useState(visible), _visible = _d[0], setVisible = _d[1];
|
|
2619
2644
|
React.useEffect(function () {
|
|
2620
2645
|
setVisible(visible);
|
|
@@ -2625,9 +2650,9 @@ var CAlert = React.forwardRef(function (_a, ref) {
|
|
|
2625
2650
|
var getTransitionClass = function (state) {
|
|
2626
2651
|
return state === 'entered' && 'show';
|
|
2627
2652
|
};
|
|
2628
|
-
return (React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, onExit: onClose, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2653
|
+
return (React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: alertRef, onExit: onClose, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2629
2654
|
var transitionClass = getTransitionClass(state);
|
|
2630
|
-
return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass), role: "alert" }, rest, { ref:
|
|
2655
|
+
return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass), role: "alert" }, rest, { ref: forkedRef }),
|
|
2631
2656
|
children,
|
|
2632
2657
|
dismissible && React__default["default"].createElement(CCloseButton, { onClick: function () { return setVisible(false); } })));
|
|
2633
2658
|
}));
|
|
@@ -2711,6 +2736,25 @@ CAvatar.propTypes = {
|
|
|
2711
2736
|
};
|
|
2712
2737
|
CAvatar.displayName = 'CAvatar';
|
|
2713
2738
|
|
|
2739
|
+
var CBackdrop = React.forwardRef(function (_a, ref) {
|
|
2740
|
+
var _b = _a.className, className = _b === void 0 ? 'modal-backdrop' : _b, visible = _a.visible, rest = __rest(_a, ["className", "visible"]);
|
|
2741
|
+
var backdropRef = React.useRef(null);
|
|
2742
|
+
var forkedRef = useForkedRef(ref, backdropRef);
|
|
2743
|
+
var _className = classNames(className, 'fade');
|
|
2744
|
+
var getTransitionClass = function (state) {
|
|
2745
|
+
return state === 'entered' && 'show';
|
|
2746
|
+
};
|
|
2747
|
+
return (React__default["default"].createElement(Transition$1, { in: visible, mountOnEnter: true, nodeRef: backdropRef, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2748
|
+
var transitionClass = getTransitionClass(state);
|
|
2749
|
+
return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: forkedRef })));
|
|
2750
|
+
}));
|
|
2751
|
+
});
|
|
2752
|
+
CBackdrop.propTypes = {
|
|
2753
|
+
className: PropTypes.string,
|
|
2754
|
+
visible: PropTypes.bool,
|
|
2755
|
+
};
|
|
2756
|
+
CBackdrop.displayName = 'CBackdrop';
|
|
2757
|
+
|
|
2714
2758
|
var CBadge = React.forwardRef(function (_a, ref) {
|
|
2715
2759
|
var _b;
|
|
2716
2760
|
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"]);
|
|
@@ -2738,23 +2782,6 @@ CBadge.propTypes = {
|
|
|
2738
2782
|
};
|
|
2739
2783
|
CBadge.displayName = 'CBadge';
|
|
2740
2784
|
|
|
2741
|
-
var CBackdrop = React.forwardRef(function (_a, ref) {
|
|
2742
|
-
var _b = _a.className, className = _b === void 0 ? 'modal-backdrop' : _b, visible = _a.visible, rest = __rest(_a, ["className", "visible"]);
|
|
2743
|
-
var _className = classNames(className, 'fade');
|
|
2744
|
-
var getTransitionClass = function (state) {
|
|
2745
|
-
return state === 'entered' && 'show';
|
|
2746
|
-
};
|
|
2747
|
-
return (React__default["default"].createElement(Transition$1, { in: visible, mountOnEnter: true, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2748
|
-
var transitionClass = getTransitionClass(state);
|
|
2749
|
-
return React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: ref }));
|
|
2750
|
-
}));
|
|
2751
|
-
});
|
|
2752
|
-
CBackdrop.propTypes = {
|
|
2753
|
-
className: PropTypes.string,
|
|
2754
|
-
visible: PropTypes.bool,
|
|
2755
|
-
};
|
|
2756
|
-
CBackdrop.displayName = 'CBackdrop';
|
|
2757
|
-
|
|
2758
2785
|
var CBreadcrumb = React.forwardRef(function (_a, ref) {
|
|
2759
2786
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2760
2787
|
var _className = classNames('breadcrumb', className);
|
|
@@ -2800,6 +2827,17 @@ CButton.propTypes = {
|
|
|
2800
2827
|
};
|
|
2801
2828
|
CButton.displayName = 'CButton';
|
|
2802
2829
|
|
|
2830
|
+
var CButtonToolbar = React.forwardRef(function (_a, ref) {
|
|
2831
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2832
|
+
var _className = classNames('btn-toolbar', className);
|
|
2833
|
+
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
2834
|
+
});
|
|
2835
|
+
CButtonToolbar.propTypes = {
|
|
2836
|
+
children: PropTypes.node,
|
|
2837
|
+
className: PropTypes.string,
|
|
2838
|
+
};
|
|
2839
|
+
CButtonToolbar.displayName = 'CButtonToolbar';
|
|
2840
|
+
|
|
2803
2841
|
var CButtonGroup = React.forwardRef(function (_a, ref) {
|
|
2804
2842
|
var _b;
|
|
2805
2843
|
var children = _a.children, className = _a.className, size = _a.size, vertical = _a.vertical, rest = __rest(_a, ["children", "className", "size", "vertical"]);
|
|
@@ -2814,17 +2852,6 @@ CButtonGroup.propTypes = {
|
|
|
2814
2852
|
};
|
|
2815
2853
|
CButtonGroup.displayName = 'CButtonGroup';
|
|
2816
2854
|
|
|
2817
|
-
var CButtonToolbar = React.forwardRef(function (_a, ref) {
|
|
2818
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2819
|
-
var _className = classNames('btn-toolbar', className);
|
|
2820
|
-
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
2821
|
-
});
|
|
2822
|
-
CButtonToolbar.propTypes = {
|
|
2823
|
-
children: PropTypes.node,
|
|
2824
|
-
className: PropTypes.string,
|
|
2825
|
-
};
|
|
2826
|
-
CButtonToolbar.displayName = 'CButtonToolbar';
|
|
2827
|
-
|
|
2828
2855
|
var CCallout = React.forwardRef(function (_a, ref) {
|
|
2829
2856
|
var _b;
|
|
2830
2857
|
var children = _a.children, className = _a.className, color = _a.color, rest = __rest(_a, ["children", "className", "color"]);
|
|
@@ -3575,6 +3602,10 @@ function getContainingBlock(element) {
|
|
|
3575
3602
|
|
|
3576
3603
|
var currentNode = getParentNode(element);
|
|
3577
3604
|
|
|
3605
|
+
if (isShadowRoot(currentNode)) {
|
|
3606
|
+
currentNode = currentNode.host;
|
|
3607
|
+
}
|
|
3608
|
+
|
|
3578
3609
|
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
3579
3610
|
var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
3580
3611
|
// create a containing block.
|
|
@@ -3767,13 +3798,21 @@ function mapToStyles(_ref2) {
|
|
|
3767
3798
|
adaptive = _ref2.adaptive,
|
|
3768
3799
|
roundOffsets = _ref2.roundOffsets,
|
|
3769
3800
|
isFixed = _ref2.isFixed;
|
|
3801
|
+
var _offsets$x = offsets.x,
|
|
3802
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
3803
|
+
_offsets$y = offsets.y,
|
|
3804
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
3770
3805
|
|
|
3771
|
-
var _ref3 =
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3806
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
3807
|
+
x: x,
|
|
3808
|
+
y: y
|
|
3809
|
+
}) : {
|
|
3810
|
+
x: x,
|
|
3811
|
+
y: y
|
|
3812
|
+
};
|
|
3776
3813
|
|
|
3814
|
+
x = _ref3.x;
|
|
3815
|
+
y = _ref3.y;
|
|
3777
3816
|
var hasX = offsets.hasOwnProperty('x');
|
|
3778
3817
|
var hasY = offsets.hasOwnProperty('y');
|
|
3779
3818
|
var sideX = left;
|
|
@@ -3799,7 +3838,7 @@ function mapToStyles(_ref2) {
|
|
|
3799
3838
|
|
|
3800
3839
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
3801
3840
|
sideY = bottom;
|
|
3802
|
-
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
3841
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
3803
3842
|
offsetParent[heightProp];
|
|
3804
3843
|
y -= offsetY - popperRect.height;
|
|
3805
3844
|
y *= gpuAcceleration ? 1 : -1;
|
|
@@ -3807,7 +3846,7 @@ function mapToStyles(_ref2) {
|
|
|
3807
3846
|
|
|
3808
3847
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
3809
3848
|
sideX = right;
|
|
3810
|
-
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
3849
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
3811
3850
|
offsetParent[widthProp];
|
|
3812
3851
|
x -= offsetX - popperRect.width;
|
|
3813
3852
|
x *= gpuAcceleration ? 1 : -1;
|
|
@@ -3818,6 +3857,17 @@ function mapToStyles(_ref2) {
|
|
|
3818
3857
|
position: position
|
|
3819
3858
|
}, adaptive && unsetSides);
|
|
3820
3859
|
|
|
3860
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
3861
|
+
x: x,
|
|
3862
|
+
y: y
|
|
3863
|
+
}) : {
|
|
3864
|
+
x: x,
|
|
3865
|
+
y: y
|
|
3866
|
+
};
|
|
3867
|
+
|
|
3868
|
+
x = _ref4.x;
|
|
3869
|
+
y = _ref4.y;
|
|
3870
|
+
|
|
3821
3871
|
if (gpuAcceleration) {
|
|
3822
3872
|
var _Object$assign;
|
|
3823
3873
|
|
|
@@ -3827,9 +3877,9 @@ function mapToStyles(_ref2) {
|
|
|
3827
3877
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
3828
3878
|
}
|
|
3829
3879
|
|
|
3830
|
-
function computeStyles(
|
|
3831
|
-
var state =
|
|
3832
|
-
options =
|
|
3880
|
+
function computeStyles(_ref5) {
|
|
3881
|
+
var state = _ref5.state,
|
|
3882
|
+
options = _ref5.options;
|
|
3833
3883
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
3834
3884
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
3835
3885
|
_options$adaptive = options.adaptive,
|
|
@@ -4128,7 +4178,7 @@ function getClippingParents(element) {
|
|
|
4128
4178
|
|
|
4129
4179
|
|
|
4130
4180
|
return clippingParents.filter(function (clippingParent) {
|
|
4131
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'
|
|
4181
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
4132
4182
|
});
|
|
4133
4183
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
4134
4184
|
// clipping parents
|
|
@@ -5603,9 +5653,10 @@ function Reference(_ref) {
|
|
|
5603
5653
|
|
|
5604
5654
|
var CDropdownContext = React.createContext({});
|
|
5605
5655
|
var CDropdown = React.forwardRef(function (_a, ref) {
|
|
5606
|
-
var children = _a.children, alignment = _a.alignment, className = _a.className, dark = _a.dark, direction = _a.direction, onHide = _a.onHide, onShow = _a.onShow,
|
|
5607
|
-
var
|
|
5656
|
+
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"]);
|
|
5657
|
+
var _h = React.useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
5608
5658
|
var dropdownRef = React.useRef(null);
|
|
5659
|
+
var dropdownToggleRef = React.useRef(null);
|
|
5609
5660
|
var forkedRef = useForkedRef(ref, dropdownRef);
|
|
5610
5661
|
var Component = variant === 'nav-item' ? 'li' : component;
|
|
5611
5662
|
// Disable popper if responsive aligment is set.
|
|
@@ -5614,8 +5665,10 @@ var CDropdown = React.forwardRef(function (_a, ref) {
|
|
|
5614
5665
|
}
|
|
5615
5666
|
var contextValues = {
|
|
5616
5667
|
alignment: alignment,
|
|
5668
|
+
autoClose: autoClose,
|
|
5617
5669
|
dark: dark,
|
|
5618
5670
|
direction: direction,
|
|
5671
|
+
dropdownToggleRef: dropdownToggleRef,
|
|
5619
5672
|
placement: placement,
|
|
5620
5673
|
popper: popper,
|
|
5621
5674
|
variant: variant,
|
|
@@ -5625,17 +5678,6 @@ var CDropdown = React.forwardRef(function (_a, ref) {
|
|
|
5625
5678
|
var _className = classNames(variant === 'nav-item' ? 'nav-item dropdown' : variant, {
|
|
5626
5679
|
show: _visible,
|
|
5627
5680
|
}, direction, className);
|
|
5628
|
-
React.useEffect(function () {
|
|
5629
|
-
_visible &&
|
|
5630
|
-
setTimeout(function () {
|
|
5631
|
-
window.addEventListener('click', handleClickOutside);
|
|
5632
|
-
window.addEventListener('keyup', handleKeyup);
|
|
5633
|
-
});
|
|
5634
|
-
return function () {
|
|
5635
|
-
window.removeEventListener('click', handleClickOutside);
|
|
5636
|
-
window.removeEventListener('keyup', handleKeyup);
|
|
5637
|
-
};
|
|
5638
|
-
}, [_visible]);
|
|
5639
5681
|
React.useEffect(function () {
|
|
5640
5682
|
setVisible(visible);
|
|
5641
5683
|
}, [visible]);
|
|
@@ -5643,18 +5685,6 @@ var CDropdown = React.forwardRef(function (_a, ref) {
|
|
|
5643
5685
|
_visible && onShow && onShow();
|
|
5644
5686
|
!_visible && onHide && onHide();
|
|
5645
5687
|
}, [_visible]);
|
|
5646
|
-
var handleKeyup = function (event) {
|
|
5647
|
-
var _a;
|
|
5648
|
-
if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
5649
|
-
setVisible(false);
|
|
5650
|
-
}
|
|
5651
|
-
};
|
|
5652
|
-
var handleClickOutside = function (event) {
|
|
5653
|
-
var _a;
|
|
5654
|
-
if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
5655
|
-
setVisible(false);
|
|
5656
|
-
}
|
|
5657
|
-
};
|
|
5658
5688
|
var dropdownContent = function () {
|
|
5659
5689
|
return variant === 'input-group' ? (React__default["default"].createElement(React__default["default"].Fragment, null, children)) : (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: forkedRef }), children));
|
|
5660
5690
|
};
|
|
@@ -5673,6 +5703,10 @@ CDropdown.propTypes = {
|
|
|
5673
5703
|
PropTypes.shape({ xl: alignmentDirection }),
|
|
5674
5704
|
PropTypes.shape({ xxl: alignmentDirection }),
|
|
5675
5705
|
]),
|
|
5706
|
+
autoClose: PropTypes.oneOfType([
|
|
5707
|
+
PropTypes.bool,
|
|
5708
|
+
PropTypes.oneOf(['inside', 'outside']),
|
|
5709
|
+
]),
|
|
5676
5710
|
children: PropTypes.node,
|
|
5677
5711
|
className: PropTypes.string,
|
|
5678
5712
|
component: PropTypes.elementType,
|
|
@@ -5712,7 +5746,7 @@ CDropdownHeader.displayName = 'CDropdownHeader';
|
|
|
5712
5746
|
var CDropdownItem = React.forwardRef(function (_a, ref) {
|
|
5713
5747
|
var children = _a.children, className = _a.className, _b = _a.component, component = _b === void 0 ? 'a' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
5714
5748
|
var _className = classNames('dropdown-item', className);
|
|
5715
|
-
return (React__default["default"].createElement(CLink, __assign({ component: component }, rest, {
|
|
5749
|
+
return (React__default["default"].createElement(CLink, __assign({ className: _className, component: component }, rest, { ref: ref }), children));
|
|
5716
5750
|
});
|
|
5717
5751
|
CDropdownItem.propTypes = {
|
|
5718
5752
|
children: PropTypes.node,
|
|
@@ -5735,7 +5769,36 @@ CDropdownItemPlain.displayName = 'CDropdownItemPlain';
|
|
|
5735
5769
|
|
|
5736
5770
|
var CDropdownMenu = function (_a) {
|
|
5737
5771
|
var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'ul' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
5738
|
-
var _c = React.useContext(CDropdownContext), alignment = _c.alignment, dark = _c.dark, direction = _c.direction, placement = _c.placement, popper = _c.popper, visible = _c.visible;
|
|
5772
|
+
var _c = React.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;
|
|
5773
|
+
var dropdownMenuRef = React.useRef(null);
|
|
5774
|
+
React.useEffect(function () {
|
|
5775
|
+
visible && window.addEventListener('mouseup', handleMouseUp);
|
|
5776
|
+
visible && window.addEventListener('keyup', handleKeyup);
|
|
5777
|
+
return function () {
|
|
5778
|
+
window.removeEventListener('mouseup', handleMouseUp);
|
|
5779
|
+
window.removeEventListener('keyup', handleKeyup);
|
|
5780
|
+
};
|
|
5781
|
+
}, [visible]);
|
|
5782
|
+
var handleKeyup = function (event) {
|
|
5783
|
+
if (autoClose === false) {
|
|
5784
|
+
return;
|
|
5785
|
+
}
|
|
5786
|
+
if (event.key === 'Escape') {
|
|
5787
|
+
setVisible(false);
|
|
5788
|
+
}
|
|
5789
|
+
};
|
|
5790
|
+
var handleMouseUp = function (event) {
|
|
5791
|
+
var _a, _b;
|
|
5792
|
+
if (dropdownToggleRef && dropdownToggleRef.current.contains(event.target)) {
|
|
5793
|
+
return;
|
|
5794
|
+
}
|
|
5795
|
+
if (autoClose === true ||
|
|
5796
|
+
(autoClose === 'inside' && ((_a = dropdownMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) ||
|
|
5797
|
+
(autoClose === 'outside' && !((_b = dropdownMenuRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)))) {
|
|
5798
|
+
setTimeout(function () { return setVisible(false); }, 1);
|
|
5799
|
+
return;
|
|
5800
|
+
}
|
|
5801
|
+
};
|
|
5739
5802
|
var _placement = placement;
|
|
5740
5803
|
if (direction === 'dropup') {
|
|
5741
5804
|
_placement = 'top-start';
|
|
@@ -5775,7 +5838,7 @@ var CDropdownMenu = function (_a) {
|
|
|
5775
5838
|
})
|
|
5776
5839
|
: children));
|
|
5777
5840
|
};
|
|
5778
|
-
return popper && visible ? (React__default["default"].createElement(Popper, { placement: _placement }, function (_a) {
|
|
5841
|
+
return popper && visible ? (React__default["default"].createElement(Popper, { innerRef: dropdownMenuRef, placement: _placement }, function (_a) {
|
|
5779
5842
|
var ref = _a.ref, style = _a.style;
|
|
5780
5843
|
return dropdownMenuComponent(style, ref);
|
|
5781
5844
|
})) : (dropdownMenuComponent());
|
|
@@ -5788,8 +5851,8 @@ CDropdownMenu.propTypes = {
|
|
|
5788
5851
|
CDropdownMenu.displayName = 'CDropdownMenu';
|
|
5789
5852
|
|
|
5790
5853
|
var CDropdownToggle = function (_a) {
|
|
5791
|
-
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"]);
|
|
5792
|
-
var _d = React.useContext(CDropdownContext), popper = _d.popper, variant = _d.variant, visible = _d.visible, setVisible = _d.setVisible;
|
|
5854
|
+
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"]);
|
|
5855
|
+
var _d = React.useContext(CDropdownContext), dropdownToggleRef = _d.dropdownToggleRef, popper = _d.popper, variant = _d.variant, visible = _d.visible, setVisible = _d.setVisible;
|
|
5793
5856
|
var _className = classNames({
|
|
5794
5857
|
'dropdown-toggle': caret,
|
|
5795
5858
|
'dropdown-toggle-split': split,
|
|
@@ -5804,199 +5867,90 @@ var CDropdownToggle = function (_a) {
|
|
|
5804
5867
|
onFocus: function () { return setVisible(true); },
|
|
5805
5868
|
onBlur: function () { return setVisible(false); },
|
|
5806
5869
|
}));
|
|
5807
|
-
var togglerProps = __assign({ className: _className, 'aria-expanded': visible }, triggers);
|
|
5870
|
+
var togglerProps = __assign(__assign({ className: _className, 'aria-expanded': visible }, (!rest.disabled && __assign({}, triggers))), triggers);
|
|
5808
5871
|
// We use any because Toggler can be `a` as well as `button`.
|
|
5809
5872
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5810
5873
|
var Toggler = function (ref) {
|
|
5811
|
-
return variant === 'nav-item' ? (React__default["default"].createElement("a", __assign({ href: "#" }, togglerProps, { ref: ref }), children)) : (React__default["default"].createElement(CButton, __assign({ type: "button" }, togglerProps, { tabIndex: 0 }, rest, { ref: ref }),
|
|
5874
|
+
return custom && React__default["default"].isValidElement(children) ? (React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].cloneElement(children, __assign(__assign({ 'aria-expanded': visible }, (!rest.disabled && __assign({}, triggers))), { ref: useForkedRef(ref, dropdownToggleRef) })))) : variant === 'nav-item' ? (React__default["default"].createElement("a", __assign({ href: "#" }, togglerProps, { ref: useForkedRef(ref, dropdownToggleRef) }), children)) : (React__default["default"].createElement(CButton, __assign({ type: "button" }, togglerProps, { tabIndex: 0 }, rest, { ref: useForkedRef(ref, dropdownToggleRef) }),
|
|
5812
5875
|
children,
|
|
5813
5876
|
split && React__default["default"].createElement("span", { className: "visually-hidden" }, "Toggle Dropdown")));
|
|
5814
5877
|
};
|
|
5815
5878
|
return popper ? React__default["default"].createElement(Reference, null, function (_a) {
|
|
5816
5879
|
var ref = _a.ref;
|
|
5817
5880
|
return Toggler(ref);
|
|
5818
|
-
}) : Toggler();
|
|
5881
|
+
}) : Toggler(dropdownToggleRef);
|
|
5819
5882
|
};
|
|
5820
5883
|
CDropdownToggle.propTypes = {
|
|
5821
5884
|
caret: PropTypes.bool,
|
|
5822
5885
|
children: PropTypes.node,
|
|
5823
5886
|
className: PropTypes.string,
|
|
5887
|
+
custom: PropTypes.bool,
|
|
5824
5888
|
split: PropTypes.bool,
|
|
5825
5889
|
trigger: triggerPropType,
|
|
5826
5890
|
};
|
|
5827
5891
|
CDropdownToggle.displayName = 'CDropdownToggle';
|
|
5828
5892
|
|
|
5829
|
-
var
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
'
|
|
5833
|
-
'md',
|
|
5834
|
-
'sm',
|
|
5835
|
-
'xs',
|
|
5836
|
-
];
|
|
5837
|
-
var CCol = React.forwardRef(function (_a, ref) {
|
|
5838
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5839
|
-
var repsonsiveClassNames = [];
|
|
5840
|
-
BREAKPOINTS$3.forEach(function (bp) {
|
|
5841
|
-
var breakpoint = rest[bp];
|
|
5842
|
-
delete rest[bp];
|
|
5843
|
-
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
5844
|
-
if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
|
|
5845
|
-
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint));
|
|
5846
|
-
}
|
|
5847
|
-
if (typeof breakpoint === 'boolean') {
|
|
5848
|
-
repsonsiveClassNames.push("col".concat(infix));
|
|
5849
|
-
}
|
|
5850
|
-
if (breakpoint && typeof breakpoint === 'object') {
|
|
5851
|
-
if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
|
|
5852
|
-
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint.span));
|
|
5853
|
-
}
|
|
5854
|
-
if (typeof breakpoint.span === 'boolean') {
|
|
5855
|
-
repsonsiveClassNames.push("col".concat(infix));
|
|
5856
|
-
}
|
|
5857
|
-
if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
|
|
5858
|
-
repsonsiveClassNames.push("order".concat(infix, "-").concat(breakpoint.order));
|
|
5859
|
-
}
|
|
5860
|
-
if (typeof breakpoint.offset === 'number') {
|
|
5861
|
-
repsonsiveClassNames.push("offset".concat(infix, "-").concat(breakpoint.offset));
|
|
5862
|
-
}
|
|
5863
|
-
}
|
|
5864
|
-
});
|
|
5865
|
-
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'col', className);
|
|
5893
|
+
var CFooter = React.forwardRef(function (_a, ref) {
|
|
5894
|
+
var _b;
|
|
5895
|
+
var children = _a.children, className = _a.className, position = _a.position, rest = __rest(_a, ["children", "className", "position"]);
|
|
5896
|
+
var _className = classNames('footer', (_b = {}, _b["footer-".concat(position)] = position, _b), className);
|
|
5866
5897
|
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5867
5898
|
});
|
|
5868
|
-
|
|
5869
|
-
PropTypes.bool,
|
|
5870
|
-
PropTypes.number,
|
|
5871
|
-
PropTypes.string,
|
|
5872
|
-
PropTypes.oneOf(['auto']),
|
|
5873
|
-
]);
|
|
5874
|
-
var col = PropTypes.oneOfType([
|
|
5875
|
-
span,
|
|
5876
|
-
PropTypes.shape({
|
|
5877
|
-
span: span,
|
|
5878
|
-
offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
5879
|
-
order: PropTypes.oneOfType([
|
|
5880
|
-
PropTypes.oneOf(['first', 'last']),
|
|
5881
|
-
PropTypes.number,
|
|
5882
|
-
PropTypes.string,
|
|
5883
|
-
]),
|
|
5884
|
-
}),
|
|
5885
|
-
]);
|
|
5886
|
-
CCol.propTypes = {
|
|
5899
|
+
CFooter.propTypes = {
|
|
5887
5900
|
children: PropTypes.node,
|
|
5888
5901
|
className: PropTypes.string,
|
|
5889
|
-
|
|
5890
|
-
sm: col,
|
|
5902
|
+
position: PropTypes.oneOf(['fixed', 'sticky']),
|
|
5891
5903
|
};
|
|
5892
|
-
|
|
5904
|
+
CFooter.displayName = 'CFooter';
|
|
5893
5905
|
|
|
5894
|
-
var
|
|
5895
|
-
|
|
5896
|
-
'
|
|
5897
|
-
|
|
5898
|
-
'md',
|
|
5899
|
-
'sm',
|
|
5900
|
-
'fluid',
|
|
5901
|
-
];
|
|
5902
|
-
var CContainer = React.forwardRef(function (_a, ref) {
|
|
5903
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5904
|
-
var repsonsiveClassNames = [];
|
|
5905
|
-
BREAKPOINTS$2.forEach(function (bp) {
|
|
5906
|
-
var breakpoint = rest[bp];
|
|
5907
|
-
delete rest[bp];
|
|
5908
|
-
breakpoint && repsonsiveClassNames.push("container-".concat(bp));
|
|
5909
|
-
});
|
|
5910
|
-
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'container', className);
|
|
5911
|
-
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5906
|
+
var CForm = React.forwardRef(function (_a, ref) {
|
|
5907
|
+
var children = _a.children, className = _a.className, validated = _a.validated, rest = __rest(_a, ["children", "className", "validated"]);
|
|
5908
|
+
var _className = classNames({ 'was-validated': validated }, className);
|
|
5909
|
+
return (React__default["default"].createElement("form", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5912
5910
|
});
|
|
5913
|
-
|
|
5911
|
+
CForm.propTypes = {
|
|
5914
5912
|
children: PropTypes.node,
|
|
5915
5913
|
className: PropTypes.string,
|
|
5916
|
-
|
|
5917
|
-
md: PropTypes.bool,
|
|
5918
|
-
lg: PropTypes.bool,
|
|
5919
|
-
xl: PropTypes.bool,
|
|
5920
|
-
xxl: PropTypes.bool,
|
|
5921
|
-
fluid: PropTypes.bool,
|
|
5914
|
+
validated: PropTypes.bool,
|
|
5922
5915
|
};
|
|
5923
|
-
|
|
5916
|
+
CForm.displayName = 'CForm';
|
|
5924
5917
|
|
|
5925
|
-
var
|
|
5926
|
-
|
|
5927
|
-
'
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
];
|
|
5933
|
-
var CRow = React.forwardRef(function (_a, ref) {
|
|
5934
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5935
|
-
var repsonsiveClassNames = [];
|
|
5936
|
-
BREAKPOINTS$1.forEach(function (bp) {
|
|
5937
|
-
var breakpoint = rest[bp];
|
|
5938
|
-
delete rest[bp];
|
|
5939
|
-
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
5940
|
-
if (typeof breakpoint === 'object') {
|
|
5941
|
-
if (breakpoint.cols) {
|
|
5942
|
-
repsonsiveClassNames.push("row-cols".concat(infix, "-").concat(breakpoint.cols));
|
|
5943
|
-
}
|
|
5944
|
-
if (typeof breakpoint.gutter === 'number') {
|
|
5945
|
-
repsonsiveClassNames.push("g".concat(infix, "-").concat(breakpoint.gutter));
|
|
5946
|
-
}
|
|
5947
|
-
if (typeof breakpoint.gutterX === 'number') {
|
|
5948
|
-
repsonsiveClassNames.push("gx".concat(infix, "-").concat(breakpoint.gutterX));
|
|
5949
|
-
}
|
|
5950
|
-
if (typeof breakpoint.gutterY === 'number') {
|
|
5951
|
-
repsonsiveClassNames.push("gy".concat(infix, "-").concat(breakpoint.gutterY));
|
|
5952
|
-
}
|
|
5953
|
-
}
|
|
5954
|
-
});
|
|
5955
|
-
var _className = classNames('row', repsonsiveClassNames, className);
|
|
5956
|
-
return (React__default["default"].createElement("div", { className: _className, ref: ref }, children));
|
|
5918
|
+
var CFormFeedback = React.forwardRef(function (_a, ref) {
|
|
5919
|
+
var _b;
|
|
5920
|
+
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"]);
|
|
5921
|
+
var _className = classNames((_b = {},
|
|
5922
|
+
_b["invalid-".concat(tooltip ? 'tooltip' : 'feedback')] = invalid,
|
|
5923
|
+
_b["valid-".concat(tooltip ? 'tooltip' : 'feedback')] = valid,
|
|
5924
|
+
_b), className);
|
|
5925
|
+
return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5957
5926
|
});
|
|
5958
|
-
|
|
5959
|
-
cols: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.string]),
|
|
5960
|
-
gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5961
|
-
gutterX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5962
|
-
gutterY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5963
|
-
});
|
|
5964
|
-
CRow.propTypes = {
|
|
5965
|
-
children: PropTypes.node,
|
|
5966
|
-
className: PropTypes.string,
|
|
5967
|
-
xs: bp,
|
|
5968
|
-
sm: bp,
|
|
5969
|
-
md: bp,
|
|
5970
|
-
lg: bp,
|
|
5971
|
-
xl: bp,
|
|
5972
|
-
xxl: bp,
|
|
5973
|
-
};
|
|
5974
|
-
CRow.displayName = 'CRow';
|
|
5975
|
-
|
|
5976
|
-
var CFooter = React.forwardRef(function (_a, ref) {
|
|
5977
|
-
var _b;
|
|
5978
|
-
var children = _a.children, className = _a.className, position = _a.position, rest = __rest(_a, ["children", "className", "position"]);
|
|
5979
|
-
var _className = classNames('footer', (_b = {}, _b["footer-".concat(position)] = position, _b), className);
|
|
5980
|
-
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5981
|
-
});
|
|
5982
|
-
CFooter.propTypes = {
|
|
5927
|
+
CFormFeedback.propTypes = {
|
|
5983
5928
|
children: PropTypes.node,
|
|
5984
5929
|
className: PropTypes.string,
|
|
5985
|
-
|
|
5930
|
+
component: PropTypes.elementType,
|
|
5931
|
+
invalid: PropTypes.bool,
|
|
5932
|
+
tooltip: PropTypes.bool,
|
|
5933
|
+
valid: PropTypes.bool,
|
|
5986
5934
|
};
|
|
5987
|
-
|
|
5935
|
+
CFormFeedback.displayName = 'CFormFeedback';
|
|
5988
5936
|
|
|
5989
|
-
var
|
|
5990
|
-
var
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
})
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5937
|
+
var CFormControlValidation = function (_a) {
|
|
5938
|
+
var describedby = _a.describedby, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, invalid = _a.invalid, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid;
|
|
5939
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
5940
|
+
feedback && (valid || invalid) && (React__default["default"].createElement(CFormFeedback, __assign({}, (invalid && { id: describedby }), { invalid: invalid, tooltip: tooltipFeedback, valid: valid }), feedback)),
|
|
5941
|
+
feedbackInvalid && (React__default["default"].createElement(CFormFeedback, { id: describedby, invalid: true, tooltip: tooltipFeedback }, feedbackInvalid)),
|
|
5942
|
+
feedbackValid && (React__default["default"].createElement(CFormFeedback, { valid: true, tooltip: tooltipFeedback }, feedbackValid))));
|
|
5943
|
+
};
|
|
5944
|
+
CFormControlValidation.propTypes = {
|
|
5945
|
+
describedby: PropTypes.string,
|
|
5946
|
+
feedback: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
5947
|
+
feedbackValid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
5948
|
+
feedbackInvalid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
5949
|
+
invalid: PropTypes.bool,
|
|
5950
|
+
tooltipFeedback: PropTypes.bool,
|
|
5951
|
+
valid: PropTypes.bool,
|
|
5998
5952
|
};
|
|
5999
|
-
|
|
5953
|
+
CFormControlValidation.displayName = 'CFormControlValidation';
|
|
6000
5954
|
|
|
6001
5955
|
var CFormLabel = React.forwardRef(function (_a, ref) {
|
|
6002
5956
|
var children = _a.children, className = _a.className, customClassName = _a.customClassName, rest = __rest(_a, ["children", "className", "customClassName"]);
|
|
@@ -6012,7 +5966,7 @@ CFormLabel.displayName = 'CFormLabel';
|
|
|
6012
5966
|
|
|
6013
5967
|
var CFormCheck = React.forwardRef(function (_a, ref) {
|
|
6014
5968
|
var _b;
|
|
6015
|
-
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"]);
|
|
5969
|
+
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"]);
|
|
6016
5970
|
var inputRef = React.useRef(null);
|
|
6017
5971
|
var forkedRef = useForkedRef(ref, inputRef);
|
|
6018
5972
|
React.useEffect(function () {
|
|
@@ -6038,50 +5992,25 @@ var CFormCheck = React.forwardRef(function (_a, ref) {
|
|
|
6038
5992
|
var formControl = function () {
|
|
6039
5993
|
return React__default["default"].createElement("input", __assign({ type: type, className: inputClassName, id: id }, rest, { ref: forkedRef }));
|
|
6040
5994
|
};
|
|
5995
|
+
var formValidation = function () { return (React__default["default"].createElement(CFormControlValidation, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, invalid: invalid, tooltipFeedback: tooltipFeedback, valid: valid })); };
|
|
6041
5996
|
var formLabel = function () {
|
|
6042
5997
|
return (React__default["default"].createElement(CFormLabel, __assign({ customClassName: labelClassName }, (id && { htmlFor: id })), label));
|
|
6043
5998
|
};
|
|
6044
5999
|
return button ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6045
6000
|
formControl(),
|
|
6046
|
-
label && formLabel()
|
|
6047
|
-
|
|
6048
|
-
|
|
6001
|
+
label && formLabel(),
|
|
6002
|
+
formValidation())) : label ? (hitArea ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6003
|
+
React__default["default"].createElement(CFormLabel, __assign({ customClassName: className }, (id && { htmlFor: id })),
|
|
6004
|
+
formControl(),
|
|
6005
|
+
label),
|
|
6006
|
+
formValidation())) : (React__default["default"].createElement("div", { className: _className },
|
|
6049
6007
|
formControl(),
|
|
6050
|
-
formLabel()
|
|
6008
|
+
formLabel(),
|
|
6009
|
+
formValidation()))) : (formControl());
|
|
6051
6010
|
});
|
|
6052
|
-
CFormCheck.propTypes = {
|
|
6053
|
-
button: PropTypes.object,
|
|
6054
|
-
className: PropTypes.string,
|
|
6055
|
-
hitArea: PropTypes.oneOf(['full']),
|
|
6056
|
-
id: PropTypes.string,
|
|
6057
|
-
indeterminate: PropTypes.bool,
|
|
6058
|
-
inline: PropTypes.bool,
|
|
6059
|
-
invalid: PropTypes.bool,
|
|
6060
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
6061
|
-
type: PropTypes.oneOf(['checkbox', 'radio']),
|
|
6062
|
-
valid: PropTypes.bool,
|
|
6063
|
-
};
|
|
6011
|
+
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);
|
|
6064
6012
|
CFormCheck.displayName = 'CFormCheck';
|
|
6065
6013
|
|
|
6066
|
-
var CFormFeedback = React.forwardRef(function (_a, ref) {
|
|
6067
|
-
var _b;
|
|
6068
|
-
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"]);
|
|
6069
|
-
var _className = classNames((_b = {},
|
|
6070
|
-
_b["invalid-".concat(tooltip ? 'tooltip' : 'feedback')] = invalid,
|
|
6071
|
-
_b["valid-".concat(tooltip ? 'tooltip' : 'feedback')] = valid,
|
|
6072
|
-
_b), className);
|
|
6073
|
-
return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6074
|
-
});
|
|
6075
|
-
CFormFeedback.propTypes = {
|
|
6076
|
-
children: PropTypes.node,
|
|
6077
|
-
className: PropTypes.string,
|
|
6078
|
-
component: PropTypes.elementType,
|
|
6079
|
-
invalid: PropTypes.bool,
|
|
6080
|
-
tooltip: PropTypes.bool,
|
|
6081
|
-
valid: PropTypes.bool,
|
|
6082
|
-
};
|
|
6083
|
-
CFormFeedback.displayName = 'CFormFeedback';
|
|
6084
|
-
|
|
6085
6014
|
var CFormFloating = React.forwardRef(function (_a, ref) {
|
|
6086
6015
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6087
6016
|
var _className = classNames('form-floating', className);
|
|
@@ -6093,62 +6022,81 @@ CFormFloating.propTypes = {
|
|
|
6093
6022
|
};
|
|
6094
6023
|
CFormFloating.displayName = 'CFormFloating';
|
|
6095
6024
|
|
|
6025
|
+
var CFormText = React.forwardRef(function (_a, ref) {
|
|
6026
|
+
var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'div' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
6027
|
+
var _className = classNames('form-text', className);
|
|
6028
|
+
return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6029
|
+
});
|
|
6030
|
+
CFormText.propTypes = {
|
|
6031
|
+
children: PropTypes.node,
|
|
6032
|
+
className: PropTypes.string,
|
|
6033
|
+
component: PropTypes.elementType,
|
|
6034
|
+
};
|
|
6035
|
+
CFormText.displayName = 'CFormText';
|
|
6036
|
+
|
|
6037
|
+
var CFormControlWrapper = function (_a) {
|
|
6038
|
+
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;
|
|
6039
|
+
return floatingLabel ? (React__default["default"].createElement(CFormFloating, null,
|
|
6040
|
+
children,
|
|
6041
|
+
React__default["default"].createElement(CFormLabel, { htmlFor: id }, label || floatingLabel))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6042
|
+
label && React__default["default"].createElement(CFormLabel, { htmlFor: id }, label),
|
|
6043
|
+
children,
|
|
6044
|
+
text && React__default["default"].createElement(CFormText, { id: describedby }, text),
|
|
6045
|
+
React__default["default"].createElement(CFormControlValidation, { describedby: describedby, feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, invalid: invalid, tooltipFeedback: tooltipFeedback, valid: valid })));
|
|
6046
|
+
};
|
|
6047
|
+
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);
|
|
6048
|
+
CFormControlWrapper.displayName = 'CFormControlWrapper';
|
|
6049
|
+
|
|
6096
6050
|
var CFormInput = React.forwardRef(function (_a, ref) {
|
|
6097
6051
|
var _b;
|
|
6098
|
-
var children = _a.children, className = _a.className, invalid = _a.invalid, plainText = _a.plainText, size = _a.size,
|
|
6052
|
+
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"]);
|
|
6053
|
+
var _e = React.useState(), value = _e[0], setValue = _e[1];
|
|
6054
|
+
React.useEffect(function () {
|
|
6055
|
+
var timeOutId = setTimeout(function () { return value && onChange && onChange(value); }, typeof delay === 'number' ? delay : 500);
|
|
6056
|
+
return function () { return clearTimeout(timeOutId); };
|
|
6057
|
+
}, [value]);
|
|
6099
6058
|
var _className = classNames(plainText ? 'form-control-plaintext' : 'form-control', (_b = {},
|
|
6100
6059
|
_b["form-control-".concat(size)] = size,
|
|
6101
6060
|
_b['form-control-color'] = type === 'color',
|
|
6102
6061
|
_b['is-invalid'] = invalid,
|
|
6103
6062
|
_b['is-valid'] = valid,
|
|
6104
6063
|
_b), className);
|
|
6105
|
-
return (React__default["default"].createElement(
|
|
6064
|
+
return (React__default["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["default"].createElement("input", __assign({ className: _className, id: id, type: type, onChange: function (event) { return (delay ? setValue(event) : onChange && onChange(event)); } }, rest, { ref: ref }), children)));
|
|
6106
6066
|
});
|
|
6107
|
-
CFormInput.propTypes = {
|
|
6108
|
-
children: PropTypes.node,
|
|
6109
|
-
className: PropTypes.string,
|
|
6110
|
-
invalid: PropTypes.bool,
|
|
6111
|
-
plainText: PropTypes.bool,
|
|
6112
|
-
size: PropTypes.oneOf(['sm', 'lg']),
|
|
6113
|
-
type: PropTypes.oneOfType([PropTypes.oneOf(['color', 'file', 'text']), PropTypes.string]),
|
|
6114
|
-
valid: PropTypes.bool,
|
|
6115
|
-
};
|
|
6067
|
+
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);
|
|
6116
6068
|
CFormInput.displayName = 'CFormInput';
|
|
6117
6069
|
|
|
6118
6070
|
var CFormRange = React.forwardRef(function (_a, ref) {
|
|
6119
|
-
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
6071
|
+
var className = _a.className, label = _a.label, rest = __rest(_a, ["className", "label"]);
|
|
6120
6072
|
var _className = classNames('form-range', className);
|
|
6121
|
-
return React__default["default"].createElement("
|
|
6073
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6074
|
+
label && React__default["default"].createElement(CFormLabel, { htmlFor: rest.id }, label),
|
|
6075
|
+
React__default["default"].createElement("input", __assign({ type: "range", className: _className }, rest, { ref: ref }))));
|
|
6122
6076
|
});
|
|
6123
6077
|
CFormRange.propTypes = {
|
|
6124
6078
|
className: PropTypes.string,
|
|
6079
|
+
label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
6125
6080
|
};
|
|
6126
6081
|
CFormRange.displayName = 'CFormRange';
|
|
6127
6082
|
|
|
6128
6083
|
var CFormSelect = React.forwardRef(function (_a, ref) {
|
|
6129
6084
|
var _b;
|
|
6130
|
-
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"]);
|
|
6085
|
+
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"]);
|
|
6131
6086
|
var _className = classNames('form-select', (_b = {},
|
|
6132
6087
|
_b["form-select-".concat(size)] = size,
|
|
6133
6088
|
_b['is-invalid'] = invalid,
|
|
6134
6089
|
_b['is-valid'] = valid,
|
|
6135
6090
|
_b), className);
|
|
6136
|
-
return (React__default["default"].createElement(
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6091
|
+
return (React__default["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 },
|
|
6092
|
+
React__default["default"].createElement("select", __assign({ id: id, className: _className, size: htmlSize }, rest, { ref: ref }), options
|
|
6093
|
+
? options.map(function (option, index) {
|
|
6094
|
+
return (React__default["default"].createElement("option", __assign({}, (typeof option === 'object' &&
|
|
6095
|
+
option.disabled && { disabled: option.disabled }), (typeof option === 'object' && option.value && { value: option.value }), { key: index }), typeof option === 'string' ? option : option.label));
|
|
6096
|
+
})
|
|
6097
|
+
: children)));
|
|
6142
6098
|
});
|
|
6143
|
-
CFormSelect.propTypes = {
|
|
6144
|
-
children: PropTypes.node,
|
|
6145
|
-
className: PropTypes.string,
|
|
6146
|
-
htmlSize: PropTypes.number,
|
|
6147
|
-
invalid: PropTypes.bool,
|
|
6148
|
-
options: PropTypes.array,
|
|
6149
|
-
size: PropTypes.oneOf(['sm', 'lg']),
|
|
6150
|
-
valid: PropTypes.bool,
|
|
6151
|
-
};
|
|
6099
|
+
CFormSelect.propTypes = __assign({ className: PropTypes.string, htmlSize: PropTypes.number, options: PropTypes.array }, CFormControlWrapper.propTypes);
|
|
6152
6100
|
CFormSelect.displayName = 'CFormSelect';
|
|
6153
6101
|
|
|
6154
6102
|
var CFormSwitch = React.forwardRef(function (_a, ref) {
|
|
@@ -6179,33 +6127,16 @@ CFormSwitch.propTypes = {
|
|
|
6179
6127
|
};
|
|
6180
6128
|
CFormSwitch.displayName = 'CFormSwitch';
|
|
6181
6129
|
|
|
6182
|
-
var CFormText = React.forwardRef(function (_a, ref) {
|
|
6183
|
-
var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'div' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
6184
|
-
var _className = classNames('form-text', className);
|
|
6185
|
-
return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6186
|
-
});
|
|
6187
|
-
CFormText.propTypes = {
|
|
6188
|
-
children: PropTypes.node,
|
|
6189
|
-
className: PropTypes.string,
|
|
6190
|
-
component: PropTypes.elementType,
|
|
6191
|
-
};
|
|
6192
|
-
CFormText.displayName = 'CFormText';
|
|
6193
|
-
|
|
6194
6130
|
var CFormTextarea = React.forwardRef(function (_a, ref) {
|
|
6195
|
-
var children = _a.children, className = _a.className, invalid = _a.invalid, plainText = _a.plainText, valid = _a.valid, rest = __rest(_a, ["children", "className", "invalid", "plainText", "valid"]);
|
|
6131
|
+
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"]);
|
|
6196
6132
|
var _className = classNames(plainText ? 'form-control-plaintext' : 'form-control', {
|
|
6197
6133
|
'is-invalid': invalid,
|
|
6198
6134
|
'is-valid': valid,
|
|
6199
6135
|
}, className);
|
|
6200
|
-
return (React__default["default"].createElement(
|
|
6136
|
+
return (React__default["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 },
|
|
6137
|
+
React__default["default"].createElement("textarea", __assign({ className: _className, id: id }, rest, { ref: ref }), children)));
|
|
6201
6138
|
});
|
|
6202
|
-
CFormTextarea.propTypes = {
|
|
6203
|
-
children: PropTypes.node,
|
|
6204
|
-
className: PropTypes.string,
|
|
6205
|
-
invalid: PropTypes.bool,
|
|
6206
|
-
plainText: PropTypes.bool,
|
|
6207
|
-
valid: PropTypes.bool,
|
|
6208
|
-
};
|
|
6139
|
+
CFormTextarea.propTypes = __assign({ className: PropTypes.string, id: PropTypes.string, plainText: PropTypes.bool }, CFormControlWrapper.propTypes);
|
|
6209
6140
|
CFormTextarea.displayName = 'CFormTextarea';
|
|
6210
6141
|
|
|
6211
6142
|
var CInputGroup = React.forwardRef(function (_a, ref) {
|
|
@@ -6235,6 +6166,153 @@ CInputGroupText.propTypes = {
|
|
|
6235
6166
|
};
|
|
6236
6167
|
CInputGroupText.displayName = 'CInputGroupText';
|
|
6237
6168
|
|
|
6169
|
+
var BREAKPOINTS$3 = [
|
|
6170
|
+
'xxl',
|
|
6171
|
+
'xl',
|
|
6172
|
+
'lg',
|
|
6173
|
+
'md',
|
|
6174
|
+
'sm',
|
|
6175
|
+
'xs',
|
|
6176
|
+
];
|
|
6177
|
+
var CCol = React.forwardRef(function (_a, ref) {
|
|
6178
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6179
|
+
var repsonsiveClassNames = [];
|
|
6180
|
+
BREAKPOINTS$3.forEach(function (bp) {
|
|
6181
|
+
var breakpoint = rest[bp];
|
|
6182
|
+
delete rest[bp];
|
|
6183
|
+
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
6184
|
+
if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
|
|
6185
|
+
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint));
|
|
6186
|
+
}
|
|
6187
|
+
if (typeof breakpoint === 'boolean') {
|
|
6188
|
+
repsonsiveClassNames.push("col".concat(infix));
|
|
6189
|
+
}
|
|
6190
|
+
if (breakpoint && typeof breakpoint === 'object') {
|
|
6191
|
+
if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
|
|
6192
|
+
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint.span));
|
|
6193
|
+
}
|
|
6194
|
+
if (typeof breakpoint.span === 'boolean') {
|
|
6195
|
+
repsonsiveClassNames.push("col".concat(infix));
|
|
6196
|
+
}
|
|
6197
|
+
if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
|
|
6198
|
+
repsonsiveClassNames.push("order".concat(infix, "-").concat(breakpoint.order));
|
|
6199
|
+
}
|
|
6200
|
+
if (typeof breakpoint.offset === 'number') {
|
|
6201
|
+
repsonsiveClassNames.push("offset".concat(infix, "-").concat(breakpoint.offset));
|
|
6202
|
+
}
|
|
6203
|
+
}
|
|
6204
|
+
});
|
|
6205
|
+
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'col', className);
|
|
6206
|
+
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6207
|
+
});
|
|
6208
|
+
var span = PropTypes.oneOfType([
|
|
6209
|
+
PropTypes.bool,
|
|
6210
|
+
PropTypes.number,
|
|
6211
|
+
PropTypes.string,
|
|
6212
|
+
PropTypes.oneOf(['auto']),
|
|
6213
|
+
]);
|
|
6214
|
+
var col = PropTypes.oneOfType([
|
|
6215
|
+
span,
|
|
6216
|
+
PropTypes.shape({
|
|
6217
|
+
span: span,
|
|
6218
|
+
offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
6219
|
+
order: PropTypes.oneOfType([
|
|
6220
|
+
PropTypes.oneOf(['first', 'last']),
|
|
6221
|
+
PropTypes.number,
|
|
6222
|
+
PropTypes.string,
|
|
6223
|
+
]),
|
|
6224
|
+
}),
|
|
6225
|
+
]);
|
|
6226
|
+
CCol.propTypes = {
|
|
6227
|
+
children: PropTypes.node,
|
|
6228
|
+
className: PropTypes.string,
|
|
6229
|
+
xs: col,
|
|
6230
|
+
sm: col,
|
|
6231
|
+
};
|
|
6232
|
+
CCol.displayName = 'CCol';
|
|
6233
|
+
|
|
6234
|
+
var BREAKPOINTS$2 = [
|
|
6235
|
+
'xxl',
|
|
6236
|
+
'xl',
|
|
6237
|
+
'lg',
|
|
6238
|
+
'md',
|
|
6239
|
+
'sm',
|
|
6240
|
+
'fluid',
|
|
6241
|
+
];
|
|
6242
|
+
var CContainer = React.forwardRef(function (_a, ref) {
|
|
6243
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6244
|
+
var repsonsiveClassNames = [];
|
|
6245
|
+
BREAKPOINTS$2.forEach(function (bp) {
|
|
6246
|
+
var breakpoint = rest[bp];
|
|
6247
|
+
delete rest[bp];
|
|
6248
|
+
breakpoint && repsonsiveClassNames.push("container-".concat(bp));
|
|
6249
|
+
});
|
|
6250
|
+
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'container', className);
|
|
6251
|
+
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6252
|
+
});
|
|
6253
|
+
CContainer.propTypes = {
|
|
6254
|
+
children: PropTypes.node,
|
|
6255
|
+
className: PropTypes.string,
|
|
6256
|
+
sm: PropTypes.bool,
|
|
6257
|
+
md: PropTypes.bool,
|
|
6258
|
+
lg: PropTypes.bool,
|
|
6259
|
+
xl: PropTypes.bool,
|
|
6260
|
+
xxl: PropTypes.bool,
|
|
6261
|
+
fluid: PropTypes.bool,
|
|
6262
|
+
};
|
|
6263
|
+
CContainer.displayName = 'CContainer';
|
|
6264
|
+
|
|
6265
|
+
var BREAKPOINTS$1 = [
|
|
6266
|
+
'xxl',
|
|
6267
|
+
'xl',
|
|
6268
|
+
'lg',
|
|
6269
|
+
'md',
|
|
6270
|
+
'sm',
|
|
6271
|
+
'xs',
|
|
6272
|
+
];
|
|
6273
|
+
var CRow = React.forwardRef(function (_a, ref) {
|
|
6274
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6275
|
+
var repsonsiveClassNames = [];
|
|
6276
|
+
BREAKPOINTS$1.forEach(function (bp) {
|
|
6277
|
+
var breakpoint = rest[bp];
|
|
6278
|
+
delete rest[bp];
|
|
6279
|
+
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
6280
|
+
if (typeof breakpoint === 'object') {
|
|
6281
|
+
if (breakpoint.cols) {
|
|
6282
|
+
repsonsiveClassNames.push("row-cols".concat(infix, "-").concat(breakpoint.cols));
|
|
6283
|
+
}
|
|
6284
|
+
if (typeof breakpoint.gutter === 'number') {
|
|
6285
|
+
repsonsiveClassNames.push("g".concat(infix, "-").concat(breakpoint.gutter));
|
|
6286
|
+
}
|
|
6287
|
+
if (typeof breakpoint.gutterX === 'number') {
|
|
6288
|
+
repsonsiveClassNames.push("gx".concat(infix, "-").concat(breakpoint.gutterX));
|
|
6289
|
+
}
|
|
6290
|
+
if (typeof breakpoint.gutterY === 'number') {
|
|
6291
|
+
repsonsiveClassNames.push("gy".concat(infix, "-").concat(breakpoint.gutterY));
|
|
6292
|
+
}
|
|
6293
|
+
}
|
|
6294
|
+
});
|
|
6295
|
+
var _className = classNames('row', repsonsiveClassNames, className);
|
|
6296
|
+
return (React__default["default"].createElement("div", { className: _className, ref: ref }, children));
|
|
6297
|
+
});
|
|
6298
|
+
var bp = PropTypes.shape({
|
|
6299
|
+
cols: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.string]),
|
|
6300
|
+
gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
6301
|
+
gutterX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
6302
|
+
gutterY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
6303
|
+
});
|
|
6304
|
+
CRow.propTypes = {
|
|
6305
|
+
children: PropTypes.node,
|
|
6306
|
+
className: PropTypes.string,
|
|
6307
|
+
xs: bp,
|
|
6308
|
+
sm: bp,
|
|
6309
|
+
md: bp,
|
|
6310
|
+
lg: bp,
|
|
6311
|
+
xl: bp,
|
|
6312
|
+
xxl: bp,
|
|
6313
|
+
};
|
|
6314
|
+
CRow.displayName = 'CRow';
|
|
6315
|
+
|
|
6238
6316
|
var CHeader = React.forwardRef(function (_a, ref) {
|
|
6239
6317
|
var _b;
|
|
6240
6318
|
var children = _a.children, className = _a.className, container = _a.container, position = _a.position, rest = __rest(_a, ["children", "className", "container", "position"]);
|
|
@@ -6437,11 +6515,12 @@ CModalDialog.displayName = 'CModalDialog';
|
|
|
6437
6515
|
|
|
6438
6516
|
var CModalContext = React.createContext({});
|
|
6439
6517
|
var CModal = React.forwardRef(function (_a, ref) {
|
|
6440
|
-
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;
|
|
6518
|
+
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;
|
|
6441
6519
|
var modalRef = React.useRef(null);
|
|
6520
|
+
var modalContentRef = React.useRef(null);
|
|
6442
6521
|
var forkedRef = useForkedRef(ref, modalRef);
|
|
6443
|
-
var
|
|
6444
|
-
var
|
|
6522
|
+
var _h = React.useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
6523
|
+
var _j = React.useState(false), staticBackdrop = _j[0], setStaticBackdrop = _j[1];
|
|
6445
6524
|
React.useEffect(function () {
|
|
6446
6525
|
setVisible(visible);
|
|
6447
6526
|
}, [visible]);
|
|
@@ -6449,6 +6528,14 @@ var CModal = React.forwardRef(function (_a, ref) {
|
|
|
6449
6528
|
visible: _visible,
|
|
6450
6529
|
setVisible: setVisible,
|
|
6451
6530
|
};
|
|
6531
|
+
React.useEffect(function () {
|
|
6532
|
+
modalRef.current && modalRef.current.addEventListener('click', handleClickOutside);
|
|
6533
|
+
modalRef.current && modalRef.current.addEventListener('keyup', handleKeyDown);
|
|
6534
|
+
return function () {
|
|
6535
|
+
modalRef.current && modalRef.current.removeEventListener('click', handleClickOutside);
|
|
6536
|
+
modalRef.current && modalRef.current.removeEventListener('keyup', handleKeyDown);
|
|
6537
|
+
};
|
|
6538
|
+
}, [_visible]);
|
|
6452
6539
|
var handleDismiss = function () {
|
|
6453
6540
|
if (backdrop === 'static') {
|
|
6454
6541
|
return setStaticBackdrop(true);
|
|
@@ -6486,6 +6573,12 @@ var CModal = React.forwardRef(function (_a, ref) {
|
|
|
6486
6573
|
}
|
|
6487
6574
|
return function () { return document.body.classList.remove('modal-open'); };
|
|
6488
6575
|
}, [_visible]);
|
|
6576
|
+
var handleClickOutside = function (event) {
|
|
6577
|
+
if (modalContentRef.current &&
|
|
6578
|
+
!modalContentRef.current.contains(event.target)) {
|
|
6579
|
+
handleDismiss();
|
|
6580
|
+
}
|
|
6581
|
+
};
|
|
6489
6582
|
var handleKeyDown = React.useCallback(function (event) {
|
|
6490
6583
|
if (event.key === 'Escape' && keyboard) {
|
|
6491
6584
|
return handleDismiss();
|
|
@@ -6494,17 +6587,16 @@ var CModal = React.forwardRef(function (_a, ref) {
|
|
|
6494
6587
|
var modal = function (ref, transitionClass) {
|
|
6495
6588
|
return (React__default["default"].createElement(CModalContext.Provider, { value: contextValues },
|
|
6496
6589
|
React__default["default"].createElement("div", { className: classNames(_className, transitionClass), tabIndex: -1, role: "dialog", ref: ref },
|
|
6497
|
-
React__default["default"].createElement(CModalDialog, { alignment: alignment, fullscreen: fullscreen, scrollable: scrollable, size: size
|
|
6498
|
-
React__default["default"].createElement(CModalContent,
|
|
6590
|
+
React__default["default"].createElement(CModalDialog, { alignment: alignment, fullscreen: fullscreen, scrollable: scrollable, size: size },
|
|
6591
|
+
React__default["default"].createElement(CModalContent, { ref: modalContentRef }, children)))));
|
|
6499
6592
|
};
|
|
6500
6593
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6501
|
-
React__default["default"].createElement(
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
})),
|
|
6594
|
+
React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: modalRef, onEnter: onShow, onExit: onClose, unmountOnExit: unmountOnClose, timeout: !transition ? 0 : duration }, function (state) {
|
|
6595
|
+
var transitionClass = getTransitionClass(state);
|
|
6596
|
+
return typeof window !== 'undefined' && portal
|
|
6597
|
+
? ReactDOM.createPortal(modal(forkedRef, transitionClass), document.body)
|
|
6598
|
+
: modal(forkedRef, transitionClass);
|
|
6599
|
+
}),
|
|
6508
6600
|
typeof window !== 'undefined' && portal
|
|
6509
6601
|
? backdrop && ReactDOM.createPortal(React__default["default"].createElement(CBackdrop, { visible: _visible }), document.body)
|
|
6510
6602
|
: backdrop && React__default["default"].createElement(CBackdrop, { visible: _visible })));
|
|
@@ -6527,6 +6619,7 @@ CModal.propTypes = {
|
|
|
6527
6619
|
scrollable: PropTypes.bool,
|
|
6528
6620
|
size: PropTypes.oneOf(['sm', 'lg', 'xl']),
|
|
6529
6621
|
transition: PropTypes.bool,
|
|
6622
|
+
unmountOnClose: PropTypes.bool,
|
|
6530
6623
|
visible: PropTypes.bool,
|
|
6531
6624
|
};
|
|
6532
6625
|
CModal.displayName = 'CModal';
|
|
@@ -6677,7 +6770,7 @@ var CNavGroup = React.forwardRef(function (_a, ref) {
|
|
|
6677
6770
|
var _className = classNames('nav-group', { show: _visible }, className);
|
|
6678
6771
|
return (React__default["default"].createElement("li", __assign({ className: _className }, rest, { ref: ref }),
|
|
6679
6772
|
toggler && (React__default["default"].createElement("a", { className: "nav-link nav-group-toggle", onClick: function (event) { return handleTogglerOnCLick(event); } }, toggler)),
|
|
6680
|
-
React__default["default"].createElement(Transition$1, { in: _visible, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 300 }, function (state) { return (React__default["default"].createElement("ul", { className: classNames('nav-group-items', {
|
|
6773
|
+
React__default["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["default"].createElement("ul", { className: classNames('nav-group-items', {
|
|
6681
6774
|
compact: compact,
|
|
6682
6775
|
}), style: __assign(__assign({}, style), transitionStyles[state]), ref: navItemsRef }, React__default["default"].Children.map(children, function (child, index) {
|
|
6683
6776
|
if (React__default["default"].isValidElement(child)) {
|
|
@@ -6789,46 +6882,150 @@ var CNavbarBrand = React.forwardRef(function (_a, ref) {
|
|
|
6789
6882
|
var _className = classNames('navbar-brand', className);
|
|
6790
6883
|
return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6791
6884
|
});
|
|
6792
|
-
CNavbarBrand.propTypes = {
|
|
6885
|
+
CNavbarBrand.propTypes = {
|
|
6886
|
+
children: PropTypes.node,
|
|
6887
|
+
className: PropTypes.string,
|
|
6888
|
+
component: PropTypes.elementType,
|
|
6889
|
+
};
|
|
6890
|
+
CNavbarBrand.displayName = 'CNavbarBrand';
|
|
6891
|
+
|
|
6892
|
+
var CNavbarNav = React.forwardRef(function (_a, ref) {
|
|
6893
|
+
var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'ul' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
|
|
6894
|
+
var _className = classNames('navbar-nav', className);
|
|
6895
|
+
return (React__default["default"].createElement(Component, __assign({ className: _className, role: "navigation" }, rest, { ref: ref }), children));
|
|
6896
|
+
});
|
|
6897
|
+
CNavbarNav.propTypes = {
|
|
6898
|
+
children: PropTypes.node,
|
|
6899
|
+
className: PropTypes.string,
|
|
6900
|
+
component: PropTypes.elementType,
|
|
6901
|
+
};
|
|
6902
|
+
CNavbarNav.displayName = 'CNavbarNav';
|
|
6903
|
+
|
|
6904
|
+
var CNavbarText = React.forwardRef(function (_a, ref) {
|
|
6905
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6906
|
+
var _className = classNames('navbar-text', className);
|
|
6907
|
+
return (React__default["default"].createElement("span", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6908
|
+
});
|
|
6909
|
+
CNavbarText.propTypes = {
|
|
6910
|
+
children: PropTypes.node,
|
|
6911
|
+
className: PropTypes.string,
|
|
6912
|
+
};
|
|
6913
|
+
CNavbarText.displayName = 'CNavbarText';
|
|
6914
|
+
|
|
6915
|
+
var CNavbarToggler = React.forwardRef(function (_a, ref) {
|
|
6916
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6917
|
+
var _className = classNames('navbar-toggler', className);
|
|
6918
|
+
return (React__default["default"].createElement("button", __assign({ type: "button", className: _className }, rest, { ref: ref }), children ? children : React__default["default"].createElement("span", { className: "navbar-toggler-icon" })));
|
|
6919
|
+
});
|
|
6920
|
+
CNavbarToggler.propTypes = {
|
|
6921
|
+
children: PropTypes.node,
|
|
6922
|
+
className: PropTypes.string,
|
|
6923
|
+
};
|
|
6924
|
+
CNavbarToggler.displayName = 'CNavbarToggler';
|
|
6925
|
+
|
|
6926
|
+
var COffcanvas = React.forwardRef(function (_a, ref) {
|
|
6927
|
+
var _b;
|
|
6928
|
+
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"]);
|
|
6929
|
+
var _h = React.useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
6930
|
+
var offcanvasRef = React.useRef(null);
|
|
6931
|
+
var forkedRef = useForkedRef(ref, offcanvasRef);
|
|
6932
|
+
React.useEffect(function () {
|
|
6933
|
+
setVisible(visible);
|
|
6934
|
+
}, [visible]);
|
|
6935
|
+
React.useEffect(function () {
|
|
6936
|
+
if (_visible) {
|
|
6937
|
+
if (!scroll) {
|
|
6938
|
+
document.body.style.overflow = 'hidden';
|
|
6939
|
+
document.body.style.paddingRight = '0px';
|
|
6940
|
+
}
|
|
6941
|
+
return;
|
|
6942
|
+
}
|
|
6943
|
+
if (!scroll) {
|
|
6944
|
+
document.body.style.removeProperty('overflow');
|
|
6945
|
+
document.body.style.removeProperty('padding-right');
|
|
6946
|
+
}
|
|
6947
|
+
}, [_visible]);
|
|
6948
|
+
var _className = classNames('offcanvas', (_b = {},
|
|
6949
|
+
_b["offcanvas-".concat(placement)] = placement,
|
|
6950
|
+
_b.show = _visible,
|
|
6951
|
+
_b), className);
|
|
6952
|
+
var transitionStyles = {
|
|
6953
|
+
entering: { visibility: 'visible' },
|
|
6954
|
+
entered: { visibility: 'visible' },
|
|
6955
|
+
exiting: { visibility: 'visible' },
|
|
6956
|
+
exited: { visibility: 'hidden' },
|
|
6957
|
+
};
|
|
6958
|
+
var handleDismiss = function () {
|
|
6959
|
+
setVisible(false);
|
|
6960
|
+
};
|
|
6961
|
+
var handleKeyDown = React.useCallback(function (event) {
|
|
6962
|
+
if (event.key === 'Escape' && keyboard) {
|
|
6963
|
+
return handleDismiss();
|
|
6964
|
+
}
|
|
6965
|
+
}, [ref, handleDismiss]);
|
|
6966
|
+
var offcanvas = function (ref, state) {
|
|
6967
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6968
|
+
React__default["default"].createElement("div", __assign({ className: _className, role: "dialog", style: __assign({}, transitionStyles[state]), tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: ref }), children)));
|
|
6969
|
+
};
|
|
6970
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
6971
|
+
React__default["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) {
|
|
6972
|
+
return typeof window !== 'undefined' && portal
|
|
6973
|
+
? ReactDOM.createPortal(offcanvas(forkedRef, state), document.body)
|
|
6974
|
+
: offcanvas(forkedRef, state);
|
|
6975
|
+
}),
|
|
6976
|
+
typeof window !== 'undefined' && portal
|
|
6977
|
+
? backdrop &&
|
|
6978
|
+
ReactDOM.createPortal(React__default["default"].createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }), document.body)
|
|
6979
|
+
: backdrop && (React__default["default"].createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }))));
|
|
6980
|
+
});
|
|
6981
|
+
COffcanvas.propTypes = {
|
|
6982
|
+
backdrop: PropTypes.bool,
|
|
6793
6983
|
children: PropTypes.node,
|
|
6794
6984
|
className: PropTypes.string,
|
|
6795
|
-
|
|
6985
|
+
keyboard: PropTypes.bool,
|
|
6986
|
+
onHide: PropTypes.func,
|
|
6987
|
+
onShow: PropTypes.func,
|
|
6988
|
+
placement: PropTypes.oneOf(['start', 'end', 'top', 'bottom'])
|
|
6989
|
+
.isRequired,
|
|
6990
|
+
portal: PropTypes.bool,
|
|
6991
|
+
scroll: PropTypes.bool,
|
|
6992
|
+
visible: PropTypes.bool,
|
|
6796
6993
|
};
|
|
6797
|
-
|
|
6994
|
+
COffcanvas.displayName = 'COffcanvas';
|
|
6798
6995
|
|
|
6799
|
-
var
|
|
6800
|
-
var children = _a.children,
|
|
6801
|
-
var _className = classNames('
|
|
6802
|
-
return (React__default["default"].createElement(
|
|
6996
|
+
var COffcanvasBody = React.forwardRef(function (_a, ref) {
|
|
6997
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6998
|
+
var _className = classNames('offcanvas-body', className);
|
|
6999
|
+
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6803
7000
|
});
|
|
6804
|
-
|
|
7001
|
+
COffcanvasBody.propTypes = {
|
|
6805
7002
|
children: PropTypes.node,
|
|
6806
7003
|
className: PropTypes.string,
|
|
6807
|
-
component: PropTypes.elementType,
|
|
6808
7004
|
};
|
|
6809
|
-
|
|
7005
|
+
COffcanvasBody.displayName = 'COffcanvasBody';
|
|
6810
7006
|
|
|
6811
|
-
var
|
|
7007
|
+
var COffcanvasHeader = React.forwardRef(function (_a, ref) {
|
|
6812
7008
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6813
|
-
var _className = classNames('
|
|
6814
|
-
return (React__default["default"].createElement("
|
|
7009
|
+
var _className = classNames('offcanvas-header', className);
|
|
7010
|
+
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6815
7011
|
});
|
|
6816
|
-
|
|
7012
|
+
COffcanvasHeader.propTypes = {
|
|
6817
7013
|
children: PropTypes.node,
|
|
6818
7014
|
className: PropTypes.string,
|
|
6819
7015
|
};
|
|
6820
|
-
|
|
7016
|
+
COffcanvasHeader.displayName = 'COffcanvasHeader';
|
|
6821
7017
|
|
|
6822
|
-
var
|
|
6823
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6824
|
-
var _className = classNames('
|
|
6825
|
-
return (React__default["default"].createElement(
|
|
7018
|
+
var COffcanvasTitle = React.forwardRef(function (_a, ref) {
|
|
7019
|
+
var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'h5' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
|
|
7020
|
+
var _className = classNames('offcanvas-title', className);
|
|
7021
|
+
return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6826
7022
|
});
|
|
6827
|
-
|
|
7023
|
+
COffcanvasTitle.propTypes = {
|
|
6828
7024
|
children: PropTypes.node,
|
|
6829
7025
|
className: PropTypes.string,
|
|
7026
|
+
component: PropTypes.elementType,
|
|
6830
7027
|
};
|
|
6831
|
-
|
|
7028
|
+
COffcanvasTitle.displayName = 'COffcanvasTitle';
|
|
6832
7029
|
|
|
6833
7030
|
var CPagination = React.forwardRef(function (_a, ref) {
|
|
6834
7031
|
var _b;
|
|
@@ -6903,66 +7100,6 @@ CPlaceholder.propTypes = {
|
|
|
6903
7100
|
};
|
|
6904
7101
|
CPlaceholder.displayName = 'CPlaceholder';
|
|
6905
7102
|
|
|
6906
|
-
var CPopover = function (_a) {
|
|
6907
|
-
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"]);
|
|
6908
|
-
var _e = React.useState(visible), _visible = _e[0], setVisible = _e[1];
|
|
6909
|
-
var getTransitionClass = function (state) {
|
|
6910
|
-
return state === 'entering'
|
|
6911
|
-
? 'fade'
|
|
6912
|
-
: state === 'entered'
|
|
6913
|
-
? 'fade show'
|
|
6914
|
-
: state === 'exiting'
|
|
6915
|
-
? 'fade'
|
|
6916
|
-
: 'fade';
|
|
6917
|
-
};
|
|
6918
|
-
return (React__default["default"].createElement(Manager, null,
|
|
6919
|
-
React__default["default"].createElement(Reference, null, function (_a) {
|
|
6920
|
-
var ref = _a.ref;
|
|
6921
|
-
return React__default["default"].cloneElement(children, __assign(__assign(__assign({ ref: ref }, ((trigger === 'click' || trigger.includes('click')) && {
|
|
6922
|
-
onClick: function () { return setVisible(!_visible); },
|
|
6923
|
-
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
6924
|
-
onFocus: function () { return setVisible(true); },
|
|
6925
|
-
onBlur: function () { return setVisible(false); },
|
|
6926
|
-
})), ((trigger === 'hover' || trigger.includes('hover')) && {
|
|
6927
|
-
onMouseEnter: function () { return setVisible(true); },
|
|
6928
|
-
onMouseLeave: function () { return setVisible(false); },
|
|
6929
|
-
})));
|
|
6930
|
-
}),
|
|
6931
|
-
typeof window !== 'undefined' &&
|
|
6932
|
-
ReactDOM.createPortal(React__default["default"].createElement(Transition$1, { in: _visible, onEnter: onShow, onExit: onHide, mountOnEnter: true, timeout: {
|
|
6933
|
-
enter: 0,
|
|
6934
|
-
exit: 200,
|
|
6935
|
-
}, unmountOnExit: true }, function (state) {
|
|
6936
|
-
var transitionClass = getTransitionClass(state);
|
|
6937
|
-
return (React__default["default"].createElement(Popper, { placement: placement, modifiers: [
|
|
6938
|
-
{
|
|
6939
|
-
name: 'offset',
|
|
6940
|
-
options: {
|
|
6941
|
-
offset: offset,
|
|
6942
|
-
},
|
|
6943
|
-
},
|
|
6944
|
-
] }, function (_a) {
|
|
6945
|
-
var arrowProps = _a.arrowProps, style = _a.style, ref = _a.ref;
|
|
6946
|
-
return (React__default["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),
|
|
6947
|
-
React__default["default"].createElement("div", __assign({ className: "popover-arrow" }, arrowProps)),
|
|
6948
|
-
React__default["default"].createElement("div", { className: "popover-header" }, title),
|
|
6949
|
-
React__default["default"].createElement("div", { className: "popover-body" }, content)));
|
|
6950
|
-
}));
|
|
6951
|
-
}), document.body)));
|
|
6952
|
-
};
|
|
6953
|
-
CPopover.propTypes = {
|
|
6954
|
-
children: PropTypes.any,
|
|
6955
|
-
content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
6956
|
-
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
6957
|
-
offset: PropTypes.any,
|
|
6958
|
-
onHide: PropTypes.func,
|
|
6959
|
-
onShow: PropTypes.func,
|
|
6960
|
-
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
6961
|
-
trigger: triggerPropType,
|
|
6962
|
-
visible: PropTypes.bool,
|
|
6963
|
-
};
|
|
6964
|
-
CPopover.displayName = 'CPopover';
|
|
6965
|
-
|
|
6966
7103
|
var CProgressBar = React.forwardRef(function (_a, ref) {
|
|
6967
7104
|
var _b;
|
|
6968
7105
|
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"]);
|
|
@@ -7001,6 +7138,69 @@ CProgress.propTypes = {
|
|
|
7001
7138
|
};
|
|
7002
7139
|
CProgress.displayName = 'CProgress';
|
|
7003
7140
|
|
|
7141
|
+
var CPopover = function (_a) {
|
|
7142
|
+
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"]);
|
|
7143
|
+
var _e = React.useState(visible), _visible = _e[0], setVisible = _e[1];
|
|
7144
|
+
var popoverRef = React.useRef();
|
|
7145
|
+
var _f = React.useState(null), referenceElement = _f[0], setReferenceElement = _f[1];
|
|
7146
|
+
var _g = React.useState(null), popperElement = _g[0], setPopperElement = _g[1];
|
|
7147
|
+
var _h = React.useState(null), arrowElement = _h[0], setArrowElement = _h[1];
|
|
7148
|
+
var _j = usePopper(referenceElement, popperElement, {
|
|
7149
|
+
modifiers: [
|
|
7150
|
+
{ name: 'arrow', options: { element: arrowElement } },
|
|
7151
|
+
{
|
|
7152
|
+
name: 'offset',
|
|
7153
|
+
options: {
|
|
7154
|
+
offset: offset,
|
|
7155
|
+
},
|
|
7156
|
+
},
|
|
7157
|
+
],
|
|
7158
|
+
placement: placement,
|
|
7159
|
+
}), styles = _j.styles, attributes = _j.attributes;
|
|
7160
|
+
var getTransitionClass = function (state) {
|
|
7161
|
+
return state === 'entering'
|
|
7162
|
+
? 'fade'
|
|
7163
|
+
: state === 'entered'
|
|
7164
|
+
? 'fade show'
|
|
7165
|
+
: state === 'exiting'
|
|
7166
|
+
? 'fade'
|
|
7167
|
+
: 'fade';
|
|
7168
|
+
};
|
|
7169
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7170
|
+
React__default["default"].cloneElement(children, __assign(__assign(__assign({ ref: setReferenceElement }, ((trigger === 'click' || trigger.includes('click')) && {
|
|
7171
|
+
onClick: function () { return setVisible(!_visible); },
|
|
7172
|
+
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
7173
|
+
onFocus: function () { return setVisible(true); },
|
|
7174
|
+
onBlur: function () { return setVisible(false); },
|
|
7175
|
+
})), ((trigger === 'hover' || trigger.includes('hover')) && {
|
|
7176
|
+
onMouseEnter: function () { return setVisible(true); },
|
|
7177
|
+
onMouseLeave: function () { return setVisible(false); },
|
|
7178
|
+
}))),
|
|
7179
|
+
typeof window !== 'undefined' &&
|
|
7180
|
+
ReactDOM.createPortal(React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: popoverRef, onEnter: onShow, onExit: onHide, timeout: {
|
|
7181
|
+
enter: 0,
|
|
7182
|
+
exit: 200,
|
|
7183
|
+
}, unmountOnExit: true }, function (state) {
|
|
7184
|
+
var transitionClass = getTransitionClass(state);
|
|
7185
|
+
return (React__default["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),
|
|
7186
|
+
React__default["default"].createElement("div", { className: "popover-arrow", style: styles.arrow, ref: setArrowElement }),
|
|
7187
|
+
React__default["default"].createElement("div", { className: "popover-header" }, title),
|
|
7188
|
+
React__default["default"].createElement("div", { className: "popover-body" }, content)));
|
|
7189
|
+
}), document.body)));
|
|
7190
|
+
};
|
|
7191
|
+
CPopover.propTypes = {
|
|
7192
|
+
children: PropTypes.any,
|
|
7193
|
+
content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
7194
|
+
offset: PropTypes.any,
|
|
7195
|
+
onHide: PropTypes.func,
|
|
7196
|
+
onShow: PropTypes.func,
|
|
7197
|
+
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
7198
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
7199
|
+
trigger: triggerPropType,
|
|
7200
|
+
visible: PropTypes.bool,
|
|
7201
|
+
};
|
|
7202
|
+
CPopover.displayName = 'CPopover';
|
|
7203
|
+
|
|
7004
7204
|
var isOnMobile = function (element) {
|
|
7005
7205
|
return Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'));
|
|
7006
7206
|
};
|
|
@@ -7113,110 +7313,6 @@ CSidebar.propTypes = {
|
|
|
7113
7313
|
};
|
|
7114
7314
|
CSidebar.displayName = 'CSidebar';
|
|
7115
7315
|
|
|
7116
|
-
var COffcanvas = React.forwardRef(function (_a, ref) {
|
|
7117
|
-
var _b;
|
|
7118
|
-
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"]);
|
|
7119
|
-
var _h = React.useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
7120
|
-
var offcanvasRef = React.useRef(null);
|
|
7121
|
-
var forkedRef = useForkedRef(ref, offcanvasRef);
|
|
7122
|
-
React.useEffect(function () {
|
|
7123
|
-
setVisible(visible);
|
|
7124
|
-
}, [visible]);
|
|
7125
|
-
React.useEffect(function () {
|
|
7126
|
-
if (_visible) {
|
|
7127
|
-
if (!scroll) {
|
|
7128
|
-
document.body.style.overflow = 'hidden';
|
|
7129
|
-
document.body.style.paddingRight = '0px';
|
|
7130
|
-
}
|
|
7131
|
-
return;
|
|
7132
|
-
}
|
|
7133
|
-
if (!scroll) {
|
|
7134
|
-
document.body.style.removeProperty('overflow');
|
|
7135
|
-
document.body.style.removeProperty('padding-right');
|
|
7136
|
-
}
|
|
7137
|
-
}, [_visible]);
|
|
7138
|
-
var _className = classNames('offcanvas', (_b = {},
|
|
7139
|
-
_b["offcanvas-".concat(placement)] = placement,
|
|
7140
|
-
_b.show = _visible,
|
|
7141
|
-
_b), className);
|
|
7142
|
-
var transitionStyles = {
|
|
7143
|
-
entering: { visibility: 'visible' },
|
|
7144
|
-
entered: { visibility: 'visible' },
|
|
7145
|
-
exiting: { visibility: 'visible' },
|
|
7146
|
-
exited: { visibility: 'hidden' },
|
|
7147
|
-
};
|
|
7148
|
-
var handleDismiss = function () {
|
|
7149
|
-
setVisible(false);
|
|
7150
|
-
};
|
|
7151
|
-
var handleKeyDown = React.useCallback(function (event) {
|
|
7152
|
-
if (event.key === 'Escape' && keyboard) {
|
|
7153
|
-
return handleDismiss();
|
|
7154
|
-
}
|
|
7155
|
-
}, [ref, handleDismiss]);
|
|
7156
|
-
var offcanvas = function (ref, state) {
|
|
7157
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7158
|
-
React__default["default"].createElement("div", __assign({ className: _className, role: "dialog", style: __assign({}, transitionStyles[state]), tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: ref }), children)));
|
|
7159
|
-
};
|
|
7160
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7161
|
-
React__default["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) {
|
|
7162
|
-
return typeof window !== 'undefined' && portal
|
|
7163
|
-
? ReactDOM.createPortal(offcanvas(forkedRef, state), document.body)
|
|
7164
|
-
: offcanvas(forkedRef, state);
|
|
7165
|
-
}),
|
|
7166
|
-
typeof window !== 'undefined' && portal
|
|
7167
|
-
? backdrop &&
|
|
7168
|
-
ReactDOM.createPortal(React__default["default"].createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }), document.body)
|
|
7169
|
-
: backdrop && (React__default["default"].createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }))));
|
|
7170
|
-
});
|
|
7171
|
-
COffcanvas.propTypes = {
|
|
7172
|
-
backdrop: PropTypes.bool,
|
|
7173
|
-
children: PropTypes.node,
|
|
7174
|
-
className: PropTypes.string,
|
|
7175
|
-
keyboard: PropTypes.bool,
|
|
7176
|
-
onHide: PropTypes.func,
|
|
7177
|
-
onShow: PropTypes.func,
|
|
7178
|
-
placement: PropTypes.oneOf(['start', 'end', 'top', 'bottom'])
|
|
7179
|
-
.isRequired,
|
|
7180
|
-
portal: PropTypes.bool,
|
|
7181
|
-
scroll: PropTypes.bool,
|
|
7182
|
-
visible: PropTypes.bool,
|
|
7183
|
-
};
|
|
7184
|
-
COffcanvas.displayName = 'COffcanvas';
|
|
7185
|
-
|
|
7186
|
-
var COffcanvasBody = React.forwardRef(function (_a, ref) {
|
|
7187
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7188
|
-
var _className = classNames('offcanvas-body', className);
|
|
7189
|
-
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7190
|
-
});
|
|
7191
|
-
COffcanvasBody.propTypes = {
|
|
7192
|
-
children: PropTypes.node,
|
|
7193
|
-
className: PropTypes.string,
|
|
7194
|
-
};
|
|
7195
|
-
COffcanvasBody.displayName = 'COffcanvasBody';
|
|
7196
|
-
|
|
7197
|
-
var COffcanvasHeader = React.forwardRef(function (_a, ref) {
|
|
7198
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7199
|
-
var _className = classNames('offcanvas-header', className);
|
|
7200
|
-
return (React__default["default"].createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7201
|
-
});
|
|
7202
|
-
COffcanvasHeader.propTypes = {
|
|
7203
|
-
children: PropTypes.node,
|
|
7204
|
-
className: PropTypes.string,
|
|
7205
|
-
};
|
|
7206
|
-
COffcanvasHeader.displayName = 'COffcanvasHeader';
|
|
7207
|
-
|
|
7208
|
-
var COffcanvasTitle = React.forwardRef(function (_a, ref) {
|
|
7209
|
-
var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'h5' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
|
|
7210
|
-
var _className = classNames('offcanvas-title', className);
|
|
7211
|
-
return (React__default["default"].createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7212
|
-
});
|
|
7213
|
-
COffcanvasTitle.propTypes = {
|
|
7214
|
-
children: PropTypes.node,
|
|
7215
|
-
className: PropTypes.string,
|
|
7216
|
-
component: PropTypes.elementType,
|
|
7217
|
-
};
|
|
7218
|
-
COffcanvasTitle.displayName = 'COffcanvasTitle';
|
|
7219
|
-
|
|
7220
7316
|
var CSidebarBrand = React.forwardRef(function (_a, ref) {
|
|
7221
7317
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7222
7318
|
var _className = classNames('sidebar-brand', className);
|
|
@@ -7433,15 +7529,17 @@ CTabContent.displayName = 'CTabContent';
|
|
|
7433
7529
|
|
|
7434
7530
|
var CTabPane = React.forwardRef(function (_a, ref) {
|
|
7435
7531
|
var children = _a.children, className = _a.className, onHide = _a.onHide, onShow = _a.onShow, visible = _a.visible, rest = __rest(_a, ["children", "className", "onHide", "onShow", "visible"]);
|
|
7532
|
+
var tabPaneRef = React.useRef();
|
|
7533
|
+
var forkedRef = useForkedRef(ref, tabPaneRef);
|
|
7436
7534
|
var getTransitionClass = function (state) {
|
|
7437
7535
|
return state === 'entered' && 'show';
|
|
7438
7536
|
};
|
|
7439
7537
|
var _className = classNames('tab-pane', 'fade', {
|
|
7440
7538
|
active: visible,
|
|
7441
7539
|
}, className);
|
|
7442
|
-
return (React__default["default"].createElement(Transition$1, { in: visible, onEnter: onShow, onExit: onHide, timeout: 150 }, function (state) {
|
|
7540
|
+
return (React__default["default"].createElement(Transition$1, { in: visible, nodeRef: tabPaneRef, onEnter: onShow, onExit: onHide, timeout: 150 }, function (state) {
|
|
7443
7541
|
var transitionClass = getTransitionClass(state);
|
|
7444
|
-
return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref:
|
|
7542
|
+
return (React__default["default"].createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: forkedRef }), children));
|
|
7445
7543
|
}));
|
|
7446
7544
|
});
|
|
7447
7545
|
CTabPane.propTypes = {
|
|
@@ -7457,6 +7555,8 @@ var CToastContext = React.createContext({});
|
|
|
7457
7555
|
var CToast = React.forwardRef(function (_a, ref) {
|
|
7458
7556
|
var _b;
|
|
7459
7557
|
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"]);
|
|
7558
|
+
var toastRef = React.useRef();
|
|
7559
|
+
var forkedRef = useForkedRef(ref, toastRef);
|
|
7460
7560
|
var _g = React.useState(false), _visible = _g[0], setVisible = _g[1];
|
|
7461
7561
|
var timeout = React.useRef();
|
|
7462
7562
|
React.useEffect(function () {
|
|
@@ -7494,10 +7594,10 @@ var CToast = React.forwardRef(function (_a, ref) {
|
|
|
7494
7594
|
? 'showing'
|
|
7495
7595
|
: 'fade';
|
|
7496
7596
|
};
|
|
7497
|
-
return (React__default["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) {
|
|
7597
|
+
return (React__default["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) {
|
|
7498
7598
|
var transitionClass = getTransitionClass(state);
|
|
7499
7599
|
return (React__default["default"].createElement(CToastContext.Provider, { value: contextValues },
|
|
7500
|
-
React__default["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:
|
|
7600
|
+
React__default["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)));
|
|
7501
7601
|
}));
|
|
7502
7602
|
});
|
|
7503
7603
|
CToast.propTypes = {
|
|
@@ -7607,8 +7707,24 @@ CToaster.propTypes = {
|
|
|
7607
7707
|
CToaster.displayName = 'CToaster';
|
|
7608
7708
|
|
|
7609
7709
|
var CTooltip = function (_a) {
|
|
7610
|
-
var children = _a.children, content = _a.content, _b = _a.
|
|
7611
|
-
var
|
|
7710
|
+
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"]);
|
|
7711
|
+
var tooltipRef = React.useRef();
|
|
7712
|
+
var _e = React.useState(visible), _visible = _e[0], setVisible = _e[1];
|
|
7713
|
+
var _f = React.useState(null), referenceElement = _f[0], setReferenceElement = _f[1];
|
|
7714
|
+
var _g = React.useState(null), popperElement = _g[0], setPopperElement = _g[1];
|
|
7715
|
+
var _h = React.useState(null), arrowElement = _h[0], setArrowElement = _h[1];
|
|
7716
|
+
var _j = usePopper(referenceElement, popperElement, {
|
|
7717
|
+
modifiers: [
|
|
7718
|
+
{ name: 'arrow', options: { element: arrowElement } },
|
|
7719
|
+
{
|
|
7720
|
+
name: 'offset',
|
|
7721
|
+
options: {
|
|
7722
|
+
offset: offset,
|
|
7723
|
+
},
|
|
7724
|
+
},
|
|
7725
|
+
],
|
|
7726
|
+
placement: placement,
|
|
7727
|
+
}), styles = _j.styles, attributes = _j.attributes;
|
|
7612
7728
|
var getTransitionClass = function (state) {
|
|
7613
7729
|
return state === 'entering'
|
|
7614
7730
|
? 'fade'
|
|
@@ -7618,39 +7734,34 @@ var CTooltip = function (_a) {
|
|
|
7618
7734
|
? 'fade'
|
|
7619
7735
|
: 'fade';
|
|
7620
7736
|
};
|
|
7621
|
-
return (React__default["default"].createElement(
|
|
7622
|
-
React__default["default"].
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
onMouseLeave: function () { return setVisible(false); },
|
|
7632
|
-
})));
|
|
7633
|
-
}),
|
|
7737
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7738
|
+
React__default["default"].cloneElement(children, __assign(__assign(__assign({ ref: setReferenceElement }, ((trigger === 'click' || trigger.includes('click')) && {
|
|
7739
|
+
onClick: function () { return setVisible(!_visible); },
|
|
7740
|
+
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
7741
|
+
onFocus: function () { return setVisible(true); },
|
|
7742
|
+
onBlur: function () { return setVisible(false); },
|
|
7743
|
+
})), ((trigger === 'hover' || trigger.includes('hover')) && {
|
|
7744
|
+
onMouseEnter: function () { return setVisible(true); },
|
|
7745
|
+
onMouseLeave: function () { return setVisible(false); },
|
|
7746
|
+
}))),
|
|
7634
7747
|
typeof window !== 'undefined' &&
|
|
7635
|
-
ReactDOM.createPortal(React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, onEnter: onShow, onExit: onHide, timeout: {
|
|
7748
|
+
ReactDOM.createPortal(React__default["default"].createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: tooltipRef, onEnter: onShow, onExit: onHide, timeout: {
|
|
7636
7749
|
enter: 0,
|
|
7637
7750
|
exit: 200,
|
|
7638
7751
|
}, unmountOnExit: true }, function (state) {
|
|
7639
7752
|
var transitionClass = getTransitionClass(state);
|
|
7640
|
-
return (React__default["default"].createElement(
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
React__default["default"].createElement("div", __assign({ className: "tooltip-arrow" }, arrowProps)),
|
|
7644
|
-
React__default["default"].createElement("div", { className: "tooltip-inner" }, content)));
|
|
7645
|
-
}));
|
|
7753
|
+
return (React__default["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),
|
|
7754
|
+
React__default["default"].createElement("div", { className: "tooltip-arrow", style: styles.arrow, ref: setArrowElement }),
|
|
7755
|
+
React__default["default"].createElement("div", { className: "tooltip-inner" }, content)));
|
|
7646
7756
|
}), document.body)));
|
|
7647
7757
|
};
|
|
7648
7758
|
CTooltip.propTypes = {
|
|
7649
7759
|
children: PropTypes.any,
|
|
7650
7760
|
content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
7651
|
-
|
|
7761
|
+
offset: PropTypes.any,
|
|
7652
7762
|
onHide: PropTypes.func,
|
|
7653
7763
|
onShow: PropTypes.func,
|
|
7764
|
+
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
7654
7765
|
trigger: triggerPropType,
|
|
7655
7766
|
visible: PropTypes.bool,
|
|
7656
7767
|
};
|