@mui/x-date-pickers 5.0.3 โ 5.0.4
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 +61 -1
- package/CalendarPicker/CalendarPicker.js +6 -0
- package/index.js +1 -1
- package/legacy/CalendarPicker/CalendarPicker.js +6 -0
- package/legacy/index.js +1 -1
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/jaJP.js +65 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/jaJP.d.ts +35 -0
- package/locales/jaJP.js +51 -0
- package/modern/CalendarPicker/CalendarPicker.js +6 -0
- package/modern/index.js +1 -1
- package/modern/locales/index.js +1 -0
- package/modern/locales/jaJP.js +47 -0
- package/node/CalendarPicker/CalendarPicker.js +6 -0
- package/node/index.js +1 -1
- package/node/locales/index.js +13 -0
- package/node/locales/jaJP.js +60 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,67 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## 5.17.6
|
|
7
|
+
|
|
8
|
+
_Oct 6, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights โจ:
|
|
11
|
+
|
|
12
|
+
- ๐ Add Japanese (ja-JP) locale to pickers (#6365) @sho918
|
|
13
|
+
- ๐ Improve support for theme augmentation in the DataGrid (#6406) @cherniavskii
|
|
14
|
+
- ๐ Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v5.17.6` / `@mui/x-data-grid-pro@v5.17.6` / `@mui/x-data-grid-premium@v5.17.6`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Add missing `valueOptions` (#6400) @DanailH
|
|
21
|
+
- [DataGrid] Don't start edit mode when pressing <kbd>Shift</kbd> + <kbd>Space</kbd> (#6380) @m4theushw
|
|
22
|
+
- [DataGrid] Pass generics to the components in the theme augmentation (#6406) @cherniavskii
|
|
23
|
+
|
|
24
|
+
### `@mui/x-date-pickers@v5.0.4` / `@mui/x-date-pickers-pro@v5.0.4`
|
|
25
|
+
|
|
26
|
+
#### Changes
|
|
27
|
+
|
|
28
|
+
- [l10n] Add Japanese (ja-JP) locale to pickers (#6365) (#6382) @sho918
|
|
29
|
+
- [pickers] Prevent `CalendarPicker` getting focus when `autoFocus=false` (#6304) (#6362) @alexfauquette
|
|
30
|
+
- [pickers] Fix git repository location @oliviertassinari
|
|
31
|
+
|
|
32
|
+
### Docs
|
|
33
|
+
|
|
34
|
+
- [docs] Fix customized day rendering demo style (#6342) @Ambrish-git
|
|
35
|
+
|
|
36
|
+
## 5.17.5
|
|
37
|
+
|
|
38
|
+
_Sep 29, 2022_
|
|
39
|
+
|
|
40
|
+
We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights โจ:
|
|
41
|
+
|
|
42
|
+
- ๐ Add theme augmentation module to DataGridPremium (#6316) @cherniavskii
|
|
43
|
+
- ๐ Fix blank space when changing page with dynamic row height (#6320) @m4theushw
|
|
44
|
+
- ๐ Improve controlled editing demo to make easier to reuse it (#6306) @cherniavskii
|
|
45
|
+
- ๐ Bugfixes
|
|
46
|
+
|
|
47
|
+
### `@mui/x-data-grid@v5.17.5` / `@mui/x-data-grid-pro@v5.17.5` / `@mui/x-data-grid-premium@v5.17.5`
|
|
48
|
+
|
|
49
|
+
#### Changes
|
|
50
|
+
|
|
51
|
+
- [DataGrid] Fix `GridPagination` props typing (#6295) @cherniavskii
|
|
52
|
+
- [DataGrid] Fix `GridRow` not forwarding `ref` to the root element (#6303) @cherniavskii
|
|
53
|
+
- [DataGrid] Fix `undefined` value being showed in filter button tooltip text (#6271) @cherniavskii
|
|
54
|
+
- [DataGrid] Fix blank space when changing page with dynamic row height (#6320) @m4theushw
|
|
55
|
+
- [DataGrid] Revert cell/row mode if `processRowUpdate` fails (#6319) @m4theushw
|
|
56
|
+
- [DataGridPremium] Add missing `themeAugmentation` module (#6316) @cherniavskii
|
|
57
|
+
|
|
58
|
+
### Docs
|
|
59
|
+
|
|
60
|
+
- [docs] Pass model change callbacks in controlled grid editing demos (#6306) @cherniavskii
|
|
61
|
+
|
|
62
|
+
### Core
|
|
63
|
+
|
|
64
|
+
- [core] Reduce the amount of updated screenshots reported by Argos (#6310) @cherniavskii
|
|
65
|
+
|
|
66
|
+
## 5.17.4
|
|
7
67
|
|
|
8
68
|
_Sep 22, 2022_
|
|
9
69
|
|
|
@@ -257,8 +257,14 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
|
|
|
257
257
|
setInternalFocusedView(prevView => prevView === eventView ? null : prevView);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
|
+
const prevOpenViewRef = React.useRef(openView);
|
|
260
261
|
React.useEffect(() => {
|
|
261
262
|
// Set focus to the button when switching from a view to another
|
|
263
|
+
if (prevOpenViewRef.current === openView) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
prevOpenViewRef.current = openView;
|
|
262
268
|
handleFocusedViewChange(openView)(true);
|
|
263
269
|
}, [openView, handleFocusedViewChange]);
|
|
264
270
|
return /*#__PURE__*/_jsxs(CalendarPickerRoot, {
|
package/index.js
CHANGED
|
@@ -270,8 +270,14 @@ export var CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicke
|
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
272
|
});
|
|
273
|
+
var prevOpenViewRef = React.useRef(openView);
|
|
273
274
|
React.useEffect(function () {
|
|
274
275
|
// Set focus to the button when switching from a view to another
|
|
276
|
+
if (prevOpenViewRef.current === openView) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
prevOpenViewRef.current = openView;
|
|
275
281
|
handleFocusedViewChange(openView)(true);
|
|
276
282
|
}, [openView, handleFocusedViewChange]);
|
|
277
283
|
return /*#__PURE__*/_jsxs(CalendarPickerRoot, {
|
package/legacy/index.js
CHANGED
package/legacy/locales/index.js
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
+
// maps ClockPickerView to its translation
|
|
3
|
+
var clockViews = {
|
|
4
|
+
hours: 'ๆ้',
|
|
5
|
+
minutes: 'ๅ',
|
|
6
|
+
seconds: '็ง'
|
|
7
|
+
}; // maps PickersToolbar["viewType"] to its translation
|
|
8
|
+
|
|
9
|
+
var pickerViews = {
|
|
10
|
+
calendar: 'ใซใฌใณใใผ่กจ็คบ',
|
|
11
|
+
clock: 'ๆ่จ่กจ็คบ'
|
|
12
|
+
};
|
|
13
|
+
var jaJPPickers = {
|
|
14
|
+
// Calendar navigation
|
|
15
|
+
previousMonth: 'ๅ
ๆ',
|
|
16
|
+
nextMonth: 'ๆฅๆ',
|
|
17
|
+
// View navigation
|
|
18
|
+
openPreviousView: 'ๅใฎ่กจ็คบใ้ใ',
|
|
19
|
+
openNextView: 'ๆฌกใฎ่กจ็คบใ้ใ',
|
|
20
|
+
calendarViewSwitchingButtonAriaLabel: function calendarViewSwitchingButtonAriaLabel(view) {
|
|
21
|
+
return view === 'year' ? 'ๅนด้ธๆ่กจ็คบใใใซใฌใณใใผ่กจ็คบใซๅใๆฟใใ' : 'ใซใฌใณใใผ่กจ็คบใใๅนด้ธๆ่กจ็คบใซๅใๆฟใใ';
|
|
22
|
+
},
|
|
23
|
+
inputModeToggleButtonAriaLabel: function inputModeToggleButtonAriaLabel(isKeyboardInputOpen, viewType) {
|
|
24
|
+
return isKeyboardInputOpen ? "\u30C6\u30AD\u30B9\u30C8\u5165\u529B\u8868\u793A\u304B\u3089".concat(pickerViews[viewType], "\u306B\u5207\u308A\u66FF\u3048\u308B") : "".concat(pickerViews[viewType], "\u304B\u3089\u30C6\u30AD\u30B9\u30C8\u5165\u529B\u8868\u793A\u306B\u5207\u308A\u66FF\u3048\u308B");
|
|
25
|
+
},
|
|
26
|
+
// DateRange placeholders
|
|
27
|
+
start: '้ๅง',
|
|
28
|
+
end: '็ตไบ',
|
|
29
|
+
// Action bar
|
|
30
|
+
cancelButtonLabel: 'ใญใฃใณใปใซ',
|
|
31
|
+
clearButtonLabel: 'ใฏใชใข',
|
|
32
|
+
okButtonLabel: '็ขบๅฎ',
|
|
33
|
+
todayButtonLabel: 'ไปๆฅ',
|
|
34
|
+
// Toolbar titles
|
|
35
|
+
datePickerDefaultToolbarTitle: 'ๆฅไปใ้ธๆ',
|
|
36
|
+
dateTimePickerDefaultToolbarTitle: 'ๆฅๆใ้ธๆ',
|
|
37
|
+
timePickerDefaultToolbarTitle: 'ๆ้ใ้ธๆ',
|
|
38
|
+
dateRangePickerDefaultToolbarTitle: 'ๆฅไปใฎ็ฏๅฒใ้ธๆ',
|
|
39
|
+
// Clock labels
|
|
40
|
+
clockLabelText: function clockLabelText(view, time, adapter) {
|
|
41
|
+
var _clockViews$view;
|
|
42
|
+
|
|
43
|
+
return "".concat((_clockViews$view = clockViews[view]) != null ? _clockViews$view : view, "\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044 ").concat(time === null ? 'ๆ้ใ้ธๆใใใฆใใพใใ' : "\u9078\u629E\u3057\u305F\u6642\u9593\u306F ".concat(adapter.format(time, 'fullTime'), " \u3067\u3059"));
|
|
44
|
+
},
|
|
45
|
+
hoursClockNumberText: function hoursClockNumberText(hours) {
|
|
46
|
+
return "".concat(hours, " ").concat(clockViews.hours);
|
|
47
|
+
},
|
|
48
|
+
minutesClockNumberText: function minutesClockNumberText(minutes) {
|
|
49
|
+
return "".concat(minutes, " ").concat(clockViews.minutes);
|
|
50
|
+
},
|
|
51
|
+
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
52
|
+
return "".concat(seconds, " ").concat(clockViews.seconds);
|
|
53
|
+
},
|
|
54
|
+
// Open picker labels
|
|
55
|
+
openDatePickerDialogue: function openDatePickerDialogue(value, utils) {
|
|
56
|
+
return value !== null && utils.isValid(value) ? "\u65E5\u4ED8\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u9078\u629E\u3057\u305F\u65E5\u4ED8\u306F ".concat(utils.format(value, 'fullDate'), " \u3067\u3059") : 'ๆฅไปใ้ธๆใใฆใใ ใใ';
|
|
57
|
+
},
|
|
58
|
+
openTimePickerDialogue: function openTimePickerDialogue(value, utils) {
|
|
59
|
+
return value !== null && utils.isValid(value) ? "\u6642\u9593\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u9078\u629E\u3057\u305F\u6642\u9593\u306F ".concat(utils.format(value, 'fullTime'), " \u3067\u3059") : 'ๆ้ใ้ธๆใใฆใใ ใใ';
|
|
60
|
+
},
|
|
61
|
+
// Table labels
|
|
62
|
+
timeTableLabel: 'ๆ้ใ้ธๆ',
|
|
63
|
+
dateTableLabel: 'ๆฅไปใ้ธๆ'
|
|
64
|
+
};
|
|
65
|
+
export var jaJP = getPickersLocalization(jaJPPickers);
|
package/locales/index.d.ts
CHANGED
package/locales/index.js
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CalendarPickerView } from '../internals/models';
|
|
2
|
+
export declare const jaJP: {
|
|
3
|
+
components: {
|
|
4
|
+
MuiLocalizationProvider: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
localeText: {
|
|
7
|
+
previousMonth?: string | undefined;
|
|
8
|
+
nextMonth?: string | undefined;
|
|
9
|
+
openPreviousView?: string | undefined;
|
|
10
|
+
openNextView?: string | undefined;
|
|
11
|
+
cancelButtonLabel?: string | undefined;
|
|
12
|
+
clearButtonLabel?: string | undefined;
|
|
13
|
+
okButtonLabel?: string | undefined;
|
|
14
|
+
todayButtonLabel?: string | undefined;
|
|
15
|
+
start?: string | undefined;
|
|
16
|
+
end?: string | undefined;
|
|
17
|
+
calendarViewSwitchingButtonAriaLabel?: ((currentView: CalendarPickerView) => string) | undefined;
|
|
18
|
+
inputModeToggleButtonAriaLabel?: ((isKeyboardInputOpen: boolean, viewType: "calendar" | "clock") => string) | undefined;
|
|
19
|
+
clockLabelText?: ((view: import("../internals/models").ClockPickerView, time: any, adapter: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
20
|
+
hoursClockNumberText?: ((hours: string) => string) | undefined;
|
|
21
|
+
minutesClockNumberText?: ((minutes: string) => string) | undefined;
|
|
22
|
+
secondsClockNumberText?: ((seconds: string) => string) | undefined;
|
|
23
|
+
openDatePickerDialogue?: ((date: any, utils: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
24
|
+
openTimePickerDialogue?: ((date: any, utils: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
25
|
+
timeTableLabel?: string | undefined;
|
|
26
|
+
dateTableLabel?: string | undefined;
|
|
27
|
+
datePickerDefaultToolbarTitle?: string | undefined;
|
|
28
|
+
dateTimePickerDefaultToolbarTitle?: string | undefined;
|
|
29
|
+
timePickerDefaultToolbarTitle?: string | undefined;
|
|
30
|
+
dateRangePickerDefaultToolbarTitle?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
package/locales/jaJP.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
+
// maps ClockPickerView to its translation
|
|
3
|
+
const clockViews = {
|
|
4
|
+
hours: 'ๆ้',
|
|
5
|
+
minutes: 'ๅ',
|
|
6
|
+
seconds: '็ง'
|
|
7
|
+
}; // maps PickersToolbar["viewType"] to its translation
|
|
8
|
+
|
|
9
|
+
const pickerViews = {
|
|
10
|
+
calendar: 'ใซใฌใณใใผ่กจ็คบ',
|
|
11
|
+
clock: 'ๆ่จ่กจ็คบ'
|
|
12
|
+
};
|
|
13
|
+
const jaJPPickers = {
|
|
14
|
+
// Calendar navigation
|
|
15
|
+
previousMonth: 'ๅ
ๆ',
|
|
16
|
+
nextMonth: 'ๆฅๆ',
|
|
17
|
+
// View navigation
|
|
18
|
+
openPreviousView: 'ๅใฎ่กจ็คบใ้ใ',
|
|
19
|
+
openNextView: 'ๆฌกใฎ่กจ็คบใ้ใ',
|
|
20
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'ๅนด้ธๆ่กจ็คบใใใซใฌใณใใผ่กจ็คบใซๅใๆฟใใ' : 'ใซใฌใณใใผ่กจ็คบใใๅนด้ธๆ่กจ็คบใซๅใๆฟใใ',
|
|
21
|
+
inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => isKeyboardInputOpen ? `ใใญในใๅ
ฅๅ่กจ็คบใใ${pickerViews[viewType]}ใซๅใๆฟใใ` : `${pickerViews[viewType]}ใใใใญในใๅ
ฅๅ่กจ็คบใซๅใๆฟใใ`,
|
|
22
|
+
// DateRange placeholders
|
|
23
|
+
start: '้ๅง',
|
|
24
|
+
end: '็ตไบ',
|
|
25
|
+
// Action bar
|
|
26
|
+
cancelButtonLabel: 'ใญใฃใณใปใซ',
|
|
27
|
+
clearButtonLabel: 'ใฏใชใข',
|
|
28
|
+
okButtonLabel: '็ขบๅฎ',
|
|
29
|
+
todayButtonLabel: 'ไปๆฅ',
|
|
30
|
+
// Toolbar titles
|
|
31
|
+
datePickerDefaultToolbarTitle: 'ๆฅไปใ้ธๆ',
|
|
32
|
+
dateTimePickerDefaultToolbarTitle: 'ๆฅๆใ้ธๆ',
|
|
33
|
+
timePickerDefaultToolbarTitle: 'ๆ้ใ้ธๆ',
|
|
34
|
+
dateRangePickerDefaultToolbarTitle: 'ๆฅไปใฎ็ฏๅฒใ้ธๆ',
|
|
35
|
+
// Clock labels
|
|
36
|
+
clockLabelText: (view, time, adapter) => {
|
|
37
|
+
var _clockViews$view;
|
|
38
|
+
|
|
39
|
+
return `${(_clockViews$view = clockViews[view]) != null ? _clockViews$view : view}ใ้ธๆใใฆใใ ใใ ${time === null ? 'ๆ้ใ้ธๆใใใฆใใพใใ' : `้ธๆใใๆ้ใฏ ${adapter.format(time, 'fullTime')} ใงใ`}`;
|
|
40
|
+
},
|
|
41
|
+
hoursClockNumberText: hours => `${hours} ${clockViews.hours}`,
|
|
42
|
+
minutesClockNumberText: minutes => `${minutes} ${clockViews.minutes}`,
|
|
43
|
+
secondsClockNumberText: seconds => `${seconds} ${clockViews.seconds}`,
|
|
44
|
+
// Open picker labels
|
|
45
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ๆฅไปใ้ธๆใใฆใใ ใใใ้ธๆใใๆฅไปใฏ ${utils.format(value, 'fullDate')} ใงใ` : 'ๆฅไปใ้ธๆใใฆใใ ใใ',
|
|
46
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ๆ้ใ้ธๆใใฆใใ ใใใ้ธๆใใๆ้ใฏ ${utils.format(value, 'fullTime')} ใงใ` : 'ๆ้ใ้ธๆใใฆใใ ใใ',
|
|
47
|
+
// Table labels
|
|
48
|
+
timeTableLabel: 'ๆ้ใ้ธๆ',
|
|
49
|
+
dateTableLabel: 'ๆฅไปใ้ธๆ'
|
|
50
|
+
};
|
|
51
|
+
export const jaJP = getPickersLocalization(jaJPPickers);
|
|
@@ -257,8 +257,14 @@ export const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPic
|
|
|
257
257
|
setInternalFocusedView(prevView => prevView === eventView ? null : prevView);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
|
+
const prevOpenViewRef = React.useRef(openView);
|
|
260
261
|
React.useEffect(() => {
|
|
261
262
|
// Set focus to the button when switching from a view to another
|
|
263
|
+
if (prevOpenViewRef.current === openView) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
prevOpenViewRef.current = openView;
|
|
262
268
|
handleFocusedViewChange(openView)(true);
|
|
263
269
|
}, [openView, handleFocusedViewChange]);
|
|
264
270
|
return /*#__PURE__*/_jsxs(CalendarPickerRoot, {
|
package/modern/index.js
CHANGED
package/modern/locales/index.js
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
+
// maps ClockPickerView to its translation
|
|
3
|
+
const clockViews = {
|
|
4
|
+
hours: 'ๆ้',
|
|
5
|
+
minutes: 'ๅ',
|
|
6
|
+
seconds: '็ง'
|
|
7
|
+
}; // maps PickersToolbar["viewType"] to its translation
|
|
8
|
+
|
|
9
|
+
const pickerViews = {
|
|
10
|
+
calendar: 'ใซใฌใณใใผ่กจ็คบ',
|
|
11
|
+
clock: 'ๆ่จ่กจ็คบ'
|
|
12
|
+
};
|
|
13
|
+
const jaJPPickers = {
|
|
14
|
+
// Calendar navigation
|
|
15
|
+
previousMonth: 'ๅ
ๆ',
|
|
16
|
+
nextMonth: 'ๆฅๆ',
|
|
17
|
+
// View navigation
|
|
18
|
+
openPreviousView: 'ๅใฎ่กจ็คบใ้ใ',
|
|
19
|
+
openNextView: 'ๆฌกใฎ่กจ็คบใ้ใ',
|
|
20
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'ๅนด้ธๆ่กจ็คบใใใซใฌใณใใผ่กจ็คบใซๅใๆฟใใ' : 'ใซใฌใณใใผ่กจ็คบใใๅนด้ธๆ่กจ็คบใซๅใๆฟใใ',
|
|
21
|
+
inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => isKeyboardInputOpen ? `ใใญในใๅ
ฅๅ่กจ็คบใใ${pickerViews[viewType]}ใซๅใๆฟใใ` : `${pickerViews[viewType]}ใใใใญในใๅ
ฅๅ่กจ็คบใซๅใๆฟใใ`,
|
|
22
|
+
// DateRange placeholders
|
|
23
|
+
start: '้ๅง',
|
|
24
|
+
end: '็ตไบ',
|
|
25
|
+
// Action bar
|
|
26
|
+
cancelButtonLabel: 'ใญใฃใณใปใซ',
|
|
27
|
+
clearButtonLabel: 'ใฏใชใข',
|
|
28
|
+
okButtonLabel: '็ขบๅฎ',
|
|
29
|
+
todayButtonLabel: 'ไปๆฅ',
|
|
30
|
+
// Toolbar titles
|
|
31
|
+
datePickerDefaultToolbarTitle: 'ๆฅไปใ้ธๆ',
|
|
32
|
+
dateTimePickerDefaultToolbarTitle: 'ๆฅๆใ้ธๆ',
|
|
33
|
+
timePickerDefaultToolbarTitle: 'ๆ้ใ้ธๆ',
|
|
34
|
+
dateRangePickerDefaultToolbarTitle: 'ๆฅไปใฎ็ฏๅฒใ้ธๆ',
|
|
35
|
+
// Clock labels
|
|
36
|
+
clockLabelText: (view, time, adapter) => `${clockViews[view] ?? view}ใ้ธๆใใฆใใ ใใ ${time === null ? 'ๆ้ใ้ธๆใใใฆใใพใใ' : `้ธๆใใๆ้ใฏ ${adapter.format(time, 'fullTime')} ใงใ`}`,
|
|
37
|
+
hoursClockNumberText: hours => `${hours} ${clockViews.hours}`,
|
|
38
|
+
minutesClockNumberText: minutes => `${minutes} ${clockViews.minutes}`,
|
|
39
|
+
secondsClockNumberText: seconds => `${seconds} ${clockViews.seconds}`,
|
|
40
|
+
// Open picker labels
|
|
41
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ๆฅไปใ้ธๆใใฆใใ ใใใ้ธๆใใๆฅไปใฏ ${utils.format(value, 'fullDate')} ใงใ` : 'ๆฅไปใ้ธๆใใฆใใ ใใ',
|
|
42
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ๆ้ใ้ธๆใใฆใใ ใใใ้ธๆใใๆ้ใฏ ${utils.format(value, 'fullTime')} ใงใ` : 'ๆ้ใ้ธๆใใฆใใ ใใ',
|
|
43
|
+
// Table labels
|
|
44
|
+
timeTableLabel: 'ๆ้ใ้ธๆ',
|
|
45
|
+
dateTableLabel: 'ๆฅไปใ้ธๆ'
|
|
46
|
+
};
|
|
47
|
+
export const jaJP = getPickersLocalization(jaJPPickers);
|
|
@@ -288,8 +288,14 @@ const CalendarPicker = /*#__PURE__*/React.forwardRef(function CalendarPicker(inP
|
|
|
288
288
|
setInternalFocusedView(prevView => prevView === eventView ? null : prevView);
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
|
+
const prevOpenViewRef = React.useRef(openView);
|
|
291
292
|
React.useEffect(() => {
|
|
292
293
|
// Set focus to the button when switching from a view to another
|
|
294
|
+
if (prevOpenViewRef.current === openView) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
prevOpenViewRef.current = openView;
|
|
293
299
|
handleFocusedViewChange(openView)(true);
|
|
294
300
|
}, [openView, handleFocusedViewChange]);
|
|
295
301
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CalendarPickerRoot, {
|
package/node/index.js
CHANGED
package/node/locales/index.js
CHANGED
|
@@ -212,6 +212,19 @@ Object.keys(_isIS).forEach(function (key) {
|
|
|
212
212
|
});
|
|
213
213
|
});
|
|
214
214
|
|
|
215
|
+
var _jaJP = require("./jaJP");
|
|
216
|
+
|
|
217
|
+
Object.keys(_jaJP).forEach(function (key) {
|
|
218
|
+
if (key === "default" || key === "__esModule") return;
|
|
219
|
+
if (key in exports && exports[key] === _jaJP[key]) return;
|
|
220
|
+
Object.defineProperty(exports, key, {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
get: function () {
|
|
223
|
+
return _jaJP[key];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
215
228
|
var _pickersLocaleTextApi = require("./utils/pickersLocaleTextApi");
|
|
216
229
|
|
|
217
230
|
Object.keys(_pickersLocaleTextApi).forEach(function (key) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.jaJP = void 0;
|
|
7
|
+
|
|
8
|
+
var _getPickersLocalization = require("./utils/getPickersLocalization");
|
|
9
|
+
|
|
10
|
+
// maps ClockPickerView to its translation
|
|
11
|
+
const clockViews = {
|
|
12
|
+
hours: 'ๆ้',
|
|
13
|
+
minutes: 'ๅ',
|
|
14
|
+
seconds: '็ง'
|
|
15
|
+
}; // maps PickersToolbar["viewType"] to its translation
|
|
16
|
+
|
|
17
|
+
const pickerViews = {
|
|
18
|
+
calendar: 'ใซใฌใณใใผ่กจ็คบ',
|
|
19
|
+
clock: 'ๆ่จ่กจ็คบ'
|
|
20
|
+
};
|
|
21
|
+
const jaJPPickers = {
|
|
22
|
+
// Calendar navigation
|
|
23
|
+
previousMonth: 'ๅ
ๆ',
|
|
24
|
+
nextMonth: 'ๆฅๆ',
|
|
25
|
+
// View navigation
|
|
26
|
+
openPreviousView: 'ๅใฎ่กจ็คบใ้ใ',
|
|
27
|
+
openNextView: 'ๆฌกใฎ่กจ็คบใ้ใ',
|
|
28
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'ๅนด้ธๆ่กจ็คบใใใซใฌใณใใผ่กจ็คบใซๅใๆฟใใ' : 'ใซใฌใณใใผ่กจ็คบใใๅนด้ธๆ่กจ็คบใซๅใๆฟใใ',
|
|
29
|
+
inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => isKeyboardInputOpen ? `ใใญในใๅ
ฅๅ่กจ็คบใใ${pickerViews[viewType]}ใซๅใๆฟใใ` : `${pickerViews[viewType]}ใใใใญในใๅ
ฅๅ่กจ็คบใซๅใๆฟใใ`,
|
|
30
|
+
// DateRange placeholders
|
|
31
|
+
start: '้ๅง',
|
|
32
|
+
end: '็ตไบ',
|
|
33
|
+
// Action bar
|
|
34
|
+
cancelButtonLabel: 'ใญใฃใณใปใซ',
|
|
35
|
+
clearButtonLabel: 'ใฏใชใข',
|
|
36
|
+
okButtonLabel: '็ขบๅฎ',
|
|
37
|
+
todayButtonLabel: 'ไปๆฅ',
|
|
38
|
+
// Toolbar titles
|
|
39
|
+
datePickerDefaultToolbarTitle: 'ๆฅไปใ้ธๆ',
|
|
40
|
+
dateTimePickerDefaultToolbarTitle: 'ๆฅๆใ้ธๆ',
|
|
41
|
+
timePickerDefaultToolbarTitle: 'ๆ้ใ้ธๆ',
|
|
42
|
+
dateRangePickerDefaultToolbarTitle: 'ๆฅไปใฎ็ฏๅฒใ้ธๆ',
|
|
43
|
+
// Clock labels
|
|
44
|
+
clockLabelText: (view, time, adapter) => {
|
|
45
|
+
var _clockViews$view;
|
|
46
|
+
|
|
47
|
+
return `${(_clockViews$view = clockViews[view]) != null ? _clockViews$view : view}ใ้ธๆใใฆใใ ใใ ${time === null ? 'ๆ้ใ้ธๆใใใฆใใพใใ' : `้ธๆใใๆ้ใฏ ${adapter.format(time, 'fullTime')} ใงใ`}`;
|
|
48
|
+
},
|
|
49
|
+
hoursClockNumberText: hours => `${hours} ${clockViews.hours}`,
|
|
50
|
+
minutesClockNumberText: minutes => `${minutes} ${clockViews.minutes}`,
|
|
51
|
+
secondsClockNumberText: seconds => `${seconds} ${clockViews.seconds}`,
|
|
52
|
+
// Open picker labels
|
|
53
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ๆฅไปใ้ธๆใใฆใใ ใใใ้ธๆใใๆฅไปใฏ ${utils.format(value, 'fullDate')} ใงใ` : 'ๆฅไปใ้ธๆใใฆใใ ใใ',
|
|
54
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ๆ้ใ้ธๆใใฆใใ ใใใ้ธๆใใๆ้ใฏ ${utils.format(value, 'fullTime')} ใงใ` : 'ๆ้ใ้ธๆใใฆใใ ใใ',
|
|
55
|
+
// Table labels
|
|
56
|
+
timeTableLabel: 'ๆ้ใ้ธๆ',
|
|
57
|
+
dateTableLabel: 'ๆฅไปใ้ธๆ'
|
|
58
|
+
};
|
|
59
|
+
const jaJP = (0, _getPickersLocalization.getPickersLocalization)(jaJPPickers);
|
|
60
|
+
exports.jaJP = jaJP;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "The community edition of the date picker components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "https://github.com/mui
|
|
32
|
+
"url": "https://github.com/mui/mui-x.git",
|
|
33
33
|
"directory": "packages/x-date-pickers"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|