@progress/kendo-react-dateinputs 13.3.0-develop.9 → 13.4.0-develop.1
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/PopupSettings.d.ts +22 -0
- package/calendar/components/Calendar.d.ts +202 -0
- package/calendar/components/Calendar.mjs +7 -7
- package/calendar/components/CalendarCell.d.ts +71 -0
- package/calendar/components/CalendarHeaderTitle.d.ts +38 -0
- package/calendar/components/CalendarNavigationItem.d.ts +39 -0
- package/calendar/components/CalendarWeekCell.d.ts +42 -0
- package/calendar/components/Header.d.ts +65 -0
- package/calendar/components/Header.mjs +3 -3
- package/calendar/components/HorizontalViewList.d.ts +80 -0
- package/calendar/components/HorizontalViewList.mjs +3 -3
- package/calendar/components/MultiViewCalendar.d.ts +226 -0
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +17 -17
- package/calendar/components/Navigation.d.ts +85 -0
- package/calendar/components/TodayCommand.d.ts +46 -0
- package/calendar/components/TodayCommand.mjs +3 -3
- package/calendar/components/View.d.ts +101 -0
- package/calendar/components/ViewList.d.ts +128 -0
- package/calendar/models/ActiveView.d.ts +11 -0
- package/calendar/models/CalendarSettings.d.ts +256 -0
- package/calendar/models/CalendarViewEnum.d.ts +16 -0
- package/calendar/models/CellContext.d.ts +72 -0
- package/calendar/models/MultiViewCalendarMode.d.ts +16 -0
- package/calendar/models/MultiViewCalendarSettings.d.ts +129 -0
- package/calendar/models/NavigationAction.d.ts +22 -0
- package/calendar/models/SelectionRange.d.ts +24 -0
- package/calendar/models/SelectionRangeEnd.d.ts +11 -0
- package/calendar/models/ViewService.d.ts +32 -0
- package/calendar/models/WeekDaysFormat.d.ts +11 -0
- package/calendar/models/index.d.ts +18 -0
- package/calendar/services/BusViewService.d.ts +28 -0
- package/calendar/services/CenturyViewService.d.ts +32 -0
- package/calendar/services/CenturyViewService.mjs +4 -4
- package/calendar/services/DOMService.d.ts +36 -0
- package/calendar/services/DecadeViewService.d.ts +34 -0
- package/calendar/services/DecadeViewService.mjs +4 -4
- package/calendar/services/MonthViewService.d.ts +40 -0
- package/calendar/services/MonthViewService.mjs +2 -2
- package/calendar/services/NavigationService.d.ts +21 -0
- package/calendar/services/ScrollSyncService.d.ts +28 -0
- package/calendar/services/WeekNamesService.d.ts +17 -0
- package/calendar/services/YearViewService.d.ts +38 -0
- package/calendar/services/YearViewService.mjs +2 -2
- package/calendar/services/index.d.ts +17 -0
- package/calendar/utils/ScrollSync.d.ts +20 -0
- package/codemods/utils.js +1 -8
- package/codemods/v11/dateinput-handle.js +1 -8
- package/codemods/v11/datepicker-handle.js +1 -8
- package/common/AdaptiveMode.d.ts +22 -0
- package/common/ClearButton.d.ts +20 -0
- package/dateinput/DateInput.d.ts +248 -0
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +63 -65
- package/dateinput/dateInputIntl.d.ts +30 -0
- package/dateinput/models/DateInputSettings.d.ts +107 -0
- package/dateinput/models/common-package-props.d.ts +34 -0
- package/dateinput/models/dateinput-options.d.ts +105 -0
- package/dateinput/models/format-placeholder.d.ts +46 -0
- package/dateinput/models/incremental-steps.d.ts +24 -0
- package/dateinput/models/index.d.ts +15 -0
- package/dateinput/models/kendo-date.d.ts +60 -0
- package/dateinput/models/mask.d.ts +14 -0
- package/dateinput/models/selection.d.ts +14 -0
- package/dateinput/utils.d.ts +31 -0
- package/datepicker/DatePicker.d.ts +279 -0
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +68 -72
- package/datepicker/ToggleButton.d.ts +17 -0
- package/datepicker/models/DatePickerSettings.d.ts +248 -0
- package/datepicker/models/index.d.ts +9 -0
- package/daterangepicker/DateRangePicker.d.ts +357 -0
- package/daterangepicker/DateRangePicker.mjs +13 -13
- package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +13 -0
- package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +13 -0
- package/daterangepicker/models/DateRangePickerPopupSettings.d.ts +13 -0
- package/daterangepicker/models/DateRangePickerSettings.d.ts +129 -0
- package/daterangepicker/models/index.d.ts +12 -0
- package/datetimepicker/DateTimePicker.d.ts +420 -0
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +16 -20
- package/datetimepicker/DateTimeSelector.d.ts +111 -0
- package/datetimepicker/DateTimeSelector.mjs +3 -3
- package/datetimepicker/models/DateTimePickerSettings.d.ts +154 -0
- package/datetimepicker/models/index.d.ts +9 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/hooks/usePickerFloatingLabel.d.ts +27 -0
- package/index.d.mts +35 -4952
- package/index.d.ts +35 -4952
- package/messages/index.d.ts +132 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +8 -8
- package/timepicker/TimeList.d.ts +97 -0
- package/timepicker/TimeList.js +5 -5
- package/timepicker/TimeList.mjs +122 -112
- package/timepicker/TimePart.d.ts +146 -0
- package/timepicker/TimePart.mjs +3 -3
- package/timepicker/TimePicker.d.ts +417 -0
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +64 -68
- package/timepicker/TimeSelector.d.ts +149 -0
- package/timepicker/TimeSelector.mjs +3 -3
- package/timepicker/models/IncrementalSteps.d.ts +18 -0
- package/timepicker/models/ListItem.d.ts +14 -0
- package/timepicker/models/ListService.d.ts +22 -0
- package/timepicker/models/ListServiceSettings.d.ts +19 -0
- package/timepicker/models/TimePart.d.ts +17 -0
- package/timepicker/models/TimePickerSettings.d.ts +137 -0
- package/timepicker/models/index.d.ts +14 -0
- package/timepicker/services/DOMService.d.ts +18 -0
- package/timepicker/services/DayPeriodService.d.ts +54 -0
- package/timepicker/services/HoursService.d.ts +40 -0
- package/timepicker/services/MinutesService.d.ts +39 -0
- package/timepicker/services/SecondsService.d.ts +39 -0
- package/timepicker/services/index.d.ts +13 -0
- package/timepicker/utils.d.ts +63 -0
- package/timepicker/utils.mjs +1 -1
- package/utils.d.ts +103 -0
- package/utils.js +1 -1
- package/utils.mjs +46 -46
- package/virtualization/Virtualization.d.ts +125 -0
- package/virtualization/services/ScrollerService.d.ts +56 -0
- package/virtualization/services/index.d.ts +10 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { DateInputFormatPlaceholder } from './format-placeholder.js';
|
|
9
|
+
import { IntlService, DateFormatOptions } from '@progress/kendo-react-intl';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export interface DatePart {
|
|
14
|
+
value: Date | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export declare class KendoDate {
|
|
20
|
+
year: boolean;
|
|
21
|
+
month: boolean;
|
|
22
|
+
date: boolean;
|
|
23
|
+
hours: boolean;
|
|
24
|
+
minutes: boolean;
|
|
25
|
+
seconds: boolean;
|
|
26
|
+
milliseconds: boolean;
|
|
27
|
+
formatPlaceholder: DateInputFormatPlaceholder;
|
|
28
|
+
format: string | DateFormatOptions;
|
|
29
|
+
private leadingZero;
|
|
30
|
+
private monthNames;
|
|
31
|
+
private typedMonthPart;
|
|
32
|
+
private knownParts;
|
|
33
|
+
private symbols;
|
|
34
|
+
private intlProvider;
|
|
35
|
+
get intl(): IntlService;
|
|
36
|
+
private _value;
|
|
37
|
+
get value(): Date;
|
|
38
|
+
constructor(intlProvider: () => IntlService, formatPlaceholder: DateInputFormatPlaceholder, format: string | DateFormatOptions);
|
|
39
|
+
setValue(value: Date | null): void;
|
|
40
|
+
hasValue(): boolean;
|
|
41
|
+
getDateObject(): Date | null;
|
|
42
|
+
getTextAndFormat(): {
|
|
43
|
+
text: string;
|
|
44
|
+
format: string;
|
|
45
|
+
};
|
|
46
|
+
modifyExisting(value: boolean): void;
|
|
47
|
+
getExisting(symbol: string): boolean;
|
|
48
|
+
setExisting(symbol: string, value: boolean): void;
|
|
49
|
+
modifyPart(symbol: string, offset: number): void;
|
|
50
|
+
parsePart(symbol: string, currentChar: string): DatePart;
|
|
51
|
+
symbolMap(symbol: string): string;
|
|
52
|
+
resetLeadingZero(): boolean;
|
|
53
|
+
private isAbbrMonth;
|
|
54
|
+
private partPattern;
|
|
55
|
+
private matchMonth;
|
|
56
|
+
private allFormatedMonths;
|
|
57
|
+
private dateFormatString;
|
|
58
|
+
private merge;
|
|
59
|
+
private dateFieldName;
|
|
60
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare class Mask {
|
|
12
|
+
symbols: string;
|
|
13
|
+
partMap: any[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export type Selection = {
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_FORMAT = "d";
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_FORMAT_PLACEHOLDER = "wide";
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export declare const padZero: (length: number) => string;
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export declare const approximateStringMatching: (oldTextOrigin: string, oldFormat: string, newTextOrigin: string, selectionStart: number) => any[];
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
export declare const dateSymbolMap: (map: any, part: any) => Function;
|
|
28
|
+
/**
|
|
29
|
+
* @hidden
|
|
30
|
+
*/
|
|
31
|
+
export declare const isInRange: (candidate: Date | null, min: Date, max: Date) => boolean;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PopupProps } from '@progress/kendo-react-popup';
|
|
9
|
+
import { FormComponentProps, FormComponentValidity, AdaptiveModeContextType } from '@progress/kendo-react-common';
|
|
10
|
+
import { DateInputHandle, DateInputProps } from '../dateinput/DateInput.js';
|
|
11
|
+
import { Calendar, CalendarProps } from '../calendar/components/Calendar.js';
|
|
12
|
+
import { DatePickerSettings } from './models/index.js';
|
|
13
|
+
import { ToggleButtonProps } from './ToggleButton.js';
|
|
14
|
+
import { DateInputCommonPackageProps } from '../dateinput/models/index.js';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
/**
|
|
17
|
+
* The arguments for the `onChange` event of the DatePicker.
|
|
18
|
+
*/
|
|
19
|
+
export interface DatePickerChangeEvent {
|
|
20
|
+
/** The native DOM event. */
|
|
21
|
+
nativeEvent?: any;
|
|
22
|
+
/** The React synthetic event. */
|
|
23
|
+
syntheticEvent: React.SyntheticEvent<any>;
|
|
24
|
+
/** The new `value`. */
|
|
25
|
+
value: Date | null;
|
|
26
|
+
/** The current popup state. */
|
|
27
|
+
show: boolean;
|
|
28
|
+
/** The component instance that fired the event. */
|
|
29
|
+
target: DatePickerHandle;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The arguments for the `onOpen` event of the DatePicker.
|
|
33
|
+
*/
|
|
34
|
+
export interface DatePickerOpenEvent {
|
|
35
|
+
/** The component instance that fired the event. */
|
|
36
|
+
target: DatePickerHandle;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The arguments for the `onClose` event of the DatePicker.
|
|
40
|
+
*/
|
|
41
|
+
export interface DatePickerCloseEvent {
|
|
42
|
+
/** The component instance that fired the event. */
|
|
43
|
+
target: DatePickerHandle;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Represents the props of the [KendoReact DatePicker component](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker).
|
|
47
|
+
*/
|
|
48
|
+
export interface DatePickerProps extends DatePickerSettings, FormComponentProps, DateInputCommonPackageProps, Omit<React.HTMLAttributes<HTMLElement>, 'defaultValue' | 'onChange' | 'onBlur' | 'onFocus' | 'placeholder'> {
|
|
49
|
+
/**
|
|
50
|
+
* Set the initial `value` when the component is uncontrolled ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker/default-value)).
|
|
51
|
+
*/
|
|
52
|
+
defaultValue?: Date | null;
|
|
53
|
+
/**
|
|
54
|
+
* Fires when the user selects a new `value` ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker/controlled-state#toc-controlling-the-date-value)).
|
|
55
|
+
*/
|
|
56
|
+
onChange?: (event: DatePickerChangeEvent) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Fires when the popup opens.
|
|
59
|
+
*/
|
|
60
|
+
onOpen?: (event: DatePickerOpenEvent) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Fires when the popup closes.
|
|
63
|
+
*/
|
|
64
|
+
onClose?: (event: DatePickerCloseEvent) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Set the current `value` ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker/controlled-state#toc-controlling-the-date-value)).
|
|
67
|
+
* Provide a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance or `null`.
|
|
68
|
+
*/
|
|
69
|
+
value?: Date | null;
|
|
70
|
+
/**
|
|
71
|
+
* Control the `size` of the DatePicker.
|
|
72
|
+
*
|
|
73
|
+
* The available options are:
|
|
74
|
+
* - small
|
|
75
|
+
* - medium
|
|
76
|
+
* - large
|
|
77
|
+
*
|
|
78
|
+
* @default undefined (theme-controlled)
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* <DatePicker size="large" />
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
size?: 'small' | 'medium' | 'large';
|
|
86
|
+
/**
|
|
87
|
+
* Control the corner `rounded` style of the DatePicker.
|
|
88
|
+
*
|
|
89
|
+
* The available options are:
|
|
90
|
+
* - small
|
|
91
|
+
* - medium
|
|
92
|
+
* - large
|
|
93
|
+
* - full
|
|
94
|
+
*
|
|
95
|
+
* @default undefined (theme-controlled)
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* <DatePicker rounded="full" />
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
103
|
+
/**
|
|
104
|
+
* Control the `fillMode` (background) of the DatePicker.
|
|
105
|
+
*
|
|
106
|
+
* The available options are:
|
|
107
|
+
* - solid
|
|
108
|
+
* - outline
|
|
109
|
+
* - flat
|
|
110
|
+
*
|
|
111
|
+
* @default undefined (theme-controlled)
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```tsx
|
|
115
|
+
* <DatePicker fillMode="outline" />
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
fillMode?: 'solid' | 'flat' | 'outline';
|
|
119
|
+
/**
|
|
120
|
+
* Enable adaptive rendering of the popup based on viewport width.
|
|
121
|
+
*
|
|
122
|
+
* @default `false`
|
|
123
|
+
*/
|
|
124
|
+
adaptive?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Set the title text in the adaptive popup (action sheet). Use only when `adaptive` is `true`.
|
|
127
|
+
* If not set, the title matches the `label`.
|
|
128
|
+
*/
|
|
129
|
+
adaptiveTitle?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Set the subtitle text in the adaptive popup (action sheet). Use only when `adaptive` is `true`.
|
|
132
|
+
*/
|
|
133
|
+
adaptiveSubtitle?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Apply the `autoFocus` attribute to the internal input element.
|
|
136
|
+
*
|
|
137
|
+
* @default `false`
|
|
138
|
+
*/
|
|
139
|
+
autoFocus?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* @hidden
|
|
142
|
+
*/
|
|
143
|
+
visited?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* @hidden
|
|
146
|
+
*/
|
|
147
|
+
touched?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* @hidden
|
|
150
|
+
*/
|
|
151
|
+
modified?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Autofill missing date parts with the current date on blur.
|
|
154
|
+
*
|
|
155
|
+
* @default `false`
|
|
156
|
+
*/
|
|
157
|
+
autoFill?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
/**
|
|
160
|
+
* Set the upper threshold for interpreting a two-digit year as part of the current century ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/dateinput/formats#toc-two---digit-year-max)).
|
|
161
|
+
* Values smaller than (`twoDigitYearMax` + 1) map to 20xx. Larger map to 19xx.
|
|
162
|
+
*
|
|
163
|
+
* @default `68`
|
|
164
|
+
*/
|
|
165
|
+
twoDigitYearMax?: number;
|
|
166
|
+
/**
|
|
167
|
+
/**
|
|
168
|
+
* Enable mouse wheel to increment or decrement segments.
|
|
169
|
+
*
|
|
170
|
+
* @default `true`
|
|
171
|
+
*/
|
|
172
|
+
enableMouseWheel?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Pass HTML attributes to the internal focusable input element.
|
|
175
|
+
* Attributes required for core logic are ignored.
|
|
176
|
+
*/
|
|
177
|
+
inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
178
|
+
/**
|
|
179
|
+
* @hidden
|
|
180
|
+
* This prop is provided by the withAdaptiveModeContext HOC to subscribe to AdaptiveModeContext.
|
|
181
|
+
*/
|
|
182
|
+
_adaptiveMode?: AdaptiveModeContextType;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* @hidden
|
|
186
|
+
*/
|
|
187
|
+
export interface DatePickerState {
|
|
188
|
+
value: Date | null;
|
|
189
|
+
show: boolean;
|
|
190
|
+
focused: boolean;
|
|
191
|
+
windowWidth?: number;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Represents the KendoReact DatePicker Component.
|
|
195
|
+
*
|
|
196
|
+
* Accepts properties of type [DatePickerProps](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/datepickerprops).
|
|
197
|
+
* Obtaining the `ref` returns an object of type [DatePickerHandle](https://www.telerik.com/kendo-react-ui/components/dateinputs/api/datepickerhandle).
|
|
198
|
+
*/
|
|
199
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<DatePickerHandle>>;
|
|
200
|
+
/**
|
|
201
|
+
* @hidden
|
|
202
|
+
*/
|
|
203
|
+
export declare const datePickerDefaultProps: {
|
|
204
|
+
defaultShow: boolean;
|
|
205
|
+
defaultValue: null;
|
|
206
|
+
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
207
|
+
calendar: React.ComponentType<CalendarProps<any>>;
|
|
208
|
+
toggleButton: React.ComponentType<ToggleButtonProps>;
|
|
209
|
+
popup: React.ComponentType<PopupProps>;
|
|
210
|
+
disabled: boolean;
|
|
211
|
+
format: string;
|
|
212
|
+
max: Date;
|
|
213
|
+
min: Date;
|
|
214
|
+
popupSettings: any;
|
|
215
|
+
tabIndex: number;
|
|
216
|
+
weekNumber: boolean;
|
|
217
|
+
validityStyles: boolean;
|
|
218
|
+
size: "small" | "medium" | "large" | undefined;
|
|
219
|
+
rounded: "small" | "medium" | "large" | "full" | undefined;
|
|
220
|
+
fillMode: "flat" | "solid" | "outline" | undefined;
|
|
221
|
+
autoFocus: boolean;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Represents the PropsContext of the `DatePicker` component.
|
|
225
|
+
* Used for global configuration of all `DatePicker` instances.
|
|
226
|
+
*
|
|
227
|
+
* For more information, refer to the [DateInputs Props Context](https://www.telerik.com/kendo-react-ui/components/dateinputs/props-context) article.
|
|
228
|
+
*/
|
|
229
|
+
export declare const DatePickerPropsContext: React.Context<(p: DatePickerProps) => DatePickerProps>;
|
|
230
|
+
/**
|
|
231
|
+
* Represent the `ref` of the DatePicker component.
|
|
232
|
+
*/
|
|
233
|
+
export interface DatePickerHandle {
|
|
234
|
+
/**
|
|
235
|
+
* @hidden
|
|
236
|
+
*/
|
|
237
|
+
focus: () => void;
|
|
238
|
+
/**
|
|
239
|
+
* Toggles the popup of the DatePicker.
|
|
240
|
+
*/
|
|
241
|
+
togglePopup: () => void;
|
|
242
|
+
/**
|
|
243
|
+
* Returns the props of the DatePicker component.
|
|
244
|
+
*/
|
|
245
|
+
props: DatePickerProps;
|
|
246
|
+
/**
|
|
247
|
+
* Returns a boolean value indicating whether the DatePicker is in mobile mode.
|
|
248
|
+
*/
|
|
249
|
+
mobileMode: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Returns the HTML element of the DatePicker component.
|
|
252
|
+
*/
|
|
253
|
+
element: HTMLSpanElement | null;
|
|
254
|
+
/**
|
|
255
|
+
* Gets the Calendar component inside the DatePicker component.
|
|
256
|
+
*/
|
|
257
|
+
calendar: Calendar | null;
|
|
258
|
+
/**
|
|
259
|
+
* Gets the DateInput component inside the DatePicker component.
|
|
260
|
+
*/
|
|
261
|
+
dateInput: DateInputHandle | null;
|
|
262
|
+
/**
|
|
263
|
+
* Gets the `name` property of the DatePicker.
|
|
264
|
+
*/
|
|
265
|
+
name: string | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* Gets the popup state of the DatePicker.
|
|
268
|
+
*/
|
|
269
|
+
show: boolean;
|
|
270
|
+
/**
|
|
271
|
+
* Represents the validity state into which the DatePicker is set.
|
|
272
|
+
*/
|
|
273
|
+
validity: FormComponentValidity;
|
|
274
|
+
/**
|
|
275
|
+
* Gets the value of the DatePicker.
|
|
276
|
+
*/
|
|
277
|
+
value: Date | null;
|
|
278
|
+
}
|
|
279
|
+
export type DatePicker = DatePickerHandle;
|
package/datepicker/DatePicker.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const lt=require("react"),e=require("prop-types"),ut=require("@progress/kendo-react-popup"),W=require("@progress/kendo-date-math"),i=require("@progress/kendo-react-common"),it=require("@progress/kendo-svg-icons"),st=require("../dateinput/DateInput.js"),ct=require("../calendar/components/Calendar.js"),a=require("../utils.js"),j=require("../messages/index.js"),dt=require("@progress/kendo-react-intl"),ft=require("./ToggleButton.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const lt=require("react"),e=require("prop-types"),ut=require("@progress/kendo-react-popup"),W=require("@progress/kendo-date-math"),i=require("@progress/kendo-react-common"),it=require("@progress/kendo-svg-icons"),st=require("../dateinput/DateInput.js"),ct=require("../calendar/components/Calendar.js"),a=require("../utils.js"),j=require("../messages/index.js"),dt=require("@progress/kendo-react-intl"),ft=require("./ToggleButton.js"),pt=require("../hooks/usePickerFloatingLabel.js"),mt=require("@progress/kendo-react-layout"),gt=require("../common/AdaptiveMode.js");function bt(n){const v=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const p in n)if(p!=="default"){const M=Object.getOwnPropertyDescriptor(n,p);Object.defineProperty(v,p,M.get?M:{enumerable:!0,get:()=>n[p]})}}return v.default=n,Object.freeze(v)}const o=bt(lt),U=o.forwardRef((n,v)=>{const p=i.useId(n.id),M=dt.useLocalization(),w=i.useAdaptiveModeContext(),{defaultShow:fe=l.defaultShow,defaultValue:pe=l.defaultValue,dateInput:me=l.dateInput,calendar:ge=l.calendar,toggleButton:be=l.toggleButton,popup:he=l.popup,disabled:y=l.disabled,format:ve=l.format,max:I=l.max,min:T=l.min,popupSettings:D=l.popupSettings,tabIndex:we=l.tabIndex,weekNumber:ye=l.weekNumber,validityStyles:H=l.validityStyles,size:B=l.size,rounded:E=l.rounded,fillMode:x=l.fillMode,autoFocus:De=l.autoFocus,show:Y,autoSwitchParts:Ce,autoSwitchKeys:ke,twoDigitYearMax:Oe,ariaLabel:Pe,adaptive:ht,adaptiveTitle:Me=n.label||void 0,adaptiveSubtitle:Re,formatPlaceholder:Se,inputAttributes:_e,validationMessage:$,visited:vt,value:q,touched:wt,modified:yt,_adaptiveMode:Dt=w,valid:X,focusedDate:Ie,id:Te,ariaLabelledBy:Be,ariaDescribedBy:Ee,placeholder:xe,onChange:Z,onOpen:G,onClose:J,...Q}=i.usePropsContext(de,n),A=()=>{if(i.canUseDOM)return k.current&&k.current.ownerDocument||window.document},s=()=>!!(h.windowWidth&&w&&h.windowWidth<=(w==null?void 0:w.medium)&&n.adaptive),m=()=>{const t=R.current!==void 0?R.current:q!==void 0?q:h.value;return t!==null?W.cloneDate(t):null},u=()=>S.current!==void 0?S.current:Y!==void 0?Y:h.show,qe=()=>me||l.dateInput,Ae=()=>be||l.toggleButton,Ne=()=>ge||l.calendar,Fe=()=>he||l.popup,ee=()=>n.required!==void 0?n.required:!1,N=()=>{const t=m()||q||null,r=T,c=I,_=a.isInDateRange(t,r,c),z=$!==void 0,L=(!ee()||t!=null)&&_,K=X!==void 0?X:L;return{customError:z,rangeOverflow:t&&c.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<r.getTime()||!1,valid:K,valueMissing:t===null}},Ve=t=>{for(const r of t)P({windowWidth:r.target.clientWidth})},ze=()=>{d.current&&d.current.focus()},te=t=>{f.current=t},g=t=>{u()!==t&&(P({show:t}),t&&G&&G({target:C.current}),!t&&J&&J({target:C.current}))},Le=t=>{const r=m();return r&&t?a.setTime(t,r):t},Ke=t=>{D!=null&&D.onMouseDownOutside&&D.onMouseDownOutside(t)},ne=(t,r)=>{P({value:W.cloneDate(t||void 0)}),R.current=t,S.current=!1,s()||(b.current=!0),Z&&Z({syntheticEvent:r.syntheticEvent,nativeEvent:r.nativeEvent,value:m(),show:u(),target:C.current}),R.current=void 0,S.current=void 0,g(!1)},We=t=>{const r=Le(t.value);ne(r,t)},oe=()=>{const{popupClass:t,...r}=D,c=u(),_=m(),z=_&&W.getDate(_),L=i.classNames(t),K={popupClass:"k-datepicker-popup",show:c,anchor:k.current,className:L,id:re,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...r,onMouseDownOutside:Ke},se={disabled:y,value:z,min:T,max:I,weekNumber:ye,focusedDate:Ie,className:s()?"k-calendar-lg":"",navigation:!s(),onChange:We},ce=Ne(),rt=Fe();return s()?o.createElement(ce,{_ref:te,...se}):o.createElement(rt,{...K},o.createElement(ce,{_ref:te,...se}))},ae=()=>{P({focused:!1}),g(!1)},je=()=>{const{windowWidth:t=0}=h,r={expand:u(),onClose:ae,title:Me,subTitle:Re,windowWidth:t};return o.createElement(gt.AdaptiveMode,{...r},o.createElement(mt.ActionSheetContent,null,oe()))},Ue=t=>{ne(t.value,t)},He=()=>{P({focused:!0})},Ye=()=>{g(!u())},F=()=>{y||(b.current=!0,g(!u()))},$e=t=>{t.preventDefault()},Xe=t=>{const{altKey:r,keyCode:c}=t;if(c===i.Keys.esc&&u()){b.current=!0,g(!1);return}r&&(c===i.Keys.up||c===i.Keys.down)&&(t.preventDefault(),t.stopPropagation(),b.current=c===i.Keys.up,g(c===i.Keys.down))},C=o.useRef(null),k=o.useRef(null),d=o.useRef(null),f=o.useRef(null);o.useImperativeHandle(C,()=>({props:n,get element(){return k.current},get calendar(){return f.current},get dateInput(){return d.current},get name(){return n.name},get show(){return u()},get validity(){return N()},get value(){return m()},get mobileMode(){return s()},togglePopup:Ye,focus:ze})),o.useImperativeHandle(v,()=>C.current);const R=o.useRef(void 0),S=o.useRef(void 0),Ze=o.useRef(null),b=o.useRef(!1),V=o.useRef(!1),O=o.useRef(null),[h,Ge]=o.useState({value:pe,show:fe,focused:!1}),[,Je]=o.useReducer(t=>t,!0),P=t=>{Ge(r=>({...r,...t}))};o.useEffect(()=>{f.current&&f.current.element&&u()&&!V.current&&f.current.element.focus({preventScroll:!0}),s()&&u()&&!V.current&&setTimeout(()=>{f.current&&f.current.element&&f.current.element.focus({preventScroll:!0})},300),d.current&&d.current.element&&!u()&&b.current&&d.current.element.focus({preventScroll:!0}),V.current=u(),b.current=!1}),o.useEffect(()=>{var t;return O.current=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(r=>Ve(r)),u()&&Je(),(t=A())!=null&&t.body&&O.current&&O.current.observe(A().body),()=>{var r;clearTimeout(Ze.current),(r=A())!=null&&r.body&&O.current&&O.current.disconnect()}},[]);const re=p+"-popup-id",Qe=oe(),et=qe(),tt=m(),nt=Ae(),ot=je(),le=!H||N().valid,ue=M.toLanguageString(j.toggleCalendar,j.messages[j.toggleCalendar]),at={disabled:y,format:ve,formatPlaceholder:Se,id:Te,ariaLabelledBy:Be,ariaDescribedBy:Ee,ariaLabel:Pe,max:I,min:T,name:n.name,onChange:Ue,required:n.required,_ref:d,tabIndex:u()?-1:we,title:n.title,valid:N().valid,validationMessage:$,validityStyles:H,value:tt,label:void 0,placeholder:h.focused?null:xe,ariaExpanded:u(),autoFill:n.autoFill,twoDigitYearMax:Oe,enableMouseWheel:n.enableMouseWheel,autoCorrectParts:n.autoCorrectParts,autoSwitchParts:Ce,autoSwitchKeys:ke,allowCaretMode:n.allowCaretMode,inputAttributes:_e},ie=o.createElement(i.AsyncFocusBlur,{onFocus:He,onBlur:s()?void 0:ae,onSyncBlur:n.onBlur,onSyncFocus:n.onFocus},t=>o.createElement(o.Fragment,null,o.createElement("span",{...n.label?{}:Q,ref:k,className:i.classNames("k-input","k-datepicker",{[`k-input-${i.kendoThemeMaps.sizeMap[B]||B}`]:B,[`k-rounded-${i.kendoThemeMaps.roundedMap[E]||E}`]:E,[`k-input-${x}`]:x,"k-invalid":!le,"k-required":ee(),"k-disabled":y},n.className),onKeyDown:Xe,style:{width:n.width},onFocus:s()?F:t.onFocus,onBlur:t.onBlur,onClick:s()?F:void 0},o.createElement(et,{_ref:d,ariaRole:"combobox",ariaExpanded:u(),ariaControls:re,autoFocus:De,...at}),o.createElement(nt,{type:"button",icon:"calendar",svgIcon:it.calendarIcon,title:ue,className:"k-input-button",onClick:s()?void 0:F,"aria-label":ue,fillMode:x,onMouseDown:$e}),!s()&&Qe),s()&&ot));return n.label?o.createElement(pt.PickerFloatingLabel,{dateInput:d,label:n.label,editorId:p,editorValid:le,editorDisabled:y,children:ie,style:{width:n.width},...Q}):ie});U.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:a.nullable(e.string),pattern:a.nullable(e.string),date:a.nullable(e.oneOf(["short","medium","long","full"])),time:a.nullable(e.oneOf(["short","medium","long","full"])),datetime:a.nullable(e.oneOf(["short","medium","long","full"])),era:a.nullable(e.oneOf(["narrow","short","long"])),year:a.nullable(e.oneOf(["numeric","2-digit"])),month:a.nullable(e.oneOf(["numeric","2-digit","narrow","short","long"])),day:a.nullable(e.oneOf(["numeric","2-digit"])),weekday:a.nullable(e.oneOf(["narrow","short","long"])),hour:a.nullable(e.oneOf(["numeric","2-digit"])),hour12:a.nullable(e.bool),minute:a.nullable(e.oneOf(["numeric","2-digit"])),second:a.nullable(e.oneOf(["numeric","2-digit"])),timeZoneName:a.nullable(e.oneOf(["short","long"]))})]),formatPlaceholder:e.oneOfType([a.nullable(e.oneOf(["wide","narrow","short","formatPattern"])),e.shape({year:a.nullable(e.string),month:a.nullable(e.string),day:a.nullable(e.string),hour:a.nullable(e.string),minute:a.nullable(e.string),second:a.nullable(e.string)})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:a.nullable(e.bool),appendTo:a.nullable(e.any),popupClass:a.nullable(e.string)}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full"]),fillMode:e.oneOf(["solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string,adaptiveSubtitle:e.string,autoFocus:e.bool,inputAttributes:e.object};const l={defaultShow:!1,defaultValue:null,dateInput:st.DateInput,calendar:ct.Calendar,toggleButton:ft.ToggleButton,popup:ut.Popup,disabled:!1,format:"d",max:a.MAX_DATE,min:a.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1},de=i.createPropsContext();U.displayName="KendoReactDatePicker";exports.DatePicker=U;exports.DatePickerPropsContext=de;exports.datePickerDefaultProps=l;
|