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