@mui/lab 5.0.0-alpha.60 → 5.0.0-alpha.64
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 +230 -32
- package/ClockPicker/ClockPicker.d.ts +1 -1
- package/ClockPicker/ClockPicker.js +5 -2
- package/DatePicker/DatePicker.js +5 -1
- package/DateRangePicker/DateRangePicker.js +5 -1
- package/DateTimePicker/DateTimePicker.js +5 -1
- package/DesktopDatePicker/DesktopDatePicker.js +5 -1
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
- package/LoadingButton/LoadingButton.d.ts +2 -0
- package/LoadingButton/LoadingButton.js +19 -9
- package/MobileDatePicker/MobileDatePicker.js +5 -1
- package/MobileDateRangePicker/MobileDateRangePicker.js +5 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
- package/StaticDatePicker/StaticDatePicker.js +5 -1
- package/StaticDateRangePicker/StaticDateRangePicker.js +5 -1
- package/StaticDateTimePicker/StaticDateTimePicker.js +5 -1
- package/index.js +1 -1
- package/legacy/ClockPicker/ClockPicker.js +5 -2
- package/legacy/DatePicker/DatePicker.js +5 -1
- package/legacy/DateRangePicker/DateRangePicker.js +5 -1
- package/legacy/DateTimePicker/DateTimePicker.js +5 -1
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +5 -1
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -1
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
- package/legacy/LoadingButton/LoadingButton.js +19 -10
- package/legacy/MobileDatePicker/MobileDatePicker.js +5 -1
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +5 -1
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
- package/legacy/StaticDatePicker/StaticDatePicker.js +5 -1
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +5 -1
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +5 -1
- package/legacy/index.js +1 -1
- package/modern/ClockPicker/ClockPicker.js +5 -2
- package/modern/DatePicker/DatePicker.js +5 -1
- package/modern/DateRangePicker/DateRangePicker.js +5 -1
- package/modern/DateTimePicker/DateTimePicker.js +5 -1
- package/modern/DesktopDatePicker/DesktopDatePicker.js +5 -1
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
- package/modern/LoadingButton/LoadingButton.js +20 -9
- package/modern/MobileDatePicker/MobileDatePicker.js +5 -1
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +5 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +5 -1
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +5 -1
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +5 -1
- package/modern/index.js +1 -1
- package/node/ClockPicker/ClockPicker.js +5 -2
- package/node/DatePicker/DatePicker.js +5 -1
- package/node/DateRangePicker/DateRangePicker.js +5 -1
- package/node/DateTimePicker/DateTimePicker.js +5 -1
- package/node/DesktopDatePicker/DesktopDatePicker.js +5 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -1
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
- package/node/LoadingButton/LoadingButton.js +17 -6
- package/node/MobileDatePicker/MobileDatePicker.js +5 -1
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +5 -1
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
- package/node/StaticDatePicker/StaticDatePicker.js +5 -1
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +5 -1
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +5 -1
- package/node/index.js +1 -1
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "disabled", "loading", "loadingIndicator", "loadingPosition", "variant"];
|
|
3
|
+
const _excluded = ["children", "disabled", "id", "loading", "loadingIndicator", "loadingPosition", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { chainPropTypes } from '@mui/utils';
|
|
7
|
-
import { capitalize } from '@mui/material/utils';
|
|
7
|
+
import { capitalize, unstable_useId as useId } from '@mui/material/utils';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
9
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import Button from '@mui/material/Button';
|
|
@@ -112,12 +112,6 @@ const LoadingButtonLoadingIndicator = styled('div', {
|
|
|
112
112
|
position: 'relative',
|
|
113
113
|
right: -10
|
|
114
114
|
}));
|
|
115
|
-
|
|
116
|
-
const LoadingIndicator = /*#__PURE__*/_jsx(CircularProgress, {
|
|
117
|
-
color: "inherit",
|
|
118
|
-
size: 16
|
|
119
|
-
});
|
|
120
|
-
|
|
121
115
|
const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inProps, ref) {
|
|
122
116
|
const props = useThemeProps({
|
|
123
117
|
props: inProps,
|
|
@@ -127,13 +121,21 @@ const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inPro
|
|
|
127
121
|
const {
|
|
128
122
|
children,
|
|
129
123
|
disabled = false,
|
|
124
|
+
id: idProp,
|
|
130
125
|
loading = false,
|
|
131
|
-
loadingIndicator
|
|
126
|
+
loadingIndicator: loadingIndicatorProp,
|
|
132
127
|
loadingPosition = 'center',
|
|
133
128
|
variant = 'text'
|
|
134
129
|
} = props,
|
|
135
130
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
136
131
|
|
|
132
|
+
const id = useId(idProp);
|
|
133
|
+
const loadingIndicator = loadingIndicatorProp != null ? loadingIndicatorProp : /*#__PURE__*/_jsx(CircularProgress, {
|
|
134
|
+
"aria-labelledby": id,
|
|
135
|
+
color: "inherit",
|
|
136
|
+
size: 16
|
|
137
|
+
});
|
|
138
|
+
|
|
137
139
|
const ownerState = _extends({}, props, {
|
|
138
140
|
disabled,
|
|
139
141
|
loading,
|
|
@@ -145,6 +147,7 @@ const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inPro
|
|
|
145
147
|
const classes = useUtilityClasses(ownerState);
|
|
146
148
|
return /*#__PURE__*/_jsx(LoadingButtonRoot, _extends({
|
|
147
149
|
disabled: disabled || loading,
|
|
150
|
+
id: id,
|
|
148
151
|
ref: ref
|
|
149
152
|
}, other, {
|
|
150
153
|
variant: variant,
|
|
@@ -189,6 +192,11 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
|
|
|
189
192
|
*/
|
|
190
193
|
disabled: PropTypes.bool,
|
|
191
194
|
|
|
195
|
+
/**
|
|
196
|
+
* @ignore
|
|
197
|
+
*/
|
|
198
|
+
id: PropTypes.string,
|
|
199
|
+
|
|
192
200
|
/**
|
|
193
201
|
* If `true`, the loading indicator is shown.
|
|
194
202
|
* @default false
|
|
@@ -197,6 +205,8 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
|
|
|
197
205
|
|
|
198
206
|
/**
|
|
199
207
|
* Element placed before the children if the button is in loading state.
|
|
208
|
+
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
209
|
+
* By default we render a `CircularProgress` that is labelled by the button itself.
|
|
200
210
|
* @default <CircularProgress color="inherit" size={16} />
|
|
201
211
|
*/
|
|
202
212
|
loadingIndicator: PropTypes.node,
|
|
@@ -132,7 +132,11 @@ process.env.NODE_ENV !== "production" ? MobileDatePicker.propTypes
|
|
|
132
132
|
* The props used for each slot inside.
|
|
133
133
|
* @default {}
|
|
134
134
|
*/
|
|
135
|
-
componentsProps: PropTypes.
|
|
135
|
+
componentsProps: PropTypes.shape({
|
|
136
|
+
leftArrowButton: PropTypes.object,
|
|
137
|
+
rightArrowButton: PropTypes.object,
|
|
138
|
+
switchViewButton: PropTypes.object
|
|
139
|
+
}),
|
|
136
140
|
|
|
137
141
|
/**
|
|
138
142
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -174,7 +174,11 @@ process.env.NODE_ENV !== "production" ? MobileDateRangePicker.propTypes
|
|
|
174
174
|
* The props used for each slot inside.
|
|
175
175
|
* @default {}
|
|
176
176
|
*/
|
|
177
|
-
componentsProps: PropTypes.
|
|
177
|
+
componentsProps: PropTypes.shape({
|
|
178
|
+
leftArrowButton: PropTypes.object,
|
|
179
|
+
rightArrowButton: PropTypes.object,
|
|
180
|
+
switchViewButton: PropTypes.object
|
|
181
|
+
}),
|
|
178
182
|
|
|
179
183
|
/**
|
|
180
184
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -144,7 +144,11 @@ process.env.NODE_ENV !== "production" ? MobileDateTimePicker.propTypes
|
|
|
144
144
|
* The props used for each slot inside.
|
|
145
145
|
* @default {}
|
|
146
146
|
*/
|
|
147
|
-
componentsProps: PropTypes.
|
|
147
|
+
componentsProps: PropTypes.shape({
|
|
148
|
+
leftArrowButton: PropTypes.object,
|
|
149
|
+
rightArrowButton: PropTypes.object,
|
|
150
|
+
switchViewButton: PropTypes.object
|
|
151
|
+
}),
|
|
148
152
|
|
|
149
153
|
/**
|
|
150
154
|
* Date tab icon.
|
|
@@ -106,7 +106,11 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes
|
|
|
106
106
|
* The props used for each slot inside.
|
|
107
107
|
* @default {}
|
|
108
108
|
*/
|
|
109
|
-
componentsProps: PropTypes.
|
|
109
|
+
componentsProps: PropTypes.shape({
|
|
110
|
+
leftArrowButton: PropTypes.object,
|
|
111
|
+
rightArrowButton: PropTypes.object,
|
|
112
|
+
switchViewButton: PropTypes.object
|
|
113
|
+
}),
|
|
110
114
|
|
|
111
115
|
/**
|
|
112
116
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -149,7 +149,11 @@ process.env.NODE_ENV !== "production" ? StaticDateRangePicker.propTypes
|
|
|
149
149
|
* The props used for each slot inside.
|
|
150
150
|
* @default {}
|
|
151
151
|
*/
|
|
152
|
-
componentsProps: PropTypes.
|
|
152
|
+
componentsProps: PropTypes.shape({
|
|
153
|
+
leftArrowButton: PropTypes.object,
|
|
154
|
+
rightArrowButton: PropTypes.object,
|
|
155
|
+
switchViewButton: PropTypes.object
|
|
156
|
+
}),
|
|
153
157
|
|
|
154
158
|
/**
|
|
155
159
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -118,7 +118,11 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes
|
|
|
118
118
|
* The props used for each slot inside.
|
|
119
119
|
* @default {}
|
|
120
120
|
*/
|
|
121
|
-
componentsProps: PropTypes.
|
|
121
|
+
componentsProps: PropTypes.shape({
|
|
122
|
+
leftArrowButton: PropTypes.object,
|
|
123
|
+
rightArrowButton: PropTypes.object,
|
|
124
|
+
switchViewButton: PropTypes.object
|
|
125
|
+
}),
|
|
122
126
|
|
|
123
127
|
/**
|
|
124
128
|
* Date tab icon.
|
package/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
28
28
|
|
|
29
29
|
var ClockPickerArrowSwitcher = styled(PickersArrowSwitcher, {
|
|
30
30
|
name: 'MuiClockPicker',
|
|
31
|
-
slot: '
|
|
31
|
+
slot: 'ArrowSwitcher',
|
|
32
32
|
overridesResolver: function overridesResolver(props, styles) {
|
|
33
33
|
return styles.arrowSwitcher;
|
|
34
34
|
}
|
|
@@ -305,7 +305,10 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes
|
|
|
305
305
|
/**
|
|
306
306
|
* The props used for each slot inside.
|
|
307
307
|
*/
|
|
308
|
-
componentsProps: PropTypes.
|
|
308
|
+
componentsProps: PropTypes.shape({
|
|
309
|
+
leftArrowButton: PropTypes.object,
|
|
310
|
+
rightArrowButton: PropTypes.object
|
|
311
|
+
}),
|
|
309
312
|
|
|
310
313
|
/**
|
|
311
314
|
* Selected date @DateIOType.
|
|
@@ -126,7 +126,11 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes
|
|
|
126
126
|
* The props used for each slot inside.
|
|
127
127
|
* @default {}
|
|
128
128
|
*/
|
|
129
|
-
componentsProps: PropTypes.
|
|
129
|
+
componentsProps: PropTypes.shape({
|
|
130
|
+
leftArrowButton: PropTypes.object,
|
|
131
|
+
rightArrowButton: PropTypes.object,
|
|
132
|
+
switchViewButton: PropTypes.object
|
|
133
|
+
}),
|
|
130
134
|
|
|
131
135
|
/**
|
|
132
136
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -182,7 +182,11 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes
|
|
|
182
182
|
* The props used for each slot inside.
|
|
183
183
|
* @default {}
|
|
184
184
|
*/
|
|
185
|
-
componentsProps: PropTypes.
|
|
185
|
+
componentsProps: PropTypes.shape({
|
|
186
|
+
leftArrowButton: PropTypes.object,
|
|
187
|
+
rightArrowButton: PropTypes.object,
|
|
188
|
+
switchViewButton: PropTypes.object
|
|
189
|
+
}),
|
|
186
190
|
|
|
187
191
|
/**
|
|
188
192
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -138,7 +138,11 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes
|
|
|
138
138
|
* The props used for each slot inside.
|
|
139
139
|
* @default {}
|
|
140
140
|
*/
|
|
141
|
-
componentsProps: PropTypes.
|
|
141
|
+
componentsProps: PropTypes.shape({
|
|
142
|
+
leftArrowButton: PropTypes.object,
|
|
143
|
+
rightArrowButton: PropTypes.object,
|
|
144
|
+
switchViewButton: PropTypes.object
|
|
145
|
+
}),
|
|
142
146
|
|
|
143
147
|
/**
|
|
144
148
|
* Date tab icon.
|
|
@@ -121,7 +121,11 @@ process.env.NODE_ENV !== "production" ? DesktopDatePicker.propTypes
|
|
|
121
121
|
* The props used for each slot inside.
|
|
122
122
|
* @default {}
|
|
123
123
|
*/
|
|
124
|
-
componentsProps: PropTypes.
|
|
124
|
+
componentsProps: PropTypes.shape({
|
|
125
|
+
leftArrowButton: PropTypes.object,
|
|
126
|
+
rightArrowButton: PropTypes.object,
|
|
127
|
+
switchViewButton: PropTypes.object
|
|
128
|
+
}),
|
|
125
129
|
|
|
126
130
|
/**
|
|
127
131
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -166,7 +166,11 @@ process.env.NODE_ENV !== "production" ? DesktopDateRangePicker.propTypes
|
|
|
166
166
|
* The props used for each slot inside.
|
|
167
167
|
* @default {}
|
|
168
168
|
*/
|
|
169
|
-
componentsProps: PropTypes.
|
|
169
|
+
componentsProps: PropTypes.shape({
|
|
170
|
+
leftArrowButton: PropTypes.object,
|
|
171
|
+
rightArrowButton: PropTypes.object,
|
|
172
|
+
switchViewButton: PropTypes.object
|
|
173
|
+
}),
|
|
170
174
|
|
|
171
175
|
/**
|
|
172
176
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -131,7 +131,11 @@ process.env.NODE_ENV !== "production" ? DesktopDateTimePicker.propTypes
|
|
|
131
131
|
* The props used for each slot inside.
|
|
132
132
|
* @default {}
|
|
133
133
|
*/
|
|
134
|
-
componentsProps: PropTypes.
|
|
134
|
+
componentsProps: PropTypes.shape({
|
|
135
|
+
leftArrowButton: PropTypes.object,
|
|
136
|
+
rightArrowButton: PropTypes.object,
|
|
137
|
+
switchViewButton: PropTypes.object
|
|
138
|
+
}),
|
|
135
139
|
|
|
136
140
|
/**
|
|
137
141
|
* Date tab icon.
|
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { chainPropTypes } from '@mui/utils';
|
|
7
|
-
import { capitalize } from '@mui/material/utils';
|
|
7
|
+
import { capitalize, unstable_useId as useId } from '@mui/material/utils';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
9
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import Button from '@mui/material/Button';
|
|
@@ -103,12 +103,6 @@ var LoadingButtonLoadingIndicator = styled('div', {
|
|
|
103
103
|
right: -10
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
|
-
|
|
107
|
-
var LoadingIndicator = /*#__PURE__*/_jsx(CircularProgress, {
|
|
108
|
-
color: "inherit",
|
|
109
|
-
size: 16
|
|
110
|
-
});
|
|
111
|
-
|
|
112
106
|
var LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inProps, ref) {
|
|
113
107
|
var props = useThemeProps({
|
|
114
108
|
props: inProps,
|
|
@@ -118,15 +112,22 @@ var LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inProps
|
|
|
118
112
|
var children = props.children,
|
|
119
113
|
_props$disabled = props.disabled,
|
|
120
114
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
115
|
+
idProp = props.id,
|
|
121
116
|
_props$loading = props.loading,
|
|
122
117
|
loading = _props$loading === void 0 ? false : _props$loading,
|
|
123
|
-
|
|
124
|
-
loadingIndicator = _props$loadingIndicat === void 0 ? LoadingIndicator : _props$loadingIndicat,
|
|
118
|
+
loadingIndicatorProp = props.loadingIndicator,
|
|
125
119
|
_props$loadingPositio = props.loadingPosition,
|
|
126
120
|
loadingPosition = _props$loadingPositio === void 0 ? 'center' : _props$loadingPositio,
|
|
127
121
|
_props$variant = props.variant,
|
|
128
122
|
variant = _props$variant === void 0 ? 'text' : _props$variant,
|
|
129
|
-
other = _objectWithoutProperties(props, ["children", "disabled", "loading", "loadingIndicator", "loadingPosition", "variant"]);
|
|
123
|
+
other = _objectWithoutProperties(props, ["children", "disabled", "id", "loading", "loadingIndicator", "loadingPosition", "variant"]);
|
|
124
|
+
|
|
125
|
+
var id = useId(idProp);
|
|
126
|
+
var loadingIndicator = loadingIndicatorProp != null ? loadingIndicatorProp : /*#__PURE__*/_jsx(CircularProgress, {
|
|
127
|
+
"aria-labelledby": id,
|
|
128
|
+
color: "inherit",
|
|
129
|
+
size: 16
|
|
130
|
+
});
|
|
130
131
|
|
|
131
132
|
var ownerState = _extends({}, props, {
|
|
132
133
|
disabled: disabled,
|
|
@@ -139,6 +140,7 @@ var LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inProps
|
|
|
139
140
|
var classes = useUtilityClasses(ownerState);
|
|
140
141
|
return /*#__PURE__*/_jsx(LoadingButtonRoot, _extends({
|
|
141
142
|
disabled: disabled || loading,
|
|
143
|
+
id: id,
|
|
142
144
|
ref: ref
|
|
143
145
|
}, other, {
|
|
144
146
|
variant: variant,
|
|
@@ -183,6 +185,11 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
|
|
|
183
185
|
*/
|
|
184
186
|
disabled: PropTypes.bool,
|
|
185
187
|
|
|
188
|
+
/**
|
|
189
|
+
* @ignore
|
|
190
|
+
*/
|
|
191
|
+
id: PropTypes.string,
|
|
192
|
+
|
|
186
193
|
/**
|
|
187
194
|
* If `true`, the loading indicator is shown.
|
|
188
195
|
* @default false
|
|
@@ -191,6 +198,8 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
|
|
|
191
198
|
|
|
192
199
|
/**
|
|
193
200
|
* Element placed before the children if the button is in loading state.
|
|
201
|
+
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
202
|
+
* By default we render a `CircularProgress` that is labelled by the button itself.
|
|
194
203
|
* @default <CircularProgress color="inherit" size={16} />
|
|
195
204
|
*/
|
|
196
205
|
loadingIndicator: PropTypes.node,
|
|
@@ -135,7 +135,11 @@ process.env.NODE_ENV !== "production" ? MobileDatePicker.propTypes
|
|
|
135
135
|
* The props used for each slot inside.
|
|
136
136
|
* @default {}
|
|
137
137
|
*/
|
|
138
|
-
componentsProps: PropTypes.
|
|
138
|
+
componentsProps: PropTypes.shape({
|
|
139
|
+
leftArrowButton: PropTypes.object,
|
|
140
|
+
rightArrowButton: PropTypes.object,
|
|
141
|
+
switchViewButton: PropTypes.object
|
|
142
|
+
}),
|
|
139
143
|
|
|
140
144
|
/**
|
|
141
145
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -180,7 +180,11 @@ process.env.NODE_ENV !== "production" ? MobileDateRangePicker.propTypes
|
|
|
180
180
|
* The props used for each slot inside.
|
|
181
181
|
* @default {}
|
|
182
182
|
*/
|
|
183
|
-
componentsProps: PropTypes.
|
|
183
|
+
componentsProps: PropTypes.shape({
|
|
184
|
+
leftArrowButton: PropTypes.object,
|
|
185
|
+
rightArrowButton: PropTypes.object,
|
|
186
|
+
switchViewButton: PropTypes.object
|
|
187
|
+
}),
|
|
184
188
|
|
|
185
189
|
/**
|
|
186
190
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -147,7 +147,11 @@ process.env.NODE_ENV !== "production" ? MobileDateTimePicker.propTypes
|
|
|
147
147
|
* The props used for each slot inside.
|
|
148
148
|
* @default {}
|
|
149
149
|
*/
|
|
150
|
-
componentsProps: PropTypes.
|
|
150
|
+
componentsProps: PropTypes.shape({
|
|
151
|
+
leftArrowButton: PropTypes.object,
|
|
152
|
+
rightArrowButton: PropTypes.object,
|
|
153
|
+
switchViewButton: PropTypes.object
|
|
154
|
+
}),
|
|
151
155
|
|
|
152
156
|
/**
|
|
153
157
|
* Date tab icon.
|
|
@@ -110,7 +110,11 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes
|
|
|
110
110
|
* The props used for each slot inside.
|
|
111
111
|
* @default {}
|
|
112
112
|
*/
|
|
113
|
-
componentsProps: PropTypes.
|
|
113
|
+
componentsProps: PropTypes.shape({
|
|
114
|
+
leftArrowButton: PropTypes.object,
|
|
115
|
+
rightArrowButton: PropTypes.object,
|
|
116
|
+
switchViewButton: PropTypes.object
|
|
117
|
+
}),
|
|
114
118
|
|
|
115
119
|
/**
|
|
116
120
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -156,7 +156,11 @@ process.env.NODE_ENV !== "production" ? StaticDateRangePicker.propTypes
|
|
|
156
156
|
* The props used for each slot inside.
|
|
157
157
|
* @default {}
|
|
158
158
|
*/
|
|
159
|
-
componentsProps: PropTypes.
|
|
159
|
+
componentsProps: PropTypes.shape({
|
|
160
|
+
leftArrowButton: PropTypes.object,
|
|
161
|
+
rightArrowButton: PropTypes.object,
|
|
162
|
+
switchViewButton: PropTypes.object
|
|
163
|
+
}),
|
|
160
164
|
|
|
161
165
|
/**
|
|
162
166
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -122,7 +122,11 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes
|
|
|
122
122
|
* The props used for each slot inside.
|
|
123
123
|
* @default {}
|
|
124
124
|
*/
|
|
125
|
-
componentsProps: PropTypes.
|
|
125
|
+
componentsProps: PropTypes.shape({
|
|
126
|
+
leftArrowButton: PropTypes.object,
|
|
127
|
+
rightArrowButton: PropTypes.object,
|
|
128
|
+
switchViewButton: PropTypes.object
|
|
129
|
+
}),
|
|
126
130
|
|
|
127
131
|
/**
|
|
128
132
|
* Date tab icon.
|
package/legacy/index.js
CHANGED
|
@@ -30,7 +30,7 @@ const useUtilityClasses = ownerState => {
|
|
|
30
30
|
|
|
31
31
|
const ClockPickerArrowSwitcher = styled(PickersArrowSwitcher, {
|
|
32
32
|
name: 'MuiClockPicker',
|
|
33
|
-
slot: '
|
|
33
|
+
slot: 'ArrowSwitcher',
|
|
34
34
|
overridesResolver: (props, styles) => styles.arrowSwitcher
|
|
35
35
|
})({
|
|
36
36
|
position: 'absolute',
|
|
@@ -266,7 +266,10 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes
|
|
|
266
266
|
/**
|
|
267
267
|
* The props used for each slot inside.
|
|
268
268
|
*/
|
|
269
|
-
componentsProps: PropTypes.
|
|
269
|
+
componentsProps: PropTypes.shape({
|
|
270
|
+
leftArrowButton: PropTypes.object,
|
|
271
|
+
rightArrowButton: PropTypes.object
|
|
272
|
+
}),
|
|
270
273
|
|
|
271
274
|
/**
|
|
272
275
|
* Selected date @DateIOType.
|
|
@@ -128,7 +128,11 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes
|
|
|
128
128
|
* The props used for each slot inside.
|
|
129
129
|
* @default {}
|
|
130
130
|
*/
|
|
131
|
-
componentsProps: PropTypes.
|
|
131
|
+
componentsProps: PropTypes.shape({
|
|
132
|
+
leftArrowButton: PropTypes.object,
|
|
133
|
+
rightArrowButton: PropTypes.object,
|
|
134
|
+
switchViewButton: PropTypes.object
|
|
135
|
+
}),
|
|
132
136
|
|
|
133
137
|
/**
|
|
134
138
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -176,7 +176,11 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes
|
|
|
176
176
|
* The props used for each slot inside.
|
|
177
177
|
* @default {}
|
|
178
178
|
*/
|
|
179
|
-
componentsProps: PropTypes.
|
|
179
|
+
componentsProps: PropTypes.shape({
|
|
180
|
+
leftArrowButton: PropTypes.object,
|
|
181
|
+
rightArrowButton: PropTypes.object,
|
|
182
|
+
switchViewButton: PropTypes.object
|
|
183
|
+
}),
|
|
180
184
|
|
|
181
185
|
/**
|
|
182
186
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -140,7 +140,11 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes
|
|
|
140
140
|
* The props used for each slot inside.
|
|
141
141
|
* @default {}
|
|
142
142
|
*/
|
|
143
|
-
componentsProps: PropTypes.
|
|
143
|
+
componentsProps: PropTypes.shape({
|
|
144
|
+
leftArrowButton: PropTypes.object,
|
|
145
|
+
rightArrowButton: PropTypes.object,
|
|
146
|
+
switchViewButton: PropTypes.object
|
|
147
|
+
}),
|
|
144
148
|
|
|
145
149
|
/**
|
|
146
150
|
* Date tab icon.
|
|
@@ -119,7 +119,11 @@ process.env.NODE_ENV !== "production" ? DesktopDatePicker.propTypes
|
|
|
119
119
|
* The props used for each slot inside.
|
|
120
120
|
* @default {}
|
|
121
121
|
*/
|
|
122
|
-
componentsProps: PropTypes.
|
|
122
|
+
componentsProps: PropTypes.shape({
|
|
123
|
+
leftArrowButton: PropTypes.object,
|
|
124
|
+
rightArrowButton: PropTypes.object,
|
|
125
|
+
switchViewButton: PropTypes.object
|
|
126
|
+
}),
|
|
123
127
|
|
|
124
128
|
/**
|
|
125
129
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -160,7 +160,11 @@ process.env.NODE_ENV !== "production" ? DesktopDateRangePicker.propTypes
|
|
|
160
160
|
* The props used for each slot inside.
|
|
161
161
|
* @default {}
|
|
162
162
|
*/
|
|
163
|
-
componentsProps: PropTypes.
|
|
163
|
+
componentsProps: PropTypes.shape({
|
|
164
|
+
leftArrowButton: PropTypes.object,
|
|
165
|
+
rightArrowButton: PropTypes.object,
|
|
166
|
+
switchViewButton: PropTypes.object
|
|
167
|
+
}),
|
|
164
168
|
|
|
165
169
|
/**
|
|
166
170
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -129,7 +129,11 @@ process.env.NODE_ENV !== "production" ? DesktopDateTimePicker.propTypes
|
|
|
129
129
|
* The props used for each slot inside.
|
|
130
130
|
* @default {}
|
|
131
131
|
*/
|
|
132
|
-
componentsProps: PropTypes.
|
|
132
|
+
componentsProps: PropTypes.shape({
|
|
133
|
+
leftArrowButton: PropTypes.object,
|
|
134
|
+
rightArrowButton: PropTypes.object,
|
|
135
|
+
switchViewButton: PropTypes.object
|
|
136
|
+
}),
|
|
133
137
|
|
|
134
138
|
/**
|
|
135
139
|
* Date tab icon.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "disabled", "loading", "loadingIndicator", "loadingPosition", "variant"];
|
|
3
|
+
const _excluded = ["children", "disabled", "id", "loading", "loadingIndicator", "loadingPosition", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { chainPropTypes } from '@mui/utils';
|
|
7
|
-
import { capitalize } from '@mui/material/utils';
|
|
7
|
+
import { capitalize, unstable_useId as useId } from '@mui/material/utils';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
9
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import Button from '@mui/material/Button';
|
|
@@ -112,12 +112,6 @@ const LoadingButtonLoadingIndicator = styled('div', {
|
|
|
112
112
|
position: 'relative',
|
|
113
113
|
right: -10
|
|
114
114
|
}));
|
|
115
|
-
|
|
116
|
-
const LoadingIndicator = /*#__PURE__*/_jsx(CircularProgress, {
|
|
117
|
-
color: "inherit",
|
|
118
|
-
size: 16
|
|
119
|
-
});
|
|
120
|
-
|
|
121
115
|
const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inProps, ref) {
|
|
122
116
|
const props = useThemeProps({
|
|
123
117
|
props: inProps,
|
|
@@ -127,13 +121,22 @@ const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inPro
|
|
|
127
121
|
const {
|
|
128
122
|
children,
|
|
129
123
|
disabled = false,
|
|
124
|
+
id: idProp,
|
|
130
125
|
loading = false,
|
|
131
|
-
loadingIndicator
|
|
126
|
+
loadingIndicator: loadingIndicatorProp,
|
|
132
127
|
loadingPosition = 'center',
|
|
133
128
|
variant = 'text'
|
|
134
129
|
} = props,
|
|
135
130
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
136
131
|
|
|
132
|
+
const id = useId(idProp);
|
|
133
|
+
|
|
134
|
+
const loadingIndicator = loadingIndicatorProp ?? /*#__PURE__*/_jsx(CircularProgress, {
|
|
135
|
+
"aria-labelledby": id,
|
|
136
|
+
color: "inherit",
|
|
137
|
+
size: 16
|
|
138
|
+
});
|
|
139
|
+
|
|
137
140
|
const ownerState = _extends({}, props, {
|
|
138
141
|
disabled,
|
|
139
142
|
loading,
|
|
@@ -145,6 +148,7 @@ const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inPro
|
|
|
145
148
|
const classes = useUtilityClasses(ownerState);
|
|
146
149
|
return /*#__PURE__*/_jsx(LoadingButtonRoot, _extends({
|
|
147
150
|
disabled: disabled || loading,
|
|
151
|
+
id: id,
|
|
148
152
|
ref: ref
|
|
149
153
|
}, other, {
|
|
150
154
|
variant: variant,
|
|
@@ -189,6 +193,11 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
|
|
|
189
193
|
*/
|
|
190
194
|
disabled: PropTypes.bool,
|
|
191
195
|
|
|
196
|
+
/**
|
|
197
|
+
* @ignore
|
|
198
|
+
*/
|
|
199
|
+
id: PropTypes.string,
|
|
200
|
+
|
|
192
201
|
/**
|
|
193
202
|
* If `true`, the loading indicator is shown.
|
|
194
203
|
* @default false
|
|
@@ -197,6 +206,8 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
|
|
|
197
206
|
|
|
198
207
|
/**
|
|
199
208
|
* Element placed before the children if the button is in loading state.
|
|
209
|
+
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
210
|
+
* By default we render a `CircularProgress` that is labelled by the button itself.
|
|
200
211
|
* @default <CircularProgress color="inherit" size={16} />
|
|
201
212
|
*/
|
|
202
213
|
loadingIndicator: PropTypes.node,
|
|
@@ -132,7 +132,11 @@ process.env.NODE_ENV !== "production" ? MobileDatePicker.propTypes
|
|
|
132
132
|
* The props used for each slot inside.
|
|
133
133
|
* @default {}
|
|
134
134
|
*/
|
|
135
|
-
componentsProps: PropTypes.
|
|
135
|
+
componentsProps: PropTypes.shape({
|
|
136
|
+
leftArrowButton: PropTypes.object,
|
|
137
|
+
rightArrowButton: PropTypes.object,
|
|
138
|
+
switchViewButton: PropTypes.object
|
|
139
|
+
}),
|
|
136
140
|
|
|
137
141
|
/**
|
|
138
142
|
* Default calendar month displayed when `value={null}`.
|
|
@@ -174,7 +174,11 @@ process.env.NODE_ENV !== "production" ? MobileDateRangePicker.propTypes
|
|
|
174
174
|
* The props used for each slot inside.
|
|
175
175
|
* @default {}
|
|
176
176
|
*/
|
|
177
|
-
componentsProps: PropTypes.
|
|
177
|
+
componentsProps: PropTypes.shape({
|
|
178
|
+
leftArrowButton: PropTypes.object,
|
|
179
|
+
rightArrowButton: PropTypes.object,
|
|
180
|
+
switchViewButton: PropTypes.object
|
|
181
|
+
}),
|
|
178
182
|
|
|
179
183
|
/**
|
|
180
184
|
* Default calendar month displayed when `value={null}`.
|