@mui/x-date-pickers 6.19.4 → 6.19.6
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 +112 -10
- package/DateCalendar/DateCalendar.js +3 -0
- package/DateCalendar/DateCalendar.types.d.ts +3 -0
- package/DateCalendar/DayCalendar.d.ts +3 -0
- package/DateCalendar/PickersFadeTransitionGroup.d.ts +3 -0
- package/DateCalendar/PickersSlideTransition.d.ts +3 -0
- package/DateCalendar/useCalendarState.js +2 -3
- package/DatePicker/DatePickerToolbar.d.ts +5 -4
- package/DatePicker/DatePickerToolbar.js +11 -3
- package/DateTimePicker/DateTimePickerTabs.d.ts +2 -2
- package/DateTimePicker/DateTimePickerTabs.js +7 -1
- package/DateTimePicker/DateTimePickerToolbar.d.ts +2 -2
- package/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/PickersLayout/PickersLayout.js +6 -0
- package/PickersLayout/PickersLayout.types.d.ts +6 -0
- package/TimePicker/TimePickerToolbar.d.ts +5 -4
- package/TimePicker/TimePickerToolbar.js +11 -3
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +3 -0
- package/internals/components/PickersPopper.d.ts +3 -0
- package/internals/models/props/tabs.d.ts +6 -0
- package/internals/models/props/toolbar.d.ts +3 -0
- package/legacy/DateCalendar/DateCalendar.js +3 -0
- package/legacy/DateCalendar/useCalendarState.js +2 -3
- package/legacy/DatePicker/DatePickerToolbar.js +10 -2
- package/legacy/DateTimePicker/DateTimePickerTabs.js +7 -1
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/legacy/PickersLayout/PickersLayout.js +6 -0
- package/legacy/TimePicker/TimePickerToolbar.js +10 -2
- package/legacy/index.js +1 -1
- package/legacy/locales/koKR.js +1 -2
- package/legacy/locales/zhCN.js +2 -3
- package/locales/koKR.js +1 -2
- package/locales/zhCN.js +2 -3
- package/modern/DateCalendar/DateCalendar.js +3 -0
- package/modern/DateCalendar/useCalendarState.js +2 -3
- package/modern/DatePicker/DatePickerToolbar.js +11 -3
- package/modern/DateTimePicker/DateTimePickerTabs.js +7 -1
- package/modern/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/modern/PickersLayout/PickersLayout.js +6 -0
- package/modern/TimePicker/TimePickerToolbar.js +11 -3
- package/modern/index.js +1 -1
- package/modern/locales/koKR.js +1 -2
- package/modern/locales/zhCN.js +2 -3
- package/node/DateCalendar/DateCalendar.js +3 -0
- package/node/DateCalendar/useCalendarState.js +1 -2
- package/node/DatePicker/DatePickerToolbar.js +11 -3
- package/node/DateTimePicker/DateTimePickerTabs.js +7 -1
- package/node/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/node/PickersLayout/PickersLayout.js +6 -0
- package/node/TimePicker/TimePickerToolbar.js +11 -3
- package/node/index.js +1 -1
- package/node/locales/koKR.js +1 -2
- package/node/locales/zhCN.js +2 -3
- package/package.json +1 -1
|
@@ -73,7 +73,8 @@ var DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
73
73
|
view = props.view,
|
|
74
74
|
_props$hidden = props.hidden,
|
|
75
75
|
hidden = _props$hidden === void 0 ? typeof window === 'undefined' || window.innerHeight < 667 : _props$hidden,
|
|
76
|
-
className = props.className
|
|
76
|
+
className = props.className,
|
|
77
|
+
sx = props.sx;
|
|
77
78
|
var localeText = useLocaleText();
|
|
78
79
|
var classes = useUtilityClasses(props);
|
|
79
80
|
var handleChange = function handleChange(event, value) {
|
|
@@ -88,6 +89,7 @@ var DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
88
89
|
value: viewToTab(view),
|
|
89
90
|
onChange: handleChange,
|
|
90
91
|
className: clsx(className, classes.root),
|
|
92
|
+
sx: sx,
|
|
91
93
|
children: [/*#__PURE__*/_jsx(Tab, {
|
|
92
94
|
value: "date",
|
|
93
95
|
"aria-label": localeText.dateTableLabel,
|
|
@@ -129,6 +131,10 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
129
131
|
* @param {TView} view The view to open
|
|
130
132
|
*/
|
|
131
133
|
onViewChange: PropTypes.func.isRequired,
|
|
134
|
+
/**
|
|
135
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
136
|
+
*/
|
|
137
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
132
138
|
/**
|
|
133
139
|
* Time tab icon.
|
|
134
140
|
* @default Time
|
|
@@ -352,6 +352,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
352
352
|
*/
|
|
353
353
|
onViewChange: PropTypes.func.isRequired,
|
|
354
354
|
readOnly: PropTypes.bool,
|
|
355
|
+
/**
|
|
356
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
357
|
+
*/
|
|
355
358
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
356
359
|
titleId: PropTypes.string,
|
|
357
360
|
/**
|
|
@@ -120,6 +120,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
120
120
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
121
121
|
// ----------------------------------------------------------------------
|
|
122
122
|
children: PropTypes.node,
|
|
123
|
+
/**
|
|
124
|
+
* Override or extend the styles applied to the component.
|
|
125
|
+
*/
|
|
123
126
|
classes: PropTypes.object,
|
|
124
127
|
className: PropTypes.string,
|
|
125
128
|
/**
|
|
@@ -162,6 +165,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
162
165
|
* @default {}
|
|
163
166
|
*/
|
|
164
167
|
slots: PropTypes.object,
|
|
168
|
+
/**
|
|
169
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
170
|
+
*/
|
|
165
171
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
166
172
|
value: PropTypes.any,
|
|
167
173
|
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
var _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly"];
|
|
4
|
+
var _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
|
|
5
5
|
import * as React from 'react';
|
|
6
|
+
import clsx from 'clsx';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import { useTheme, styled, useThemeProps } from '@mui/material/styles';
|
|
8
9
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
@@ -132,6 +133,7 @@ function TimePickerToolbar(inProps) {
|
|
|
132
133
|
views = props.views,
|
|
133
134
|
disabled = props.disabled,
|
|
134
135
|
readOnly = props.readOnly,
|
|
136
|
+
className = props.className,
|
|
135
137
|
other = _objectWithoutProperties(props, _excluded);
|
|
136
138
|
var utils = useUtils();
|
|
137
139
|
var localeText = useLocaleText();
|
|
@@ -159,7 +161,7 @@ function TimePickerToolbar(inProps) {
|
|
|
159
161
|
toolbarTitle: localeText.timePickerToolbarTitle,
|
|
160
162
|
isLandscape: isLandscape,
|
|
161
163
|
ownerState: ownerState,
|
|
162
|
-
className: classes.root
|
|
164
|
+
className: clsx(classes.root, className)
|
|
163
165
|
}, other, {
|
|
164
166
|
children: [/*#__PURE__*/_jsxs(TimePickerToolbarHourMinuteLabel, {
|
|
165
167
|
className: classes.hourMinuteLabel,
|
|
@@ -222,6 +224,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
222
224
|
// ----------------------------------------------------------------------
|
|
223
225
|
ampm: PropTypes.bool,
|
|
224
226
|
ampmInClock: PropTypes.bool,
|
|
227
|
+
/**
|
|
228
|
+
* Override or extend the styles applied to the component.
|
|
229
|
+
*/
|
|
225
230
|
classes: PropTypes.object,
|
|
226
231
|
/**
|
|
227
232
|
* className applied to the root component.
|
|
@@ -242,6 +247,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
242
247
|
*/
|
|
243
248
|
onViewChange: PropTypes.func.isRequired,
|
|
244
249
|
readOnly: PropTypes.bool,
|
|
250
|
+
/**
|
|
251
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
252
|
+
*/
|
|
245
253
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
246
254
|
titleId: PropTypes.string,
|
|
247
255
|
/**
|
package/legacy/index.js
CHANGED
package/legacy/locales/koKR.js
CHANGED
|
@@ -61,8 +61,7 @@ var koKRPickers = {
|
|
|
61
61
|
openTimePickerDialogue: function openTimePickerDialogue(value, utils) {
|
|
62
62
|
return value !== null && utils.isValid(value) ? "\uC2DC\uAC04\uC744 \uC120\uD0DD\uD558\uC138\uC694. \uD604\uC7AC \uC120\uD0DD\uB41C \uC2DC\uAC04\uC740 ".concat(utils.format(value, 'fullTime'), "\uC785\uB2C8\uB2E4.") : '시간을 선택하세요';
|
|
63
63
|
},
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
fieldClearLabel: '지우기',
|
|
66
65
|
// Table labels
|
|
67
66
|
timeTableLabel: '선택한 시간',
|
|
68
67
|
dateTableLabel: '선택한 날짜',
|
package/legacy/locales/zhCN.js
CHANGED
|
@@ -3,7 +3,7 @@ var views = {
|
|
|
3
3
|
hours: '小时',
|
|
4
4
|
minutes: '分钟',
|
|
5
5
|
seconds: '秒',
|
|
6
|
-
meridiem: '
|
|
6
|
+
meridiem: '十二小时制'
|
|
7
7
|
};
|
|
8
8
|
var zhCNPickers = {
|
|
9
9
|
// Calendar navigation
|
|
@@ -61,8 +61,7 @@ var zhCNPickers = {
|
|
|
61
61
|
openTimePickerDialogue: function openTimePickerDialogue(value, utils) {
|
|
62
62
|
return value !== null && utils.isValid(value) ? "\u9009\u62E9\u65F6\u95F4\uFF0C\u5DF2\u9009\u62E9".concat(utils.format(value, 'fullTime')) : '选择时间';
|
|
63
63
|
},
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
fieldClearLabel: '清除',
|
|
66
65
|
// Table labels
|
|
67
66
|
timeTableLabel: '选择时间',
|
|
68
67
|
dateTableLabel: '选择日期',
|
package/locales/koKR.js
CHANGED
|
@@ -41,8 +41,7 @@ const koKRPickers = {
|
|
|
41
41
|
// Open picker labels
|
|
42
42
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `날짜를 선택하세요. 현재 선택된 날짜는 ${utils.format(value, 'fullDate')}입니다.` : '날짜를 선택하세요',
|
|
43
43
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `시간을 선택하세요. 현재 선택된 시간은 ${utils.format(value, 'fullTime')}입니다.` : '시간을 선택하세요',
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
fieldClearLabel: '지우기',
|
|
46
45
|
// Table labels
|
|
47
46
|
timeTableLabel: '선택한 시간',
|
|
48
47
|
dateTableLabel: '선택한 날짜',
|
package/locales/zhCN.js
CHANGED
|
@@ -3,7 +3,7 @@ const views = {
|
|
|
3
3
|
hours: '小时',
|
|
4
4
|
minutes: '分钟',
|
|
5
5
|
seconds: '秒',
|
|
6
|
-
meridiem: '
|
|
6
|
+
meridiem: '十二小时制'
|
|
7
7
|
};
|
|
8
8
|
const zhCNPickers = {
|
|
9
9
|
// Calendar navigation
|
|
@@ -41,8 +41,7 @@ const zhCNPickers = {
|
|
|
41
41
|
// Open picker labels
|
|
42
42
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `选择日期,已选择${utils.format(value, 'fullDate')}` : '选择日期',
|
|
43
43
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `选择时间,已选择${utils.format(value, 'fullTime')}` : '选择时间',
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
fieldClearLabel: '清除',
|
|
46
45
|
// Table labels
|
|
47
46
|
timeTableLabel: '选择时间',
|
|
48
47
|
dateTableLabel: '选择日期',
|
|
@@ -360,6 +360,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
360
360
|
* - the `input` element if there is a field rendered.
|
|
361
361
|
*/
|
|
362
362
|
autoFocus: PropTypes.bool,
|
|
363
|
+
/**
|
|
364
|
+
* Override or extend the styles applied to the component.
|
|
365
|
+
*/
|
|
363
366
|
classes: PropTypes.object,
|
|
364
367
|
className: PropTypes.string,
|
|
365
368
|
/**
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
4
4
|
import { useIsDateDisabled } from './useIsDateDisabled';
|
|
5
|
-
import { useUtils
|
|
5
|
+
import { useUtils } from '../internals/hooks/useUtils';
|
|
6
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
7
|
import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
|
|
8
8
|
export const createCalendarStateReducer = (reduceAnimations, disableSwitchToMonthOnDayFocus, utils) => (state, action) => {
|
|
@@ -49,7 +49,6 @@ export const useCalendarState = params => {
|
|
|
49
49
|
shouldDisableDate,
|
|
50
50
|
timezone
|
|
51
51
|
} = params;
|
|
52
|
-
const now = useNow(timezone);
|
|
53
52
|
const utils = useUtils();
|
|
54
53
|
const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
|
|
55
54
|
const referenceDate = React.useMemo(() => {
|
|
@@ -72,7 +71,7 @@ export const useCalendarState = params => {
|
|
|
72
71
|
);
|
|
73
72
|
const [calendarState, dispatch] = React.useReducer(reducerFn, {
|
|
74
73
|
isMonthSwitchingAnimating: false,
|
|
75
|
-
focusedDay:
|
|
74
|
+
focusedDay: referenceDate,
|
|
76
75
|
currentMonth: utils.startOfMonth(referenceDate),
|
|
77
76
|
slideDirection: 'left'
|
|
78
77
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"];
|
|
3
|
+
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import Typography from '@mui/material/Typography';
|
|
7
8
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
@@ -55,7 +56,8 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
55
56
|
isLandscape,
|
|
56
57
|
toolbarFormat,
|
|
57
58
|
toolbarPlaceholder = '––',
|
|
58
|
-
views
|
|
59
|
+
views,
|
|
60
|
+
className
|
|
59
61
|
} = props,
|
|
60
62
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
61
63
|
const utils = useUtils();
|
|
@@ -76,7 +78,7 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
76
78
|
ref: ref,
|
|
77
79
|
toolbarTitle: localeText.datePickerToolbarTitle,
|
|
78
80
|
isLandscape: isLandscape,
|
|
79
|
-
className: classes.root
|
|
81
|
+
className: clsx(classes.root, className)
|
|
80
82
|
}, other, {
|
|
81
83
|
children: /*#__PURE__*/_jsx(DatePickerToolbarTitle, {
|
|
82
84
|
variant: "h4",
|
|
@@ -92,6 +94,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
92
94
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
93
95
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
94
96
|
// ----------------------------------------------------------------------
|
|
97
|
+
/**
|
|
98
|
+
* Override or extend the styles applied to the component.
|
|
99
|
+
*/
|
|
95
100
|
classes: PropTypes.object,
|
|
96
101
|
/**
|
|
97
102
|
* className applied to the root component.
|
|
@@ -112,6 +117,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
112
117
|
*/
|
|
113
118
|
onViewChange: PropTypes.func.isRequired,
|
|
114
119
|
readOnly: PropTypes.bool,
|
|
120
|
+
/**
|
|
121
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
122
|
+
*/
|
|
115
123
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
116
124
|
titleId: PropTypes.string,
|
|
117
125
|
/**
|
|
@@ -70,7 +70,8 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
70
70
|
timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
|
|
71
71
|
view,
|
|
72
72
|
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
73
|
-
className
|
|
73
|
+
className,
|
|
74
|
+
sx
|
|
74
75
|
} = props;
|
|
75
76
|
const localeText = useLocaleText();
|
|
76
77
|
const classes = useUtilityClasses(props);
|
|
@@ -86,6 +87,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
86
87
|
value: viewToTab(view),
|
|
87
88
|
onChange: handleChange,
|
|
88
89
|
className: clsx(className, classes.root),
|
|
90
|
+
sx: sx,
|
|
89
91
|
children: [/*#__PURE__*/_jsx(Tab, {
|
|
90
92
|
value: "date",
|
|
91
93
|
"aria-label": localeText.dateTableLabel,
|
|
@@ -127,6 +129,10 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
127
129
|
* @param {TView} view The view to open
|
|
128
130
|
*/
|
|
129
131
|
onViewChange: PropTypes.func.isRequired,
|
|
132
|
+
/**
|
|
133
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
134
|
+
*/
|
|
135
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
130
136
|
/**
|
|
131
137
|
* Time tab icon.
|
|
132
138
|
* @default Time
|
|
@@ -327,6 +327,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
327
327
|
*/
|
|
328
328
|
onViewChange: PropTypes.func.isRequired,
|
|
329
329
|
readOnly: PropTypes.bool,
|
|
330
|
+
/**
|
|
331
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
332
|
+
*/
|
|
330
333
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
331
334
|
titleId: PropTypes.string,
|
|
332
335
|
/**
|
|
@@ -122,6 +122,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
122
122
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
123
123
|
// ----------------------------------------------------------------------
|
|
124
124
|
children: PropTypes.node,
|
|
125
|
+
/**
|
|
126
|
+
* Override or extend the styles applied to the component.
|
|
127
|
+
*/
|
|
125
128
|
classes: PropTypes.object,
|
|
126
129
|
className: PropTypes.string,
|
|
127
130
|
/**
|
|
@@ -164,6 +167,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
164
167
|
* @default {}
|
|
165
168
|
*/
|
|
166
169
|
slots: PropTypes.object,
|
|
170
|
+
/**
|
|
171
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
172
|
+
*/
|
|
167
173
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
168
174
|
value: PropTypes.any,
|
|
169
175
|
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly"];
|
|
3
|
+
const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import { useTheme, styled, useThemeProps } from '@mui/material/styles';
|
|
7
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
@@ -132,7 +133,8 @@ function TimePickerToolbar(inProps) {
|
|
|
132
133
|
onViewChange,
|
|
133
134
|
views,
|
|
134
135
|
disabled,
|
|
135
|
-
readOnly
|
|
136
|
+
readOnly,
|
|
137
|
+
className
|
|
136
138
|
} = props,
|
|
137
139
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
138
140
|
const utils = useUtils();
|
|
@@ -160,7 +162,7 @@ function TimePickerToolbar(inProps) {
|
|
|
160
162
|
toolbarTitle: localeText.timePickerToolbarTitle,
|
|
161
163
|
isLandscape: isLandscape,
|
|
162
164
|
ownerState: ownerState,
|
|
163
|
-
className: classes.root
|
|
165
|
+
className: clsx(classes.root, className)
|
|
164
166
|
}, other, {
|
|
165
167
|
children: [/*#__PURE__*/_jsxs(TimePickerToolbarHourMinuteLabel, {
|
|
166
168
|
className: classes.hourMinuteLabel,
|
|
@@ -213,6 +215,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
213
215
|
// ----------------------------------------------------------------------
|
|
214
216
|
ampm: PropTypes.bool,
|
|
215
217
|
ampmInClock: PropTypes.bool,
|
|
218
|
+
/**
|
|
219
|
+
* Override or extend the styles applied to the component.
|
|
220
|
+
*/
|
|
216
221
|
classes: PropTypes.object,
|
|
217
222
|
/**
|
|
218
223
|
* className applied to the root component.
|
|
@@ -233,6 +238,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
233
238
|
*/
|
|
234
239
|
onViewChange: PropTypes.func.isRequired,
|
|
235
240
|
readOnly: PropTypes.bool,
|
|
241
|
+
/**
|
|
242
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
243
|
+
*/
|
|
236
244
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
237
245
|
titleId: PropTypes.string,
|
|
238
246
|
/**
|
package/modern/index.js
CHANGED
package/modern/locales/koKR.js
CHANGED
|
@@ -41,8 +41,7 @@ const koKRPickers = {
|
|
|
41
41
|
// Open picker labels
|
|
42
42
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `날짜를 선택하세요. 현재 선택된 날짜는 ${utils.format(value, 'fullDate')}입니다.` : '날짜를 선택하세요',
|
|
43
43
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `시간을 선택하세요. 현재 선택된 시간은 ${utils.format(value, 'fullTime')}입니다.` : '시간을 선택하세요',
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
fieldClearLabel: '지우기',
|
|
46
45
|
// Table labels
|
|
47
46
|
timeTableLabel: '선택한 시간',
|
|
48
47
|
dateTableLabel: '선택한 날짜',
|
package/modern/locales/zhCN.js
CHANGED
|
@@ -3,7 +3,7 @@ const views = {
|
|
|
3
3
|
hours: '小时',
|
|
4
4
|
minutes: '分钟',
|
|
5
5
|
seconds: '秒',
|
|
6
|
-
meridiem: '
|
|
6
|
+
meridiem: '十二小时制'
|
|
7
7
|
};
|
|
8
8
|
const zhCNPickers = {
|
|
9
9
|
// Calendar navigation
|
|
@@ -41,8 +41,7 @@ const zhCNPickers = {
|
|
|
41
41
|
// Open picker labels
|
|
42
42
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `选择日期,已选择${utils.format(value, 'fullDate')}` : '选择日期',
|
|
43
43
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `选择时间,已选择${utils.format(value, 'fullTime')}` : '选择时间',
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
fieldClearLabel: '清除',
|
|
46
45
|
// Table labels
|
|
47
46
|
timeTableLabel: '选择时间',
|
|
48
47
|
dateTableLabel: '选择日期',
|
|
@@ -368,6 +368,9 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
368
368
|
* - the `input` element if there is a field rendered.
|
|
369
369
|
*/
|
|
370
370
|
autoFocus: _propTypes.default.bool,
|
|
371
|
+
/**
|
|
372
|
+
* Override or extend the styles applied to the component.
|
|
373
|
+
*/
|
|
371
374
|
classes: _propTypes.default.object,
|
|
372
375
|
className: _propTypes.default.string,
|
|
373
376
|
/**
|
|
@@ -59,7 +59,6 @@ const useCalendarState = params => {
|
|
|
59
59
|
shouldDisableDate,
|
|
60
60
|
timezone
|
|
61
61
|
} = params;
|
|
62
|
-
const now = (0, _useUtils.useNow)(timezone);
|
|
63
62
|
const utils = (0, _useUtils.useUtils)();
|
|
64
63
|
const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;
|
|
65
64
|
const referenceDate = React.useMemo(() => {
|
|
@@ -82,7 +81,7 @@ const useCalendarState = params => {
|
|
|
82
81
|
);
|
|
83
82
|
const [calendarState, dispatch] = React.useReducer(reducerFn, {
|
|
84
83
|
isMonthSwitchingAnimating: false,
|
|
85
|
-
focusedDay:
|
|
84
|
+
focusedDay: referenceDate,
|
|
86
85
|
currentMonth: utils.startOfMonth(referenceDate),
|
|
87
86
|
slideDirection: 'left'
|
|
88
87
|
});
|
|
@@ -8,6 +8,7 @@ exports.DatePickerToolbar = void 0;
|
|
|
8
8
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
13
14
|
var _styles = require("@mui/material/styles");
|
|
@@ -17,7 +18,7 @@ var _useUtils = require("../internals/hooks/useUtils");
|
|
|
17
18
|
var _datePickerToolbarClasses = require("./datePickerToolbarClasses");
|
|
18
19
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"];
|
|
21
|
+
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
|
|
21
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
24
|
const useUtilityClasses = ownerState => {
|
|
@@ -64,7 +65,8 @@ const DatePickerToolbar = exports.DatePickerToolbar = /*#__PURE__*/React.forward
|
|
|
64
65
|
isLandscape,
|
|
65
66
|
toolbarFormat,
|
|
66
67
|
toolbarPlaceholder = '––',
|
|
67
|
-
views
|
|
68
|
+
views,
|
|
69
|
+
className
|
|
68
70
|
} = props,
|
|
69
71
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
70
72
|
const utils = (0, _useUtils.useUtils)();
|
|
@@ -85,7 +87,7 @@ const DatePickerToolbar = exports.DatePickerToolbar = /*#__PURE__*/React.forward
|
|
|
85
87
|
ref: ref,
|
|
86
88
|
toolbarTitle: localeText.datePickerToolbarTitle,
|
|
87
89
|
isLandscape: isLandscape,
|
|
88
|
-
className: classes.root
|
|
90
|
+
className: (0, _clsx.default)(classes.root, className)
|
|
89
91
|
}, other, {
|
|
90
92
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DatePickerToolbarTitle, {
|
|
91
93
|
variant: "h4",
|
|
@@ -101,6 +103,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
101
103
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
102
104
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
103
105
|
// ----------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* Override or extend the styles applied to the component.
|
|
108
|
+
*/
|
|
104
109
|
classes: _propTypes.default.object,
|
|
105
110
|
/**
|
|
106
111
|
* className applied to the root component.
|
|
@@ -121,6 +126,9 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
121
126
|
*/
|
|
122
127
|
onViewChange: _propTypes.default.func.isRequired,
|
|
123
128
|
readOnly: _propTypes.default.bool,
|
|
129
|
+
/**
|
|
130
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
131
|
+
*/
|
|
124
132
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
125
133
|
titleId: _propTypes.default.string,
|
|
126
134
|
/**
|
|
@@ -78,7 +78,8 @@ const DateTimePickerTabs = exports.DateTimePickerTabs = function DateTimePickerT
|
|
|
78
78
|
timeIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.TimeIcon, {}),
|
|
79
79
|
view,
|
|
80
80
|
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
81
|
-
className
|
|
81
|
+
className,
|
|
82
|
+
sx
|
|
82
83
|
} = props;
|
|
83
84
|
const localeText = (0, _useUtils.useLocaleText)();
|
|
84
85
|
const classes = useUtilityClasses(props);
|
|
@@ -94,6 +95,7 @@ const DateTimePickerTabs = exports.DateTimePickerTabs = function DateTimePickerT
|
|
|
94
95
|
value: viewToTab(view),
|
|
95
96
|
onChange: handleChange,
|
|
96
97
|
className: (0, _clsx.default)(className, classes.root),
|
|
98
|
+
sx: sx,
|
|
97
99
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
98
100
|
value: "date",
|
|
99
101
|
"aria-label": localeText.dateTableLabel,
|
|
@@ -135,6 +137,10 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
135
137
|
* @param {TView} view The view to open
|
|
136
138
|
*/
|
|
137
139
|
onViewChange: _propTypes.default.func.isRequired,
|
|
140
|
+
/**
|
|
141
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
142
|
+
*/
|
|
143
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
138
144
|
/**
|
|
139
145
|
* Time tab icon.
|
|
140
146
|
* @default Time
|
|
@@ -335,6 +335,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
335
335
|
*/
|
|
336
336
|
onViewChange: _propTypes.default.func.isRequired,
|
|
337
337
|
readOnly: _propTypes.default.bool,
|
|
338
|
+
/**
|
|
339
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
340
|
+
*/
|
|
338
341
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
339
342
|
titleId: _propTypes.default.string,
|
|
340
343
|
/**
|
|
@@ -129,6 +129,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
129
129
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
130
130
|
// ----------------------------------------------------------------------
|
|
131
131
|
children: _propTypes.default.node,
|
|
132
|
+
/**
|
|
133
|
+
* Override or extend the styles applied to the component.
|
|
134
|
+
*/
|
|
132
135
|
classes: _propTypes.default.object,
|
|
133
136
|
className: _propTypes.default.string,
|
|
134
137
|
/**
|
|
@@ -171,6 +174,9 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
171
174
|
* @default {}
|
|
172
175
|
*/
|
|
173
176
|
slots: _propTypes.default.object,
|
|
177
|
+
/**
|
|
178
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
179
|
+
*/
|
|
174
180
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
175
181
|
value: _propTypes.default.any,
|
|
176
182
|
view: _propTypes.default.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
@@ -8,6 +8,7 @@ exports.TimePickerToolbar = TimePickerToolbar;
|
|
|
8
8
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _styles = require("@mui/material/styles");
|
|
13
14
|
var _utils = require("@mui/utils");
|
|
@@ -20,7 +21,7 @@ var _dateHelpersHooks = require("../internals/hooks/date-helpers-hooks");
|
|
|
20
21
|
var _timePickerToolbarClasses = require("./timePickerToolbarClasses");
|
|
21
22
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
22
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly"];
|
|
24
|
+
const _excluded = ["ampm", "ampmInClock", "value", "isLandscape", "onChange", "view", "onViewChange", "views", "disabled", "readOnly", "className"];
|
|
24
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
25
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
27
|
const useUtilityClasses = ownerState => {
|
|
@@ -140,7 +141,8 @@ function TimePickerToolbar(inProps) {
|
|
|
140
141
|
onViewChange,
|
|
141
142
|
views,
|
|
142
143
|
disabled,
|
|
143
|
-
readOnly
|
|
144
|
+
readOnly,
|
|
145
|
+
className
|
|
144
146
|
} = props,
|
|
145
147
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
146
148
|
const utils = (0, _useUtils.useUtils)();
|
|
@@ -168,7 +170,7 @@ function TimePickerToolbar(inProps) {
|
|
|
168
170
|
toolbarTitle: localeText.timePickerToolbarTitle,
|
|
169
171
|
isLandscape: isLandscape,
|
|
170
172
|
ownerState: ownerState,
|
|
171
|
-
className: classes.root
|
|
173
|
+
className: (0, _clsx.default)(classes.root, className)
|
|
172
174
|
}, other, {
|
|
173
175
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TimePickerToolbarHourMinuteLabel, {
|
|
174
176
|
className: classes.hourMinuteLabel,
|
|
@@ -221,6 +223,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
221
223
|
// ----------------------------------------------------------------------
|
|
222
224
|
ampm: _propTypes.default.bool,
|
|
223
225
|
ampmInClock: _propTypes.default.bool,
|
|
226
|
+
/**
|
|
227
|
+
* Override or extend the styles applied to the component.
|
|
228
|
+
*/
|
|
224
229
|
classes: _propTypes.default.object,
|
|
225
230
|
/**
|
|
226
231
|
* className applied to the root component.
|
|
@@ -241,6 +246,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
241
246
|
*/
|
|
242
247
|
onViewChange: _propTypes.default.func.isRequired,
|
|
243
248
|
readOnly: _propTypes.default.bool,
|
|
249
|
+
/**
|
|
250
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
251
|
+
*/
|
|
244
252
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
245
253
|
titleId: _propTypes.default.string,
|
|
246
254
|
/**
|
package/node/index.js
CHANGED
package/node/locales/koKR.js
CHANGED
|
@@ -47,8 +47,7 @@ const koKRPickers = {
|
|
|
47
47
|
// Open picker labels
|
|
48
48
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `날짜를 선택하세요. 현재 선택된 날짜는 ${utils.format(value, 'fullDate')}입니다.` : '날짜를 선택하세요',
|
|
49
49
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `시간을 선택하세요. 현재 선택된 시간은 ${utils.format(value, 'fullTime')}입니다.` : '시간을 선택하세요',
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
fieldClearLabel: '지우기',
|
|
52
51
|
// Table labels
|
|
53
52
|
timeTableLabel: '선택한 시간',
|
|
54
53
|
dateTableLabel: '선택한 날짜',
|