@coreui/react 4.11.0 → 4.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.es.js +39 -26
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +39 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modal/CModal.tsx +1 -4
- package/src/components/popover/CPopover.tsx +24 -13
- package/src/components/tooltip/CTooltip.tsx +24 -12
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
Several quick start options are available:
|
|
48
48
|
|
|
49
|
-
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.11.
|
|
49
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.11.1.zip)
|
|
50
50
|
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
|
|
51
51
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
|
|
52
52
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
|
package/dist/index.es.js
CHANGED
|
@@ -6107,8 +6107,7 @@ var CModal = forwardRef(function (_a, ref) {
|
|
|
6107
6107
|
};
|
|
6108
6108
|
}, [_visible]);
|
|
6109
6109
|
var handleClickOutside = function (event) {
|
|
6110
|
-
if (
|
|
6111
|
-
!modalContentRef.current.contains(event.target)) {
|
|
6110
|
+
if (modalRef.current && modalRef.current == event.target) {
|
|
6112
6111
|
handleDismiss();
|
|
6113
6112
|
}
|
|
6114
6113
|
};
|
|
@@ -6674,10 +6673,11 @@ CProgress.propTypes = {
|
|
|
6674
6673
|
CProgress.displayName = 'CProgress';
|
|
6675
6674
|
|
|
6676
6675
|
var CPopover = forwardRef(function (_a, ref) {
|
|
6677
|
-
var children = _a.children, _b = _a.animation, animation = _b === void 0 ? true : _b, className = _a.className, container = _a.container, content = _a.content, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.fallbackPlacements, fallbackPlacements = _d === void 0 ? ['top', 'right', 'bottom', 'left'] : _d, _e = _a.offset, offset = _e === void 0 ? [0, 8] : _e, onHide = _a.onHide
|
|
6676
|
+
var children = _a.children, _b = _a.animation, animation = _b === void 0 ? true : _b, className = _a.className, container = _a.container, content = _a.content, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.fallbackPlacements, fallbackPlacements = _d === void 0 ? ['top', 'right', 'bottom', 'left'] : _d, _e = _a.offset, offset = _e === void 0 ? [0, 8] : _e, onHide = _a.onHide; _a.onShow; var _f = _a.placement, placement = _f === void 0 ? 'top' : _f, title = _a.title, _g = _a.trigger, trigger = _g === void 0 ? 'click' : _g, visible = _a.visible, rest = __rest(_a, ["children", "animation", "className", "container", "content", "delay", "fallbackPlacements", "offset", "onHide", "onShow", "placement", "title", "trigger", "visible"]);
|
|
6678
6677
|
var popoverRef = useRef(null);
|
|
6679
6678
|
var togglerRef = useRef(null);
|
|
6680
6679
|
var forkedRef = useForkedRef(ref, popoverRef);
|
|
6680
|
+
var uID = useRef("popover".concat(Math.floor(Math.random() * 1000000)));
|
|
6681
6681
|
var _h = usePopper(), initPopper = _h.initPopper, destroyPopper = _h.destroyPopper;
|
|
6682
6682
|
var _j = useState(visible), _visible = _j[0], setVisible = _j[1];
|
|
6683
6683
|
var _delay = typeof delay === 'number' ? { show: delay, hide: delay } : delay;
|
|
@@ -6707,14 +6707,6 @@ var CPopover = forwardRef(function (_a, ref) {
|
|
|
6707
6707
|
useEffect(function () {
|
|
6708
6708
|
setVisible(visible);
|
|
6709
6709
|
}, [visible]);
|
|
6710
|
-
useEffect(function () {
|
|
6711
|
-
if (_visible && togglerRef.current && popoverRef.current) {
|
|
6712
|
-
initPopper(togglerRef.current, popoverRef.current, popperConfig);
|
|
6713
|
-
}
|
|
6714
|
-
return function () {
|
|
6715
|
-
destroyPopper();
|
|
6716
|
-
};
|
|
6717
|
-
}, [_visible]);
|
|
6718
6710
|
var toggleVisible = function (visible) {
|
|
6719
6711
|
if (visible) {
|
|
6720
6712
|
setTimeout(function () { return setVisible(true); }, _delay.show);
|
|
@@ -6723,7 +6715,9 @@ var CPopover = forwardRef(function (_a, ref) {
|
|
|
6723
6715
|
setTimeout(function () { return setVisible(false); }, _delay.hide);
|
|
6724
6716
|
};
|
|
6725
6717
|
return (React.createElement(React.Fragment, null,
|
|
6726
|
-
React.cloneElement(children, __assign(__assign(__assign({
|
|
6718
|
+
React.cloneElement(children, __assign(__assign(__assign(__assign(__assign({}, (_visible && {
|
|
6719
|
+
'aria-describedby': uID.current,
|
|
6720
|
+
})), { ref: togglerRef }), ((trigger === 'click' || trigger.includes('click')) && {
|
|
6727
6721
|
onClick: function () { return toggleVisible(!_visible); },
|
|
6728
6722
|
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
6729
6723
|
onFocus: function () { return toggleVisible(true); },
|
|
@@ -6733,7 +6727,17 @@ var CPopover = forwardRef(function (_a, ref) {
|
|
|
6733
6727
|
onMouseLeave: function () { return toggleVisible(false); },
|
|
6734
6728
|
}))),
|
|
6735
6729
|
React.createElement(CConditionalPortal, { container: container, portal: true },
|
|
6736
|
-
React.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: popoverRef, onEnter:
|
|
6730
|
+
React.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: popoverRef, onEnter: function () {
|
|
6731
|
+
if (togglerRef.current && popoverRef.current) {
|
|
6732
|
+
initPopper(togglerRef.current, popoverRef.current, popperConfig);
|
|
6733
|
+
}
|
|
6734
|
+
}, onEntering: function () {
|
|
6735
|
+
if (togglerRef.current && popoverRef.current) {
|
|
6736
|
+
popoverRef.current.style.display = 'initial';
|
|
6737
|
+
}
|
|
6738
|
+
}, onExit: onHide, onExited: function () {
|
|
6739
|
+
destroyPopper();
|
|
6740
|
+
}, timeout: {
|
|
6737
6741
|
enter: 0,
|
|
6738
6742
|
exit: popoverRef.current
|
|
6739
6743
|
? getTransitionDurationFromElement(popoverRef.current) + 50
|
|
@@ -6741,7 +6745,9 @@ var CPopover = forwardRef(function (_a, ref) {
|
|
|
6741
6745
|
}, unmountOnExit: true }, function (state) { return (React.createElement("div", __assign({ className: classNames('popover', 'bs-popover-auto', {
|
|
6742
6746
|
fade: animation,
|
|
6743
6747
|
show: state === 'entered',
|
|
6744
|
-
}, className), ref: forkedRef, role: "tooltip"
|
|
6748
|
+
}, className), id: uID.current, ref: forkedRef, role: "tooltip", style: {
|
|
6749
|
+
display: 'none',
|
|
6750
|
+
} }, rest),
|
|
6745
6751
|
React.createElement("div", { className: "popover-arrow" }),
|
|
6746
6752
|
React.createElement("div", { className: "popover-header" }, title),
|
|
6747
6753
|
React.createElement("div", { className: "popover-body" }, content))); }))));
|
|
@@ -7291,10 +7297,11 @@ CToaster.propTypes = {
|
|
|
7291
7297
|
CToaster.displayName = 'CToaster';
|
|
7292
7298
|
|
|
7293
7299
|
var CTooltip = forwardRef(function (_a, ref) {
|
|
7294
|
-
var children = _a.children, _b = _a.animation, animation = _b === void 0 ? true : _b, className = _a.className, container = _a.container, content = _a.content, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.fallbackPlacements, fallbackPlacements = _d === void 0 ? ['top', 'right', 'bottom', 'left'] : _d, _e = _a.offset, offset = _e === void 0 ? [0, 6] : _e, onHide = _a.onHide
|
|
7300
|
+
var children = _a.children, _b = _a.animation, animation = _b === void 0 ? true : _b, className = _a.className, container = _a.container, content = _a.content, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.fallbackPlacements, fallbackPlacements = _d === void 0 ? ['top', 'right', 'bottom', 'left'] : _d, _e = _a.offset, offset = _e === void 0 ? [0, 6] : _e, onHide = _a.onHide; _a.onShow; var _f = _a.placement, placement = _f === void 0 ? 'top' : _f, _g = _a.trigger, trigger = _g === void 0 ? ['hover', 'focus'] : _g, visible = _a.visible, rest = __rest(_a, ["children", "animation", "className", "container", "content", "delay", "fallbackPlacements", "offset", "onHide", "onShow", "placement", "trigger", "visible"]);
|
|
7295
7301
|
var tooltipRef = useRef(null);
|
|
7296
7302
|
var togglerRef = useRef(null);
|
|
7297
7303
|
var forkedRef = useForkedRef(ref, tooltipRef);
|
|
7304
|
+
var uID = useRef("tooltip".concat(Math.floor(Math.random() * 1000000)));
|
|
7298
7305
|
var _h = usePopper(), initPopper = _h.initPopper, destroyPopper = _h.destroyPopper;
|
|
7299
7306
|
var _j = useState(visible), _visible = _j[0], setVisible = _j[1];
|
|
7300
7307
|
var _delay = typeof delay === 'number' ? { show: delay, hide: delay } : delay;
|
|
@@ -7324,14 +7331,6 @@ var CTooltip = forwardRef(function (_a, ref) {
|
|
|
7324
7331
|
useEffect(function () {
|
|
7325
7332
|
setVisible(visible);
|
|
7326
7333
|
}, [visible]);
|
|
7327
|
-
useEffect(function () {
|
|
7328
|
-
if (_visible && togglerRef.current && tooltipRef.current) {
|
|
7329
|
-
initPopper(togglerRef.current, tooltipRef.current, popperConfig);
|
|
7330
|
-
}
|
|
7331
|
-
return function () {
|
|
7332
|
-
destroyPopper();
|
|
7333
|
-
};
|
|
7334
|
-
}, [_visible]);
|
|
7335
7334
|
var toggleVisible = function (visible) {
|
|
7336
7335
|
if (visible) {
|
|
7337
7336
|
setTimeout(function () { return setVisible(true); }, _delay.show);
|
|
@@ -7340,7 +7339,9 @@ var CTooltip = forwardRef(function (_a, ref) {
|
|
|
7340
7339
|
setTimeout(function () { return setVisible(false); }, _delay.hide);
|
|
7341
7340
|
};
|
|
7342
7341
|
return (React.createElement(React.Fragment, null,
|
|
7343
|
-
React.cloneElement(children, __assign(__assign(__assign({
|
|
7342
|
+
React.cloneElement(children, __assign(__assign(__assign(__assign(__assign({}, (_visible && {
|
|
7343
|
+
'aria-describedby': uID.current,
|
|
7344
|
+
})), { ref: togglerRef }), ((trigger === 'click' || trigger.includes('click')) && {
|
|
7344
7345
|
onClick: function () { return toggleVisible(!_visible); },
|
|
7345
7346
|
})), ((trigger === 'focus' || trigger.includes('focus')) && {
|
|
7346
7347
|
onFocus: function () { return toggleVisible(true); },
|
|
@@ -7350,7 +7351,17 @@ var CTooltip = forwardRef(function (_a, ref) {
|
|
|
7350
7351
|
onMouseLeave: function () { return toggleVisible(false); },
|
|
7351
7352
|
}))),
|
|
7352
7353
|
React.createElement(CConditionalPortal, { container: container, portal: true },
|
|
7353
|
-
React.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: tooltipRef, onEnter:
|
|
7354
|
+
React.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: tooltipRef, onEnter: function () {
|
|
7355
|
+
if (togglerRef.current && tooltipRef.current) {
|
|
7356
|
+
initPopper(togglerRef.current, tooltipRef.current, popperConfig);
|
|
7357
|
+
}
|
|
7358
|
+
}, onEntering: function () {
|
|
7359
|
+
if (togglerRef.current && tooltipRef.current) {
|
|
7360
|
+
tooltipRef.current.style.display = 'initial';
|
|
7361
|
+
}
|
|
7362
|
+
}, onExit: onHide, onExited: function () {
|
|
7363
|
+
destroyPopper();
|
|
7364
|
+
}, timeout: {
|
|
7354
7365
|
enter: 0,
|
|
7355
7366
|
exit: tooltipRef.current
|
|
7356
7367
|
? getTransitionDurationFromElement(tooltipRef.current) + 50
|
|
@@ -7358,7 +7369,9 @@ var CTooltip = forwardRef(function (_a, ref) {
|
|
|
7358
7369
|
}, unmountOnExit: true }, function (state) { return (React.createElement("div", __assign({ className: classNames('tooltip', 'bs-tooltip-auto', {
|
|
7359
7370
|
fade: animation,
|
|
7360
7371
|
show: state === 'entered',
|
|
7361
|
-
}, className), ref: forkedRef, role: "tooltip"
|
|
7372
|
+
}, className), id: uID.current, ref: forkedRef, role: "tooltip", style: {
|
|
7373
|
+
display: 'none',
|
|
7374
|
+
} }, rest),
|
|
7362
7375
|
React.createElement("div", { className: "tooltip-arrow" }),
|
|
7363
7376
|
React.createElement("div", { className: "tooltip-inner" }, content))); }))));
|
|
7364
7377
|
});
|