rsuite 5.83.0 → 5.83.2
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 +23 -0
- package/Stat/styles/index.css +12 -0
- package/Stat/styles/index.less +12 -0
- package/cjs/CustomProvider/useCustom.js +24 -7
- package/cjs/Progress/ProgressCircle.d.ts +2 -0
- package/cjs/Progress/ProgressCircle.js +5 -2
- package/cjs/Stat/StatTrend.d.ts +1 -1
- package/cjs/Stat/StatTrend.js +9 -2
- package/dist/rsuite-no-reset-rtl.css +12 -0
- 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 +12 -0
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +12 -0
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +12 -0
- package/dist/rsuite.js +275 -286
- 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.LICENSE.txt +0 -9
- package/dist/rsuite.min.js.map +1 -1
- package/esm/CustomProvider/useCustom.js +24 -7
- package/esm/Progress/ProgressCircle.d.ts +2 -0
- package/esm/Progress/ProgressCircle.js +5 -2
- package/esm/Stat/StatTrend.d.ts +1 -1
- package/esm/Stat/StatTrend.js +9 -2
- package/package.json +2 -2
|
@@ -10,12 +10,29 @@ import { CustomContext } from "./CustomContext.js";
|
|
|
10
10
|
function getDefaultRTL() {
|
|
11
11
|
return typeof document !== 'undefined' && (document.body.getAttribute('dir') || document.dir) === 'rtl';
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Maps a component name to its corresponding locale key
|
|
16
|
+
* @param componentName - The name of the component
|
|
17
|
+
* @returns The locale key for the component
|
|
18
|
+
*/
|
|
19
|
+
function getComponentLocaleKey(componentName) {
|
|
20
|
+
// Define mappings for components that share locale keys
|
|
21
|
+
var localeKeyMappings = {
|
|
22
|
+
// All picker components use the Combobox locale
|
|
23
|
+
Cascader: 'Combobox',
|
|
24
|
+
CheckTreePicker: 'Combobox',
|
|
25
|
+
MultiCascader: 'Combobox',
|
|
26
|
+
SelectPicker: 'Combobox',
|
|
27
|
+
TreePicker: 'Combobox',
|
|
28
|
+
CheckPicker: 'Combobox',
|
|
29
|
+
// Time components use date components locales
|
|
30
|
+
TimePicker: 'DatePicker',
|
|
31
|
+
TimeRangePicker: 'DateRangePicker'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Return the mapped locale key or the component name itself if no mapping exists
|
|
35
|
+
return localeKeyMappings[componentName] || componentName;
|
|
19
36
|
}
|
|
20
37
|
|
|
21
38
|
/**
|
|
@@ -63,7 +80,7 @@ export function useCustom(componentName, componentProps) {
|
|
|
63
80
|
//Memoize the global default props based on component name
|
|
64
81
|
var globalDefaultProps = ((_components$component = components[componentName]) === null || _components$component === void 0 ? void 0 : _components$component.defaultProps) || {};
|
|
65
82
|
var mergedProps = assign({}, globalDefaultProps, restProps);
|
|
66
|
-
var localeKey =
|
|
83
|
+
var localeKey = getComponentLocaleKey(componentName);
|
|
67
84
|
|
|
68
85
|
// If the default locale has the component name, then merge the locale.
|
|
69
86
|
if (Object.keys(enGB).includes(localeKey)) {
|
|
@@ -12,6 +12,8 @@ export interface ProgressCircleProps extends WithAsProps {
|
|
|
12
12
|
strokeWidth?: number;
|
|
13
13
|
/** Tail width */
|
|
14
14
|
trailWidth?: number;
|
|
15
|
+
/** Diameter of the circle */
|
|
16
|
+
width?: number;
|
|
15
17
|
/** Circular progress bar degree */
|
|
16
18
|
gapDegree?: number;
|
|
17
19
|
/** Circular progress bar Notch position */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
var _excluded = ["as", "strokeWidth", "trailWidth", "percent", "strokeLinecap", "className", "showInfo", "status", "classPrefix", "style", "gapDegree", "gapPosition", "trailColor", "strokeColor"];
|
|
4
|
+
var _excluded = ["as", "strokeWidth", "trailWidth", "width", "percent", "strokeLinecap", "className", "showInfo", "status", "classPrefix", "style", "gapDegree", "gapPosition", "trailColor", "strokeColor"];
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { PROGRESS_STATUS_ICON } from "../internals/constants/statusIcons.js";
|
|
@@ -22,6 +22,7 @@ var ProgressCircle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
22
22
|
strokeWidth = _propsWithDefaults$st === void 0 ? 6 : _propsWithDefaults$st,
|
|
23
23
|
_propsWithDefaults$tr = propsWithDefaults.trailWidth,
|
|
24
24
|
trailWidth = _propsWithDefaults$tr === void 0 ? 6 : _propsWithDefaults$tr,
|
|
25
|
+
width = propsWithDefaults.width,
|
|
25
26
|
_propsWithDefaults$pe = propsWithDefaults.percent,
|
|
26
27
|
percent = _propsWithDefaults$pe === void 0 ? 0 : _propsWithDefaults$pe,
|
|
27
28
|
_propsWithDefaults$st2 = propsWithDefaults.strokeLinecap,
|
|
@@ -110,7 +111,8 @@ var ProgressCircle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
110
111
|
className: prefix('circle-info')
|
|
111
112
|
}, info) : null, /*#__PURE__*/React.createElement("svg", _extends({
|
|
112
113
|
className: prefix('svg'),
|
|
113
|
-
viewBox: "0 0 100 100"
|
|
114
|
+
viewBox: "0 0 100 100",
|
|
115
|
+
width: width
|
|
114
116
|
}, rest), /*#__PURE__*/React.createElement("path", {
|
|
115
117
|
className: prefix('trail'),
|
|
116
118
|
d: pathString,
|
|
@@ -135,6 +137,7 @@ ProgressCircle.propTypes = {
|
|
|
135
137
|
percent: PropTypes.number,
|
|
136
138
|
strokeWidth: PropTypes.number,
|
|
137
139
|
trailWidth: PropTypes.number,
|
|
140
|
+
width: PropTypes.number,
|
|
138
141
|
gapDegree: PropTypes.number,
|
|
139
142
|
gapPosition: oneOf(['top', 'bottom', 'left', 'right']),
|
|
140
143
|
showInfo: PropTypes.bool,
|
package/esm/Stat/StatTrend.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
2
2
|
interface StatTrendProps extends WithAsProps {
|
|
3
|
-
indicator?: 'up' | 'down';
|
|
3
|
+
indicator?: 'up' | 'down' | 'equal';
|
|
4
4
|
appearance?: 'default' | 'subtle';
|
|
5
5
|
}
|
|
6
6
|
declare const StatTrend: RsRefForwardingComponent<'dd', StatTrendProps>;
|
package/esm/Stat/StatTrend.js
CHANGED
|
@@ -30,6 +30,13 @@ var ArrowDown = function ArrowDown(props) {
|
|
|
30
30
|
d: "M17 8l0 9l-9 0"
|
|
31
31
|
}));
|
|
32
32
|
};
|
|
33
|
+
var ArrowEqual = function ArrowEqual(props) {
|
|
34
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, svgProps, props), /*#__PURE__*/React.createElement("path", {
|
|
35
|
+
d: "M7 9l10 0"
|
|
36
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
37
|
+
d: "M7 15l10 0"
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
33
40
|
var StatTrend = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
34
41
|
var _props$as = props.as,
|
|
35
42
|
Component = _props$as === void 0 ? 'span' : _props$as,
|
|
@@ -47,7 +54,7 @@ var StatTrend = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
47
54
|
prefix = _useClassNames.prefix,
|
|
48
55
|
withClassPrefix = _useClassNames.withClassPrefix;
|
|
49
56
|
var classes = merge(className, withClassPrefix(appearance, indicator));
|
|
50
|
-
var IndicatorIcon = indicator === 'up' ? ArrowUp : ArrowDown;
|
|
57
|
+
var IndicatorIcon = indicator === 'up' ? ArrowUp : indicator === 'down' ? ArrowDown : ArrowEqual;
|
|
51
58
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
52
59
|
ref: ref,
|
|
53
60
|
className: classes
|
|
@@ -57,7 +64,7 @@ var StatTrend = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
57
64
|
});
|
|
58
65
|
StatTrend.displayName = 'StatTrend';
|
|
59
66
|
StatTrend.propTypes = {
|
|
60
|
-
indicator: oneOf(['up', 'down']),
|
|
67
|
+
indicator: oneOf(['up', 'down', 'equal']),
|
|
61
68
|
appearance: oneOf(['default', 'subtle'])
|
|
62
69
|
};
|
|
63
70
|
export default StatTrend;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsuite",
|
|
3
|
-
"version": "5.83.
|
|
3
|
+
"version": "5.83.2",
|
|
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.19.
|
|
41
|
+
"rsuite-table": "^5.19.2",
|
|
42
42
|
"schema-typed": "^2.4.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|