@mui/x-date-pickers 7.0.0-beta.4 β 7.0.0-beta.5
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 +138 -14
- package/DatePicker/DatePickerToolbar.js +4 -1
- package/DateTimePicker/DateTimePickerToolbar.d.ts +2 -2
- package/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +4 -4
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +6 -4
- package/TimePicker/TimePickerToolbar.js +3 -0
- package/index.js +1 -1
- package/internals/components/PickersToolbar.js +13 -9
- package/internals/hooks/useField/useFieldCharacterEditing.js +1 -1
- package/internals/hooks/useField/useFieldV6TextField.js +5 -3
- package/internals/hooks/useField/useFieldV7TextField.js +2 -2
- package/internals/models/props/toolbar.d.ts +3 -0
- package/locales/koKR.js +1 -2
- package/locales/zhCN.js +16 -20
- package/modern/DatePicker/DatePickerToolbar.js +4 -1
- package/modern/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +4 -4
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +5 -3
- package/modern/TimePicker/TimePickerToolbar.js +3 -0
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersToolbar.js +13 -9
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +1 -1
- package/modern/internals/hooks/useField/useFieldV6TextField.js +5 -3
- package/modern/internals/hooks/useField/useFieldV7TextField.js +2 -2
- package/modern/locales/koKR.js +1 -2
- package/modern/locales/zhCN.js +16 -20
- package/node/DatePicker/DatePickerToolbar.js +4 -1
- package/node/DateTimePicker/DateTimePickerToolbar.js +3 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +4 -4
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +5 -3
- package/node/TimePicker/TimePickerToolbar.js +3 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickersToolbar.js +13 -9
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +1 -1
- package/node/internals/hooks/useField/useFieldV6TextField.js +5 -3
- package/node/internals/hooks/useField/useFieldV7TextField.js +2 -2
- package/node/locales/koKR.js +1 -2
- package/node/locales/zhCN.js +16 -20
- package/package.json +1 -1
- package/themeAugmentation/props.d.ts +9 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,89 @@
|
|
|
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
|
+
## 7.0.0-beta.5
|
|
7
|
+
|
|
8
|
+
_Mar 1, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights β¨:
|
|
11
|
+
|
|
12
|
+
- π Add `getSortComparator` for more advanced sorting behaviors (#12215) @cherniavskii
|
|
13
|
+
- π Add `use client` directive to the Grid packages (#11803) @MBilalShafi
|
|
14
|
+
- π Improve Korean (ko-KR) and Chinese (zh-CN) locales on the Pickers
|
|
15
|
+
- π Bugfixes
|
|
16
|
+
- π Documentation improvements
|
|
17
|
+
|
|
18
|
+
### Data Grid
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid@7.0.0-beta.5`
|
|
21
|
+
|
|
22
|
+
- [DataGrid] Add `getSortComparator` for more advanced sorting behaviors (#12215) @cherniavskii
|
|
23
|
+
- [DataGrid] Add `use client` directive to the Grid packages (#11803) @MBilalShafi
|
|
24
|
+
- [DataGrid] Fix `disableResetButton` and `disableShowHideToggle` flags to not exclude each other (#12169) @adyry
|
|
25
|
+
- [DataGrid] Fix cell range classnames (#12230) @romgrk
|
|
26
|
+
- [DataGrid] Fix wrong offset for right-pinned columns when toggling dark/light modes (#12233) @cherniavskii
|
|
27
|
+
- [DataGrid] Improve row virtualization and rendering performance (#12247) @romgrk
|
|
28
|
+
- [DataGrid] Improve performance by removing `querySelector` call (#12229) @romgrk
|
|
29
|
+
- [DataGrid] Fix `onColumnWidthChange` called before autosize affects column width (#12140) @shaharyar-shamshi
|
|
30
|
+
- [DataGrid] Fix boolean "is" filter (#12117) @shaharyar-shamshi
|
|
31
|
+
- [DataGrid] Fix `upsertFilterItems` removing filters that are not part of the update (#11954) @gitstart
|
|
32
|
+
- [DataGrid] Render scrollbars only if there is scroll (#12265) @cherniavskii
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-data-grid-pro@7.0.0-beta.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-data-grid@7.0.0-beta.5`, plus:
|
|
37
|
+
|
|
38
|
+
- [DataGridPro] Fix column resize errors on MacOS with automatic scrollbars enabled (#12217) @cherniavskii
|
|
39
|
+
- [DataGridPro] Fix lazy-loading crash (#12080) @romgrk
|
|
40
|
+
- [DataGridPro] Fix useGridRows not giving error on reversed data (#10821) @martijn-basesoft
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-premium@7.0.0-beta.5` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.5`, plus:
|
|
45
|
+
|
|
46
|
+
- [DataGridPremium] Make clipboard copy respect the sorting during cell selection (#12235) @MBilalShafi
|
|
47
|
+
|
|
48
|
+
### Date Pickers
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-date-pickers@7.0.0-beta.5`
|
|
51
|
+
|
|
52
|
+
- [pickers] Fix toolbar components props handling (#12211) @LukasTy
|
|
53
|
+
- [l10n] Improve Chinese (zh-CN) locale (#12245) @headironc
|
|
54
|
+
- [l10n] Improve Korean (ko-KR) locale (#12192) @Luzi
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-date-pickers-pro@7.0.0-beta.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
57
|
+
|
|
58
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
|
|
59
|
+
|
|
60
|
+
- [DateTimeRangePicker] Fix validation behavior (#12243) @LukasTy
|
|
61
|
+
|
|
62
|
+
### Charts / `@mui/x-charts@7.0.0-beta.5`
|
|
63
|
+
|
|
64
|
+
- [charts] Fix grid duplicated key (#12208) @alexfauquette
|
|
65
|
+
|
|
66
|
+
### Tree View / `@mui/x-tree-view@7.0.0-beta.5`
|
|
67
|
+
|
|
68
|
+
- [TreeView] Add public API and expose focus method (#12143) @noraleonte
|
|
69
|
+
|
|
70
|
+
### Docs
|
|
71
|
+
|
|
72
|
+
- [docs] Fix image layout shift when loading @oliviertassinari
|
|
73
|
+
- [docs] Match Material UI repo comment for redirections @oliviertassinari
|
|
74
|
+
- [docs] Non breaking spaces @oliviertassinari
|
|
75
|
+
- [docs] Polish the Date Picker playground (#11869) @zanivan
|
|
76
|
+
- [docs] Standardize WAI-ARIA references @oliviertassinari
|
|
77
|
+
|
|
78
|
+
### Core
|
|
79
|
+
|
|
80
|
+
- [core] Allow local docs next.js settings (#12227) @romgrk
|
|
81
|
+
- [core] Remove grid folder from `getComponentInfo` RegExp (#12241) @flaviendelangle
|
|
82
|
+
- [core] Remove `window.` reference for common globals @oliviertassinari
|
|
83
|
+
- [core] Use runtime agnostic setTimeout type @oliviertassinari
|
|
84
|
+
- [docs-infra] Fix Stack Overflow breaking space @oliviertassinari
|
|
85
|
+
- [docs-infra] Fix missing non breaking spaces @oliviertassinari
|
|
86
|
+
- [github] Update `no-response` workflow (#12193) @MBilalShafi
|
|
87
|
+
- [infra] Fix missing permission reset @oliviertassinari
|
|
88
|
+
|
|
6
89
|
## 7.0.0-beta.4
|
|
7
90
|
|
|
8
91
|
_Feb 23, 2024_
|
|
@@ -49,7 +132,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
|
|
|
49
132
|
<DateField
|
|
50
133
|
- selectedSections={{ startIndex: 0, endIndex: 0 }}
|
|
51
134
|
+ selectedSections={0}
|
|
52
|
-
|
|
135
|
+
|
|
53
136
|
// If the field has 3 sections
|
|
54
137
|
- selectedSections={{ startIndex: 0, endIndex: 2 }}
|
|
55
138
|
+ selectedSections="all"
|
|
@@ -68,20 +151,20 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
|
|
|
68
151
|
+ enableAccessibleFieldDOMStructure,
|
|
69
152
|
// ... rest of the props you are using
|
|
70
153
|
} = props;
|
|
71
|
-
|
|
154
|
+
|
|
72
155
|
return ( /* Some UI to edit the date */ )
|
|
73
156
|
}
|
|
74
|
-
|
|
157
|
+
|
|
75
158
|
function MyCustomField(props) {
|
|
76
159
|
const fieldResponse = useDateField<Dayjs, false, typeof textFieldProps>({
|
|
77
160
|
...props,
|
|
78
161
|
+ // If you only support one DOM structure, we advise you to hardcode it here to avoid unwanted switches in your application
|
|
79
162
|
+ enableAccessibleFieldDOMStructure: false,
|
|
80
163
|
});
|
|
81
|
-
|
|
164
|
+
|
|
82
165
|
return <MyCustomTextField ref={ref} {...fieldResponse} />;
|
|
83
166
|
}
|
|
84
|
-
|
|
167
|
+
|
|
85
168
|
function App() {
|
|
86
169
|
return <DatePicker slots={{ field: MyCustomField }} />;
|
|
87
170
|
}
|
|
@@ -2352,6 +2435,47 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
|
|
|
2352
2435
|
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
|
|
2353
2436
|
- [license] Correctly throw errors (#10924) @oliviertassinari
|
|
2354
2437
|
|
|
2438
|
+
## 6.19.6
|
|
2439
|
+
|
|
2440
|
+
_Mar 1, 2024_
|
|
2441
|
+
|
|
2442
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights β¨:
|
|
2443
|
+
|
|
2444
|
+
- π Improve Korean (ko-KR) and Chinese (zh-CN) locales on the Pickers
|
|
2445
|
+
- π Bugfixes
|
|
2446
|
+
- π Documentation improvements
|
|
2447
|
+
|
|
2448
|
+
### Data Grid
|
|
2449
|
+
|
|
2450
|
+
#### `@mui/x-data-grid@6.19.6`
|
|
2451
|
+
|
|
2452
|
+
- [DataGrid] Fix error when existing rows are passed to `replaceRows` (@martijn-basesoft)
|
|
2453
|
+
|
|
2454
|
+
#### `@mui/x-data-grid-pro@6.19.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
2455
|
+
|
|
2456
|
+
Same changes as in `@mui/x-data-grid@6.19.6`.
|
|
2457
|
+
|
|
2458
|
+
#### `@mui/x-data-grid-premium@6.19.6` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
2459
|
+
|
|
2460
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.6`, plus:
|
|
2461
|
+
|
|
2462
|
+
- [DataGridPremium] Make clipboard copy respect the sorting during cell selection (#12255) @MBilalShafi
|
|
2463
|
+
|
|
2464
|
+
### Date Pickers
|
|
2465
|
+
|
|
2466
|
+
#### `@mui/x-date-pickers@6.19.6`
|
|
2467
|
+
|
|
2468
|
+
- [l10n] Improve Chinese (zh-CN) locale (#12250) @headironc
|
|
2469
|
+
- [l10n] Improve Korean (ko-KR) locale (#12186) @Luzi
|
|
2470
|
+
|
|
2471
|
+
#### `@mui/x-date-pickers-pro@6.19.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
2472
|
+
|
|
2473
|
+
Same changes as in `@mui/x-date-pickers@6.19.6`.
|
|
2474
|
+
|
|
2475
|
+
### Docs
|
|
2476
|
+
|
|
2477
|
+
- [docs] Update lazy loading demo to show skeleton rows during initial rows fetch (#12062) @cherniavskii
|
|
2478
|
+
|
|
2355
2479
|
## 6.19.5
|
|
2356
2480
|
|
|
2357
2481
|
_Feb 23, 2024_
|
|
@@ -2394,8 +2518,8 @@ Same changes as in `@mui/x-date-pickers@6.19.5`.
|
|
|
2394
2518
|
|
|
2395
2519
|
- [docs] Clarify Pickers 'Component composition' section (#12147) @LukasTy
|
|
2396
2520
|
- [docs] Fix 301 redirection to StackBlitz @oliviertassinari
|
|
2397
|
-
- [docs] Fix 301 to Material
|
|
2398
|
-
- [docs] Fix 301 to Material
|
|
2521
|
+
- [docs] Fix 301 to MaterialΒ UI @oliviertassinari
|
|
2522
|
+
- [docs] Fix 301 to MaterialΒ UI @oliviertassinari
|
|
2399
2523
|
- [docs] Fix 404 links to translation source @oliviertassinari
|
|
2400
2524
|
- [docs] Fix dead link to translations @oliviertassinari
|
|
2401
2525
|
- [docs] Fix the Treemap illustration (#12189) @danilo-leal
|
|
@@ -4264,7 +4388,7 @@ We'd like to offer a big thanks to the 13 contributors who made this release pos
|
|
|
4264
4388
|
|
|
4265
4389
|
#### `@mui/x-data-grid@6.9.1`
|
|
4266
4390
|
|
|
4267
|
-
- [DataGrid] Add Joy
|
|
4391
|
+
- [DataGrid] Add JoyΒ UI `tooltip` and `loadingOverlay` slots (#9028) @cherniavskii
|
|
4268
4392
|
- [DataGrid] Add section about enabling pagination on Pro and Premium (#8759) @joserodolfofreitas
|
|
4269
4393
|
- [DataGrid] Don't forward `editCellState` prop to DOM element (#9501) @m4theushw
|
|
4270
4394
|
- [DataGrid] Add experimental API for faster filtering performance (#9254) @romgrk
|
|
@@ -4395,7 +4519,7 @@ Same changes as in `@mui/x-date-pickers@6.9.0`.
|
|
|
4395
4519
|
- [docs] Fix random screenshot generation (#9364) @cherniavskii
|
|
4396
4520
|
- [docs] Remove random generation from chart doc example (#9343) @flaviendelangle
|
|
4397
4521
|
- [docs] Sync h1 with sidenav link (#9252) @oliviertassinari
|
|
4398
|
-
- [docs] Use the mui-x Stack
|
|
4522
|
+
- [docs] Use the mui-x StackΒ Overflow tag (#9352) @oliviertassinari
|
|
4399
4523
|
|
|
4400
4524
|
### Core
|
|
4401
4525
|
|
|
@@ -4722,8 +4846,8 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
|
|
|
4722
4846
|
|
|
4723
4847
|
- [DataGrid] Fix DataGrid rendering in JSDOM (#8968) @cherniavskii
|
|
4724
4848
|
- [DataGrid] Fix layout when rendered inside a parent with `display: grid` (#8577) @cherniavskii
|
|
4725
|
-
- [DataGrid] Add Joy
|
|
4726
|
-
- [DataGrid] Add Joy
|
|
4849
|
+
- [DataGrid] Add JoyΒ UI icon slots (#8940) @siriwatknp
|
|
4850
|
+
- [DataGrid] Add JoyΒ UI pagination slot (#8871) @cherniavskii
|
|
4727
4851
|
- [DataGrid] Extract `baseChip` slot (#8748) @cherniavskii
|
|
4728
4852
|
- [DataGridPremium] Implement Clipboard import (#7389) @cherniavskii
|
|
4729
4853
|
- [l10n] Improve French (fr-FR) locale (#8825) @allereaugabriel
|
|
@@ -4773,7 +4897,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
|
|
|
4773
4897
|
- [DataGrid] Fix falsy filter values not showing in filter button tooltip (#8550) @ithrforu
|
|
4774
4898
|
- [DataGrid] Fix missing watermark in Pro and Premium packages (#8797) @cherniavskii
|
|
4775
4899
|
- [DataGrid] Remove unwarranted warning log (#8847) @romgrk
|
|
4776
|
-
- [DataGrid] Add Joy
|
|
4900
|
+
- [DataGrid] Add JoyΒ UI slots (`Select`, `SelectOption`, `InputLabel`, `FormControl`) (#8747) @cherniavskii
|
|
4777
4901
|
- [DataGridPremium] Fix expanded groups being collapsed after calling `updateRows` (#8823) @cherniavskii
|
|
4778
4902
|
|
|
4779
4903
|
### `@mui/x-date-pickers@6.3.1` / `@mui/x-date-pickers-pro@6.3.1`
|
|
@@ -4824,7 +4948,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
4824
4948
|
- [DataGrid] Add overlay classes to `gridClasses` (#8686) @lindapaiste
|
|
4825
4949
|
- [DataGrid] Avoid passing `api` prop to div (#8679) @someden
|
|
4826
4950
|
- [DataGrid] Fix 'ResizeObserver loop limit exceeded' error (#8744) @m4theushw
|
|
4827
|
-
- [DataGrid] Add Joy
|
|
4951
|
+
- [DataGrid] Add JoyΒ UI slots (button and switch) (#8699) @siriwatknp
|
|
4828
4952
|
- [DataGrid] Fix aggregation label alignment (#8694) @joserodolfofreitas
|
|
4829
4953
|
- [DataGridPremium] Fix infinite loop when updating grouped rows (#8693) @cherniavskii
|
|
4830
4954
|
- [DataGridPro] Fix error after updating `columns` and `columnGroupingModel` at once (#8730) @cherniavskii
|
|
@@ -4886,7 +5010,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
|
|
|
4886
5010
|
#### Changes
|
|
4887
5011
|
|
|
4888
5012
|
- [DataGrid] Add `getTogglableColumns` to `Hide all` and `Show all` actions (#8496) @MBilalShafi
|
|
4889
|
-
- [DataGrid] Add Grid + Joy
|
|
5013
|
+
- [DataGrid] Add Grid + JoyΒ UI experiment page (#8067) @cherniavskii
|
|
4890
5014
|
- [DataGrid] Fix print style when rendering inside Shadow DOM (#8656) @Bwatermelon
|
|
4891
5015
|
- [DataGrid] Replace `GridAutoSizer` with `ResizeObserver` (#8091) @m4theushw
|
|
4892
5016
|
- [DataGrid] Use stable ID for the placeholder filter item (#8603) @m4theushw
|
|
@@ -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 = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
|
|
3
|
+
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className", "onViewChange", "view"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -133,5 +133,8 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
133
133
|
* Currently visible picker view.
|
|
134
134
|
*/
|
|
135
135
|
view: PropTypes.oneOf(['day', 'month', 'year']).isRequired,
|
|
136
|
+
/**
|
|
137
|
+
* Available views.
|
|
138
|
+
*/
|
|
136
139
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired).isRequired
|
|
137
140
|
} : void 0;
|
|
@@ -5,8 +5,6 @@ import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models'
|
|
|
5
5
|
import { MakeOptional } from '../internals/models/helpers';
|
|
6
6
|
import { PickerValidDate } from '../models';
|
|
7
7
|
export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
8
|
-
ampm?: boolean;
|
|
9
|
-
ampmInClock?: boolean;
|
|
10
8
|
/**
|
|
11
9
|
* Override or extend the styles applied to the component.
|
|
12
10
|
*/
|
|
@@ -18,6 +16,8 @@ export interface DateTimePickerToolbarProps<TDate extends PickerValidDate> exten
|
|
|
18
16
|
* If provided, it will be used instead of `dateTimePickerToolbarTitle` from localization.
|
|
19
17
|
*/
|
|
20
18
|
toolbarTitle?: React.ReactNode;
|
|
19
|
+
ampm?: boolean;
|
|
20
|
+
ampmInClock?: boolean;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Demos:
|
|
@@ -360,6 +360,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
360
360
|
* Currently visible picker view.
|
|
361
361
|
*/
|
|
362
362
|
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
363
|
+
/**
|
|
364
|
+
* Available views.
|
|
365
|
+
*/
|
|
363
366
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired
|
|
364
367
|
} : void 0;
|
|
365
368
|
export { DateTimePickerToolbar };
|
|
@@ -229,7 +229,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
229
229
|
value,
|
|
230
230
|
ampm,
|
|
231
231
|
utils,
|
|
232
|
-
isDisabled: hours =>
|
|
232
|
+
isDisabled: hours => isTimeDisabled(hours, 'hours'),
|
|
233
233
|
timeStep: timeSteps.hours,
|
|
234
234
|
resolveAriaLabel: localeText.hoursClockNumberText,
|
|
235
235
|
valueOrReferenceDate
|
|
@@ -245,7 +245,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
245
245
|
items: getTimeSectionOptions({
|
|
246
246
|
value: utils.getMinutes(valueOrReferenceDate),
|
|
247
247
|
utils,
|
|
248
|
-
isDisabled: minutes =>
|
|
248
|
+
isDisabled: minutes => isTimeDisabled(minutes, 'minutes'),
|
|
249
249
|
resolveLabel: minutes => utils.format(utils.setMinutes(now, minutes), 'minutes'),
|
|
250
250
|
timeStep: timeSteps.minutes,
|
|
251
251
|
hasValue: !!value,
|
|
@@ -262,7 +262,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
262
262
|
items: getTimeSectionOptions({
|
|
263
263
|
value: utils.getSeconds(valueOrReferenceDate),
|
|
264
264
|
utils,
|
|
265
|
-
isDisabled: seconds =>
|
|
265
|
+
isDisabled: seconds => isTimeDisabled(seconds, 'seconds'),
|
|
266
266
|
resolveLabel: seconds => utils.format(utils.setSeconds(now, seconds), 'seconds'),
|
|
267
267
|
timeStep: timeSteps.seconds,
|
|
268
268
|
hasValue: !!value,
|
|
@@ -294,7 +294,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
294
294
|
default:
|
|
295
295
|
throw new Error(`Unknown view: ${viewToBuild} found.`);
|
|
296
296
|
}
|
|
297
|
-
}, [now, value, ampm, utils, timeSteps.hours, timeSteps.minutes, timeSteps.seconds, localeText.hoursClockNumberText, localeText.minutesClockNumberText, localeText.secondsClockNumberText, meridiemMode, setValueAndGoToNextView, valueOrReferenceDate,
|
|
297
|
+
}, [now, value, ampm, utils, timeSteps.hours, timeSteps.minutes, timeSteps.seconds, localeText.hoursClockNumberText, localeText.minutesClockNumberText, localeText.secondsClockNumberText, meridiemMode, setValueAndGoToNextView, valueOrReferenceDate, isTimeDisabled, handleMeridiemChange]);
|
|
298
298
|
const viewTimeOptions = React.useMemo(() => {
|
|
299
299
|
return views.reduce((result, currentView) => {
|
|
300
300
|
return _extends({}, result, {
|
|
@@ -138,8 +138,10 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
138
138
|
role: "listbox"
|
|
139
139
|
}, other, {
|
|
140
140
|
children: items.map((option, index) => {
|
|
141
|
-
var _option$isDisabled
|
|
142
|
-
|
|
141
|
+
var _option$isDisabled;
|
|
142
|
+
const isItemDisabled = (_option$isDisabled = option.isDisabled) == null ? void 0 : _option$isDisabled.call(option, option.value);
|
|
143
|
+
const isDisabled = disabled || isItemDisabled;
|
|
144
|
+
if (skipDisabled && isDisabled) {
|
|
143
145
|
return null;
|
|
144
146
|
}
|
|
145
147
|
const isSelected = option.isSelected(option.value);
|
|
@@ -147,12 +149,12 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
147
149
|
return /*#__PURE__*/_jsx(DigitalClockSectionItem, _extends({
|
|
148
150
|
onClick: () => !readOnly && onChange(option.value),
|
|
149
151
|
selected: isSelected,
|
|
150
|
-
disabled:
|
|
152
|
+
disabled: isDisabled,
|
|
151
153
|
disableRipple: readOnly,
|
|
152
154
|
role: "option"
|
|
153
155
|
// aria-readonly is not supported here and does not have any effect
|
|
154
156
|
,
|
|
155
|
-
"aria-disabled": readOnly,
|
|
157
|
+
"aria-disabled": readOnly || isDisabled || undefined,
|
|
156
158
|
"aria-label": option.ariaLabel,
|
|
157
159
|
"aria-selected": isSelected,
|
|
158
160
|
tabIndex: tabIndex,
|
|
@@ -254,6 +254,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
254
254
|
* Currently visible picker view.
|
|
255
255
|
*/
|
|
256
256
|
view: PropTypes.oneOf(['hours', 'meridiem', 'minutes', 'seconds']).isRequired,
|
|
257
|
+
/**
|
|
258
|
+
* Available views.
|
|
259
|
+
*/
|
|
257
260
|
views: PropTypes.arrayOf(PropTypes.oneOf(['hours', 'meridiem', 'minutes', 'seconds']).isRequired).isRequired
|
|
258
261
|
} : void 0;
|
|
259
262
|
export { TimePickerToolbar };
|
package/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["children", "className", "toolbarTitle", "hidden", "titleId", "isLandscape", "classes", "landscapeDirection"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import clsx from 'clsx';
|
|
4
6
|
import Typography from '@mui/material/Typography';
|
|
@@ -63,21 +65,23 @@ export const PickersToolbar = /*#__PURE__*/React.forwardRef(function PickersTool
|
|
|
63
65
|
name: 'MuiPickersToolbar'
|
|
64
66
|
});
|
|
65
67
|
const {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
children,
|
|
69
|
+
className,
|
|
70
|
+
toolbarTitle,
|
|
71
|
+
hidden,
|
|
72
|
+
titleId
|
|
73
|
+
} = props,
|
|
74
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
72
75
|
const ownerState = props;
|
|
73
76
|
const classes = useUtilityClasses(ownerState);
|
|
74
77
|
if (hidden) {
|
|
75
78
|
return null;
|
|
76
79
|
}
|
|
77
|
-
return /*#__PURE__*/_jsxs(PickersToolbarRoot, {
|
|
80
|
+
return /*#__PURE__*/_jsxs(PickersToolbarRoot, _extends({
|
|
78
81
|
ref: ref,
|
|
79
82
|
className: clsx(classes.root, className),
|
|
80
|
-
ownerState: ownerState
|
|
83
|
+
ownerState: ownerState
|
|
84
|
+
}, other, {
|
|
81
85
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
82
86
|
color: "text.secondary",
|
|
83
87
|
variant: "overline",
|
|
@@ -88,5 +92,5 @@ export const PickersToolbar = /*#__PURE__*/React.forwardRef(function PickersTool
|
|
|
88
92
|
ownerState: ownerState,
|
|
89
93
|
children: children
|
|
90
94
|
})]
|
|
91
|
-
});
|
|
95
|
+
}));
|
|
92
96
|
});
|
|
@@ -36,7 +36,7 @@ export const addPositionPropertiesToSections = (sections, localizedDigits, isRTL
|
|
|
36
36
|
export const useFieldV6TextField = params => {
|
|
37
37
|
const theme = useTheme();
|
|
38
38
|
const isRTL = theme.direction === 'rtl';
|
|
39
|
-
const focusTimeoutRef = React.useRef(
|
|
39
|
+
const focusTimeoutRef = React.useRef();
|
|
40
40
|
const {
|
|
41
41
|
forwardedProps: {
|
|
42
42
|
onFocus,
|
|
@@ -151,7 +151,7 @@ export const useFieldV6TextField = params => {
|
|
|
151
151
|
onFocus == null || onFocus(...args);
|
|
152
152
|
// The ref is guaranteed to be resolved at this point.
|
|
153
153
|
const input = inputRef.current;
|
|
154
|
-
|
|
154
|
+
clearTimeout(focusTimeoutRef.current);
|
|
155
155
|
focusTimeoutRef.current = setTimeout(() => {
|
|
156
156
|
// The ref changed, the component got remounted, the focus event is no longer relevant.
|
|
157
157
|
if (!input || input !== inputRef.current) {
|
|
@@ -288,7 +288,9 @@ export const useFieldV6TextField = params => {
|
|
|
288
288
|
if (inputRef.current && inputRef.current === getActiveElement(document)) {
|
|
289
289
|
setSelectedSections('all');
|
|
290
290
|
}
|
|
291
|
-
return () =>
|
|
291
|
+
return () => {
|
|
292
|
+
clearTimeout(focusTimeoutRef.current);
|
|
293
|
+
};
|
|
292
294
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
293
295
|
|
|
294
296
|
const inputMode = React.useMemo(() => {
|
|
@@ -134,7 +134,7 @@ export const useFieldV7TextField = params => {
|
|
|
134
134
|
setFocused(true);
|
|
135
135
|
onClick == null || onClick(event, ...args);
|
|
136
136
|
if (parsedSelectedSections === 'all') {
|
|
137
|
-
|
|
137
|
+
setTimeout(() => {
|
|
138
138
|
const cursorPosition = document.getSelection().getRangeAt(0).startOffset;
|
|
139
139
|
if (cursorPosition === 0) {
|
|
140
140
|
setSelectedSections(sectionOrder.startIndex);
|
|
@@ -206,7 +206,7 @@ export const useFieldV7TextField = params => {
|
|
|
206
206
|
});
|
|
207
207
|
const handleContainerBlur = useEventCallback((...args) => {
|
|
208
208
|
onBlur == null || onBlur(...args);
|
|
209
|
-
|
|
209
|
+
setTimeout(() => {
|
|
210
210
|
if (!sectionListRef.current) {
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
@@ -16,6 +16,9 @@ export interface BaseToolbarProps<TValue, TView extends DateOrTimeViewWithMeridi
|
|
|
16
16
|
* @param {TView} view The view to open
|
|
17
17
|
*/
|
|
18
18
|
onViewChange: (view: TView) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Available views.
|
|
21
|
+
*/
|
|
19
22
|
views: readonly TView[];
|
|
20
23
|
disabled?: boolean;
|
|
21
24
|
readOnly?: boolean;
|
package/locales/koKR.js
CHANGED
|
@@ -46,8 +46,7 @@ const koKRPickers = {
|
|
|
46
46
|
// Open picker labels
|
|
47
47
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `λ μ§λ₯Ό μ ννμΈμ. νμ¬ μ νλ λ μ§λ ${utils.format(value, 'fullDate')}μ
λλ€.` : 'λ μ§λ₯Ό μ ννμΈμ',
|
|
48
48
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `μκ°μ μ ννμΈμ. νμ¬ μ νλ μκ°μ ${utils.format(value, 'fullTime')}μ
λλ€.` : 'μκ°μ μ ννμΈμ',
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
fieldClearLabel: 'μ§μ°κΈ°',
|
|
51
50
|
// Table labels
|
|
52
51
|
timeTableLabel: 'μ νν μκ°',
|
|
53
52
|
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
|
|
@@ -16,11 +16,10 @@ const zhCNPickers = {
|
|
|
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: 'ζΈ
ι€',
|
|
@@ -46,8 +45,7 @@ const zhCNPickers = {
|
|
|
46
45
|
// Open picker labels
|
|
47
46
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ιζ©ζ₯ζοΌε·²ιζ©${utils.format(value, 'fullDate')}` : 'ιζ©ζ₯ζ',
|
|
48
47
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ιζ©ζΆι΄οΌε·²ιζ©${utils.format(value, 'fullTime')}` : 'ιζ©ζΆι΄',
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
fieldClearLabel: 'ζΈ
ι€',
|
|
51
49
|
// Table labels
|
|
52
50
|
timeTableLabel: 'ιζ©ζΆι΄',
|
|
53
51
|
dateTableLabel: 'ιζ©ζ₯ζ',
|
|
@@ -59,19 +57,17 @@ const zhCNPickers = {
|
|
|
59
57
|
fieldHoursPlaceholder: () => 'hh',
|
|
60
58
|
fieldMinutesPlaceholder: () => 'mm',
|
|
61
59
|
fieldSecondsPlaceholder: () => 'ss',
|
|
62
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
63
|
-
|
|
60
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
64
61
|
// View names
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
year: 'εΉ΄δ»½',
|
|
63
|
+
month: 'ζδ»½',
|
|
64
|
+
day: 'ζ₯ζ',
|
|
65
|
+
weekDay: 'ζζ',
|
|
66
|
+
hours: 'ζΆ',
|
|
67
|
+
minutes: 'ε',
|
|
68
|
+
seconds: 'η§',
|
|
69
|
+
meridiem: 'εδΊε°ζΆεΆ',
|
|
74
70
|
// Common
|
|
75
|
-
|
|
71
|
+
empty: 'η©Ί'
|
|
76
72
|
};
|
|
77
73
|
export const zhCN = getPickersLocalization(zhCNPickers);
|
|
@@ -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 = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
|
|
3
|
+
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className", "onViewChange", "view"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -133,5 +133,8 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
133
133
|
* Currently visible picker view.
|
|
134
134
|
*/
|
|
135
135
|
view: PropTypes.oneOf(['day', 'month', 'year']).isRequired,
|
|
136
|
+
/**
|
|
137
|
+
* Available views.
|
|
138
|
+
*/
|
|
136
139
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired).isRequired
|
|
137
140
|
} : void 0;
|
|
@@ -360,6 +360,9 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
360
360
|
* Currently visible picker view.
|
|
361
361
|
*/
|
|
362
362
|
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
363
|
+
/**
|
|
364
|
+
* Available views.
|
|
365
|
+
*/
|
|
363
366
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired
|
|
364
367
|
} : void 0;
|
|
365
368
|
export { DateTimePickerToolbar };
|
|
@@ -229,7 +229,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
229
229
|
value,
|
|
230
230
|
ampm,
|
|
231
231
|
utils,
|
|
232
|
-
isDisabled: hours =>
|
|
232
|
+
isDisabled: hours => isTimeDisabled(hours, 'hours'),
|
|
233
233
|
timeStep: timeSteps.hours,
|
|
234
234
|
resolveAriaLabel: localeText.hoursClockNumberText,
|
|
235
235
|
valueOrReferenceDate
|
|
@@ -245,7 +245,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
245
245
|
items: getTimeSectionOptions({
|
|
246
246
|
value: utils.getMinutes(valueOrReferenceDate),
|
|
247
247
|
utils,
|
|
248
|
-
isDisabled: minutes =>
|
|
248
|
+
isDisabled: minutes => isTimeDisabled(minutes, 'minutes'),
|
|
249
249
|
resolveLabel: minutes => utils.format(utils.setMinutes(now, minutes), 'minutes'),
|
|
250
250
|
timeStep: timeSteps.minutes,
|
|
251
251
|
hasValue: !!value,
|
|
@@ -262,7 +262,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
262
262
|
items: getTimeSectionOptions({
|
|
263
263
|
value: utils.getSeconds(valueOrReferenceDate),
|
|
264
264
|
utils,
|
|
265
|
-
isDisabled: seconds =>
|
|
265
|
+
isDisabled: seconds => isTimeDisabled(seconds, 'seconds'),
|
|
266
266
|
resolveLabel: seconds => utils.format(utils.setSeconds(now, seconds), 'seconds'),
|
|
267
267
|
timeStep: timeSteps.seconds,
|
|
268
268
|
hasValue: !!value,
|
|
@@ -294,7 +294,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
294
294
|
default:
|
|
295
295
|
throw new Error(`Unknown view: ${viewToBuild} found.`);
|
|
296
296
|
}
|
|
297
|
-
}, [now, value, ampm, utils, timeSteps.hours, timeSteps.minutes, timeSteps.seconds, localeText.hoursClockNumberText, localeText.minutesClockNumberText, localeText.secondsClockNumberText, meridiemMode, setValueAndGoToNextView, valueOrReferenceDate,
|
|
297
|
+
}, [now, value, ampm, utils, timeSteps.hours, timeSteps.minutes, timeSteps.seconds, localeText.hoursClockNumberText, localeText.minutesClockNumberText, localeText.secondsClockNumberText, meridiemMode, setValueAndGoToNextView, valueOrReferenceDate, isTimeDisabled, handleMeridiemChange]);
|
|
298
298
|
const viewTimeOptions = React.useMemo(() => {
|
|
299
299
|
return views.reduce((result, currentView) => {
|
|
300
300
|
return _extends({}, result, {
|
|
@@ -137,7 +137,9 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
137
137
|
role: "listbox"
|
|
138
138
|
}, other, {
|
|
139
139
|
children: items.map((option, index) => {
|
|
140
|
-
|
|
140
|
+
const isItemDisabled = option.isDisabled?.(option.value);
|
|
141
|
+
const isDisabled = disabled || isItemDisabled;
|
|
142
|
+
if (skipDisabled && isDisabled) {
|
|
141
143
|
return null;
|
|
142
144
|
}
|
|
143
145
|
const isSelected = option.isSelected(option.value);
|
|
@@ -145,12 +147,12 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
145
147
|
return /*#__PURE__*/_jsx(DigitalClockSectionItem, _extends({
|
|
146
148
|
onClick: () => !readOnly && onChange(option.value),
|
|
147
149
|
selected: isSelected,
|
|
148
|
-
disabled:
|
|
150
|
+
disabled: isDisabled,
|
|
149
151
|
disableRipple: readOnly,
|
|
150
152
|
role: "option"
|
|
151
153
|
// aria-readonly is not supported here and does not have any effect
|
|
152
154
|
,
|
|
153
|
-
"aria-disabled": readOnly,
|
|
155
|
+
"aria-disabled": readOnly || isDisabled || undefined,
|
|
154
156
|
"aria-label": option.ariaLabel,
|
|
155
157
|
"aria-selected": isSelected,
|
|
156
158
|
tabIndex: tabIndex,
|
|
@@ -254,6 +254,9 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
254
254
|
* Currently visible picker view.
|
|
255
255
|
*/
|
|
256
256
|
view: PropTypes.oneOf(['hours', 'meridiem', 'minutes', 'seconds']).isRequired,
|
|
257
|
+
/**
|
|
258
|
+
* Available views.
|
|
259
|
+
*/
|
|
257
260
|
views: PropTypes.arrayOf(PropTypes.oneOf(['hours', 'meridiem', 'minutes', 'seconds']).isRequired).isRequired
|
|
258
261
|
} : void 0;
|
|
259
262
|
export { TimePickerToolbar };
|
package/modern/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["children", "className", "toolbarTitle", "hidden", "titleId", "isLandscape", "classes", "landscapeDirection"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import clsx from 'clsx';
|
|
4
6
|
import Typography from '@mui/material/Typography';
|
|
@@ -60,21 +62,23 @@ export const PickersToolbar = /*#__PURE__*/React.forwardRef(function PickersTool
|
|
|
60
62
|
name: 'MuiPickersToolbar'
|
|
61
63
|
});
|
|
62
64
|
const {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
children,
|
|
66
|
+
className,
|
|
67
|
+
toolbarTitle,
|
|
68
|
+
hidden,
|
|
69
|
+
titleId
|
|
70
|
+
} = props,
|
|
71
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
69
72
|
const ownerState = props;
|
|
70
73
|
const classes = useUtilityClasses(ownerState);
|
|
71
74
|
if (hidden) {
|
|
72
75
|
return null;
|
|
73
76
|
}
|
|
74
|
-
return /*#__PURE__*/_jsxs(PickersToolbarRoot, {
|
|
77
|
+
return /*#__PURE__*/_jsxs(PickersToolbarRoot, _extends({
|
|
75
78
|
ref: ref,
|
|
76
79
|
className: clsx(classes.root, className),
|
|
77
|
-
ownerState: ownerState
|
|
80
|
+
ownerState: ownerState
|
|
81
|
+
}, other, {
|
|
78
82
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
79
83
|
color: "text.secondary",
|
|
80
84
|
variant: "overline",
|
|
@@ -85,5 +89,5 @@ export const PickersToolbar = /*#__PURE__*/React.forwardRef(function PickersTool
|
|
|
85
89
|
ownerState: ownerState,
|
|
86
90
|
children: children
|
|
87
91
|
})]
|
|
88
|
-
});
|
|
92
|
+
}));
|
|
89
93
|
});
|
|
@@ -36,7 +36,7 @@ export const addPositionPropertiesToSections = (sections, localizedDigits, isRTL
|
|
|
36
36
|
export const useFieldV6TextField = params => {
|
|
37
37
|
const theme = useTheme();
|
|
38
38
|
const isRTL = theme.direction === 'rtl';
|
|
39
|
-
const focusTimeoutRef = React.useRef(
|
|
39
|
+
const focusTimeoutRef = React.useRef();
|
|
40
40
|
const {
|
|
41
41
|
forwardedProps: {
|
|
42
42
|
onFocus,
|
|
@@ -148,7 +148,7 @@ export const useFieldV6TextField = params => {
|
|
|
148
148
|
onFocus?.(...args);
|
|
149
149
|
// The ref is guaranteed to be resolved at this point.
|
|
150
150
|
const input = inputRef.current;
|
|
151
|
-
|
|
151
|
+
clearTimeout(focusTimeoutRef.current);
|
|
152
152
|
focusTimeoutRef.current = setTimeout(() => {
|
|
153
153
|
// The ref changed, the component got remounted, the focus event is no longer relevant.
|
|
154
154
|
if (!input || input !== inputRef.current) {
|
|
@@ -282,7 +282,9 @@ export const useFieldV6TextField = params => {
|
|
|
282
282
|
if (inputRef.current && inputRef.current === getActiveElement(document)) {
|
|
283
283
|
setSelectedSections('all');
|
|
284
284
|
}
|
|
285
|
-
return () =>
|
|
285
|
+
return () => {
|
|
286
|
+
clearTimeout(focusTimeoutRef.current);
|
|
287
|
+
};
|
|
286
288
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
287
289
|
|
|
288
290
|
const inputMode = React.useMemo(() => {
|
|
@@ -134,7 +134,7 @@ export const useFieldV7TextField = params => {
|
|
|
134
134
|
setFocused(true);
|
|
135
135
|
onClick?.(event, ...args);
|
|
136
136
|
if (parsedSelectedSections === 'all') {
|
|
137
|
-
|
|
137
|
+
setTimeout(() => {
|
|
138
138
|
const cursorPosition = document.getSelection().getRangeAt(0).startOffset;
|
|
139
139
|
if (cursorPosition === 0) {
|
|
140
140
|
setSelectedSections(sectionOrder.startIndex);
|
|
@@ -205,7 +205,7 @@ export const useFieldV7TextField = params => {
|
|
|
205
205
|
});
|
|
206
206
|
const handleContainerBlur = useEventCallback((...args) => {
|
|
207
207
|
onBlur?.(...args);
|
|
208
|
-
|
|
208
|
+
setTimeout(() => {
|
|
209
209
|
if (!sectionListRef.current) {
|
|
210
210
|
return;
|
|
211
211
|
}
|
package/modern/locales/koKR.js
CHANGED
|
@@ -46,8 +46,7 @@ const koKRPickers = {
|
|
|
46
46
|
// Open picker labels
|
|
47
47
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `λ μ§λ₯Ό μ ννμΈμ. νμ¬ μ νλ λ μ§λ ${utils.format(value, 'fullDate')}μ
λλ€.` : 'λ μ§λ₯Ό μ ννμΈμ',
|
|
48
48
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `μκ°μ μ ννμΈμ. νμ¬ μ νλ μκ°μ ${utils.format(value, 'fullTime')}μ
λλ€.` : 'μκ°μ μ ννμΈμ',
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
fieldClearLabel: 'μ§μ°κΈ°',
|
|
51
50
|
// Table labels
|
|
52
51
|
timeTableLabel: 'μ νν μκ°',
|
|
53
52
|
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
|
|
@@ -16,11 +16,10 @@ const zhCNPickers = {
|
|
|
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: 'ζΈ
ι€',
|
|
@@ -46,8 +45,7 @@ const zhCNPickers = {
|
|
|
46
45
|
// Open picker labels
|
|
47
46
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ιζ©ζ₯ζοΌε·²ιζ©${utils.format(value, 'fullDate')}` : 'ιζ©ζ₯ζ',
|
|
48
47
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ιζ©ζΆι΄οΌε·²ιζ©${utils.format(value, 'fullTime')}` : 'ιζ©ζΆι΄',
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
fieldClearLabel: 'ζΈ
ι€',
|
|
51
49
|
// Table labels
|
|
52
50
|
timeTableLabel: 'ιζ©ζΆι΄',
|
|
53
51
|
dateTableLabel: 'ιζ©ζ₯ζ',
|
|
@@ -59,19 +57,17 @@ const zhCNPickers = {
|
|
|
59
57
|
fieldHoursPlaceholder: () => 'hh',
|
|
60
58
|
fieldMinutesPlaceholder: () => 'mm',
|
|
61
59
|
fieldSecondsPlaceholder: () => 'ss',
|
|
62
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
63
|
-
|
|
60
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
64
61
|
// View names
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
year: 'εΉ΄δ»½',
|
|
63
|
+
month: 'ζδ»½',
|
|
64
|
+
day: 'ζ₯ζ',
|
|
65
|
+
weekDay: 'ζζ',
|
|
66
|
+
hours: 'ζΆ',
|
|
67
|
+
minutes: 'ε',
|
|
68
|
+
seconds: 'η§',
|
|
69
|
+
meridiem: 'εδΊε°ζΆεΆ',
|
|
74
70
|
// Common
|
|
75
|
-
|
|
71
|
+
empty: 'η©Ί'
|
|
76
72
|
};
|
|
77
73
|
export const zhCN = getPickersLocalization(zhCNPickers);
|
|
@@ -18,7 +18,7 @@ var _useUtils = require("../internals/hooks/useUtils");
|
|
|
18
18
|
var _datePickerToolbarClasses = require("./datePickerToolbarClasses");
|
|
19
19
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className"];
|
|
21
|
+
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views", "className", "onViewChange", "view"];
|
|
22
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); }
|
|
23
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; }
|
|
24
24
|
const useUtilityClasses = ownerState => {
|
|
@@ -142,5 +142,8 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
142
142
|
* Currently visible picker view.
|
|
143
143
|
*/
|
|
144
144
|
view: _propTypes.default.oneOf(['day', 'month', 'year']).isRequired,
|
|
145
|
+
/**
|
|
146
|
+
* Available views.
|
|
147
|
+
*/
|
|
145
148
|
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['day', 'month', 'year']).isRequired).isRequired
|
|
146
149
|
} : void 0;
|
|
@@ -368,5 +368,8 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
368
368
|
* Currently visible picker view.
|
|
369
369
|
*/
|
|
370
370
|
view: _propTypes.default.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
371
|
+
/**
|
|
372
|
+
* Available views.
|
|
373
|
+
*/
|
|
371
374
|
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired
|
|
372
375
|
} : void 0;
|
|
@@ -238,7 +238,7 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
238
238
|
value,
|
|
239
239
|
ampm,
|
|
240
240
|
utils,
|
|
241
|
-
isDisabled: hours =>
|
|
241
|
+
isDisabled: hours => isTimeDisabled(hours, 'hours'),
|
|
242
242
|
timeStep: timeSteps.hours,
|
|
243
243
|
resolveAriaLabel: localeText.hoursClockNumberText,
|
|
244
244
|
valueOrReferenceDate
|
|
@@ -254,7 +254,7 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
254
254
|
items: (0, _MultiSectionDigitalClock.getTimeSectionOptions)({
|
|
255
255
|
value: utils.getMinutes(valueOrReferenceDate),
|
|
256
256
|
utils,
|
|
257
|
-
isDisabled: minutes =>
|
|
257
|
+
isDisabled: minutes => isTimeDisabled(minutes, 'minutes'),
|
|
258
258
|
resolveLabel: minutes => utils.format(utils.setMinutes(now, minutes), 'minutes'),
|
|
259
259
|
timeStep: timeSteps.minutes,
|
|
260
260
|
hasValue: !!value,
|
|
@@ -271,7 +271,7 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
271
271
|
items: (0, _MultiSectionDigitalClock.getTimeSectionOptions)({
|
|
272
272
|
value: utils.getSeconds(valueOrReferenceDate),
|
|
273
273
|
utils,
|
|
274
|
-
isDisabled: seconds =>
|
|
274
|
+
isDisabled: seconds => isTimeDisabled(seconds, 'seconds'),
|
|
275
275
|
resolveLabel: seconds => utils.format(utils.setSeconds(now, seconds), 'seconds'),
|
|
276
276
|
timeStep: timeSteps.seconds,
|
|
277
277
|
hasValue: !!value,
|
|
@@ -303,7 +303,7 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
303
303
|
default:
|
|
304
304
|
throw new Error(`Unknown view: ${viewToBuild} found.`);
|
|
305
305
|
}
|
|
306
|
-
}, [now, value, ampm, utils, timeSteps.hours, timeSteps.minutes, timeSteps.seconds, localeText.hoursClockNumberText, localeText.minutesClockNumberText, localeText.secondsClockNumberText, meridiemMode, setValueAndGoToNextView, valueOrReferenceDate,
|
|
306
|
+
}, [now, value, ampm, utils, timeSteps.hours, timeSteps.minutes, timeSteps.seconds, localeText.hoursClockNumberText, localeText.minutesClockNumberText, localeText.secondsClockNumberText, meridiemMode, setValueAndGoToNextView, valueOrReferenceDate, isTimeDisabled, handleMeridiemChange]);
|
|
307
307
|
const viewTimeOptions = React.useMemo(() => {
|
|
308
308
|
return views.reduce((result, currentView) => {
|
|
309
309
|
return (0, _extends2.default)({}, result, {
|
|
@@ -146,7 +146,9 @@ const MultiSectionDigitalClockSection = exports.MultiSectionDigitalClockSection
|
|
|
146
146
|
role: "listbox"
|
|
147
147
|
}, other, {
|
|
148
148
|
children: items.map((option, index) => {
|
|
149
|
-
|
|
149
|
+
const isItemDisabled = option.isDisabled?.(option.value);
|
|
150
|
+
const isDisabled = disabled || isItemDisabled;
|
|
151
|
+
if (skipDisabled && isDisabled) {
|
|
150
152
|
return null;
|
|
151
153
|
}
|
|
152
154
|
const isSelected = option.isSelected(option.value);
|
|
@@ -154,12 +156,12 @@ const MultiSectionDigitalClockSection = exports.MultiSectionDigitalClockSection
|
|
|
154
156
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(DigitalClockSectionItem, (0, _extends2.default)({
|
|
155
157
|
onClick: () => !readOnly && onChange(option.value),
|
|
156
158
|
selected: isSelected,
|
|
157
|
-
disabled:
|
|
159
|
+
disabled: isDisabled,
|
|
158
160
|
disableRipple: readOnly,
|
|
159
161
|
role: "option"
|
|
160
162
|
// aria-readonly is not supported here and does not have any effect
|
|
161
163
|
,
|
|
162
|
-
"aria-disabled": readOnly,
|
|
164
|
+
"aria-disabled": readOnly || isDisabled || undefined,
|
|
163
165
|
"aria-label": option.ariaLabel,
|
|
164
166
|
"aria-selected": isSelected,
|
|
165
167
|
tabIndex: tabIndex,
|
|
@@ -262,5 +262,8 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
262
262
|
* Currently visible picker view.
|
|
263
263
|
*/
|
|
264
264
|
view: _propTypes.default.oneOf(['hours', 'meridiem', 'minutes', 'seconds']).isRequired,
|
|
265
|
+
/**
|
|
266
|
+
* Available views.
|
|
267
|
+
*/
|
|
265
268
|
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['hours', 'meridiem', 'minutes', 'seconds']).isRequired).isRequired
|
|
266
269
|
} : void 0;
|
package/node/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.PickersToolbar = void 0;
|
|
8
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
@@ -13,6 +14,7 @@ var _styles = require("@mui/material/styles");
|
|
|
13
14
|
var _utils = require("@mui/utils");
|
|
14
15
|
var _pickersToolbarClasses = require("./pickersToolbarClasses");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const _excluded = ["children", "className", "toolbarTitle", "hidden", "titleId", "isLandscape", "classes", "landscapeDirection"];
|
|
16
18
|
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); }
|
|
17
19
|
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; }
|
|
18
20
|
const useUtilityClasses = ownerState => {
|
|
@@ -68,21 +70,23 @@ const PickersToolbar = exports.PickersToolbar = /*#__PURE__*/React.forwardRef(fu
|
|
|
68
70
|
name: 'MuiPickersToolbar'
|
|
69
71
|
});
|
|
70
72
|
const {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
children,
|
|
74
|
+
className,
|
|
75
|
+
toolbarTitle,
|
|
76
|
+
hidden,
|
|
77
|
+
titleId
|
|
78
|
+
} = props,
|
|
79
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
77
80
|
const ownerState = props;
|
|
78
81
|
const classes = useUtilityClasses(ownerState);
|
|
79
82
|
if (hidden) {
|
|
80
83
|
return null;
|
|
81
84
|
}
|
|
82
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PickersToolbarRoot, {
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PickersToolbarRoot, (0, _extends2.default)({
|
|
83
86
|
ref: ref,
|
|
84
87
|
className: (0, _clsx.default)(classes.root, className),
|
|
85
|
-
ownerState: ownerState
|
|
88
|
+
ownerState: ownerState
|
|
89
|
+
}, other, {
|
|
86
90
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
87
91
|
color: "text.secondary",
|
|
88
92
|
variant: "overline",
|
|
@@ -93,5 +97,5 @@ const PickersToolbar = exports.PickersToolbar = /*#__PURE__*/React.forwardRef(fu
|
|
|
93
97
|
ownerState: ownerState,
|
|
94
98
|
children: children
|
|
95
99
|
})]
|
|
96
|
-
});
|
|
100
|
+
}));
|
|
97
101
|
});
|
|
@@ -46,7 +46,7 @@ exports.addPositionPropertiesToSections = addPositionPropertiesToSections;
|
|
|
46
46
|
const useFieldV6TextField = params => {
|
|
47
47
|
const theme = (0, _styles.useTheme)();
|
|
48
48
|
const isRTL = theme.direction === 'rtl';
|
|
49
|
-
const focusTimeoutRef = React.useRef(
|
|
49
|
+
const focusTimeoutRef = React.useRef();
|
|
50
50
|
const {
|
|
51
51
|
forwardedProps: {
|
|
52
52
|
onFocus,
|
|
@@ -158,7 +158,7 @@ const useFieldV6TextField = params => {
|
|
|
158
158
|
onFocus?.(...args);
|
|
159
159
|
// The ref is guaranteed to be resolved at this point.
|
|
160
160
|
const input = inputRef.current;
|
|
161
|
-
|
|
161
|
+
clearTimeout(focusTimeoutRef.current);
|
|
162
162
|
focusTimeoutRef.current = setTimeout(() => {
|
|
163
163
|
// The ref changed, the component got remounted, the focus event is no longer relevant.
|
|
164
164
|
if (!input || input !== inputRef.current) {
|
|
@@ -292,7 +292,9 @@ const useFieldV6TextField = params => {
|
|
|
292
292
|
if (inputRef.current && inputRef.current === (0, _utils.getActiveElement)(document)) {
|
|
293
293
|
setSelectedSections('all');
|
|
294
294
|
}
|
|
295
|
-
return () =>
|
|
295
|
+
return () => {
|
|
296
|
+
clearTimeout(focusTimeoutRef.current);
|
|
297
|
+
};
|
|
296
298
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
297
299
|
|
|
298
300
|
const inputMode = React.useMemo(() => {
|
|
@@ -143,7 +143,7 @@ const useFieldV7TextField = params => {
|
|
|
143
143
|
setFocused(true);
|
|
144
144
|
onClick?.(event, ...args);
|
|
145
145
|
if (parsedSelectedSections === 'all') {
|
|
146
|
-
|
|
146
|
+
setTimeout(() => {
|
|
147
147
|
const cursorPosition = document.getSelection().getRangeAt(0).startOffset;
|
|
148
148
|
if (cursorPosition === 0) {
|
|
149
149
|
setSelectedSections(sectionOrder.startIndex);
|
|
@@ -214,7 +214,7 @@ const useFieldV7TextField = params => {
|
|
|
214
214
|
});
|
|
215
215
|
const handleContainerBlur = (0, _useEventCallback.default)((...args) => {
|
|
216
216
|
onBlur?.(...args);
|
|
217
|
-
|
|
217
|
+
setTimeout(() => {
|
|
218
218
|
if (!sectionListRef.current) {
|
|
219
219
|
return;
|
|
220
220
|
}
|
package/node/locales/koKR.js
CHANGED
|
@@ -52,8 +52,7 @@ const koKRPickers = {
|
|
|
52
52
|
// Open picker labels
|
|
53
53
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `λ μ§λ₯Ό μ ννμΈμ. νμ¬ μ νλ λ μ§λ ${utils.format(value, 'fullDate')}μ
λλ€.` : 'λ μ§λ₯Ό μ ννμΈμ',
|
|
54
54
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `μκ°μ μ ννμΈμ. νμ¬ μ νλ μκ°μ ${utils.format(value, 'fullTime')}μ
λλ€.` : 'μκ°μ μ ννμΈμ',
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
fieldClearLabel: 'μ§μ°κΈ°',
|
|
57
56
|
// Table labels
|
|
58
57
|
timeTableLabel: 'μ νν μκ°',
|
|
59
58
|
dateTableLabel: 'μ νν λ μ§',
|
package/node/locales/zhCN.js
CHANGED
|
@@ -9,7 +9,7 @@ const views = {
|
|
|
9
9
|
hours: 'ε°ζΆ',
|
|
10
10
|
minutes: 'ει',
|
|
11
11
|
seconds: 'η§',
|
|
12
|
-
meridiem: '
|
|
12
|
+
meridiem: 'εδΊε°ζΆεΆ'
|
|
13
13
|
};
|
|
14
14
|
const zhCNPickers = {
|
|
15
15
|
// Calendar navigation
|
|
@@ -22,11 +22,10 @@ const zhCNPickers = {
|
|
|
22
22
|
// DateRange labels
|
|
23
23
|
start: 'εΌε§',
|
|
24
24
|
end: 'η»ζ',
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
startDate: 'εΌε§ζ₯ζ',
|
|
26
|
+
startTime: 'εΌε§ζΆι΄',
|
|
27
|
+
endDate: 'η»ζζ₯ζ',
|
|
28
|
+
endTime: 'η»ζζΆι΄',
|
|
30
29
|
// Action bar
|
|
31
30
|
cancelButtonLabel: 'εζΆ',
|
|
32
31
|
clearButtonLabel: 'ζΈ
ι€',
|
|
@@ -52,8 +51,7 @@ const zhCNPickers = {
|
|
|
52
51
|
// Open picker labels
|
|
53
52
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ιζ©ζ₯ζοΌε·²ιζ©${utils.format(value, 'fullDate')}` : 'ιζ©ζ₯ζ',
|
|
54
53
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ιζ©ζΆι΄οΌε·²ιζ©${utils.format(value, 'fullTime')}` : 'ιζ©ζΆι΄',
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
fieldClearLabel: 'ζΈ
ι€',
|
|
57
55
|
// Table labels
|
|
58
56
|
timeTableLabel: 'ιζ©ζΆι΄',
|
|
59
57
|
dateTableLabel: 'ιζ©ζ₯ζ',
|
|
@@ -65,19 +63,17 @@ const zhCNPickers = {
|
|
|
65
63
|
fieldHoursPlaceholder: () => 'hh',
|
|
66
64
|
fieldMinutesPlaceholder: () => 'mm',
|
|
67
65
|
fieldSecondsPlaceholder: () => 'ss',
|
|
68
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
69
|
-
|
|
66
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
70
67
|
// View names
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
68
|
+
year: 'εΉ΄δ»½',
|
|
69
|
+
month: 'ζδ»½',
|
|
70
|
+
day: 'ζ₯ζ',
|
|
71
|
+
weekDay: 'ζζ',
|
|
72
|
+
hours: 'ζΆ',
|
|
73
|
+
minutes: 'ε',
|
|
74
|
+
seconds: 'η§',
|
|
75
|
+
meridiem: 'εδΊε°ζΆεΆ',
|
|
80
76
|
// Common
|
|
81
|
-
|
|
77
|
+
empty: 'η©Ί'
|
|
82
78
|
};
|
|
83
79
|
const zhCN = exports.zhCN = (0, _getPickersLocalization.getPickersLocalization)(zhCNPickers);
|
package/package.json
CHANGED
|
@@ -19,22 +19,21 @@ import { PickersToolbarButtonProps } from '../internals/components/PickersToolba
|
|
|
19
19
|
import { ExportedPickersToolbarTextProps } from '../internals/components/PickersToolbarText';
|
|
20
20
|
import { DateOrTimeView, PickerValidDate } from '../models';
|
|
21
21
|
|
|
22
|
-
import { DatePickerProps
|
|
22
|
+
import { DatePickerProps } from '../DatePicker';
|
|
23
|
+
import { ExportedDatePickerToolbarProps } from '../DatePicker/DatePickerToolbar';
|
|
23
24
|
import { DesktopDatePickerProps } from '../DesktopDatePicker';
|
|
24
25
|
import { MobileDatePickerProps } from '../MobileDatePicker';
|
|
25
26
|
import { StaticDatePickerProps } from '../StaticDatePicker';
|
|
26
27
|
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
DateTimePickerTabsProps,
|
|
30
|
-
DateTimePickerToolbarProps,
|
|
31
|
-
} from '../DateTimePicker';
|
|
28
|
+
import { DateTimePickerProps, DateTimePickerTabsProps } from '../DateTimePicker';
|
|
29
|
+
import { ExportedDateTimePickerToolbarProps } from '../DateTimePicker/DateTimePickerToolbar';
|
|
32
30
|
import { DesktopDateTimePickerProps } from '../DesktopDateTimePicker';
|
|
33
31
|
import { MobileDateTimePickerProps } from '../MobileDateTimePicker';
|
|
34
32
|
import { StaticDateTimePickerProps } from '../StaticDateTimePicker';
|
|
35
33
|
import { DateTimeFieldProps } from '../DateTimeField';
|
|
36
34
|
|
|
37
|
-
import { TimePickerProps
|
|
35
|
+
import { TimePickerProps } from '../TimePicker';
|
|
36
|
+
import { ExportedTimePickerToolbarProps } from '../TimePicker/TimePickerToolbar';
|
|
38
37
|
import { DesktopTimePickerProps } from '../DesktopTimePicker';
|
|
39
38
|
import { MobileTimePickerProps } from '../MobileTimePicker';
|
|
40
39
|
import { StaticTimePickerProps } from '../StaticTimePicker';
|
|
@@ -60,10 +59,10 @@ export interface PickersComponentsPropsList {
|
|
|
60
59
|
MuiClockPointer: ClockPointerProps;
|
|
61
60
|
MuiDateCalendar: DateCalendarProps<PickerValidDate>;
|
|
62
61
|
MuiDateField: DateFieldProps<PickerValidDate, any>;
|
|
63
|
-
MuiDatePickerToolbar:
|
|
62
|
+
MuiDatePickerToolbar: ExportedDatePickerToolbarProps;
|
|
64
63
|
MuiDateTimeField: DateTimeFieldProps<PickerValidDate, any>;
|
|
65
64
|
MuiDateTimePickerTabs: DateTimePickerTabsProps;
|
|
66
|
-
MuiDateTimePickerToolbar:
|
|
65
|
+
MuiDateTimePickerToolbar: ExportedDateTimePickerToolbarProps;
|
|
67
66
|
MuiDayCalendar: DayCalendarProps<PickerValidDate>;
|
|
68
67
|
MuiDayCalendarSkeleton: DayCalendarSkeletonProps;
|
|
69
68
|
MuiDigitalClock: ExportedDigitalClockProps<PickerValidDate>;
|
|
@@ -85,7 +84,7 @@ export interface PickersComponentsPropsList {
|
|
|
85
84
|
MuiPickersYear: ExportedPickersYearProps;
|
|
86
85
|
MuiTimeClock: TimeClockProps<PickerValidDate>;
|
|
87
86
|
MuiTimeField: TimeFieldProps<PickerValidDate, any>;
|
|
88
|
-
MuiTimePickerToolbar:
|
|
87
|
+
MuiTimePickerToolbar: ExportedTimePickerToolbarProps;
|
|
89
88
|
MuiYearCalendar: YearCalendarProps<PickerValidDate>;
|
|
90
89
|
|
|
91
90
|
// Date Pickers
|