react-bootstrap 2.10.1 → 2.10.3
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/AbstractModalHeader.js +2 -2
- package/cjs/AccordionButton.js +2 -2
- package/cjs/Carousel.d.ts +1 -1
- package/cjs/Carousel.js +13 -13
- package/cjs/Dropdown.js +3 -3
- package/cjs/DropdownMenu.js +1 -1
- package/cjs/Fade.js +1 -1
- package/cjs/Form.d.ts +60 -58
- package/cjs/InputGroup.d.ts +2 -2
- package/cjs/Modal.js +8 -8
- package/cjs/Navbar.js +2 -2
- package/cjs/Offcanvas.js +4 -4
- package/cjs/Overlay.js +4 -4
- package/cjs/OverlayTrigger.js +3 -3
- package/cjs/Tab.d.ts +1 -1
- package/cjs/TabContainer.d.ts +2 -1
- package/cjs/Tabs.d.ts +1 -1
- package/cjs/Tabs.js +1 -0
- package/cjs/ThemeProvider.d.ts +1 -1
- package/cjs/Toast.js +1 -1
- package/cjs/ToastHeader.js +1 -1
- package/cjs/ToggleButtonGroup.js +1 -1
- package/cjs/TransitionWrapper.d.ts +2 -2
- package/cjs/helpers.d.ts +1 -1
- package/cjs/useWrappedRefWithWarning.js +1 -1
- package/dist/react-bootstrap.js +666 -500
- package/dist/react-bootstrap.min.js +1 -1
- package/dist/react-bootstrap.min.js.LICENSE.txt +2 -1
- package/esm/AbstractModalHeader.js +2 -2
- package/esm/AccordionButton.js +2 -2
- package/esm/Carousel.d.ts +1 -1
- package/esm/Carousel.js +13 -13
- package/esm/Dropdown.js +3 -3
- package/esm/DropdownMenu.js +1 -1
- package/esm/Fade.js +1 -1
- package/esm/Form.d.ts +60 -58
- package/esm/InputGroup.d.ts +2 -2
- package/esm/Modal.js +8 -8
- package/esm/Navbar.js +2 -2
- package/esm/Offcanvas.js +4 -4
- package/esm/Overlay.js +4 -4
- package/esm/OverlayTrigger.js +3 -3
- package/esm/Tab.d.ts +1 -1
- package/esm/TabContainer.d.ts +2 -1
- package/esm/Tabs.d.ts +1 -1
- package/esm/Tabs.js +1 -0
- package/esm/ThemeProvider.d.ts +1 -1
- package/esm/Toast.js +1 -1
- package/esm/ToastHeader.js +1 -1
- package/esm/TransitionWrapper.d.ts +2 -2
- package/esm/helpers.d.ts +1 -1
- package/package.json +4 -5
|
@@ -22,8 +22,8 @@ const AbstractModalHeader = /*#__PURE__*/React.forwardRef(({
|
|
|
22
22
|
}, ref) => {
|
|
23
23
|
const context = (0, _react.useContext)(_ModalContext.default);
|
|
24
24
|
const handleClick = (0, _useEventCallback.default)(() => {
|
|
25
|
-
context == null
|
|
26
|
-
onHide == null
|
|
25
|
+
context == null || context.onHide();
|
|
26
|
+
onHide == null || onHide();
|
|
27
27
|
});
|
|
28
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
29
29
|
ref: ref,
|
package/cjs/AccordionButton.js
CHANGED
|
@@ -38,8 +38,8 @@ function useAccordionButton(eventKey, onClick) {
|
|
|
38
38
|
eventKeyPassed = [eventKey];
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
onSelect == null
|
|
42
|
-
onClick == null
|
|
41
|
+
onSelect == null || onSelect(eventKeyPassed, e);
|
|
42
|
+
onClick == null || onClick(e);
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
const AccordionButton = /*#__PURE__*/React.forwardRef(({
|
package/cjs/Carousel.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export interface CarouselProps extends BsPrefixProps, Omit<React.HTMLAttributes<
|
|
|
26
26
|
prevLabel?: React.ReactNode;
|
|
27
27
|
nextIcon?: React.ReactNode;
|
|
28
28
|
nextLabel?: React.ReactNode;
|
|
29
|
-
ref?: React.Ref<CarouselRef>;
|
|
30
29
|
variant?: CarouselVariant;
|
|
30
|
+
ref?: React.Ref<CarouselRef> | React.MutableRefObject<CarouselRef | undefined>;
|
|
31
31
|
}
|
|
32
32
|
declare const _default: BsPrefixRefForwardingComponent<"div", CarouselProps> & {
|
|
33
33
|
Caption: BsPrefixRefForwardingComponent<"div", import("./CarouselCaption").CarouselCaptionProps>;
|
package/cjs/Carousel.js
CHANGED
|
@@ -128,7 +128,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
128
128
|
nextActiveIndex = numChildren - 1;
|
|
129
129
|
}
|
|
130
130
|
nextDirectionRef.current = 'prev';
|
|
131
|
-
onSelect == null
|
|
131
|
+
onSelect == null || onSelect(nextActiveIndex, event);
|
|
132
132
|
}, [isSliding, renderedActiveIndex, onSelect, wrap, numChildren]);
|
|
133
133
|
|
|
134
134
|
// This is used in the setInterval, so it should not invalidate.
|
|
@@ -144,7 +144,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
144
144
|
nextActiveIndex = 0;
|
|
145
145
|
}
|
|
146
146
|
nextDirectionRef.current = 'next';
|
|
147
|
-
onSelect == null
|
|
147
|
+
onSelect == null || onSelect(nextActiveIndex, event);
|
|
148
148
|
});
|
|
149
149
|
const elementRef = (0, _react.useRef)();
|
|
150
150
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
@@ -169,18 +169,18 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
169
169
|
// These callbacks will be handled by the <Transition> callbacks.
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
onSlide == null
|
|
173
|
-
onSlid == null
|
|
172
|
+
onSlide == null || onSlide(renderedActiveIndex, slideDirection);
|
|
173
|
+
onSlid == null || onSlid(renderedActiveIndex, slideDirection);
|
|
174
174
|
}, [renderedActiveIndex]);
|
|
175
175
|
const orderClassName = `${prefix}-item-${direction}`;
|
|
176
176
|
const directionalClassName = `${prefix}-item-${slideDirection}`;
|
|
177
177
|
const handleEnter = (0, _react.useCallback)(node => {
|
|
178
178
|
(0, _triggerBrowserReflow.default)(node);
|
|
179
|
-
onSlide == null
|
|
179
|
+
onSlide == null || onSlide(renderedActiveIndex, slideDirection);
|
|
180
180
|
}, [onSlide, renderedActiveIndex, slideDirection]);
|
|
181
181
|
const handleEntered = (0, _react.useCallback)(() => {
|
|
182
182
|
setIsSliding(false);
|
|
183
|
-
onSlid == null
|
|
183
|
+
onSlid == null || onSlid(renderedActiveIndex, slideDirection);
|
|
184
184
|
}, [onSlid, renderedActiveIndex, slideDirection]);
|
|
185
185
|
const handleKeyDown = (0, _react.useCallback)(event => {
|
|
186
186
|
if (keyboard && !/input|textarea/i.test(event.target.tagName)) {
|
|
@@ -204,17 +204,17 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
204
204
|
default:
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
onKeyDown == null
|
|
207
|
+
onKeyDown == null || onKeyDown(event);
|
|
208
208
|
}, [keyboard, onKeyDown, prev, next, isRTL]);
|
|
209
209
|
const handleMouseOver = (0, _react.useCallback)(event => {
|
|
210
210
|
if (pause === 'hover') {
|
|
211
211
|
setPaused(true);
|
|
212
212
|
}
|
|
213
|
-
onMouseOver == null
|
|
213
|
+
onMouseOver == null || onMouseOver(event);
|
|
214
214
|
}, [pause, onMouseOver]);
|
|
215
215
|
const handleMouseOut = (0, _react.useCallback)(event => {
|
|
216
216
|
setPaused(false);
|
|
217
|
-
onMouseOut == null
|
|
217
|
+
onMouseOut == null || onMouseOut(event);
|
|
218
218
|
}, [onMouseOut]);
|
|
219
219
|
const touchStartXRef = (0, _react.useRef)(0);
|
|
220
220
|
const touchDeltaXRef = (0, _react.useRef)(0);
|
|
@@ -225,7 +225,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
225
225
|
if (pause === 'hover') {
|
|
226
226
|
setPaused(true);
|
|
227
227
|
}
|
|
228
|
-
onTouchStart == null
|
|
228
|
+
onTouchStart == null || onTouchStart(event);
|
|
229
229
|
}, [pause, onTouchStart]);
|
|
230
230
|
const handleTouchMove = (0, _react.useCallback)(event => {
|
|
231
231
|
if (event.touches && event.touches.length > 1) {
|
|
@@ -233,7 +233,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
233
233
|
} else {
|
|
234
234
|
touchDeltaXRef.current = event.touches[0].clientX - touchStartXRef.current;
|
|
235
235
|
}
|
|
236
|
-
onTouchMove == null
|
|
236
|
+
onTouchMove == null || onTouchMove(event);
|
|
237
237
|
}, [onTouchMove]);
|
|
238
238
|
const handleTouchEnd = (0, _react.useCallback)(event => {
|
|
239
239
|
if (touch) {
|
|
@@ -251,7 +251,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
251
251
|
setPaused(false);
|
|
252
252
|
}, interval || undefined);
|
|
253
253
|
}
|
|
254
|
-
onTouchEnd == null
|
|
254
|
+
onTouchEnd == null || onTouchEnd(event);
|
|
255
255
|
}, [touch, pause, prev, next, touchUnpauseTimeout, interval, onTouchEnd]);
|
|
256
256
|
const shouldPlay = interval != null && !paused && !isSliding;
|
|
257
257
|
const intervalHandleRef = (0, _react.useRef)();
|
|
@@ -271,7 +271,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
271
271
|
const indicatorOnClicks = (0, _react.useMemo)(() => indicators && Array.from({
|
|
272
272
|
length: numChildren
|
|
273
273
|
}, (_, index) => event => {
|
|
274
|
-
onSelect == null
|
|
274
|
+
onSelect == null || onSelect(index, event);
|
|
275
275
|
}), [indicators, numChildren, onSelect]);
|
|
276
276
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
|
|
277
277
|
ref: elementRef,
|
package/cjs/Dropdown.js
CHANGED
|
@@ -56,16 +56,16 @@ const Dropdown = /*#__PURE__*/React.forwardRef((pProps, ref) => {
|
|
|
56
56
|
return true;
|
|
57
57
|
};
|
|
58
58
|
const handleToggle = (0, _useEventCallback.default)((nextShow, meta) => {
|
|
59
|
-
var _meta$originalEvent
|
|
59
|
+
var _meta$originalEvent;
|
|
60
60
|
/** Checking if target of event is ToggleButton,
|
|
61
61
|
* if it is then nullify mousedown event
|
|
62
62
|
*/
|
|
63
|
-
const isToggleButton = (_meta$originalEvent = meta.originalEvent) == null
|
|
63
|
+
const isToggleButton = (_meta$originalEvent = meta.originalEvent) == null || (_meta$originalEvent = _meta$originalEvent.target) == null ? void 0 : _meta$originalEvent.classList.contains('dropdown-toggle');
|
|
64
64
|
if (isToggleButton && meta.source === 'mousedown') {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
if (meta.originalEvent.currentTarget === document && (meta.source !== 'keydown' || meta.originalEvent.key === 'Escape')) meta.source = 'rootClose';
|
|
68
|
-
if (isClosingPermitted(meta.source)) onToggle == null
|
|
68
|
+
if (isClosingPermitted(meta.source)) onToggle == null || onToggle(nextShow, meta);
|
|
69
69
|
});
|
|
70
70
|
const alignEnd = align === 'end';
|
|
71
71
|
const placement = (0, _DropdownMenu.getDropdownMenuPlacement)(alignEnd, drop, isRTL);
|
package/cjs/DropdownMenu.js
CHANGED
|
@@ -95,7 +95,7 @@ const DropdownMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
95
95
|
(0, _useIsomorphicEffect.default)(() => {
|
|
96
96
|
// Popper's initial position for the menu is incorrect when
|
|
97
97
|
// renderOnMount=true. Need to call update() to correct it.
|
|
98
|
-
if (show) popper == null
|
|
98
|
+
if (show) popper == null || popper.update();
|
|
99
99
|
}, [show]);
|
|
100
100
|
if (!hasShown && !renderOnMount && !isInputGroup) return null;
|
|
101
101
|
|
package/cjs/Fade.js
CHANGED
|
@@ -34,7 +34,7 @@ const Fade = /*#__PURE__*/React.forwardRef(({
|
|
|
34
34
|
};
|
|
35
35
|
const handleEnter = (0, _react.useCallback)((node, isAppearing) => {
|
|
36
36
|
(0, _triggerBrowserReflow.default)(node);
|
|
37
|
-
onEnter == null
|
|
37
|
+
onEnter == null || onEnter(node, isAppearing);
|
|
38
38
|
}, [onEnter]);
|
|
39
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TransitionWrapper.default, {
|
|
40
40
|
ref: ref,
|
package/cjs/Form.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
18
18
|
Label: React.ForwardRefExoticComponent<import("./FormCheckLabel").FormCheckLabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
19
19
|
}, {
|
|
20
20
|
className?: string | undefined;
|
|
21
|
-
|
|
21
|
+
"aria-label"?: string | undefined;
|
|
22
22
|
disabled?: boolean | undefined;
|
|
23
23
|
form?: string | undefined;
|
|
24
24
|
formAction?: string | undefined;
|
|
@@ -34,7 +34,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
34
34
|
suppressHydrationWarning?: boolean | undefined;
|
|
35
35
|
accessKey?: string | undefined;
|
|
36
36
|
autoFocus?: boolean | undefined;
|
|
37
|
-
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
37
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
38
38
|
contextMenu?: string | undefined;
|
|
39
39
|
dir?: string | undefined;
|
|
40
40
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -42,7 +42,6 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
42
42
|
id?: string | undefined;
|
|
43
43
|
lang?: string | undefined;
|
|
44
44
|
nonce?: string | undefined;
|
|
45
|
-
placeholder?: string | undefined;
|
|
46
45
|
slot?: string | undefined;
|
|
47
46
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
48
47
|
style?: React.CSSProperties | undefined;
|
|
@@ -74,55 +73,60 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
74
73
|
results?: number | undefined;
|
|
75
74
|
security?: string | undefined;
|
|
76
75
|
unselectable?: "on" | "off" | undefined;
|
|
77
|
-
inputMode?: "search" | "
|
|
76
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
78
77
|
is?: string | undefined;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
78
|
+
"aria-activedescendant"?: string | undefined;
|
|
79
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
80
|
+
"aria-autocomplete"?: "list" | "none" | "both" | "inline" | undefined;
|
|
81
|
+
"aria-braillelabel"?: string | undefined;
|
|
82
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
83
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
84
|
+
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
85
|
+
"aria-colcount"?: number | undefined;
|
|
86
|
+
"aria-colindex"?: number | undefined;
|
|
87
|
+
"aria-colindextext"?: string | undefined;
|
|
88
|
+
"aria-colspan"?: number | undefined;
|
|
89
|
+
"aria-controls"?: string | undefined;
|
|
90
|
+
"aria-current"?: boolean | "true" | "false" | "time" | "page" | "step" | "location" | "date" | undefined;
|
|
91
|
+
"aria-describedby"?: string | undefined;
|
|
92
|
+
"aria-description"?: string | undefined;
|
|
93
|
+
"aria-details"?: string | undefined;
|
|
94
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
95
|
+
"aria-dropeffect"?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
96
|
+
"aria-errormessage"?: string | undefined;
|
|
97
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
98
|
+
"aria-flowto"?: string | undefined;
|
|
99
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
100
|
+
"aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
|
|
101
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
102
|
+
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
103
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
104
|
+
"aria-labelledby"?: string | undefined;
|
|
105
|
+
"aria-level"?: number | undefined;
|
|
106
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
107
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
108
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
109
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
110
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
111
|
+
"aria-owns"?: string | undefined;
|
|
112
|
+
"aria-placeholder"?: string | undefined;
|
|
113
|
+
"aria-posinset"?: number | undefined;
|
|
114
|
+
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
115
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
116
|
+
"aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
117
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
118
|
+
"aria-roledescription"?: string | undefined;
|
|
119
|
+
"aria-rowcount"?: number | undefined;
|
|
120
|
+
"aria-rowindex"?: number | undefined;
|
|
121
|
+
"aria-rowindextext"?: string | undefined;
|
|
122
|
+
"aria-rowspan"?: number | undefined;
|
|
123
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
124
|
+
"aria-setsize"?: number | undefined;
|
|
125
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
126
|
+
"aria-valuemax"?: number | undefined;
|
|
127
|
+
"aria-valuemin"?: number | undefined;
|
|
128
|
+
"aria-valuenow"?: number | undefined;
|
|
129
|
+
"aria-valuetext"?: string | undefined;
|
|
126
130
|
children?: React.ReactNode;
|
|
127
131
|
dangerouslySetInnerHTML?: {
|
|
128
132
|
__html: string | TrustedHTML;
|
|
@@ -266,9 +270,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
266
270
|
onPointerCancel?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
267
271
|
onPointerCancelCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
268
272
|
onPointerEnter?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
269
|
-
onPointerEnterCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
270
273
|
onPointerLeave?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
271
|
-
onPointerLeaveCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
272
274
|
onPointerOver?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
273
275
|
onPointerOverCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
274
276
|
onPointerOut?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
@@ -289,9 +291,9 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
289
291
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
|
|
290
292
|
onTransitionEnd?: React.TransitionEventHandler<HTMLInputElement> | undefined;
|
|
291
293
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
|
|
294
|
+
list?: string | undefined;
|
|
292
295
|
label?: React.ReactNode;
|
|
293
296
|
pattern?: string | undefined;
|
|
294
|
-
list?: string | undefined;
|
|
295
297
|
reverse?: boolean | undefined;
|
|
296
298
|
bsPrefix?: string | undefined;
|
|
297
299
|
height?: string | number | undefined;
|
|
@@ -299,19 +301,19 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
299
301
|
size?: number | undefined;
|
|
300
302
|
inline?: boolean | undefined;
|
|
301
303
|
multiple?: boolean | undefined;
|
|
302
|
-
as?: React.ElementType<any> | undefined;
|
|
303
|
-
autoComplete?:
|
|
304
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
305
|
+
autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
|
|
304
306
|
alt?: string | undefined;
|
|
305
307
|
accept?: string | undefined;
|
|
306
308
|
capture?: boolean | "user" | "environment" | undefined;
|
|
307
309
|
checked?: boolean | undefined;
|
|
310
|
+
enterKeyHint?: "search" | "next" | "enter" | "done" | "go" | "previous" | "send" | undefined;
|
|
308
311
|
maxLength?: number | undefined;
|
|
309
312
|
minLength?: number | undefined;
|
|
310
313
|
src?: string | undefined;
|
|
311
314
|
max?: string | number | undefined;
|
|
312
315
|
min?: string | number | undefined;
|
|
313
|
-
|
|
314
|
-
enterKeyHint?: "search" | "next" | "enter" | "done" | "go" | "previous" | "send" | undefined;
|
|
316
|
+
placeholder?: string | undefined;
|
|
315
317
|
readOnly?: boolean | undefined;
|
|
316
318
|
required?: boolean | undefined;
|
|
317
319
|
step?: string | number | undefined;
|
package/cjs/InputGroup.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface InputGroupProps extends BsPrefixProps, React.HTMLAttributes<HTM
|
|
|
7
7
|
}
|
|
8
8
|
declare const _default: BsPrefixRefForwardingComponent<"div", InputGroupProps> & {
|
|
9
9
|
Text: BsPrefixRefForwardingComponent<"span", import("./InputGroupText").InputGroupTextProps>;
|
|
10
|
-
Radio: (props: FormCheckInputProps) => JSX.Element;
|
|
11
|
-
Checkbox: (props: FormCheckInputProps) => JSX.Element;
|
|
10
|
+
Radio: (props: FormCheckInputProps) => React.JSX.Element;
|
|
11
|
+
Checkbox: (props: FormCheckInputProps) => React.JSX.Element;
|
|
12
12
|
};
|
|
13
13
|
export default _default;
|
package/cjs/Modal.js
CHANGED
|
@@ -116,7 +116,7 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
116
116
|
});
|
|
117
117
|
(0, _useWillUnmount.default)(() => {
|
|
118
118
|
(0, _removeEventListener.default)(window, 'resize', handleWindowResize);
|
|
119
|
-
removeStaticModalAnimationRef.current == null
|
|
119
|
+
removeStaticModalAnimationRef.current == null || removeStaticModalAnimationRef.current();
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
// We prevent the modal from closing during a drag by detecting where the
|
|
@@ -152,11 +152,11 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
152
152
|
ignoreBackdropClickRef.current = false;
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
onHide == null
|
|
155
|
+
onHide == null || onHide();
|
|
156
156
|
};
|
|
157
157
|
const handleEscapeKeyDown = e => {
|
|
158
158
|
if (keyboard) {
|
|
159
|
-
onEscapeKeyDown == null
|
|
159
|
+
onEscapeKeyDown == null || onEscapeKeyDown(e);
|
|
160
160
|
} else {
|
|
161
161
|
// Call preventDefault to stop modal from closing in @restart/ui.
|
|
162
162
|
e.preventDefault();
|
|
@@ -170,21 +170,21 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
170
170
|
if (node) {
|
|
171
171
|
updateDialogStyle(node);
|
|
172
172
|
}
|
|
173
|
-
onEnter == null
|
|
173
|
+
onEnter == null || onEnter(node, isAppearing);
|
|
174
174
|
};
|
|
175
175
|
const handleExit = node => {
|
|
176
|
-
removeStaticModalAnimationRef.current == null
|
|
177
|
-
onExit == null
|
|
176
|
+
removeStaticModalAnimationRef.current == null || removeStaticModalAnimationRef.current();
|
|
177
|
+
onExit == null || onExit(node);
|
|
178
178
|
};
|
|
179
179
|
const handleEntering = (node, isAppearing) => {
|
|
180
|
-
onEntering == null
|
|
180
|
+
onEntering == null || onEntering(node, isAppearing);
|
|
181
181
|
|
|
182
182
|
// FIXME: This should work even when animation is disabled.
|
|
183
183
|
(0, _addEventListener.default)(window, 'resize', handleWindowResize);
|
|
184
184
|
};
|
|
185
185
|
const handleExited = node => {
|
|
186
186
|
if (node) node.style.display = ''; // RHL removes it sometimes
|
|
187
|
-
onExited == null
|
|
187
|
+
onExited == null || onExited(node);
|
|
188
188
|
|
|
189
189
|
// FIXME: This should work even when animation is disabled.
|
|
190
190
|
(0, _removeEventListener.default)(window, 'resize', handleWindowResize);
|
package/cjs/Navbar.js
CHANGED
|
@@ -40,9 +40,9 @@ const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
40
40
|
});
|
|
41
41
|
const bsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(initialBsPrefix, 'navbar');
|
|
42
42
|
const handleCollapse = (0, _react.useCallback)((...args) => {
|
|
43
|
-
onSelect == null
|
|
43
|
+
onSelect == null || onSelect(...args);
|
|
44
44
|
if (collapseOnSelect && expanded) {
|
|
45
|
-
onToggle == null
|
|
45
|
+
onToggle == null || onToggle(false);
|
|
46
46
|
}
|
|
47
47
|
}, [onSelect, collapseOnSelect, expanded, onToggle]);
|
|
48
48
|
|
package/cjs/Offcanvas.js
CHANGED
|
@@ -77,8 +77,8 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
77
77
|
setShowOffcanvas(responsive ? show && !hideResponsiveOffcanvas : show);
|
|
78
78
|
}, [show, responsive, hideResponsiveOffcanvas]);
|
|
79
79
|
const handleHide = (0, _useEventCallback.default)(() => {
|
|
80
|
-
onToggle == null
|
|
81
|
-
onHide == null
|
|
80
|
+
onToggle == null || onToggle();
|
|
81
|
+
onHide == null || onHide();
|
|
82
82
|
});
|
|
83
83
|
const modalContext = (0, _react.useMemo)(() => ({
|
|
84
84
|
onHide: handleHide
|
|
@@ -97,11 +97,11 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
97
97
|
}
|
|
98
98
|
const handleEnter = (node, ...args) => {
|
|
99
99
|
if (node) node.style.visibility = 'visible';
|
|
100
|
-
onEnter == null
|
|
100
|
+
onEnter == null || onEnter(node, ...args);
|
|
101
101
|
};
|
|
102
102
|
const handleExited = (node, ...args) => {
|
|
103
103
|
if (node) node.style.visibility = '';
|
|
104
|
-
onExited == null
|
|
104
|
+
onExited == null || onExited(...args);
|
|
105
105
|
};
|
|
106
106
|
const renderBackdrop = (0, _react.useCallback)(backdropProps => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
107
107
|
...backdropProps,
|
package/cjs/Overlay.js
CHANGED
|
@@ -43,12 +43,12 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
43
43
|
const actualTransition = transition === true ? _Fade.default : transition || undefined;
|
|
44
44
|
const handleFirstUpdate = (0, _useEventCallback.default)(state => {
|
|
45
45
|
setFirstRenderedState(state);
|
|
46
|
-
popperConfig == null
|
|
46
|
+
popperConfig == null || popperConfig.onFirstUpdate == null || popperConfig.onFirstUpdate(state);
|
|
47
47
|
});
|
|
48
48
|
(0, _useIsomorphicEffect.default)(() => {
|
|
49
49
|
if (firstRenderedState && outerProps.target) {
|
|
50
50
|
// Must wait for target element to resolve before updating popper.
|
|
51
|
-
popperRef.current.scheduleUpdate == null
|
|
51
|
+
popperRef.current.scheduleUpdate == null || popperRef.current.scheduleUpdate();
|
|
52
52
|
}
|
|
53
53
|
}, [firstRenderedState, outerProps.target]);
|
|
54
54
|
(0, _react.useEffect)(() => {
|
|
@@ -73,7 +73,7 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
73
73
|
popper: popperObj,
|
|
74
74
|
show
|
|
75
75
|
}) => {
|
|
76
|
-
var _popperObj$state
|
|
76
|
+
var _popperObj$state;
|
|
77
77
|
wrapRefs(overlayProps, arrowProps);
|
|
78
78
|
// Need to get placement from popper object, handling case when overlay is flipped using 'flip' prop
|
|
79
79
|
const updatedPlacement = popperObj == null ? void 0 : popperObj.placement;
|
|
@@ -81,7 +81,7 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
81
81
|
state: popperObj == null ? void 0 : popperObj.state,
|
|
82
82
|
scheduleUpdate: popperObj == null ? void 0 : popperObj.update,
|
|
83
83
|
placement: updatedPlacement,
|
|
84
|
-
outOfBoundaries: (popperObj == null
|
|
84
|
+
outOfBoundaries: (popperObj == null || (_popperObj$state = popperObj.state) == null || (_popperObj$state = _popperObj$state.modifiersData.hide) == null ? void 0 : _popperObj$state.isReferenceHidden) || false,
|
|
85
85
|
strategy: popperConfig.strategy
|
|
86
86
|
});
|
|
87
87
|
const hasDoneInitialMeasure = !!firstRenderedState;
|
package/cjs/OverlayTrigger.js
CHANGED
|
@@ -90,15 +90,15 @@ const OverlayTrigger = ({
|
|
|
90
90
|
}, [delay.hide, setShow, timeout]);
|
|
91
91
|
const handleFocus = (0, _react.useCallback)((...args) => {
|
|
92
92
|
handleShow();
|
|
93
|
-
onFocus == null
|
|
93
|
+
onFocus == null || onFocus(...args);
|
|
94
94
|
}, [handleShow, onFocus]);
|
|
95
95
|
const handleBlur = (0, _react.useCallback)((...args) => {
|
|
96
96
|
handleHide();
|
|
97
|
-
onBlur == null
|
|
97
|
+
onBlur == null || onBlur(...args);
|
|
98
98
|
}, [handleHide, onBlur]);
|
|
99
99
|
const handleClick = (0, _react.useCallback)((...args) => {
|
|
100
100
|
setShow(!show);
|
|
101
|
-
onClick == null
|
|
101
|
+
onClick == null || onClick(...args);
|
|
102
102
|
}, [onClick, setShow, show]);
|
|
103
103
|
const handleMouseOver = (0, _react.useCallback)((...args) => {
|
|
104
104
|
handleMouseOverOut(handleShow, args, 'fromElement');
|
package/cjs/Tab.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface TabProps extends Omit<TabPaneProps, 'title'> {
|
|
|
9
9
|
}
|
|
10
10
|
declare const _default: React.FC<TabProps> & {
|
|
11
11
|
Container: {
|
|
12
|
-
({ transition, ...props }: import("./TabContainer").TabContainerProps): JSX.Element;
|
|
12
|
+
({ transition, ...props }: import("./TabContainer").TabContainerProps): React.JSX.Element;
|
|
13
13
|
propTypes: {
|
|
14
14
|
id: PropTypes.Requireable<string>;
|
|
15
15
|
transition: PropTypes.Requireable<NonNullable<boolean | PropTypes.ReactComponentLike | null | undefined>>;
|
package/cjs/TabContainer.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
3
|
import { TabsProps } from '@restart/ui/Tabs';
|
|
3
4
|
import { TransitionType } from './helpers';
|
|
@@ -5,7 +6,7 @@ export interface TabContainerProps extends Omit<TabsProps, 'transition'> {
|
|
|
5
6
|
transition?: TransitionType;
|
|
6
7
|
}
|
|
7
8
|
declare const TabContainer: {
|
|
8
|
-
({ transition, ...props }: TabContainerProps): JSX.Element;
|
|
9
|
+
({ transition, ...props }: TabContainerProps): React.JSX.Element;
|
|
9
10
|
propTypes: {
|
|
10
11
|
/**
|
|
11
12
|
* HTML id attribute, required if no `generateChildId` prop
|
package/cjs/Tabs.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface TabsProps extends Omit<BaseTabsProps, 'transition'>, Omit<React
|
|
|
7
7
|
transition?: TransitionType;
|
|
8
8
|
}
|
|
9
9
|
declare const Tabs: {
|
|
10
|
-
(props: TabsProps): JSX.Element;
|
|
10
|
+
(props: TabsProps): React.JSX.Element;
|
|
11
11
|
propTypes: {
|
|
12
12
|
/**
|
|
13
13
|
* Mark the Tab with a matching `eventKey` as active.
|
package/cjs/Tabs.js
CHANGED
package/cjs/ThemeProvider.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ThemeProviderProps extends Partial<ThemeContextValue> {
|
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
}
|
|
13
13
|
declare const Consumer: React.Consumer<ThemeContextValue>;
|
|
14
|
-
declare function ThemeProvider({ prefixes, breakpoints, minBreakpoint, dir, children, }: ThemeProviderProps): JSX.Element;
|
|
14
|
+
declare function ThemeProvider({ prefixes, breakpoints, minBreakpoint, dir, children, }: ThemeProviderProps): React.JSX.Element;
|
|
15
15
|
declare namespace ThemeProvider {
|
|
16
16
|
var propTypes: any;
|
|
17
17
|
}
|
package/cjs/Toast.js
CHANGED
|
@@ -48,7 +48,7 @@ const Toast = /*#__PURE__*/React.forwardRef(({
|
|
|
48
48
|
const autohideToast = !!(autohide && show);
|
|
49
49
|
const autohideFunc = (0, _react.useCallback)(() => {
|
|
50
50
|
if (autohideToast) {
|
|
51
|
-
onCloseRef.current == null
|
|
51
|
+
onCloseRef.current == null || onCloseRef.current();
|
|
52
52
|
}
|
|
53
53
|
}, [autohideToast]);
|
|
54
54
|
(0, _react.useEffect)(() => {
|
package/cjs/ToastHeader.js
CHANGED
|
@@ -26,7 +26,7 @@ const ToastHeader = /*#__PURE__*/React.forwardRef(({
|
|
|
26
26
|
bsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'toast-header');
|
|
27
27
|
const context = (0, _react.useContext)(_ToastContext.default);
|
|
28
28
|
const handleClick = (0, _useEventCallback.default)(e => {
|
|
29
|
-
context == null
|
|
29
|
+
context == null || context.onClose == null || context.onClose(e);
|
|
30
30
|
});
|
|
31
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
32
32
|
ref: ref,
|
package/cjs/ToggleButtonGroup.js
CHANGED
|
@@ -42,7 +42,7 @@ const ToggleButtonGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
42
42
|
onChange([...values, inputVal], event);
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
!(type !== 'radio' || !!name) ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, 'A `name` is required to group the toggle buttons when the `type` ' + 'is set to "radio"') :
|
|
45
|
+
!(type !== 'radio' || !!name) ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, 'A `name` is required to group the toggle buttons when the `type` ' + 'is set to "radio"') : (0, _invariant.default)(false) : void 0;
|
|
46
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroup.default, {
|
|
47
47
|
...controlledProps,
|
|
48
48
|
ref: ref,
|
|
@@ -6,9 +6,9 @@ export type TransitionWrapperProps = TransitionProps & {
|
|
|
6
6
|
};
|
|
7
7
|
declare const TransitionWrapper: React.ForwardRefExoticComponent<(Omit<import("react-transition-group/Transition").TimeoutProps<undefined> & {
|
|
8
8
|
childRef?: React.Ref<unknown> | undefined;
|
|
9
|
-
children: React.ReactElement
|
|
9
|
+
children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
10
10
|
}, "ref"> | Omit<import("react-transition-group/Transition").EndListenerProps<undefined> & {
|
|
11
11
|
childRef?: React.Ref<unknown> | undefined;
|
|
12
|
-
children: React.ReactElement
|
|
12
|
+
children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
13
13
|
}, "ref">) & React.RefAttributes<Transition<any>>>;
|
|
14
14
|
export default TransitionWrapper;
|
package/cjs/helpers.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface AsProp<As extends React.ElementType = React.ElementType> {
|
|
|
11
11
|
export interface BsPrefixProps<As extends React.ElementType = React.ElementType> extends BsPrefixOnlyProps, AsProp<As> {
|
|
12
12
|
}
|
|
13
13
|
export interface BsPrefixRefForwardingComponent<TInitial extends React.ElementType, P = unknown> {
|
|
14
|
-
<As extends React.ElementType = TInitial>(props: React.PropsWithChildren<ReplaceProps<As, BsPrefixProps<As> & P>>, context?: any): React.
|
|
14
|
+
<As extends React.ElementType = TInitial>(props: React.PropsWithChildren<ReplaceProps<As, BsPrefixProps<As> & P>>, context?: any): React.ReactNode;
|
|
15
15
|
propTypes?: any;
|
|
16
16
|
contextTypes?: any;
|
|
17
17
|
defaultProps?: Partial<P>;
|