@mui/x-date-pickers 7.0.0-alpha.4 → 7.0.0-alpha.6
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 +342 -0
- package/DateCalendar/DateCalendar.types.d.ts +6 -6
- package/DateCalendar/DayCalendar.d.ts +4 -4
- package/DateCalendar/index.d.ts +1 -1
- package/DateField/DateField.js +17 -50
- package/DateField/DateField.types.d.ts +5 -9
- package/DateField/useDateField.d.ts +2 -2
- package/DateField/useDateField.js +1 -5
- package/DatePicker/DatePicker.js +5 -1
- package/DatePicker/DatePicker.types.d.ts +6 -6
- package/DatePicker/index.d.ts +1 -1
- package/DatePicker/shared.d.ts +6 -6
- package/DateTimeField/DateTimeField.js +17 -50
- package/DateTimeField/DateTimeField.types.d.ts +5 -9
- package/DateTimeField/useDateTimeField.d.ts +2 -2
- package/DateTimeField/useDateTimeField.js +1 -5
- package/DateTimePicker/DateTimePicker.js +5 -1
- package/DateTimePicker/DateTimePicker.types.d.ts +6 -6
- package/DateTimePicker/index.d.ts +1 -1
- package/DateTimePicker/shared.d.ts +6 -6
- package/DesktopDatePicker/DesktopDatePicker.js +7 -2
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +6 -6
- package/DesktopDatePicker/index.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +8 -8
- package/DesktopDateTimePicker/index.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.js +5 -1
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +8 -8
- package/DesktopTimePicker/index.d.ts +1 -1
- package/DigitalClock/DigitalClock.types.d.ts +4 -4
- package/DigitalClock/index.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.js +7 -2
- package/MobileDatePicker/MobileDatePicker.types.d.ts +6 -6
- package/MobileDatePicker/index.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +6 -6
- package/MobileDateTimePicker/index.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.js +5 -1
- package/MobileTimePicker/MobileTimePicker.types.d.ts +6 -6
- package/MobileTimePicker/index.d.ts +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +4 -4
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +3 -3
- package/MultiSectionDigitalClock/index.d.ts +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +8 -8
- package/PickersCalendarHeader/index.d.ts +1 -1
- package/PickersLayout/PickersLayout.types.d.ts +6 -6
- package/PickersLayout/index.d.ts +1 -1
- package/PickersSectionList/PickersSectionList.d.ts +11 -0
- package/PickersSectionList/PickersSectionList.js +223 -0
- package/PickersSectionList/PickersSectionList.types.d.ts +56 -0
- package/PickersSectionList/index.d.ts +4 -0
- package/PickersSectionList/index.js +2 -0
- package/PickersSectionList/package.json +6 -0
- package/PickersSectionList/pickersSectionListClasses.d.ts +11 -0
- package/PickersSectionList/pickersSectionListClasses.js +6 -0
- package/StaticDatePicker/StaticDatePicker.js +1 -1
- package/StaticDatePicker/StaticDatePicker.types.d.ts +7 -7
- package/StaticDatePicker/index.d.ts +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +7 -7
- package/StaticDateTimePicker/index.d.ts +1 -1
- package/StaticTimePicker/StaticTimePicker.types.d.ts +7 -7
- package/StaticTimePicker/index.d.ts +1 -1
- package/TimeClock/TimeClock.types.d.ts +5 -5
- package/TimeClock/index.d.ts +1 -1
- package/TimeField/TimeField.js +17 -50
- package/TimeField/TimeField.types.d.ts +5 -9
- package/TimeField/useTimeField.d.ts +2 -2
- package/TimeField/useTimeField.js +1 -5
- package/TimePicker/TimePicker.js +5 -1
- package/TimePicker/TimePicker.types.d.ts +6 -6
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/shared.d.ts +5 -5
- package/hooks/index.d.ts +1 -0
- package/hooks/useClearableField.d.ts +32 -20
- package/hooks/useClearableField.js +32 -33
- package/index.d.ts +1 -0
- package/index.js +4 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +9 -9
- package/internals/components/PickersArrowSwitcher/index.d.ts +3 -1
- package/internals/components/PickersArrowSwitcher/index.js +2 -1
- package/internals/components/{PickersTextField → PickersInput}/Outline.d.ts +1 -0
- package/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
- package/internals/components/PickersInput/PickersFilledInput.d.ts +3 -0
- package/internals/components/PickersInput/PickersFilledInput.js +166 -0
- package/internals/components/PickersInput/PickersInput.d.ts +15 -0
- package/internals/components/{PickersTextField → PickersInput}/PickersInput.js +78 -106
- package/internals/components/PickersInput/PickersInput.types.d.ts +60 -0
- package/internals/components/PickersInput/PickersOutlinedInput.d.ts +3 -0
- package/internals/components/PickersInput/PickersOutlinedInput.js +117 -0
- package/internals/components/PickersInput/PickersStandardInput.d.ts +3 -0
- package/internals/components/PickersInput/PickersStandardInput.js +123 -0
- package/internals/components/PickersInput/index.d.ts +4 -0
- package/internals/components/PickersInput/index.js +3 -0
- package/internals/components/PickersInput/pickersInputClasses.d.ts +84 -0
- package/internals/components/PickersInput/pickersInputClasses.js +18 -0
- package/internals/components/PickersModalDialog.d.ts +4 -4
- package/internals/components/PickersPopper.d.ts +4 -4
- package/internals/components/PickersTextField/PickersTextField.d.ts +1 -2
- package/internals/components/PickersTextField/PickersTextField.js +15 -6
- package/internals/components/PickersTextField/PickersTextField.types.d.ts +46 -3
- package/internals/components/PickersTextField/pickersTextFieldClasses.d.ts +0 -31
- package/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
- package/internals/hooks/useDesktopPicker/index.d.ts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +8 -8
- package/internals/hooks/useField/index.d.ts +1 -1
- package/internals/hooks/useField/useField.js +11 -4
- package/internals/hooks/useField/useField.types.d.ts +4 -24
- package/internals/hooks/useField/useField.utils.js +24 -4
- package/internals/hooks/useField/useFieldState.js +7 -3
- package/internals/hooks/useMobilePicker/index.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +7 -7
- package/internals/hooks/useStaticPicker/index.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +5 -5
- package/internals/index.d.ts +7 -6
- package/internals/index.js +1 -0
- package/internals/models/props/basePickerProps.d.ts +4 -0
- package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.d.ts +3 -0
- package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +26 -0
- package/legacy/DateField/DateField.js +19 -47
- package/legacy/DateField/useDateField.js +1 -4
- package/legacy/DatePicker/DatePicker.js +5 -1
- package/legacy/DateTimeField/DateTimeField.js +19 -47
- package/legacy/DateTimeField/useDateTimeField.js +1 -4
- package/legacy/DateTimePicker/DateTimePicker.js +5 -1
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +7 -2
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +5 -1
- package/legacy/MobileDatePicker/MobileDatePicker.js +7 -2
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
- package/legacy/MobileTimePicker/MobileTimePicker.js +5 -1
- package/legacy/PickersSectionList/PickersSectionList.js +230 -0
- package/legacy/PickersSectionList/index.js +2 -0
- package/legacy/PickersSectionList/pickersSectionListClasses.js +6 -0
- package/legacy/StaticDatePicker/StaticDatePicker.js +1 -1
- package/legacy/TimeField/TimeField.js +19 -47
- package/legacy/TimeField/useTimeField.js +1 -4
- package/legacy/TimePicker/TimePicker.js +5 -1
- package/legacy/hooks/useClearableField.js +30 -32
- package/legacy/index.js +4 -1
- package/legacy/internals/components/PickersArrowSwitcher/index.js +2 -1
- package/legacy/internals/components/{PickersTextField → PickersInput}/Outline.js +40 -22
- package/legacy/internals/components/PickersInput/PickersFilledInput.js +161 -0
- package/legacy/internals/components/{PickersTextField → PickersInput}/PickersInput.js +75 -90
- package/legacy/internals/components/PickersInput/PickersInput.types.js +1 -0
- package/legacy/internals/components/PickersInput/PickersOutlinedInput.js +110 -0
- package/legacy/internals/components/PickersInput/PickersStandardInput.js +117 -0
- package/legacy/internals/components/PickersInput/index.js +3 -0
- package/legacy/internals/components/PickersInput/pickersInputClasses.js +18 -0
- package/legacy/internals/components/PickersTextField/PickersTextField.js +16 -7
- package/legacy/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
- package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
- package/legacy/internals/hooks/useField/useField.js +12 -5
- package/legacy/internals/hooks/useField/useField.utils.js +26 -4
- package/legacy/internals/hooks/useField/useFieldState.js +7 -3
- package/legacy/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
- package/legacy/internals/index.js +1 -0
- package/legacy/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +24 -0
- package/legacy/locales/ruRU.js +1 -2
- package/locales/ruRU.js +1 -2
- package/models/fields.d.ts +2 -1
- package/modern/DateField/DateField.js +17 -50
- package/modern/DateField/useDateField.js +1 -5
- package/modern/DatePicker/DatePicker.js +5 -1
- package/modern/DateTimeField/DateTimeField.js +17 -50
- package/modern/DateTimeField/useDateTimeField.js +1 -5
- package/modern/DateTimePicker/DateTimePicker.js +5 -1
- package/modern/DesktopDatePicker/DesktopDatePicker.js +7 -2
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
- package/modern/DesktopTimePicker/DesktopTimePicker.js +5 -1
- package/modern/MobileDatePicker/MobileDatePicker.js +7 -2
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
- package/modern/MobileTimePicker/MobileTimePicker.js +5 -1
- package/modern/PickersSectionList/PickersSectionList.js +221 -0
- package/modern/PickersSectionList/PickersSectionList.types.js +1 -0
- package/modern/PickersSectionList/index.js +2 -0
- package/modern/PickersSectionList/pickersSectionListClasses.js +6 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
- package/modern/TimeField/TimeField.js +17 -50
- package/modern/TimeField/useTimeField.js +1 -5
- package/modern/TimePicker/TimePicker.js +5 -1
- package/modern/hooks/useClearableField.js +32 -33
- package/modern/index.js +4 -1
- package/modern/internals/components/PickersArrowSwitcher/index.js +2 -1
- package/modern/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
- package/modern/internals/components/PickersInput/PickersFilledInput.js +165 -0
- package/modern/internals/components/{PickersTextField → PickersInput}/PickersInput.js +78 -106
- package/modern/internals/components/PickersInput/PickersInput.types.js +1 -0
- package/modern/internals/components/PickersInput/PickersOutlinedInput.js +117 -0
- package/modern/internals/components/PickersInput/PickersStandardInput.js +123 -0
- package/modern/internals/components/PickersInput/index.js +3 -0
- package/modern/internals/components/PickersInput/pickersInputClasses.js +18 -0
- package/modern/internals/components/PickersTextField/PickersTextField.js +15 -6
- package/modern/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
- package/modern/internals/hooks/useField/useField.js +11 -4
- package/modern/internals/hooks/useField/useField.utils.js +24 -4
- package/modern/internals/hooks/useField/useFieldState.js +7 -3
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
- package/modern/internals/index.js +1 -0
- package/modern/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +26 -0
- package/modern/locales/ruRU.js +1 -2
- package/node/DateField/DateField.js +18 -51
- package/node/DateField/useDateField.js +1 -5
- package/node/DatePicker/DatePicker.js +5 -1
- package/node/DateTimeField/DateTimeField.js +18 -51
- package/node/DateTimeField/useDateTimeField.js +1 -5
- package/node/DateTimePicker/DateTimePicker.js +5 -1
- package/node/DesktopDatePicker/DesktopDatePicker.js +10 -5
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -1
- package/node/DesktopTimePicker/DesktopTimePicker.js +5 -1
- package/node/MobileDatePicker/MobileDatePicker.js +10 -5
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +5 -1
- package/node/MobileTimePicker/MobileTimePicker.js +5 -1
- package/node/PickersSectionList/PickersSectionList.js +228 -0
- package/node/PickersSectionList/index.js +49 -0
- package/node/PickersSectionList/pickersSectionListClasses.js +14 -0
- package/node/StaticDatePicker/StaticDatePicker.js +2 -2
- package/node/TimeField/TimeField.js +18 -51
- package/node/TimeField/useTimeField.js +1 -5
- package/node/TimePicker/TimePicker.js +5 -1
- package/node/hooks/useClearableField.js +33 -34
- package/node/index.js +13 -1
- package/node/internals/components/PickersArrowSwitcher/index.js +14 -1
- package/node/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
- package/node/internals/components/PickersInput/PickersFilledInput.js +174 -0
- package/node/internals/components/{PickersTextField → PickersInput}/PickersInput.js +80 -108
- package/node/internals/components/PickersInput/PickersInput.types.js +5 -0
- package/node/internals/components/PickersInput/PickersOutlinedInput.js +125 -0
- package/node/internals/components/PickersInput/PickersStandardInput.js +132 -0
- package/node/internals/components/PickersInput/index.js +32 -0
- package/node/internals/components/PickersInput/pickersInputClasses.js +29 -0
- package/node/internals/components/PickersTextField/PickersTextField.js +15 -6
- package/node/internals/components/PickersTextField/pickersTextFieldClasses.js +6 -9
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -0
- package/node/internals/hooks/useField/useField.js +11 -4
- package/node/internals/hooks/useField/useField.utils.js +24 -4
- package/node/internals/hooks/useField/useFieldState.js +7 -3
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +3 -1
- package/node/internals/index.js +7 -0
- package/node/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +34 -0
- package/node/locales/ruRU.js +1 -2
- package/package.json +5 -5
- package/themeAugmentation/overrides.d.ts +5 -7
- package/themeAugmentation/props.d.ts +6 -8
- package/internals/components/PickersTextField/PickersInput.d.ts +0 -3
- package/internals/components/PickersTextField/PickersInput.types.d.ts +0 -45
- /package/{internals/components/PickersTextField/PickersInput.types.js → PickersSectionList/PickersSectionList.types.js} +0 -0
- /package/{legacy/internals/components/PickersTextField → internals/components/PickersInput}/PickersInput.types.js +0 -0
- /package/{modern/internals/components/PickersTextField/PickersInput.types.js → legacy/PickersSectionList/PickersSectionList.types.js} +0 -0
- /package/node/{internals/components/PickersTextField/PickersInput.types.js → PickersSectionList/PickersSectionList.types.js} +0 -0
|
@@ -220,6 +220,10 @@ MobileDateTimePicker.propTypes = {
|
|
|
220
220
|
* @default 3
|
|
221
221
|
*/
|
|
222
222
|
monthsPerRow: PropTypes.oneOf([3, 4]),
|
|
223
|
+
/**
|
|
224
|
+
* Name attribute used by the `input` element in the Field.
|
|
225
|
+
*/
|
|
226
|
+
name: PropTypes.string,
|
|
223
227
|
/**
|
|
224
228
|
* Callback fired when the value is accepted.
|
|
225
229
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -318,7 +322,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
318
322
|
* 4. If `null` is provided, no section will be selected
|
|
319
323
|
* If not provided, the selected sections will be handled internally.
|
|
320
324
|
*/
|
|
321
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
325
|
+
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
322
326
|
endIndex: PropTypes.number.isRequired,
|
|
323
327
|
startIndex: PropTypes.number.isRequired
|
|
324
328
|
})]),
|
|
@@ -164,6 +164,10 @@ MobileTimePicker.propTypes = {
|
|
|
164
164
|
* @default 1
|
|
165
165
|
*/
|
|
166
166
|
minutesStep: PropTypes.number,
|
|
167
|
+
/**
|
|
168
|
+
* Name attribute used by the `input` element in the Field.
|
|
169
|
+
*/
|
|
170
|
+
name: PropTypes.string,
|
|
167
171
|
/**
|
|
168
172
|
* Callback fired when the value is accepted.
|
|
169
173
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -244,7 +248,7 @@ MobileTimePicker.propTypes = {
|
|
|
244
248
|
* 4. If `null` is provided, no section will be selected
|
|
245
249
|
* If not provided, the selected sections will be handled internally.
|
|
246
250
|
*/
|
|
247
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
251
|
+
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
248
252
|
endIndex: PropTypes.number.isRequired,
|
|
249
253
|
startIndex: PropTypes.number.isRequired
|
|
250
254
|
})]),
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["slots", "slotProps", "elements", "sectionListRef"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import styled from '@mui/system/styled';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { useSlotProps } from '@mui/base/utils';
|
|
8
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
+
import useForkRef from '@mui/utils/useForkRef';
|
|
10
|
+
import { getPickersSectionListUtilityClass, pickersSectionListClasses } from './pickersSectionListClasses';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export const PickersSectionListRoot = styled('div', {
|
|
14
|
+
name: 'MuiPickersSectionList',
|
|
15
|
+
slot: 'Root',
|
|
16
|
+
overridesResolver: (props, styles) => styles.root
|
|
17
|
+
})({
|
|
18
|
+
direction: 'ltr /*! @noflip */',
|
|
19
|
+
outline: 'none'
|
|
20
|
+
});
|
|
21
|
+
export const PickersSectionListSection = styled('span', {
|
|
22
|
+
name: 'MuiPickersSectionList',
|
|
23
|
+
slot: 'Section',
|
|
24
|
+
overridesResolver: (props, styles) => styles.section
|
|
25
|
+
})({});
|
|
26
|
+
export const PickersSectionListSectionSeparator = styled('span', {
|
|
27
|
+
name: 'MuiPickersSectionList',
|
|
28
|
+
slot: 'SectionSeparator',
|
|
29
|
+
overridesResolver: (props, styles) => styles.sectionSeparator
|
|
30
|
+
})({
|
|
31
|
+
whiteSpace: 'pre'
|
|
32
|
+
});
|
|
33
|
+
export const PickersSectionListSectionContent = styled('span', {
|
|
34
|
+
name: 'MuiPickersSectionList',
|
|
35
|
+
slot: 'SectionContent',
|
|
36
|
+
overridesResolver: (props, styles) => styles.sectionContent
|
|
37
|
+
})({
|
|
38
|
+
outline: 'none'
|
|
39
|
+
});
|
|
40
|
+
const useUtilityClasses = ownerState => {
|
|
41
|
+
const {
|
|
42
|
+
classes
|
|
43
|
+
} = ownerState;
|
|
44
|
+
const slots = {
|
|
45
|
+
root: ['root'],
|
|
46
|
+
section: ['section'],
|
|
47
|
+
sectionContent: ['sectionContent']
|
|
48
|
+
};
|
|
49
|
+
return composeClasses(slots, getPickersSectionListUtilityClass, classes);
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Demos:
|
|
53
|
+
*
|
|
54
|
+
* - [Custom field](https://mui.com/x/react-date-pickers/custom-field/)
|
|
55
|
+
*
|
|
56
|
+
* API:
|
|
57
|
+
*
|
|
58
|
+
* - [PickersSectionList API](https://mui.com/x/api/date-pickers/pickers-section-list/)
|
|
59
|
+
*/
|
|
60
|
+
function PickersSection(props) {
|
|
61
|
+
const {
|
|
62
|
+
slots,
|
|
63
|
+
slotProps,
|
|
64
|
+
element,
|
|
65
|
+
classes
|
|
66
|
+
} = props;
|
|
67
|
+
const Section = slots?.section ?? PickersSectionListSection;
|
|
68
|
+
const sectionProps = useSlotProps({
|
|
69
|
+
elementType: Section,
|
|
70
|
+
externalSlotProps: slotProps?.section,
|
|
71
|
+
externalForwardedProps: element.container,
|
|
72
|
+
className: classes.section,
|
|
73
|
+
ownerState: {}
|
|
74
|
+
});
|
|
75
|
+
const SectionContent = slots?.sectionContent ?? PickersSectionListSectionContent;
|
|
76
|
+
const sectionContentProps = useSlotProps({
|
|
77
|
+
elementType: SectionContent,
|
|
78
|
+
externalSlotProps: slotProps?.sectionContent,
|
|
79
|
+
externalForwardedProps: element.content,
|
|
80
|
+
additionalProps: {
|
|
81
|
+
suppressContentEditableWarning: true
|
|
82
|
+
},
|
|
83
|
+
className: classes.sectionContent,
|
|
84
|
+
ownerState: {}
|
|
85
|
+
});
|
|
86
|
+
const SectionSeparator = slots?.sectionSeparator ?? PickersSectionListSectionSeparator;
|
|
87
|
+
const sectionSeparatorBeforeProps = useSlotProps({
|
|
88
|
+
elementType: SectionSeparator,
|
|
89
|
+
externalSlotProps: slotProps?.sectionSeparator,
|
|
90
|
+
externalForwardedProps: element.before,
|
|
91
|
+
ownerState: {
|
|
92
|
+
position: 'before'
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const sectionSeparatorAfterProps = useSlotProps({
|
|
96
|
+
elementType: SectionSeparator,
|
|
97
|
+
externalSlotProps: slotProps?.sectionSeparator,
|
|
98
|
+
externalForwardedProps: element.after,
|
|
99
|
+
ownerState: {
|
|
100
|
+
position: 'after'
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return /*#__PURE__*/_jsxs(Section, _extends({}, sectionProps, {
|
|
104
|
+
children: [/*#__PURE__*/_jsx(SectionSeparator, _extends({}, sectionSeparatorBeforeProps)), /*#__PURE__*/_jsx(SectionContent, _extends({}, sectionContentProps)), /*#__PURE__*/_jsx(SectionSeparator, _extends({}, sectionSeparatorAfterProps))]
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
const PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(props, ref) {
|
|
108
|
+
const {
|
|
109
|
+
slots,
|
|
110
|
+
slotProps,
|
|
111
|
+
elements,
|
|
112
|
+
sectionListRef
|
|
113
|
+
} = props,
|
|
114
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
115
|
+
const classes = useUtilityClasses(props);
|
|
116
|
+
const rootRef = React.useRef(null);
|
|
117
|
+
const handleRootRef = useForkRef(ref, rootRef);
|
|
118
|
+
const getRoot = methodName => {
|
|
119
|
+
if (!rootRef.current) {
|
|
120
|
+
throw new Error(`MUI: Cannot call sectionListRef.${methodName} before the mount of the component`);
|
|
121
|
+
}
|
|
122
|
+
return rootRef.current;
|
|
123
|
+
};
|
|
124
|
+
React.useImperativeHandle(sectionListRef, () => ({
|
|
125
|
+
getRoot() {
|
|
126
|
+
return getRoot('getRoot');
|
|
127
|
+
},
|
|
128
|
+
getSectionContainer(index) {
|
|
129
|
+
const root = getRoot('getSectionContainer');
|
|
130
|
+
return root.querySelector(`.${pickersSectionListClasses.section}[data-sectionindex="${index}"]`);
|
|
131
|
+
},
|
|
132
|
+
getSectionContent(index) {
|
|
133
|
+
const root = getRoot('getSectionContent');
|
|
134
|
+
return root.querySelector(`.${pickersSectionListClasses.section}[data-sectionindex="${index}"] .${pickersSectionListClasses.sectionContent}`);
|
|
135
|
+
},
|
|
136
|
+
getSectionIndexFromDOMElement(element) {
|
|
137
|
+
const root = getRoot('getSectionIndexFromDOMElement');
|
|
138
|
+
if (element == null || !root.contains(element)) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
let sectionContainer = null;
|
|
142
|
+
if (element.classList.contains(pickersSectionListClasses.section)) {
|
|
143
|
+
sectionContainer = element;
|
|
144
|
+
} else if (element.classList.contains(pickersSectionListClasses.sectionContent)) {
|
|
145
|
+
sectionContainer = element.parentElement;
|
|
146
|
+
}
|
|
147
|
+
if (sectionContainer == null) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
return Number(sectionContainer.dataset.sectionindex);
|
|
151
|
+
}
|
|
152
|
+
}));
|
|
153
|
+
const Root = slots?.root ?? PickersSectionListRoot;
|
|
154
|
+
const rootProps = useSlotProps({
|
|
155
|
+
elementType: Root,
|
|
156
|
+
externalSlotProps: slotProps?.root,
|
|
157
|
+
externalForwardedProps: other,
|
|
158
|
+
additionalProps: {
|
|
159
|
+
ref: handleRootRef,
|
|
160
|
+
suppressContentEditableWarning: true
|
|
161
|
+
},
|
|
162
|
+
className: classes.root,
|
|
163
|
+
ownerState: {}
|
|
164
|
+
});
|
|
165
|
+
return /*#__PURE__*/_jsx(Root, _extends({}, rootProps, {
|
|
166
|
+
children: rootProps.contentEditable ? elements.map(({
|
|
167
|
+
content,
|
|
168
|
+
before,
|
|
169
|
+
after
|
|
170
|
+
}) => `${before.children}${content.children}${after.children}`).join('') : /*#__PURE__*/_jsx(React.Fragment, {
|
|
171
|
+
children: elements.map((element, elementIndex) => /*#__PURE__*/_jsx(PickersSection, {
|
|
172
|
+
slots: slots,
|
|
173
|
+
slotProps: slotProps,
|
|
174
|
+
element: element,
|
|
175
|
+
classes: classes
|
|
176
|
+
}, elementIndex))
|
|
177
|
+
})
|
|
178
|
+
}));
|
|
179
|
+
});
|
|
180
|
+
process.env.NODE_ENV !== "production" ? PickersSectionList.propTypes = {
|
|
181
|
+
// ----------------------------- Warning --------------------------------
|
|
182
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
183
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
184
|
+
// ----------------------------------------------------------------------
|
|
185
|
+
/**
|
|
186
|
+
* Override or extend the styles applied to the component.
|
|
187
|
+
*/
|
|
188
|
+
classes: PropTypes.object,
|
|
189
|
+
/**
|
|
190
|
+
* If true, the whole element is editable.
|
|
191
|
+
* Useful when all the sections are selected.
|
|
192
|
+
*/
|
|
193
|
+
contentEditable: PropTypes.bool.isRequired,
|
|
194
|
+
/**
|
|
195
|
+
* The elements to render.
|
|
196
|
+
* Each element contains the prop to edit a section of the value.
|
|
197
|
+
*/
|
|
198
|
+
elements: PropTypes.arrayOf(PropTypes.shape({
|
|
199
|
+
after: PropTypes.object.isRequired,
|
|
200
|
+
before: PropTypes.object.isRequired,
|
|
201
|
+
container: PropTypes.object.isRequired,
|
|
202
|
+
content: PropTypes.object.isRequired
|
|
203
|
+
})).isRequired,
|
|
204
|
+
sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
205
|
+
current: PropTypes.shape({
|
|
206
|
+
getRoot: PropTypes.func.isRequired,
|
|
207
|
+
getSectionContainer: PropTypes.func.isRequired,
|
|
208
|
+
getSectionContent: PropTypes.func.isRequired,
|
|
209
|
+
getSectionIndexFromDOMElement: PropTypes.func.isRequired
|
|
210
|
+
})
|
|
211
|
+
})]),
|
|
212
|
+
/**
|
|
213
|
+
* The props used for each component slot.
|
|
214
|
+
*/
|
|
215
|
+
slotProps: PropTypes.object,
|
|
216
|
+
/**
|
|
217
|
+
* Overridable component slots.
|
|
218
|
+
*/
|
|
219
|
+
slots: PropTypes.object
|
|
220
|
+
} : void 0;
|
|
221
|
+
export { PickersSectionList };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { PickersSectionList as Unstable_PickersSectionList, PickersSectionListRoot as Unstable_PickersSectionListRoot, PickersSectionListSection as Unstable_PickersSectionListSection, PickersSectionListSectionSeparator as Unstable_PickersSectionListSectionSeparator, PickersSectionListSectionContent as Unstable_PickersSectionListSectionContent } from './PickersSectionList';
|
|
2
|
+
export { getPickersSectionListUtilityClass, pickersSectionListClasses } from './pickersSectionListClasses';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
3
|
+
export function getPickersSectionListUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiPickersSectionList', slot);
|
|
5
|
+
}
|
|
6
|
+
export const pickersSectionListClasses = generateUtilityClasses('MuiPickersSectionList', ['root', 'section', 'sectionContent']);
|
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
|
|
5
5
|
import { renderDateViewCalendar } from '../dateViewRenderers';
|
|
6
6
|
import { useStaticPicker } from '../internals/hooks/useStaticPicker';
|
|
7
|
-
import { validateDate } from '../internals';
|
|
7
|
+
import { validateDate } from '../internals/utils/validation/validateDate';
|
|
8
8
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
9
9
|
/**
|
|
10
10
|
* Demos:
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "InputProps", "inputProps"]
|
|
4
|
-
_excluded2 = ["inputRef"],
|
|
5
|
-
_excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly", "clearable", "onClear"];
|
|
3
|
+
const _excluded = ["slots", "slotProps", "InputProps", "inputProps"];
|
|
6
4
|
import * as React from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import MuiTextField from '@mui/material/TextField';
|
|
@@ -11,6 +9,7 @@ import { useSlotProps } from '@mui/base/utils';
|
|
|
11
9
|
import { refType } from '@mui/utils';
|
|
12
10
|
import { useTimeField } from './useTimeField';
|
|
13
11
|
import { useClearableField } from '../hooks';
|
|
12
|
+
import { convertFieldResponseIntoMuiTextFieldProps } from '../internals/utils/convertFieldResponseIntoMuiTextFieldProps';
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
14
|
/**
|
|
16
15
|
* Demos:
|
|
@@ -22,7 +21,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
22
21
|
*
|
|
23
22
|
* - [TimeField API](https://mui.com/x/api/date-pickers/time-field/)
|
|
24
23
|
*/
|
|
25
|
-
const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps,
|
|
24
|
+
const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, inRef) {
|
|
26
25
|
const themeProps = useThemeProps({
|
|
27
26
|
props: inProps,
|
|
28
27
|
name: 'MuiTimeField'
|
|
@@ -36,58 +35,26 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, ref)
|
|
|
36
35
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
37
36
|
const ownerState = themeProps;
|
|
38
37
|
const TextField = slots?.textField ?? MuiTextField;
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
38
|
+
const textFieldProps = useSlotProps({
|
|
39
|
+
elementType: TextField,
|
|
40
|
+
externalSlotProps: slotProps?.textField,
|
|
41
|
+
externalForwardedProps: other,
|
|
42
|
+
ownerState,
|
|
43
|
+
additionalProps: {
|
|
44
|
+
ref: inRef
|
|
45
|
+
}
|
|
46
|
+
});
|
|
49
47
|
|
|
50
48
|
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
51
49
|
textFieldProps.inputProps = _extends({}, inputProps, textFieldProps.inputProps);
|
|
52
50
|
textFieldProps.InputProps = _extends({}, InputProps, textFieldProps.InputProps);
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}),
|
|
57
|
-
{
|
|
58
|
-
ref: inputRef,
|
|
59
|
-
onPaste,
|
|
60
|
-
onKeyDown,
|
|
61
|
-
inputMode,
|
|
62
|
-
readOnly,
|
|
63
|
-
clearable,
|
|
64
|
-
onClear
|
|
65
|
-
} = _useTimeField,
|
|
66
|
-
fieldProps = _objectWithoutPropertiesLoose(_useTimeField, _excluded3);
|
|
67
|
-
const {
|
|
68
|
-
InputProps: ProcessedInputProps,
|
|
69
|
-
fieldProps: processedFieldProps
|
|
70
|
-
} = useClearableField({
|
|
71
|
-
onClear,
|
|
72
|
-
clearable,
|
|
73
|
-
fieldProps,
|
|
74
|
-
InputProps: fieldProps.InputProps,
|
|
51
|
+
const fieldResponse = useTimeField(textFieldProps);
|
|
52
|
+
const convertedFieldResponse = convertFieldResponseIntoMuiTextFieldProps(fieldResponse);
|
|
53
|
+
const processedFieldProps = useClearableField(_extends({}, convertedFieldResponse, {
|
|
75
54
|
slots,
|
|
76
55
|
slotProps
|
|
77
|
-
});
|
|
78
|
-
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
79
|
-
ref: ref
|
|
80
|
-
}, processedFieldProps, {
|
|
81
|
-
InputProps: _extends({}, ProcessedInputProps, {
|
|
82
|
-
readOnly
|
|
83
|
-
}),
|
|
84
|
-
inputProps: _extends({}, fieldProps.inputProps, {
|
|
85
|
-
inputMode,
|
|
86
|
-
onPaste,
|
|
87
|
-
onKeyDown,
|
|
88
|
-
ref: inputRef
|
|
89
|
-
})
|
|
90
56
|
}));
|
|
57
|
+
return /*#__PURE__*/_jsx(TextField, _extends({}, processedFieldProps));
|
|
91
58
|
});
|
|
92
59
|
process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
93
60
|
// ----------------------------- Warning --------------------------------
|
|
@@ -282,7 +249,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
282
249
|
* 4. If `null` is provided, no section will be selected
|
|
283
250
|
* If not provided, the selected sections will be handled internally.
|
|
284
251
|
*/
|
|
285
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
252
|
+
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
286
253
|
endIndex: PropTypes.number.isRequired,
|
|
287
254
|
startIndex: PropTypes.number.isRequired
|
|
288
255
|
})]),
|
|
@@ -14,17 +14,13 @@ const useDefaultizedTimeField = props => {
|
|
|
14
14
|
format: props.format ?? defaultFormat
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
-
export const useTimeField =
|
|
18
|
-
props: inProps,
|
|
19
|
-
inputRef
|
|
20
|
-
}) => {
|
|
17
|
+
export const useTimeField = inProps => {
|
|
21
18
|
const props = useDefaultizedTimeField(inProps);
|
|
22
19
|
const {
|
|
23
20
|
forwardedProps,
|
|
24
21
|
internalProps
|
|
25
22
|
} = splitFieldInternalAndForwardedProps(props, 'time');
|
|
26
23
|
return useField({
|
|
27
|
-
inputRef,
|
|
28
24
|
forwardedProps,
|
|
29
25
|
internalProps,
|
|
30
26
|
valueManager: singleItemValueManager,
|
|
@@ -149,6 +149,10 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
149
149
|
* @default 1
|
|
150
150
|
*/
|
|
151
151
|
minutesStep: PropTypes.number,
|
|
152
|
+
/**
|
|
153
|
+
* Name attribute used by the `input` element in the Field.
|
|
154
|
+
*/
|
|
155
|
+
name: PropTypes.string,
|
|
152
156
|
/**
|
|
153
157
|
* Callback fired when the value is accepted.
|
|
154
158
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -229,7 +233,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
229
233
|
* 4. If `null` is provided, no section will be selected
|
|
230
234
|
* If not provided, the selected sections will be handled internally.
|
|
231
235
|
*/
|
|
232
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
236
|
+
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
233
237
|
endIndex: PropTypes.number.isRequired,
|
|
234
238
|
startIndex: PropTypes.number.isRequired
|
|
235
239
|
})]),
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["clearable", "onClear", "InputProps", "sx", "slots", "slotProps"],
|
|
4
|
+
_excluded2 = ["ownerState"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import { useSlotProps } from '@mui/base/utils';
|
|
6
7
|
import MuiIconButton from '@mui/material/IconButton';
|
|
7
8
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
8
9
|
import { ClearIcon } from '../icons';
|
|
9
|
-
import { useLocaleText } from '../internals';
|
|
10
|
+
import { useLocaleText } from '../internals/hooks/useUtils';
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
export const useClearableField =
|
|
13
|
-
clearable,
|
|
14
|
-
fieldProps: forwardedFieldProps,
|
|
15
|
-
InputProps: ForwardedInputProps,
|
|
16
|
-
onClear,
|
|
17
|
-
slots,
|
|
18
|
-
slotProps
|
|
19
|
-
}) => {
|
|
13
|
+
export const useClearableField = props => {
|
|
20
14
|
const localeText = useLocaleText();
|
|
15
|
+
const {
|
|
16
|
+
clearable,
|
|
17
|
+
onClear,
|
|
18
|
+
InputProps,
|
|
19
|
+
sx,
|
|
20
|
+
slots,
|
|
21
|
+
slotProps
|
|
22
|
+
} = props,
|
|
23
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
24
|
const IconButton = slots?.clearButton ?? MuiIconButton;
|
|
22
25
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
23
26
|
const _useSlotProps = useSlotProps({
|
|
@@ -29,30 +32,30 @@ export const useClearableField = ({
|
|
|
29
32
|
title: localeText.fieldClearLabel
|
|
30
33
|
}
|
|
31
34
|
}),
|
|
32
|
-
iconButtonProps = _objectWithoutPropertiesLoose(_useSlotProps,
|
|
35
|
+
iconButtonProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
33
36
|
const EndClearIcon = slots?.clearIcon ?? ClearIcon;
|
|
34
37
|
const endClearIconProps = useSlotProps({
|
|
35
38
|
elementType: EndClearIcon,
|
|
36
39
|
externalSlotProps: slotProps?.clearIcon,
|
|
37
40
|
ownerState: {}
|
|
38
41
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
return _extends({}, other, {
|
|
43
|
+
InputProps: _extends({}, InputProps, {
|
|
44
|
+
endAdornment: clearable ? /*#__PURE__*/_jsxs(React.Fragment, {
|
|
45
|
+
children: [/*#__PURE__*/_jsx(InputAdornment, {
|
|
46
|
+
position: "end",
|
|
47
|
+
sx: {
|
|
48
|
+
marginRight: InputProps?.endAdornment ? -1 : -1.5
|
|
49
|
+
},
|
|
50
|
+
children: /*#__PURE__*/_jsx(IconButton, _extends({}, iconButtonProps, {
|
|
51
|
+
onClick: onClear,
|
|
52
|
+
children: /*#__PURE__*/_jsx(EndClearIcon, _extends({
|
|
53
|
+
fontSize: "small"
|
|
54
|
+
}, endClearIconProps))
|
|
55
|
+
}))
|
|
56
|
+
}), InputProps?.endAdornment]
|
|
57
|
+
}) : InputProps?.endAdornment
|
|
58
|
+
}),
|
|
56
59
|
sx: [{
|
|
57
60
|
'& .clearButton': {
|
|
58
61
|
opacity: 1
|
|
@@ -67,10 +70,6 @@ export const useClearableField = ({
|
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
|
-
}, ...(Array.isArray(
|
|
73
|
+
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
71
74
|
});
|
|
72
|
-
return {
|
|
73
|
-
InputProps,
|
|
74
|
-
fieldProps
|
|
75
|
-
};
|
|
76
75
|
};
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers v7.0.0-alpha.
|
|
2
|
+
* @mui/x-date-pickers v7.0.0-alpha.6
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -49,6 +49,9 @@ export * from './PickersShortcuts';
|
|
|
49
49
|
|
|
50
50
|
// Other slots
|
|
51
51
|
export * from './PickersCalendarHeader';
|
|
52
|
+
|
|
53
|
+
// Field utilities
|
|
54
|
+
export * from './PickersSectionList';
|
|
52
55
|
export { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from './internals/utils/utils';
|
|
53
56
|
export * from './models';
|
|
54
57
|
export * from './icons';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { PickersArrowSwitcher } from './PickersArrowSwitcher';
|
|
1
|
+
export { PickersArrowSwitcher } from './PickersArrowSwitcher';
|
|
2
|
+
export { pickersArrowSwitcherClasses, getPickersArrowSwitcherUtilityClass } from './pickersArrowSwitcherClasses';
|
|
@@ -4,22 +4,38 @@ const _excluded = ["children", "className", "label"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { styled } from '@mui/material/styles';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const OutlineRoot = styled('fieldset'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
const OutlineRoot = styled('fieldset', {
|
|
8
|
+
name: 'MuiPickersOutlinedInput',
|
|
9
|
+
slot: 'NotchedOutline',
|
|
10
|
+
overridesResolver: (props, styles) => styles.notchedOutline
|
|
11
|
+
})(({
|
|
12
|
+
theme
|
|
13
|
+
}) => {
|
|
14
|
+
const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
15
|
+
return {
|
|
16
|
+
textAlign: 'left',
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
bottom: 0,
|
|
19
|
+
right: 0,
|
|
20
|
+
top: -5,
|
|
21
|
+
left: 0,
|
|
22
|
+
margin: 0,
|
|
23
|
+
padding: '0 8px',
|
|
24
|
+
pointerEvents: 'none',
|
|
25
|
+
borderRadius: 'inherit',
|
|
26
|
+
borderStyle: 'solid',
|
|
27
|
+
borderWidth: 1,
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
minWidth: '0%',
|
|
30
|
+
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
31
|
+
};
|
|
22
32
|
});
|
|
33
|
+
const OutlineLabel = styled('span')(({
|
|
34
|
+
theme
|
|
35
|
+
}) => ({
|
|
36
|
+
fontFamily: theme.typography.fontFamily,
|
|
37
|
+
fontSize: 'inherit'
|
|
38
|
+
}));
|
|
23
39
|
const OutlineLegend = styled('legend')(({
|
|
24
40
|
ownerState,
|
|
25
41
|
theme
|
|
@@ -78,17 +94,17 @@ export default function Outline(props) {
|
|
|
78
94
|
});
|
|
79
95
|
return /*#__PURE__*/_jsx(OutlineRoot, _extends({
|
|
80
96
|
"aria-hidden": true,
|
|
81
|
-
className: className
|
|
82
|
-
ownerState: ownerState
|
|
97
|
+
className: className
|
|
83
98
|
}, other, {
|
|
99
|
+
ownerState: ownerState,
|
|
84
100
|
children: /*#__PURE__*/_jsx(OutlineLegend, {
|
|
85
101
|
ownerState: ownerState,
|
|
86
|
-
children: withLabel ? /*#__PURE__*/_jsx(
|
|
102
|
+
children: withLabel ? /*#__PURE__*/_jsx(OutlineLabel, {
|
|
87
103
|
children: label
|
|
88
104
|
}) :
|
|
89
105
|
/*#__PURE__*/
|
|
90
106
|
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
91
|
-
_jsx(
|
|
107
|
+
_jsx(OutlineLabel, {
|
|
92
108
|
className: "notranslate",
|
|
93
109
|
children: "\u200B"
|
|
94
110
|
})
|