rsuite 5.33.1 → 5.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/DatePicker/styles/index.less +1 -0
- package/Timeline/styles/index.less +1 -1
- package/cjs/Timeline/Timeline.d.ts +9 -0
- package/cjs/Timeline/Timeline.js +12 -1
- package/cjs/Timeline/TimelineItem.d.ts +18 -1
- package/cjs/Timeline/TimelineItem.js +5 -3
- package/cjs/Windowing/List.js +11 -2
- package/dist/rsuite-no-reset-rtl.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +1 -1
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +1 -1
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +1 -1
- package/dist/rsuite.js +3 -3
- 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/Timeline/Timeline.d.ts +9 -0
- package/esm/Timeline/Timeline.js +13 -1
- package/esm/Timeline/TimelineItem.d.ts +18 -1
- package/esm/Timeline/TimelineItem.js +5 -3
- package/esm/Windowing/List.js +12 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# [5.34.0](https://github.com/rsuite/rsuite/compare/v5.33.1...v5.34.0) (2023-05-19)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **DatePicker:** added stack styles to datepicker styles ([#3195](https://github.com/rsuite/rsuite/issues/3195)) ([b3ed580](https://github.com/rsuite/rsuite/commit/b3ed580867db2e5205e71475c593e7d17ff04b49))
|
|
6
|
+
- **SelectPicker:** prevent error when listProps.itemSize is a number ([#3193](https://github.com/rsuite/rsuite/issues/3193)) ([151df47](https://github.com/rsuite/rsuite/commit/151df474b15ab4651d4ee5777b66018e58837816))
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **Timeline:** add isItemActive prop ([#3198](https://github.com/rsuite/rsuite/issues/3198)) ([377930f](https://github.com/rsuite/rsuite/commit/377930f3498c59834a424417c136499866aacec2))
|
|
11
|
+
|
|
1
12
|
## [5.33.1](https://github.com/rsuite/rsuite/compare/v5.33.0...v5.33.1) (2023-05-12)
|
|
2
13
|
|
|
3
14
|
### Bug Fixes
|
|
@@ -8,9 +8,18 @@ export interface TimelineProps extends WithAsProps {
|
|
|
8
8
|
align?: 'left' | 'right' | 'alternate';
|
|
9
9
|
/** Timeline endless **/
|
|
10
10
|
endless?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether an item is active (with highlighted dot).
|
|
13
|
+
*
|
|
14
|
+
* @default
|
|
15
|
+
* The last item is marked active.
|
|
16
|
+
*/
|
|
17
|
+
isItemActive?: (index: number, totalItemsCount: number) => boolean;
|
|
11
18
|
}
|
|
12
19
|
interface TimelineComponent extends RsRefForwardingComponent<'div', TimelineProps> {
|
|
13
20
|
Item: typeof TimelineItem;
|
|
21
|
+
ACTIVE_FIRST: (index: number, totalItemsCount: number) => boolean;
|
|
22
|
+
ACTIVE_LAST: (index: number, totalItemsCount: number) => boolean;
|
|
14
23
|
}
|
|
15
24
|
declare const Timeline: TimelineComponent;
|
|
16
25
|
export default Timeline;
|
package/cjs/Timeline/Timeline.js
CHANGED
|
@@ -29,7 +29,9 @@ var Timeline = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
29
29
|
_props$align = props.align,
|
|
30
30
|
align = _props$align === void 0 ? 'left' : _props$align,
|
|
31
31
|
endless = props.endless,
|
|
32
|
-
|
|
32
|
+
_props$isItemActive = props.isItemActive,
|
|
33
|
+
isItemActive = _props$isItemActive === void 0 ? Timeline.ACTIVE_LAST : _props$isItemActive,
|
|
34
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["children", "as", "classPrefix", "className", "align", "endless", "isItemActive"]);
|
|
33
35
|
|
|
34
36
|
var _useClassNames = (0, _utils.useClassNames)(classPrefix),
|
|
35
37
|
merge = _useClassNames.merge,
|
|
@@ -52,11 +54,20 @@ var Timeline = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
52
54
|
}), _utils.ReactChildren.mapCloneElement(children, function (_child, index) {
|
|
53
55
|
return {
|
|
54
56
|
last: index + 1 === count,
|
|
57
|
+
INTERNAL_active: isItemActive(index, count),
|
|
55
58
|
align: align
|
|
56
59
|
};
|
|
57
60
|
}));
|
|
58
61
|
});
|
|
59
62
|
|
|
63
|
+
Timeline.ACTIVE_FIRST = function (index) {
|
|
64
|
+
return index === 0;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
Timeline.ACTIVE_LAST = function (index, totalItemsCount) {
|
|
68
|
+
return index === totalItemsCount - 1;
|
|
69
|
+
};
|
|
70
|
+
|
|
60
71
|
Timeline.Item = _TimelineItem.default;
|
|
61
72
|
Timeline.displayName = 'Timeline';
|
|
62
73
|
Timeline.propTypes = {
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithAsProps, RsRefForwardingComponent } from '../@types/common';
|
|
3
3
|
export interface TimelineItemProps extends WithAsProps {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Whether the last item
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
* This props is supposed to be used only by Timeline component internally
|
|
9
|
+
* User should never rely on this prop
|
|
10
|
+
*
|
|
11
|
+
* @deprecated
|
|
12
|
+
* This prop was used to indicate whether an item is the last item so that it gets highlighted.
|
|
13
|
+
* Now we can specify whether an item should be highlighted individually.
|
|
14
|
+
* Use {@link INTERNAL_active} instead
|
|
15
|
+
*/
|
|
5
16
|
last?: boolean;
|
|
6
17
|
/** Customizing the Timeline item */
|
|
7
18
|
dot?: React.ReactNode;
|
|
@@ -11,6 +22,12 @@ export interface TimelineItemProps extends WithAsProps {
|
|
|
11
22
|
as?: React.ElementType;
|
|
12
23
|
/** Customized time of timeline **/
|
|
13
24
|
time?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
* This props is supposed to be used only by Timeline component internally
|
|
28
|
+
* User should never rely on this prop
|
|
29
|
+
*/
|
|
30
|
+
INTERNAL_active?: boolean;
|
|
14
31
|
}
|
|
15
32
|
declare const TimelineItem: RsRefForwardingComponent<'div', TimelineItemProps>;
|
|
16
33
|
export default TimelineItem;
|
|
@@ -21,11 +21,12 @@ var TimelineItem = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
21
21
|
children = props.children,
|
|
22
22
|
_props$classPrefix = props.classPrefix,
|
|
23
23
|
classPrefix = _props$classPrefix === void 0 ? 'timeline-item' : _props$classPrefix,
|
|
24
|
-
|
|
24
|
+
DEPRECATED_last = props.last,
|
|
25
25
|
className = props.className,
|
|
26
26
|
dot = props.dot,
|
|
27
27
|
time = props.time,
|
|
28
|
-
|
|
28
|
+
INTERNAL_active = props.INTERNAL_active,
|
|
29
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "children", "classPrefix", "last", "className", "dot", "time", "INTERNAL_active"]);
|
|
29
30
|
|
|
30
31
|
var _useClassNames = (0, _utils.useClassNames)(classPrefix),
|
|
31
32
|
merge = _useClassNames.merge,
|
|
@@ -33,7 +34,8 @@ var TimelineItem = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
33
34
|
prefix = _useClassNames.prefix;
|
|
34
35
|
|
|
35
36
|
var classes = merge(className, withClassPrefix({
|
|
36
|
-
last:
|
|
37
|
+
last: DEPRECATED_last,
|
|
38
|
+
active: INTERNAL_active
|
|
37
39
|
}));
|
|
38
40
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, {
|
|
39
41
|
ref: ref,
|
package/cjs/Windowing/List.js
CHANGED
|
@@ -21,7 +21,8 @@ var List = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
21
21
|
var rowHeight = props.rowHeight,
|
|
22
22
|
_props$as = props.as,
|
|
23
23
|
Component = _props$as === void 0 ? _reactWindow.VariableSizeList : _props$as,
|
|
24
|
-
|
|
24
|
+
itemSizeProp = props.itemSize,
|
|
25
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["rowHeight", "as", "itemSize"]);
|
|
25
26
|
var listRef = (0, _react.useRef)(null);
|
|
26
27
|
|
|
27
28
|
var _useCustom = (0, _utils.useCustom)(),
|
|
@@ -56,7 +57,15 @@ var List = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
56
57
|
index: index
|
|
57
58
|
}) : rowHeight || 0;
|
|
58
59
|
}, [rowHeight]);
|
|
59
|
-
var
|
|
60
|
+
var itemSize = (0, _react.useMemo)(function () {
|
|
61
|
+
if (typeof itemSizeProp === 'function') return itemSizeProp;
|
|
62
|
+
return function () {
|
|
63
|
+
return itemSizeProp;
|
|
64
|
+
};
|
|
65
|
+
}, [itemSizeProp]);
|
|
66
|
+
var compatibleProps = (0, _extends2.default)({
|
|
67
|
+
itemSize: itemSize
|
|
68
|
+
}, rest);
|
|
60
69
|
|
|
61
70
|
if (rowHeight) {
|
|
62
71
|
compatibleProps.itemSize = Component === _reactWindow.VariableSizeList ? setRowHeight : rowHeight;
|
|
@@ -14770,7 +14770,7 @@ textarea.rs-picker-menu .rs-picker-search-bar .rs-picker-search-bar-input {
|
|
|
14770
14770
|
.rs-timeline-item-custom-dot::before {
|
|
14771
14771
|
display: none;
|
|
14772
14772
|
}
|
|
14773
|
-
.rs-timeline-item-
|
|
14773
|
+
.rs-timeline-item-active .rs-timeline-item-dot::before {
|
|
14774
14774
|
background-color: #3498ff;
|
|
14775
14775
|
background-color: var(--rs-timeline-indicator-active-bg);
|
|
14776
14776
|
}
|