rsuite 5.46.0 → 5.46.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 +8 -0
- package/cjs/Calendar/Table.js +2 -1
- package/cjs/Calendar/TableRow.d.ts +1 -0
- package/cjs/Calendar/TableRow.js +10 -4
- package/cjs/RangeSlider/RangeSlider.js +14 -6
- package/cjs/Slider/Slider.js +7 -3
- package/cjs/Table/Table.d.ts +3 -3
- package/dist/rsuite-no-reset-rtl.css +2 -2
- 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 +2 -2
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +2 -2
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +2 -2
- package/dist/rsuite.js +5 -5
- 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/Calendar/Table.js +2 -1
- package/esm/Calendar/TableRow.d.ts +1 -0
- package/esm/Calendar/TableRow.js +10 -4
- package/esm/RangeSlider/RangeSlider.js +14 -6
- package/esm/Slider/Slider.js +7 -3
- package/esm/Table/Table.d.ts +3 -3
- package/package.json +2 -2
- package/styles/color-modes/dark.less +1 -1
- package/styles/color-modes/high-contrast.less +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [5.46.1](https://github.com/rsuite/rsuite/compare/v5.46.0...v5.46.1) (2023-12-01)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **Calendar:** fix incorrect week numbers calculation ([#3471](https://github.com/rsuite/rsuite/issues/3471)) ([646e728](https://github.com/rsuite/rsuite/commit/646e72874595ee7c0a8d8596175c974ff67e146a))
|
|
6
|
+
- **CSS:** fix CSS calc syntax compatibility issue ([#3474](https://github.com/rsuite/rsuite/issues/3474)) ([88021ee](https://github.com/rsuite/rsuite/commit/88021eeaa0f7e720f6511616c0e2413570700159))
|
|
7
|
+
- **Slider,RangeSlider:** fix onChangeCommitted not triggered when the… ([#3472](https://github.com/rsuite/rsuite/issues/3472)) ([18a6e17](https://github.com/rsuite/rsuite/commit/18a6e17417bcb516701340b335c10ee3c7efa15a))
|
|
8
|
+
|
|
1
9
|
# [5.46.0](https://github.com/rsuite/rsuite/compare/v5.45.0...v5.46.0) (2023-11-24)
|
|
2
10
|
|
|
3
11
|
### Bug Fixes
|
package/cjs/Calendar/Table.js
CHANGED
|
@@ -32,7 +32,8 @@ var Table = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
32
32
|
}), /*#__PURE__*/_react.default.createElement(_TableHeaderRow.default, null), rows.map(function (week, index) {
|
|
33
33
|
return /*#__PURE__*/_react.default.createElement(_TableRow.default, {
|
|
34
34
|
key: index,
|
|
35
|
-
weekendDate: week
|
|
35
|
+
weekendDate: week,
|
|
36
|
+
rowIndex: index + 1
|
|
36
37
|
});
|
|
37
38
|
}));
|
|
38
39
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RsRefForwardingComponent, WithAsProps } from '../@types/common';
|
|
2
2
|
export interface TableRowProps extends WithAsProps {
|
|
3
3
|
weekendDate?: Date;
|
|
4
|
+
rowIndex?: number;
|
|
4
5
|
}
|
|
5
6
|
declare const TableRow: RsRefForwardingComponent<'div', TableRowProps>;
|
|
6
7
|
export default TableRow;
|
package/cjs/Calendar/TableRow.js
CHANGED
|
@@ -21,7 +21,8 @@ var TableRow = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
21
21
|
classPrefix = _props$classPrefix === void 0 ? 'calendar-table' : _props$classPrefix,
|
|
22
22
|
_props$weekendDate = props.weekendDate,
|
|
23
23
|
weekendDate = _props$weekendDate === void 0 ? new Date() : _props$weekendDate,
|
|
24
|
-
|
|
24
|
+
rowIndex = props.rowIndex,
|
|
25
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "className", "classPrefix", "weekendDate", "rowIndex"]);
|
|
25
26
|
var _useCalendarContext = (0, _CalendarContext.useCalendarContext)(),
|
|
26
27
|
_useCalendarContext$d = _useCalendarContext.date,
|
|
27
28
|
selected = _useCalendarContext$d === void 0 ? new Date() : _useCalendarContext$d,
|
|
@@ -95,14 +96,19 @@ var TableRow = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
95
96
|
return days;
|
|
96
97
|
};
|
|
97
98
|
var classes = merge(className, prefix('row'));
|
|
99
|
+
var week = (0, _dateUtils.format)(weekendDate, isoWeek ? 'I' : 'w', {
|
|
100
|
+
firstWeekContainsDate: 4
|
|
101
|
+
});
|
|
98
102
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, {
|
|
99
103
|
ref: ref,
|
|
100
104
|
role: "row",
|
|
105
|
+
"aria-rowindex": rowIndex,
|
|
101
106
|
className: classes
|
|
102
107
|
}), showWeekNumbers && /*#__PURE__*/_react.default.createElement("div", {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
role: "rowheader",
|
|
109
|
+
"aria-label": "Week " + week,
|
|
110
|
+
className: prefix('cell-week-number')
|
|
111
|
+
}, week), renderDays());
|
|
106
112
|
});
|
|
107
113
|
TableRow.displayName = 'CalendarTableRow';
|
|
108
114
|
TableRow.propTypes = {
|
|
@@ -36,6 +36,7 @@ var RangeSlider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
36
36
|
progress = _props$progress === void 0 ? true : _props$progress,
|
|
37
37
|
vertical = props.vertical,
|
|
38
38
|
disabled = props.disabled,
|
|
39
|
+
readOnly = props.readOnly,
|
|
39
40
|
_props$classPrefix = props.classPrefix,
|
|
40
41
|
classPrefix = _props$classPrefix === void 0 ? 'slider' : _props$classPrefix,
|
|
41
42
|
_props$min = props.min,
|
|
@@ -55,7 +56,7 @@ var RangeSlider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
55
56
|
renderMark = props.renderMark,
|
|
56
57
|
onChange = props.onChange,
|
|
57
58
|
onChangeCommitted = props.onChangeCommitted,
|
|
58
|
-
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["aria-label", "aria-labelledby", "aria-valuetext", "as", "barClassName", "className", "constraint", "defaultValue", "graduated", "progress", "vertical", "disabled", "classPrefix", "min", "max", "step", "value", "handleClassName", "handleStyle", "handleTitle", "tooltip", "getAriaValueText", "renderTooltip", "renderMark", "onChange", "onChangeCommitted"]);
|
|
59
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["aria-label", "aria-labelledby", "aria-valuetext", "as", "barClassName", "className", "constraint", "defaultValue", "graduated", "progress", "vertical", "disabled", "readOnly", "classPrefix", "min", "max", "step", "value", "handleClassName", "handleStyle", "handleTitle", "tooltip", "getAriaValueText", "renderTooltip", "renderMark", "onChange", "onChangeCommitted"]);
|
|
59
60
|
var barRef = (0, _react.useRef)(null);
|
|
60
61
|
|
|
61
62
|
// Define the parameter position of the handle
|
|
@@ -168,6 +169,9 @@ var RangeSlider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
168
169
|
* Callback function that is fired when the mousemove is triggered
|
|
169
170
|
*/
|
|
170
171
|
var handleDragMove = (0, _utils.useEventCallback)(function (event, dataset) {
|
|
172
|
+
if (disabled || readOnly) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
171
175
|
var nextValue = getNextValue(event, dataset);
|
|
172
176
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
173
177
|
setValue(nextValue);
|
|
@@ -179,12 +183,15 @@ var RangeSlider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
179
183
|
* Callback function that is fired when the mouseup is triggered
|
|
180
184
|
*/
|
|
181
185
|
var handleChangeCommitted = (0, _react.useCallback)(function (event, dataset) {
|
|
186
|
+
if (disabled || readOnly) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
182
189
|
var nextValue = getNextValue(event, dataset);
|
|
183
190
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
184
191
|
setValue(nextValue);
|
|
185
192
|
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
186
193
|
}
|
|
187
|
-
}, [
|
|
194
|
+
}, [disabled, readOnly, getNextValue, isRangeMatchingConstraint, setValue, onChangeCommitted]);
|
|
188
195
|
var handleKeyDown = (0, _react.useCallback)(function (event) {
|
|
189
196
|
var _event$target;
|
|
190
197
|
var _event$target$dataset = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target['dataset'],
|
|
@@ -225,8 +232,8 @@ var RangeSlider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
225
232
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue, event);
|
|
226
233
|
}
|
|
227
234
|
}, [max, min, onChange, rtl, isRangeMatchingConstraint, setValue, step, value]);
|
|
228
|
-
var
|
|
229
|
-
if (disabled) {
|
|
235
|
+
var handleBarClick = (0, _react.useCallback)(function (event) {
|
|
236
|
+
if (disabled || readOnly) {
|
|
230
237
|
return;
|
|
231
238
|
}
|
|
232
239
|
var start = value[0],
|
|
@@ -245,8 +252,9 @@ var RangeSlider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
245
252
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
246
253
|
setValue(nextValue);
|
|
247
254
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue, event);
|
|
255
|
+
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
248
256
|
}
|
|
249
|
-
}, [disabled, getValidValue, getValueByPosition, isRangeMatchingConstraint, onChange, setValue, value]);
|
|
257
|
+
}, [disabled, readOnly, getValidValue, getValueByPosition, isRangeMatchingConstraint, onChange, onChangeCommitted, setValue, value]);
|
|
250
258
|
var handleProps = (0, _react.useMemo)(function () {
|
|
251
259
|
return [{
|
|
252
260
|
value: value[0],
|
|
@@ -287,7 +295,7 @@ var RangeSlider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
287
295
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
288
296
|
className: merge(barClassName, prefix('bar')),
|
|
289
297
|
ref: barRef,
|
|
290
|
-
onClick:
|
|
298
|
+
onClick: handleBarClick
|
|
291
299
|
}, progress && /*#__PURE__*/_react.default.createElement(_ProgressBar.default, {
|
|
292
300
|
rtl: rtl,
|
|
293
301
|
vertical: vertical,
|
package/cjs/Slider/Slider.js
CHANGED
|
@@ -90,9 +90,9 @@ var Slider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
90
90
|
var classes = merge(className, withClassPrefix({
|
|
91
91
|
vertical: vertical,
|
|
92
92
|
disabled: disabled,
|
|
93
|
-
readOnly: readOnly,
|
|
94
93
|
graduated: graduated,
|
|
95
|
-
'with-mark': renderMark
|
|
94
|
+
'with-mark': renderMark,
|
|
95
|
+
readonly: readOnly
|
|
96
96
|
}));
|
|
97
97
|
var max = (0, _react.useMemo)(function () {
|
|
98
98
|
return (0, _utils2.precisionMath)(Math.floor((maxProp - min) / step) * step + min);
|
|
@@ -166,6 +166,10 @@ var Slider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
166
166
|
var nextValue = getValidValue(getValueByPosition(event));
|
|
167
167
|
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
168
168
|
}, [disabled, getValidValue, getValueByPosition, onChangeCommitted, readOnly]);
|
|
169
|
+
var handleClickBar = (0, _react.useCallback)(function (event) {
|
|
170
|
+
handleChangeValue(event);
|
|
171
|
+
handleChangeCommitted(event);
|
|
172
|
+
}, [handleChangeCommitted, handleChangeValue]);
|
|
169
173
|
var handleKeyDown = (0, _react.useCallback)(function (event) {
|
|
170
174
|
var nextValue;
|
|
171
175
|
var increaseKey = rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
@@ -207,7 +211,7 @@ var Slider = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
207
211
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
208
212
|
ref: barRef,
|
|
209
213
|
className: merge(barClassName, prefix('bar')),
|
|
210
|
-
onClick:
|
|
214
|
+
onClick: handleClickBar
|
|
211
215
|
}, progress && /*#__PURE__*/_react.default.createElement(_ProgressBar.default, {
|
|
212
216
|
rtl: rtl,
|
|
213
217
|
vertical: vertical,
|
package/cjs/Table/Table.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export interface CellProps<Row extends RowDataType> extends Omit<TableCellProps<
|
|
|
6
6
|
/** Row Data */
|
|
7
7
|
rowData?: Row;
|
|
8
8
|
}
|
|
9
|
-
declare const _default: (<Row extends RowDataType<
|
|
10
|
-
Cell: <Row_1 extends RowDataType<
|
|
9
|
+
declare const _default: (<Row extends RowDataType<any>, Key extends RowKeyType>(props: TableProps<Row, Key> & React.RefAttributes<TableInstance<Row, Key>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
10
|
+
Cell: <Row_1 extends RowDataType<any>, Key_1 extends RowKeyType>(props: import("rsuite-table/lib/Cell").InnerCellProps<Row_1, Key_1> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
11
11
|
Column: typeof Column;
|
|
12
|
-
HeaderCell: <Row_2 extends RowDataType<
|
|
12
|
+
HeaderCell: <Row_2 extends RowDataType<any>, Key_2 extends RowKeyType>(props: import("rsuite-table").HeaderCellProps<Row_2, Key_2> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
13
|
ColumnGroup: React.ForwardRefExoticComponent<import("rsuite-table").ColumnGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
};
|
|
15
15
|
export default _default;
|
|
@@ -538,7 +538,7 @@
|
|
|
538
538
|
--rs-progress-bar-success: var(--rs-color-green);
|
|
539
539
|
--rs-progress-bar-fail: var(--rs-color-red);
|
|
540
540
|
--rs-placeholder: var(--rs-gray-600);
|
|
541
|
-
--rs-placeholder-active:
|
|
541
|
+
--rs-placeholder-active: var(--rs-gray-500);
|
|
542
542
|
--rs-breadcrumb-item-active-text: #fff;
|
|
543
543
|
--rs-dropdown-divider: var(--rs-gray-600);
|
|
544
544
|
--rs-dropdown-item-bg-hover: var(--rs-gray-600);
|
|
@@ -880,7 +880,7 @@
|
|
|
880
880
|
--rs-progress-bar-success: var(--rs-color-green);
|
|
881
881
|
--rs-progress-bar-fail: var(--rs-color-red);
|
|
882
882
|
--rs-placeholder: var(--rs-gray-600);
|
|
883
|
-
--rs-placeholder-active:
|
|
883
|
+
--rs-placeholder-active: var(--rs-gray-500);
|
|
884
884
|
--rs-breadcrumb-item-active-text: #fff;
|
|
885
885
|
--rs-dropdown-divider: var(--rs-gray-600);
|
|
886
886
|
--rs-dropdown-item-bg-hover: var(--rs-gray-600);
|