@ringcentral/juno 2.0.0-rc.0 → 2.0.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/README.md +2 -1
- package/components/Avatar/Avatar.js +36 -32
- package/components/Buttons/Button/Button.js +11 -7
- package/components/Buttons/IconButton/IconButton.js +5 -3
- package/components/Buttons/SplitButton/SplitButton.js +2 -1
- package/components/DetachedWindow/DetachedWindow.d.ts +1 -7
- package/components/DetachedWindow/DetachedWindow.js +8 -6
- package/components/Dialer/DialPad/utils/useKeyAudio.js +4 -4
- package/components/Dialog/Dialog.js +11 -7
- package/components/Downshift/Downshift.js +115 -108
- package/components/Downshift/utils/useDownshiftError.js +2 -1
- package/components/Forms/Checkbox/Checkbox.js +11 -7
- package/components/Forms/Picker/DatePicker/DatePicker.js +21 -17
- package/components/Forms/TextField/TextField.js +26 -22
- package/components/Icon/Icon.js +41 -37
- package/components/Icon/utils/IconUtils.js +24 -16
- package/components/Link/Link.js +16 -12
- package/components/List/ListItem/ListItem.js +16 -12
- package/components/List/ListItemText/ListItemText.js +21 -17
- package/components/Loading/Loading.js +6 -4
- package/components/Menu/MenuItem/MenuItem.js +6 -4
- package/components/PortalHost/PortalManager/PortalManager.js +24 -16
- package/components/Snackbar/SnackbarContent/SnackbarContent.js +11 -7
- package/components/Tag/Tag.js +11 -7
- package/components/Text/Text.js +1 -2
- package/components/Text/TextWithEllipsis.js +7 -4
- package/components/TextWithHighlight/TextWithHighlight.js +7 -4
- package/components/TextWithLink/TextWithLink.js +7 -4
- package/components/TextWithTooltip/TextWithTooltip.js +7 -4
- package/components/Thumbnail/Thumbnail.js +16 -12
- package/components/Tooltip/Tooltip.js +17 -11
- package/components/VirtualizedMenu/VirtualizedMenuList.js +8 -10
- package/es6/README.md +2 -1
- package/es6/components/Avatar/Avatar.js +37 -33
- package/es6/components/Buttons/Button/Button.js +12 -8
- package/es6/components/Buttons/IconButton/IconButton.js +6 -4
- package/es6/components/Buttons/SplitButton/SplitButton.js +2 -1
- package/es6/components/DetachedWindow/DetachedWindow.js +8 -6
- package/es6/components/Dialer/DialPad/utils/useKeyAudio.js +4 -4
- package/es6/components/Dialog/Dialog.js +12 -8
- package/es6/components/Downshift/Downshift.js +116 -109
- package/es6/components/Downshift/utils/useDownshiftError.js +3 -2
- package/es6/components/Forms/Checkbox/Checkbox.js +12 -8
- package/es6/components/Forms/Picker/DatePicker/DatePicker.js +22 -18
- package/es6/components/Forms/TextField/TextField.js +27 -23
- package/es6/components/Icon/Icon.js +42 -38
- package/es6/components/Icon/utils/IconUtils.js +24 -16
- package/es6/components/Link/Link.js +17 -13
- package/es6/components/List/ListItem/ListItem.js +17 -13
- package/es6/components/List/ListItemText/ListItemText.js +22 -18
- package/es6/components/Loading/Loading.js +6 -4
- package/es6/components/Menu/MenuItem/MenuItem.js +6 -4
- package/es6/components/PortalHost/PortalManager/PortalManager.js +24 -16
- package/es6/components/Snackbar/SnackbarContent/SnackbarContent.js +12 -8
- package/es6/components/Tag/Tag.js +12 -8
- package/es6/components/Text/Text.js +1 -2
- package/es6/components/Text/TextWithEllipsis.js +7 -4
- package/es6/components/TextWithHighlight/TextWithHighlight.js +7 -4
- package/es6/components/TextWithLink/TextWithLink.js +7 -4
- package/es6/components/TextWithTooltip/TextWithTooltip.js +7 -4
- package/es6/components/Thumbnail/Thumbnail.js +17 -13
- package/es6/components/Tooltip/Tooltip.js +18 -12
- package/es6/components/VirtualizedMenu/VirtualizedMenuList.js +9 -11
- package/es6/foundation/config.js +77 -57
- package/es6/foundation/hooks/useResizeObserver/useResizeObserver.js +10 -7
- package/es6/foundation/styles/opacity.js +6 -4
- package/es6/foundation/utils/clearReactReferencesInNode.js +9 -7
- package/es6/foundation/utils/hasValue.js +1 -1
- package/es6/foundation/utils/index.js +0 -1
- package/es6/foundation/utils/isShowJunoWarning.js +0 -2
- package/es6/foundation/utils/withDeprecatedCheck.js +14 -15
- package/foundation/config.d.ts +23 -13
- package/foundation/config.js +78 -58
- package/foundation/hooks/useResizeObserver/useResizeObserver.js +10 -7
- package/foundation/styles/opacity.js +6 -4
- package/foundation/utils/clearReactReferencesInNode.js +9 -7
- package/foundation/utils/hasValue.js +1 -1
- package/foundation/utils/index.d.ts +0 -1
- package/foundation/utils/index.js +0 -1
- package/foundation/utils/isShowJunoWarning.d.ts +0 -1
- package/foundation/utils/isShowJunoWarning.js +0 -4
- package/foundation/utils/withDeprecatedCheck.d.ts +2 -2
- package/foundation/utils/withDeprecatedCheck.js +14 -15
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@ import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
|
2
2
|
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import MuiCheckbox from '@material-ui/core/Checkbox';
|
|
4
4
|
import { Indeterminate as indeterminateIcon, Selects as selectIcon, Unselect as unSelectIcon, } from '@ringcentral/juno-icon';
|
|
5
|
-
import { combineClasses, styled,
|
|
5
|
+
import { combineClasses, styled, useDeprecatedCheck, useThemeProps, } from '../../../foundation';
|
|
6
6
|
import { withTooltip } from '../../Tooltip';
|
|
7
7
|
import { RcFormControlLabel } from '../FormControlLabel';
|
|
8
8
|
import { CustomIconPropsGetter } from '../utils';
|
|
@@ -15,6 +15,16 @@ var getIconProps = CustomIconPropsGetter({
|
|
|
15
15
|
});
|
|
16
16
|
var _RcCheckbox = forwardRef(function (inProps, ref) {
|
|
17
17
|
var props = useThemeProps({ props: inProps, name: 'RcCheckbox' });
|
|
18
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
19
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
20
|
+
useDeprecatedCheck(RcCheckbox, props, [
|
|
21
|
+
{
|
|
22
|
+
prop: 'iconSize',
|
|
23
|
+
time: '2021-4',
|
|
24
|
+
comment: "@deprecated using size to replace that",
|
|
25
|
+
},
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
18
28
|
var label = props.label, formControlLabelProps = props.formControlLabelProps, color = props.color, error = props.error, followColorWhenUnChecked = props.followColorWhenUnChecked, classesProp = props.classes, iconSize = props.iconSize, sizeProp = props.size, icon = props.icon, checkedIcon = props.checkedIcon, rest = __rest(props, ["label", "formControlLabelProps", "color", "error", "followColorWhenUnChecked", "classes", "iconSize", "size", "icon", "checkedIcon"]);
|
|
19
29
|
var size = sizeProp;
|
|
20
30
|
// TODO: switch to size
|
|
@@ -29,13 +39,7 @@ var _RcCheckbox = forwardRef(function (inProps, ref) {
|
|
|
29
39
|
}
|
|
30
40
|
return Checkbox;
|
|
31
41
|
});
|
|
32
|
-
var RcCheckbox = styled(
|
|
33
|
-
{
|
|
34
|
-
prop: 'iconSize',
|
|
35
|
-
time: '2021-4',
|
|
36
|
-
comment: "@deprecated using size to replace that",
|
|
37
|
-
},
|
|
38
|
-
], 'RcCheckbox'))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), CheckboxStyle);
|
|
42
|
+
var RcCheckbox = styled(withTooltip(_RcCheckbox))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), CheckboxStyle);
|
|
39
43
|
RcCheckbox.displayName = 'RcCheckbox';
|
|
40
44
|
RcCheckbox.defaultProps = {
|
|
41
45
|
color: 'interactive.f01',
|
|
@@ -6,7 +6,7 @@ import { useControlled } from '@material-ui/core/utils';
|
|
|
6
6
|
import { MuiPickersUtilsProvider, useUtils as useMuiUtils, } from '@material-ui/pickers';
|
|
7
7
|
import { findClosestEnabledDate as MuiFindClosestEnabledDate } from '@material-ui/pickers/_helpers/date-utils';
|
|
8
8
|
import { DateBorder } from '@ringcentral/juno-icon';
|
|
9
|
-
import { combineClasses, combineProps, omit, styled, useEventCallback, useThemeProps,
|
|
9
|
+
import { combineClasses, combineProps, omit, styled, useDeprecatedCheck, useEventCallback, useThemeProps, } from '../../../../foundation';
|
|
10
10
|
import { PickerTextField, } from '../utils';
|
|
11
11
|
import { Calendar } from './Calendar';
|
|
12
12
|
import { invalidateDateInRange, RcDatePickerClasses, ScreenReaderProvider, } from './utils';
|
|
@@ -110,26 +110,30 @@ var InnerRcDatePicker = forwardRef(function (props, ref) {
|
|
|
110
110
|
});
|
|
111
111
|
var _RcDatePicker = forwardRef(function (inProps, ref) {
|
|
112
112
|
var props = useThemeProps({ props: inProps, name: 'RcDatePicker' });
|
|
113
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
114
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
115
|
+
useDeprecatedCheck(RcDatePicker, props, [
|
|
116
|
+
{
|
|
117
|
+
prop: 'minDate',
|
|
118
|
+
time: '2021-3',
|
|
119
|
+
comment: "Min date @DateIOType, using min instead ",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
prop: 'maxDate',
|
|
123
|
+
time: '2021-3',
|
|
124
|
+
comment: "Max date @DateIOType, using max instead ",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
prop: 'date',
|
|
128
|
+
time: '2021-3',
|
|
129
|
+
comment: "please use value to replace that ",
|
|
130
|
+
},
|
|
131
|
+
]);
|
|
132
|
+
}
|
|
113
133
|
return (React.createElement(MuiPickersUtilsProvider, { utils: MomentUtils, locale: props.locale, libInstance: moment },
|
|
114
134
|
React.createElement(InnerRcDatePicker, __assign({ ref: ref }, props))));
|
|
115
135
|
});
|
|
116
|
-
var RcDatePicker = styled(
|
|
117
|
-
{
|
|
118
|
-
prop: 'minDate',
|
|
119
|
-
time: '2021-3',
|
|
120
|
-
comment: "Min date @DateIOType, using min instead ",
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
prop: 'maxDate',
|
|
124
|
-
time: '2021-3',
|
|
125
|
-
comment: "Max date @DateIOType, using max instead ",
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
prop: 'date',
|
|
129
|
-
time: '2021-3',
|
|
130
|
-
comment: "please use value to replace that ",
|
|
131
|
-
},
|
|
132
|
-
], 'RcDatePicker'))(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
136
|
+
var RcDatePicker = styled(_RcDatePicker)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
133
137
|
RcDatePicker.defaultProps = {
|
|
134
138
|
clearBtn: true,
|
|
135
139
|
formatString: DEFAULT_FORMAT,
|
|
@@ -2,13 +2,38 @@ import { __assign, __makeTemplateObject, __read, __rest } from "tslib";
|
|
|
2
2
|
import React, { forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import MuiTextField from '@material-ui/core/TextField';
|
|
4
4
|
import { DeleteCircle } from '@ringcentral/juno-icon';
|
|
5
|
-
import { clearReactReferencesInNode, combineClasses, combineProps, styled, useEventCallback, useForkRef, useThemeProps,
|
|
5
|
+
import { clearReactReferencesInNode, combineClasses, combineProps, styled, useDeprecatedCheck, useEventCallback, useForkRef, useThemeProps, } from '../../../foundation';
|
|
6
6
|
import { useRcFormContext } from '../Form/Form/FormContext';
|
|
7
7
|
import { ClearIconButton, TextFieldStyle } from './styles';
|
|
8
8
|
import { RcOutlineTextFieldIconSizes, RcOutlineTextFieldInputClasses, RcTextFieldClasses, RcTextFieldFormHelperTextClasses, RcTextFieldInputClasses, RcTextFieldInputLabelClasses, } from './utils';
|
|
9
9
|
var combineOutlineClasses = combineClasses(RcTextFieldInputClasses, RcOutlineTextFieldInputClasses);
|
|
10
10
|
var _RcTextField = forwardRef(function (inProps, ref) {
|
|
11
11
|
var props = useThemeProps({ props: inProps, name: 'RcTextField' });
|
|
12
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
13
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
14
|
+
useDeprecatedCheck(RcTextField, props, [
|
|
15
|
+
{
|
|
16
|
+
prop: 'focusOnMount',
|
|
17
|
+
time: '2021-4',
|
|
18
|
+
comment: "please use `autoFocus` to replace that",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
prop: 'selectOnMount',
|
|
22
|
+
time: '2021-4',
|
|
23
|
+
comment: "please use `autoSelect` to replace that",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
prop: 'clearLabel',
|
|
27
|
+
time: '2021-4',
|
|
28
|
+
comment: "clear button label, please use `clearButtonProps` with `title` replace that",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
prop: 'clearAriaLabel',
|
|
32
|
+
time: '2021-4',
|
|
33
|
+
comment: "clear button aria-label, use `clearButtonProps` with `aria-label` replace that",
|
|
34
|
+
},
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
12
37
|
var classesProp = props.classes, InputLabelPropsProp = props.InputLabelProps, FormHelperTextPropsProp = props.FormHelperTextProps, valueProp = props.value, focusOnMount = props.focusOnMount, selectOnMount = props.selectOnMount, clearAriaLabel = props.clearAriaLabel,
|
|
13
38
|
// TODO: remove when remove focusOnMount
|
|
14
39
|
_a = props.autoFocus,
|
|
@@ -139,28 +164,7 @@ var _RcTextField = forwardRef(function (inProps, ref) {
|
|
|
139
164
|
return (React.createElement(MuiTextField, __assign({}, rest, events, { id: id, value: valueProp, onChange: onChange, defaultValue: defaultValue, error: validate ? !!validateMessage : error, helperText: validateMessage || helperText, classes: classes, FormHelperTextProps: FormHelperTextProps, InputLabelProps: InputLabelProps, InputProps: InputProps, inputRef: inputRef, ref: ref })));
|
|
140
165
|
});
|
|
141
166
|
/** @release */
|
|
142
|
-
var RcTextField = styled(
|
|
143
|
-
{
|
|
144
|
-
prop: 'focusOnMount',
|
|
145
|
-
time: '2021-4',
|
|
146
|
-
comment: "please use `autoFocus` to replace that",
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
prop: 'selectOnMount',
|
|
150
|
-
time: '2021-4',
|
|
151
|
-
comment: "please use `autoSelect` to replace that",
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
prop: 'clearLabel',
|
|
155
|
-
time: '2021-4',
|
|
156
|
-
comment: "clear button label, please use `clearButtonProps` with `title` replace that",
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
prop: 'clearAriaLabel',
|
|
160
|
-
time: '2021-4',
|
|
161
|
-
comment: "clear button aria-label, use `clearButtonProps` with `aria-label` replace that",
|
|
162
|
-
},
|
|
163
|
-
], 'RcTextField'))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), TextFieldStyle);
|
|
167
|
+
var RcTextField = styled(_RcTextField)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), TextFieldStyle);
|
|
164
168
|
RcTextField.defaultProps = {
|
|
165
169
|
clearBtn: true,
|
|
166
170
|
variant: 'standard',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, memo, } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import { styled,
|
|
4
|
+
import { styled, useDeprecatedCheck, useThemeProps, } from '../../foundation';
|
|
5
5
|
import { RcCircularProgress } from '../Progress';
|
|
6
6
|
import { IconStyle, StyledSvg } from './styles';
|
|
7
7
|
import { RcIconSizes } from './utils';
|
|
@@ -12,6 +12,46 @@ import { useIconService } from './utils/IconService';
|
|
|
12
12
|
*/
|
|
13
13
|
var _RcIcon = memo(forwardRef(function (inProps, ref) {
|
|
14
14
|
var props = useThemeProps({ props: inProps, name: 'RcIcon' });
|
|
15
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
16
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
17
|
+
useDeprecatedCheck(RcIcon, props, [
|
|
18
|
+
{
|
|
19
|
+
prop: 'icon',
|
|
20
|
+
time: '2021-1',
|
|
21
|
+
comment: 'please use symbol to replace icon',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
prop: 'children',
|
|
25
|
+
time: '2021-1',
|
|
26
|
+
comment: 'please use symbol to replace children',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
prop: 'iconSize',
|
|
30
|
+
time: '2021-1',
|
|
31
|
+
comment: 'please use size',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
prop: 'iconColor',
|
|
35
|
+
time: '2021-1',
|
|
36
|
+
comment: 'please use color',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
prop: 'useLoading',
|
|
40
|
+
time: '2021-1',
|
|
41
|
+
comment: 'please use loading',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
prop: 'loadingSize',
|
|
45
|
+
time: '2021-1',
|
|
46
|
+
comment: 'please use CircularProgressProps={{ size: 24 }} to set custom loading size',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
prop: 'desc',
|
|
50
|
+
time: '2021-1',
|
|
51
|
+
comment: 'please use symbol',
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
15
55
|
var loadingSize = props.loadingSize, useLoading = props.useLoading, iconColor = props.iconColor, iconSize = props.iconSize, icon = props.icon, desc = props.desc, className = props.className, _a = props.loading, loading = _a === void 0 ? useLoading : _a, CircularProgressProps = props.CircularProgressProps, symbol = props.symbol, children = props.children,
|
|
16
56
|
// * pick props
|
|
17
57
|
color = props.color, size = props.size, rest = __rest(props, ["loadingSize", "useLoading", "iconColor", "iconSize", "icon", "desc", "className", "loading", "CircularProgressProps", "symbol", "children", "color", "size"]);
|
|
@@ -61,43 +101,7 @@ var _RcIcon = memo(forwardRef(function (inProps, ref) {
|
|
|
61
101
|
!!desc && React.createElement("title", null, desc),
|
|
62
102
|
React.createElement("use", { xlinkHref: href, href: href }))))));
|
|
63
103
|
}));
|
|
64
|
-
var RcIcon = styled(
|
|
65
|
-
{
|
|
66
|
-
prop: 'icon',
|
|
67
|
-
time: '2021-1',
|
|
68
|
-
comment: 'please use symbol to replace icon',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
prop: 'children',
|
|
72
|
-
time: '2021-1',
|
|
73
|
-
comment: 'please use symbol to replace children',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
prop: 'iconSize',
|
|
77
|
-
time: '2021-1',
|
|
78
|
-
comment: 'please use size',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
prop: 'iconColor',
|
|
82
|
-
time: '2021-1',
|
|
83
|
-
comment: 'please use color',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
prop: 'useLoading',
|
|
87
|
-
time: '2021-1',
|
|
88
|
-
comment: 'please use loading',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
prop: 'loadingSize',
|
|
92
|
-
time: '2021-1',
|
|
93
|
-
comment: 'please use CircularProgressProps={{ size: 24 }} to set custom loading size',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
prop: 'desc',
|
|
97
|
-
time: '2021-1',
|
|
98
|
-
comment: 'please use symbol',
|
|
99
|
-
},
|
|
100
|
-
], 'RcIcon'))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), IconStyle);
|
|
104
|
+
var RcIcon = styled(_RcIcon)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), IconStyle);
|
|
101
105
|
RcIcon.defaultProps = {
|
|
102
106
|
size: 'large',
|
|
103
107
|
};
|
|
@@ -12,28 +12,36 @@ export var RcIconSizes = {
|
|
|
12
12
|
export function switchSize(size) {
|
|
13
13
|
switch (size) {
|
|
14
14
|
case 'extraSmall':
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
16
|
+
logInDev({
|
|
17
|
+
component: 'RcIcon',
|
|
18
|
+
message: 'please change extraSmall to xsmall',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
19
21
|
return 'xsmall';
|
|
20
22
|
case 'moreLarge':
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
24
|
+
logInDev({
|
|
25
|
+
component: 'RcIcon',
|
|
26
|
+
message: 'please change moreLarge to xlarge',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
25
29
|
return 'xlarge';
|
|
26
30
|
case 'mediumLarge':
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
32
|
+
logInDev({
|
|
33
|
+
component: 'RcIcon',
|
|
34
|
+
message: 'please change mediumLarge to xxlarge',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
31
37
|
return 'xxlarge';
|
|
32
38
|
case 'extraLarge':
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
40
|
+
logInDev({
|
|
41
|
+
component: 'RcIcon',
|
|
42
|
+
message: 'please change extraLarge to xxxlarge',
|
|
43
|
+
});
|
|
44
|
+
}
|
|
37
45
|
return 'xxxlarge';
|
|
38
46
|
default:
|
|
39
47
|
return size;
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
|
-
import { styled, useA11yKeyEvent,
|
|
3
|
+
import { styled, useA11yKeyEvent, useDeprecatedCheck, useThemeProps, } from '../../foundation';
|
|
4
4
|
import { LinkStyle } from './styles';
|
|
5
5
|
var _RcLink = forwardRef(function (inProps, ref) {
|
|
6
6
|
var props = useThemeProps({ props: inProps, name: 'RcLink' });
|
|
7
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
8
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
9
|
+
useDeprecatedCheck(RcLink, props, [
|
|
10
|
+
{
|
|
11
|
+
prop: 'size',
|
|
12
|
+
time: '2021-4',
|
|
13
|
+
comment: "@deprecated size of Link, default is medium, please use variant directly\n * `small` => `caption1`\n * `medium` => `body1`\n * `large` => `headline1`\n */",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
prop: 'handleOnClick',
|
|
17
|
+
time: '2021-4',
|
|
18
|
+
comment: "@deprecated use onClick replace that */",
|
|
19
|
+
},
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
7
22
|
var _handleOnClick = props.handleOnClick, ComponentProp = props.Component, onKeyDown = props.onKeyDown, onClick = props.onClick, disabled = props.disabled, children = props.children, tabIndex = props.tabIndex, color = props.color, underline = props.underline, variant = props.variant, rest = __rest(props, ["handleOnClick", "Component", "onKeyDown", "onClick", "disabled", "children", "tabIndex", "color", "underline", "variant"]);
|
|
8
23
|
// TODO: remove when handleOnClick removed
|
|
9
24
|
var handleOnClick = _handleOnClick ? _handleOnClick : onClick;
|
|
@@ -18,18 +33,7 @@ var _RcLink = forwardRef(function (inProps, ref) {
|
|
|
18
33
|
* @release
|
|
19
34
|
* that onClick event will be trigger with `enter` like `<a>`, when have custom onKeydown event, that will be cover by outside
|
|
20
35
|
* */
|
|
21
|
-
var RcLink = styled(
|
|
22
|
-
{
|
|
23
|
-
prop: 'size',
|
|
24
|
-
time: '2021-4',
|
|
25
|
-
comment: "@deprecated size of Link, default is medium, please use variant directly\n * `small` => `caption1`\n * `medium` => `body1`\n * `large` => `headline1`\n */",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
prop: 'handleOnClick',
|
|
29
|
-
time: '2021-4',
|
|
30
|
-
comment: "@deprecated use onClick replace that */",
|
|
31
|
-
},
|
|
32
|
-
], 'RcLink'))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), LinkStyle);
|
|
36
|
+
var RcLink = styled(_RcLink)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), LinkStyle);
|
|
33
37
|
RcLink.defaultProps = {
|
|
34
38
|
variant: 'body1',
|
|
35
39
|
color: 'informative.f02',
|
|
@@ -2,12 +2,27 @@ import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
|
2
2
|
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import MuiListItem from '@material-ui/core/ListItem';
|
|
5
|
-
import { combineClasses, combineProps, styled,
|
|
5
|
+
import { combineClasses, combineProps, styled, useDeprecatedCheck, useThemeProps, } from '../../../foundation';
|
|
6
6
|
import { withTooltip } from '../../Tooltip';
|
|
7
7
|
import { ListItemStyle } from './styles';
|
|
8
8
|
import { RcListItemClasses, RcListItemMultilineClassName, RcListItemRippleClasses, } from './utils';
|
|
9
9
|
var _RcListItem = forwardRef(function (inProps, ref) {
|
|
10
10
|
var props = useThemeProps({ props: inProps, name: 'RcListItem' });
|
|
11
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
12
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
13
|
+
useDeprecatedCheck(RcListItem, props, [
|
|
14
|
+
{
|
|
15
|
+
prop: 'baseColor',
|
|
16
|
+
time: '2021-9',
|
|
17
|
+
comment: '@deprecated should use color directly',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
prop: 'maxWidth',
|
|
21
|
+
time: '2021-4',
|
|
22
|
+
comment: 'recommend using classes to define',
|
|
23
|
+
},
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
11
26
|
var classesProp = props.classes, color = props.color, TouchRipplePropsProp = props.TouchRippleProps, children = props.children, className = props.className, singleLine = props.singleLine, button = props.button, size = props.size, canHover = props.canHover, isInline = props.isInline, baseColor = props.baseColor, title = props.title, highlighted = props.highlighted, maxWidth = props.maxWidth, rest = __rest(props, ["classes", "color", "TouchRippleProps", "children", "className", "singleLine", "button", "size", "canHover", "isInline", "baseColor", "title", "highlighted", "maxWidth"]);
|
|
12
27
|
var classes = useMemo(function () { return combineClasses(RcListItemClasses, classesProp); }, [classesProp]);
|
|
13
28
|
var ListItemClassName = useMemo(function () {
|
|
@@ -26,18 +41,7 @@ var _RcListItem = forwardRef(function (inProps, ref) {
|
|
|
26
41
|
}, [TouchRipplePropsProp, button]);
|
|
27
42
|
return (React.createElement(MuiListItem, __assign({}, rest, additionProps, { ref: ref, title: typeof title === 'string' ? title : undefined, classes: classes, className: ListItemClassName, button: button }), children));
|
|
28
43
|
});
|
|
29
|
-
var RcListItem = styled(
|
|
30
|
-
{
|
|
31
|
-
prop: 'baseColor',
|
|
32
|
-
time: '2021-9',
|
|
33
|
-
comment: '@deprecated should use color directly',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
prop: 'maxWidth',
|
|
37
|
-
time: '2021-4',
|
|
38
|
-
comment: 'recommend using classes to define',
|
|
39
|
-
},
|
|
40
|
-
], 'RcListItem'))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), ListItemStyle);
|
|
44
|
+
var RcListItem = styled(withTooltip(_RcListItem))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), ListItemStyle);
|
|
41
45
|
RcListItem.defaultProps = {
|
|
42
46
|
singleLine: false,
|
|
43
47
|
button: true,
|
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import MuiListItemText from '@material-ui/core/ListItemText';
|
|
4
|
-
import { combineClasses, omit, styled,
|
|
4
|
+
import { combineClasses, omit, styled, useDeprecatedCheck, useThemeProps, } from '../../../foundation';
|
|
5
5
|
import { ListItemTextStyle } from './styles';
|
|
6
6
|
import { RcListItemTextClasses } from './utils';
|
|
7
7
|
var _RcListItemText = forwardRef(function (inProps, ref) {
|
|
8
8
|
var props = useThemeProps({ props: inProps, name: 'RcListItemText' });
|
|
9
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
10
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
11
|
+
useDeprecatedCheck(RcListItemText, props, [
|
|
12
|
+
{
|
|
13
|
+
prop: 'primaryColor',
|
|
14
|
+
time: '2021-4',
|
|
15
|
+
comment: 'recommend use primaryTypographyProps color prop',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
prop: 'alignCenter',
|
|
19
|
+
time: '2021-4',
|
|
20
|
+
comment: "recommend using classes to define it",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
prop: 'lineThrough',
|
|
24
|
+
time: '2021-4',
|
|
25
|
+
comment: "recommend using classes to define it",
|
|
26
|
+
},
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
9
29
|
var classesProp = props.classes, children = props.children, isEllipsis = props.isEllipsis, primaryTypographyPropsProp = props.primaryTypographyProps, secondaryTypographyPropsProp = props.secondaryTypographyProps, primaryColor = props.primaryColor, alignCenter = props.alignCenter, lineThrough = props.lineThrough, rest = __rest(props, ["classes", "children", "isEllipsis", "primaryTypographyProps", "secondaryTypographyProps", "primaryColor", "alignCenter", "lineThrough"]);
|
|
10
30
|
var classes = useMemo(function () { return combineClasses(RcListItemTextClasses, classesProp); }, [classesProp]);
|
|
11
31
|
var primaryTypographyProps = useMemo(function () { return omit(primaryTypographyPropsProp, ['color', 'variant']); }, [primaryTypographyPropsProp]);
|
|
12
32
|
var secondaryTypographyProps = useMemo(function () { return omit(secondaryTypographyPropsProp, ['color', 'variant']); }, [secondaryTypographyPropsProp]);
|
|
13
33
|
return (React.createElement(MuiListItemText, __assign({}, rest, { ref: ref, classes: classes, primaryTypographyProps: primaryTypographyProps, secondaryTypographyProps: secondaryTypographyProps }), children));
|
|
14
34
|
});
|
|
15
|
-
var RcListItemText = styled(
|
|
16
|
-
{
|
|
17
|
-
prop: 'primaryColor',
|
|
18
|
-
time: '2021-4',
|
|
19
|
-
comment: 'recommend use primaryTypographyProps color prop',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
prop: 'alignCenter',
|
|
23
|
-
time: '2021-4',
|
|
24
|
-
comment: "recommend using classes to define it",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
prop: 'lineThrough',
|
|
28
|
-
time: '2021-4',
|
|
29
|
-
comment: "recommend using classes to define it",
|
|
30
|
-
},
|
|
31
|
-
], 'RcListItemText'))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), ListItemTextStyle);
|
|
35
|
+
var RcListItemText = styled(_RcListItemText)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), ListItemTextStyle);
|
|
32
36
|
RcListItemText.defaultProps = {
|
|
33
37
|
isEllipsis: true,
|
|
34
38
|
primaryTypographyProps: {
|
|
@@ -18,10 +18,12 @@ var RcLoading = function (inProps) {
|
|
|
18
18
|
childrenWhenLoading.type !== React.Fragment) {
|
|
19
19
|
return (React.createElement(RcBox, { clone: true, display: "none" }, childrenWhenLoading));
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
22
|
+
logInDev({
|
|
23
|
+
component: 'RcLoading',
|
|
24
|
+
message: 'please confirm your children is a valid html element to set style, when you use `keepVisible=false`',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
25
27
|
return childrenWhenLoading;
|
|
26
28
|
};
|
|
27
29
|
return (React.createElement(React.Fragment, null,
|
|
@@ -50,10 +50,12 @@ var _RcMenuItem = forwardRef(function (inProps, ref) {
|
|
|
50
50
|
return isRcElement(icon, ['RcListItemIcon']) ? (icon) : (React.createElement(RcListItemIcon, null, icon));
|
|
51
51
|
}
|
|
52
52
|
if (typeof icon === 'string') {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
54
|
+
logInDev({
|
|
55
|
+
component: 'RcMenuItem',
|
|
56
|
+
message: 'please use symbol to replace icon string',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
57
59
|
return (React.createElement(RcListItemIcon, null,
|
|
58
60
|
React.createElement(RcIcon, { size: "small" }, icon)));
|
|
59
61
|
}
|
|
@@ -31,10 +31,12 @@ var PortalManager = /** @class */ (function (_super) {
|
|
|
31
31
|
var currPortal = this.portalStore.get(id);
|
|
32
32
|
// portalWithSameID opened
|
|
33
33
|
if (currPortal === null || currPortal === void 0 ? void 0 : currPortal.open) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
35
|
+
logInDev({
|
|
36
|
+
component: 'RcPortalHost',
|
|
37
|
+
message: "open the portal with id('" + id + "') failed, this portal is already open",
|
|
38
|
+
});
|
|
39
|
+
}
|
|
38
40
|
return currPortal.portalController;
|
|
39
41
|
}
|
|
40
42
|
var portalDescriptor = this.createPortalDescriptor({
|
|
@@ -118,10 +120,12 @@ var PortalManager = /** @class */ (function (_super) {
|
|
|
118
120
|
PortalManager.prototype.closeByID = function (id, feedback) {
|
|
119
121
|
var portal = this.portalStore.get(id);
|
|
120
122
|
if (!(portal === null || portal === void 0 ? void 0 : portal.open)) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
124
|
+
logInDev({
|
|
125
|
+
component: 'RcPortalHost',
|
|
126
|
+
message: 'close portal failed, this portal is already closed',
|
|
127
|
+
});
|
|
128
|
+
}
|
|
125
129
|
return;
|
|
126
130
|
}
|
|
127
131
|
this._feedbackMap.set(portal.id, feedback);
|
|
@@ -137,10 +141,12 @@ var PortalManager = /** @class */ (function (_super) {
|
|
|
137
141
|
PortalManager.prototype[UnmountSymbol] = function (id) {
|
|
138
142
|
var portal = this.portalStore.get(id);
|
|
139
143
|
if (!portal) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
145
|
+
logInDev({
|
|
146
|
+
component: 'RcPortalHost',
|
|
147
|
+
message: 'unmount portal failed, this portal is already unmount',
|
|
148
|
+
});
|
|
149
|
+
}
|
|
144
150
|
return;
|
|
145
151
|
}
|
|
146
152
|
this.portalStore.delete(portal.id);
|
|
@@ -151,10 +157,12 @@ var PortalManager = /** @class */ (function (_super) {
|
|
|
151
157
|
PortalManager.prototype.updatePropsByID = function (id, propsOrHandler) {
|
|
152
158
|
var portal = this.portalStore.get(id);
|
|
153
159
|
if (!(portal === null || portal === void 0 ? void 0 : portal.open)) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
160
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
161
|
+
logInDev({
|
|
162
|
+
component: 'RcPortalHost',
|
|
163
|
+
message: 'update props failed, this portal is already closed',
|
|
164
|
+
});
|
|
165
|
+
}
|
|
158
166
|
return;
|
|
159
167
|
}
|
|
160
168
|
var props = (function () {
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, isValidElement, useMemo, } from 'react';
|
|
3
3
|
import MuiSnackbarContent from '@material-ui/core/SnackbarContent';
|
|
4
|
-
import { combineClasses, isRcElement, styled,
|
|
4
|
+
import { combineClasses, isRcElement, styled, useDeprecatedCheck, useThemeProps, } from '../../../foundation';
|
|
5
5
|
import { RcCircularProgress } from '../../Progress/CircularProgress';
|
|
6
6
|
import { snackbarContentStyle } from './styles';
|
|
7
7
|
import { RcSnackbarContentClasses, RcSnackbarContentLoadingSizes, } from './utils';
|
|
8
8
|
/** @release */
|
|
9
9
|
var _RcSnackbarContent = forwardRef(function (inProps, ref) {
|
|
10
10
|
var props = useThemeProps({ props: inProps, name: 'RcSnackbarContent' });
|
|
11
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
12
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
13
|
+
useDeprecatedCheck(RcSnackbarContent, props, [
|
|
14
|
+
{
|
|
15
|
+
prop: 'ariaLabel',
|
|
16
|
+
time: '2021-3',
|
|
17
|
+
comment: "please use `aria-label` directly ",
|
|
18
|
+
},
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
11
21
|
var classesProp = props.classes, loading = props.loading, size = props.size, messageAlign = props.messageAlign, type = props.type, fullWidth = props.fullWidth, actionProp = props.action, rest = __rest(props, ["classes", "loading", "size", "messageAlign", "type", "fullWidth", "action"]);
|
|
12
22
|
var classes = useMemo(function () { return combineClasses(RcSnackbarContentClasses, classesProp); }, [classesProp]);
|
|
13
23
|
var action = useMemo(function () {
|
|
@@ -28,13 +38,7 @@ var _RcSnackbarContent = forwardRef(function (inProps, ref) {
|
|
|
28
38
|
}, [actionProp, size]);
|
|
29
39
|
return (React.createElement(MuiSnackbarContent, __assign({}, rest, { ref: ref, classes: classes, action: loading ? (React.createElement(RcCircularProgress, { color: "inherit", size: RcSnackbarContentLoadingSizes[size] })) : (action) })));
|
|
30
40
|
});
|
|
31
|
-
var RcSnackbarContent = styled(
|
|
32
|
-
{
|
|
33
|
-
prop: 'ariaLabel',
|
|
34
|
-
time: '2021-3',
|
|
35
|
-
comment: "please use `aria-label` directly ",
|
|
36
|
-
},
|
|
37
|
-
], 'RcSnackbarContent'))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), snackbarContentStyle);
|
|
41
|
+
var RcSnackbarContent = styled(_RcSnackbarContent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), snackbarContentStyle);
|
|
38
42
|
RcSnackbarContent.defaultProps = {
|
|
39
43
|
type: 'success',
|
|
40
44
|
messageAlign: 'center',
|