@mui/x-date-pickers 9.7.0 → 9.9.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/AdapterMomentHijri/AdapterMomentHijri.js +2 -2
- package/AdapterMomentHijri/AdapterMomentHijri.mjs +2 -2
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +2 -2
- package/AdapterMomentJalaali/AdapterMomentJalaali.mjs +2 -2
- package/CHANGELOG.md +249 -1
- package/DateCalendar/DayCalendar.d.mts +1 -1
- package/DateCalendar/DayCalendar.d.ts +1 -1
- package/DateCalendar/DayCalendar.js +5 -4
- package/DateCalendar/DayCalendar.mjs +5 -4
- package/DateCalendar/PickersFadeTransitionGroup.d.mts +1 -1
- package/DateCalendar/PickersFadeTransitionGroup.d.ts +1 -1
- package/DateCalendar/PickersSlideTransition.d.mts +1 -1
- package/DateCalendar/PickersSlideTransition.d.ts +1 -1
- package/DateTimePicker/DateTimePickerTabs.d.mts +1 -1
- package/DateTimePicker/DateTimePickerTabs.d.ts +1 -1
- package/DateTimePicker/DateTimePickerToolbar.d.mts +1 -1
- package/DateTimePicker/DateTimePickerToolbar.d.ts +1 -1
- package/DayCalendarSkeleton/DayCalendarSkeleton.d.mts +1 -1
- package/DayCalendarSkeleton/DayCalendarSkeleton.d.ts +1 -1
- package/MonthCalendar/MonthCalendarButton.d.mts +1 -1
- package/MonthCalendar/MonthCalendarButton.d.ts +1 -1
- package/PickersActionBar/PickersActionBar.d.mts +1 -1
- package/PickersActionBar/PickersActionBar.d.ts +1 -1
- package/PickersShortcuts/PickersShortcuts.d.mts +1 -1
- package/PickersShortcuts/PickersShortcuts.d.ts +1 -1
- package/PickersTextField/PickersOutlinedInput/Outline.d.mts +1 -1
- package/PickersTextField/PickersOutlinedInput/Outline.d.ts +1 -1
- package/TimeClock/Clock.d.mts +1 -1
- package/TimeClock/Clock.d.ts +1 -1
- package/TimeClock/ClockNumber.d.mts +1 -1
- package/TimeClock/ClockNumber.d.ts +1 -1
- package/TimeClock/ClockNumbers.d.mts +1 -1
- package/TimeClock/ClockNumbers.d.ts +1 -1
- package/TimeClock/ClockPointer.d.mts +1 -1
- package/TimeClock/ClockPointer.d.ts +1 -1
- package/TimePicker/TimePickerToolbar.d.mts +1 -1
- package/TimePicker/TimePickerToolbar.d.ts +1 -1
- package/YearCalendar/YearCalendarButton.d.mts +1 -1
- package/YearCalendar/YearCalendarButton.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.d.mts +1 -1
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/components/PickerFieldUI.d.mts +2 -2
- package/internals/components/PickerFieldUI.d.ts +2 -2
- package/internals/components/PickerPopper/PickerPopper.d.mts +1 -1
- package/internals/components/PickerPopper/PickerPopper.d.ts +1 -1
- package/internals/components/PickerPopper/PickerPopper.js +1 -1
- package/internals/components/PickerPopper/PickerPopper.mjs +1 -1
- package/internals/components/PickerProvider.d.mts +1 -1
- package/internals/components/PickerProvider.d.ts +1 -1
- package/internals/components/PickersModalDialog.d.mts +1 -1
- package/internals/components/PickersModalDialog.d.ts +1 -1
- package/internals/demo/DemoContainer.d.mts +2 -2
- package/internals/demo/DemoContainer.d.ts +2 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.mts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -1
- package/internals/hooks/useField/useField.utils.d.mts +0 -1
- package/internals/hooks/useField/useField.utils.d.ts +0 -1
- package/internals/hooks/useField/useField.utils.js +2 -2
- package/internals/hooks/useField/useField.utils.mjs +1 -1
- package/internals/hooks/useField/useFieldSectionContentProps.js +14 -11
- package/internals/hooks/useField/useFieldSectionContentProps.mjs +14 -11
- package/internals/hooks/useMobilePicker/useMobilePicker.d.mts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.d.mts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -1
- package/locales/roRO.js +2 -3
- package/locales/roRO.mjs +2 -3
- package/package.json +3 -3
- package/timeViewRenderers/timeViewRenderers.d.mts +3 -3
- package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
|
@@ -20,4 +20,4 @@ export interface YearCalendarButtonProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* @ignore - internal component.
|
|
22
22
|
*/
|
|
23
|
-
export declare const YearCalendarButton: React.MemoExoticComponent<(props: YearCalendarButtonProps) =>
|
|
23
|
+
export declare const YearCalendarButton: React.MemoExoticComponent<(props: YearCalendarButtonProps) => React.JSX.Element>;
|
|
@@ -20,4 +20,4 @@ export interface YearCalendarButtonProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* @ignore - internal component.
|
|
22
22
|
*/
|
|
23
|
-
export declare const YearCalendarButton: React.MemoExoticComponent<(props: YearCalendarButtonProps) =>
|
|
23
|
+
export declare const YearCalendarButton: React.MemoExoticComponent<(props: YearCalendarButtonProps) => React.JSX.Element>;
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -18,7 +18,7 @@ export declare const PickerFieldUIContext: React.Context<PickerFieldUIContextVal
|
|
|
18
18
|
* Adds the button to open the Picker and the button to clear the value of the field.
|
|
19
19
|
* @ignore - internal component.
|
|
20
20
|
*/
|
|
21
|
-
export declare function PickerFieldUI<TProps extends UseFieldProps>(props: PickerFieldUIProps<TProps>):
|
|
21
|
+
export declare function PickerFieldUI<TProps extends UseFieldProps>(props: PickerFieldUIProps<TProps>): React.JSX.Element;
|
|
22
22
|
export interface ExportedPickerFieldUIProps {
|
|
23
23
|
/**
|
|
24
24
|
* If `true`, a clear button will be shown in the field allowing value clearing.
|
|
@@ -116,7 +116,7 @@ interface UseFieldTextFieldPropsParameters {
|
|
|
116
116
|
ref: React.Ref<HTMLDivElement>;
|
|
117
117
|
externalForwardedProps: any;
|
|
118
118
|
}
|
|
119
|
-
export declare function PickerFieldUIContextProvider(props: PickerFieldUIContextProviderProps):
|
|
119
|
+
export declare function PickerFieldUIContextProvider(props: PickerFieldUIContextProviderProps): React.JSX.Element;
|
|
120
120
|
interface PickerFieldUIContextProviderProps {
|
|
121
121
|
children: React.ReactNode;
|
|
122
122
|
inputRef: React.Ref<HTMLInputElement> | undefined;
|
|
@@ -18,7 +18,7 @@ export declare const PickerFieldUIContext: React.Context<PickerFieldUIContextVal
|
|
|
18
18
|
* Adds the button to open the Picker and the button to clear the value of the field.
|
|
19
19
|
* @ignore - internal component.
|
|
20
20
|
*/
|
|
21
|
-
export declare function PickerFieldUI<TProps extends UseFieldProps>(props: PickerFieldUIProps<TProps>):
|
|
21
|
+
export declare function PickerFieldUI<TProps extends UseFieldProps>(props: PickerFieldUIProps<TProps>): React.JSX.Element;
|
|
22
22
|
export interface ExportedPickerFieldUIProps {
|
|
23
23
|
/**
|
|
24
24
|
* If `true`, a clear button will be shown in the field allowing value clearing.
|
|
@@ -116,7 +116,7 @@ interface UseFieldTextFieldPropsParameters {
|
|
|
116
116
|
ref: React.Ref<HTMLDivElement>;
|
|
117
117
|
externalForwardedProps: any;
|
|
118
118
|
}
|
|
119
|
-
export declare function PickerFieldUIContextProvider(props: PickerFieldUIContextProviderProps):
|
|
119
|
+
export declare function PickerFieldUIContextProvider(props: PickerFieldUIContextProviderProps): React.JSX.Element;
|
|
120
120
|
interface PickerFieldUIContextProviderProps {
|
|
121
121
|
children: React.ReactNode;
|
|
122
122
|
inputRef: React.Ref<HTMLInputElement> | undefined;
|
|
@@ -64,4 +64,4 @@ export interface PickerPopperProps extends ExportedPickerPopperProps {
|
|
|
64
64
|
slots?: PickerPopperSlots;
|
|
65
65
|
slotProps?: PickerPopperSlotProps;
|
|
66
66
|
}
|
|
67
|
-
export declare function PickerPopper(inProps: PickerPopperProps):
|
|
67
|
+
export declare function PickerPopper(inProps: PickerPopperProps): React.JSX.Element;
|
|
@@ -64,4 +64,4 @@ export interface PickerPopperProps extends ExportedPickerPopperProps {
|
|
|
64
64
|
slots?: PickerPopperSlots;
|
|
65
65
|
slotProps?: PickerPopperSlotProps;
|
|
66
66
|
}
|
|
67
|
-
export declare function PickerPopper(inProps: PickerPopperProps):
|
|
67
|
+
export declare function PickerPopper(inProps: PickerPopperProps): React.JSX.Element;
|
|
@@ -79,7 +79,7 @@ function useClickAwayListener(active, onClickAway) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// Ensure that this hook is not "activated" synchronously.
|
|
82
|
-
// https://github.com/
|
|
82
|
+
// https://github.com/react/react/issues/20074
|
|
83
83
|
function armClickAwayListener() {
|
|
84
84
|
activatedRef.current = true;
|
|
85
85
|
}
|
|
@@ -72,7 +72,7 @@ function useClickAwayListener(active, onClickAway) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// Ensure that this hook is not "activated" synchronously.
|
|
75
|
-
// https://github.com/
|
|
75
|
+
// https://github.com/react/react/issues/20074
|
|
76
76
|
function armClickAwayListener() {
|
|
77
77
|
activatedRef.current = true;
|
|
78
78
|
}
|
|
@@ -16,7 +16,7 @@ export declare const PickerPrivateContext: React.Context<PickerPrivateContextVal
|
|
|
16
16
|
*
|
|
17
17
|
* @ignore - do not document.
|
|
18
18
|
*/
|
|
19
|
-
export declare function PickerProvider<TValue extends PickerValidValue>(props: PickerProviderProps<TValue>):
|
|
19
|
+
export declare function PickerProvider<TValue extends PickerValidValue>(props: PickerProviderProps<TValue>): React.JSX.Element;
|
|
20
20
|
export interface PickerProviderProps<TValue extends PickerValidValue> {
|
|
21
21
|
contextValue: PickerContextValue<any, any, any>;
|
|
22
22
|
actionsContextValue: PickerActionsContextValue<any, any, any>;
|
|
@@ -16,7 +16,7 @@ export declare const PickerPrivateContext: React.Context<PickerPrivateContextVal
|
|
|
16
16
|
*
|
|
17
17
|
* @ignore - do not document.
|
|
18
18
|
*/
|
|
19
|
-
export declare function PickerProvider<TValue extends PickerValidValue>(props: PickerProviderProps<TValue>):
|
|
19
|
+
export declare function PickerProvider<TValue extends PickerValidValue>(props: PickerProviderProps<TValue>): React.JSX.Element;
|
|
20
20
|
export interface PickerProviderProps<TValue extends PickerValidValue> {
|
|
21
21
|
contextValue: PickerContextValue<any, any, any>;
|
|
22
22
|
actionsContextValue: PickerActionsContextValue<any, any, any>;
|
|
@@ -45,4 +45,4 @@ export interface PickersModalDialogProps {
|
|
|
45
45
|
*/
|
|
46
46
|
slotProps?: PickersModalDialogSlotProps;
|
|
47
47
|
}
|
|
48
|
-
export declare function PickersModalDialog(props: React.PropsWithChildren<PickersModalDialogProps>):
|
|
48
|
+
export declare function PickersModalDialog(props: React.PropsWithChildren<PickersModalDialogProps>): React.JSX.Element;
|
|
@@ -45,4 +45,4 @@ export interface PickersModalDialogProps {
|
|
|
45
45
|
*/
|
|
46
46
|
slotProps?: PickersModalDialogSlotProps;
|
|
47
47
|
}
|
|
48
|
-
export declare function PickersModalDialog(props: React.PropsWithChildren<PickersModalDialogProps>):
|
|
48
|
+
export declare function PickersModalDialog(props: React.PropsWithChildren<PickersModalDialogProps>): React.JSX.Element;
|
|
@@ -14,7 +14,7 @@ interface DemoItemProps extends Omit<StackProps, 'component'> {
|
|
|
14
14
|
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
15
15
|
* Please do not use it in your application.
|
|
16
16
|
*/
|
|
17
|
-
export declare function DemoItem(props: DemoItemProps):
|
|
17
|
+
export declare function DemoItem(props: DemoItemProps): React.JSX.Element;
|
|
18
18
|
export declare namespace DemoItem {
|
|
19
19
|
var displayName: string;
|
|
20
20
|
}
|
|
@@ -22,5 +22,5 @@ export declare namespace DemoItem {
|
|
|
22
22
|
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
23
23
|
* Please do not use it in your application.
|
|
24
24
|
*/
|
|
25
|
-
export declare function DemoContainer(props: DemoGridProps):
|
|
25
|
+
export declare function DemoContainer(props: DemoGridProps): React.JSX.Element;
|
|
26
26
|
export {};
|
|
@@ -14,7 +14,7 @@ interface DemoItemProps extends Omit<StackProps, 'component'> {
|
|
|
14
14
|
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
15
15
|
* Please do not use it in your application.
|
|
16
16
|
*/
|
|
17
|
-
export declare function DemoItem(props: DemoItemProps):
|
|
17
|
+
export declare function DemoItem(props: DemoItemProps): React.JSX.Element;
|
|
18
18
|
export declare namespace DemoItem {
|
|
19
19
|
var displayName: string;
|
|
20
20
|
}
|
|
@@ -22,5 +22,5 @@ export declare namespace DemoItem {
|
|
|
22
22
|
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
23
23
|
* Please do not use it in your application.
|
|
24
24
|
*/
|
|
25
|
-
export declare function DemoContainer(props: DemoGridProps):
|
|
25
|
+
export declare function DemoContainer(props: DemoGridProps): React.JSX.Element;
|
|
26
26
|
export {};
|
|
@@ -11,5 +11,5 @@ export declare const useDesktopPicker: <TView extends DateOrTimeViewWithMeridiem
|
|
|
11
11
|
steps,
|
|
12
12
|
...pickerParams
|
|
13
13
|
}: UseDesktopPickerParams<TView, TExternalProps>) => {
|
|
14
|
-
renderPicker: () => import("react
|
|
14
|
+
renderPicker: () => import("react").JSX.Element;
|
|
15
15
|
};
|
|
@@ -11,5 +11,5 @@ export declare const useDesktopPicker: <TView extends DateOrTimeViewWithMeridiem
|
|
|
11
11
|
steps,
|
|
12
12
|
...pickerParams
|
|
13
13
|
}: UseDesktopPickerParams<TView, TExternalProps>) => {
|
|
14
|
-
renderPicker: () => import("react
|
|
14
|
+
renderPicker: () => import("react").JSX.Element;
|
|
15
15
|
};
|
|
@@ -6,7 +6,6 @@ export declare const getDateSectionConfigFromFormatToken: (adapter: MuiPickersAd
|
|
|
6
6
|
};
|
|
7
7
|
export declare const getDaysInWeekStr: (adapter: MuiPickersAdapter, format: string) => string[];
|
|
8
8
|
export declare const getLetterEditingOptions: (adapter: MuiPickersAdapter, timezone: PickersTimezone, sectionType: FieldSectionType, format: string) => string[];
|
|
9
|
-
export declare const FORMAT_SECONDS_NO_LEADING_ZEROS = "s";
|
|
10
9
|
export declare const getLocalizedDigits: (adapter: MuiPickersAdapter) => string[];
|
|
11
10
|
export declare const removeLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
12
11
|
export declare const applyLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
@@ -6,7 +6,6 @@ export declare const getDateSectionConfigFromFormatToken: (adapter: MuiPickersAd
|
|
|
6
6
|
};
|
|
7
7
|
export declare const getDaysInWeekStr: (adapter: MuiPickersAdapter, format: string) => string[];
|
|
8
8
|
export declare const getLetterEditingOptions: (adapter: MuiPickersAdapter, timezone: PickersTimezone, sectionType: FieldSectionType, format: string) => string[];
|
|
9
|
-
export declare const FORMAT_SECONDS_NO_LEADING_ZEROS = "s";
|
|
10
9
|
export declare const getLocalizedDigits: (adapter: MuiPickersAdapter) => string[];
|
|
11
10
|
export declare const removeLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
12
11
|
export declare const applyLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.validateSections = exports.removeLocalizedDigits = exports.parseSelectedSections = exports.mergeDateIntoReferenceDate = exports.isStringNumber = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLocalizedDigits = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForHiddenInputFromSections = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.applyLocalizedDigits =
|
|
7
|
+
exports.validateSections = exports.removeLocalizedDigits = exports.parseSelectedSections = exports.mergeDateIntoReferenceDate = exports.isStringNumber = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLocalizedDigits = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForHiddenInputFromSections = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.applyLocalizedDigits = void 0;
|
|
8
8
|
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
|
|
9
9
|
var _dateUtils = require("../../utils/date-utils");
|
|
10
10
|
var _timeUtils = require("../../utils/time-utils");
|
|
@@ -66,7 +66,7 @@ const getLetterEditingOptions = (adapter, timezone, sectionType, format) => {
|
|
|
66
66
|
// This format should be the same on all the adapters
|
|
67
67
|
// If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.
|
|
68
68
|
exports.getLetterEditingOptions = getLetterEditingOptions;
|
|
69
|
-
const FORMAT_SECONDS_NO_LEADING_ZEROS =
|
|
69
|
+
const FORMAT_SECONDS_NO_LEADING_ZEROS = 's';
|
|
70
70
|
const NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
71
71
|
const getLocalizedDigits = adapter => {
|
|
72
72
|
const today = adapter.date(undefined);
|
|
@@ -56,7 +56,7 @@ export const getLetterEditingOptions = (adapter, timezone, sectionType, format)
|
|
|
56
56
|
|
|
57
57
|
// This format should be the same on all the adapters
|
|
58
58
|
// If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.
|
|
59
|
-
|
|
59
|
+
const FORMAT_SECONDS_NO_LEADING_ZEROS = 's';
|
|
60
60
|
const NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
61
61
|
export const getLocalizedDigits = adapter => {
|
|
62
62
|
const today = adapter.date(undefined);
|
|
@@ -10,6 +10,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
11
11
|
var _hooks = require("../../../hooks");
|
|
12
12
|
var _syncSelectionToDOM = require("./syncSelectionToDOM");
|
|
13
|
+
var _useField = require("./useField.utils");
|
|
13
14
|
/**
|
|
14
15
|
* Generate the props to pass to the content element of each section of the field.
|
|
15
16
|
* @param {UseFieldSectionContentPropsParameters} parameters The parameters of the hook.
|
|
@@ -32,6 +33,7 @@ function useFieldSectionContentProps(parameters) {
|
|
|
32
33
|
sectionsValueBoundaries,
|
|
33
34
|
state,
|
|
34
35
|
value,
|
|
36
|
+
localizedDigits,
|
|
35
37
|
// Methods to update the states
|
|
36
38
|
clearActiveSection,
|
|
37
39
|
setCharacterQuery,
|
|
@@ -152,10 +154,10 @@ function useFieldSectionContentProps(parameters) {
|
|
|
152
154
|
onFocus: createFocusHandler(sectionIndex),
|
|
153
155
|
// Aria attributes
|
|
154
156
|
'aria-readonly': readOnly,
|
|
155
|
-
'aria-valuenow': getSectionValueNow(section, adapter),
|
|
157
|
+
'aria-valuenow': getSectionValueNow(section, adapter, localizedDigits),
|
|
156
158
|
'aria-valuemin': sectionBoundaries.minimum,
|
|
157
159
|
'aria-valuemax': sectionBoundaries.maximum,
|
|
158
|
-
'aria-valuetext': section.value ? getSectionValueText(section, adapter) : translations.empty,
|
|
160
|
+
'aria-valuetext': section.value ? getSectionValueText(section, adapter, localizedDigits) : translations.empty,
|
|
159
161
|
'aria-label': translations[section.type],
|
|
160
162
|
'aria-disabled': disabled,
|
|
161
163
|
// Other
|
|
@@ -171,9 +173,9 @@ function useFieldSectionContentProps(parameters) {
|
|
|
171
173
|
children: section.value || section.placeholder,
|
|
172
174
|
inputMode: section.contentType === 'letter' ? 'text' : 'numeric'
|
|
173
175
|
};
|
|
174
|
-
}, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
|
|
176
|
+
}, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, localizedDigits, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
|
|
175
177
|
}
|
|
176
|
-
function getSectionValueText(section, adapter) {
|
|
178
|
+
function getSectionValueText(section, adapter, localizedDigits) {
|
|
177
179
|
if (!section.value) {
|
|
178
180
|
return undefined;
|
|
179
181
|
}
|
|
@@ -181,7 +183,7 @@ function getSectionValueText(section, adapter) {
|
|
|
181
183
|
case 'month':
|
|
182
184
|
{
|
|
183
185
|
if (section.contentType === 'digit') {
|
|
184
|
-
const dateWithMonth = adapter.setMonth(adapter.date(), Number(section.value) - 1);
|
|
186
|
+
const dateWithMonth = adapter.setMonth(adapter.date(), Number((0, _useField.removeLocalizedDigits)(section.value, localizedDigits)) - 1);
|
|
185
187
|
return adapter.isValid(dateWithMonth) ? adapter.format(dateWithMonth, 'month') : '';
|
|
186
188
|
}
|
|
187
189
|
const parsedDate = adapter.parse(section.value, section.format);
|
|
@@ -189,7 +191,7 @@ function getSectionValueText(section, adapter) {
|
|
|
189
191
|
}
|
|
190
192
|
case 'day':
|
|
191
193
|
if (section.contentType === 'digit') {
|
|
192
|
-
const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number(section.value));
|
|
194
|
+
const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number((0, _useField.removeLocalizedDigits)(section.value, localizedDigits)));
|
|
193
195
|
// Announce a cardinal day (e.g. "2"), not a locale ordinal (e.g. French "2ème").
|
|
194
196
|
// See https://github.com/mui/mui-x/issues/22915.
|
|
195
197
|
return adapter.isValid(dateWithDay) ? adapter.format(dateWithDay, 'dayOfMonth') : '';
|
|
@@ -202,10 +204,11 @@ function getSectionValueText(section, adapter) {
|
|
|
202
204
|
return undefined;
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
|
-
function getSectionValueNow(section, adapter) {
|
|
207
|
+
function getSectionValueNow(section, adapter, localizedDigits) {
|
|
206
208
|
if (!section.value) {
|
|
207
209
|
return undefined;
|
|
208
210
|
}
|
|
211
|
+
const nonLocalizedValue = (0, _useField.removeLocalizedDigits)(section.value, localizedDigits);
|
|
209
212
|
switch (section.type) {
|
|
210
213
|
case 'weekDay':
|
|
211
214
|
{
|
|
@@ -213,7 +216,7 @@ function getSectionValueNow(section, adapter) {
|
|
|
213
216
|
// TODO: improve by resolving the week day number from a letter week day
|
|
214
217
|
return undefined;
|
|
215
218
|
}
|
|
216
|
-
return Number(
|
|
219
|
+
return Number(nonLocalizedValue);
|
|
217
220
|
}
|
|
218
221
|
case 'meridiem':
|
|
219
222
|
{
|
|
@@ -224,16 +227,16 @@ function getSectionValueNow(section, adapter) {
|
|
|
224
227
|
return undefined;
|
|
225
228
|
}
|
|
226
229
|
case 'day':
|
|
227
|
-
return section.contentType === 'digit-with-letter' ? parseInt(
|
|
230
|
+
return section.contentType === 'digit-with-letter' ? parseInt(nonLocalizedValue, 10) : Number(nonLocalizedValue);
|
|
228
231
|
case 'month':
|
|
229
232
|
{
|
|
230
233
|
if (section.contentType === 'digit') {
|
|
231
|
-
return Number(
|
|
234
|
+
return Number(nonLocalizedValue);
|
|
232
235
|
}
|
|
233
236
|
const parsedDate = adapter.parse(section.value, section.format);
|
|
234
237
|
return parsedDate ? adapter.getMonth(parsedDate) + 1 : undefined;
|
|
235
238
|
}
|
|
236
239
|
default:
|
|
237
|
-
return section.contentType !== 'letter' ? Number(
|
|
240
|
+
return section.contentType !== 'letter' ? Number(nonLocalizedValue) : undefined;
|
|
238
241
|
}
|
|
239
242
|
}
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
3
3
|
import { usePickerAdapter, usePickerTranslations } from "../../../hooks/index.mjs";
|
|
4
4
|
import { syncSelectionToDOM } from "./syncSelectionToDOM.mjs";
|
|
5
|
+
import { removeLocalizedDigits } from "./useField.utils.mjs";
|
|
5
6
|
/**
|
|
6
7
|
* Generate the props to pass to the content element of each section of the field.
|
|
7
8
|
* @param {UseFieldSectionContentPropsParameters} parameters The parameters of the hook.
|
|
@@ -24,6 +25,7 @@ export function useFieldSectionContentProps(parameters) {
|
|
|
24
25
|
sectionsValueBoundaries,
|
|
25
26
|
state,
|
|
26
27
|
value,
|
|
28
|
+
localizedDigits,
|
|
27
29
|
// Methods to update the states
|
|
28
30
|
clearActiveSection,
|
|
29
31
|
setCharacterQuery,
|
|
@@ -144,10 +146,10 @@ export function useFieldSectionContentProps(parameters) {
|
|
|
144
146
|
onFocus: createFocusHandler(sectionIndex),
|
|
145
147
|
// Aria attributes
|
|
146
148
|
'aria-readonly': readOnly,
|
|
147
|
-
'aria-valuenow': getSectionValueNow(section, adapter),
|
|
149
|
+
'aria-valuenow': getSectionValueNow(section, adapter, localizedDigits),
|
|
148
150
|
'aria-valuemin': sectionBoundaries.minimum,
|
|
149
151
|
'aria-valuemax': sectionBoundaries.maximum,
|
|
150
|
-
'aria-valuetext': section.value ? getSectionValueText(section, adapter) : translations.empty,
|
|
152
|
+
'aria-valuetext': section.value ? getSectionValueText(section, adapter, localizedDigits) : translations.empty,
|
|
151
153
|
'aria-label': translations[section.type],
|
|
152
154
|
'aria-disabled': disabled,
|
|
153
155
|
// Other
|
|
@@ -163,9 +165,9 @@ export function useFieldSectionContentProps(parameters) {
|
|
|
163
165
|
children: section.value || section.placeholder,
|
|
164
166
|
inputMode: section.contentType === 'letter' ? 'text' : 'numeric'
|
|
165
167
|
};
|
|
166
|
-
}, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
|
|
168
|
+
}, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, localizedDigits, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
|
|
167
169
|
}
|
|
168
|
-
function getSectionValueText(section, adapter) {
|
|
170
|
+
function getSectionValueText(section, adapter, localizedDigits) {
|
|
169
171
|
if (!section.value) {
|
|
170
172
|
return undefined;
|
|
171
173
|
}
|
|
@@ -173,7 +175,7 @@ function getSectionValueText(section, adapter) {
|
|
|
173
175
|
case 'month':
|
|
174
176
|
{
|
|
175
177
|
if (section.contentType === 'digit') {
|
|
176
|
-
const dateWithMonth = adapter.setMonth(adapter.date(), Number(section.value) - 1);
|
|
178
|
+
const dateWithMonth = adapter.setMonth(adapter.date(), Number(removeLocalizedDigits(section.value, localizedDigits)) - 1);
|
|
177
179
|
return adapter.isValid(dateWithMonth) ? adapter.format(dateWithMonth, 'month') : '';
|
|
178
180
|
}
|
|
179
181
|
const parsedDate = adapter.parse(section.value, section.format);
|
|
@@ -181,7 +183,7 @@ function getSectionValueText(section, adapter) {
|
|
|
181
183
|
}
|
|
182
184
|
case 'day':
|
|
183
185
|
if (section.contentType === 'digit') {
|
|
184
|
-
const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number(section.value));
|
|
186
|
+
const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number(removeLocalizedDigits(section.value, localizedDigits)));
|
|
185
187
|
// Announce a cardinal day (e.g. "2"), not a locale ordinal (e.g. French "2ème").
|
|
186
188
|
// See https://github.com/mui/mui-x/issues/22915.
|
|
187
189
|
return adapter.isValid(dateWithDay) ? adapter.format(dateWithDay, 'dayOfMonth') : '';
|
|
@@ -194,10 +196,11 @@ function getSectionValueText(section, adapter) {
|
|
|
194
196
|
return undefined;
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
|
-
function getSectionValueNow(section, adapter) {
|
|
199
|
+
function getSectionValueNow(section, adapter, localizedDigits) {
|
|
198
200
|
if (!section.value) {
|
|
199
201
|
return undefined;
|
|
200
202
|
}
|
|
203
|
+
const nonLocalizedValue = removeLocalizedDigits(section.value, localizedDigits);
|
|
201
204
|
switch (section.type) {
|
|
202
205
|
case 'weekDay':
|
|
203
206
|
{
|
|
@@ -205,7 +208,7 @@ function getSectionValueNow(section, adapter) {
|
|
|
205
208
|
// TODO: improve by resolving the week day number from a letter week day
|
|
206
209
|
return undefined;
|
|
207
210
|
}
|
|
208
|
-
return Number(
|
|
211
|
+
return Number(nonLocalizedValue);
|
|
209
212
|
}
|
|
210
213
|
case 'meridiem':
|
|
211
214
|
{
|
|
@@ -216,16 +219,16 @@ function getSectionValueNow(section, adapter) {
|
|
|
216
219
|
return undefined;
|
|
217
220
|
}
|
|
218
221
|
case 'day':
|
|
219
|
-
return section.contentType === 'digit-with-letter' ? parseInt(
|
|
222
|
+
return section.contentType === 'digit-with-letter' ? parseInt(nonLocalizedValue, 10) : Number(nonLocalizedValue);
|
|
220
223
|
case 'month':
|
|
221
224
|
{
|
|
222
225
|
if (section.contentType === 'digit') {
|
|
223
|
-
return Number(
|
|
226
|
+
return Number(nonLocalizedValue);
|
|
224
227
|
}
|
|
225
228
|
const parsedDate = adapter.parse(section.value, section.format);
|
|
226
229
|
return parsedDate ? adapter.getMonth(parsedDate) + 1 : undefined;
|
|
227
230
|
}
|
|
228
231
|
default:
|
|
229
|
-
return section.contentType !== 'letter' ? Number(
|
|
232
|
+
return section.contentType !== 'letter' ? Number(nonLocalizedValue) : undefined;
|
|
230
233
|
}
|
|
231
234
|
}
|
|
@@ -11,5 +11,5 @@ export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem,
|
|
|
11
11
|
steps,
|
|
12
12
|
...pickerParams
|
|
13
13
|
}: UseMobilePickerParams<TView, TExternalProps>) => {
|
|
14
|
-
renderPicker: () => import("react
|
|
14
|
+
renderPicker: () => import("react").JSX.Element;
|
|
15
15
|
};
|
|
@@ -11,5 +11,5 @@ export declare const useMobilePicker: <TView extends DateOrTimeViewWithMeridiem,
|
|
|
11
11
|
steps,
|
|
12
12
|
...pickerParams
|
|
13
13
|
}: UseMobilePickerParams<TView, TExternalProps>) => {
|
|
14
|
-
renderPicker: () => import("react
|
|
14
|
+
renderPicker: () => import("react").JSX.Element;
|
|
15
15
|
};
|
|
@@ -11,5 +11,5 @@ export declare const useStaticPicker: <TView extends DateOrTimeViewWithMeridiem,
|
|
|
11
11
|
steps,
|
|
12
12
|
...pickerParams
|
|
13
13
|
}: UseStaticPickerParams<TView, TExternalProps>) => {
|
|
14
|
-
renderPicker: () => import("react
|
|
14
|
+
renderPicker: () => import("react").JSX.Element;
|
|
15
15
|
};
|
|
@@ -11,5 +11,5 @@ export declare const useStaticPicker: <TView extends DateOrTimeViewWithMeridiem,
|
|
|
11
11
|
steps,
|
|
12
12
|
...pickerParams
|
|
13
13
|
}: UseStaticPickerParams<TView, TExternalProps>) => {
|
|
14
|
-
renderPicker: () => import("react
|
|
14
|
+
renderPicker: () => import("react").JSX.Element;
|
|
15
15
|
};
|
package/locales/roRO.js
CHANGED
|
@@ -38,8 +38,7 @@ const roROPickers = {
|
|
|
38
38
|
dateTimePickerToolbarTitle: 'Selectați data și ora',
|
|
39
39
|
timePickerToolbarTitle: 'Selectați ora',
|
|
40
40
|
dateRangePickerToolbarTitle: 'Selectați intervalul de date',
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
timeRangePickerToolbarTitle: 'Selectați intervalul de timp',
|
|
43
42
|
// Clock labels
|
|
44
43
|
clockLabelText: (view, formattedTime) => `Selectați ${timeViews[view] ?? view}. ${!formattedTime ? 'Nicio oră selectată' : `Ora selectată este ${formattedTime}`}`,
|
|
45
44
|
hoursClockNumberText: hours => `${hours} ${timeViews.hours}`,
|
|
@@ -55,7 +54,7 @@ const roROPickers = {
|
|
|
55
54
|
// Open Picker labels
|
|
56
55
|
openDatePickerDialogue: formattedDate => formattedDate ? `Selectați data, data selectată este ${formattedDate}` : 'Selectați data',
|
|
57
56
|
openTimePickerDialogue: formattedTime => formattedTime ? `Selectați ora, ora selectată este ${formattedTime}` : 'Selectați ora',
|
|
58
|
-
|
|
57
|
+
openRangePickerDialogue: formattedRange => formattedRange ? `Selectați intervalul, intervalul selectat este ${formattedRange}` : 'Selectați intervalul',
|
|
59
58
|
fieldClearLabel: 'Golire conținut',
|
|
60
59
|
// Table labels
|
|
61
60
|
timeTableLabel: 'Selectați ora',
|
package/locales/roRO.mjs
CHANGED
|
@@ -32,8 +32,7 @@ const roROPickers = {
|
|
|
32
32
|
dateTimePickerToolbarTitle: 'Selectați data și ora',
|
|
33
33
|
timePickerToolbarTitle: 'Selectați ora',
|
|
34
34
|
dateRangePickerToolbarTitle: 'Selectați intervalul de date',
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
timeRangePickerToolbarTitle: 'Selectați intervalul de timp',
|
|
37
36
|
// Clock labels
|
|
38
37
|
clockLabelText: (view, formattedTime) => `Selectați ${timeViews[view] ?? view}. ${!formattedTime ? 'Nicio oră selectată' : `Ora selectată este ${formattedTime}`}`,
|
|
39
38
|
hoursClockNumberText: hours => `${hours} ${timeViews.hours}`,
|
|
@@ -49,7 +48,7 @@ const roROPickers = {
|
|
|
49
48
|
// Open Picker labels
|
|
50
49
|
openDatePickerDialogue: formattedDate => formattedDate ? `Selectați data, data selectată este ${formattedDate}` : 'Selectați data',
|
|
51
50
|
openTimePickerDialogue: formattedTime => formattedTime ? `Selectați ora, ora selectată este ${formattedTime}` : 'Selectați ora',
|
|
52
|
-
|
|
51
|
+
openRangePickerDialogue: formattedRange => formattedRange ? `Selectați intervalul, intervalul selectat este ${formattedRange}` : 'Selectați intervalul',
|
|
53
52
|
fieldClearLabel: 'Golire conținut',
|
|
54
53
|
// Table labels
|
|
55
54
|
timeTableLabel: 'Selectați ora',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of the MUI X Date and Time Picker components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.29.7",
|
|
37
|
-
"@mui/utils": "^9.
|
|
37
|
+
"@mui/utils": "^9.2.0",
|
|
38
38
|
"@types/react-transition-group": "^4.4.12",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"react-transition-group": "^4.4.5",
|
|
42
|
-
"@mui/x-internals": "^9.
|
|
42
|
+
"@mui/x-internals": "^9.9.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@emotion/react": "^11.9.0",
|
|
@@ -39,7 +39,7 @@ export declare const renderTimeViewClock: ({
|
|
|
39
39
|
showViewSwitcher,
|
|
40
40
|
disableIgnoringDatePartForTimeValidation,
|
|
41
41
|
timezone
|
|
42
|
-
}: TimeViewRendererProps<TimeView, TimeClockProps<TimeView>>) => import("react
|
|
42
|
+
}: TimeViewRendererProps<TimeView, TimeClockProps<TimeView>>) => import("react").JSX.Element;
|
|
43
43
|
export declare const renderDigitalClockTimeView: ({
|
|
44
44
|
view,
|
|
45
45
|
onViewChange,
|
|
@@ -69,7 +69,7 @@ export declare const renderDigitalClockTimeView: ({
|
|
|
69
69
|
timeSteps,
|
|
70
70
|
skipDisabled,
|
|
71
71
|
timezone
|
|
72
|
-
}: TimeViewRendererProps<Extract<TimeView, "hours">, Omit<DigitalClockProps, "timeStep"> & Pick<TimePickerProps, "timeSteps">>) => import("react
|
|
72
|
+
}: TimeViewRendererProps<Extract<TimeView, "hours">, Omit<DigitalClockProps, "timeStep"> & Pick<TimePickerProps, "timeSteps">>) => import("react").JSX.Element;
|
|
73
73
|
export declare const renderMultiSectionDigitalClockTimeView: ({
|
|
74
74
|
view,
|
|
75
75
|
onViewChange,
|
|
@@ -99,4 +99,4 @@ export declare const renderMultiSectionDigitalClockTimeView: ({
|
|
|
99
99
|
timeSteps,
|
|
100
100
|
skipDisabled,
|
|
101
101
|
timezone
|
|
102
|
-
}: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps>) => import("react
|
|
102
|
+
}: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps>) => import("react").JSX.Element;
|
|
@@ -39,7 +39,7 @@ export declare const renderTimeViewClock: ({
|
|
|
39
39
|
showViewSwitcher,
|
|
40
40
|
disableIgnoringDatePartForTimeValidation,
|
|
41
41
|
timezone
|
|
42
|
-
}: TimeViewRendererProps<TimeView, TimeClockProps<TimeView>>) => import("react
|
|
42
|
+
}: TimeViewRendererProps<TimeView, TimeClockProps<TimeView>>) => import("react").JSX.Element;
|
|
43
43
|
export declare const renderDigitalClockTimeView: ({
|
|
44
44
|
view,
|
|
45
45
|
onViewChange,
|
|
@@ -69,7 +69,7 @@ export declare const renderDigitalClockTimeView: ({
|
|
|
69
69
|
timeSteps,
|
|
70
70
|
skipDisabled,
|
|
71
71
|
timezone
|
|
72
|
-
}: TimeViewRendererProps<Extract<TimeView, "hours">, Omit<DigitalClockProps, "timeStep"> & Pick<TimePickerProps, "timeSteps">>) => import("react
|
|
72
|
+
}: TimeViewRendererProps<Extract<TimeView, "hours">, Omit<DigitalClockProps, "timeStep"> & Pick<TimePickerProps, "timeSteps">>) => import("react").JSX.Element;
|
|
73
73
|
export declare const renderMultiSectionDigitalClockTimeView: ({
|
|
74
74
|
view,
|
|
75
75
|
onViewChange,
|
|
@@ -99,4 +99,4 @@ export declare const renderMultiSectionDigitalClockTimeView: ({
|
|
|
99
99
|
timeSteps,
|
|
100
100
|
skipDisabled,
|
|
101
101
|
timezone
|
|
102
|
-
}: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps>) => import("react
|
|
102
|
+
}: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps>) => import("react").JSX.Element;
|