react-bootstrap 2.10.2 → 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/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 +550 -496
- 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/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
|
@@ -17,8 +17,8 @@ const AbstractModalHeader = /*#__PURE__*/React.forwardRef(({
|
|
|
17
17
|
}, ref) => {
|
|
18
18
|
const context = useContext(ModalContext);
|
|
19
19
|
const handleClick = useEventCallback(() => {
|
|
20
|
-
context == null
|
|
21
|
-
onHide == null
|
|
20
|
+
context == null || context.onHide();
|
|
21
|
+
onHide == null || onHide();
|
|
22
22
|
});
|
|
23
23
|
return /*#__PURE__*/_jsxs("div", {
|
|
24
24
|
ref: ref,
|
package/esm/AccordionButton.js
CHANGED
|
@@ -31,8 +31,8 @@ export function useAccordionButton(eventKey, onClick) {
|
|
|
31
31
|
eventKeyPassed = [eventKey];
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
onSelect == null
|
|
35
|
-
onClick == null
|
|
34
|
+
onSelect == null || onSelect(eventKeyPassed, e);
|
|
35
|
+
onClick == null || onClick(e);
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
const AccordionButton = /*#__PURE__*/React.forwardRef(({
|
package/esm/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/esm/Carousel.js
CHANGED
|
@@ -124,7 +124,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
124
124
|
nextActiveIndex = numChildren - 1;
|
|
125
125
|
}
|
|
126
126
|
nextDirectionRef.current = 'prev';
|
|
127
|
-
onSelect == null
|
|
127
|
+
onSelect == null || onSelect(nextActiveIndex, event);
|
|
128
128
|
}, [isSliding, renderedActiveIndex, onSelect, wrap, numChildren]);
|
|
129
129
|
|
|
130
130
|
// This is used in the setInterval, so it should not invalidate.
|
|
@@ -140,7 +140,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
140
140
|
nextActiveIndex = 0;
|
|
141
141
|
}
|
|
142
142
|
nextDirectionRef.current = 'next';
|
|
143
|
-
onSelect == null
|
|
143
|
+
onSelect == null || onSelect(nextActiveIndex, event);
|
|
144
144
|
});
|
|
145
145
|
const elementRef = useRef();
|
|
146
146
|
useImperativeHandle(ref, () => ({
|
|
@@ -165,18 +165,18 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
165
165
|
// These callbacks will be handled by the <Transition> callbacks.
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
-
onSlide == null
|
|
169
|
-
onSlid == null
|
|
168
|
+
onSlide == null || onSlide(renderedActiveIndex, slideDirection);
|
|
169
|
+
onSlid == null || onSlid(renderedActiveIndex, slideDirection);
|
|
170
170
|
}, [renderedActiveIndex]);
|
|
171
171
|
const orderClassName = `${prefix}-item-${direction}`;
|
|
172
172
|
const directionalClassName = `${prefix}-item-${slideDirection}`;
|
|
173
173
|
const handleEnter = useCallback(node => {
|
|
174
174
|
triggerBrowserReflow(node);
|
|
175
|
-
onSlide == null
|
|
175
|
+
onSlide == null || onSlide(renderedActiveIndex, slideDirection);
|
|
176
176
|
}, [onSlide, renderedActiveIndex, slideDirection]);
|
|
177
177
|
const handleEntered = useCallback(() => {
|
|
178
178
|
setIsSliding(false);
|
|
179
|
-
onSlid == null
|
|
179
|
+
onSlid == null || onSlid(renderedActiveIndex, slideDirection);
|
|
180
180
|
}, [onSlid, renderedActiveIndex, slideDirection]);
|
|
181
181
|
const handleKeyDown = useCallback(event => {
|
|
182
182
|
if (keyboard && !/input|textarea/i.test(event.target.tagName)) {
|
|
@@ -200,17 +200,17 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
200
200
|
default:
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
onKeyDown == null
|
|
203
|
+
onKeyDown == null || onKeyDown(event);
|
|
204
204
|
}, [keyboard, onKeyDown, prev, next, isRTL]);
|
|
205
205
|
const handleMouseOver = useCallback(event => {
|
|
206
206
|
if (pause === 'hover') {
|
|
207
207
|
setPaused(true);
|
|
208
208
|
}
|
|
209
|
-
onMouseOver == null
|
|
209
|
+
onMouseOver == null || onMouseOver(event);
|
|
210
210
|
}, [pause, onMouseOver]);
|
|
211
211
|
const handleMouseOut = useCallback(event => {
|
|
212
212
|
setPaused(false);
|
|
213
|
-
onMouseOut == null
|
|
213
|
+
onMouseOut == null || onMouseOut(event);
|
|
214
214
|
}, [onMouseOut]);
|
|
215
215
|
const touchStartXRef = useRef(0);
|
|
216
216
|
const touchDeltaXRef = useRef(0);
|
|
@@ -221,7 +221,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
221
221
|
if (pause === 'hover') {
|
|
222
222
|
setPaused(true);
|
|
223
223
|
}
|
|
224
|
-
onTouchStart == null
|
|
224
|
+
onTouchStart == null || onTouchStart(event);
|
|
225
225
|
}, [pause, onTouchStart]);
|
|
226
226
|
const handleTouchMove = useCallback(event => {
|
|
227
227
|
if (event.touches && event.touches.length > 1) {
|
|
@@ -229,7 +229,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
229
229
|
} else {
|
|
230
230
|
touchDeltaXRef.current = event.touches[0].clientX - touchStartXRef.current;
|
|
231
231
|
}
|
|
232
|
-
onTouchMove == null
|
|
232
|
+
onTouchMove == null || onTouchMove(event);
|
|
233
233
|
}, [onTouchMove]);
|
|
234
234
|
const handleTouchEnd = useCallback(event => {
|
|
235
235
|
if (touch) {
|
|
@@ -247,7 +247,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
247
247
|
setPaused(false);
|
|
248
248
|
}, interval || undefined);
|
|
249
249
|
}
|
|
250
|
-
onTouchEnd == null
|
|
250
|
+
onTouchEnd == null || onTouchEnd(event);
|
|
251
251
|
}, [touch, pause, prev, next, touchUnpauseTimeout, interval, onTouchEnd]);
|
|
252
252
|
const shouldPlay = interval != null && !paused && !isSliding;
|
|
253
253
|
const intervalHandleRef = useRef();
|
|
@@ -267,7 +267,7 @@ const Carousel = /*#__PURE__*/React.forwardRef(({
|
|
|
267
267
|
const indicatorOnClicks = useMemo(() => indicators && Array.from({
|
|
268
268
|
length: numChildren
|
|
269
269
|
}, (_, index) => event => {
|
|
270
|
-
onSelect == null
|
|
270
|
+
onSelect == null || onSelect(index, event);
|
|
271
271
|
}), [indicators, numChildren, onSelect]);
|
|
272
272
|
return /*#__PURE__*/_jsxs(Component, {
|
|
273
273
|
ref: elementRef,
|
package/esm/Dropdown.js
CHANGED
|
@@ -50,16 +50,16 @@ const Dropdown = /*#__PURE__*/React.forwardRef((pProps, ref) => {
|
|
|
50
50
|
return true;
|
|
51
51
|
};
|
|
52
52
|
const handleToggle = useEventCallback((nextShow, meta) => {
|
|
53
|
-
var _meta$originalEvent
|
|
53
|
+
var _meta$originalEvent;
|
|
54
54
|
/** Checking if target of event is ToggleButton,
|
|
55
55
|
* if it is then nullify mousedown event
|
|
56
56
|
*/
|
|
57
|
-
const isToggleButton = (_meta$originalEvent = meta.originalEvent) == null
|
|
57
|
+
const isToggleButton = (_meta$originalEvent = meta.originalEvent) == null || (_meta$originalEvent = _meta$originalEvent.target) == null ? void 0 : _meta$originalEvent.classList.contains('dropdown-toggle');
|
|
58
58
|
if (isToggleButton && meta.source === 'mousedown') {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
if (meta.originalEvent.currentTarget === document && (meta.source !== 'keydown' || meta.originalEvent.key === 'Escape')) meta.source = 'rootClose';
|
|
62
|
-
if (isClosingPermitted(meta.source)) onToggle == null
|
|
62
|
+
if (isClosingPermitted(meta.source)) onToggle == null || onToggle(nextShow, meta);
|
|
63
63
|
});
|
|
64
64
|
const alignEnd = align === 'end';
|
|
65
65
|
const placement = getDropdownMenuPlacement(alignEnd, drop, isRTL);
|
package/esm/DropdownMenu.js
CHANGED
|
@@ -88,7 +88,7 @@ const DropdownMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
88
88
|
useIsomorphicEffect(() => {
|
|
89
89
|
// Popper's initial position for the menu is incorrect when
|
|
90
90
|
// renderOnMount=true. Need to call update() to correct it.
|
|
91
|
-
if (show) popper == null
|
|
91
|
+
if (show) popper == null || popper.update();
|
|
92
92
|
}, [show]);
|
|
93
93
|
if (!hasShown && !renderOnMount && !isInputGroup) return null;
|
|
94
94
|
|
package/esm/Fade.js
CHANGED
|
@@ -27,7 +27,7 @@ const Fade = /*#__PURE__*/React.forwardRef(({
|
|
|
27
27
|
};
|
|
28
28
|
const handleEnter = useCallback((node, isAppearing) => {
|
|
29
29
|
triggerBrowserReflow(node);
|
|
30
|
-
onEnter == null
|
|
30
|
+
onEnter == null || onEnter(node, isAppearing);
|
|
31
31
|
}, [onEnter]);
|
|
32
32
|
return /*#__PURE__*/_jsx(TransitionWrapper, {
|
|
33
33
|
ref: ref,
|
package/esm/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/esm/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/esm/Modal.js
CHANGED
|
@@ -110,7 +110,7 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
110
110
|
});
|
|
111
111
|
useWillUnmount(() => {
|
|
112
112
|
removeEventListener(window, 'resize', handleWindowResize);
|
|
113
|
-
removeStaticModalAnimationRef.current == null
|
|
113
|
+
removeStaticModalAnimationRef.current == null || removeStaticModalAnimationRef.current();
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
// We prevent the modal from closing during a drag by detecting where the
|
|
@@ -146,11 +146,11 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
146
146
|
ignoreBackdropClickRef.current = false;
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
onHide == null
|
|
149
|
+
onHide == null || onHide();
|
|
150
150
|
};
|
|
151
151
|
const handleEscapeKeyDown = e => {
|
|
152
152
|
if (keyboard) {
|
|
153
|
-
onEscapeKeyDown == null
|
|
153
|
+
onEscapeKeyDown == null || onEscapeKeyDown(e);
|
|
154
154
|
} else {
|
|
155
155
|
// Call preventDefault to stop modal from closing in @restart/ui.
|
|
156
156
|
e.preventDefault();
|
|
@@ -164,21 +164,21 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
164
164
|
if (node) {
|
|
165
165
|
updateDialogStyle(node);
|
|
166
166
|
}
|
|
167
|
-
onEnter == null
|
|
167
|
+
onEnter == null || onEnter(node, isAppearing);
|
|
168
168
|
};
|
|
169
169
|
const handleExit = node => {
|
|
170
|
-
removeStaticModalAnimationRef.current == null
|
|
171
|
-
onExit == null
|
|
170
|
+
removeStaticModalAnimationRef.current == null || removeStaticModalAnimationRef.current();
|
|
171
|
+
onExit == null || onExit(node);
|
|
172
172
|
};
|
|
173
173
|
const handleEntering = (node, isAppearing) => {
|
|
174
|
-
onEntering == null
|
|
174
|
+
onEntering == null || onEntering(node, isAppearing);
|
|
175
175
|
|
|
176
176
|
// FIXME: This should work even when animation is disabled.
|
|
177
177
|
addEventListener(window, 'resize', handleWindowResize);
|
|
178
178
|
};
|
|
179
179
|
const handleExited = node => {
|
|
180
180
|
if (node) node.style.display = ''; // RHL removes it sometimes
|
|
181
|
-
onExited == null
|
|
181
|
+
onExited == null || onExited(node);
|
|
182
182
|
|
|
183
183
|
// FIXME: This should work even when animation is disabled.
|
|
184
184
|
removeEventListener(window, 'resize', handleWindowResize);
|
package/esm/Navbar.js
CHANGED
|
@@ -34,9 +34,9 @@ const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
34
34
|
});
|
|
35
35
|
const bsPrefix = useBootstrapPrefix(initialBsPrefix, 'navbar');
|
|
36
36
|
const handleCollapse = useCallback((...args) => {
|
|
37
|
-
onSelect == null
|
|
37
|
+
onSelect == null || onSelect(...args);
|
|
38
38
|
if (collapseOnSelect && expanded) {
|
|
39
|
-
onToggle == null
|
|
39
|
+
onToggle == null || onToggle(false);
|
|
40
40
|
}
|
|
41
41
|
}, [onSelect, collapseOnSelect, expanded, onToggle]);
|
|
42
42
|
|
package/esm/Offcanvas.js
CHANGED
|
@@ -73,8 +73,8 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
73
73
|
setShowOffcanvas(responsive ? show && !hideResponsiveOffcanvas : show);
|
|
74
74
|
}, [show, responsive, hideResponsiveOffcanvas]);
|
|
75
75
|
const handleHide = useEventCallback(() => {
|
|
76
|
-
onToggle == null
|
|
77
|
-
onHide == null
|
|
76
|
+
onToggle == null || onToggle();
|
|
77
|
+
onHide == null || onHide();
|
|
78
78
|
});
|
|
79
79
|
const modalContext = useMemo(() => ({
|
|
80
80
|
onHide: handleHide
|
|
@@ -93,11 +93,11 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
93
93
|
}
|
|
94
94
|
const handleEnter = (node, ...args) => {
|
|
95
95
|
if (node) node.style.visibility = 'visible';
|
|
96
|
-
onEnter == null
|
|
96
|
+
onEnter == null || onEnter(node, ...args);
|
|
97
97
|
};
|
|
98
98
|
const handleExited = (node, ...args) => {
|
|
99
99
|
if (node) node.style.visibility = '';
|
|
100
|
-
onExited == null
|
|
100
|
+
onExited == null || onExited(...args);
|
|
101
101
|
};
|
|
102
102
|
const renderBackdrop = useCallback(backdropProps => /*#__PURE__*/_jsx("div", {
|
|
103
103
|
...backdropProps,
|
package/esm/Overlay.js
CHANGED
|
@@ -37,12 +37,12 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
37
37
|
const actualTransition = transition === true ? Fade : transition || undefined;
|
|
38
38
|
const handleFirstUpdate = useEventCallback(state => {
|
|
39
39
|
setFirstRenderedState(state);
|
|
40
|
-
popperConfig == null
|
|
40
|
+
popperConfig == null || popperConfig.onFirstUpdate == null || popperConfig.onFirstUpdate(state);
|
|
41
41
|
});
|
|
42
42
|
useIsomorphicEffect(() => {
|
|
43
43
|
if (firstRenderedState && outerProps.target) {
|
|
44
44
|
// Must wait for target element to resolve before updating popper.
|
|
45
|
-
popperRef.current.scheduleUpdate == null
|
|
45
|
+
popperRef.current.scheduleUpdate == null || popperRef.current.scheduleUpdate();
|
|
46
46
|
}
|
|
47
47
|
}, [firstRenderedState, outerProps.target]);
|
|
48
48
|
useEffect(() => {
|
|
@@ -67,7 +67,7 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
67
67
|
popper: popperObj,
|
|
68
68
|
show
|
|
69
69
|
}) => {
|
|
70
|
-
var _popperObj$state
|
|
70
|
+
var _popperObj$state;
|
|
71
71
|
wrapRefs(overlayProps, arrowProps);
|
|
72
72
|
// Need to get placement from popper object, handling case when overlay is flipped using 'flip' prop
|
|
73
73
|
const updatedPlacement = popperObj == null ? void 0 : popperObj.placement;
|
|
@@ -75,7 +75,7 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
75
75
|
state: popperObj == null ? void 0 : popperObj.state,
|
|
76
76
|
scheduleUpdate: popperObj == null ? void 0 : popperObj.update,
|
|
77
77
|
placement: updatedPlacement,
|
|
78
|
-
outOfBoundaries: (popperObj == null
|
|
78
|
+
outOfBoundaries: (popperObj == null || (_popperObj$state = popperObj.state) == null || (_popperObj$state = _popperObj$state.modifiersData.hide) == null ? void 0 : _popperObj$state.isReferenceHidden) || false,
|
|
79
79
|
strategy: popperConfig.strategy
|
|
80
80
|
});
|
|
81
81
|
const hasDoneInitialMeasure = !!firstRenderedState;
|
package/esm/OverlayTrigger.js
CHANGED
|
@@ -86,15 +86,15 @@ const OverlayTrigger = ({
|
|
|
86
86
|
}, [delay.hide, setShow, timeout]);
|
|
87
87
|
const handleFocus = useCallback((...args) => {
|
|
88
88
|
handleShow();
|
|
89
|
-
onFocus == null
|
|
89
|
+
onFocus == null || onFocus(...args);
|
|
90
90
|
}, [handleShow, onFocus]);
|
|
91
91
|
const handleBlur = useCallback((...args) => {
|
|
92
92
|
handleHide();
|
|
93
|
-
onBlur == null
|
|
93
|
+
onBlur == null || onBlur(...args);
|
|
94
94
|
}, [handleHide, onBlur]);
|
|
95
95
|
const handleClick = useCallback((...args) => {
|
|
96
96
|
setShow(!show);
|
|
97
|
-
onClick == null
|
|
97
|
+
onClick == null || onClick(...args);
|
|
98
98
|
}, [onClick, setShow, show]);
|
|
99
99
|
const handleMouseOver = useCallback((...args) => {
|
|
100
100
|
handleMouseOverOut(handleShow, args, 'fromElement');
|
package/esm/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/esm/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/esm/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/esm/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/esm/Toast.js
CHANGED
|
@@ -42,7 +42,7 @@ const Toast = /*#__PURE__*/React.forwardRef(({
|
|
|
42
42
|
const autohideToast = !!(autohide && show);
|
|
43
43
|
const autohideFunc = useCallback(() => {
|
|
44
44
|
if (autohideToast) {
|
|
45
|
-
onCloseRef.current == null
|
|
45
|
+
onCloseRef.current == null || onCloseRef.current();
|
|
46
46
|
}
|
|
47
47
|
}, [autohideToast]);
|
|
48
48
|
useEffect(() => {
|
package/esm/ToastHeader.js
CHANGED
|
@@ -21,7 +21,7 @@ const ToastHeader = /*#__PURE__*/React.forwardRef(({
|
|
|
21
21
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'toast-header');
|
|
22
22
|
const context = useContext(ToastContext);
|
|
23
23
|
const handleClick = useEventCallback(e => {
|
|
24
|
-
context == null
|
|
24
|
+
context == null || context.onClose == null || context.onClose(e);
|
|
25
25
|
});
|
|
26
26
|
return /*#__PURE__*/_jsxs("div", {
|
|
27
27
|
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/esm/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>;
|