react-bootstrap 2.0.1 → 2.1.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/cjs/Accordion.d.ts +5 -4
- package/cjs/Accordion.js +4 -2
- package/cjs/AccordionButton.js +21 -6
- package/cjs/AccordionCollapse.js +2 -2
- package/cjs/AccordionContext.d.ts +6 -3
- package/cjs/AccordionContext.js +6 -2
- package/cjs/ElementChildren.d.ts +6 -1
- package/cjs/ElementChildren.js +10 -0
- package/cjs/FormCheck.js +4 -2
- package/cjs/Modal.d.ts +1 -1
- package/cjs/NavDropdown.d.ts +1 -1
- package/dist/react-bootstrap.js +104 -44
- package/dist/react-bootstrap.min.js +1 -1
- package/esm/Accordion.d.ts +5 -4
- package/esm/Accordion.js +4 -2
- package/esm/AccordionButton.js +21 -6
- package/esm/AccordionCollapse.js +2 -2
- package/esm/AccordionContext.d.ts +6 -3
- package/esm/AccordionContext.js +3 -0
- package/esm/ElementChildren.d.ts +6 -1
- package/esm/ElementChildren.js +10 -1
- package/esm/FormCheck.js +3 -2
- package/esm/Modal.d.ts +1 -1
- package/esm/NavDropdown.d.ts +1 -1
- package/package.json +3 -4
- package/cjs/AbstractNav.d.ts +0 -15
- package/cjs/AbstractNavItem.d.ts +0 -19
- package/cjs/AccordionToggle.d.ts +0 -11
- package/cjs/CardColumns.d.ts +0 -2
- package/cjs/CardContext.d.ts +0 -6
- package/cjs/CardDeck.d.ts +0 -2
- package/cjs/FormFile.d.ts +0 -23
- package/cjs/FormFileInput.d.ts +0 -10
- package/cjs/FormFileLabel.d.ts +0 -7
- package/cjs/Jumbotron.d.ts +0 -7
- package/cjs/Media.d.ts +0 -8
- package/cjs/PopoverContent.d.ts +0 -5
- package/cjs/PopoverTitle.d.ts +0 -5
- package/cjs/ResponsiveEmbed.d.ts +0 -9
- package/cjs/SafeAnchor.d.ts +0 -17
- package/cjs/SelectableContext.d.ts +0 -5
- package/cjs/TabContext.d.ts +0 -12
- package/cjs/usePopperMarginModifiers.d.ts +0 -4
- package/esm/AbstractNav.d.ts +0 -15
- package/esm/AbstractNavItem.d.ts +0 -19
- package/esm/AccordionToggle.d.ts +0 -11
- package/esm/CardColumns.d.ts +0 -2
- package/esm/CardContext.d.ts +0 -6
- package/esm/CardDeck.d.ts +0 -2
- package/esm/FormFile.d.ts +0 -23
- package/esm/FormFileInput.d.ts +0 -10
- package/esm/FormFileLabel.d.ts +0 -7
- package/esm/Jumbotron.d.ts +0 -7
- package/esm/Media.d.ts +0 -8
- package/esm/PopoverContent.d.ts +0 -5
- package/esm/PopoverTitle.d.ts +0 -5
- package/esm/ResponsiveEmbed.d.ts +0 -9
- package/esm/SafeAnchor.d.ts +0 -17
- package/esm/SelectableContext.d.ts +0 -5
- package/esm/TabContext.d.ts +0 -12
- package/esm/usePopperMarginModifiers.d.ts +0 -4
package/cjs/Accordion.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AccordionSelectCallback, AccordionEventKey } from './AccordionContext';
|
|
3
3
|
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
4
4
|
export interface AccordionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'>, BsPrefixProps {
|
|
5
|
-
activeKey?:
|
|
6
|
-
defaultActiveKey?:
|
|
7
|
-
onSelect?:
|
|
5
|
+
activeKey?: AccordionEventKey;
|
|
6
|
+
defaultActiveKey?: AccordionEventKey;
|
|
7
|
+
onSelect?: AccordionSelectCallback;
|
|
8
8
|
flush?: boolean;
|
|
9
|
+
alwaysOpen?: boolean;
|
|
9
10
|
}
|
|
10
11
|
declare const _default: BsPrefixRefForwardingComponent<"div", AccordionProps> & {
|
|
11
12
|
Button: BsPrefixRefForwardingComponent<"div", import("./AccordionButton").AccordionButtonProps>;
|
package/cjs/Accordion.js
CHANGED
|
@@ -40,6 +40,7 @@ const Accordion = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
40
40
|
className,
|
|
41
41
|
onSelect,
|
|
42
42
|
flush,
|
|
43
|
+
alwaysOpen,
|
|
43
44
|
...controlledProps
|
|
44
45
|
} = (0, _uncontrollable.useUncontrolled)(props, {
|
|
45
46
|
activeKey: 'onSelect'
|
|
@@ -47,8 +48,9 @@ const Accordion = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
47
48
|
const prefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'accordion');
|
|
48
49
|
const contextValue = (0, React.useMemo)(() => ({
|
|
49
50
|
activeEventKey: activeKey,
|
|
50
|
-
onSelect
|
|
51
|
-
|
|
51
|
+
onSelect,
|
|
52
|
+
alwaysOpen
|
|
53
|
+
}), [activeKey, onSelect, alwaysOpen]);
|
|
52
54
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AccordionContext.default.Provider, {
|
|
53
55
|
value: contextValue,
|
|
54
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
package/cjs/AccordionButton.js
CHANGED
|
@@ -10,7 +10,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
|
|
13
|
-
var _AccordionContext =
|
|
13
|
+
var _AccordionContext = _interopRequireWildcard(require("./AccordionContext"));
|
|
14
14
|
|
|
15
15
|
var _AccordionItemContext = _interopRequireDefault(require("./AccordionItemContext"));
|
|
16
16
|
|
|
@@ -25,16 +25,31 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
25
25
|
function useAccordionButton(eventKey, onClick) {
|
|
26
26
|
const {
|
|
27
27
|
activeEventKey,
|
|
28
|
-
onSelect
|
|
28
|
+
onSelect,
|
|
29
|
+
alwaysOpen
|
|
29
30
|
} = (0, React.useContext)(_AccordionContext.default);
|
|
30
31
|
return e => {
|
|
31
32
|
/*
|
|
32
33
|
Compare the event key in context with the given event key.
|
|
33
34
|
If they are the same, then collapse the component.
|
|
34
35
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (
|
|
36
|
+
let eventKeyPassed = eventKey === activeEventKey ? null : eventKey;
|
|
37
|
+
|
|
38
|
+
if (alwaysOpen) {
|
|
39
|
+
if (Array.isArray(activeEventKey)) {
|
|
40
|
+
if (activeEventKey.includes(eventKey)) {
|
|
41
|
+
eventKeyPassed = activeEventKey.filter(k => k !== eventKey);
|
|
42
|
+
} else {
|
|
43
|
+
eventKeyPassed = [...activeEventKey, eventKey];
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
// activeEventKey is undefined.
|
|
47
|
+
eventKeyPassed = [eventKey];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
onSelect == null ? void 0 : onSelect(eventKeyPassed, e);
|
|
52
|
+
onClick == null ? void 0 : onClick(e);
|
|
38
53
|
};
|
|
39
54
|
}
|
|
40
55
|
|
|
@@ -64,7 +79,7 @@ const AccordionButton = /*#__PURE__*/React.forwardRef(({
|
|
|
64
79
|
onClick: accordionOnClick,
|
|
65
80
|
...props,
|
|
66
81
|
"aria-expanded": eventKey === activeEventKey,
|
|
67
|
-
className: (0, _classnames.default)(className, bsPrefix,
|
|
82
|
+
className: (0, _classnames.default)(className, bsPrefix, !(0, _AccordionContext.isAccordionItemSelected)(activeEventKey, eventKey) && 'collapsed')
|
|
68
83
|
});
|
|
69
84
|
});
|
|
70
85
|
AccordionButton.displayName = 'AccordionButton';
|
package/cjs/AccordionCollapse.js
CHANGED
|
@@ -13,7 +13,7 @@ var _ThemeProvider = require("./ThemeProvider");
|
|
|
13
13
|
|
|
14
14
|
var _Collapse = _interopRequireDefault(require("./Collapse"));
|
|
15
15
|
|
|
16
|
-
var _AccordionContext =
|
|
16
|
+
var _AccordionContext = _interopRequireWildcard(require("./AccordionContext"));
|
|
17
17
|
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
|
|
@@ -35,7 +35,7 @@ const AccordionCollapse = /*#__PURE__*/React.forwardRef(({
|
|
|
35
35
|
bsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'accordion-collapse');
|
|
36
36
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Collapse.default, {
|
|
37
37
|
ref: ref,
|
|
38
|
-
in: activeEventKey
|
|
38
|
+
in: (0, _AccordionContext.isAccordionItemSelected)(activeEventKey, eventKey),
|
|
39
39
|
...props,
|
|
40
40
|
className: (0, _classnames.default)(className, bsPrefix),
|
|
41
41
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
export declare type AccordionEventKey = string | string[] | null | undefined;
|
|
3
|
+
export declare type AccordionSelectCallback = (eventKey: AccordionEventKey, e: React.SyntheticEvent<unknown>) => void;
|
|
3
4
|
export interface AccordionContextValue {
|
|
4
|
-
activeEventKey?:
|
|
5
|
-
onSelect?:
|
|
5
|
+
activeEventKey?: AccordionEventKey;
|
|
6
|
+
onSelect?: AccordionSelectCallback;
|
|
7
|
+
alwaysOpen?: boolean;
|
|
6
8
|
}
|
|
9
|
+
export declare function isAccordionItemSelected(activeEventKey: AccordionEventKey, eventKey: string): boolean;
|
|
7
10
|
declare const context: React.Context<AccordionContextValue>;
|
|
8
11
|
export default context;
|
package/cjs/AccordionContext.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
+
exports.isAccordionItemSelected = isAccordionItemSelected;
|
|
5
6
|
|
|
6
7
|
var React = _interopRequireWildcard(require("react"));
|
|
7
8
|
|
|
@@ -9,8 +10,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
9
10
|
|
|
10
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
12
|
|
|
13
|
+
function isAccordionItemSelected(activeEventKey, eventKey) {
|
|
14
|
+
return Array.isArray(activeEventKey) ? activeEventKey.includes(eventKey) : activeEventKey === eventKey;
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
const context = /*#__PURE__*/React.createContext({});
|
|
13
18
|
context.displayName = 'AccordionContext';
|
|
14
19
|
var _default = context;
|
|
15
|
-
exports.default = _default;
|
|
16
|
-
module.exports = exports.default;
|
|
20
|
+
exports.default = _default;
|
package/cjs/ElementChildren.d.ts
CHANGED
|
@@ -15,4 +15,9 @@ declare function map<P = any>(children: any, func: (el: React.ReactElement<P>, i
|
|
|
15
15
|
* leaf child with the index reflecting the position relative to "valid components".
|
|
16
16
|
*/
|
|
17
17
|
declare function forEach<P = any>(children: any, func: (el: React.ReactElement<P>, index: number) => void): void;
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Finds whether a component's `children` prop includes a React element of the
|
|
20
|
+
* specified type.
|
|
21
|
+
*/
|
|
22
|
+
declare function hasChildOfType<P = any>(children: React.ReactNode, type: string | React.JSXElementConstructor<P>): boolean;
|
|
23
|
+
export { map, forEach, hasChildOfType };
|
package/cjs/ElementChildren.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.forEach = forEach;
|
|
5
|
+
exports.hasChildOfType = hasChildOfType;
|
|
5
6
|
exports.map = map;
|
|
6
7
|
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -35,4 +36,13 @@ function forEach(children, func) {
|
|
|
35
36
|
React.Children.forEach(children, child => {
|
|
36
37
|
if ( /*#__PURE__*/React.isValidElement(child)) func(child, index++);
|
|
37
38
|
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Finds whether a component's `children` prop includes a React element of the
|
|
42
|
+
* specified type.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
function hasChildOfType(children, type) {
|
|
47
|
+
return React.Children.toArray(children).some(child => /*#__PURE__*/React.isValidElement(child) && child.type === type);
|
|
38
48
|
}
|
package/cjs/FormCheck.js
CHANGED
|
@@ -19,6 +19,8 @@ var _FormContext = _interopRequireDefault(require("./FormContext"));
|
|
|
19
19
|
|
|
20
20
|
var _ThemeProvider = require("./ThemeProvider");
|
|
21
21
|
|
|
22
|
+
var _ElementChildren = require("./ElementChildren");
|
|
23
|
+
|
|
22
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
25
|
|
|
24
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -54,7 +56,7 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
|
|
|
54
56
|
const innerFormContext = (0, React.useMemo)(() => ({
|
|
55
57
|
controlId: id || controlId
|
|
56
58
|
}), [controlId, id]);
|
|
57
|
-
const hasLabel = label != null && label !== false
|
|
59
|
+
const hasLabel = !children && label != null && label !== false || (0, _ElementChildren.hasChildOfType)(children, _FormCheckLabel.default);
|
|
58
60
|
const input = /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormCheckInput.default, { ...props,
|
|
59
61
|
type: type === 'switch' ? 'checkbox' : type,
|
|
60
62
|
ref: ref,
|
|
@@ -67,7 +69,7 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
|
|
|
67
69
|
value: innerFormContext,
|
|
68
70
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
69
71
|
style: style,
|
|
70
|
-
className: (0, _classnames.default)(className,
|
|
72
|
+
className: (0, _classnames.default)(className, hasLabel && bsPrefix, inline && `${bsPrefix}-inline`, type === 'switch' && bsSwitchPrefix),
|
|
71
73
|
children: children || /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
72
74
|
children: [input, hasLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormCheckLabel.default, {
|
|
73
75
|
title: title,
|
package/cjs/Modal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseModalProps } from '@restart/ui/Modal';
|
|
3
3
|
import { BsPrefixRefForwardingComponent } from './helpers';
|
|
4
4
|
export interface ModalProps extends Omit<BaseModalProps, 'role' | 'renderBackdrop' | 'renderDialog' | 'transition' | 'backdropTransition' | 'children'> {
|
|
5
5
|
size?: 'sm' | 'lg' | 'xl';
|
package/cjs/NavDropdown.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { DropdownProps } from './Dropdown';
|
|
3
3
|
import { DropdownMenuVariant } from './DropdownMenu';
|
|
4
4
|
import { BsPrefixRefForwardingComponent } from './helpers';
|
|
5
|
-
export interface NavDropdownProps extends Omit<DropdownProps, '
|
|
5
|
+
export interface NavDropdownProps extends Omit<DropdownProps, 'title'> {
|
|
6
6
|
title: React.ReactNode;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
active?: boolean;
|
package/dist/react-bootstrap.js
CHANGED
|
@@ -2694,6 +2694,9 @@ Collapse.defaultProps = defaultProps;
|
|
|
2694
2694
|
/* harmony default export */ const src_Collapse = (Collapse);
|
|
2695
2695
|
;// CONCATENATED MODULE: ./src/AccordionContext.ts
|
|
2696
2696
|
|
|
2697
|
+
function isAccordionItemSelected(activeEventKey, eventKey) {
|
|
2698
|
+
return Array.isArray(activeEventKey) ? activeEventKey.includes(eventKey) : activeEventKey === eventKey;
|
|
2699
|
+
}
|
|
2697
2700
|
const context = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
|
|
2698
2701
|
context.displayName = 'AccordionContext';
|
|
2699
2702
|
/* harmony default export */ const AccordionContext = (context);
|
|
@@ -2733,7 +2736,7 @@ const AccordionCollapse = /*#__PURE__*/external_root_React_commonjs2_react_commo
|
|
|
2733
2736
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'accordion-collapse');
|
|
2734
2737
|
return /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(src_Collapse, {
|
|
2735
2738
|
ref: ref,
|
|
2736
|
-
in: activeEventKey
|
|
2739
|
+
in: isAccordionItemSelected(activeEventKey, eventKey),
|
|
2737
2740
|
...props,
|
|
2738
2741
|
className: classnames_default()(className, bsPrefix),
|
|
2739
2742
|
children: /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(Component, {
|
|
@@ -2830,16 +2833,31 @@ const AccordionButton_propTypes = {
|
|
|
2830
2833
|
function useAccordionButton(eventKey, onClick) {
|
|
2831
2834
|
const {
|
|
2832
2835
|
activeEventKey,
|
|
2833
|
-
onSelect
|
|
2836
|
+
onSelect,
|
|
2837
|
+
alwaysOpen
|
|
2834
2838
|
} = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AccordionContext);
|
|
2835
2839
|
return e => {
|
|
2836
2840
|
/*
|
|
2837
2841
|
Compare the event key in context with the given event key.
|
|
2838
2842
|
If they are the same, then collapse the component.
|
|
2839
2843
|
*/
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
if (
|
|
2844
|
+
let eventKeyPassed = eventKey === activeEventKey ? null : eventKey;
|
|
2845
|
+
|
|
2846
|
+
if (alwaysOpen) {
|
|
2847
|
+
if (Array.isArray(activeEventKey)) {
|
|
2848
|
+
if (activeEventKey.includes(eventKey)) {
|
|
2849
|
+
eventKeyPassed = activeEventKey.filter(k => k !== eventKey);
|
|
2850
|
+
} else {
|
|
2851
|
+
eventKeyPassed = [...activeEventKey, eventKey];
|
|
2852
|
+
}
|
|
2853
|
+
} else {
|
|
2854
|
+
// activeEventKey is undefined.
|
|
2855
|
+
eventKeyPassed = [eventKey];
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
onSelect == null ? void 0 : onSelect(eventKeyPassed, e);
|
|
2860
|
+
onClick == null ? void 0 : onClick(e);
|
|
2843
2861
|
};
|
|
2844
2862
|
}
|
|
2845
2863
|
const AccordionButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
|
|
@@ -2868,10 +2886,10 @@ const AccordionButton = /*#__PURE__*/external_root_React_commonjs2_react_commonj
|
|
|
2868
2886
|
onClick: accordionOnClick,
|
|
2869
2887
|
...props,
|
|
2870
2888
|
"aria-expanded": eventKey === activeEventKey,
|
|
2871
|
-
className: classnames_default()(className, bsPrefix, eventKey
|
|
2889
|
+
className: classnames_default()(className, bsPrefix, !isAccordionItemSelected(activeEventKey, eventKey) && 'collapsed')
|
|
2872
2890
|
}, void 0, false, {
|
|
2873
2891
|
fileName: AccordionButton_jsxFileName,
|
|
2874
|
-
lineNumber:
|
|
2892
|
+
lineNumber: 86,
|
|
2875
2893
|
columnNumber: 7
|
|
2876
2894
|
}, undefined);
|
|
2877
2895
|
});
|
|
@@ -3004,13 +3022,16 @@ const Accordion_propTypes = {
|
|
|
3004
3022
|
bsPrefix: (prop_types_default()).string,
|
|
3005
3023
|
|
|
3006
3024
|
/** The current active key that corresponds to the currently expanded card */
|
|
3007
|
-
activeKey: (prop_types_default()).string,
|
|
3025
|
+
activeKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).array]),
|
|
3008
3026
|
|
|
3009
3027
|
/** The default active key that is expanded on start */
|
|
3010
|
-
defaultActiveKey: (prop_types_default()).string,
|
|
3028
|
+
defaultActiveKey: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).array]),
|
|
3011
3029
|
|
|
3012
3030
|
/** Renders accordion edge-to-edge with its parent container */
|
|
3013
|
-
flush: (prop_types_default()).bool
|
|
3031
|
+
flush: (prop_types_default()).bool,
|
|
3032
|
+
|
|
3033
|
+
/** Allow accordion items to stay open when another item is opened */
|
|
3034
|
+
alwaysOpen: (prop_types_default()).bool
|
|
3014
3035
|
};
|
|
3015
3036
|
const Accordion = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
|
|
3016
3037
|
const {
|
|
@@ -3021,6 +3042,7 @@ const Accordion = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_reac
|
|
|
3021
3042
|
className,
|
|
3022
3043
|
onSelect,
|
|
3023
3044
|
flush,
|
|
3045
|
+
alwaysOpen,
|
|
3024
3046
|
...controlledProps
|
|
3025
3047
|
} = useUncontrolled(props, {
|
|
3026
3048
|
activeKey: 'onSelect'
|
|
@@ -3028,8 +3050,9 @@ const Accordion = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_reac
|
|
|
3028
3050
|
const prefix = useBootstrapPrefix(bsPrefix, 'accordion');
|
|
3029
3051
|
const contextValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
|
3030
3052
|
activeEventKey: activeKey,
|
|
3031
|
-
onSelect
|
|
3032
|
-
|
|
3053
|
+
onSelect,
|
|
3054
|
+
alwaysOpen
|
|
3055
|
+
}), [activeKey, onSelect, alwaysOpen]);
|
|
3033
3056
|
return /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(AccordionContext.Provider, {
|
|
3034
3057
|
value: contextValue,
|
|
3035
3058
|
children: /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(Component, {
|
|
@@ -3038,12 +3061,12 @@ const Accordion = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_reac
|
|
|
3038
3061
|
className: classnames_default()(className, prefix, flush && `${prefix}-flush`)
|
|
3039
3062
|
}, void 0, false, {
|
|
3040
3063
|
fileName: Accordion_jsxFileName,
|
|
3041
|
-
lineNumber:
|
|
3064
|
+
lineNumber: 76,
|
|
3042
3065
|
columnNumber: 9
|
|
3043
3066
|
}, undefined)
|
|
3044
3067
|
}, void 0, false, {
|
|
3045
3068
|
fileName: Accordion_jsxFileName,
|
|
3046
|
-
lineNumber:
|
|
3069
|
+
lineNumber: 75,
|
|
3047
3070
|
columnNumber: 7
|
|
3048
3071
|
}, undefined);
|
|
3049
3072
|
});
|
|
@@ -3063,7 +3086,7 @@ var lib = __webpack_require__(517);
|
|
|
3063
3086
|
/**
|
|
3064
3087
|
* Creates a `Ref` whose value is updated in an effect, ensuring the most recent
|
|
3065
3088
|
* value is the one rendered with. Generally only required for Concurrent mode usage
|
|
3066
|
-
* where previous work in `render()` may be discarded
|
|
3089
|
+
* where previous work in `render()` may be discarded before being used.
|
|
3067
3090
|
*
|
|
3068
3091
|
* This is safe to access in an event handler.
|
|
3069
3092
|
*
|
|
@@ -3161,7 +3184,7 @@ function useEventCallback_useEventCallback(fn) {
|
|
|
3161
3184
|
* @param capture Whether or not to listen during the capture event phase
|
|
3162
3185
|
*/
|
|
3163
3186
|
|
|
3164
|
-
function
|
|
3187
|
+
function useEventListener_useEventListener(eventTarget, event, listener, capture) {
|
|
3165
3188
|
if (capture === void 0) {
|
|
3166
3189
|
capture = false;
|
|
3167
3190
|
}
|
|
@@ -3198,7 +3221,7 @@ function useGlobalListener(event, handler, capture) {
|
|
|
3198
3221
|
capture = false;
|
|
3199
3222
|
}
|
|
3200
3223
|
|
|
3201
|
-
var documentTarget =
|
|
3224
|
+
var documentTarget = useCallback(function () {
|
|
3202
3225
|
return document;
|
|
3203
3226
|
}, []);
|
|
3204
3227
|
return useEventListener(documentTarget, event, handler, capture);
|
|
@@ -4995,6 +5018,15 @@ function forEach(children, func) {
|
|
|
4995
5018
|
if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child)) func(child, index++);
|
|
4996
5019
|
});
|
|
4997
5020
|
}
|
|
5021
|
+
/**
|
|
5022
|
+
* Finds whether a component's `children` prop includes a React element of the
|
|
5023
|
+
* specified type.
|
|
5024
|
+
*/
|
|
5025
|
+
|
|
5026
|
+
|
|
5027
|
+
function hasChildOfType(children, type) {
|
|
5028
|
+
return external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.toArray(children).some(child => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child) && child.type === type);
|
|
5029
|
+
}
|
|
4998
5030
|
|
|
4999
5031
|
|
|
5000
5032
|
;// CONCATENATED MODULE: ./src/Carousel.tsx
|
|
@@ -7895,11 +7927,11 @@ function useRootClose(ref, onRootClose, {
|
|
|
7895
7927
|
}
|
|
7896
7928
|
});
|
|
7897
7929
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
7898
|
-
if (disabled || ref == null) return undefined;
|
|
7930
|
+
if (disabled || ref == null) return undefined;
|
|
7931
|
+
const doc = ownerDocument(getRefTarget(ref)); // Store the current event to avoid triggering handlers immediately
|
|
7899
7932
|
// https://github.com/facebook/react/issues/20074
|
|
7900
7933
|
|
|
7901
|
-
let currentEvent = window.event;
|
|
7902
|
-
const doc = ownerDocument(getRefTarget(ref)); // Use capture for this listener so it fires before React's listener, to
|
|
7934
|
+
let currentEvent = (doc.defaultView || window).event; // Use capture for this listener so it fires before React's listener, to
|
|
7903
7935
|
// avoid false positives in the contains() check below if the target DOM
|
|
7904
7936
|
// element is removed in the React mouse callback.
|
|
7905
7937
|
|
|
@@ -8379,6 +8411,21 @@ const DropdownItem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_r
|
|
|
8379
8411
|
});
|
|
8380
8412
|
DropdownItem.displayName = 'DropdownItem';
|
|
8381
8413
|
/* harmony default export */ const esm_DropdownItem = (DropdownItem);
|
|
8414
|
+
;// CONCATENATED MODULE: ./node_modules/@restart/ui/esm/useWindow.js
|
|
8415
|
+
|
|
8416
|
+
|
|
8417
|
+
const Context = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)(canUseDOM ? window : undefined);
|
|
8418
|
+
const WindowProvider = Context.Provider;
|
|
8419
|
+
/**
|
|
8420
|
+
* The document "window" placed in React context. Helpful for determining
|
|
8421
|
+
* SSR context, or when rendering into an iframe.
|
|
8422
|
+
*
|
|
8423
|
+
* @returns the current window
|
|
8424
|
+
*/
|
|
8425
|
+
|
|
8426
|
+
function useWindow() {
|
|
8427
|
+
return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(Context);
|
|
8428
|
+
}
|
|
8382
8429
|
;// CONCATENATED MODULE: ./node_modules/@restart/ui/esm/Dropdown.js
|
|
8383
8430
|
|
|
8384
8431
|
|
|
@@ -8397,6 +8444,7 @@ DropdownItem.displayName = 'DropdownItem';
|
|
|
8397
8444
|
|
|
8398
8445
|
|
|
8399
8446
|
|
|
8447
|
+
|
|
8400
8448
|
function useRefWithUpdate() {
|
|
8401
8449
|
const forceUpdate = useForceUpdate();
|
|
8402
8450
|
const ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
@@ -8423,6 +8471,7 @@ function Dropdown({
|
|
|
8423
8471
|
placement = 'bottom-start',
|
|
8424
8472
|
children
|
|
8425
8473
|
}) {
|
|
8474
|
+
const window = useWindow();
|
|
8426
8475
|
const [show, onToggle] = useUncontrolledProp(rawShow, defaultShow, rawOnToggle); // We use normal refs instead of useCallbackRef in order to populate the
|
|
8427
8476
|
// the value as quickly as possible, otherwise the effect to focus the element
|
|
8428
8477
|
// may run before the state value is set
|
|
@@ -8460,7 +8509,7 @@ function Dropdown({
|
|
|
8460
8509
|
}), [toggle, placement, show, menuElement, toggleElement, setMenu, setToggle]);
|
|
8461
8510
|
|
|
8462
8511
|
if (menuElement && lastShow && !show) {
|
|
8463
|
-
focusInDropdown.current = menuElement.contains(
|
|
8512
|
+
focusInDropdown.current = menuElement.contains(menuElement.ownerDocument.activeElement);
|
|
8464
8513
|
}
|
|
8465
8514
|
|
|
8466
8515
|
const focusToggle = useEventCallback_useEventCallback(() => {
|
|
@@ -8501,7 +8550,7 @@ function Dropdown({
|
|
|
8501
8550
|
return items[index];
|
|
8502
8551
|
};
|
|
8503
8552
|
|
|
8504
|
-
|
|
8553
|
+
useEventListener_useEventListener((0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => window.document, [window]), 'keydown', event => {
|
|
8505
8554
|
var _menuRef$current, _toggleRef$current;
|
|
8506
8555
|
|
|
8507
8556
|
const {
|
|
@@ -8558,7 +8607,7 @@ function Dropdown({
|
|
|
8558
8607
|
// to know if this event is relevant to this dropdown (e.g. in this menu).
|
|
8559
8608
|
// On `keyup` the target is the element being tagged TO which we use to check
|
|
8560
8609
|
// if focus has left the menu
|
|
8561
|
-
esm_addEventListener(
|
|
8610
|
+
esm_addEventListener(target.ownerDocument, 'keyup', e => {
|
|
8562
8611
|
var _menuRef$current2;
|
|
8563
8612
|
|
|
8564
8613
|
if (e.key === 'Tab' && !e.target || !((_menuRef$current2 = menuRef.current) != null && _menuRef$current2.contains(e.target))) {
|
|
@@ -9469,6 +9518,7 @@ var FormCheck_jsxFileName = "/Users/kyletsang/Documents/Kyle/Code/react-bootstra
|
|
|
9469
9518
|
|
|
9470
9519
|
|
|
9471
9520
|
|
|
9521
|
+
|
|
9472
9522
|
const FormCheck_propTypes = {
|
|
9473
9523
|
/**
|
|
9474
9524
|
* @default 'form-check'
|
|
@@ -9586,7 +9636,7 @@ const FormCheck = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_reac
|
|
|
9586
9636
|
const innerFormContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
|
|
9587
9637
|
controlId: id || controlId
|
|
9588
9638
|
}), [controlId, id]);
|
|
9589
|
-
const hasLabel = label != null && label !== false
|
|
9639
|
+
const hasLabel = !children && label != null && label !== false || hasChildOfType(children, src_FormCheckLabel);
|
|
9590
9640
|
|
|
9591
9641
|
const input = /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(src_FormCheckInput, { ...props,
|
|
9592
9642
|
type: type === 'switch' ? 'checkbox' : type,
|
|
@@ -9597,7 +9647,7 @@ const FormCheck = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_reac
|
|
|
9597
9647
|
as: as
|
|
9598
9648
|
}, void 0, false, {
|
|
9599
9649
|
fileName: FormCheck_jsxFileName,
|
|
9600
|
-
lineNumber:
|
|
9650
|
+
lineNumber: 161,
|
|
9601
9651
|
columnNumber: 9
|
|
9602
9652
|
}, undefined);
|
|
9603
9653
|
|
|
@@ -9605,14 +9655,14 @@ const FormCheck = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_reac
|
|
|
9605
9655
|
value: innerFormContext,
|
|
9606
9656
|
children: /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
|
|
9607
9657
|
style: style,
|
|
9608
|
-
className: classnames_default()(className,
|
|
9658
|
+
className: classnames_default()(className, hasLabel && bsPrefix, inline && `${bsPrefix}-inline`, type === 'switch' && bsSwitchPrefix),
|
|
9609
9659
|
children: children || /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(jsx_dev_runtime.Fragment, {
|
|
9610
9660
|
children: [input, hasLabel && /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(src_FormCheckLabel, {
|
|
9611
9661
|
title: title,
|
|
9612
9662
|
children: label
|
|
9613
9663
|
}, void 0, false, {
|
|
9614
9664
|
fileName: FormCheck_jsxFileName,
|
|
9615
|
-
lineNumber:
|
|
9665
|
+
lineNumber: 187,
|
|
9616
9666
|
columnNumber: 19
|
|
9617
9667
|
}, undefined), feedback && /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(src_Feedback, {
|
|
9618
9668
|
type: feedbackType,
|
|
@@ -9620,18 +9670,18 @@ const FormCheck = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_reac
|
|
|
9620
9670
|
children: feedback
|
|
9621
9671
|
}, void 0, false, {
|
|
9622
9672
|
fileName: FormCheck_jsxFileName,
|
|
9623
|
-
lineNumber:
|
|
9673
|
+
lineNumber: 190,
|
|
9624
9674
|
columnNumber: 19
|
|
9625
9675
|
}, undefined)]
|
|
9626
9676
|
}, void 0, true)
|
|
9627
9677
|
}, void 0, false, {
|
|
9628
9678
|
fileName: FormCheck_jsxFileName,
|
|
9629
|
-
lineNumber:
|
|
9679
|
+
lineNumber: 174,
|
|
9630
9680
|
columnNumber: 11
|
|
9631
9681
|
}, undefined)
|
|
9632
9682
|
}, void 0, false, {
|
|
9633
9683
|
fileName: FormCheck_jsxFileName,
|
|
9634
|
-
lineNumber:
|
|
9684
|
+
lineNumber: 173,
|
|
9635
9685
|
columnNumber: 9
|
|
9636
9686
|
}, undefined);
|
|
9637
9687
|
});
|
|
@@ -11090,8 +11140,9 @@ function useWillUnmount_useWillUnmount(fn) {
|
|
|
11090
11140
|
/**
|
|
11091
11141
|
* Get the width of the vertical window scrollbar if it's visible
|
|
11092
11142
|
*/
|
|
11093
|
-
function getBodyScrollbarWidth() {
|
|
11094
|
-
|
|
11143
|
+
function getBodyScrollbarWidth(ownerDocument = document) {
|
|
11144
|
+
const window = ownerDocument.defaultView;
|
|
11145
|
+
return Math.abs(window.innerWidth - ownerDocument.documentElement.clientWidth);
|
|
11095
11146
|
}
|
|
11096
11147
|
;// CONCATENATED MODULE: ./node_modules/@restart/ui/esm/ModalManager.js
|
|
11097
11148
|
|
|
@@ -11105,20 +11156,22 @@ const OPEN_DATA_ATTRIBUTE = dataAttr('modal-open');
|
|
|
11105
11156
|
|
|
11106
11157
|
class ModalManager {
|
|
11107
11158
|
constructor({
|
|
11159
|
+
ownerDocument,
|
|
11108
11160
|
handleContainerOverflow = true,
|
|
11109
11161
|
isRTL = false
|
|
11110
11162
|
} = {}) {
|
|
11111
11163
|
this.handleContainerOverflow = handleContainerOverflow;
|
|
11112
11164
|
this.isRTL = isRTL;
|
|
11113
11165
|
this.modals = [];
|
|
11166
|
+
this.ownerDocument = ownerDocument;
|
|
11114
11167
|
}
|
|
11115
11168
|
|
|
11116
11169
|
getScrollbarWidth() {
|
|
11117
|
-
return getBodyScrollbarWidth();
|
|
11170
|
+
return getBodyScrollbarWidth(this.ownerDocument);
|
|
11118
11171
|
}
|
|
11119
11172
|
|
|
11120
11173
|
getElement() {
|
|
11121
|
-
return document.body;
|
|
11174
|
+
return (this.ownerDocument || document).body;
|
|
11122
11175
|
}
|
|
11123
11176
|
|
|
11124
11177
|
setModalAttributes(_modal) {// For overriding
|
|
@@ -11214,18 +11267,21 @@ class ModalManager {
|
|
|
11214
11267
|
;// CONCATENATED MODULE: ./node_modules/@restart/ui/esm/useWaitForDOMRef.js
|
|
11215
11268
|
|
|
11216
11269
|
|
|
11217
|
-
|
|
11270
|
+
|
|
11271
|
+
|
|
11272
|
+
const resolveContainerRef = (ref, document) => {
|
|
11218
11273
|
var _ref;
|
|
11219
11274
|
|
|
11220
|
-
if (
|
|
11221
|
-
if (ref == null) return ownerDocument().body;
|
|
11275
|
+
if (!canUseDOM) return null;
|
|
11276
|
+
if (ref == null) return (document || ownerDocument()).body;
|
|
11222
11277
|
if (typeof ref === 'function') ref = ref();
|
|
11223
11278
|
if (ref && 'current' in ref) ref = ref.current;
|
|
11224
11279
|
if ((_ref = ref) != null && _ref.nodeType) return ref || null;
|
|
11225
11280
|
return null;
|
|
11226
11281
|
};
|
|
11227
11282
|
function useWaitForDOMRef(ref, onResolved) {
|
|
11228
|
-
const
|
|
11283
|
+
const window = useWindow();
|
|
11284
|
+
const [resolvedRef, setRef] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(() => resolveContainerRef(ref, window == null ? void 0 : window.document));
|
|
11229
11285
|
|
|
11230
11286
|
if (!resolvedRef) {
|
|
11231
11287
|
const earlyRef = resolveContainerRef(ref);
|
|
@@ -11282,15 +11338,19 @@ function Modal_objectWithoutPropertiesLoose(source, excluded) {
|
|
|
11282
11338
|
|
|
11283
11339
|
|
|
11284
11340
|
|
|
11341
|
+
|
|
11285
11342
|
let manager;
|
|
11286
11343
|
|
|
11287
|
-
function getManager() {
|
|
11288
|
-
if (!manager) manager = new esm_ModalManager(
|
|
11344
|
+
function getManager(window) {
|
|
11345
|
+
if (!manager) manager = new esm_ModalManager({
|
|
11346
|
+
ownerDocument: window == null ? void 0 : window.document
|
|
11347
|
+
});
|
|
11289
11348
|
return manager;
|
|
11290
11349
|
}
|
|
11291
11350
|
|
|
11292
11351
|
function useModalManager(provided) {
|
|
11293
|
-
const
|
|
11352
|
+
const window = useWindow();
|
|
11353
|
+
const modalManager = provided || getManager(window);
|
|
11294
11354
|
const modal = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
11295
11355
|
dialog: null,
|
|
11296
11356
|
backdrop: null
|
|
@@ -13491,7 +13551,7 @@ const NavDropdown = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_re
|
|
|
13491
13551
|
children: title
|
|
13492
13552
|
}, void 0, false, {
|
|
13493
13553
|
fileName: NavDropdown_jsxFileName,
|
|
13494
|
-
lineNumber:
|
|
13554
|
+
lineNumber: 92,
|
|
13495
13555
|
columnNumber: 11
|
|
13496
13556
|
}, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(src_Dropdown.Menu, {
|
|
13497
13557
|
role: menuRole,
|
|
@@ -13501,12 +13561,12 @@ const NavDropdown = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_re
|
|
|
13501
13561
|
children: children
|
|
13502
13562
|
}, void 0, false, {
|
|
13503
13563
|
fileName: NavDropdown_jsxFileName,
|
|
13504
|
-
lineNumber:
|
|
13564
|
+
lineNumber: 103,
|
|
13505
13565
|
columnNumber: 11
|
|
13506
13566
|
}, undefined)]
|
|
13507
13567
|
}, void 0, true, {
|
|
13508
13568
|
fileName: NavDropdown_jsxFileName,
|
|
13509
|
-
lineNumber:
|
|
13569
|
+
lineNumber: 87,
|
|
13510
13570
|
columnNumber: 9
|
|
13511
13571
|
}, undefined);
|
|
13512
13572
|
});
|