@mui/x-date-pickers 7.6.2 → 7.7.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/CHANGELOG.md +81 -0
- package/DateCalendar/DateCalendar.js +3 -3
- package/DateCalendar/DateCalendar.types.d.ts +4 -4
- package/DateCalendar/DayCalendar.d.ts +3 -4
- package/MonthCalendar/MonthCalendar.js +17 -3
- package/MonthCalendar/MonthCalendar.types.d.ts +25 -0
- package/MonthCalendar/PickersMonth.d.ts +4 -0
- package/MonthCalendar/PickersMonth.js +38 -21
- package/MonthCalendar/index.d.ts +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +1 -1
- package/YearCalendar/PickersYear.d.ts +3 -0
- package/YearCalendar/PickersYear.js +34 -22
- package/YearCalendar/YearCalendar.js +17 -3
- package/YearCalendar/YearCalendar.types.d.ts +25 -0
- package/YearCalendar/index.d.ts +1 -1
- package/index.js +1 -1
- package/locales/faIR.js +19 -22
- package/locales/koKR.js +2 -2
- package/modern/DateCalendar/DateCalendar.js +3 -3
- package/modern/MonthCalendar/MonthCalendar.js +17 -3
- package/modern/MonthCalendar/PickersMonth.js +38 -21
- package/modern/YearCalendar/PickersYear.js +34 -22
- package/modern/YearCalendar/YearCalendar.js +17 -3
- package/modern/index.js +1 -1
- package/modern/locales/faIR.js +19 -22
- package/modern/locales/koKR.js +2 -2
- package/node/DateCalendar/DateCalendar.js +3 -3
- package/node/MonthCalendar/MonthCalendar.js +17 -3
- package/node/MonthCalendar/PickersMonth.js +40 -23
- package/node/YearCalendar/PickersYear.js +34 -22
- package/node/YearCalendar/YearCalendar.js +17 -3
- package/node/index.js +1 -1
- package/node/locales/faIR.js +19 -22
- package/node/locales/koKR.js +2 -2
- package/package.json +2 -2
package/locales/faIR.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
2
|
const timeViews = {
|
|
3
|
-
hours: '
|
|
4
|
-
minutes: '
|
|
5
|
-
seconds: '
|
|
3
|
+
hours: 'ساعتها',
|
|
4
|
+
minutes: 'دقیقهها',
|
|
5
|
+
seconds: 'ثانیهها',
|
|
6
6
|
meridiem: 'بعد از ظهر'
|
|
7
7
|
};
|
|
8
8
|
const faIRPickers = {
|
|
@@ -16,11 +16,10 @@ const faIRPickers = {
|
|
|
16
16
|
// DateRange labels
|
|
17
17
|
start: 'شروع',
|
|
18
18
|
end: 'پایان',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
startDate: 'تاریخ شروع',
|
|
20
|
+
startTime: 'ساعت شروع',
|
|
21
|
+
endDate: 'تاریخ پایان',
|
|
22
|
+
endTime: 'ساعت پایان',
|
|
24
23
|
// Action bar
|
|
25
24
|
cancelButtonLabel: 'لغو',
|
|
26
25
|
clearButtonLabel: 'پاک کردن',
|
|
@@ -33,9 +32,9 @@ const faIRPickers = {
|
|
|
33
32
|
dateRangePickerToolbarTitle: 'محدوده تاریخ را انتخاب کنید',
|
|
34
33
|
// Clock labels
|
|
35
34
|
clockLabelText: (view, time, adapter) => ` را انتخاب کنید ${timeViews[view]}. ${time === null ? 'هیچ ساعتی انتخاب نشده است' : `ساعت انتخاب ${adapter.format(time, 'fullTime')} می باشد`}`,
|
|
36
|
-
hoursClockNumberText: hours => `${hours}
|
|
37
|
-
minutesClockNumberText: minutes => `${minutes}
|
|
38
|
-
secondsClockNumberText: seconds => `${seconds}
|
|
35
|
+
hoursClockNumberText: hours => `${hours} ساعتها`,
|
|
36
|
+
minutesClockNumberText: minutes => `${minutes} دقیقهها`,
|
|
37
|
+
secondsClockNumberText: seconds => `${seconds} ثانیهها`,
|
|
39
38
|
// Digital clock labels
|
|
40
39
|
selectViewText: view => ` را انتخاب کنید ${timeViews[view]}`,
|
|
41
40
|
// Calendar labels
|
|
@@ -44,10 +43,9 @@ const faIRPickers = {
|
|
|
44
43
|
calendarWeekNumberAriaLabelText: weekNumber => `هفته ${weekNumber}`,
|
|
45
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
46
45
|
// Open picker labels
|
|
47
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `تاریخ را انتخاب کنید، تاریخ انتخاب شده ${utils.format(value, 'fullDate')}
|
|
48
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ساعت را انتخاب کنید، ساعت انتخاب شده ${utils.format(value, 'fullTime')}
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `تاریخ را انتخاب کنید، تاریخ انتخاب شده ${utils.format(value, 'fullDate')} میباشد` : 'تاریخ را انتخاب کنید',
|
|
47
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ساعت را انتخاب کنید، ساعت انتخاب شده ${utils.format(value, 'fullTime')} میباشد` : 'ساعت را انتخاب کنید',
|
|
48
|
+
fieldClearLabel: 'پاک کردن مقدار',
|
|
51
49
|
// Table labels
|
|
52
50
|
timeTableLabel: 'انتخاب تاریخ',
|
|
53
51
|
dateTableLabel: 'انتخاب ساعت',
|
|
@@ -64,13 +62,12 @@ const faIRPickers = {
|
|
|
64
62
|
year: 'سال',
|
|
65
63
|
month: 'ماه',
|
|
66
64
|
day: 'روز',
|
|
67
|
-
|
|
68
|
-
hours: '
|
|
69
|
-
minutes: '
|
|
70
|
-
seconds: '
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
weekDay: 'روز هفته',
|
|
66
|
+
hours: 'ساعتها',
|
|
67
|
+
minutes: 'دقیقهها',
|
|
68
|
+
seconds: 'ثانیهها',
|
|
69
|
+
meridiem: 'نیمروز',
|
|
73
70
|
// Common
|
|
74
|
-
|
|
71
|
+
empty: 'خالی'
|
|
75
72
|
};
|
|
76
73
|
export const faIR = getPickersLocalization(faIRPickers);
|
package/locales/koKR.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 koKRPickers = {
|
|
9
9
|
// Calendar navigation
|
|
@@ -33,7 +33,7 @@ const koKRPickers = {
|
|
|
33
33
|
dateRangePickerToolbarTitle: '날짜 범위 선택하기',
|
|
34
34
|
// Clock labels
|
|
35
35
|
clockLabelText: (view, time, adapter) => `${views[view]} 선택하세요. ${time === null ? '시간을 선택하지 않았습니다.' : `현재 선택된 시간은 ${adapter.format(time, 'fullTime')}입니다.`}`,
|
|
36
|
-
hoursClockNumberText: hours => `${hours}
|
|
36
|
+
hoursClockNumberText: hours => `${hours}시`,
|
|
37
37
|
minutesClockNumberText: minutes => `${minutes}분`,
|
|
38
38
|
secondsClockNumberText: seconds => `${seconds}초`,
|
|
39
39
|
// Digital clock labels
|
|
@@ -272,7 +272,9 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
272
272
|
readOnly,
|
|
273
273
|
disabled,
|
|
274
274
|
timezone,
|
|
275
|
-
gridLabelId
|
|
275
|
+
gridLabelId,
|
|
276
|
+
slots,
|
|
277
|
+
slotProps
|
|
276
278
|
};
|
|
277
279
|
const prevOpenViewRef = React.useRef(view);
|
|
278
280
|
React.useEffect(() => {
|
|
@@ -333,8 +335,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
333
335
|
fixedWeekNumber: fixedWeekNumber,
|
|
334
336
|
dayOfWeekFormatter: dayOfWeekFormatter,
|
|
335
337
|
displayWeekNumber: displayWeekNumber,
|
|
336
|
-
slots: slots,
|
|
337
|
-
slotProps: slotProps,
|
|
338
338
|
loading: loading,
|
|
339
339
|
renderLoading: renderLoading
|
|
340
340
|
}))]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId"];
|
|
3
|
+
const _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -83,7 +83,9 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
83
83
|
onFocusedViewChange,
|
|
84
84
|
monthsPerRow = 3,
|
|
85
85
|
timezone: timezoneProp,
|
|
86
|
-
gridLabelId
|
|
86
|
+
gridLabelId,
|
|
87
|
+
slots,
|
|
88
|
+
slotProps
|
|
87
89
|
} = props,
|
|
88
90
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
89
91
|
const {
|
|
@@ -218,12 +220,14 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
218
220
|
onKeyDown: handleKeyDown,
|
|
219
221
|
autoFocus: internalHasFocus && monthNumber === focusedMonth,
|
|
220
222
|
disabled: isDisabled,
|
|
221
|
-
tabIndex: monthNumber === focusedMonth ? 0 : -1,
|
|
223
|
+
tabIndex: monthNumber === focusedMonth && !isDisabled ? 0 : -1,
|
|
222
224
|
onFocus: handleMonthFocus,
|
|
223
225
|
onBlur: handleMonthBlur,
|
|
224
226
|
"aria-current": todayMonth === monthNumber ? 'date' : undefined,
|
|
225
227
|
"aria-label": monthLabel,
|
|
226
228
|
monthsPerRow: monthsPerRow,
|
|
229
|
+
slots: slots,
|
|
230
|
+
slotProps: slotProps,
|
|
227
231
|
children: monthText
|
|
228
232
|
}, monthText);
|
|
229
233
|
})
|
|
@@ -303,6 +307,16 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
303
307
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
304
308
|
*/
|
|
305
309
|
shouldDisableMonth: PropTypes.func,
|
|
310
|
+
/**
|
|
311
|
+
* The props used for each component slot.
|
|
312
|
+
* @default {}
|
|
313
|
+
*/
|
|
314
|
+
slotProps: PropTypes.object,
|
|
315
|
+
/**
|
|
316
|
+
* Overridable component slots.
|
|
317
|
+
* @default {}
|
|
318
|
+
*/
|
|
319
|
+
slots: PropTypes.object,
|
|
306
320
|
/**
|
|
307
321
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
308
322
|
*/
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["autoFocus", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "aria-label", "monthsPerRow"];
|
|
3
|
+
const _excluded = ["autoFocus", "className", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "aria-label", "monthsPerRow", "slots", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import { styled, alpha, useThemeProps } from '@mui/material/styles';
|
|
6
|
-
import {
|
|
7
|
+
import { useSlotProps } from '@mui/base/utils';
|
|
8
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
7
10
|
import { getPickersMonthUtilityClass, pickersMonthClasses } from './pickersMonthClasses';
|
|
8
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
12
|
const useUtilityClasses = ownerState => {
|
|
@@ -36,7 +39,7 @@ const PickersMonthRoot = styled('div', {
|
|
|
36
39
|
}
|
|
37
40
|
}]
|
|
38
41
|
});
|
|
39
|
-
const
|
|
42
|
+
const MonthCalendarButton = styled('button', {
|
|
40
43
|
name: 'MuiPickersMonth',
|
|
41
44
|
slot: 'MonthButton',
|
|
42
45
|
overridesResolver: (_, styles) => [styles.monthButton, {
|
|
@@ -89,6 +92,7 @@ export const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProp
|
|
|
89
92
|
});
|
|
90
93
|
const {
|
|
91
94
|
autoFocus,
|
|
95
|
+
className,
|
|
92
96
|
children,
|
|
93
97
|
disabled,
|
|
94
98
|
selected,
|
|
@@ -101,35 +105,48 @@ export const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProp
|
|
|
101
105
|
'aria-current': ariaCurrent,
|
|
102
106
|
'aria-label': ariaLabel
|
|
103
107
|
// We don't want to forward this prop to the root element
|
|
108
|
+
,
|
|
109
|
+
|
|
110
|
+
slots,
|
|
111
|
+
slotProps
|
|
104
112
|
} = props,
|
|
105
113
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
106
114
|
const ref = React.useRef(null);
|
|
107
115
|
const classes = useUtilityClasses(props);
|
|
116
|
+
|
|
117
|
+
// We can't forward the `autoFocus` to the button because it is a native button, not a MUI Button
|
|
108
118
|
useEnhancedEffect(() => {
|
|
109
119
|
if (autoFocus) {
|
|
120
|
+
// `ref.current` being `null` would be a bug in MUI.
|
|
110
121
|
ref.current?.focus();
|
|
111
122
|
}
|
|
112
123
|
}, [autoFocus]);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
disabled
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
const MonthButton = slots?.monthButton ?? MonthCalendarButton;
|
|
125
|
+
const monthButtonProps = useSlotProps({
|
|
126
|
+
elementType: MonthButton,
|
|
127
|
+
externalSlotProps: slotProps?.monthButton,
|
|
128
|
+
additionalProps: {
|
|
129
|
+
children,
|
|
130
|
+
disabled,
|
|
131
|
+
tabIndex,
|
|
132
|
+
ref,
|
|
133
|
+
type: 'button',
|
|
134
|
+
role: 'radio',
|
|
135
|
+
'aria-current': ariaCurrent,
|
|
136
|
+
'aria-checked': selected,
|
|
137
|
+
'aria-label': ariaLabel,
|
|
126
138
|
onClick: event => onClick(event, value),
|
|
127
139
|
onKeyDown: event => onKeyDown(event, value),
|
|
128
140
|
onFocus: event => onFocus(event, value),
|
|
129
|
-
onBlur: event => onBlur(event, value)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
141
|
+
onBlur: event => onBlur(event, value)
|
|
142
|
+
},
|
|
143
|
+
ownerState: props,
|
|
144
|
+
className: classes.monthButton
|
|
145
|
+
});
|
|
146
|
+
return /*#__PURE__*/_jsx(PickersMonthRoot, _extends({
|
|
147
|
+
className: clsx(classes.root, className),
|
|
148
|
+
ownerState: props
|
|
149
|
+
}, other, {
|
|
150
|
+
children: /*#__PURE__*/_jsx(MonthButton, _extends({}, monthButtonProps))
|
|
134
151
|
}));
|
|
135
152
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["autoFocus", "className", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "yearsPerRow"];
|
|
3
|
+
const _excluded = ["autoFocus", "className", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current", "yearsPerRow", "slots", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { styled, alpha, useThemeProps } from '@mui/material/styles';
|
|
7
|
+
import { useSlotProps } from '@mui/base/utils';
|
|
8
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
8
10
|
import { getPickersYearUtilityClass, pickersYearClasses } from './pickersYearClasses';
|
|
9
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
12
|
const useUtilityClasses = ownerState => {
|
|
@@ -37,7 +39,7 @@ const PickersYearRoot = styled('div', {
|
|
|
37
39
|
}
|
|
38
40
|
}]
|
|
39
41
|
});
|
|
40
|
-
const
|
|
42
|
+
const YearCalendarButton = styled('button', {
|
|
41
43
|
name: 'MuiPickersYear',
|
|
42
44
|
slot: 'YearButton',
|
|
43
45
|
overridesResolver: (_, styles) => [styles.yearButton, {
|
|
@@ -102,37 +104,47 @@ export const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps)
|
|
|
102
104
|
onBlur,
|
|
103
105
|
'aria-current': ariaCurrent
|
|
104
106
|
// We don't want to forward this prop to the root element
|
|
107
|
+
,
|
|
108
|
+
|
|
109
|
+
slots,
|
|
110
|
+
slotProps
|
|
105
111
|
} = props,
|
|
106
112
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
107
113
|
const ref = React.useRef(null);
|
|
108
114
|
const classes = useUtilityClasses(props);
|
|
109
115
|
|
|
110
116
|
// We can't forward the `autoFocus` to the button because it is a native button, not a MUI Button
|
|
111
|
-
|
|
117
|
+
useEnhancedEffect(() => {
|
|
112
118
|
if (autoFocus) {
|
|
113
119
|
// `ref.current` being `null` would be a bug in MUI.
|
|
114
|
-
ref.current
|
|
120
|
+
ref.current?.focus();
|
|
115
121
|
}
|
|
116
122
|
}, [autoFocus]);
|
|
123
|
+
const YearButton = slots?.yearButton ?? YearCalendarButton;
|
|
124
|
+
const yearButtonProps = useSlotProps({
|
|
125
|
+
elementType: YearButton,
|
|
126
|
+
externalSlotProps: slotProps?.yearButton,
|
|
127
|
+
additionalProps: {
|
|
128
|
+
children,
|
|
129
|
+
disabled,
|
|
130
|
+
tabIndex,
|
|
131
|
+
ref,
|
|
132
|
+
type: 'button',
|
|
133
|
+
role: 'radio',
|
|
134
|
+
'aria-current': ariaCurrent,
|
|
135
|
+
'aria-checked': selected,
|
|
136
|
+
onClick: event => onClick(event, value),
|
|
137
|
+
onKeyDown: event => onKeyDown(event, value),
|
|
138
|
+
onFocus: event => onFocus(event, value),
|
|
139
|
+
onBlur: event => onBlur(event, value)
|
|
140
|
+
},
|
|
141
|
+
ownerState: props,
|
|
142
|
+
className: classes.yearButton
|
|
143
|
+
});
|
|
117
144
|
return /*#__PURE__*/_jsx(PickersYearRoot, _extends({
|
|
118
145
|
className: clsx(classes.root, className),
|
|
119
146
|
ownerState: props
|
|
120
147
|
}, other, {
|
|
121
|
-
children: /*#__PURE__*/_jsx(
|
|
122
|
-
ref: ref,
|
|
123
|
-
disabled: disabled,
|
|
124
|
-
type: "button",
|
|
125
|
-
role: "radio",
|
|
126
|
-
tabIndex: disabled ? -1 : tabIndex,
|
|
127
|
-
"aria-current": ariaCurrent,
|
|
128
|
-
"aria-checked": selected,
|
|
129
|
-
onClick: event => onClick(event, value),
|
|
130
|
-
onKeyDown: event => onKeyDown(event, value),
|
|
131
|
-
onFocus: event => onFocus(event, value),
|
|
132
|
-
onBlur: event => onBlur(event, value),
|
|
133
|
-
className: classes.yearButton,
|
|
134
|
-
ownerState: props,
|
|
135
|
-
children: children
|
|
136
|
-
})
|
|
148
|
+
children: /*#__PURE__*/_jsx(YearButton, _extends({}, yearButtonProps))
|
|
137
149
|
}));
|
|
138
150
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["autoFocus", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsPerRow", "timezone", "gridLabelId"];
|
|
3
|
+
const _excluded = ["autoFocus", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -88,7 +88,9 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
88
88
|
onFocusedViewChange,
|
|
89
89
|
yearsPerRow,
|
|
90
90
|
timezone: timezoneProp,
|
|
91
|
-
gridLabelId
|
|
91
|
+
gridLabelId,
|
|
92
|
+
slots,
|
|
93
|
+
slotProps
|
|
92
94
|
} = props,
|
|
93
95
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
94
96
|
const {
|
|
@@ -244,11 +246,13 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
244
246
|
onKeyDown: handleKeyDown,
|
|
245
247
|
autoFocus: internalHasFocus && yearNumber === focusedYear,
|
|
246
248
|
disabled: isDisabled,
|
|
247
|
-
tabIndex: yearNumber === focusedYear ? 0 : -1,
|
|
249
|
+
tabIndex: yearNumber === focusedYear && !isDisabled ? 0 : -1,
|
|
248
250
|
onFocus: handleYearFocus,
|
|
249
251
|
onBlur: handleYearBlur,
|
|
250
252
|
"aria-current": todayYear === yearNumber ? 'date' : undefined,
|
|
251
253
|
yearsPerRow: yearsPerRow,
|
|
254
|
+
slots: slots,
|
|
255
|
+
slotProps: slotProps,
|
|
252
256
|
children: utils.format(year, 'year')
|
|
253
257
|
}, utils.format(year, 'year'));
|
|
254
258
|
})
|
|
@@ -323,6 +327,16 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
323
327
|
* @returns {boolean} If `true`, the year will be disabled.
|
|
324
328
|
*/
|
|
325
329
|
shouldDisableYear: PropTypes.func,
|
|
330
|
+
/**
|
|
331
|
+
* The props used for each component slot.
|
|
332
|
+
* @default {}
|
|
333
|
+
*/
|
|
334
|
+
slotProps: PropTypes.object,
|
|
335
|
+
/**
|
|
336
|
+
* Overridable component slots.
|
|
337
|
+
* @default {}
|
|
338
|
+
*/
|
|
339
|
+
slots: PropTypes.object,
|
|
326
340
|
/**
|
|
327
341
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
328
342
|
*/
|
package/modern/index.js
CHANGED
package/modern/locales/faIR.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
2
|
const timeViews = {
|
|
3
|
-
hours: '
|
|
4
|
-
minutes: '
|
|
5
|
-
seconds: '
|
|
3
|
+
hours: 'ساعتها',
|
|
4
|
+
minutes: 'دقیقهها',
|
|
5
|
+
seconds: 'ثانیهها',
|
|
6
6
|
meridiem: 'بعد از ظهر'
|
|
7
7
|
};
|
|
8
8
|
const faIRPickers = {
|
|
@@ -16,11 +16,10 @@ const faIRPickers = {
|
|
|
16
16
|
// DateRange labels
|
|
17
17
|
start: 'شروع',
|
|
18
18
|
end: 'پایان',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
startDate: 'تاریخ شروع',
|
|
20
|
+
startTime: 'ساعت شروع',
|
|
21
|
+
endDate: 'تاریخ پایان',
|
|
22
|
+
endTime: 'ساعت پایان',
|
|
24
23
|
// Action bar
|
|
25
24
|
cancelButtonLabel: 'لغو',
|
|
26
25
|
clearButtonLabel: 'پاک کردن',
|
|
@@ -33,9 +32,9 @@ const faIRPickers = {
|
|
|
33
32
|
dateRangePickerToolbarTitle: 'محدوده تاریخ را انتخاب کنید',
|
|
34
33
|
// Clock labels
|
|
35
34
|
clockLabelText: (view, time, adapter) => ` را انتخاب کنید ${timeViews[view]}. ${time === null ? 'هیچ ساعتی انتخاب نشده است' : `ساعت انتخاب ${adapter.format(time, 'fullTime')} می باشد`}`,
|
|
36
|
-
hoursClockNumberText: hours => `${hours}
|
|
37
|
-
minutesClockNumberText: minutes => `${minutes}
|
|
38
|
-
secondsClockNumberText: seconds => `${seconds}
|
|
35
|
+
hoursClockNumberText: hours => `${hours} ساعتها`,
|
|
36
|
+
minutesClockNumberText: minutes => `${minutes} دقیقهها`,
|
|
37
|
+
secondsClockNumberText: seconds => `${seconds} ثانیهها`,
|
|
39
38
|
// Digital clock labels
|
|
40
39
|
selectViewText: view => ` را انتخاب کنید ${timeViews[view]}`,
|
|
41
40
|
// Calendar labels
|
|
@@ -44,10 +43,9 @@ const faIRPickers = {
|
|
|
44
43
|
calendarWeekNumberAriaLabelText: weekNumber => `هفته ${weekNumber}`,
|
|
45
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
46
45
|
// Open picker labels
|
|
47
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `تاریخ را انتخاب کنید، تاریخ انتخاب شده ${utils.format(value, 'fullDate')}
|
|
48
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ساعت را انتخاب کنید، ساعت انتخاب شده ${utils.format(value, 'fullTime')}
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `تاریخ را انتخاب کنید، تاریخ انتخاب شده ${utils.format(value, 'fullDate')} میباشد` : 'تاریخ را انتخاب کنید',
|
|
47
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ساعت را انتخاب کنید، ساعت انتخاب شده ${utils.format(value, 'fullTime')} میباشد` : 'ساعت را انتخاب کنید',
|
|
48
|
+
fieldClearLabel: 'پاک کردن مقدار',
|
|
51
49
|
// Table labels
|
|
52
50
|
timeTableLabel: 'انتخاب تاریخ',
|
|
53
51
|
dateTableLabel: 'انتخاب ساعت',
|
|
@@ -64,13 +62,12 @@ const faIRPickers = {
|
|
|
64
62
|
year: 'سال',
|
|
65
63
|
month: 'ماه',
|
|
66
64
|
day: 'روز',
|
|
67
|
-
|
|
68
|
-
hours: '
|
|
69
|
-
minutes: '
|
|
70
|
-
seconds: '
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
weekDay: 'روز هفته',
|
|
66
|
+
hours: 'ساعتها',
|
|
67
|
+
minutes: 'دقیقهها',
|
|
68
|
+
seconds: 'ثانیهها',
|
|
69
|
+
meridiem: 'نیمروز',
|
|
73
70
|
// Common
|
|
74
|
-
|
|
71
|
+
empty: 'خالی'
|
|
75
72
|
};
|
|
76
73
|
export const faIR = getPickersLocalization(faIRPickers);
|
package/modern/locales/koKR.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 koKRPickers = {
|
|
9
9
|
// Calendar navigation
|
|
@@ -33,7 +33,7 @@ const koKRPickers = {
|
|
|
33
33
|
dateRangePickerToolbarTitle: '날짜 범위 선택하기',
|
|
34
34
|
// Clock labels
|
|
35
35
|
clockLabelText: (view, time, adapter) => `${views[view]} 선택하세요. ${time === null ? '시간을 선택하지 않았습니다.' : `현재 선택된 시간은 ${adapter.format(time, 'fullTime')}입니다.`}`,
|
|
36
|
-
hoursClockNumberText: hours => `${hours}
|
|
36
|
+
hoursClockNumberText: hours => `${hours}시`,
|
|
37
37
|
minutesClockNumberText: minutes => `${minutes}분`,
|
|
38
38
|
secondsClockNumberText: seconds => `${seconds}초`,
|
|
39
39
|
// Digital clock labels
|
|
@@ -281,7 +281,9 @@ const DateCalendar = exports.DateCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
281
281
|
readOnly,
|
|
282
282
|
disabled,
|
|
283
283
|
timezone,
|
|
284
|
-
gridLabelId
|
|
284
|
+
gridLabelId,
|
|
285
|
+
slots,
|
|
286
|
+
slotProps
|
|
285
287
|
};
|
|
286
288
|
const prevOpenViewRef = React.useRef(view);
|
|
287
289
|
React.useEffect(() => {
|
|
@@ -342,8 +344,6 @@ const DateCalendar = exports.DateCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
342
344
|
fixedWeekNumber: fixedWeekNumber,
|
|
343
345
|
dayOfWeekFormatter: dayOfWeekFormatter,
|
|
344
346
|
displayWeekNumber: displayWeekNumber,
|
|
345
|
-
slots: slots,
|
|
346
|
-
slotProps: slotProps,
|
|
347
347
|
loading: loading,
|
|
348
348
|
renderLoading: renderLoading
|
|
349
349
|
}))]
|
|
@@ -23,7 +23,7 @@ var _getDefaultReferenceDate = require("../internals/utils/getDefaultReferenceDa
|
|
|
23
23
|
var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
24
24
|
var _dimensions = require("../internals/constants/dimensions");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
|
-
const _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId"];
|
|
26
|
+
const _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
27
27
|
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); }
|
|
28
28
|
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 && {}.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; }
|
|
29
29
|
const useUtilityClasses = ownerState => {
|
|
@@ -93,7 +93,9 @@ const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(func
|
|
|
93
93
|
onFocusedViewChange,
|
|
94
94
|
monthsPerRow = 3,
|
|
95
95
|
timezone: timezoneProp,
|
|
96
|
-
gridLabelId
|
|
96
|
+
gridLabelId,
|
|
97
|
+
slots,
|
|
98
|
+
slotProps
|
|
97
99
|
} = props,
|
|
98
100
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
99
101
|
const {
|
|
@@ -228,12 +230,14 @@ const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(func
|
|
|
228
230
|
onKeyDown: handleKeyDown,
|
|
229
231
|
autoFocus: internalHasFocus && monthNumber === focusedMonth,
|
|
230
232
|
disabled: isDisabled,
|
|
231
|
-
tabIndex: monthNumber === focusedMonth ? 0 : -1,
|
|
233
|
+
tabIndex: monthNumber === focusedMonth && !isDisabled ? 0 : -1,
|
|
232
234
|
onFocus: handleMonthFocus,
|
|
233
235
|
onBlur: handleMonthBlur,
|
|
234
236
|
"aria-current": todayMonth === monthNumber ? 'date' : undefined,
|
|
235
237
|
"aria-label": monthLabel,
|
|
236
238
|
monthsPerRow: monthsPerRow,
|
|
239
|
+
slots: slots,
|
|
240
|
+
slotProps: slotProps,
|
|
237
241
|
children: monthText
|
|
238
242
|
}, monthText);
|
|
239
243
|
})
|
|
@@ -313,6 +317,16 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
313
317
|
* @returns {boolean} If `true`, the month will be disabled.
|
|
314
318
|
*/
|
|
315
319
|
shouldDisableMonth: _propTypes.default.func,
|
|
320
|
+
/**
|
|
321
|
+
* The props used for each component slot.
|
|
322
|
+
* @default {}
|
|
323
|
+
*/
|
|
324
|
+
slotProps: _propTypes.default.object,
|
|
325
|
+
/**
|
|
326
|
+
* Overridable component slots.
|
|
327
|
+
* @default {}
|
|
328
|
+
*/
|
|
329
|
+
slots: _propTypes.default.object,
|
|
316
330
|
/**
|
|
317
331
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
318
332
|
*/
|