rsuite 5.5.0 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/Carousel/styles/index.less +1 -0
- package/CheckTreePicker/styles/index.less +5 -5
- package/Modal/styles/mixin.less +1 -0
- package/README.md +4 -2
- package/Sidenav/styles/index.less +2 -2
- package/cjs/Affix/Affix.js +1 -0
- package/cjs/Calendar/TimeDropdown.js +7 -4
- package/cjs/Carousel/Carousel.d.ts +5 -1
- package/cjs/Carousel/Carousel.js +22 -16
- package/cjs/Cascader/Cascader.js +2 -2
- package/cjs/Cascader/DropdownMenu.js +1 -1
- package/cjs/CheckTreePicker/CheckTreePicker.js +17 -12
- package/cjs/CheckTreePicker/utils.d.ts +3 -3
- package/cjs/CheckTreePicker/utils.js +2 -2
- package/cjs/DOMHelper/index.d.ts +4 -4
- package/cjs/DatePicker/DatePicker.d.ts +2 -1
- package/cjs/DatePicker/DatePicker.js +19 -12
- package/cjs/DateRangePicker/Calendar.js +2 -16
- package/cjs/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/cjs/DateRangePicker/DateRangePicker.js +5 -4
- package/cjs/IconButton/IconButton.d.ts +5 -2
- package/cjs/IconButton/IconButton.js +2 -2
- package/cjs/IconButton/test/IconButton.test.d.ts +1 -0
- package/cjs/IconButton/test/IconButton.test.js +24 -0
- package/cjs/InputPicker/InputAutosize.js +3 -1
- package/cjs/InputPicker/InputPicker.js +6 -2
- package/cjs/List/ListItem.js +13 -11
- package/cjs/Menu/MenuItem.js +14 -11
- package/cjs/Picker/PickerOverlay.js +4 -1
- package/cjs/Picker/index.d.ts +2 -1
- package/cjs/Ripple/Ripple.js +17 -9
- package/cjs/TreePicker/TreePicker.js +15 -11
- package/cjs/Uploader/UploadTrigger.js +3 -1
- package/cjs/Uploader/Uploader.js +3 -1
- package/cjs/toaster/toaster.d.ts +1 -1
- package/cjs/toaster/toaster.js +9 -3
- package/cjs/utils/treeUtils.d.ts +3 -3
- package/cjs/utils/useElementResize.d.ts +1 -1
- package/cjs/utils/useElementResize.js +5 -2
- package/cjs/utils/useTimeout.d.ts +2 -2
- package/cjs/utils/useTimeout.js +17 -8
- package/dist/rsuite-rtl.css +23 -16
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +23 -16
- package/dist/rsuite.js +370 -51
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Affix/Affix.js +1 -0
- package/esm/Calendar/TimeDropdown.js +7 -4
- package/esm/Carousel/Carousel.d.ts +5 -1
- package/esm/Carousel/Carousel.js +23 -17
- package/esm/Cascader/Cascader.js +2 -2
- package/esm/Cascader/DropdownMenu.js +1 -1
- package/esm/CheckTreePicker/CheckTreePicker.js +17 -12
- package/esm/CheckTreePicker/utils.d.ts +3 -3
- package/esm/CheckTreePicker/utils.js +2 -2
- package/esm/DOMHelper/index.d.ts +4 -4
- package/esm/DatePicker/DatePicker.d.ts +2 -1
- package/esm/DatePicker/DatePicker.js +19 -12
- package/esm/DateRangePicker/Calendar.js +2 -16
- package/esm/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/esm/DateRangePicker/DateRangePicker.js +5 -4
- package/esm/IconButton/IconButton.d.ts +5 -2
- package/esm/IconButton/IconButton.js +1 -1
- package/esm/IconButton/test/IconButton.test.d.ts +1 -0
- package/esm/IconButton/test/IconButton.test.js +18 -0
- package/esm/InputPicker/InputAutosize.js +3 -1
- package/esm/InputPicker/InputPicker.js +6 -2
- package/esm/List/ListItem.js +13 -11
- package/esm/Menu/MenuItem.js +14 -11
- package/esm/Picker/PickerOverlay.js +4 -1
- package/esm/Picker/index.d.ts +2 -1
- package/esm/Ripple/Ripple.js +17 -9
- package/esm/TreePicker/TreePicker.js +15 -11
- package/esm/Uploader/UploadTrigger.js +3 -1
- package/esm/Uploader/Uploader.js +3 -1
- package/esm/toaster/toaster.d.ts +1 -1
- package/esm/toaster/toaster.js +9 -3
- package/esm/utils/treeUtils.d.ts +3 -3
- package/esm/utils/useElementResize.d.ts +1 -1
- package/esm/utils/useElementResize.js +5 -2
- package/esm/utils/useTimeout.d.ts +2 -2
- package/esm/utils/useTimeout.js +17 -8
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
## [5.6.1](https://github.com/rsuite/rsuite/compare/v5.6.0...v5.6.1) (2022-02-17)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **caretAs:** fix DatePicker and DateRangePicker cannot replace caret ([#2360](https://github.com/rsuite/rsuite/issues/2360)) ([1e619b2](https://github.com/rsuite/rsuite/commit/1e619b2ef7abc58a93f6d6d4fc78ffea07761c81))
|
|
6
|
+
- **IconButton:** infer addtional props from as prop ([#2343](https://github.com/rsuite/rsuite/issues/2343)) ([3b6c25c](https://github.com/rsuite/rsuite/commit/3b6c25c103ed33a86baa47b8c757462da7ae8c4c))
|
|
7
|
+
- **Toaster:** code breaks when toaster is in a useEffect ([#2353](https://github.com/rsuite/rsuite/issues/2353)) ([d083fe2](https://github.com/rsuite/rsuite/commit/d083fe27013659cbc45196b7ead9ff5863404fb8)), closes [#2336](https://github.com/rsuite/rsuite/issues/2336)
|
|
8
|
+
- **useTimeout:** fix callback not being called after timeout ([#2349](https://github.com/rsuite/rsuite/issues/2349)) ([e82a12a](https://github.com/rsuite/rsuite/commit/e82a12aa2929cf66e7a3c6d70008c5bedb4ab128))
|
|
9
|
+
|
|
10
|
+
# [5.6.0](https://github.com/rsuite/rsuite/compare/v5.5.2...v5.6.0) (2022-02-10)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **DatePicker:** fixed oneTap to work in month view ([#2342](https://github.com/rsuite/rsuite/issues/2342)) ([d5368cd](https://github.com/rsuite/rsuite/commit/d5368cdfb2a6386bfb509a6316520e450f35f2b4))
|
|
15
|
+
- handle some null value branch ([#2323](https://github.com/rsuite/rsuite/issues/2323)) ([3ffd1d9](https://github.com/rsuite/rsuite/commit/3ffd1d966d5fd7f0a4f42bb8b08bf0cb65955fef))
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- **Carousel:** Expose active index ([#2338](https://github.com/rsuite/rsuite/issues/2338)) ([beac483](https://github.com/rsuite/rsuite/commit/beac48395c9fc7c30efb3f49f81e8969cd3ee71d))
|
|
20
|
+
|
|
21
|
+
## [5.5.2](https://github.com/rsuite/rsuite/compare/v5.5.1...v5.5.2) (2022-01-27)
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
- **Cascader:** add parent node in serach result while parentSelectable ([#2313](https://github.com/rsuite/rsuite/issues/2313)) ([e677bb6](https://github.com/rsuite/rsuite/commit/e677bb6b75d0cc26dafedc8e5326d413969c2867))
|
|
26
|
+
|
|
27
|
+
## [5.5.1](https://github.com/rsuite/rsuite/compare/v5.5.0...v5.5.1) (2022-01-21)
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
- **Carousel:** add a flex-wrap property on toolbar buttons ([#2302](https://github.com/rsuite/rsuite/issues/2302)) ([a9a9113](https://github.com/rsuite/rsuite/commit/a9a911378c4aaeba43233dd3acdc05913a9bf6ae))
|
|
32
|
+
- **CheckTreePicker:** fix CheckTreePicker label style ([#2304](https://github.com/rsuite/rsuite/issues/2304)) ([07eb5ac](https://github.com/rsuite/rsuite/commit/07eb5acd4e8283529619ad2b4d6003b0c4f8614d))
|
|
33
|
+
- **DateRangePicker:** fix month not selectable on calendar ([#2312](https://github.com/rsuite/rsuite/issues/2312)) ([5199845](https://github.com/rsuite/rsuite/commit/5199845ee435e923c807da5e0813f4ba06a86798))
|
|
34
|
+
- **Sidenav:** hide focus ring when interacting with mouse ([#2311](https://github.com/rsuite/rsuite/issues/2311)) ([9413bc9](https://github.com/rsuite/rsuite/commit/9413bc9a48fb8a3f915cc811b3392ba4e65b0b70))
|
|
35
|
+
|
|
36
|
+
### Performance Improvements
|
|
37
|
+
|
|
38
|
+
- Responsive for small screen ([#2293](https://github.com/rsuite/rsuite/issues/2293)) ([cadc42e](https://github.com/rsuite/rsuite/commit/cadc42e39baee174ff7d5577ea933cb471ef5bd0))
|
|
39
|
+
|
|
1
40
|
# [5.5.0](https://github.com/rsuite/rsuite/compare/v5.4.4...v5.5.0) (2022-01-13)
|
|
2
41
|
|
|
3
42
|
### Bug Fixes
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
margin: 0;
|
|
33
33
|
//padding-left: 16px;
|
|
34
34
|
padding: @picker-tree-node-padding-vertical @picker-tree-node-padding-horizontal;
|
|
35
|
-
//text gap + checkbox space
|
|
36
|
-
padding-left:
|
|
35
|
+
//text gap + checkbox space + label gap
|
|
36
|
+
padding-left: 50px; // 10px + 36px + 4px
|
|
37
37
|
|
|
38
38
|
&::before {
|
|
39
39
|
content: '';
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
height: 100%;
|
|
46
46
|
top: 0;
|
|
47
|
-
margin-left: -
|
|
47
|
+
margin-left: -52px; // 10px + 36px + 6px
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
// Only has the first level
|
|
58
58
|
.rs-check-tree-without-children .rs-check-item .rs-checkbox-checker {
|
|
59
59
|
> label {
|
|
60
|
-
padding-left:
|
|
60
|
+
padding-left: 32px; //text gap + checkbox space
|
|
61
61
|
|
|
62
62
|
&::before {
|
|
63
63
|
width: 28px;
|
|
64
|
-
margin-left: -
|
|
64
|
+
margin-left: -34px;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
package/Modal/styles/mixin.less
CHANGED
package/README.md
CHANGED
|
@@ -130,9 +130,11 @@ If you like React Suite, you can show your support by either
|
|
|
130
130
|
This project exists thanks to all the people who contribute.
|
|
131
131
|
|
|
132
132
|
<a href="https://github.com/rsuite/rsuite/graphs/contributors" target="_blank">
|
|
133
|
-
<img src="https://
|
|
133
|
+
<img src="https://contrib.rocks/image?repo=rsuite/rsuite" />
|
|
134
134
|
</a>
|
|
135
135
|
|
|
136
|
+
[![opencollective-now][opencollective-svg]][opencollective-home]
|
|
137
|
+
|
|
136
138
|
## License
|
|
137
139
|
|
|
138
140
|
React Suite is [MIT licensed][license]. Copyright (c) 2016-present, HYPERS.
|
|
@@ -147,7 +149,7 @@ React Suite is [MIT licensed][license]. Copyright (c) 2016-present, HYPERS.
|
|
|
147
149
|
[rsuite-design]: https://rsuitejs.com/design/default
|
|
148
150
|
[live-preview-on-codesandbox]: https://codesandbox.io/s/rsuite-template-5vq6zo2z5l
|
|
149
151
|
[rsuite-doc-guide]: https://rsuitejs.com/en/guide/introduction
|
|
150
|
-
[rsuite-doc-guide-themes]: https://rsuitejs.com/en/guide/
|
|
152
|
+
[rsuite-doc-guide-themes]: https://rsuitejs.com/en/guide/customization
|
|
151
153
|
[rsuite-doc-guide-intl]: https://rsuitejs.com/en/guide/intl
|
|
152
154
|
[rsuite-doc-guide-rtl]: https://rsuitejs.com/en/guide/rtl
|
|
153
155
|
[rsuite-components-overview]: https://rsuitejs.com/en/components/overview
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
|
|
138
138
|
// Sidenav is usually placed by the left/right edge of the page
|
|
139
139
|
// thus use an inset focus ring to prevent overflow clipping
|
|
140
|
-
&:focus {
|
|
140
|
+
&:focus-visible {
|
|
141
141
|
.focus-ring(inset);
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
// supplement padding
|
|
338
338
|
padding-left: @sidenav-default-width;
|
|
339
339
|
|
|
340
|
-
&:focus {
|
|
340
|
+
&:focus-visible {
|
|
341
341
|
.focus-ring();
|
|
342
342
|
|
|
343
343
|
.high-contrast-mode({
|
package/cjs/Affix/Affix.js
CHANGED
|
@@ -28,6 +28,7 @@ function useOffset(mountRef) {
|
|
|
28
28
|
setOffset = _useState[1];
|
|
29
29
|
|
|
30
30
|
var updateOffset = (0, _react.useCallback)(function () {
|
|
31
|
+
// FIXME upgrade dom-lib
|
|
31
32
|
setOffset((0, _getOffset.default)(mountRef.current));
|
|
32
33
|
}, [mountRef]); // Update after the element size changes
|
|
33
34
|
|
|
@@ -101,10 +101,11 @@ var scrollTo = function scrollTo(time, row) {
|
|
|
101
101
|
var node = container === null || container === void 0 ? void 0 : container.querySelector("[data-key=\"" + type + "-" + value + "\"]");
|
|
102
102
|
|
|
103
103
|
if (node && container) {
|
|
104
|
-
var
|
|
105
|
-
top = _ref2.top;
|
|
104
|
+
var position = (0, _getPosition.default)(node, container);
|
|
106
105
|
|
|
107
|
-
|
|
106
|
+
if (position) {
|
|
107
|
+
(0, _utils.scrollTopAnimation)(container, position.top, (0, _scrollTop.default)(container) !== 0);
|
|
108
|
+
}
|
|
108
109
|
}
|
|
109
110
|
});
|
|
110
111
|
};
|
|
@@ -134,7 +135,9 @@ var TimeDropdown = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
134
135
|
showMeridian: showMeridian
|
|
135
136
|
}); // The currently selected time scrolls to the visible range.
|
|
136
137
|
|
|
137
|
-
show &&
|
|
138
|
+
if (show && rowRef.current) {
|
|
139
|
+
scrollTo(time, rowRef.current);
|
|
140
|
+
}
|
|
138
141
|
}, [date, format, show, showMeridian]);
|
|
139
142
|
|
|
140
143
|
var handleClick = function handleClick(type, d, event) {
|
|
@@ -9,7 +9,11 @@ export interface CarouselProps extends WithAsProps {
|
|
|
9
9
|
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
10
10
|
/** Button shape */
|
|
11
11
|
shape?: 'dot' | 'bar';
|
|
12
|
-
/**
|
|
12
|
+
/** Active element index */
|
|
13
|
+
activeIndex?: number;
|
|
14
|
+
/** Defaul initial index */
|
|
15
|
+
defaultActiveIndex?: number;
|
|
16
|
+
/** Callback fired when the active item manually changes */
|
|
13
17
|
onSelect?: (index: number, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
18
|
/** Callback fired when a slide transition starts */
|
|
15
19
|
onSlideStart?: (index: number, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
package/cjs/Carousel/Carousel.js
CHANGED
|
@@ -35,10 +35,13 @@ var Carousel = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
35
35
|
autoplay = props.autoplay,
|
|
36
36
|
_props$autoplayInterv = props.autoplayInterval,
|
|
37
37
|
autoplayInterval = _props$autoplayInterv === void 0 ? 4000 : _props$autoplayInterv,
|
|
38
|
+
activeIndexProp = props.activeIndex,
|
|
39
|
+
_props$defaultActiveI = props.defaultActiveIndex,
|
|
40
|
+
defaultActiveIndex = _props$defaultActiveI === void 0 ? 0 : _props$defaultActiveI,
|
|
38
41
|
onSelect = props.onSelect,
|
|
39
42
|
onSlideStart = props.onSlideStart,
|
|
40
43
|
onSlideEnd = props.onSlideEnd,
|
|
41
|
-
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "children", "classPrefix", "className", "placement", "shape", "autoplay", "autoplayInterval", "onSelect", "onSlideStart", "onSlideEnd"]);
|
|
44
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "children", "classPrefix", "className", "placement", "shape", "autoplay", "autoplayInterval", "activeIndex", "defaultActiveIndex", "onSelect", "onSlideStart", "onSlideEnd"]);
|
|
42
45
|
|
|
43
46
|
var _useCustom = (0, _utils.useCustom)('Carousel'),
|
|
44
47
|
rtl = _useCustom.rtl;
|
|
@@ -54,17 +57,24 @@ var Carousel = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
54
57
|
var vertical = placement === 'left' || placement === 'right';
|
|
55
58
|
var lengthKey = vertical ? 'height' : 'width';
|
|
56
59
|
|
|
60
|
+
var _useControlled = (0, _utils.useControlled)(activeIndexProp, defaultActiveIndex),
|
|
61
|
+
activeIndex = _useControlled[0],
|
|
62
|
+
setActiveIndex = _useControlled[1];
|
|
63
|
+
|
|
57
64
|
var _useState = (0, _react.useState)(0),
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
lastIndex = _useState[0],
|
|
66
|
+
setLastIndex = _useState[1];
|
|
60
67
|
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
setLastIndex = _useState2[1];
|
|
68
|
+
var rootRef = (0, _react.useRef)(null); // Set a timer for automatic playback.
|
|
69
|
+
// `autoplay` needs to be cast to boolean type to avoid undefined parameters.
|
|
64
70
|
|
|
65
|
-
var
|
|
71
|
+
var _useTimeout = (0, _utils.useTimeout)(function () {
|
|
72
|
+
return handleSlide();
|
|
73
|
+
}, autoplayInterval, !!autoplay && count > 1),
|
|
74
|
+
clear = _useTimeout.clear,
|
|
75
|
+
reset = _useTimeout.reset;
|
|
66
76
|
|
|
67
|
-
var handleSlide = function
|
|
77
|
+
var handleSlide = (0, _react.useCallback)(function (nextActiveIndex, event) {
|
|
68
78
|
if (!rootRef.current) {
|
|
69
79
|
return;
|
|
70
80
|
}
|
|
@@ -77,7 +87,7 @@ var Carousel = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
77
87
|
onSlideStart === null || onSlideStart === void 0 ? void 0 : onSlideStart(nextIndex, event);
|
|
78
88
|
setLastIndex(nextActiveIndex == null ? activeIndex : nextIndex);
|
|
79
89
|
reset();
|
|
80
|
-
};
|
|
90
|
+
}, [activeIndex, count, setActiveIndex, clear, onSlideStart, reset]);
|
|
81
91
|
|
|
82
92
|
var handleChange = function handleChange(event) {
|
|
83
93
|
var activeIndex = +event.target.value;
|
|
@@ -87,13 +97,7 @@ var Carousel = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
87
97
|
|
|
88
98
|
var handleTransitionEnd = (0, _react.useCallback)(function (event) {
|
|
89
99
|
onSlideEnd === null || onSlideEnd === void 0 ? void 0 : onSlideEnd(activeIndex, event);
|
|
90
|
-
}, [activeIndex, onSlideEnd]);
|
|
91
|
-
// `autoplay` needs to be cast to boolean type to avoid undefined parameters.
|
|
92
|
-
|
|
93
|
-
var _useTimeout = (0, _utils.useTimeout)(handleSlide, autoplayInterval, !!autoplay && count > 1),
|
|
94
|
-
clear = _useTimeout.clear,
|
|
95
|
-
reset = _useTimeout.reset;
|
|
96
|
-
|
|
100
|
+
}, [activeIndex, onSlideEnd]);
|
|
97
101
|
var uniqueId = (0, _react.useMemo)(function () {
|
|
98
102
|
return (0, _utils.guid)();
|
|
99
103
|
}, []);
|
|
@@ -165,6 +169,8 @@ Carousel.propTypes = {
|
|
|
165
169
|
as: _propTypes.default.elementType,
|
|
166
170
|
className: _propTypes.default.string,
|
|
167
171
|
classPrefix: _propTypes.default.string,
|
|
172
|
+
activeIndex: _propTypes.default.number,
|
|
173
|
+
defaultActiveIndex: _propTypes.default.number,
|
|
168
174
|
autoplay: _propTypes.default.bool,
|
|
169
175
|
autoplayInterval: _propTypes.default.number,
|
|
170
176
|
placement: _propTypes.default.oneOf(['top', 'bottom', 'left', 'right']),
|
package/cjs/Cascader/Cascader.js
CHANGED
|
@@ -163,7 +163,7 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
163
163
|
var getSearchResult = (0, _react.useCallback)(function (keyword) {
|
|
164
164
|
var items = [];
|
|
165
165
|
var result = flattenData.filter(function (item) {
|
|
166
|
-
if (item[childrenKey]) {
|
|
166
|
+
if (!parentSelectable && item[childrenKey]) {
|
|
167
167
|
return false;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -179,7 +179,7 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
return items;
|
|
182
|
-
}, [childrenKey, flattenData, someKeyword]); // Used to hover the focuse item when trigger `onKeydown`
|
|
182
|
+
}, [childrenKey, flattenData, someKeyword, parentSelectable]); // Used to hover the focuse item when trigger `onKeydown`
|
|
183
183
|
|
|
184
184
|
var _useFocusItemValue = (0, _Picker.useFocusItemValue)(value, {
|
|
185
185
|
rtl: rtl,
|
|
@@ -87,7 +87,7 @@ var DropdownMenu = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
87
87
|
if (activeItem) {
|
|
88
88
|
var position = (0, _getPosition.default)(activeItem, column); // Let the active option scroll into view.
|
|
89
89
|
|
|
90
|
-
(0, _scrollTop.default)(column, position.top);
|
|
90
|
+
(0, _scrollTop.default)(column, position === null || position === void 0 ? void 0 : position.top);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
}, [prefix]);
|
|
@@ -79,17 +79,20 @@ var CheckTreePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
79
79
|
controlledValue = props.value,
|
|
80
80
|
_props$defaultValue = props.defaultValue,
|
|
81
81
|
defaultValue = _props$defaultValue === void 0 ? emptyArray : _props$defaultValue,
|
|
82
|
-
|
|
82
|
+
_props$defaultExpandA = props.defaultExpandAll,
|
|
83
|
+
defaultExpandAll = _props$defaultExpandA === void 0 ? false : _props$defaultExpandA,
|
|
83
84
|
_props$disabledItemVa = props.disabledItemValues,
|
|
84
85
|
disabledItemValues = _props$disabledItemVa === void 0 ? emptyArray : _props$disabledItemVa,
|
|
85
86
|
controlledExpandItemValues = props.expandItemValues,
|
|
86
|
-
|
|
87
|
+
_props$defaultExpandI = props.defaultExpandItemValues,
|
|
88
|
+
defaultExpandItemValues = _props$defaultExpandI === void 0 ? emptyArray : _props$defaultExpandI,
|
|
87
89
|
_props$height = props.height,
|
|
88
90
|
height = _props$height === void 0 ? 360 : _props$height,
|
|
89
91
|
menuStyle = props.menuStyle,
|
|
90
92
|
_props$searchable = props.searchable,
|
|
91
93
|
searchable = _props$searchable === void 0 ? true : _props$searchable,
|
|
92
|
-
virtualized = props.virtualized,
|
|
94
|
+
_props$virtualized = props.virtualized,
|
|
95
|
+
virtualized = _props$virtualized === void 0 ? false : _props$virtualized,
|
|
93
96
|
className = props.className,
|
|
94
97
|
_props$classPrefix = props.classPrefix,
|
|
95
98
|
classPrefix = _props$classPrefix === void 0 ? 'picker' : _props$classPrefix,
|
|
@@ -271,15 +274,17 @@ var CheckTreePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
271
274
|
};
|
|
272
275
|
|
|
273
276
|
var focusActiveNode = (0, _react.useCallback)(function () {
|
|
274
|
-
(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
277
|
+
if (listRef.current) {
|
|
278
|
+
(0, _treeUtils.focusToActiveTreeNode)({
|
|
279
|
+
list: listRef.current,
|
|
280
|
+
valueKey: valueKey,
|
|
281
|
+
selector: "." + checkTreePrefix('node-active'),
|
|
282
|
+
activeNode: activeNode,
|
|
283
|
+
virtualized: virtualized,
|
|
284
|
+
container: treeViewRef.current,
|
|
285
|
+
formattedNodes: getFormattedNodes()
|
|
286
|
+
});
|
|
287
|
+
}
|
|
283
288
|
}, [checkTreePrefix, activeNode, getFormattedNodes, valueKey, virtualized]);
|
|
284
289
|
(0, _react.useEffect)(function () {
|
|
285
290
|
setValue((0, _utils2.getCheckTreePickerDefaultValue)(value, uncheckableItemValues));
|
|
@@ -36,9 +36,9 @@ export declare function isEveryFirstLevelNodeUncheckable(nodes: TreeNodesType, u
|
|
|
36
36
|
* get node uncheckable state
|
|
37
37
|
* @param {*} node
|
|
38
38
|
*/
|
|
39
|
-
export declare function isNodeUncheckable(node: any, props:
|
|
40
|
-
export declare function getFormattedTree(data: any[], nodes: TreeNodesType, props:
|
|
41
|
-
export declare function getDisabledState(nodes: TreeNodesType, node: TreeNodeType, props:
|
|
39
|
+
export declare function isNodeUncheckable(node: any, props: Required<Pick<CheckTreePickerProps, 'uncheckableItemValues' | 'valueKey'>>): boolean;
|
|
40
|
+
export declare function getFormattedTree(data: any[], nodes: TreeNodesType, props: Required<Pick<CheckTreePickerProps, 'childrenKey' | 'cascade'>>): any[];
|
|
41
|
+
export declare function getDisabledState(nodes: TreeNodesType, node: TreeNodeType, props: Required<Pick<CheckTreePickerProps, 'disabledItemValues' | 'valueKey'>>): boolean;
|
|
42
42
|
export declare function getCheckTreePickerDefaultValue(value: any[], uncheckableItemValues: any[]): any[];
|
|
43
43
|
export declare function getSelectedItems(nodes: TreeNodesType, value: (string | number)[], valueKey: string): TreeNodeType[];
|
|
44
44
|
export declare function getNodeCheckState({ nodes, node, cascade, childrenKey }: any): CheckStateType;
|
|
@@ -136,7 +136,7 @@ function getFormattedTree(data, nodes, props) {
|
|
|
136
136
|
var curNode = nodes[node.refKey];
|
|
137
137
|
|
|
138
138
|
if (curNode) {
|
|
139
|
-
var _node;
|
|
139
|
+
var _node$childrenKey;
|
|
140
140
|
|
|
141
141
|
var checkState = !(0, _isUndefined2.default)(cascade) ? getNodeCheckState({
|
|
142
142
|
node: curNode,
|
|
@@ -150,7 +150,7 @@ function getFormattedTree(data, nodes, props) {
|
|
|
150
150
|
formatted.parent = curNode.parent;
|
|
151
151
|
formatted.checkState = checkState;
|
|
152
152
|
|
|
153
|
-
if (((_node = node[childrenKey]) === null || _node === void 0 ? void 0 : _node.length) > 0) {
|
|
153
|
+
if (((_node$childrenKey = node[childrenKey]) === null || _node$childrenKey === void 0 ? void 0 : _node$childrenKey.length) > 0) {
|
|
154
154
|
formatted[childrenKey] = getFormattedTree(formatted[childrenKey], nodes, props);
|
|
155
155
|
}
|
|
156
156
|
}
|
package/cjs/DOMHelper/index.d.ts
CHANGED
|
@@ -13,15 +13,15 @@ declare const DOMHelper: {
|
|
|
13
13
|
cancelAnimationFramePolyfill: typeof clearTimeout;
|
|
14
14
|
requestAnimationFramePolyfill: typeof requestAnimationFrame;
|
|
15
15
|
getAnimationEnd: typeof helpers.getAnimationEnd;
|
|
16
|
-
ownerDocument: (node: Element) => Document;
|
|
16
|
+
ownerDocument: (node: Element | null) => Document;
|
|
17
17
|
ownerWindow: (componentOrElement: Element) => Window;
|
|
18
18
|
getWindow: (node: any) => Window;
|
|
19
|
-
getContainer: (container: Element | (() => Element), defaultContainer?: Element | undefined) => Element;
|
|
19
|
+
getContainer: (container: Element | (() => Element | null) | null, defaultContainer?: Element | undefined) => Element;
|
|
20
20
|
canUseDOM: boolean;
|
|
21
21
|
contains: (context: Element, node: Node & ParentNode) => boolean;
|
|
22
22
|
scrollTop: (node: Element, val?: number | undefined) => number;
|
|
23
23
|
scrollLeft: (node: Element, val?: number | undefined) => number;
|
|
24
|
-
getOffset: (node: Element) => {
|
|
24
|
+
getOffset: (node: Element | null) => {
|
|
25
25
|
top: number;
|
|
26
26
|
left: number;
|
|
27
27
|
height: number;
|
|
@@ -42,7 +42,7 @@ declare const DOMHelper: {
|
|
|
42
42
|
isFocusable: typeof helpers.isFocusable;
|
|
43
43
|
getStyle: (node: Element, property?: string | undefined) => string | CSSStyleDeclaration;
|
|
44
44
|
removeStyle: (node: Element, keys: string | string[]) => void;
|
|
45
|
-
addStyle: (node: Element, property: string | import("dom-lib/esm/addStyle").CSSProperty
|
|
45
|
+
addStyle: (node: Element, property: string | Partial<import("dom-lib/esm/addStyle").CSSProperty>, value?: string | number | undefined) => void;
|
|
46
46
|
translateDOMPositionXY: (style: CSSStyleDeclaration, x?: number | undefined, y?: number | undefined) => CSSStyleDeclaration;
|
|
47
47
|
};
|
|
48
48
|
export default DOMHelper;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RangeType } from './Toolbar';
|
|
3
3
|
import { DatePickerLocale } from '../locales';
|
|
4
|
+
import { PickerToggleProps } from '../Picker';
|
|
4
5
|
import { FormControlBaseProps, PickerBaseProps, RsRefForwardingComponent } from '../@types/common';
|
|
5
6
|
export type { RangeType } from './Toolbar';
|
|
6
|
-
export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, FormControlBaseProps<Date | null> {
|
|
7
|
+
export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, FormControlBaseProps<Date | null>, Pick<PickerToggleProps, 'caretAs' | 'readOnly' | 'plaintext'> {
|
|
7
8
|
/** Configure shortcut options */
|
|
8
9
|
ranges?: RangeType<Date>[];
|
|
9
10
|
/** Calendar panel default presentation date and time */
|
|
@@ -68,6 +68,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
68
68
|
showWeekNumbers = props.showWeekNumbers,
|
|
69
69
|
style = props.style,
|
|
70
70
|
toggleAs = props.toggleAs,
|
|
71
|
+
caretAsProp = props.caretAs,
|
|
71
72
|
disabledDateProp = props.disabledDate,
|
|
72
73
|
renderValue = props.renderValue,
|
|
73
74
|
onChange = props.onChange,
|
|
@@ -83,7 +84,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
83
84
|
onSelect = props.onSelect,
|
|
84
85
|
onToggleMonthDropdown = props.onToggleMonthDropdown,
|
|
85
86
|
onToggleTimeDropdown = props.onToggleTimeDropdown,
|
|
86
|
-
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "className", "classPrefix", "calendarDefaultDate", "cleanable", "defaultValue", "disabled", "format", "isoWeek", "limitEndYear", "locale", "menuClassName", "appearance", "placement", "oneTap", "placeholder", "ranges", "value", "showMeridian", "showWeekNumbers", "style", "toggleAs", "disabledDate", "renderValue", "onChange", "onChangeCalendarDate", "onClean", "onClose", "onEntered", "onExited", "onNextMonth", "onOk", "onOpen", "onPrevMonth", "onSelect", "onToggleMonthDropdown", "onToggleTimeDropdown"]);
|
|
87
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "className", "classPrefix", "calendarDefaultDate", "cleanable", "defaultValue", "disabled", "format", "isoWeek", "limitEndYear", "locale", "menuClassName", "appearance", "placement", "oneTap", "placeholder", "ranges", "value", "showMeridian", "showWeekNumbers", "style", "toggleAs", "caretAs", "disabledDate", "renderValue", "onChange", "onChangeCalendarDate", "onClean", "onClose", "onEntered", "onExited", "onNextMonth", "onOk", "onOpen", "onPrevMonth", "onSelect", "onToggleMonthDropdown", "onToggleTimeDropdown"]);
|
|
87
88
|
|
|
88
89
|
var _useCustom = (0, _utils.useCustom)('DatePicker', overrideLocale),
|
|
89
90
|
locale = _useCustom.locale,
|
|
@@ -152,15 +153,6 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
152
153
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(nextValue, event);
|
|
153
154
|
onChangeCalendarDate === null || onChangeCalendarDate === void 0 ? void 0 : onChangeCalendarDate(nextValue, event);
|
|
154
155
|
}, [onChangeCalendarDate, onSelect]);
|
|
155
|
-
/**
|
|
156
|
-
* A callback triggered when the date on the calendar changes.
|
|
157
|
-
*/
|
|
158
|
-
|
|
159
|
-
var handleChangePageDate = (0, _react.useCallback)(function (nextPageDate) {
|
|
160
|
-
setCalendarDate(nextPageDate);
|
|
161
|
-
reset();
|
|
162
|
-
handleDateChange(nextPageDate);
|
|
163
|
-
}, [handleDateChange, reset, setCalendarDate]);
|
|
164
156
|
/**
|
|
165
157
|
* A callback triggered when the time on the calendar changes.
|
|
166
158
|
*/
|
|
@@ -288,6 +280,21 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
288
280
|
updateValue(event, nextValue);
|
|
289
281
|
}
|
|
290
282
|
}, [formatStr, handleDateChange, oneTap, calendarDate, setCalendarDate, updateValue]);
|
|
283
|
+
/**
|
|
284
|
+
* A callback triggered when the date on the calendar changes.
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
var handleChangePageDate = (0, _react.useCallback)(function (nextPageDate, event) {
|
|
288
|
+
setCalendarDate(nextPageDate);
|
|
289
|
+
reset();
|
|
290
|
+
handleDateChange(nextPageDate); // Show only the calendar month panel. formatStr = 'yyyy-MM'
|
|
291
|
+
|
|
292
|
+
var onlyShowMonth = _utils.DateUtils.shouldMonth(formatStr) && !_utils.DateUtils.shouldDate(formatStr);
|
|
293
|
+
|
|
294
|
+
if (oneTap && onlyShowMonth) {
|
|
295
|
+
updateValue(event, nextPageDate);
|
|
296
|
+
}
|
|
297
|
+
}, [formatStr, handleDateChange, oneTap, reset, setCalendarDate, updateValue]);
|
|
291
298
|
var disabledDate = (0, _react.useCallback)(function (date) {
|
|
292
299
|
var _disabledDateProp;
|
|
293
300
|
|
|
@@ -439,8 +446,8 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
439
446
|
return (_renderValue = renderValue === null || renderValue === void 0 ? void 0 : renderValue(value, formatStr)) !== null && _renderValue !== void 0 ? _renderValue : formatDate(value, formatStr);
|
|
440
447
|
}, [formatStr, formatDate, placeholder, renderValue, value]);
|
|
441
448
|
var caretAs = (0, _react.useMemo)(function () {
|
|
442
|
-
return _utils.DateUtils.shouldOnlyTime(formatStr) ? _ClockO.default : _Calendar.default;
|
|
443
|
-
}, [formatStr]);
|
|
449
|
+
return caretAsProp || (_utils.DateUtils.shouldOnlyTime(formatStr) ? _ClockO.default : _Calendar.default);
|
|
450
|
+
}, [caretAsProp, formatStr]);
|
|
444
451
|
return /*#__PURE__*/_react.default.createElement(_Picker.PickerToggleTrigger, {
|
|
445
452
|
trigger: "active",
|
|
446
453
|
pickerProps: (0, _pick.default)(props, _Picker.pickTriggerPropKeys),
|
|
@@ -114,22 +114,8 @@ var Calendar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
114
114
|
return !after;
|
|
115
115
|
}, [calendarDate, index, showOneCalendar]);
|
|
116
116
|
var disabledMonth = (0, _react.useCallback)(function (date) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (disabledDate !== null && disabledDate !== void 0 && disabledDate(date, value, _utils.DATERANGE_DISABLED_TARGET.CALENDAR)) {
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (showOneCalendar) return false;
|
|
124
|
-
|
|
125
|
-
if (index === 1) {
|
|
126
|
-
after = (0, _dateUtils.isAfter)(date, calendarDate[0]);
|
|
127
|
-
return !after;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
after = (0, _dateUtils.isAfter)(calendarDate[1], date);
|
|
131
|
-
return !after;
|
|
132
|
-
}, [calendarDate, disabledDate, index, showOneCalendar, value]);
|
|
117
|
+
return disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date, value, _utils.DATERANGE_DISABLED_TARGET.CALENDAR);
|
|
118
|
+
}, [disabledDate, value]);
|
|
133
119
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, {
|
|
134
120
|
format: format,
|
|
135
121
|
calendarState: calendarState,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormControlBaseProps, PickerBaseProps } from '../@types/common';
|
|
3
|
-
import { PickerComponent } from '../Picker';
|
|
3
|
+
import { PickerComponent, PickerToggleProps } from '../Picker';
|
|
4
4
|
import { DisabledDateFunction, RangeType, DateRange } from './types';
|
|
5
|
-
export interface DateRangePickerProps extends PickerBaseProps, FormControlBaseProps<DateRange | null> {
|
|
5
|
+
export interface DateRangePickerProps extends PickerBaseProps, FormControlBaseProps<DateRange | null>, Pick<PickerToggleProps, 'caretAs' | 'readOnly' | 'plaintext'> {
|
|
6
6
|
/** Configure shortcut options */
|
|
7
7
|
ranges?: RangeType[];
|
|
8
8
|
/** Format date */
|
|
@@ -82,6 +82,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
82
82
|
showMeridian = props.showMeridian,
|
|
83
83
|
style = props.style,
|
|
84
84
|
toggleAs = props.toggleAs,
|
|
85
|
+
caretAs = props.caretAs,
|
|
85
86
|
valueProp = props.value,
|
|
86
87
|
onChange = props.onChange,
|
|
87
88
|
onClean = props.onClean,
|
|
@@ -92,7 +93,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
92
93
|
onOk = props.onOk,
|
|
93
94
|
onOpen = props.onOpen,
|
|
94
95
|
onSelect = props.onSelect,
|
|
95
|
-
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "classPrefix", "className", "appearance", "cleanable", "character", "defaultCalendarValue", "defaultValue", "disabled", "disabledDate", "format", "hoverRange", "isoWeek", "limitEndYear", "locale", "menuClassName", "menuStyle", "oneTap", "placeholder", "placement", "ranges", "renderValue", "showOneCalendar", "showWeekNumbers", "showMeridian", "style", "toggleAs", "value", "onChange", "onClean", "onClose", "onEnter", "onEntered", "onExited", "onOk", "onOpen", "onSelect"]);
|
|
96
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "classPrefix", "className", "appearance", "cleanable", "character", "defaultCalendarValue", "defaultValue", "disabled", "disabledDate", "format", "hoverRange", "isoWeek", "limitEndYear", "locale", "menuClassName", "menuStyle", "oneTap", "placeholder", "placement", "ranges", "renderValue", "showOneCalendar", "showWeekNumbers", "showMeridian", "style", "toggleAs", "caretAs", "value", "onChange", "onClean", "onClose", "onEnter", "onEntered", "onExited", "onOk", "onOpen", "onSelect"]);
|
|
96
97
|
|
|
97
98
|
var _useClassNames = (0, _utils.useClassNames)(classPrefix),
|
|
98
99
|
merge = _useClassNames.merge,
|
|
@@ -276,7 +277,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
276
277
|
|
|
277
278
|
if (!hasDoneSelect.current) {
|
|
278
279
|
// If `hoverRange` is set, you need to change the value of hoverDateRange according to the rules
|
|
279
|
-
if (!(0, _isNil.default)(nextHoverDateRange)) {
|
|
280
|
+
if (!(0, _isNil.default)(nextHoverDateRange) && !(0, _isNil.default)(selectRangeValueRef.current)) {
|
|
280
281
|
var nextSelectedDates = [selectRangeValueRef.current[0], nextHoverDateRange[1]];
|
|
281
282
|
|
|
282
283
|
if (_utils.DateUtils.isBefore(nextHoverDateRange[0], selectRangeValueRef.current[0])) {
|
|
@@ -632,8 +633,8 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
632
633
|
hasValue: hasValue,
|
|
633
634
|
active: isPickerToggleActive,
|
|
634
635
|
placement: placement,
|
|
635
|
-
|
|
636
|
-
|
|
636
|
+
disabled: disabled,
|
|
637
|
+
caretAs: caretAs || _Calendar.default
|
|
637
638
|
}), getDisplayString(value))));
|
|
638
639
|
});
|
|
639
640
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ButtonProps } from '../Button';
|
|
3
2
|
import { IconProps } from '@rsuite/icons/lib/Icon';
|
|
3
|
+
import { RsRefForwardingComponent } from '../@types/common';
|
|
4
|
+
import Button, { ButtonProps } from '../Button';
|
|
4
5
|
export interface IconButtonProps extends ButtonProps {
|
|
5
6
|
/** Set the icon */
|
|
6
7
|
icon?: React.ReactElement<IconProps>;
|
|
@@ -9,5 +10,7 @@ export interface IconButtonProps extends ButtonProps {
|
|
|
9
10
|
/** The placement of icon */
|
|
10
11
|
placement?: 'left' | 'right';
|
|
11
12
|
}
|
|
12
|
-
declare const IconButton:
|
|
13
|
+
declare const IconButton: RsRefForwardingComponent<typeof Button, IconButtonProps & {
|
|
14
|
+
ref?: React.Ref<HTMLElement>;
|
|
15
|
+
}>;
|
|
13
16
|
export default IconButton;
|
|
@@ -13,10 +13,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
|
|
16
|
-
var _Button = _interopRequireDefault(require("../Button"));
|
|
17
|
-
|
|
18
16
|
var _utils = require("../utils");
|
|
19
17
|
|
|
18
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
19
|
+
|
|
20
20
|
var IconButton = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
21
21
|
var icon = props.icon,
|
|
22
22
|
_props$placement = props.placement,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
8
|
+
|
|
9
|
+
var Link = function Link(_ref) {
|
|
10
|
+
var to = _ref.to;
|
|
11
|
+
return /*#__PURE__*/_react.default.createElement("a", {
|
|
12
|
+
href: to
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var ref = /*#__PURE__*/_react.default.createRef(); // Infer `as` component props
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/*#__PURE__*/
|
|
20
|
+
_react.default.createElement(_IconButton.default, {
|
|
21
|
+
ref: ref,
|
|
22
|
+
as: Link,
|
|
23
|
+
to: "/home"
|
|
24
|
+
});
|
|
@@ -128,7 +128,9 @@ var InputAutosize = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
if (sizerRef.current) {
|
|
132
|
+
copyStyles(inputStyles, sizerRef.current);
|
|
133
|
+
}
|
|
132
134
|
|
|
133
135
|
if (placeholderRef.current) {
|
|
134
136
|
copyStyles(inputStyles, placeholderRef.current);
|