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/esm/Calendar/Table.js
CHANGED
|
@@ -27,7 +27,8 @@ var Table = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
27
27
|
}), /*#__PURE__*/React.createElement(TableHeaderRow, null), rows.map(function (week, index) {
|
|
28
28
|
return /*#__PURE__*/React.createElement(TableRow, {
|
|
29
29
|
key: index,
|
|
30
|
-
weekendDate: week
|
|
30
|
+
weekendDate: week,
|
|
31
|
+
rowIndex: index + 1
|
|
31
32
|
});
|
|
32
33
|
}));
|
|
33
34
|
});
|
|
@@ -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/esm/Calendar/TableRow.js
CHANGED
|
@@ -15,7 +15,8 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
15
15
|
classPrefix = _props$classPrefix === void 0 ? 'calendar-table' : _props$classPrefix,
|
|
16
16
|
_props$weekendDate = props.weekendDate,
|
|
17
17
|
weekendDate = _props$weekendDate === void 0 ? new Date() : _props$weekendDate,
|
|
18
|
-
|
|
18
|
+
rowIndex = props.rowIndex,
|
|
19
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "weekendDate", "rowIndex"]);
|
|
19
20
|
var _useCalendarContext = useCalendarContext(),
|
|
20
21
|
_useCalendarContext$d = _useCalendarContext.date,
|
|
21
22
|
selected = _useCalendarContext$d === void 0 ? new Date() : _useCalendarContext$d,
|
|
@@ -89,14 +90,19 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
89
90
|
return days;
|
|
90
91
|
};
|
|
91
92
|
var classes = merge(className, prefix('row'));
|
|
93
|
+
var week = format(weekendDate, isoWeek ? 'I' : 'w', {
|
|
94
|
+
firstWeekContainsDate: 4
|
|
95
|
+
});
|
|
92
96
|
return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
93
97
|
ref: ref,
|
|
94
98
|
role: "row",
|
|
99
|
+
"aria-rowindex": rowIndex,
|
|
95
100
|
className: classes
|
|
96
101
|
}), showWeekNumbers && /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
role: "rowheader",
|
|
103
|
+
"aria-label": "Week " + week,
|
|
104
|
+
className: prefix('cell-week-number')
|
|
105
|
+
}, week), renderDays());
|
|
100
106
|
});
|
|
101
107
|
TableRow.displayName = 'CalendarTableRow';
|
|
102
108
|
TableRow.propTypes = {
|
|
@@ -30,6 +30,7 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
30
30
|
progress = _props$progress === void 0 ? true : _props$progress,
|
|
31
31
|
vertical = props.vertical,
|
|
32
32
|
disabled = props.disabled,
|
|
33
|
+
readOnly = props.readOnly,
|
|
33
34
|
_props$classPrefix = props.classPrefix,
|
|
34
35
|
classPrefix = _props$classPrefix === void 0 ? 'slider' : _props$classPrefix,
|
|
35
36
|
_props$min = props.min,
|
|
@@ -49,7 +50,7 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
49
50
|
renderMark = props.renderMark,
|
|
50
51
|
onChange = props.onChange,
|
|
51
52
|
onChangeCommitted = props.onChangeCommitted,
|
|
52
|
-
rest = _objectWithoutPropertiesLoose(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"]);
|
|
53
|
+
rest = _objectWithoutPropertiesLoose(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"]);
|
|
53
54
|
var barRef = useRef(null);
|
|
54
55
|
|
|
55
56
|
// Define the parameter position of the handle
|
|
@@ -162,6 +163,9 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
162
163
|
* Callback function that is fired when the mousemove is triggered
|
|
163
164
|
*/
|
|
164
165
|
var handleDragMove = useEventCallback(function (event, dataset) {
|
|
166
|
+
if (disabled || readOnly) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
165
169
|
var nextValue = getNextValue(event, dataset);
|
|
166
170
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
167
171
|
setValue(nextValue);
|
|
@@ -173,12 +177,15 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
173
177
|
* Callback function that is fired when the mouseup is triggered
|
|
174
178
|
*/
|
|
175
179
|
var handleChangeCommitted = useCallback(function (event, dataset) {
|
|
180
|
+
if (disabled || readOnly) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
176
183
|
var nextValue = getNextValue(event, dataset);
|
|
177
184
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
178
185
|
setValue(nextValue);
|
|
179
186
|
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
180
187
|
}
|
|
181
|
-
}, [
|
|
188
|
+
}, [disabled, readOnly, getNextValue, isRangeMatchingConstraint, setValue, onChangeCommitted]);
|
|
182
189
|
var handleKeyDown = useCallback(function (event) {
|
|
183
190
|
var _event$target;
|
|
184
191
|
var _event$target$dataset = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target['dataset'],
|
|
@@ -219,8 +226,8 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
219
226
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue, event);
|
|
220
227
|
}
|
|
221
228
|
}, [max, min, onChange, rtl, isRangeMatchingConstraint, setValue, step, value]);
|
|
222
|
-
var
|
|
223
|
-
if (disabled) {
|
|
229
|
+
var handleBarClick = useCallback(function (event) {
|
|
230
|
+
if (disabled || readOnly) {
|
|
224
231
|
return;
|
|
225
232
|
}
|
|
226
233
|
var start = value[0],
|
|
@@ -239,8 +246,9 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
239
246
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
240
247
|
setValue(nextValue);
|
|
241
248
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue, event);
|
|
249
|
+
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
242
250
|
}
|
|
243
|
-
}, [disabled, getValidValue, getValueByPosition, isRangeMatchingConstraint, onChange, setValue, value]);
|
|
251
|
+
}, [disabled, readOnly, getValidValue, getValueByPosition, isRangeMatchingConstraint, onChange, onChangeCommitted, setValue, value]);
|
|
244
252
|
var handleProps = useMemo(function () {
|
|
245
253
|
return [{
|
|
246
254
|
value: value[0],
|
|
@@ -281,7 +289,7 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
281
289
|
}), /*#__PURE__*/React.createElement("div", {
|
|
282
290
|
className: merge(barClassName, prefix('bar')),
|
|
283
291
|
ref: barRef,
|
|
284
|
-
onClick:
|
|
292
|
+
onClick: handleBarClick
|
|
285
293
|
}, progress && /*#__PURE__*/React.createElement(ProgressBar, {
|
|
286
294
|
rtl: rtl,
|
|
287
295
|
vertical: vertical,
|
package/esm/Slider/Slider.js
CHANGED
|
@@ -83,9 +83,9 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
83
83
|
var classes = merge(className, withClassPrefix({
|
|
84
84
|
vertical: vertical,
|
|
85
85
|
disabled: disabled,
|
|
86
|
-
readOnly: readOnly,
|
|
87
86
|
graduated: graduated,
|
|
88
|
-
'with-mark': renderMark
|
|
87
|
+
'with-mark': renderMark,
|
|
88
|
+
readonly: readOnly
|
|
89
89
|
}));
|
|
90
90
|
var max = useMemo(function () {
|
|
91
91
|
return precisionMath(Math.floor((maxProp - min) / step) * step + min);
|
|
@@ -159,6 +159,10 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
159
159
|
var nextValue = getValidValue(getValueByPosition(event));
|
|
160
160
|
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
161
161
|
}, [disabled, getValidValue, getValueByPosition, onChangeCommitted, readOnly]);
|
|
162
|
+
var handleClickBar = useCallback(function (event) {
|
|
163
|
+
handleChangeValue(event);
|
|
164
|
+
handleChangeCommitted(event);
|
|
165
|
+
}, [handleChangeCommitted, handleChangeValue]);
|
|
162
166
|
var handleKeyDown = useCallback(function (event) {
|
|
163
167
|
var nextValue;
|
|
164
168
|
var increaseKey = rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
@@ -200,7 +204,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
200
204
|
}), /*#__PURE__*/React.createElement("div", {
|
|
201
205
|
ref: barRef,
|
|
202
206
|
className: merge(barClassName, prefix('bar')),
|
|
203
|
-
onClick:
|
|
207
|
+
onClick: handleClickBar
|
|
204
208
|
}, progress && /*#__PURE__*/React.createElement(ProgressBar, {
|
|
205
209
|
rtl: rtl,
|
|
206
210
|
vertical: vertical,
|
package/esm/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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsuite",
|
|
3
|
-
"version": "5.46.
|
|
3
|
+
"version": "5.46.1",
|
|
4
4
|
"description": "A suite of react components",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prop-types": "^15.8.1",
|
|
39
39
|
"react-use-set": "^1.0.0",
|
|
40
40
|
"react-window": "^1.8.8",
|
|
41
|
-
"rsuite-table": "^5.18.
|
|
41
|
+
"rsuite-table": "^5.18.2",
|
|
42
42
|
"schema-typed": "^2.1.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
|
|
159
159
|
// Placeholder
|
|
160
160
|
--rs-placeholder: var(--rs-gray-600);
|
|
161
|
-
--rs-placeholder-active:
|
|
161
|
+
--rs-placeholder-active: var(--rs-gray-500);
|
|
162
162
|
|
|
163
163
|
// Breadcrumb
|
|
164
164
|
--rs-breadcrumb-item-active-text: #fff;
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
|
|
166
166
|
// Placeholder
|
|
167
167
|
--rs-placeholder: var(--rs-gray-600);
|
|
168
|
-
--rs-placeholder-active:
|
|
168
|
+
--rs-placeholder-active: var(--rs-gray-500);
|
|
169
169
|
|
|
170
170
|
// Breadcrumb
|
|
171
171
|
--rs-breadcrumb-item-active-text: #fff;
|