@coreui/react 4.1.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/accordion/index.d.ts +7 -0
- package/dist/components/alert/index.d.ts +4 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/backdrop/index.d.ts +2 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button-group/index.d.ts +3 -0
- package/dist/components/callout/index.d.ts +2 -0
- package/dist/components/card/index.d.ts +12 -0
- package/dist/components/carousel/index.d.ts +4 -0
- package/dist/components/close-button/index.d.ts +2 -0
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/dropdown/CDropdown.d.ts +10 -1
- package/dist/components/dropdown/CDropdownToggle.d.ts +4 -0
- package/dist/components/dropdown/index.d.ts +8 -0
- package/dist/components/footer/index.d.ts +2 -0
- package/dist/components/form/CForm.d.ts +2 -2
- package/dist/components/form/CFormCheck.d.ts +2 -1
- package/dist/components/form/CFormControlValidation.d.ts +46 -0
- package/dist/components/form/CFormControlWrapper.d.ts +31 -0
- package/dist/components/form/CFormInput.d.ts +6 -9
- package/dist/components/form/CFormRange.d.ts +7 -1
- package/dist/components/form/CFormSelect.d.ts +3 -10
- package/dist/components/form/CFormTextarea.d.ts +2 -9
- package/dist/components/form/index.d.ts +14 -0
- package/dist/components/grid/index.d.ts +4 -0
- package/dist/components/header/index.d.ts +7 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/list-group/index.d.ts +3 -0
- package/dist/components/modal/CModal.d.ts +3 -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 +585 -512
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +585 -512
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
- package/src/components/accordion/CAccordionButton.tsx +2 -1
- package/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap +2 -0
- package/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap +2 -0
- package/src/components/accordion/index.ts +15 -0
- package/src/components/alert/CAlert.tsx +14 -3
- package/src/components/alert/index.ts +5 -0
- package/src/components/avatar/index.ts +3 -0
- package/src/components/backdrop/CBackdrop.tsx +10 -3
- package/src/components/backdrop/index.ts +3 -0
- package/src/components/badge/index.ts +3 -0
- package/src/components/breadcrumb/index.ts +4 -0
- package/src/components/button/index.ts +3 -0
- package/src/components/button-group/index.ts +4 -0
- package/src/components/callout/index.ts +3 -0
- package/src/components/card/index.ts +25 -0
- package/src/components/carousel/index.ts +5 -0
- package/src/components/close-button/index.ts +3 -0
- package/src/components/collapse/CCollapse.tsx +1 -0
- package/src/components/collapse/index.ts +3 -0
- package/src/components/dropdown/CDropdown.tsx +19 -24
- package/src/components/dropdown/CDropdownItem.tsx +1 -1
- package/src/components/dropdown/CDropdownMenu.tsx +55 -3
- package/src/components/dropdown/CDropdownToggle.tsx +28 -5
- package/src/components/dropdown/index.ts +17 -0
- package/src/components/footer/index.ts +3 -0
- package/src/components/form/CForm.tsx +2 -2
- package/src/components/form/CFormCheck.tsx +32 -7
- package/src/components/form/CFormControlValidation.tsx +97 -0
- package/src/components/form/CFormControlWrapper.tsx +85 -0
- package/src/components/form/CFormInput.tsx +75 -19
- package/src/components/form/CFormRange.tsx +18 -4
- package/src/components/form/CFormSelect.tsx +60 -32
- package/src/components/form/CFormTextarea.tsx +45 -17
- package/src/components/form/index.ts +29 -0
- package/src/components/grid/index.ts +5 -0
- package/src/components/header/index.ts +8 -0
- package/src/components/image/index.ts +3 -0
- package/src/components/index.ts +35 -0
- package/src/components/link/index.ts +3 -0
- package/src/components/list-group/index.ts +4 -0
- package/src/components/modal/CModal.tsx +3 -2
- 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
|
|
@@ -852,7 +852,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
852
852
|
if (checkerResult == null) {
|
|
853
853
|
return null;
|
|
854
854
|
}
|
|
855
|
-
if (checkerResult.data.
|
|
855
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
856
856
|
expectedTypes.push(checkerResult.data.expectedType);
|
|
857
857
|
}
|
|
858
858
|
}
|
|
@@ -2479,7 +2479,7 @@ var CCollapse = forwardRef(function (_a, ref) {
|
|
|
2479
2479
|
var _className = classNames({
|
|
2480
2480
|
'collapse-horizontal': horizontal,
|
|
2481
2481
|
}, className);
|
|
2482
|
-
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) {
|
|
2483
2483
|
var transitionClass = getTransitionClass(state);
|
|
2484
2484
|
var currentHeight = height === 0 ? null : { height: height };
|
|
2485
2485
|
var currentWidth = width === 0 ? null : { width: width };
|
|
@@ -2513,7 +2513,7 @@ var CAccordionButton = forwardRef(function (_a, ref) {
|
|
|
2513
2513
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2514
2514
|
var _b = useContext(CAccordionItemContext), visible = _b.visible, setVisible = _b.setVisible;
|
|
2515
2515
|
var _className = classNames('accordion-button', { collapsed: !visible }, className);
|
|
2516
|
-
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));
|
|
2517
2517
|
});
|
|
2518
2518
|
CAccordionButton.propTypes = {
|
|
2519
2519
|
children: PropTypes.node,
|
|
@@ -2611,6 +2611,8 @@ CCloseButton.displayName = 'CCloseButton';
|
|
|
2611
2611
|
|
|
2612
2612
|
var CAlert = forwardRef(function (_a, ref) {
|
|
2613
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);
|
|
2614
2616
|
var _d = useState(visible), _visible = _d[0], setVisible = _d[1];
|
|
2615
2617
|
useEffect(function () {
|
|
2616
2618
|
setVisible(visible);
|
|
@@ -2621,9 +2623,9 @@ var CAlert = forwardRef(function (_a, ref) {
|
|
|
2621
2623
|
var getTransitionClass = function (state) {
|
|
2622
2624
|
return state === 'entered' && 'show';
|
|
2623
2625
|
};
|
|
2624
|
-
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) {
|
|
2625
2627
|
var transitionClass = getTransitionClass(state);
|
|
2626
|
-
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 }),
|
|
2627
2629
|
children,
|
|
2628
2630
|
dismissible && React__default.createElement(CCloseButton, { onClick: function () { return setVisible(false); } })));
|
|
2629
2631
|
}));
|
|
@@ -2707,6 +2709,25 @@ CAvatar.propTypes = {
|
|
|
2707
2709
|
};
|
|
2708
2710
|
CAvatar.displayName = 'CAvatar';
|
|
2709
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
|
+
|
|
2710
2731
|
var CBadge = forwardRef(function (_a, ref) {
|
|
2711
2732
|
var _b;
|
|
2712
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"]);
|
|
@@ -2734,23 +2755,6 @@ CBadge.propTypes = {
|
|
|
2734
2755
|
};
|
|
2735
2756
|
CBadge.displayName = 'CBadge';
|
|
2736
2757
|
|
|
2737
|
-
var CBackdrop = forwardRef(function (_a, ref) {
|
|
2738
|
-
var _b = _a.className, className = _b === void 0 ? 'modal-backdrop' : _b, visible = _a.visible, rest = __rest(_a, ["className", "visible"]);
|
|
2739
|
-
var _className = classNames(className, 'fade');
|
|
2740
|
-
var getTransitionClass = function (state) {
|
|
2741
|
-
return state === 'entered' && 'show';
|
|
2742
|
-
};
|
|
2743
|
-
return (React__default.createElement(Transition$1, { in: visible, mountOnEnter: true, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2744
|
-
var transitionClass = getTransitionClass(state);
|
|
2745
|
-
return React__default.createElement("div", __assign({ className: classNames(_className, transitionClass) }, rest, { ref: ref }));
|
|
2746
|
-
}));
|
|
2747
|
-
});
|
|
2748
|
-
CBackdrop.propTypes = {
|
|
2749
|
-
className: PropTypes.string,
|
|
2750
|
-
visible: PropTypes.bool,
|
|
2751
|
-
};
|
|
2752
|
-
CBackdrop.displayName = 'CBackdrop';
|
|
2753
|
-
|
|
2754
2758
|
var CBreadcrumb = forwardRef(function (_a, ref) {
|
|
2755
2759
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2756
2760
|
var _className = classNames('breadcrumb', className);
|
|
@@ -2796,6 +2800,17 @@ CButton.propTypes = {
|
|
|
2796
2800
|
};
|
|
2797
2801
|
CButton.displayName = 'CButton';
|
|
2798
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
|
+
|
|
2799
2814
|
var CButtonGroup = forwardRef(function (_a, ref) {
|
|
2800
2815
|
var _b;
|
|
2801
2816
|
var children = _a.children, className = _a.className, size = _a.size, vertical = _a.vertical, rest = __rest(_a, ["children", "className", "size", "vertical"]);
|
|
@@ -2810,17 +2825,6 @@ CButtonGroup.propTypes = {
|
|
|
2810
2825
|
};
|
|
2811
2826
|
CButtonGroup.displayName = 'CButtonGroup';
|
|
2812
2827
|
|
|
2813
|
-
var CButtonToolbar = forwardRef(function (_a, ref) {
|
|
2814
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
2815
|
-
var _className = classNames('btn-toolbar', className);
|
|
2816
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
2817
|
-
});
|
|
2818
|
-
CButtonToolbar.propTypes = {
|
|
2819
|
-
children: PropTypes.node,
|
|
2820
|
-
className: PropTypes.string,
|
|
2821
|
-
};
|
|
2822
|
-
CButtonToolbar.displayName = 'CButtonToolbar';
|
|
2823
|
-
|
|
2824
2828
|
var CCallout = forwardRef(function (_a, ref) {
|
|
2825
2829
|
var _b;
|
|
2826
2830
|
var children = _a.children, className = _a.className, color = _a.color, rest = __rest(_a, ["children", "className", "color"]);
|
|
@@ -3571,6 +3575,10 @@ function getContainingBlock(element) {
|
|
|
3571
3575
|
|
|
3572
3576
|
var currentNode = getParentNode(element);
|
|
3573
3577
|
|
|
3578
|
+
if (isShadowRoot(currentNode)) {
|
|
3579
|
+
currentNode = currentNode.host;
|
|
3580
|
+
}
|
|
3581
|
+
|
|
3574
3582
|
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
3575
3583
|
var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
3576
3584
|
// create a containing block.
|
|
@@ -3763,13 +3771,21 @@ function mapToStyles(_ref2) {
|
|
|
3763
3771
|
adaptive = _ref2.adaptive,
|
|
3764
3772
|
roundOffsets = _ref2.roundOffsets,
|
|
3765
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;
|
|
3766
3778
|
|
|
3767
|
-
var _ref3 =
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3779
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
3780
|
+
x: x,
|
|
3781
|
+
y: y
|
|
3782
|
+
}) : {
|
|
3783
|
+
x: x,
|
|
3784
|
+
y: y
|
|
3785
|
+
};
|
|
3772
3786
|
|
|
3787
|
+
x = _ref3.x;
|
|
3788
|
+
y = _ref3.y;
|
|
3773
3789
|
var hasX = offsets.hasOwnProperty('x');
|
|
3774
3790
|
var hasY = offsets.hasOwnProperty('y');
|
|
3775
3791
|
var sideX = left;
|
|
@@ -3795,7 +3811,7 @@ function mapToStyles(_ref2) {
|
|
|
3795
3811
|
|
|
3796
3812
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
3797
3813
|
sideY = bottom;
|
|
3798
|
-
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]
|
|
3799
3815
|
offsetParent[heightProp];
|
|
3800
3816
|
y -= offsetY - popperRect.height;
|
|
3801
3817
|
y *= gpuAcceleration ? 1 : -1;
|
|
@@ -3803,7 +3819,7 @@ function mapToStyles(_ref2) {
|
|
|
3803
3819
|
|
|
3804
3820
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
3805
3821
|
sideX = right;
|
|
3806
|
-
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]
|
|
3807
3823
|
offsetParent[widthProp];
|
|
3808
3824
|
x -= offsetX - popperRect.width;
|
|
3809
3825
|
x *= gpuAcceleration ? 1 : -1;
|
|
@@ -3814,6 +3830,17 @@ function mapToStyles(_ref2) {
|
|
|
3814
3830
|
position: position
|
|
3815
3831
|
}, adaptive && unsetSides);
|
|
3816
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
|
+
|
|
3817
3844
|
if (gpuAcceleration) {
|
|
3818
3845
|
var _Object$assign;
|
|
3819
3846
|
|
|
@@ -3823,9 +3850,9 @@ function mapToStyles(_ref2) {
|
|
|
3823
3850
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
3824
3851
|
}
|
|
3825
3852
|
|
|
3826
|
-
function computeStyles(
|
|
3827
|
-
var state =
|
|
3828
|
-
options =
|
|
3853
|
+
function computeStyles(_ref5) {
|
|
3854
|
+
var state = _ref5.state,
|
|
3855
|
+
options = _ref5.options;
|
|
3829
3856
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
3830
3857
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
3831
3858
|
_options$adaptive = options.adaptive,
|
|
@@ -4124,7 +4151,7 @@ function getClippingParents(element) {
|
|
|
4124
4151
|
|
|
4125
4152
|
|
|
4126
4153
|
return clippingParents.filter(function (clippingParent) {
|
|
4127
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'
|
|
4154
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
4128
4155
|
});
|
|
4129
4156
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
4130
4157
|
// clipping parents
|
|
@@ -5599,9 +5626,10 @@ function Reference(_ref) {
|
|
|
5599
5626
|
|
|
5600
5627
|
var CDropdownContext = createContext({});
|
|
5601
5628
|
var CDropdown = forwardRef(function (_a, ref) {
|
|
5602
|
-
var children = _a.children, alignment = _a.alignment, className = _a.className, dark = _a.dark, direction = _a.direction, onHide = _a.onHide, onShow = _a.onShow,
|
|
5603
|
-
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];
|
|
5604
5631
|
var dropdownRef = useRef(null);
|
|
5632
|
+
var dropdownToggleRef = useRef(null);
|
|
5605
5633
|
var forkedRef = useForkedRef(ref, dropdownRef);
|
|
5606
5634
|
var Component = variant === 'nav-item' ? 'li' : component;
|
|
5607
5635
|
// Disable popper if responsive aligment is set.
|
|
@@ -5610,8 +5638,10 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
5610
5638
|
}
|
|
5611
5639
|
var contextValues = {
|
|
5612
5640
|
alignment: alignment,
|
|
5641
|
+
autoClose: autoClose,
|
|
5613
5642
|
dark: dark,
|
|
5614
5643
|
direction: direction,
|
|
5644
|
+
dropdownToggleRef: dropdownToggleRef,
|
|
5615
5645
|
placement: placement,
|
|
5616
5646
|
popper: popper,
|
|
5617
5647
|
variant: variant,
|
|
@@ -5621,17 +5651,6 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
5621
5651
|
var _className = classNames(variant === 'nav-item' ? 'nav-item dropdown' : variant, {
|
|
5622
5652
|
show: _visible,
|
|
5623
5653
|
}, direction, className);
|
|
5624
|
-
useEffect(function () {
|
|
5625
|
-
_visible &&
|
|
5626
|
-
setTimeout(function () {
|
|
5627
|
-
window.addEventListener('click', handleClickOutside);
|
|
5628
|
-
window.addEventListener('keyup', handleKeyup);
|
|
5629
|
-
});
|
|
5630
|
-
return function () {
|
|
5631
|
-
window.removeEventListener('click', handleClickOutside);
|
|
5632
|
-
window.removeEventListener('keyup', handleKeyup);
|
|
5633
|
-
};
|
|
5634
|
-
}, [_visible]);
|
|
5635
5654
|
useEffect(function () {
|
|
5636
5655
|
setVisible(visible);
|
|
5637
5656
|
}, [visible]);
|
|
@@ -5639,18 +5658,6 @@ var CDropdown = forwardRef(function (_a, ref) {
|
|
|
5639
5658
|
_visible && onShow && onShow();
|
|
5640
5659
|
!_visible && onHide && onHide();
|
|
5641
5660
|
}, [_visible]);
|
|
5642
|
-
var handleKeyup = function (event) {
|
|
5643
|
-
var _a;
|
|
5644
|
-
if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
5645
|
-
setVisible(false);
|
|
5646
|
-
}
|
|
5647
|
-
};
|
|
5648
|
-
var handleClickOutside = function (event) {
|
|
5649
|
-
var _a;
|
|
5650
|
-
if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
5651
|
-
setVisible(false);
|
|
5652
|
-
}
|
|
5653
|
-
};
|
|
5654
5661
|
var dropdownContent = function () {
|
|
5655
5662
|
return variant === 'input-group' ? (React__default.createElement(React__default.Fragment, null, children)) : (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: forkedRef }), children));
|
|
5656
5663
|
};
|
|
@@ -5669,6 +5676,10 @@ CDropdown.propTypes = {
|
|
|
5669
5676
|
PropTypes.shape({ xl: alignmentDirection }),
|
|
5670
5677
|
PropTypes.shape({ xxl: alignmentDirection }),
|
|
5671
5678
|
]),
|
|
5679
|
+
autoClose: PropTypes.oneOfType([
|
|
5680
|
+
PropTypes.bool,
|
|
5681
|
+
PropTypes.oneOf(['inside', 'outside']),
|
|
5682
|
+
]),
|
|
5672
5683
|
children: PropTypes.node,
|
|
5673
5684
|
className: PropTypes.string,
|
|
5674
5685
|
component: PropTypes.elementType,
|
|
@@ -5708,7 +5719,7 @@ CDropdownHeader.displayName = 'CDropdownHeader';
|
|
|
5708
5719
|
var CDropdownItem = forwardRef(function (_a, ref) {
|
|
5709
5720
|
var children = _a.children, className = _a.className, _b = _a.component, component = _b === void 0 ? 'a' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
5710
5721
|
var _className = classNames('dropdown-item', className);
|
|
5711
|
-
return (React__default.createElement(CLink, __assign({ component: component }, rest, {
|
|
5722
|
+
return (React__default.createElement(CLink, __assign({ className: _className, component: component }, rest, { ref: ref }), children));
|
|
5712
5723
|
});
|
|
5713
5724
|
CDropdownItem.propTypes = {
|
|
5714
5725
|
children: PropTypes.node,
|
|
@@ -5731,7 +5742,36 @@ CDropdownItemPlain.displayName = 'CDropdownItemPlain';
|
|
|
5731
5742
|
|
|
5732
5743
|
var CDropdownMenu = function (_a) {
|
|
5733
5744
|
var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'ul' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
5734
|
-
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
|
+
};
|
|
5735
5775
|
var _placement = placement;
|
|
5736
5776
|
if (direction === 'dropup') {
|
|
5737
5777
|
_placement = 'top-start';
|
|
@@ -5771,7 +5811,7 @@ var CDropdownMenu = function (_a) {
|
|
|
5771
5811
|
})
|
|
5772
5812
|
: children));
|
|
5773
5813
|
};
|
|
5774
|
-
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) {
|
|
5775
5815
|
var ref = _a.ref, style = _a.style;
|
|
5776
5816
|
return dropdownMenuComponent(style, ref);
|
|
5777
5817
|
})) : (dropdownMenuComponent());
|
|
@@ -5784,8 +5824,8 @@ CDropdownMenu.propTypes = {
|
|
|
5784
5824
|
CDropdownMenu.displayName = 'CDropdownMenu';
|
|
5785
5825
|
|
|
5786
5826
|
var CDropdownToggle = function (_a) {
|
|
5787
|
-
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"]);
|
|
5788
|
-
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;
|
|
5789
5829
|
var _className = classNames({
|
|
5790
5830
|
'dropdown-toggle': caret,
|
|
5791
5831
|
'dropdown-toggle-split': split,
|
|
@@ -5800,175 +5840,29 @@ var CDropdownToggle = function (_a) {
|
|
|
5800
5840
|
onFocus: function () { return setVisible(true); },
|
|
5801
5841
|
onBlur: function () { return setVisible(false); },
|
|
5802
5842
|
}));
|
|
5803
|
-
var togglerProps = __assign({ className: _className, 'aria-expanded': visible }, triggers);
|
|
5843
|
+
var togglerProps = __assign(__assign({ className: _className, 'aria-expanded': visible }, (!rest.disabled && __assign({}, triggers))), triggers);
|
|
5804
5844
|
// We use any because Toggler can be `a` as well as `button`.
|
|
5805
5845
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5806
5846
|
var Toggler = function (ref) {
|
|
5807
|
-
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) }),
|
|
5808
5848
|
children,
|
|
5809
5849
|
split && React__default.createElement("span", { className: "visually-hidden" }, "Toggle Dropdown")));
|
|
5810
5850
|
};
|
|
5811
5851
|
return popper ? React__default.createElement(Reference, null, function (_a) {
|
|
5812
5852
|
var ref = _a.ref;
|
|
5813
5853
|
return Toggler(ref);
|
|
5814
|
-
}) : Toggler();
|
|
5854
|
+
}) : Toggler(dropdownToggleRef);
|
|
5815
5855
|
};
|
|
5816
5856
|
CDropdownToggle.propTypes = {
|
|
5817
5857
|
caret: PropTypes.bool,
|
|
5818
5858
|
children: PropTypes.node,
|
|
5819
5859
|
className: PropTypes.string,
|
|
5860
|
+
custom: PropTypes.bool,
|
|
5820
5861
|
split: PropTypes.bool,
|
|
5821
5862
|
trigger: triggerPropType,
|
|
5822
5863
|
};
|
|
5823
5864
|
CDropdownToggle.displayName = 'CDropdownToggle';
|
|
5824
5865
|
|
|
5825
|
-
var BREAKPOINTS$3 = [
|
|
5826
|
-
'xxl',
|
|
5827
|
-
'xl',
|
|
5828
|
-
'lg',
|
|
5829
|
-
'md',
|
|
5830
|
-
'sm',
|
|
5831
|
-
'xs',
|
|
5832
|
-
];
|
|
5833
|
-
var CCol = forwardRef(function (_a, ref) {
|
|
5834
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5835
|
-
var repsonsiveClassNames = [];
|
|
5836
|
-
BREAKPOINTS$3.forEach(function (bp) {
|
|
5837
|
-
var breakpoint = rest[bp];
|
|
5838
|
-
delete rest[bp];
|
|
5839
|
-
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
5840
|
-
if (typeof breakpoint === 'number' || typeof breakpoint === 'string') {
|
|
5841
|
-
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint));
|
|
5842
|
-
}
|
|
5843
|
-
if (typeof breakpoint === 'boolean') {
|
|
5844
|
-
repsonsiveClassNames.push("col".concat(infix));
|
|
5845
|
-
}
|
|
5846
|
-
if (breakpoint && typeof breakpoint === 'object') {
|
|
5847
|
-
if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') {
|
|
5848
|
-
repsonsiveClassNames.push("col".concat(infix, "-").concat(breakpoint.span));
|
|
5849
|
-
}
|
|
5850
|
-
if (typeof breakpoint.span === 'boolean') {
|
|
5851
|
-
repsonsiveClassNames.push("col".concat(infix));
|
|
5852
|
-
}
|
|
5853
|
-
if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') {
|
|
5854
|
-
repsonsiveClassNames.push("order".concat(infix, "-").concat(breakpoint.order));
|
|
5855
|
-
}
|
|
5856
|
-
if (typeof breakpoint.offset === 'number') {
|
|
5857
|
-
repsonsiveClassNames.push("offset".concat(infix, "-").concat(breakpoint.offset));
|
|
5858
|
-
}
|
|
5859
|
-
}
|
|
5860
|
-
});
|
|
5861
|
-
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'col', className);
|
|
5862
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5863
|
-
});
|
|
5864
|
-
var span = PropTypes.oneOfType([
|
|
5865
|
-
PropTypes.bool,
|
|
5866
|
-
PropTypes.number,
|
|
5867
|
-
PropTypes.string,
|
|
5868
|
-
PropTypes.oneOf(['auto']),
|
|
5869
|
-
]);
|
|
5870
|
-
var col = PropTypes.oneOfType([
|
|
5871
|
-
span,
|
|
5872
|
-
PropTypes.shape({
|
|
5873
|
-
span: span,
|
|
5874
|
-
offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
5875
|
-
order: PropTypes.oneOfType([
|
|
5876
|
-
PropTypes.oneOf(['first', 'last']),
|
|
5877
|
-
PropTypes.number,
|
|
5878
|
-
PropTypes.string,
|
|
5879
|
-
]),
|
|
5880
|
-
}),
|
|
5881
|
-
]);
|
|
5882
|
-
CCol.propTypes = {
|
|
5883
|
-
children: PropTypes.node,
|
|
5884
|
-
className: PropTypes.string,
|
|
5885
|
-
xs: col,
|
|
5886
|
-
sm: col,
|
|
5887
|
-
};
|
|
5888
|
-
CCol.displayName = 'CCol';
|
|
5889
|
-
|
|
5890
|
-
var BREAKPOINTS$2 = [
|
|
5891
|
-
'xxl',
|
|
5892
|
-
'xl',
|
|
5893
|
-
'lg',
|
|
5894
|
-
'md',
|
|
5895
|
-
'sm',
|
|
5896
|
-
'fluid',
|
|
5897
|
-
];
|
|
5898
|
-
var CContainer = forwardRef(function (_a, ref) {
|
|
5899
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5900
|
-
var repsonsiveClassNames = [];
|
|
5901
|
-
BREAKPOINTS$2.forEach(function (bp) {
|
|
5902
|
-
var breakpoint = rest[bp];
|
|
5903
|
-
delete rest[bp];
|
|
5904
|
-
breakpoint && repsonsiveClassNames.push("container-".concat(bp));
|
|
5905
|
-
});
|
|
5906
|
-
var _className = classNames(repsonsiveClassNames.length ? repsonsiveClassNames : 'container', className);
|
|
5907
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5908
|
-
});
|
|
5909
|
-
CContainer.propTypes = {
|
|
5910
|
-
children: PropTypes.node,
|
|
5911
|
-
className: PropTypes.string,
|
|
5912
|
-
sm: PropTypes.bool,
|
|
5913
|
-
md: PropTypes.bool,
|
|
5914
|
-
lg: PropTypes.bool,
|
|
5915
|
-
xl: PropTypes.bool,
|
|
5916
|
-
xxl: PropTypes.bool,
|
|
5917
|
-
fluid: PropTypes.bool,
|
|
5918
|
-
};
|
|
5919
|
-
CContainer.displayName = 'CContainer';
|
|
5920
|
-
|
|
5921
|
-
var BREAKPOINTS$1 = [
|
|
5922
|
-
'xxl',
|
|
5923
|
-
'xl',
|
|
5924
|
-
'lg',
|
|
5925
|
-
'md',
|
|
5926
|
-
'sm',
|
|
5927
|
-
'xs',
|
|
5928
|
-
];
|
|
5929
|
-
var CRow = forwardRef(function (_a, ref) {
|
|
5930
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
5931
|
-
var repsonsiveClassNames = [];
|
|
5932
|
-
BREAKPOINTS$1.forEach(function (bp) {
|
|
5933
|
-
var breakpoint = rest[bp];
|
|
5934
|
-
delete rest[bp];
|
|
5935
|
-
var infix = bp === 'xs' ? '' : "-".concat(bp);
|
|
5936
|
-
if (typeof breakpoint === 'object') {
|
|
5937
|
-
if (breakpoint.cols) {
|
|
5938
|
-
repsonsiveClassNames.push("row-cols".concat(infix, "-").concat(breakpoint.cols));
|
|
5939
|
-
}
|
|
5940
|
-
if (typeof breakpoint.gutter === 'number') {
|
|
5941
|
-
repsonsiveClassNames.push("g".concat(infix, "-").concat(breakpoint.gutter));
|
|
5942
|
-
}
|
|
5943
|
-
if (typeof breakpoint.gutterX === 'number') {
|
|
5944
|
-
repsonsiveClassNames.push("gx".concat(infix, "-").concat(breakpoint.gutterX));
|
|
5945
|
-
}
|
|
5946
|
-
if (typeof breakpoint.gutterY === 'number') {
|
|
5947
|
-
repsonsiveClassNames.push("gy".concat(infix, "-").concat(breakpoint.gutterY));
|
|
5948
|
-
}
|
|
5949
|
-
}
|
|
5950
|
-
});
|
|
5951
|
-
var _className = classNames('row', repsonsiveClassNames, className);
|
|
5952
|
-
return (React__default.createElement("div", { className: _className, ref: ref }, children));
|
|
5953
|
-
});
|
|
5954
|
-
var bp = PropTypes.shape({
|
|
5955
|
-
cols: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.string]),
|
|
5956
|
-
gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5957
|
-
gutterX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5958
|
-
gutterY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
5959
|
-
});
|
|
5960
|
-
CRow.propTypes = {
|
|
5961
|
-
children: PropTypes.node,
|
|
5962
|
-
className: PropTypes.string,
|
|
5963
|
-
xs: bp,
|
|
5964
|
-
sm: bp,
|
|
5965
|
-
md: bp,
|
|
5966
|
-
lg: bp,
|
|
5967
|
-
xl: bp,
|
|
5968
|
-
xxl: bp,
|
|
5969
|
-
};
|
|
5970
|
-
CRow.displayName = 'CRow';
|
|
5971
|
-
|
|
5972
5866
|
var CFooter = forwardRef(function (_a, ref) {
|
|
5973
5867
|
var _b;
|
|
5974
5868
|
var children = _a.children, className = _a.className, position = _a.position, rest = __rest(_a, ["children", "className", "position"]);
|
|
@@ -5994,12 +5888,49 @@ CForm.propTypes = {
|
|
|
5994
5888
|
};
|
|
5995
5889
|
CForm.displayName = 'CForm';
|
|
5996
5890
|
|
|
5997
|
-
var
|
|
5998
|
-
var
|
|
5999
|
-
var
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
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));
|
|
5899
|
+
});
|
|
5900
|
+
CFormFeedback.propTypes = {
|
|
5901
|
+
children: PropTypes.node,
|
|
5902
|
+
className: PropTypes.string,
|
|
5903
|
+
component: PropTypes.elementType,
|
|
5904
|
+
invalid: PropTypes.bool,
|
|
5905
|
+
tooltip: PropTypes.bool,
|
|
5906
|
+
valid: PropTypes.bool,
|
|
5907
|
+
};
|
|
5908
|
+
CFormFeedback.displayName = 'CFormFeedback';
|
|
5909
|
+
|
|
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,
|
|
5925
|
+
};
|
|
5926
|
+
CFormControlValidation.displayName = 'CFormControlValidation';
|
|
5927
|
+
|
|
5928
|
+
var CFormLabel = forwardRef(function (_a, ref) {
|
|
5929
|
+
var children = _a.children, className = _a.className, customClassName = _a.customClassName, rest = __rest(_a, ["children", "className", "customClassName"]);
|
|
5930
|
+
var _className = customClassName ? customClassName : classNames('form-label', className);
|
|
5931
|
+
return (React__default.createElement("label", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
5932
|
+
});
|
|
5933
|
+
CFormLabel.propTypes = {
|
|
6003
5934
|
children: PropTypes.node,
|
|
6004
5935
|
className: PropTypes.string,
|
|
6005
5936
|
customClassName: PropTypes.string,
|
|
@@ -6008,7 +5939,7 @@ CFormLabel.displayName = 'CFormLabel';
|
|
|
6008
5939
|
|
|
6009
5940
|
var CFormCheck = forwardRef(function (_a, ref) {
|
|
6010
5941
|
var _b;
|
|
6011
|
-
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"]);
|
|
6012
5943
|
var inputRef = useRef(null);
|
|
6013
5944
|
var forkedRef = useForkedRef(ref, inputRef);
|
|
6014
5945
|
useEffect(function () {
|
|
@@ -6034,50 +5965,25 @@ var CFormCheck = forwardRef(function (_a, ref) {
|
|
|
6034
5965
|
var formControl = function () {
|
|
6035
5966
|
return React__default.createElement("input", __assign({ type: type, className: inputClassName, id: id }, rest, { ref: forkedRef }));
|
|
6036
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 })); };
|
|
6037
5969
|
var formLabel = function () {
|
|
6038
5970
|
return (React__default.createElement(CFormLabel, __assign({ customClassName: labelClassName }, (id && { htmlFor: id })), label));
|
|
6039
5971
|
};
|
|
6040
5972
|
return button ? (React__default.createElement(React__default.Fragment, null,
|
|
6041
5973
|
formControl(),
|
|
6042
|
-
label && formLabel()
|
|
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 },
|
|
6043
5980
|
formControl(),
|
|
6044
|
-
|
|
6045
|
-
formControl()
|
|
6046
|
-
formLabel()))) : (formControl());
|
|
5981
|
+
formLabel(),
|
|
5982
|
+
formValidation()))) : (formControl());
|
|
6047
5983
|
});
|
|
6048
|
-
CFormCheck.propTypes = {
|
|
6049
|
-
button: PropTypes.object,
|
|
6050
|
-
className: PropTypes.string,
|
|
6051
|
-
hitArea: PropTypes.oneOf(['full']),
|
|
6052
|
-
id: PropTypes.string,
|
|
6053
|
-
indeterminate: PropTypes.bool,
|
|
6054
|
-
inline: PropTypes.bool,
|
|
6055
|
-
invalid: PropTypes.bool,
|
|
6056
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
6057
|
-
type: PropTypes.oneOf(['checkbox', 'radio']),
|
|
6058
|
-
valid: PropTypes.bool,
|
|
6059
|
-
};
|
|
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);
|
|
6060
5985
|
CFormCheck.displayName = 'CFormCheck';
|
|
6061
5986
|
|
|
6062
|
-
var CFormFeedback = forwardRef(function (_a, ref) {
|
|
6063
|
-
var _b;
|
|
6064
|
-
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"]);
|
|
6065
|
-
var _className = classNames((_b = {},
|
|
6066
|
-
_b["invalid-".concat(tooltip ? 'tooltip' : 'feedback')] = invalid,
|
|
6067
|
-
_b["valid-".concat(tooltip ? 'tooltip' : 'feedback')] = valid,
|
|
6068
|
-
_b), className);
|
|
6069
|
-
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6070
|
-
});
|
|
6071
|
-
CFormFeedback.propTypes = {
|
|
6072
|
-
children: PropTypes.node,
|
|
6073
|
-
className: PropTypes.string,
|
|
6074
|
-
component: PropTypes.elementType,
|
|
6075
|
-
invalid: PropTypes.bool,
|
|
6076
|
-
tooltip: PropTypes.bool,
|
|
6077
|
-
valid: PropTypes.bool,
|
|
6078
|
-
};
|
|
6079
|
-
CFormFeedback.displayName = 'CFormFeedback';
|
|
6080
|
-
|
|
6081
5987
|
var CFormFloating = forwardRef(function (_a, ref) {
|
|
6082
5988
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6083
5989
|
var _className = classNames('form-floating', className);
|
|
@@ -6089,62 +5995,81 @@ CFormFloating.propTypes = {
|
|
|
6089
5995
|
};
|
|
6090
5996
|
CFormFloating.displayName = 'CFormFloating';
|
|
6091
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
|
+
|
|
6092
6023
|
var CFormInput = forwardRef(function (_a, ref) {
|
|
6093
6024
|
var _b;
|
|
6094
|
-
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]);
|
|
6095
6031
|
var _className = classNames(plainText ? 'form-control-plaintext' : 'form-control', (_b = {},
|
|
6096
6032
|
_b["form-control-".concat(size)] = size,
|
|
6097
6033
|
_b['form-control-color'] = type === 'color',
|
|
6098
6034
|
_b['is-invalid'] = invalid,
|
|
6099
6035
|
_b['is-valid'] = valid,
|
|
6100
6036
|
_b), className);
|
|
6101
|
-
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)));
|
|
6102
6039
|
});
|
|
6103
|
-
CFormInput.propTypes = {
|
|
6104
|
-
children: PropTypes.node,
|
|
6105
|
-
className: PropTypes.string,
|
|
6106
|
-
invalid: PropTypes.bool,
|
|
6107
|
-
plainText: PropTypes.bool,
|
|
6108
|
-
size: PropTypes.oneOf(['sm', 'lg']),
|
|
6109
|
-
type: PropTypes.oneOfType([PropTypes.oneOf(['color', 'file', 'text']), PropTypes.string]),
|
|
6110
|
-
valid: PropTypes.bool,
|
|
6111
|
-
};
|
|
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);
|
|
6112
6041
|
CFormInput.displayName = 'CFormInput';
|
|
6113
6042
|
|
|
6114
6043
|
var CFormRange = forwardRef(function (_a, ref) {
|
|
6115
|
-
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
6044
|
+
var className = _a.className, label = _a.label, rest = __rest(_a, ["className", "label"]);
|
|
6116
6045
|
var _className = classNames('form-range', className);
|
|
6117
|
-
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 }))));
|
|
6118
6049
|
});
|
|
6119
6050
|
CFormRange.propTypes = {
|
|
6120
6051
|
className: PropTypes.string,
|
|
6052
|
+
label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
6121
6053
|
};
|
|
6122
6054
|
CFormRange.displayName = 'CFormRange';
|
|
6123
6055
|
|
|
6124
6056
|
var CFormSelect = forwardRef(function (_a, ref) {
|
|
6125
6057
|
var _b;
|
|
6126
|
-
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"]);
|
|
6127
6059
|
var _className = classNames('form-select', (_b = {},
|
|
6128
6060
|
_b["form-select-".concat(size)] = size,
|
|
6129
6061
|
_b['is-invalid'] = invalid,
|
|
6130
6062
|
_b['is-valid'] = valid,
|
|
6131
6063
|
_b), className);
|
|
6132
|
-
return (React__default.createElement(
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
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)));
|
|
6138
6071
|
});
|
|
6139
|
-
CFormSelect.propTypes = {
|
|
6140
|
-
children: PropTypes.node,
|
|
6141
|
-
className: PropTypes.string,
|
|
6142
|
-
htmlSize: PropTypes.number,
|
|
6143
|
-
invalid: PropTypes.bool,
|
|
6144
|
-
options: PropTypes.array,
|
|
6145
|
-
size: PropTypes.oneOf(['sm', 'lg']),
|
|
6146
|
-
valid: PropTypes.bool,
|
|
6147
|
-
};
|
|
6072
|
+
CFormSelect.propTypes = __assign({ className: PropTypes.string, htmlSize: PropTypes.number, options: PropTypes.array }, CFormControlWrapper.propTypes);
|
|
6148
6073
|
CFormSelect.displayName = 'CFormSelect';
|
|
6149
6074
|
|
|
6150
6075
|
var CFormSwitch = forwardRef(function (_a, ref) {
|
|
@@ -6175,33 +6100,16 @@ CFormSwitch.propTypes = {
|
|
|
6175
6100
|
};
|
|
6176
6101
|
CFormSwitch.displayName = 'CFormSwitch';
|
|
6177
6102
|
|
|
6178
|
-
var CFormText = forwardRef(function (_a, ref) {
|
|
6179
|
-
var children = _a.children, className = _a.className, _b = _a.component, Component = _b === void 0 ? 'div' : _b, rest = __rest(_a, ["children", "className", "component"]);
|
|
6180
|
-
var _className = classNames('form-text', className);
|
|
6181
|
-
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6182
|
-
});
|
|
6183
|
-
CFormText.propTypes = {
|
|
6184
|
-
children: PropTypes.node,
|
|
6185
|
-
className: PropTypes.string,
|
|
6186
|
-
component: PropTypes.elementType,
|
|
6187
|
-
};
|
|
6188
|
-
CFormText.displayName = 'CFormText';
|
|
6189
|
-
|
|
6190
6103
|
var CFormTextarea = forwardRef(function (_a, ref) {
|
|
6191
|
-
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"]);
|
|
6192
6105
|
var _className = classNames(plainText ? 'form-control-plaintext' : 'form-control', {
|
|
6193
6106
|
'is-invalid': invalid,
|
|
6194
6107
|
'is-valid': valid,
|
|
6195
6108
|
}, className);
|
|
6196
|
-
return (React__default.createElement(
|
|
6109
|
+
return (React__default.createElement(CFormControlWrapper, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, id: id, invalid: invalid, label: label, text: text, tooltipFeedback: tooltipFeedback, valid: valid },
|
|
6110
|
+
React__default.createElement("textarea", __assign({ className: _className }, rest, { ref: ref }), children)));
|
|
6197
6111
|
});
|
|
6198
|
-
CFormTextarea.propTypes = {
|
|
6199
|
-
children: PropTypes.node,
|
|
6200
|
-
className: PropTypes.string,
|
|
6201
|
-
invalid: PropTypes.bool,
|
|
6202
|
-
plainText: PropTypes.bool,
|
|
6203
|
-
valid: PropTypes.bool,
|
|
6204
|
-
};
|
|
6112
|
+
CFormTextarea.propTypes = __assign({ className: PropTypes.string, id: PropTypes.string, plainText: PropTypes.bool }, CFormControlWrapper.propTypes);
|
|
6205
6113
|
CFormTextarea.displayName = 'CFormTextarea';
|
|
6206
6114
|
|
|
6207
6115
|
var CInputGroup = forwardRef(function (_a, ref) {
|
|
@@ -6231,6 +6139,153 @@ CInputGroupText.propTypes = {
|
|
|
6231
6139
|
};
|
|
6232
6140
|
CInputGroupText.displayName = 'CInputGroupText';
|
|
6233
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
|
+
|
|
6234
6289
|
var CHeader = forwardRef(function (_a, ref) {
|
|
6235
6290
|
var _b;
|
|
6236
6291
|
var children = _a.children, className = _a.className, container = _a.container, position = _a.position, rest = __rest(_a, ["children", "className", "container", "position"]);
|
|
@@ -6509,7 +6564,7 @@ var CModal = forwardRef(function (_a, ref) {
|
|
|
6509
6564
|
React__default.createElement(CModalContent, { ref: modalContentRef }, children)))));
|
|
6510
6565
|
};
|
|
6511
6566
|
return (React__default.createElement(React__default.Fragment, null,
|
|
6512
|
-
React__default.createElement(Transition$1, { in: _visible, mountOnEnter: true, onEnter: onShow, onExit: onClose, unmountOnExit: unmountOnClose, timeout: !transition ? 0 : duration }, function (state) {
|
|
6567
|
+
React__default.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: modalRef, onEnter: onShow, onExit: onClose, unmountOnExit: unmountOnClose, timeout: !transition ? 0 : duration }, function (state) {
|
|
6513
6568
|
var transitionClass = getTransitionClass(state);
|
|
6514
6569
|
return typeof window !== 'undefined' && portal
|
|
6515
6570
|
? createPortal(modal(forkedRef, transitionClass), document.body)
|
|
@@ -6688,7 +6743,7 @@ var CNavGroup = forwardRef(function (_a, ref) {
|
|
|
6688
6743
|
var _className = classNames('nav-group', { show: _visible }, className);
|
|
6689
6744
|
return (React__default.createElement("li", __assign({ className: _className }, rest, { ref: ref }),
|
|
6690
6745
|
toggler && (React__default.createElement("a", { className: "nav-link nav-group-toggle", onClick: function (event) { return handleTogglerOnCLick(event); } }, toggler)),
|
|
6691
|
-
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', {
|
|
6692
6747
|
compact: compact,
|
|
6693
6748
|
}), style: __assign(__assign({}, style), transitionStyles[state]), ref: navItemsRef }, React__default.Children.map(children, function (child, index) {
|
|
6694
6749
|
if (React__default.isValidElement(child)) {
|
|
@@ -6841,9 +6896,113 @@ CNavbarToggler.propTypes = {
|
|
|
6841
6896
|
};
|
|
6842
6897
|
CNavbarToggler.displayName = 'CNavbarToggler';
|
|
6843
6898
|
|
|
6844
|
-
var
|
|
6899
|
+
var COffcanvas = forwardRef(function (_a, ref) {
|
|
6845
6900
|
var _b;
|
|
6846
|
-
var children = _a.children,
|
|
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,
|
|
6956
|
+
children: PropTypes.node,
|
|
6957
|
+
className: PropTypes.string,
|
|
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,
|
|
6966
|
+
};
|
|
6967
|
+
COffcanvas.displayName = 'COffcanvas';
|
|
6968
|
+
|
|
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));
|
|
6973
|
+
});
|
|
6974
|
+
COffcanvasBody.propTypes = {
|
|
6975
|
+
children: PropTypes.node,
|
|
6976
|
+
className: PropTypes.string,
|
|
6977
|
+
};
|
|
6978
|
+
COffcanvasBody.displayName = 'COffcanvasBody';
|
|
6979
|
+
|
|
6980
|
+
var COffcanvasHeader = forwardRef(function (_a, ref) {
|
|
6981
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
6982
|
+
var _className = classNames('offcanvas-header', className);
|
|
6983
|
+
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
6984
|
+
});
|
|
6985
|
+
COffcanvasHeader.propTypes = {
|
|
6986
|
+
children: PropTypes.node,
|
|
6987
|
+
className: PropTypes.string,
|
|
6988
|
+
};
|
|
6989
|
+
COffcanvasHeader.displayName = 'COffcanvasHeader';
|
|
6990
|
+
|
|
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));
|
|
6995
|
+
});
|
|
6996
|
+
COffcanvasTitle.propTypes = {
|
|
6997
|
+
children: PropTypes.node,
|
|
6998
|
+
className: PropTypes.string,
|
|
6999
|
+
component: PropTypes.elementType,
|
|
7000
|
+
};
|
|
7001
|
+
COffcanvasTitle.displayName = 'COffcanvasTitle';
|
|
7002
|
+
|
|
7003
|
+
var CPagination = forwardRef(function (_a, ref) {
|
|
7004
|
+
var _b;
|
|
7005
|
+
var children = _a.children, align = _a.align, className = _a.className, size = _a.size, rest = __rest(_a, ["children", "align", "className", "size"]);
|
|
6847
7006
|
var _className = classNames('pagination', (_b = {},
|
|
6848
7007
|
_b["justify-content-".concat(align)] = align,
|
|
6849
7008
|
_b["pagination-".concat(size)] = size,
|
|
@@ -6914,66 +7073,6 @@ CPlaceholder.propTypes = {
|
|
|
6914
7073
|
};
|
|
6915
7074
|
CPlaceholder.displayName = 'CPlaceholder';
|
|
6916
7075
|
|
|
6917
|
-
var CPopover = function (_a) {
|
|
6918
|
-
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"]);
|
|
6919
|
-
var _e = useState(visible), _visible = _e[0], setVisible = _e[1];
|
|
6920
|
-
var getTransitionClass = function (state) {
|
|
6921
|
-
return state === 'entering'
|
|
6922
|
-
? 'fade'
|
|
6923
|
-
: state === 'entered'
|
|
6924
|
-
? 'fade show'
|
|
6925
|
-
: state === 'exiting'
|
|
6926
|
-
? 'fade'
|
|
6927
|
-
: 'fade';
|
|
6928
|
-
};
|
|
6929
|
-
return (React__default.createElement(Manager, null,
|
|
6930
|
-
React__default.createElement(Reference, null, function (_a) {
|
|
6931
|
-
var ref = _a.ref;
|
|
6932
|
-
return React__default.cloneElement(children, __assign(__assign(__assign({ ref: ref }, ((trigger === 'click' || trigger.includes('click')) && {
|
|
6933
|
-
onClick: function () { return setVisible(!_visible); },
|
|
6934
|
-
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
6935
|
-
onFocus: function () { return setVisible(true); },
|
|
6936
|
-
onBlur: function () { return setVisible(false); },
|
|
6937
|
-
})), ((trigger === 'hover' || trigger.includes('hover')) && {
|
|
6938
|
-
onMouseEnter: function () { return setVisible(true); },
|
|
6939
|
-
onMouseLeave: function () { return setVisible(false); },
|
|
6940
|
-
})));
|
|
6941
|
-
}),
|
|
6942
|
-
typeof window !== 'undefined' &&
|
|
6943
|
-
createPortal(React__default.createElement(Transition$1, { in: _visible, onEnter: onShow, onExit: onHide, mountOnEnter: true, timeout: {
|
|
6944
|
-
enter: 0,
|
|
6945
|
-
exit: 200,
|
|
6946
|
-
}, unmountOnExit: true }, function (state) {
|
|
6947
|
-
var transitionClass = getTransitionClass(state);
|
|
6948
|
-
return (React__default.createElement(Popper, { placement: placement, modifiers: [
|
|
6949
|
-
{
|
|
6950
|
-
name: 'offset',
|
|
6951
|
-
options: {
|
|
6952
|
-
offset: offset,
|
|
6953
|
-
},
|
|
6954
|
-
},
|
|
6955
|
-
] }, function (_a) {
|
|
6956
|
-
var arrowProps = _a.arrowProps, style = _a.style, ref = _a.ref;
|
|
6957
|
-
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),
|
|
6958
|
-
React__default.createElement("div", __assign({ className: "popover-arrow" }, arrowProps)),
|
|
6959
|
-
React__default.createElement("div", { className: "popover-header" }, title),
|
|
6960
|
-
React__default.createElement("div", { className: "popover-body" }, content)));
|
|
6961
|
-
}));
|
|
6962
|
-
}), document.body)));
|
|
6963
|
-
};
|
|
6964
|
-
CPopover.propTypes = {
|
|
6965
|
-
children: PropTypes.any,
|
|
6966
|
-
content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
6967
|
-
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
6968
|
-
offset: PropTypes.any,
|
|
6969
|
-
onHide: PropTypes.func,
|
|
6970
|
-
onShow: PropTypes.func,
|
|
6971
|
-
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
6972
|
-
trigger: triggerPropType,
|
|
6973
|
-
visible: PropTypes.bool,
|
|
6974
|
-
};
|
|
6975
|
-
CPopover.displayName = 'CPopover';
|
|
6976
|
-
|
|
6977
7076
|
var CProgressBar = forwardRef(function (_a, ref) {
|
|
6978
7077
|
var _b;
|
|
6979
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"]);
|
|
@@ -7012,6 +7111,69 @@ CProgress.propTypes = {
|
|
|
7012
7111
|
};
|
|
7013
7112
|
CProgress.displayName = 'CProgress';
|
|
7014
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
|
+
|
|
7015
7177
|
var isOnMobile = function (element) {
|
|
7016
7178
|
return Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'));
|
|
7017
7179
|
};
|
|
@@ -7124,110 +7286,6 @@ CSidebar.propTypes = {
|
|
|
7124
7286
|
};
|
|
7125
7287
|
CSidebar.displayName = 'CSidebar';
|
|
7126
7288
|
|
|
7127
|
-
var COffcanvas = forwardRef(function (_a, ref) {
|
|
7128
|
-
var _b;
|
|
7129
|
-
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"]);
|
|
7130
|
-
var _h = useState(visible), _visible = _h[0], setVisible = _h[1];
|
|
7131
|
-
var offcanvasRef = useRef(null);
|
|
7132
|
-
var forkedRef = useForkedRef(ref, offcanvasRef);
|
|
7133
|
-
useEffect(function () {
|
|
7134
|
-
setVisible(visible);
|
|
7135
|
-
}, [visible]);
|
|
7136
|
-
useEffect(function () {
|
|
7137
|
-
if (_visible) {
|
|
7138
|
-
if (!scroll) {
|
|
7139
|
-
document.body.style.overflow = 'hidden';
|
|
7140
|
-
document.body.style.paddingRight = '0px';
|
|
7141
|
-
}
|
|
7142
|
-
return;
|
|
7143
|
-
}
|
|
7144
|
-
if (!scroll) {
|
|
7145
|
-
document.body.style.removeProperty('overflow');
|
|
7146
|
-
document.body.style.removeProperty('padding-right');
|
|
7147
|
-
}
|
|
7148
|
-
}, [_visible]);
|
|
7149
|
-
var _className = classNames('offcanvas', (_b = {},
|
|
7150
|
-
_b["offcanvas-".concat(placement)] = placement,
|
|
7151
|
-
_b.show = _visible,
|
|
7152
|
-
_b), className);
|
|
7153
|
-
var transitionStyles = {
|
|
7154
|
-
entering: { visibility: 'visible' },
|
|
7155
|
-
entered: { visibility: 'visible' },
|
|
7156
|
-
exiting: { visibility: 'visible' },
|
|
7157
|
-
exited: { visibility: 'hidden' },
|
|
7158
|
-
};
|
|
7159
|
-
var handleDismiss = function () {
|
|
7160
|
-
setVisible(false);
|
|
7161
|
-
};
|
|
7162
|
-
var handleKeyDown = useCallback(function (event) {
|
|
7163
|
-
if (event.key === 'Escape' && keyboard) {
|
|
7164
|
-
return handleDismiss();
|
|
7165
|
-
}
|
|
7166
|
-
}, [ref, handleDismiss]);
|
|
7167
|
-
var offcanvas = function (ref, state) {
|
|
7168
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
7169
|
-
React__default.createElement("div", __assign({ className: _className, role: "dialog", style: __assign({}, transitionStyles[state]), tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: ref }), children)));
|
|
7170
|
-
};
|
|
7171
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
7172
|
-
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) {
|
|
7173
|
-
return typeof window !== 'undefined' && portal
|
|
7174
|
-
? createPortal(offcanvas(forkedRef, state), document.body)
|
|
7175
|
-
: offcanvas(forkedRef, state);
|
|
7176
|
-
}),
|
|
7177
|
-
typeof window !== 'undefined' && portal
|
|
7178
|
-
? backdrop &&
|
|
7179
|
-
createPortal(React__default.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }), document.body)
|
|
7180
|
-
: backdrop && (React__default.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleDismiss, visible: _visible }))));
|
|
7181
|
-
});
|
|
7182
|
-
COffcanvas.propTypes = {
|
|
7183
|
-
backdrop: PropTypes.bool,
|
|
7184
|
-
children: PropTypes.node,
|
|
7185
|
-
className: PropTypes.string,
|
|
7186
|
-
keyboard: PropTypes.bool,
|
|
7187
|
-
onHide: PropTypes.func,
|
|
7188
|
-
onShow: PropTypes.func,
|
|
7189
|
-
placement: PropTypes.oneOf(['start', 'end', 'top', 'bottom'])
|
|
7190
|
-
.isRequired,
|
|
7191
|
-
portal: PropTypes.bool,
|
|
7192
|
-
scroll: PropTypes.bool,
|
|
7193
|
-
visible: PropTypes.bool,
|
|
7194
|
-
};
|
|
7195
|
-
COffcanvas.displayName = 'COffcanvas';
|
|
7196
|
-
|
|
7197
|
-
var COffcanvasBody = forwardRef(function (_a, ref) {
|
|
7198
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7199
|
-
var _className = classNames('offcanvas-body', className);
|
|
7200
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7201
|
-
});
|
|
7202
|
-
COffcanvasBody.propTypes = {
|
|
7203
|
-
children: PropTypes.node,
|
|
7204
|
-
className: PropTypes.string,
|
|
7205
|
-
};
|
|
7206
|
-
COffcanvasBody.displayName = 'COffcanvasBody';
|
|
7207
|
-
|
|
7208
|
-
var COffcanvasHeader = forwardRef(function (_a, ref) {
|
|
7209
|
-
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7210
|
-
var _className = classNames('offcanvas-header', className);
|
|
7211
|
-
return (React__default.createElement("div", __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7212
|
-
});
|
|
7213
|
-
COffcanvasHeader.propTypes = {
|
|
7214
|
-
children: PropTypes.node,
|
|
7215
|
-
className: PropTypes.string,
|
|
7216
|
-
};
|
|
7217
|
-
COffcanvasHeader.displayName = 'COffcanvasHeader';
|
|
7218
|
-
|
|
7219
|
-
var COffcanvasTitle = forwardRef(function (_a, ref) {
|
|
7220
|
-
var children = _a.children, _b = _a.component, Component = _b === void 0 ? 'h5' : _b, className = _a.className, rest = __rest(_a, ["children", "component", "className"]);
|
|
7221
|
-
var _className = classNames('offcanvas-title', className);
|
|
7222
|
-
return (React__default.createElement(Component, __assign({ className: _className }, rest, { ref: ref }), children));
|
|
7223
|
-
});
|
|
7224
|
-
COffcanvasTitle.propTypes = {
|
|
7225
|
-
children: PropTypes.node,
|
|
7226
|
-
className: PropTypes.string,
|
|
7227
|
-
component: PropTypes.elementType,
|
|
7228
|
-
};
|
|
7229
|
-
COffcanvasTitle.displayName = 'COffcanvasTitle';
|
|
7230
|
-
|
|
7231
7289
|
var CSidebarBrand = forwardRef(function (_a, ref) {
|
|
7232
7290
|
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7233
7291
|
var _className = classNames('sidebar-brand', className);
|
|
@@ -7444,15 +7502,17 @@ CTabContent.displayName = 'CTabContent';
|
|
|
7444
7502
|
|
|
7445
7503
|
var CTabPane = forwardRef(function (_a, ref) {
|
|
7446
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);
|
|
7447
7507
|
var getTransitionClass = function (state) {
|
|
7448
7508
|
return state === 'entered' && 'show';
|
|
7449
7509
|
};
|
|
7450
7510
|
var _className = classNames('tab-pane', 'fade', {
|
|
7451
7511
|
active: visible,
|
|
7452
7512
|
}, className);
|
|
7453
|
-
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) {
|
|
7454
7514
|
var transitionClass = getTransitionClass(state);
|
|
7455
|
-
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));
|
|
7456
7516
|
}));
|
|
7457
7517
|
});
|
|
7458
7518
|
CTabPane.propTypes = {
|
|
@@ -7468,6 +7528,8 @@ var CToastContext = createContext({});
|
|
|
7468
7528
|
var CToast = forwardRef(function (_a, ref) {
|
|
7469
7529
|
var _b;
|
|
7470
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);
|
|
7471
7533
|
var _g = useState(false), _visible = _g[0], setVisible = _g[1];
|
|
7472
7534
|
var timeout = useRef();
|
|
7473
7535
|
useEffect(function () {
|
|
@@ -7505,10 +7567,10 @@ var CToast = forwardRef(function (_a, ref) {
|
|
|
7505
7567
|
? 'showing'
|
|
7506
7568
|
: 'fade';
|
|
7507
7569
|
};
|
|
7508
|
-
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) {
|
|
7509
7571
|
var transitionClass = getTransitionClass(state);
|
|
7510
7572
|
return (React__default.createElement(CToastContext.Provider, { value: contextValues },
|
|
7511
|
-
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)));
|
|
7512
7574
|
}));
|
|
7513
7575
|
});
|
|
7514
7576
|
CToast.propTypes = {
|
|
@@ -7618,8 +7680,24 @@ CToaster.propTypes = {
|
|
|
7618
7680
|
CToaster.displayName = 'CToaster';
|
|
7619
7681
|
|
|
7620
7682
|
var CTooltip = function (_a) {
|
|
7621
|
-
var children = _a.children, content = _a.content, _b = _a.
|
|
7622
|
-
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;
|
|
7623
7701
|
var getTransitionClass = function (state) {
|
|
7624
7702
|
return state === 'entering'
|
|
7625
7703
|
? 'fade'
|
|
@@ -7629,39 +7707,34 @@ var CTooltip = function (_a) {
|
|
|
7629
7707
|
? 'fade'
|
|
7630
7708
|
: 'fade';
|
|
7631
7709
|
};
|
|
7632
|
-
return (React__default.createElement(
|
|
7633
|
-
React__default.
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
onMouseLeave: function () { return setVisible(false); },
|
|
7643
|
-
})));
|
|
7644
|
-
}),
|
|
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
|
+
}))),
|
|
7645
7720
|
typeof window !== 'undefined' &&
|
|
7646
|
-
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: {
|
|
7647
7722
|
enter: 0,
|
|
7648
7723
|
exit: 200,
|
|
7649
7724
|
}, unmountOnExit: true }, function (state) {
|
|
7650
7725
|
var transitionClass = getTransitionClass(state);
|
|
7651
|
-
return (React__default.createElement(
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
React__default.createElement("div", __assign({ className: "tooltip-arrow" }, arrowProps)),
|
|
7655
|
-
React__default.createElement("div", { className: "tooltip-inner" }, content)));
|
|
7656
|
-
}));
|
|
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)));
|
|
7657
7729
|
}), document.body)));
|
|
7658
7730
|
};
|
|
7659
7731
|
CTooltip.propTypes = {
|
|
7660
7732
|
children: PropTypes.any,
|
|
7661
7733
|
content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
7662
|
-
|
|
7734
|
+
offset: PropTypes.any,
|
|
7663
7735
|
onHide: PropTypes.func,
|
|
7664
7736
|
onShow: PropTypes.func,
|
|
7737
|
+
placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
|
|
7665
7738
|
trigger: triggerPropType,
|
|
7666
7739
|
visible: PropTypes.bool,
|
|
7667
7740
|
};
|