@mui/x-date-pickers 6.0.3 → 6.1.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/AdapterDateFns/index.d.ts +1 -1
- package/AdapterDateFnsJalali/index.d.ts +1 -1
- package/AdapterDateFnsJalali/index.js +68 -0
- package/AdapterDayjs/index.d.ts +2 -3
- package/AdapterLuxon/index.d.ts +2 -2
- package/AdapterLuxon/index.js +12 -3
- package/AdapterMoment/index.d.ts +1 -1
- package/AdapterMomentHijri/index.d.ts +1 -1
- package/AdapterMomentJalaali/index.d.ts +1 -1
- package/CHANGELOG.md +119 -0
- package/DateCalendar/DateCalendar.js +0 -2
- package/DateCalendar/DateCalendar.types.d.ts +1 -1
- package/DateCalendar/PickersCalendarHeader.d.ts +1 -13
- package/DateCalendar/PickersCalendarHeader.js +7 -9
- package/DateCalendar/PickersSlideTransition.js +1 -0
- package/DateCalendar/index.d.ts +0 -1
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DateField/DateField.js +8 -2
- package/DateField/DateField.types.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.d.ts +1 -1
- package/DatePicker/shared.d.ts +2 -2
- package/DateTimeField/DateTimeField.js +8 -2
- package/DateTimeField/DateTimeField.types.d.ts +2 -2
- package/DateTimePicker/DateTimePickerTabs.d.ts +1 -1
- package/DateTimePicker/DateTimePickerToolbar.d.ts +1 -1
- package/DateTimePicker/shared.d.ts +1 -2
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +1 -1
- package/LocalizationProvider/LocalizationProvider.d.ts +2 -3
- package/MobileDatePicker/MobileDatePicker.types.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.types.d.ts +1 -1
- package/MonthCalendar/PickersMonth.js +1 -0
- package/PickersLayout/PickersLayout.d.ts +1 -1
- package/PickersLayout/PickersLayout.types.d.ts +1 -1
- package/PickersLayout/index.d.ts +1 -1
- package/PickersLayout/usePickerLayout.d.ts +1 -1
- package/README.md +3 -3
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -1
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -1
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -1
- package/TimeClock/Clock.d.ts +1 -1
- package/TimeClock/ClockNumbers.d.ts +1 -1
- package/TimeClock/ClockPointer.d.ts +1 -1
- package/TimeClock/TimeClock.js +5 -4
- package/TimeClock/TimeClock.types.d.ts +1 -1
- package/TimeClock/index.d.ts +0 -1
- package/TimeField/TimeField.js +8 -2
- package/TimeField/TimeField.types.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.d.ts +1 -1
- package/TimePicker/shared.d.ts +1 -2
- package/YearCalendar/PickersYear.js +1 -0
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -12
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +0 -12
- package/internals/components/PickersModalDialog.d.ts +0 -12
- package/internals/components/PickersModalDialog.js +7 -9
- package/internals/components/PickersPopper.d.ts +0 -2
- package/internals/components/PickersPopper.js +2 -7
- package/internals/components/PickersToolbar.d.ts +1 -1
- package/internals/demo/DemoContainer.js +15 -7
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +3 -5
- package/internals/hooks/useField/index.d.ts +1 -1
- package/internals/hooks/useField/useField.d.ts +2 -1
- package/internals/hooks/useField/useField.js +11 -9
- package/internals/hooks/useField/useField.types.d.ts +25 -113
- package/internals/hooks/useField/useField.utils.d.ts +7 -6
- package/internals/hooks/useField/useField.utils.js +71 -51
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -1
- package/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/internals/hooks/useField/useFieldState.d.ts +3 -1
- package/internals/hooks/useField/useFieldState.js +88 -62
- package/internals/hooks/useIsLandscape.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +3 -5
- package/internals/hooks/usePicker/usePicker.d.ts +1 -2
- package/internals/hooks/usePicker/usePicker.types.d.ts +1 -2
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/internals/hooks/usePicker/usePickerValue.d.ts +9 -2
- package/internals/hooks/usePicker/usePickerValue.js +23 -2
- package/internals/hooks/usePicker/usePickerViews.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -2
- package/internals/hooks/useUtils.d.ts +1 -1
- package/internals/hooks/useViews.d.ts +1 -1
- package/internals/hooks/useViews.js +8 -0
- package/internals/hooks/validation/models.d.ts +1 -1
- package/internals/hooks/validation/useDateTimeValidation.d.ts +3 -3
- package/internals/hooks/validation/useDateValidation.d.ts +2 -2
- package/internals/hooks/validation/useTimeValidation.d.ts +2 -2
- package/internals/index.d.ts +3 -8
- package/internals/index.js +1 -1
- package/internals/models/fields.d.ts +2 -20
- package/internals/models/index.d.ts +0 -2
- package/internals/models/index.js +1 -3
- package/internals/models/props/basePickerProps.d.ts +3 -3
- package/internals/models/props/tabs.d.ts +1 -1
- package/internals/models/props/toolbar.d.ts +1 -1
- package/internals/utils/date-utils.d.ts +1 -1
- package/internals/utils/time-utils.d.ts +1 -1
- package/internals/utils/utils.d.ts +1 -1
- package/internals/utils/utils.js +3 -3
- package/internals/utils/validation.d.ts +1 -1
- package/internals/utils/valueManagers.d.ts +3 -5
- package/internals/utils/valueManagers.js +10 -10
- package/internals/utils/views.d.ts +1 -1
- package/legacy/AdapterDateFnsJalali/index.js +68 -0
- package/legacy/AdapterLuxon/index.js +12 -3
- package/legacy/DateCalendar/DateCalendar.js +0 -2
- package/legacy/DateCalendar/PickersCalendarHeader.js +8 -10
- package/legacy/DateField/DateField.js +7 -1
- package/legacy/DateTimeField/DateTimeField.js +7 -1
- package/legacy/TimeClock/TimeClock.js +5 -4
- package/legacy/TimeField/TimeField.js +7 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -12
- package/legacy/internals/components/PickersModalDialog.js +7 -9
- package/legacy/internals/components/PickersPopper.js +2 -7
- package/legacy/internals/demo/DemoContainer.js +12 -6
- package/legacy/internals/hooks/useField/useField.js +12 -10
- package/legacy/internals/hooks/useField/useField.utils.js +79 -55
- package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/legacy/internals/hooks/useField/useFieldState.js +94 -67
- package/legacy/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/legacy/internals/hooks/usePicker/usePickerValue.js +23 -4
- package/legacy/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/legacy/internals/hooks/useViews.js +10 -0
- package/legacy/internals/index.js +1 -1
- package/legacy/internals/models/index.js +1 -3
- package/legacy/internals/utils/utils.js +3 -3
- package/legacy/internals/utils/valueManagers.js +13 -15
- package/legacy/locales/caES.js +88 -0
- package/legacy/locales/daDK.js +91 -0
- package/legacy/locales/esES.js +34 -17
- package/legacy/locales/heIL.js +33 -16
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/jaJP.js +3 -1
- package/legacy/locales/kzKZ.js +88 -0
- package/legacy/locales/nbNO.js +12 -10
- package/legacy/locales/nlNL.js +25 -11
- package/legacy/locales/ptBR.js +33 -16
- package/legacy/locales/svSE.js +12 -10
- package/legacy/models/index.js +4 -1
- package/legacy/models/views.js +1 -0
- package/locales/beBY.d.ts +3 -3
- package/locales/caES.d.ts +51 -0
- package/locales/caES.js +54 -0
- package/locales/csCZ.d.ts +3 -3
- package/locales/daDK.d.ts +51 -0
- package/locales/daDK.js +59 -0
- package/locales/deDE.d.ts +3 -3
- package/locales/enUS.d.ts +3 -3
- package/locales/esES.d.ts +3 -3
- package/locales/esES.js +14 -17
- package/locales/faIR.d.ts +3 -3
- package/locales/fiFI.d.ts +3 -3
- package/locales/frFR.d.ts +3 -3
- package/locales/heIL.d.ts +3 -3
- package/locales/heIL.js +13 -16
- package/locales/huHU.d.ts +3 -3
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/isIS.d.ts +3 -3
- package/locales/itIT.d.ts +3 -3
- package/locales/jaJP.d.ts +3 -3
- package/locales/jaJP.js +1 -1
- package/locales/koKR.d.ts +3 -3
- package/locales/kzKZ.d.ts +51 -0
- package/locales/kzKZ.js +56 -0
- package/locales/nbNO.d.ts +3 -3
- package/locales/nbNO.js +8 -10
- package/locales/nlNL.d.ts +4 -4
- package/locales/nlNL.js +9 -11
- package/locales/plPL.d.ts +3 -3
- package/locales/ptBR.d.ts +3 -3
- package/locales/ptBR.js +13 -16
- package/locales/ruRU.d.ts +3 -3
- package/locales/svSE.d.ts +3 -3
- package/locales/svSE.js +8 -10
- package/locales/trTR.d.ts +3 -3
- package/locales/ukUA.d.ts +3 -3
- package/locales/urPK.d.ts +3 -3
- package/locales/utils/getPickersLocalization.d.ts +3 -3
- package/locales/utils/pickersLocaleTextApi.d.ts +1 -1
- package/locales/zhCN.d.ts +3 -3
- package/models/adapters.d.ts +567 -0
- package/models/adapters.js +1 -0
- package/models/fields.d.ts +117 -0
- package/models/fields.js +1 -0
- package/models/index.d.ts +4 -6
- package/models/index.js +4 -1
- package/models/validation.d.ts +8 -0
- package/models/validation.js +1 -0
- package/models/views.js +1 -0
- package/modern/AdapterDateFnsJalali/index.js +68 -0
- package/modern/AdapterLuxon/index.js +12 -3
- package/modern/DateCalendar/DateCalendar.js +0 -2
- package/modern/DateCalendar/PickersCalendarHeader.js +6 -8
- package/modern/DateCalendar/PickersSlideTransition.js +1 -0
- package/modern/DateField/DateField.js +8 -2
- package/modern/DateTimeField/DateTimeField.js +8 -2
- package/modern/MonthCalendar/PickersMonth.js +1 -0
- package/modern/TimeClock/TimeClock.js +5 -4
- package/modern/TimeField/TimeField.js +8 -2
- package/modern/YearCalendar/PickersYear.js +1 -0
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +9 -11
- package/modern/internals/components/PickersModalDialog.js +6 -8
- package/modern/internals/components/PickersPopper.js +2 -7
- package/modern/internals/demo/DemoContainer.js +15 -7
- package/modern/internals/hooks/useField/useField.js +10 -8
- package/modern/internals/hooks/useField/useField.utils.js +71 -51
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/modern/internals/hooks/useField/useFieldState.js +88 -62
- package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/modern/internals/hooks/usePicker/usePickerValue.js +23 -2
- package/modern/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/modern/internals/hooks/useViews.js +8 -0
- package/modern/internals/index.js +1 -1
- package/modern/internals/models/index.js +1 -3
- package/modern/internals/utils/utils.js +3 -3
- package/modern/internals/utils/valueManagers.js +10 -10
- package/modern/locales/caES.js +54 -0
- package/modern/locales/daDK.js +56 -0
- package/modern/locales/esES.js +14 -17
- package/modern/locales/heIL.js +13 -16
- package/modern/locales/index.js +1 -0
- package/modern/locales/jaJP.js +1 -1
- package/modern/locales/kzKZ.js +56 -0
- package/modern/locales/nbNO.js +8 -10
- package/modern/locales/nlNL.js +9 -11
- package/modern/locales/ptBR.js +13 -16
- package/modern/locales/svSE.js +8 -10
- package/modern/models/adapters.js +1 -0
- package/modern/models/fields.js +1 -0
- package/modern/models/index.js +4 -1
- package/modern/models/validation.js +1 -0
- package/modern/models/views.js +1 -0
- package/node/AdapterDateFnsJalali/index.js +68 -0
- package/node/AdapterLuxon/index.js +12 -3
- package/node/AdapterMomentHijri/index.js +2 -0
- package/node/DateCalendar/DateCalendar.js +0 -2
- package/node/DateCalendar/PickersCalendarHeader.js +5 -9
- package/node/DateCalendar/PickersSlideTransition.js +1 -0
- package/node/DateField/DateField.js +8 -2
- package/node/DateTimeField/DateTimeField.js +8 -2
- package/node/MonthCalendar/PickersMonth.js +1 -0
- package/node/TimeClock/TimeClock.js +5 -4
- package/node/TimeField/TimeField.js +8 -2
- package/node/YearCalendar/PickersYear.js +1 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +9 -11
- package/node/internals/components/PickersModalDialog.js +6 -8
- package/node/internals/components/PickersPopper.js +2 -7
- package/node/internals/demo/DemoContainer.js +15 -7
- package/node/internals/hooks/useField/useField.js +10 -8
- package/node/internals/hooks/useField/useField.utils.js +74 -53
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +22 -0
- package/node/internals/hooks/useField/useFieldState.js +87 -61
- package/node/internals/hooks/usePicker/usePickerLayoutProps.js +5 -0
- package/node/internals/hooks/usePicker/usePickerValue.js +22 -2
- package/node/internals/hooks/usePicker/usePickerViews.js +12 -0
- package/node/internals/hooks/useViews.js +8 -0
- package/node/internals/index.js +0 -6
- package/node/internals/models/index.js +0 -22
- package/node/internals/utils/utils.js +3 -3
- package/node/internals/utils/valueManagers.js +9 -9
- package/node/locales/caES.js +61 -0
- package/node/locales/csCZ.js +0 -1
- package/node/locales/daDK.js +62 -0
- package/node/locales/esES.js +14 -17
- package/node/locales/heIL.js +13 -16
- package/node/locales/index.js +11 -0
- package/node/locales/jaJP.js +1 -1
- package/node/locales/kzKZ.js +62 -0
- package/node/locales/nbNO.js +8 -10
- package/node/locales/nlNL.js +9 -11
- package/node/locales/ptBR.js +13 -16
- package/node/locales/svSE.js +8 -10
- package/node/models/fields.js +5 -0
- package/node/models/index.js +44 -0
- package/node/models/validation.js +5 -0
- package/node/models/views.js +5 -0
- package/package.json +3 -3
- package/themeAugmentation/props.d.ts +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +1 -1
- package/internals/models/muiPickersAdapter.d.ts +0 -35
- /package/{internals/models/views.js → legacy/models/adapters.js} +0 -0
- /package/legacy/{internals/models/views.js → models/fields.js} +0 -0
- /package/{modern/internals/models/views.js → legacy/models/validation.js} +0 -0
- /package/{internals/models → models}/views.d.ts +0 -0
- /package/node/{internals/models/views.js → models/adapters.js} +0 -0
|
@@ -20,7 +20,7 @@ var _PickersArrowSwitcher = require("../internals/components/PickersArrowSwitche
|
|
|
20
20
|
var _dateHelpersHooks = require("../internals/hooks/date-helpers-hooks");
|
|
21
21
|
var _pickersCalendarHeaderClasses = require("./pickersCalendarHeaderClasses");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const _excluded = ["ownerState"];
|
|
23
|
+
const _excluded = ["ownerState"]; // We keep the interface to allow module augmentation
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
26
|
const useUtilityClasses = ownerState => {
|
|
@@ -109,8 +109,6 @@ function PickersCalendarHeader(inProps) {
|
|
|
109
109
|
name: 'MuiPickersCalendarHeader'
|
|
110
110
|
});
|
|
111
111
|
const {
|
|
112
|
-
components,
|
|
113
|
-
componentsProps,
|
|
114
112
|
slots,
|
|
115
113
|
slotProps,
|
|
116
114
|
currentMonth: month,
|
|
@@ -128,10 +126,10 @@ function PickersCalendarHeader(inProps) {
|
|
|
128
126
|
} = props;
|
|
129
127
|
const ownerState = props;
|
|
130
128
|
const classes = useUtilityClasses(props);
|
|
131
|
-
const SwitchViewButton = slots?.switchViewButton ??
|
|
129
|
+
const SwitchViewButton = slots?.switchViewButton ?? PickersCalendarHeaderSwitchViewButton;
|
|
132
130
|
const switchViewButtonProps = (0, _utils.useSlotProps)({
|
|
133
131
|
elementType: SwitchViewButton,
|
|
134
|
-
externalSlotProps: slotProps?.switchViewButton
|
|
132
|
+
externalSlotProps: slotProps?.switchViewButton,
|
|
135
133
|
additionalProps: {
|
|
136
134
|
size: 'small',
|
|
137
135
|
'aria-label': localeText.calendarViewSwitchingButtonAriaLabel(view)
|
|
@@ -139,11 +137,11 @@ function PickersCalendarHeader(inProps) {
|
|
|
139
137
|
ownerState,
|
|
140
138
|
className: classes.switchViewButton
|
|
141
139
|
});
|
|
142
|
-
const SwitchViewIcon = slots?.switchViewIcon ??
|
|
140
|
+
const SwitchViewIcon = slots?.switchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;
|
|
143
141
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
144
142
|
const _useSlotProps = (0, _utils.useSlotProps)({
|
|
145
143
|
elementType: SwitchViewIcon,
|
|
146
|
-
externalSlotProps: slotProps?.switchViewIcon
|
|
144
|
+
externalSlotProps: slotProps?.switchViewIcon,
|
|
147
145
|
ownerState: undefined,
|
|
148
146
|
className: classes.switchViewIcon
|
|
149
147
|
}),
|
|
@@ -201,8 +199,6 @@ function PickersCalendarHeader(inProps) {
|
|
|
201
199
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fade.default, {
|
|
202
200
|
in: view === 'day',
|
|
203
201
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickersArrowSwitcher.PickersArrowSwitcher, {
|
|
204
|
-
components: components,
|
|
205
|
-
componentsProps: componentsProps,
|
|
206
202
|
slots: slots,
|
|
207
203
|
slotProps: slotProps,
|
|
208
204
|
onGoToPrevious: selectPreviousMonth,
|
|
@@ -112,6 +112,7 @@ function PickersSlideTransition(inProps) {
|
|
|
112
112
|
className,
|
|
113
113
|
reduceAnimations,
|
|
114
114
|
transKey
|
|
115
|
+
// extracting `classes` from `other`
|
|
115
116
|
} = props,
|
|
116
117
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
117
118
|
const classes = useUtilityClasses(props);
|
|
@@ -14,7 +14,7 @@ var _styles = require("@mui/material/styles");
|
|
|
14
14
|
var _utils = require("@mui/base/utils");
|
|
15
15
|
var _useDateField2 = require("./useDateField");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["components", "componentsProps", "slots", "slotProps"],
|
|
17
|
+
const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
|
|
18
18
|
_excluded2 = ["inputRef"],
|
|
19
19
|
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -28,7 +28,9 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
28
28
|
components,
|
|
29
29
|
componentsProps,
|
|
30
30
|
slots,
|
|
31
|
-
slotProps
|
|
31
|
+
slotProps,
|
|
32
|
+
InputProps,
|
|
33
|
+
inputProps
|
|
32
34
|
} = themeProps,
|
|
33
35
|
other = (0, _objectWithoutPropertiesLoose2.default)(themeProps, _excluded);
|
|
34
36
|
const ownerState = themeProps;
|
|
@@ -43,6 +45,10 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
43
45
|
inputRef: externalInputRef
|
|
44
46
|
} = _useSlotProps,
|
|
45
47
|
textFieldProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
48
|
+
|
|
49
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
50
|
+
textFieldProps.inputProps = (0, _extends2.default)({}, textFieldProps.inputProps, inputProps);
|
|
51
|
+
textFieldProps.InputProps = (0, _extends2.default)({}, textFieldProps.InputProps, InputProps);
|
|
46
52
|
const _useDateField = (0, _useDateField2.useDateField)({
|
|
47
53
|
props: textFieldProps,
|
|
48
54
|
inputRef: externalInputRef
|
|
@@ -14,7 +14,7 @@ var _styles = require("@mui/material/styles");
|
|
|
14
14
|
var _utils = require("@mui/base/utils");
|
|
15
15
|
var _useDateTimeField2 = require("./useDateTimeField");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["components", "componentsProps", "slots", "slotProps"],
|
|
17
|
+
const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
|
|
18
18
|
_excluded2 = ["inputRef"],
|
|
19
19
|
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -28,7 +28,9 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
28
28
|
components,
|
|
29
29
|
componentsProps,
|
|
30
30
|
slots,
|
|
31
|
-
slotProps
|
|
31
|
+
slotProps,
|
|
32
|
+
InputProps,
|
|
33
|
+
inputProps
|
|
32
34
|
} = themeProps,
|
|
33
35
|
other = (0, _objectWithoutPropertiesLoose2.default)(themeProps, _excluded);
|
|
34
36
|
const ownerState = themeProps;
|
|
@@ -43,6 +45,10 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
43
45
|
inputRef: externalInputRef
|
|
44
46
|
} = _useSlotProps,
|
|
45
47
|
textFieldProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
48
|
+
|
|
49
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
50
|
+
textFieldProps.inputProps = (0, _extends2.default)({}, textFieldProps.inputProps, inputProps);
|
|
51
|
+
textFieldProps.InputProps = (0, _extends2.default)({}, textFieldProps.InputProps, InputProps);
|
|
46
52
|
const _useDateTimeField = (0, _useDateTimeField2.useDateTimeField)({
|
|
47
53
|
props: textFieldProps,
|
|
48
54
|
inputRef: externalInputRef
|
|
@@ -101,6 +101,7 @@ const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProps) {
|
|
|
101
101
|
onFocus,
|
|
102
102
|
onBlur,
|
|
103
103
|
'aria-current': ariaCurrent
|
|
104
|
+
// We don't want to forward this prop to the root element
|
|
104
105
|
} = props,
|
|
105
106
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
106
107
|
const ref = React.useRef(null);
|
|
@@ -22,6 +22,7 @@ var _PickerViewRoot = require("../internals/components/PickerViewRoot");
|
|
|
22
22
|
var _timeClockClasses = require("./timeClockClasses");
|
|
23
23
|
var _Clock = require("./Clock");
|
|
24
24
|
var _ClockNumbers = require("./ClockNumbers");
|
|
25
|
+
var _slotsMigration = require("../internals/utils/slots-migration");
|
|
25
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
27
|
const _excluded = ["ampm", "ampmInClock", "autoFocus", "components", "componentsProps", "slots", "slotProps", "value", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableClock", "shouldDisableTime", "showViewSwitcher", "onChange", "defaultValue", "view", "views", "openTo", "onViewChange", "className", "disabled", "readOnly"];
|
|
27
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -74,8 +75,8 @@ const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProps, ref)
|
|
|
74
75
|
autoFocus,
|
|
75
76
|
components,
|
|
76
77
|
componentsProps,
|
|
77
|
-
slots,
|
|
78
|
-
slotProps,
|
|
78
|
+
slots: innerSlots,
|
|
79
|
+
slotProps: innerSlotProps,
|
|
79
80
|
value: valueProp,
|
|
80
81
|
disableIgnoringDatePartForTimeValidation = false,
|
|
81
82
|
maxTime,
|
|
@@ -97,6 +98,8 @@ const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProps, ref)
|
|
|
97
98
|
readOnly
|
|
98
99
|
} = props,
|
|
99
100
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
101
|
+
const slots = innerSlots ?? (0, _slotsMigration.uncapitalizeObjectKeys)(components);
|
|
102
|
+
const slotProps = innerSlotProps ?? componentsProps;
|
|
100
103
|
const [value, setValue] = (0, _utils.unstable_useControlled)({
|
|
101
104
|
name: 'DateCalendar',
|
|
102
105
|
state: 'value',
|
|
@@ -290,8 +293,6 @@ const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProps, ref)
|
|
|
290
293
|
readOnly: readOnly
|
|
291
294
|
}, viewProps)), showViewSwitcher && /*#__PURE__*/(0, _jsxRuntime.jsx)(TimeClockArrowSwitcher, {
|
|
292
295
|
className: classes.arrowSwitcher,
|
|
293
|
-
components: components,
|
|
294
|
-
componentsProps: componentsProps,
|
|
295
296
|
slots: slots,
|
|
296
297
|
slotProps: slotProps,
|
|
297
298
|
onGoToPrevious: () => setView(previousView),
|
|
@@ -14,7 +14,7 @@ var _styles = require("@mui/material/styles");
|
|
|
14
14
|
var _utils = require("@mui/base/utils");
|
|
15
15
|
var _useTimeField2 = require("./useTimeField");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["slots", "slotProps", "components", "componentsProps"],
|
|
17
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
|
|
18
18
|
_excluded2 = ["inputRef"],
|
|
19
19
|
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -28,7 +28,9 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, ref)
|
|
|
28
28
|
slots,
|
|
29
29
|
slotProps,
|
|
30
30
|
components,
|
|
31
|
-
componentsProps
|
|
31
|
+
componentsProps,
|
|
32
|
+
InputProps,
|
|
33
|
+
inputProps
|
|
32
34
|
} = themeProps,
|
|
33
35
|
other = (0, _objectWithoutPropertiesLoose2.default)(themeProps, _excluded);
|
|
34
36
|
const ownerState = themeProps;
|
|
@@ -43,6 +45,10 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, ref)
|
|
|
43
45
|
inputRef: externalInputRef
|
|
44
46
|
} = _useSlotProps,
|
|
45
47
|
textFieldProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
48
|
+
|
|
49
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
50
|
+
textFieldProps.inputProps = (0, _extends2.default)({}, textFieldProps.inputProps, inputProps);
|
|
51
|
+
textFieldProps.InputProps = (0, _extends2.default)({}, textFieldProps.InputProps, InputProps);
|
|
46
52
|
const _useTimeField = (0, _useTimeField2.useTimeField)({
|
|
47
53
|
props: textFieldProps,
|
|
48
54
|
inputRef: externalInputRef
|
|
@@ -103,6 +103,7 @@ const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps) {
|
|
|
103
103
|
onFocus,
|
|
104
104
|
onBlur,
|
|
105
105
|
'aria-current': ariaCurrent
|
|
106
|
+
// We don't want to forward this prop to the root element
|
|
106
107
|
} = props,
|
|
107
108
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
108
109
|
const ref = React.useRef(null);
|
package/node/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
|
17
17
|
var _icons = require("../icons");
|
|
18
18
|
var _pickersArrowSwitcherClasses = require("./pickersArrowSwitcherClasses");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["children", "className", "
|
|
20
|
+
const _excluded = ["children", "className", "slots", "slotProps", "isNextDisabled", "isNextHidden", "onGoToNext", "nextLabel", "isPreviousDisabled", "isPreviousHidden", "onGoToPrevious", "previousLabel"],
|
|
21
21
|
_excluded2 = ["ownerState"],
|
|
22
22
|
_excluded3 = ["ownerState"];
|
|
23
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -68,8 +68,6 @@ const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function PickersArrow
|
|
|
68
68
|
const {
|
|
69
69
|
children,
|
|
70
70
|
className,
|
|
71
|
-
components,
|
|
72
|
-
componentsProps,
|
|
73
71
|
slots,
|
|
74
72
|
slotProps,
|
|
75
73
|
isNextDisabled,
|
|
@@ -97,10 +95,10 @@ const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function PickersArrow
|
|
|
97
95
|
label: previousLabel
|
|
98
96
|
};
|
|
99
97
|
const [leftProps, rightProps] = isRTL ? [nextProps, previousProps] : [previousProps, nextProps];
|
|
100
|
-
const PreviousIconButton = slots?.previousIconButton ??
|
|
98
|
+
const PreviousIconButton = slots?.previousIconButton ?? PickersArrowSwitcherButton;
|
|
101
99
|
const previousIconButtonProps = (0, _utils2.useSlotProps)({
|
|
102
100
|
elementType: PreviousIconButton,
|
|
103
|
-
externalSlotProps: slotProps?.previousIconButton
|
|
101
|
+
externalSlotProps: slotProps?.previousIconButton,
|
|
104
102
|
additionalProps: {
|
|
105
103
|
size: 'medium',
|
|
106
104
|
title: leftProps.label,
|
|
@@ -114,10 +112,10 @@ const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function PickersArrow
|
|
|
114
112
|
}),
|
|
115
113
|
className: classes.button
|
|
116
114
|
});
|
|
117
|
-
const NextIconButton = slots?.nextIconButton ??
|
|
115
|
+
const NextIconButton = slots?.nextIconButton ?? PickersArrowSwitcherButton;
|
|
118
116
|
const nextIconButtonProps = (0, _utils2.useSlotProps)({
|
|
119
117
|
elementType: NextIconButton,
|
|
120
|
-
externalSlotProps: slotProps?.nextIconButton
|
|
118
|
+
externalSlotProps: slotProps?.nextIconButton,
|
|
121
119
|
additionalProps: {
|
|
122
120
|
size: 'medium',
|
|
123
121
|
title: rightProps.label,
|
|
@@ -131,22 +129,22 @@ const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function PickersArrow
|
|
|
131
129
|
}),
|
|
132
130
|
className: classes.button
|
|
133
131
|
});
|
|
134
|
-
const LeftArrowIcon = slots?.leftArrowIcon ??
|
|
132
|
+
const LeftArrowIcon = slots?.leftArrowIcon ?? _icons.ArrowLeft;
|
|
135
133
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
136
134
|
const _useSlotProps = (0, _utils2.useSlotProps)({
|
|
137
135
|
elementType: LeftArrowIcon,
|
|
138
|
-
externalSlotProps: slotProps?.leftArrowIcon
|
|
136
|
+
externalSlotProps: slotProps?.leftArrowIcon,
|
|
139
137
|
additionalProps: {
|
|
140
138
|
fontSize: 'inherit'
|
|
141
139
|
},
|
|
142
140
|
ownerState: undefined
|
|
143
141
|
}),
|
|
144
142
|
leftArrowIconProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
145
|
-
const RightArrowIcon = slots?.rightArrowIcon ??
|
|
143
|
+
const RightArrowIcon = slots?.rightArrowIcon ?? _icons.ArrowRight;
|
|
146
144
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
147
145
|
const _useSlotProps2 = (0, _utils2.useSlotProps)({
|
|
148
146
|
elementType: RightArrowIcon,
|
|
149
|
-
externalSlotProps: slotProps?.rightArrowIcon
|
|
147
|
+
externalSlotProps: slotProps?.rightArrowIcon,
|
|
150
148
|
additionalProps: {
|
|
151
149
|
fontSize: 'inherit'
|
|
152
150
|
},
|
|
@@ -34,21 +34,19 @@ function PickersModalDialog(props) {
|
|
|
34
34
|
children,
|
|
35
35
|
onDismiss,
|
|
36
36
|
open,
|
|
37
|
-
components,
|
|
38
|
-
componentsProps,
|
|
39
37
|
slots,
|
|
40
38
|
slotProps
|
|
41
39
|
} = props;
|
|
42
|
-
const Dialog = slots?.dialog ??
|
|
43
|
-
const Transition = slots?.mobileTransition ??
|
|
40
|
+
const Dialog = slots?.dialog ?? PickersModalDialogRoot;
|
|
41
|
+
const Transition = slots?.mobileTransition ?? _Fade.default;
|
|
44
42
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Dialog, (0, _extends2.default)({
|
|
45
43
|
open: open,
|
|
46
44
|
onClose: onDismiss
|
|
47
|
-
},
|
|
45
|
+
}, slotProps?.dialog, {
|
|
48
46
|
TransitionComponent: Transition,
|
|
49
|
-
TransitionProps: slotProps?.mobileTransition
|
|
50
|
-
PaperComponent: slots?.mobilePaper
|
|
51
|
-
PaperProps: slotProps?.mobilePaper
|
|
47
|
+
TransitionProps: slotProps?.mobileTransition,
|
|
48
|
+
PaperComponent: slots?.mobilePaper,
|
|
49
|
+
PaperProps: slotProps?.mobilePaper,
|
|
52
50
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PickersModalDialogContent, {
|
|
53
51
|
children: children
|
|
54
52
|
})
|
|
@@ -16,7 +16,6 @@ var _utils2 = require("@mui/utils");
|
|
|
16
16
|
var _styles = require("@mui/material/styles");
|
|
17
17
|
var _pickersPopperClasses = require("./pickersPopperClasses");
|
|
18
18
|
var _utils3 = require("../utils/utils");
|
|
19
|
-
var _slotsMigration = require("../utils/slots-migration");
|
|
20
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -181,13 +180,9 @@ function PickersPopper(inProps) {
|
|
|
181
180
|
open,
|
|
182
181
|
role,
|
|
183
182
|
placement,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
slots: innerSlots,
|
|
187
|
-
slotProps: innerSlotProps
|
|
183
|
+
slots,
|
|
184
|
+
slotProps
|
|
188
185
|
} = props;
|
|
189
|
-
const slots = innerSlots ?? (0, _slotsMigration.uncapitalizeObjectKeys)(components);
|
|
190
|
-
const slotProps = innerSlotProps ?? componentsProps;
|
|
191
186
|
React.useEffect(() => {
|
|
192
187
|
function handleKeyDown(nativeEvent) {
|
|
193
188
|
// IE11, Edge (prior to using Blink?) use 'Esc'
|
|
@@ -109,14 +109,22 @@ function DemoContainer(props) {
|
|
|
109
109
|
if (childrenTypes.has('UI-view')) {
|
|
110
110
|
// noop
|
|
111
111
|
} else if (childrenTypes.has('single-input-range-field')) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
md: 400
|
|
112
|
+
if (!childrenSupportedSections.has('date-time')) {
|
|
113
|
+
sx = (0, _extends2.default)({}, sx, {
|
|
114
|
+
[`& > .${_TextField.textFieldClasses.root}`]: {
|
|
115
|
+
minWidth: 300
|
|
117
116
|
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
sx = (0, _extends2.default)({}, sx, {
|
|
120
|
+
[`& > .${_TextField.textFieldClasses.root}`]: {
|
|
121
|
+
minWidth: {
|
|
122
|
+
xs: 300,
|
|
123
|
+
md: 400
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
120
128
|
} else if (childrenSupportedSections.has('date-time')) {
|
|
121
129
|
sx = (0, _extends2.default)({}, sx, {
|
|
122
130
|
[`& > .${_TextField.textFieldClasses.root}`]: {
|
|
@@ -32,7 +32,8 @@ const useField = params => {
|
|
|
32
32
|
updateSectionValue,
|
|
33
33
|
updateValueFromValueStr,
|
|
34
34
|
setTempAndroidValueStr,
|
|
35
|
-
sectionsValueBoundaries
|
|
35
|
+
sectionsValueBoundaries,
|
|
36
|
+
placeholder
|
|
36
37
|
} = (0, _useFieldState.useFieldState)(params);
|
|
37
38
|
const {
|
|
38
39
|
applyCharacterEditing,
|
|
@@ -68,7 +69,8 @@ const useField = params => {
|
|
|
68
69
|
const handleRef = (0, _useForkRef.default)(inputRefProp, inputRef);
|
|
69
70
|
const focusTimeoutRef = React.useRef(undefined);
|
|
70
71
|
const theme = (0, _styles.useTheme)();
|
|
71
|
-
const
|
|
72
|
+
const isRTL = theme.direction === 'rtl';
|
|
73
|
+
const sectionOrder = React.useMemo(() => (0, _useField.getSectionOrder)(state.sections, isRTL), [state.sections, isRTL]);
|
|
72
74
|
const syncSelectionFromDOM = () => {
|
|
73
75
|
if (readOnly) {
|
|
74
76
|
setSelectedSections(null);
|
|
@@ -159,7 +161,7 @@ const useField = params => {
|
|
|
159
161
|
if (selectedSectionIndexes.startIndex === 0 && selectedSectionIndexes.endIndex === state.sections.length - 1) {
|
|
160
162
|
keyPressed = cleanValueStr;
|
|
161
163
|
} else {
|
|
162
|
-
const prevValueStr = (0, _useField.cleanString)(fieldValueManager.getValueStrFromSections(state.sections));
|
|
164
|
+
const prevValueStr = (0, _useField.cleanString)(fieldValueManager.getValueStrFromSections(state.sections, isRTL));
|
|
163
165
|
let startOfDiffIndex = -1;
|
|
164
166
|
let endOfDiffIndex = -1;
|
|
165
167
|
for (let i = 0; i < prevValueStr.length; i += 1) {
|
|
@@ -264,7 +266,7 @@ const useField = params => {
|
|
|
264
266
|
}
|
|
265
267
|
const activeSection = state.sections[selectedSectionIndexes.startIndex];
|
|
266
268
|
const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
|
|
267
|
-
const newSectionValue = (0, _useField.adjustSectionValue)(utils, activeSection, event.key, sectionsValueBoundaries, activeDateManager.
|
|
269
|
+
const newSectionValue = (0, _useField.adjustSectionValue)(utils, activeSection, event.key, sectionsValueBoundaries, activeDateManager.date);
|
|
268
270
|
updateSectionValue({
|
|
269
271
|
activeSection,
|
|
270
272
|
newSectionValue,
|
|
@@ -309,8 +311,8 @@ const useField = params => {
|
|
|
309
311
|
if (error !== undefined) {
|
|
310
312
|
return error;
|
|
311
313
|
}
|
|
312
|
-
return
|
|
313
|
-
}, [
|
|
314
|
+
return valueManager.hasError(validationError);
|
|
315
|
+
}, [valueManager, validationError, error]);
|
|
314
316
|
React.useEffect(() => {
|
|
315
317
|
// Select the right section when focused on mount (`autoFocus = true` on the input)
|
|
316
318
|
if (inputRef.current && inputRef.current === document.activeElement) {
|
|
@@ -330,7 +332,7 @@ const useField = params => {
|
|
|
330
332
|
}
|
|
331
333
|
}, [state.tempValueStrAndroid]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
332
334
|
|
|
333
|
-
const valueStr = React.useMemo(() => state.tempValueStrAndroid ?? fieldValueManager.getValueStrFromSections(state.sections), [state.sections, fieldValueManager, state.tempValueStrAndroid]);
|
|
335
|
+
const valueStr = React.useMemo(() => state.tempValueStrAndroid ?? fieldValueManager.getValueStrFromSections(state.sections, isRTL), [state.sections, fieldValueManager, state.tempValueStrAndroid, isRTL]);
|
|
334
336
|
const inputMode = React.useMemo(() => {
|
|
335
337
|
if (selectedSectionIndexes == null) {
|
|
336
338
|
return 'text';
|
|
@@ -357,7 +359,7 @@ const useField = params => {
|
|
|
357
359
|
setSelectedSections: activeSectionIndex => setSelectedSections(activeSectionIndex)
|
|
358
360
|
}));
|
|
359
361
|
return (0, _extends2.default)({
|
|
360
|
-
placeholder
|
|
362
|
+
placeholder,
|
|
361
363
|
autoComplete: 'off'
|
|
362
364
|
}, otherForwardedProps, {
|
|
363
365
|
value: shouldShowPlaceholder ? '' : valueStr,
|