@mui/x-date-pickers 8.0.0-alpha.12 → 8.0.0-alpha.13
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/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.ts +1 -1
- package/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +96 -94
- package/AdapterDateFnsV2/AdapterDateFnsV2.d.ts +1 -1
- package/AdapterDateFnsV2/AdapterDateFnsV2.js +96 -94
- package/AdapterDayjs/AdapterDayjs.js +11 -5
- package/CHANGELOG.md +299 -0
- package/DateCalendar/DateCalendar.js +1 -1
- package/DateField/useDateField.d.ts +1 -1
- package/DatePicker/DatePicker.types.d.ts +2 -2
- package/DateTimeField/useDateTimeField.d.ts +1 -1
- package/DateTimePicker/DateTimePicker.types.d.ts +2 -2
- package/TimeClock/Clock.js +2 -2
- package/TimeClock/ClockPointer.js +1 -1
- package/TimeField/useTimeField.d.ts +1 -1
- package/TimePicker/TimePicker.types.d.ts +2 -2
- package/esm/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.ts +1 -1
- package/esm/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +47 -45
- package/esm/AdapterDateFnsV2/AdapterDateFnsV2.d.ts +1 -1
- package/esm/AdapterDateFnsV2/AdapterDateFnsV2.js +47 -45
- package/esm/AdapterDayjs/AdapterDayjs.js +9 -5
- package/esm/DateCalendar/DateCalendar.js +1 -1
- package/esm/DateField/useDateField.d.ts +1 -1
- package/esm/DatePicker/DatePicker.types.d.ts +2 -2
- package/esm/DateTimeField/useDateTimeField.d.ts +1 -1
- package/esm/DateTimePicker/DateTimePicker.types.d.ts +2 -2
- package/esm/TimeClock/Clock.js +2 -2
- package/esm/TimeClock/ClockPointer.js +1 -1
- package/esm/TimeField/useTimeField.d.ts +1 -1
- package/esm/TimePicker/TimePicker.types.d.ts +2 -2
- package/esm/hooks/useSplitFieldProps.d.ts +1 -1
- package/esm/hooks/useSplitFieldProps.js +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/components/PickerFieldUI.d.ts +7 -0
- package/esm/internals/components/PickerFieldUI.js +2 -2
- package/esm/internals/components/PickerPopper/PickerPopper.d.ts +0 -3
- package/esm/internals/components/PickerPopper/PickerPopper.js +26 -14
- package/esm/internals/components/PickerProvider.d.ts +21 -1
- package/esm/internals/components/PickerProvider.js +7 -2
- package/esm/internals/demo/DemoContainer.js +3 -3
- package/esm/internals/hooks/useDesktopPicker/useDesktopPicker.js +5 -22
- package/esm/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +0 -5
- package/esm/internals/hooks/useField/index.d.ts +1 -2
- package/esm/internals/hooks/useField/useField.types.d.ts +10 -4
- package/esm/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.ts +9 -9
- package/esm/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +16 -8
- package/esm/internals/hooks/useField/useFieldV6TextField.js +8 -6
- package/esm/internals/hooks/useField/useFieldV7TextField.js +7 -7
- package/esm/internals/hooks/useMobilePicker/useMobilePicker.js +5 -21
- package/esm/internals/hooks/useNullableFieldPrivateContext.d.ts +6 -0
- package/esm/internals/hooks/useNullableFieldPrivateContext.js +5 -0
- package/esm/internals/hooks/usePicker/usePicker.d.ts +1 -1
- package/esm/internals/hooks/usePicker/usePicker.js +2 -2
- package/esm/internals/hooks/usePicker/usePicker.types.d.ts +1 -1
- package/esm/internals/hooks/usePicker/usePickerProvider.d.ts +8 -3
- package/esm/internals/hooks/usePicker/usePickerProvider.js +20 -6
- package/esm/internals/hooks/usePicker/usePickerViews.d.ts +20 -3
- package/esm/internals/hooks/usePicker/usePickerViews.js +20 -8
- package/esm/internals/hooks/useStaticPicker/useStaticPicker.js +3 -2
- package/esm/internals/index.d.ts +4 -3
- package/esm/internals/index.js +2 -1
- package/esm/internals/models/fields.d.ts +3 -10
- package/esm/locales/bnBD.d.ts +80 -0
- package/esm/locales/bnBD.js +73 -0
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/esm/models/fields.d.ts +2 -2
- package/esm/validation/extractValidationProps.d.ts +1 -1
- package/esm/validation/index.d.ts +1 -1
- package/esm/validation/useValidation.d.ts +1 -1
- package/hooks/useSplitFieldProps.d.ts +1 -1
- package/hooks/useSplitFieldProps.js +1 -1
- package/index.js +1 -1
- package/internals/components/PickerFieldUI.d.ts +7 -0
- package/internals/components/PickerFieldUI.js +3 -1
- package/internals/components/PickerPopper/PickerPopper.d.ts +0 -3
- package/internals/components/PickerPopper/PickerPopper.js +25 -13
- package/internals/components/PickerProvider.d.ts +21 -1
- package/internals/components/PickerProvider.js +8 -3
- package/internals/demo/DemoContainer.js +3 -3
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +5 -22
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +0 -5
- package/internals/hooks/useField/index.d.ts +1 -2
- package/internals/hooks/useField/useField.types.d.ts +10 -4
- package/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.ts +9 -9
- package/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +16 -10
- package/internals/hooks/useField/useFieldV6TextField.js +8 -6
- package/internals/hooks/useField/useFieldV7TextField.js +7 -7
- package/internals/hooks/useMobilePicker/useMobilePicker.js +5 -21
- package/internals/hooks/useNullableFieldPrivateContext.d.ts +6 -0
- package/internals/hooks/useNullableFieldPrivateContext.js +13 -0
- package/internals/hooks/usePicker/usePicker.d.ts +1 -1
- package/internals/hooks/usePicker/usePicker.js +2 -2
- package/internals/hooks/usePicker/usePicker.types.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerProvider.d.ts +8 -3
- package/internals/hooks/usePicker/usePickerProvider.js +20 -6
- package/internals/hooks/usePicker/usePickerViews.d.ts +20 -3
- package/internals/hooks/usePicker/usePickerViews.js +20 -8
- package/internals/hooks/useStaticPicker/useStaticPicker.js +3 -2
- package/internals/index.d.ts +4 -3
- package/internals/index.js +19 -0
- package/internals/models/fields.d.ts +3 -10
- package/locales/bnBD.d.ts +80 -0
- package/locales/bnBD.js +79 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +11 -0
- package/models/fields.d.ts +2 -2
- package/modern/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.d.ts +1 -1
- package/modern/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +47 -45
- package/modern/AdapterDateFnsV2/AdapterDateFnsV2.d.ts +1 -1
- package/modern/AdapterDateFnsV2/AdapterDateFnsV2.js +47 -45
- package/modern/AdapterDayjs/AdapterDayjs.js +9 -5
- package/modern/DateCalendar/DateCalendar.js +1 -1
- package/modern/DateField/useDateField.d.ts +1 -1
- package/modern/DatePicker/DatePicker.types.d.ts +2 -2
- package/modern/DateTimeField/useDateTimeField.d.ts +1 -1
- package/modern/DateTimePicker/DateTimePicker.types.d.ts +2 -2
- package/modern/TimeClock/Clock.js +2 -2
- package/modern/TimeClock/ClockPointer.js +1 -1
- package/modern/TimeField/useTimeField.d.ts +1 -1
- package/modern/TimePicker/TimePicker.types.d.ts +2 -2
- package/modern/hooks/useSplitFieldProps.d.ts +1 -1
- package/modern/hooks/useSplitFieldProps.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/components/PickerFieldUI.d.ts +7 -0
- package/modern/internals/components/PickerFieldUI.js +2 -2
- package/modern/internals/components/PickerPopper/PickerPopper.d.ts +0 -3
- package/modern/internals/components/PickerPopper/PickerPopper.js +26 -14
- package/modern/internals/components/PickerProvider.d.ts +21 -1
- package/modern/internals/components/PickerProvider.js +7 -2
- package/modern/internals/demo/DemoContainer.js +3 -3
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +5 -22
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +0 -5
- package/modern/internals/hooks/useField/index.d.ts +1 -2
- package/modern/internals/hooks/useField/useField.types.d.ts +10 -4
- package/modern/internals/hooks/useField/useFieldInternalPropsWithDefaults.d.ts +9 -9
- package/modern/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +16 -8
- package/modern/internals/hooks/useField/useFieldV6TextField.js +8 -6
- package/modern/internals/hooks/useField/useFieldV7TextField.js +7 -7
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +5 -21
- package/modern/internals/hooks/useNullableFieldPrivateContext.d.ts +6 -0
- package/modern/internals/hooks/useNullableFieldPrivateContext.js +5 -0
- package/modern/internals/hooks/usePicker/usePicker.d.ts +1 -1
- package/modern/internals/hooks/usePicker/usePicker.js +2 -2
- package/modern/internals/hooks/usePicker/usePicker.types.d.ts +1 -1
- package/modern/internals/hooks/usePicker/usePickerProvider.d.ts +8 -3
- package/modern/internals/hooks/usePicker/usePickerProvider.js +20 -6
- package/modern/internals/hooks/usePicker/usePickerViews.d.ts +20 -3
- package/modern/internals/hooks/usePicker/usePickerViews.js +20 -8
- package/modern/internals/hooks/useStaticPicker/useStaticPicker.js +3 -2
- package/modern/internals/index.d.ts +4 -3
- package/modern/internals/index.js +2 -1
- package/modern/internals/models/fields.d.ts +3 -10
- package/modern/locales/bnBD.d.ts +80 -0
- package/modern/locales/bnBD.js +73 -0
- package/modern/locales/index.d.ts +1 -0
- package/modern/locales/index.js +1 -0
- package/modern/models/fields.d.ts +2 -2
- package/modern/validation/extractValidationProps.d.ts +1 -1
- package/modern/validation/index.d.ts +1 -1
- package/modern/validation/useValidation.d.ts +1 -1
- package/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/validation/extractValidationProps.d.ts +1 -1
- package/validation/index.d.ts +1 -1
- package/validation/useValidation.d.ts +1 -1
|
@@ -4,12 +4,17 @@ import { PickerProviderProps } from "../../components/PickerProvider.js";
|
|
|
4
4
|
import type { UsePickerProps } from './usePicker.types';
|
|
5
5
|
import { DateOrTimeViewWithMeridiem, FormProps, PickerOrientation, PickerValidValue, PickerVariant } from "../../models/index.js";
|
|
6
6
|
import { UsePickerViewsProviderParams } from "./usePickerViews.js";
|
|
7
|
-
import {
|
|
7
|
+
import type { UseFieldInternalProps } from '../useField';
|
|
8
|
+
import { ExportedBaseToolbarProps } from "../../models/props/toolbar.js";
|
|
8
9
|
export declare const usePickerOrientation: (views: readonly DateOrTimeViewWithMeridiem[], customOrientation: PickerOrientation | undefined) => PickerOrientation;
|
|
9
10
|
export declare function usePickerProvider<TValue extends PickerValidValue, TView extends DateOrTimeViewWithMeridiem, TError>(parameters: UsePickerProviderParameters<TValue, TView, TError>): UsePickerProviderReturnValue<TValue>;
|
|
10
11
|
export interface UsePickerProviderParameters<TValue extends PickerValidValue, TView extends DateOrTimeViewWithMeridiem, TError> extends Pick<PickerProviderProps<TValue>, 'localeText'> {
|
|
11
12
|
ref: React.ForwardedRef<HTMLDivElement> | undefined;
|
|
12
|
-
props: UsePickerProps<TValue, any, any, any> & UsePickerProviderNonStaticProps
|
|
13
|
+
props: UsePickerProps<TValue, any, any, any> & UsePickerProviderNonStaticProps & {
|
|
14
|
+
slotProps?: {
|
|
15
|
+
toolbar?: ExportedBaseToolbarProps;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
13
18
|
valueManager: PickerValueManager<TValue, any>;
|
|
14
19
|
variant: PickerVariant;
|
|
15
20
|
paramsFromUsePickerValue: UsePickerValueProviderParams<TValue, TError>;
|
|
@@ -34,7 +39,7 @@ export interface UsePickerProviderProps extends FormProps {
|
|
|
34
39
|
/**
|
|
35
40
|
* Props used to create the picker's contexts and that are not available on static pickers.
|
|
36
41
|
*/
|
|
37
|
-
export interface UsePickerProviderNonStaticProps extends
|
|
42
|
+
export interface UsePickerProviderNonStaticProps extends Pick<UseFieldInternalProps<any, any, any>, 'formatDensity' | 'enableAccessibleFieldDOMStructure' | 'selectedSections' | 'onSelectedSectionsChange'> {
|
|
38
43
|
/**
|
|
39
44
|
* Format of the date when rendered in the input(s).
|
|
40
45
|
* Defaults to localized format based on the used `views`.
|
|
@@ -10,6 +10,8 @@ exports.usePickerProvider = usePickerProvider;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
13
|
+
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
14
|
+
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
13
15
|
var _useUtils = require("../useUtils");
|
|
14
16
|
var _utils = require("../../utils/utils");
|
|
15
17
|
var _useReduceAnimations = require("../useReduceAnimations");
|
|
@@ -59,6 +61,14 @@ function usePickerProvider(parameters) {
|
|
|
59
61
|
const orientation = usePickerOrientation(paramsFromUsePickerViews.views, props.orientation);
|
|
60
62
|
const reduceAnimations = (0, _useReduceAnimations.useReduceAnimations)(props.reduceAnimations);
|
|
61
63
|
const triggerRef = React.useRef(null);
|
|
64
|
+
const popupRef = React.useRef(null);
|
|
65
|
+
const rootRefObject = React.useRef(null);
|
|
66
|
+
const rootRef = (0, _useForkRef.default)(ref, rootRefObject);
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* TODO: Improve how we generate the aria-label and aria-labelledby attributes.
|
|
70
|
+
*/
|
|
71
|
+
const labelId = (0, _useId.default)();
|
|
62
72
|
const ownerState = React.useMemo(() => ({
|
|
63
73
|
isPickerValueEmpty: valueManager.areValuesEqual(utils, paramsFromUsePickerValue.value, valueManager.emptyValue),
|
|
64
74
|
isPickerOpen: paramsFromUsePickerValue.contextValue.open,
|
|
@@ -79,8 +89,10 @@ function usePickerProvider(parameters) {
|
|
|
79
89
|
const contextValue = React.useMemo(() => (0, _extends2.default)({}, paramsFromUsePickerValue.contextValue, paramsFromUsePickerViews.contextValue, {
|
|
80
90
|
disabled: props.disabled ?? false,
|
|
81
91
|
readOnly: props.readOnly ?? false,
|
|
92
|
+
autoFocus: props.autoFocus ?? false,
|
|
82
93
|
variant,
|
|
83
94
|
orientation,
|
|
95
|
+
popupRef,
|
|
84
96
|
reduceAnimations,
|
|
85
97
|
triggerRef,
|
|
86
98
|
triggerStatus,
|
|
@@ -88,19 +100,21 @@ function usePickerProvider(parameters) {
|
|
|
88
100
|
name: props.name,
|
|
89
101
|
label: props.label,
|
|
90
102
|
rootSx: props.sx,
|
|
91
|
-
rootRef
|
|
103
|
+
rootRef,
|
|
92
104
|
rootClassName: props.className
|
|
93
|
-
}), [paramsFromUsePickerValue.contextValue, paramsFromUsePickerViews.contextValue,
|
|
105
|
+
}), [paramsFromUsePickerValue.contextValue, paramsFromUsePickerViews.contextValue, rootRef, variant, orientation, reduceAnimations, props.disabled, props.readOnly, props.autoFocus, props.format, props.className, props.name, props.label, props.sx, triggerRef, triggerStatus]);
|
|
94
106
|
const privateContextValue = React.useMemo(() => (0, _extends2.default)({}, paramsFromUsePickerValue.privateContextValue, paramsFromUsePickerViews.privateContextValue, {
|
|
95
|
-
ownerState
|
|
96
|
-
|
|
107
|
+
ownerState,
|
|
108
|
+
rootRefObject,
|
|
109
|
+
labelId
|
|
110
|
+
}), [paramsFromUsePickerValue.privateContextValue, paramsFromUsePickerViews.privateContextValue, ownerState, labelId]);
|
|
97
111
|
const actionsContextValue = React.useMemo(() => (0, _extends2.default)({}, paramsFromUsePickerValue.actionsContextValue, paramsFromUsePickerViews.actionsContextValue), [paramsFromUsePickerValue.actionsContextValue, paramsFromUsePickerViews.actionsContextValue]);
|
|
98
|
-
const fieldPrivateContextValue = React.useMemo(() => ({
|
|
112
|
+
const fieldPrivateContextValue = React.useMemo(() => (0, _extends2.default)({}, paramsFromUsePickerViews.fieldPrivateContextValue, {
|
|
99
113
|
formatDensity: props.formatDensity,
|
|
100
114
|
enableAccessibleFieldDOMStructure: props.enableAccessibleFieldDOMStructure,
|
|
101
115
|
selectedSections: props.selectedSections,
|
|
102
116
|
onSelectedSectionsChange: props.onSelectedSectionsChange
|
|
103
|
-
}), [props.formatDensity, props.enableAccessibleFieldDOMStructure, props.selectedSections, props.onSelectedSectionsChange]);
|
|
117
|
+
}), [paramsFromUsePickerViews.fieldPrivateContextValue, props.formatDensity, props.enableAccessibleFieldDOMStructure, props.selectedSections, props.onSelectedSectionsChange]);
|
|
104
118
|
return {
|
|
105
119
|
localeText,
|
|
106
120
|
contextValue,
|
|
@@ -42,7 +42,7 @@ export interface UsePickerViewParams<TValue extends PickerValidValue, TView exte
|
|
|
42
42
|
props: TExternalProps;
|
|
43
43
|
propsFromPickerValue: UsePickerValueViewsResponse<TValue>;
|
|
44
44
|
autoFocusView: boolean;
|
|
45
|
-
|
|
45
|
+
viewContainerRole: 'dialog' | 'tooltip' | null;
|
|
46
46
|
/**
|
|
47
47
|
* A function that intercepts the regular picker rendering.
|
|
48
48
|
* Can be used to consume the provided `viewRenderers` and render a custom component wrapping them.
|
|
@@ -86,6 +86,10 @@ export interface UsePickerViewsContextValue<TView extends DateOrTimeViewWithMeri
|
|
|
86
86
|
* The view currently rendered.
|
|
87
87
|
*/
|
|
88
88
|
view: TView | null;
|
|
89
|
+
/**
|
|
90
|
+
* The view showed when first opening the picker.
|
|
91
|
+
*/
|
|
92
|
+
initialView: TView | null;
|
|
89
93
|
}
|
|
90
94
|
export interface UsePickerViewsPrivateContextValue {
|
|
91
95
|
/**
|
|
@@ -97,6 +101,18 @@ export interface UsePickerViewsPrivateContextValue {
|
|
|
97
101
|
* @returns {boolean} Whether the current view has an UI.
|
|
98
102
|
*/
|
|
99
103
|
doesTheCurrentViewHasAnUI: () => boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The aria role associated with the view container.
|
|
106
|
+
* It is equal to "dialog" when the view is rendered inside a `@mui/material/Dialog`.
|
|
107
|
+
* It is equal to "dialog" when the view is rendered inside a `@mui/material/Popper` and the focus is trapped inside the view.
|
|
108
|
+
* It is equal to "tooltip" when the view is rendered inside a `@mui/material/Popper` and the focus remains inside the field.
|
|
109
|
+
* It is always equal to null if the picker does not have a field (static pickers).
|
|
110
|
+
* It is always equal to null if the component you are accessing the context from is not wrapped by a picker.
|
|
111
|
+
*/
|
|
112
|
+
viewContainerRole: 'dialog' | 'tooltip' | null;
|
|
113
|
+
}
|
|
114
|
+
export interface UsePickerViewsFieldPrivateContextValue {
|
|
115
|
+
fieldRef: React.RefObject<FieldRef<PickerValue> | FieldRef<PickerRangeValue> | null>;
|
|
100
116
|
}
|
|
101
117
|
export interface UsePickerViewsProviderParams<TView extends DateOrTimeViewWithMeridiem> {
|
|
102
118
|
hasUIView: boolean;
|
|
@@ -104,6 +120,7 @@ export interface UsePickerViewsProviderParams<TView extends DateOrTimeViewWithMe
|
|
|
104
120
|
contextValue: UsePickerViewsContextValue<TView>;
|
|
105
121
|
actionsContextValue: UsePickerViewsActionsContextValue<TView>;
|
|
106
122
|
privateContextValue: UsePickerViewsPrivateContextValue;
|
|
123
|
+
fieldPrivateContextValue: UsePickerViewsFieldPrivateContextValue;
|
|
107
124
|
}
|
|
108
125
|
/**
|
|
109
126
|
* Manage the views of all the pickers:
|
|
@@ -115,6 +132,6 @@ export declare const usePickerViews: <TValue extends PickerValidValue, TView ext
|
|
|
115
132
|
props,
|
|
116
133
|
propsFromPickerValue,
|
|
117
134
|
autoFocusView,
|
|
118
|
-
|
|
119
|
-
|
|
135
|
+
viewContainerRole,
|
|
136
|
+
rendererInterceptor: RendererInterceptor
|
|
120
137
|
}: UsePickerViewParams<TValue, TView, TExternalProps>) => UsePickerViewsResponse<TView>;
|
|
@@ -31,8 +31,8 @@ const usePickerViews = ({
|
|
|
31
31
|
props,
|
|
32
32
|
propsFromPickerValue,
|
|
33
33
|
autoFocusView,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
viewContainerRole,
|
|
35
|
+
rendererInterceptor: RendererInterceptor
|
|
36
36
|
}) => {
|
|
37
37
|
const {
|
|
38
38
|
onChange,
|
|
@@ -49,6 +49,7 @@ const usePickerViews = ({
|
|
|
49
49
|
timezone
|
|
50
50
|
} = props;
|
|
51
51
|
const propsToForwardToView = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
52
|
+
const fieldRef = React.useRef(null);
|
|
52
53
|
const {
|
|
53
54
|
view,
|
|
54
55
|
setView,
|
|
@@ -132,20 +133,27 @@ const usePickerViews = ({
|
|
|
132
133
|
const actionsContextValue = React.useMemo(() => ({
|
|
133
134
|
setView
|
|
134
135
|
}), [setView]);
|
|
136
|
+
const initialViewRef = React.useRef(openTo ?? null);
|
|
135
137
|
const contextValue = React.useMemo(() => (0, _extends2.default)({}, actionsContextValue, {
|
|
136
138
|
views,
|
|
137
|
-
view: popperView
|
|
139
|
+
view: popperView,
|
|
140
|
+
initialView: initialViewRef.current
|
|
138
141
|
}), [actionsContextValue, views, popperView]);
|
|
139
142
|
const privateContextValue = React.useMemo(() => ({
|
|
140
143
|
hasUIView,
|
|
141
|
-
doesTheCurrentViewHasAnUI
|
|
142
|
-
|
|
144
|
+
doesTheCurrentViewHasAnUI,
|
|
145
|
+
viewContainerRole
|
|
146
|
+
}), [hasUIView, doesTheCurrentViewHasAnUI, viewContainerRole]);
|
|
147
|
+
const fieldPrivateContextValue = React.useMemo(() => ({
|
|
148
|
+
fieldRef
|
|
149
|
+
}), []);
|
|
143
150
|
const providerParams = {
|
|
144
151
|
hasUIView,
|
|
145
152
|
views,
|
|
146
153
|
contextValue,
|
|
147
154
|
actionsContextValue,
|
|
148
|
-
privateContextValue
|
|
155
|
+
privateContextValue,
|
|
156
|
+
fieldPrivateContextValue
|
|
149
157
|
};
|
|
150
158
|
return {
|
|
151
159
|
provider: providerParams,
|
|
@@ -164,10 +172,14 @@ const usePickerViews = ({
|
|
|
164
172
|
onChange: setValueAndGoToNextView,
|
|
165
173
|
view: popperView,
|
|
166
174
|
onViewChange: setView,
|
|
167
|
-
focusedView,
|
|
168
|
-
onFocusedViewChange: setFocusedView,
|
|
169
175
|
showViewSwitcher: timeViewsCount > 1,
|
|
170
176
|
timeViewsCount
|
|
177
|
+
}, viewContainerRole === 'tooltip' ? {
|
|
178
|
+
focusedView: null,
|
|
179
|
+
onFocusedViewChange: () => {}
|
|
180
|
+
} : {
|
|
181
|
+
focusedView,
|
|
182
|
+
onFocusedViewChange: setFocusedView
|
|
171
183
|
});
|
|
172
184
|
if (RendererInterceptor) {
|
|
173
185
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RendererInterceptor, {
|
|
@@ -49,9 +49,10 @@ const useStaticPicker = _ref => {
|
|
|
49
49
|
renderCurrentView
|
|
50
50
|
} = (0, _usePicker.usePicker)((0, _extends2.default)({}, pickerParams, {
|
|
51
51
|
props,
|
|
52
|
+
variant: displayStaticWrapperAs,
|
|
52
53
|
autoFocusView: autoFocus ?? false,
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
viewContainerRole: null,
|
|
55
|
+
localeText
|
|
55
56
|
}));
|
|
56
57
|
const Layout = slots?.layout ?? PickerStaticLayout;
|
|
57
58
|
const renderPicker = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickerProvider.PickerProvider, (0, _extends2.default)({}, providerProps, {
|
package/internals/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PickersArrowSwitcher } from "./components/PickersArrowSwitcher/PickersArrowSwitcher.js";
|
|
2
2
|
export type { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps } from './components/PickersArrowSwitcher';
|
|
3
|
-
export { PickerFieldUI, PickerFieldUIContextProvider, cleanFieldResponse, useFieldTextFieldProps } from "./components/PickerFieldUI.js";
|
|
4
|
-
export type { ExportedPickerFieldUIProps, PickerFieldUISlots, PickerFieldUISlotProps } from './components/PickerFieldUI';
|
|
3
|
+
export { PickerFieldUI, PickerFieldUIContextProvider, cleanFieldResponse, useFieldTextFieldProps, PickerFieldUIContext, mergeSlotProps } from "./components/PickerFieldUI.js";
|
|
4
|
+
export type { ExportedPickerFieldUIProps, PickerFieldUISlots, PickerFieldUISlotProps, PickerFieldUISlotsFromContext, PickerFieldUISlotPropsFromContext } from './components/PickerFieldUI';
|
|
5
5
|
export { PickerProvider } from "./components/PickerProvider.js";
|
|
6
6
|
export type { PickerContextValue } from './components/PickerProvider';
|
|
7
7
|
export { PickersModalDialog } from "./components/PickersModalDialog.js";
|
|
@@ -25,9 +25,10 @@ export { DAY_MARGIN, DIALOG_WIDTH, VIEW_HEIGHT } from "./constants/dimensions.js
|
|
|
25
25
|
export { useControlledValueWithTimezone } from "./hooks/useValueWithTimezone.js";
|
|
26
26
|
export type { DesktopOnlyPickerProps } from './hooks/useDesktopPicker';
|
|
27
27
|
export { useField, useFieldInternalPropsWithDefaults, createDateStrForV7HiddenInputFromSections, createDateStrForV6InputFromSections } from "./hooks/useField/index.js";
|
|
28
|
-
export type { UseFieldInternalProps, UseFieldParams, UseFieldResponse, FieldValueManager, FieldChangeHandler, FieldChangeHandlerContext
|
|
28
|
+
export type { UseFieldInternalProps, UseFieldParams, UseFieldResponse, FieldValueManager, FieldChangeHandler, FieldChangeHandlerContext } from './hooks/useField';
|
|
29
29
|
export { useFieldOwnerState } from "./hooks/useFieldOwnerState.js";
|
|
30
30
|
export type { MobileOnlyPickerProps } from './hooks/useMobilePicker';
|
|
31
|
+
export { useNullableFieldPrivateContext } from "./hooks/useNullableFieldPrivateContext.js";
|
|
31
32
|
export { useNullablePickerContext } from "./hooks/useNullablePickerContext.js";
|
|
32
33
|
export { usePicker } from "./hooks/usePicker/index.js";
|
|
33
34
|
export type { UsePickerParams, UsePickerProps, UsePickerValueFieldResponse, PickerViewsRendererProps } from './hooks/usePicker';
|
package/internals/index.js
CHANGED
|
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "PickerFieldUI", {
|
|
|
39
39
|
return _PickerFieldUI.PickerFieldUI;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "PickerFieldUIContext", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _PickerFieldUI.PickerFieldUIContext;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
42
48
|
Object.defineProperty(exports, "PickerFieldUIContextProvider", {
|
|
43
49
|
enumerable: true,
|
|
44
50
|
get: function () {
|
|
@@ -195,6 +201,12 @@ Object.defineProperty(exports, "mergeDateAndTime", {
|
|
|
195
201
|
return _dateUtils.mergeDateAndTime;
|
|
196
202
|
}
|
|
197
203
|
});
|
|
204
|
+
Object.defineProperty(exports, "mergeSlotProps", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _PickerFieldUI.mergeSlotProps;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
198
210
|
Object.defineProperty(exports, "mergeSx", {
|
|
199
211
|
enumerable: true,
|
|
200
212
|
get: function () {
|
|
@@ -309,6 +321,12 @@ Object.defineProperty(exports, "useNow", {
|
|
|
309
321
|
return _useUtils.useNow;
|
|
310
322
|
}
|
|
311
323
|
});
|
|
324
|
+
Object.defineProperty(exports, "useNullableFieldPrivateContext", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function () {
|
|
327
|
+
return _useNullableFieldPrivateContext.useNullableFieldPrivateContext;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
312
330
|
Object.defineProperty(exports, "useNullablePickerContext", {
|
|
313
331
|
enumerable: true,
|
|
314
332
|
get: function () {
|
|
@@ -378,6 +396,7 @@ var _dimensions = require("./constants/dimensions");
|
|
|
378
396
|
var _useValueWithTimezone = require("./hooks/useValueWithTimezone");
|
|
379
397
|
var _useField = require("./hooks/useField");
|
|
380
398
|
var _useFieldOwnerState = require("./hooks/useFieldOwnerState");
|
|
399
|
+
var _useNullableFieldPrivateContext = require("./hooks/useNullableFieldPrivateContext");
|
|
381
400
|
var _useNullablePickerContext = require("./hooks/useNullablePickerContext");
|
|
382
401
|
var _usePicker = require("./hooks/usePicker");
|
|
383
402
|
var _usePickerPrivateContext = require("./hooks/usePickerPrivateContext");
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import type { FieldSection } from '../../models';
|
|
2
|
-
import type { UseFieldInternalProps } from '../hooks/useField';
|
|
3
2
|
import { RangePosition } from "./pickers.js";
|
|
4
|
-
import { PickerValidValue } from "./value.js";
|
|
5
3
|
export interface FieldRangeSection extends FieldSection {
|
|
6
4
|
dateName: RangePosition;
|
|
7
5
|
}
|
|
8
|
-
export interface BaseForwardedSingleInputFieldProps {
|
|
9
|
-
id?: string;
|
|
10
|
-
focused?: boolean;
|
|
11
|
-
onKeyDown?: React.KeyboardEventHandler;
|
|
12
|
-
onBlur?: React.FocusEventHandler;
|
|
13
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
14
|
-
}
|
|
15
6
|
/**
|
|
16
7
|
* Props the single input field can receive when used inside a picker.
|
|
17
8
|
* Only contains what the MUI components are passing to the field, not what users can pass using the `props.slotProps.field`.
|
|
18
9
|
*/
|
|
19
|
-
export
|
|
10
|
+
export interface BaseSingleInputFieldProps {
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { TimeViewWithMeridiem } from "../internals/models/index.js";
|
|
2
|
+
export declare const bnBD: {
|
|
3
|
+
components: {
|
|
4
|
+
MuiLocalizationProvider: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
localeText: {
|
|
7
|
+
previousMonth?: string | undefined;
|
|
8
|
+
nextMonth?: string | undefined;
|
|
9
|
+
calendarWeekNumberHeaderLabel?: string | undefined;
|
|
10
|
+
calendarWeekNumberHeaderText?: string | undefined;
|
|
11
|
+
calendarWeekNumberAriaLabelText?: ((weekNumber: number) => string) | undefined;
|
|
12
|
+
calendarWeekNumberText?: ((weekNumber: number) => string) | undefined;
|
|
13
|
+
openPreviousView?: string | undefined;
|
|
14
|
+
openNextView?: string | undefined;
|
|
15
|
+
calendarViewSwitchingButtonAriaLabel?: ((currentView: import("@mui/x-date-pickers/models").DateView) => string) | undefined;
|
|
16
|
+
start?: string | undefined;
|
|
17
|
+
end?: string | undefined;
|
|
18
|
+
startDate?: string | undefined;
|
|
19
|
+
startTime?: string | undefined;
|
|
20
|
+
endDate?: string | undefined;
|
|
21
|
+
endTime?: string | undefined;
|
|
22
|
+
cancelButtonLabel?: string | undefined;
|
|
23
|
+
clearButtonLabel?: string | undefined;
|
|
24
|
+
okButtonLabel?: string | undefined;
|
|
25
|
+
todayButtonLabel?: string | undefined;
|
|
26
|
+
clockLabelText?: ((view: import("@mui/x-date-pickers/models").TimeView, formattedTime: string | null) => string) | undefined;
|
|
27
|
+
hoursClockNumberText?: ((hours: string) => string) | undefined;
|
|
28
|
+
minutesClockNumberText?: ((minutes: string) => string) | undefined;
|
|
29
|
+
secondsClockNumberText?: ((seconds: string) => string) | undefined;
|
|
30
|
+
selectViewText?: ((view: TimeViewWithMeridiem) => string) | undefined;
|
|
31
|
+
openDatePickerDialogue?: ((formattedDate: string | null) => string) | undefined;
|
|
32
|
+
openTimePickerDialogue?: ((formattedTime: string | null) => string) | undefined;
|
|
33
|
+
fieldClearLabel?: string | undefined;
|
|
34
|
+
timeTableLabel?: string | undefined;
|
|
35
|
+
dateTableLabel?: string | undefined;
|
|
36
|
+
fieldYearPlaceholder?: ((params: {
|
|
37
|
+
digitAmount: number;
|
|
38
|
+
format: string;
|
|
39
|
+
}) => string) | undefined;
|
|
40
|
+
fieldMonthPlaceholder?: ((params: {
|
|
41
|
+
contentType: import("@mui/x-date-pickers/models").FieldSectionContentType;
|
|
42
|
+
format: string;
|
|
43
|
+
}) => string) | undefined;
|
|
44
|
+
fieldDayPlaceholder?: ((params: {
|
|
45
|
+
format: string;
|
|
46
|
+
}) => string) | undefined;
|
|
47
|
+
fieldWeekDayPlaceholder?: ((params: {
|
|
48
|
+
contentType: import("@mui/x-date-pickers/models").FieldSectionContentType;
|
|
49
|
+
format: string;
|
|
50
|
+
}) => string) | undefined;
|
|
51
|
+
fieldHoursPlaceholder?: ((params: {
|
|
52
|
+
format: string;
|
|
53
|
+
}) => string) | undefined;
|
|
54
|
+
fieldMinutesPlaceholder?: ((params: {
|
|
55
|
+
format: string;
|
|
56
|
+
}) => string) | undefined;
|
|
57
|
+
fieldSecondsPlaceholder?: ((params: {
|
|
58
|
+
format: string;
|
|
59
|
+
}) => string) | undefined;
|
|
60
|
+
fieldMeridiemPlaceholder?: ((params: {
|
|
61
|
+
format: string;
|
|
62
|
+
}) => string) | undefined;
|
|
63
|
+
year?: string | undefined;
|
|
64
|
+
month?: string | undefined;
|
|
65
|
+
day?: string | undefined;
|
|
66
|
+
weekDay?: string | undefined;
|
|
67
|
+
hours?: string | undefined;
|
|
68
|
+
minutes?: string | undefined;
|
|
69
|
+
seconds?: string | undefined;
|
|
70
|
+
meridiem?: string | undefined;
|
|
71
|
+
empty?: string | undefined;
|
|
72
|
+
datePickerToolbarTitle?: string | undefined;
|
|
73
|
+
timePickerToolbarTitle?: string | undefined;
|
|
74
|
+
dateTimePickerToolbarTitle?: string | undefined;
|
|
75
|
+
dateRangePickerToolbarTitle?: string | undefined;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
package/locales/bnBD.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bnBD = void 0;
|
|
7
|
+
var _getPickersLocalization = require("./utils/getPickersLocalization");
|
|
8
|
+
const views = {
|
|
9
|
+
hours: 'ঘণ্টা',
|
|
10
|
+
minutes: 'মিনিট',
|
|
11
|
+
seconds: 'সেকেন্ড',
|
|
12
|
+
meridiem: 'এএম/পিএম'
|
|
13
|
+
};
|
|
14
|
+
const bnBDPickers = {
|
|
15
|
+
// Calendar navigation
|
|
16
|
+
previousMonth: 'আগের মাস',
|
|
17
|
+
nextMonth: 'পরের মাস',
|
|
18
|
+
// View navigation
|
|
19
|
+
openPreviousView: 'আগের ভিউ খুলুন',
|
|
20
|
+
openNextView: 'পরের ভিউ খুলুন',
|
|
21
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'বছরের ভিউ খোলা আছে, ক্যালেন্ডার ভিউতে পরিবর্তন করুন' : 'ক্যালেন্ডার ভিউ খোলা আছে, বছরের ভিউতে পরিবর্তন করুন',
|
|
22
|
+
// DateRange labels
|
|
23
|
+
start: 'শুরু',
|
|
24
|
+
end: 'শেষ',
|
|
25
|
+
startDate: 'শুরুর তারিখ',
|
|
26
|
+
startTime: 'শুরুর সময়',
|
|
27
|
+
endDate: 'শেষের তারিখ',
|
|
28
|
+
endTime: 'শেষের সময়',
|
|
29
|
+
// Action bar
|
|
30
|
+
cancelButtonLabel: 'বাতিল',
|
|
31
|
+
clearButtonLabel: 'পরিষ্কার',
|
|
32
|
+
okButtonLabel: 'ঠিক আছে',
|
|
33
|
+
todayButtonLabel: 'আজ',
|
|
34
|
+
// Toolbar titles
|
|
35
|
+
datePickerToolbarTitle: 'তারিখ নির্বাচন করুন',
|
|
36
|
+
dateTimePickerToolbarTitle: 'তারিখ ও সময় নির্বাচন করুন',
|
|
37
|
+
timePickerToolbarTitle: 'সময় নির্বাচন করুন',
|
|
38
|
+
dateRangePickerToolbarTitle: 'তারিখের পরিসীমা নির্বাচন করুন',
|
|
39
|
+
// Clock labels
|
|
40
|
+
clockLabelText: (view, formattedTime) => `নির্বাচন করুন ${views[view]}. ${!formattedTime ? 'কোনও সময় নির্বাচন করা হয়নি' : `নির্বাচিত সময় ${formattedTime}`}`,
|
|
41
|
+
hoursClockNumberText: hours => `${hours} ঘণ্টা`,
|
|
42
|
+
minutesClockNumberText: minutes => `${minutes} মিনিট`,
|
|
43
|
+
secondsClockNumberText: seconds => `${seconds} সেকেন্ড`,
|
|
44
|
+
// Digital clock labels
|
|
45
|
+
selectViewText: view => `${views[view]} নির্বাচন করুন`,
|
|
46
|
+
// Calendar labels
|
|
47
|
+
calendarWeekNumberHeaderLabel: 'সপ্তাহ সংখ্যা',
|
|
48
|
+
calendarWeekNumberHeaderText: '#',
|
|
49
|
+
calendarWeekNumberAriaLabelText: weekNumber => `সপ্তাহ ${weekNumber}`,
|
|
50
|
+
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
51
|
+
// Open picker labels
|
|
52
|
+
openDatePickerDialogue: formattedDate => formattedDate ? `তারিখ নির্বাচন করুন, নির্বাচিত তারিখ ${formattedDate}` : 'তারিখ নির্বাচন করুন',
|
|
53
|
+
openTimePickerDialogue: formattedTime => formattedTime ? `সময় নির্বাচন করুন, নির্বাচিত সময় ${formattedTime}` : 'সময় নির্বাচন করুন',
|
|
54
|
+
fieldClearLabel: 'পরিষ্কার',
|
|
55
|
+
// Table labels
|
|
56
|
+
timeTableLabel: 'সময় নির্বাচন করুন',
|
|
57
|
+
dateTableLabel: 'তারিখ নির্বাচন করুন',
|
|
58
|
+
// Field section placeholders
|
|
59
|
+
fieldYearPlaceholder: params => 'ব'.repeat(params.digitAmount),
|
|
60
|
+
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
61
|
+
fieldDayPlaceholder: () => 'DD',
|
|
62
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
63
|
+
fieldHoursPlaceholder: () => 'ঘন্টা',
|
|
64
|
+
fieldMinutesPlaceholder: () => 'মিনিট',
|
|
65
|
+
fieldSecondsPlaceholder: () => 'সেকেন্ড',
|
|
66
|
+
fieldMeridiemPlaceholder: () => 'এএম/পিএম',
|
|
67
|
+
// View names
|
|
68
|
+
year: 'বছর',
|
|
69
|
+
month: 'মাস',
|
|
70
|
+
day: 'দিন',
|
|
71
|
+
weekDay: 'সপ্তাহের দিন',
|
|
72
|
+
hours: 'ঘণ্টা',
|
|
73
|
+
minutes: 'মিনিট',
|
|
74
|
+
seconds: 'সেকেন্ড',
|
|
75
|
+
meridiem: 'এএম/পিএম',
|
|
76
|
+
// Common
|
|
77
|
+
empty: 'ফাঁকা'
|
|
78
|
+
};
|
|
79
|
+
const bnBD = exports.bnBD = (0, _getPickersLocalization.getPickersLocalization)(bnBDPickers);
|
package/locales/index.d.ts
CHANGED
package/locales/index.js
CHANGED
|
@@ -25,6 +25,17 @@ Object.keys(_bgBG).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
+
var _bnBD = require("./bnBD");
|
|
29
|
+
Object.keys(_bnBD).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _bnBD[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _bnBD[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
28
39
|
var _caES = require("./caES");
|
|
29
40
|
Object.keys(_caES).forEach(function (key) {
|
|
30
41
|
if (key === "default" || key === "__esModule") return;
|
package/models/fields.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TextFieldProps } from '@mui/material/TextField';
|
|
|
3
3
|
import type { ExportedPickersSectionListProps } from '../PickersSectionList';
|
|
4
4
|
import type { UseFieldInternalProps, UseFieldResponse } from '../internals/hooks/useField';
|
|
5
5
|
import type { PickersTextFieldProps } from '../PickersTextField';
|
|
6
|
-
import {
|
|
6
|
+
import { BaseSingleInputFieldProps, FieldRangeSection, PickerRangeValue, PickerValidValue } from "../internals/models/index.js";
|
|
7
7
|
import { PickerOwnerState } from "./pickers.js";
|
|
8
8
|
import type { ExportedPickerFieldUIProps } from '../internals/components/PickerFieldUI';
|
|
9
9
|
export type FieldSectionType = 'year' | 'month' | 'day' | 'weekDay' | 'hours' | 'minutes' | 'seconds' | 'meridiem' | 'empty';
|
|
@@ -131,7 +131,7 @@ export type PickerFieldSlotProps<TValue extends PickerValidValue, TEnableAccessi
|
|
|
131
131
|
* Props the text field receives when used inside a single input picker.
|
|
132
132
|
* Only contains what the MUI components are passing to the text field, not what users can pass using the `props.slotProps.field` and `props.slotProps.textField`.
|
|
133
133
|
*/
|
|
134
|
-
export type BaseSingleInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = Omit<UseFieldResponse<TEnableAccessibleFieldDOMStructure,
|
|
134
|
+
export type BaseSingleInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = Omit<UseFieldResponse<TEnableAccessibleFieldDOMStructure, BaseSingleInputFieldProps>, 'slots' | 'slotProps' | 'clearable' | 'onClear' | 'openPickerButtonPosition' | 'clearButtonPosition' | 'openPickerAriaLabel'>;
|
|
135
135
|
/**
|
|
136
136
|
* Props the built-in text field component can receive.
|
|
137
137
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Locale as DateFnsLocale } from 'date-fns-jalali
|
|
1
|
+
import type { Locale as DateFnsLocale } from 'date-fns-jalali';
|
|
2
2
|
import { AdapterFormats, AdapterOptions, MuiPickersAdapter } from "../models/index.js";
|
|
3
3
|
import { AdapterDateFnsBase } from "../AdapterDateFnsBase/index.js";
|
|
4
4
|
declare module '@mui/x-date-pickers/models' {
|
|
@@ -1,50 +1,52 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
|
|
2
|
+
// date-fns-jalali@<3 has no exports field defined
|
|
3
|
+
// See https://github.com/date-fns/date-fns/issues/1781
|
|
4
|
+
/* eslint-disable import/extensions, class-methods-use-this */
|
|
3
5
|
// @ts-nocheck
|
|
4
|
-
import addSeconds from 'date-fns-jalali/addSeconds';
|
|
5
|
-
import addMinutes from 'date-fns-jalali/addMinutes';
|
|
6
|
-
import addHours from 'date-fns-jalali/addHours';
|
|
7
|
-
import addDays from 'date-fns-jalali/addDays';
|
|
8
|
-
import addWeeks from 'date-fns-jalali/addWeeks';
|
|
9
|
-
import addMonths from 'date-fns-jalali/addMonths';
|
|
10
|
-
import addYears from 'date-fns-jalali/addYears';
|
|
11
|
-
import endOfDay from 'date-fns-jalali/endOfDay';
|
|
12
|
-
import endOfWeek from 'date-fns-jalali/endOfWeek';
|
|
13
|
-
import endOfYear from 'date-fns-jalali/endOfYear';
|
|
14
|
-
import dateFnsFormat from 'date-fns-jalali/format';
|
|
15
|
-
import getHours from 'date-fns-jalali/getHours';
|
|
16
|
-
import getSeconds from 'date-fns-jalali/getSeconds';
|
|
17
|
-
import getMilliseconds from 'date-fns-jalali/getMilliseconds';
|
|
18
|
-
import getWeek from 'date-fns-jalali/getWeek';
|
|
19
|
-
import getYear from 'date-fns-jalali/getYear';
|
|
20
|
-
import getMonth from 'date-fns-jalali/getMonth';
|
|
21
|
-
import getDate from 'date-fns-jalali/getDate';
|
|
22
|
-
import getDaysInMonth from 'date-fns-jalali/getDaysInMonth';
|
|
23
|
-
import getMinutes from 'date-fns-jalali/getMinutes';
|
|
24
|
-
import isAfter from 'date-fns-jalali/isAfter';
|
|
25
|
-
import isBefore from 'date-fns-jalali/isBefore';
|
|
26
|
-
import isEqual from 'date-fns-jalali/isEqual';
|
|
27
|
-
import isSameDay from 'date-fns-jalali/isSameDay';
|
|
28
|
-
import isSameYear from 'date-fns-jalali/isSameYear';
|
|
29
|
-
import isSameMonth from 'date-fns-jalali/isSameMonth';
|
|
30
|
-
import isSameHour from 'date-fns-jalali/isSameHour';
|
|
31
|
-
import isValid from 'date-fns-jalali/isValid';
|
|
32
|
-
import dateFnsParse from 'date-fns-jalali/parse';
|
|
33
|
-
import setDate from 'date-fns-jalali/setDate';
|
|
34
|
-
import setHours from 'date-fns-jalali/setHours';
|
|
35
|
-
import setMinutes from 'date-fns-jalali/setMinutes';
|
|
36
|
-
import setMonth from 'date-fns-jalali/setMonth';
|
|
37
|
-
import setSeconds from 'date-fns-jalali/setSeconds';
|
|
38
|
-
import setMilliseconds from 'date-fns-jalali/setMilliseconds';
|
|
39
|
-
import setYear from 'date-fns-jalali/setYear';
|
|
40
|
-
import startOfDay from 'date-fns-jalali/startOfDay';
|
|
41
|
-
import startOfMonth from 'date-fns-jalali/startOfMonth';
|
|
42
|
-
import endOfMonth from 'date-fns-jalali/endOfMonth';
|
|
43
|
-
import startOfWeek from 'date-fns-jalali/startOfWeek';
|
|
44
|
-
import startOfYear from 'date-fns-jalali/startOfYear';
|
|
45
|
-
import isWithinInterval from 'date-fns-jalali/isWithinInterval';
|
|
46
|
-
import defaultLocale from 'date-fns-jalali/locale/fa-IR';
|
|
47
|
-
import longFormatters from 'date-fns-jalali/_lib/format/longFormatters';
|
|
6
|
+
import addSeconds from 'date-fns-jalali/addSeconds/index.js';
|
|
7
|
+
import addMinutes from 'date-fns-jalali/addMinutes/index.js';
|
|
8
|
+
import addHours from 'date-fns-jalali/addHours/index.js';
|
|
9
|
+
import addDays from 'date-fns-jalali/addDays/index.js';
|
|
10
|
+
import addWeeks from 'date-fns-jalali/addWeeks/index.js';
|
|
11
|
+
import addMonths from 'date-fns-jalali/addMonths/index.js';
|
|
12
|
+
import addYears from 'date-fns-jalali/addYears/index.js';
|
|
13
|
+
import endOfDay from 'date-fns-jalali/endOfDay/index.js';
|
|
14
|
+
import endOfWeek from 'date-fns-jalali/endOfWeek/index.js';
|
|
15
|
+
import endOfYear from 'date-fns-jalali/endOfYear/index.js';
|
|
16
|
+
import dateFnsFormat from 'date-fns-jalali/format/index.js';
|
|
17
|
+
import getHours from 'date-fns-jalali/getHours/index.js';
|
|
18
|
+
import getSeconds from 'date-fns-jalali/getSeconds/index.js';
|
|
19
|
+
import getMilliseconds from 'date-fns-jalali/getMilliseconds/index.js';
|
|
20
|
+
import getWeek from 'date-fns-jalali/getWeek/index.js';
|
|
21
|
+
import getYear from 'date-fns-jalali/getYear/index.js';
|
|
22
|
+
import getMonth from 'date-fns-jalali/getMonth/index.js';
|
|
23
|
+
import getDate from 'date-fns-jalali/getDate/index.js';
|
|
24
|
+
import getDaysInMonth from 'date-fns-jalali/getDaysInMonth/index.js';
|
|
25
|
+
import getMinutes from 'date-fns-jalali/getMinutes/index.js';
|
|
26
|
+
import isAfter from 'date-fns-jalali/isAfter/index.js';
|
|
27
|
+
import isBefore from 'date-fns-jalali/isBefore/index.js';
|
|
28
|
+
import isEqual from 'date-fns-jalali/isEqual/index.js';
|
|
29
|
+
import isSameDay from 'date-fns-jalali/isSameDay/index.js';
|
|
30
|
+
import isSameYear from 'date-fns-jalali/isSameYear/index.js';
|
|
31
|
+
import isSameMonth from 'date-fns-jalali/isSameMonth/index.js';
|
|
32
|
+
import isSameHour from 'date-fns-jalali/isSameHour/index.js';
|
|
33
|
+
import isValid from 'date-fns-jalali/isValid/index.js';
|
|
34
|
+
import dateFnsParse from 'date-fns-jalali/parse/index.js';
|
|
35
|
+
import setDate from 'date-fns-jalali/setDate/index.js';
|
|
36
|
+
import setHours from 'date-fns-jalali/setHours/index.js';
|
|
37
|
+
import setMinutes from 'date-fns-jalali/setMinutes/index.js';
|
|
38
|
+
import setMonth from 'date-fns-jalali/setMonth/index.js';
|
|
39
|
+
import setSeconds from 'date-fns-jalali/setSeconds/index.js';
|
|
40
|
+
import setMilliseconds from 'date-fns-jalali/setMilliseconds/index.js';
|
|
41
|
+
import setYear from 'date-fns-jalali/setYear/index.js';
|
|
42
|
+
import startOfDay from 'date-fns-jalali/startOfDay/index.js';
|
|
43
|
+
import startOfMonth from 'date-fns-jalali/startOfMonth/index.js';
|
|
44
|
+
import endOfMonth from 'date-fns-jalali/endOfMonth/index.js';
|
|
45
|
+
import startOfWeek from 'date-fns-jalali/startOfWeek/index.js';
|
|
46
|
+
import startOfYear from 'date-fns-jalali/startOfYear/index.js';
|
|
47
|
+
import isWithinInterval from 'date-fns-jalali/isWithinInterval/index.js';
|
|
48
|
+
import defaultLocale from 'date-fns-jalali/locale/fa-IR/index.js';
|
|
49
|
+
import longFormatters from 'date-fns-jalali/_lib/format/longFormatters/index.js';
|
|
48
50
|
import { AdapterDateFnsBase } from "../AdapterDateFnsBase/index.js";
|
|
49
51
|
const defaultFormats = {
|
|
50
52
|
year: 'yyyy',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Locale as DateFnsLocale } from 'date-fns
|
|
1
|
+
import type { Locale as DateFnsLocale } from 'date-fns';
|
|
2
2
|
import { AdapterFormats, AdapterOptions, MuiPickersAdapter } from "../models/index.js";
|
|
3
3
|
import { AdapterDateFnsBase } from "../AdapterDateFnsBase/index.js";
|
|
4
4
|
declare module '@mui/x-date-pickers/models' {
|