@progress/kendo-react-dateinputs 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823
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/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/dist/es/calendar/components/Calendar.d.ts +4 -4
- package/dist/es/calendar/components/Calendar.js +17 -5
- package/dist/es/calendar/components/Header.d.ts +1 -0
- package/dist/es/calendar/components/Header.js +1 -1
- package/dist/es/calendar/components/HorizontalViewList.js +1 -0
- package/dist/es/calendar/components/MultiViewCalendar.d.ts +3 -3
- package/dist/es/calendar/components/MultiViewCalendar.js +12 -5
- package/dist/es/calendar/components/Navigation.d.ts +1 -1
- package/dist/es/calendar/components/Navigation.js +9 -4
- package/dist/es/calendar/components/TodayCommand.js +4 -2
- package/dist/es/calendar/components/View.d.ts +4 -4
- package/dist/es/calendar/components/View.js +7 -5
- package/dist/es/calendar/components/ViewList.d.ts +3 -3
- package/dist/es/calendar/components/ViewList.js +10 -2
- package/dist/es/calendar/services/BusViewService.js +1 -1
- package/dist/es/calendar/services/CenturyViewService.js +2 -2
- package/dist/es/calendar/services/DOMService.js +24 -6
- package/dist/es/calendar/services/DecadeViewService.js +2 -2
- package/dist/es/calendar/services/MonthViewService.js +2 -2
- package/dist/es/calendar/services/NavigationService.js +1 -1
- package/dist/es/calendar/services/ScrollSyncService.js +5 -1
- package/dist/es/calendar/services/YearViewService.js +2 -2
- package/dist/es/calendar/utils/ScrollSync.d.ts +3 -3
- package/dist/es/calendar/utils/ScrollSync.js +2 -0
- package/dist/es/dateinput/DateInput.d.ts +11 -7
- package/dist/es/dateinput/DateInput.js +14 -8
- package/dist/es/dateinput/models/kendo-date.js +1 -1
- package/dist/es/dateinput/models/mask.js +1 -0
- package/dist/es/dateinput/utils.d.ts +1 -1
- package/dist/es/datepicker/DatePicker.d.ts +8 -8
- package/dist/es/datepicker/DatePicker.js +4 -3
- package/dist/es/daterangepicker/DateRangePicker.d.ts +7 -5
- package/dist/es/datetimepicker/DateTimePicker.d.ts +7 -7
- package/dist/es/datetimepicker/DateTimePicker.js +3 -3
- package/dist/es/datetimepicker/DateTimeSelector.d.ts +1 -1
- package/dist/es/datetimepicker/DateTimeSelector.js +5 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.d.ts +3 -3
- package/dist/es/timepicker/TimeList.js +25 -7
- package/dist/es/timepicker/TimePart.d.ts +4 -4
- package/dist/es/timepicker/TimePart.js +4 -1
- package/dist/es/timepicker/TimePicker.d.ts +8 -8
- package/dist/es/timepicker/TimePicker.js +4 -3
- package/dist/es/timepicker/TimeSelector.d.ts +2 -2
- package/dist/es/timepicker/TimeSelector.js +4 -0
- package/dist/es/timepicker/services/DOMService.js +2 -0
- package/dist/es/timepicker/services/DayPeriodService.js +9 -3
- package/dist/es/timepicker/services/HoursService.js +14 -5
- package/dist/es/timepicker/services/MinutesService.js +12 -6
- package/dist/es/timepicker/services/SecondsService.js +12 -6
- package/dist/es/utils.js +9 -5
- package/dist/es/virtualization/Virtualization.d.ts +2 -1
- package/dist/es/virtualization/Virtualization.js +14 -6
- package/dist/es/virtualization/services/RowHeightService.js +9 -5
- package/dist/es/virtualization/services/ScrollerService.js +9 -3
- package/dist/npm/calendar/components/Calendar.d.ts +4 -4
- package/dist/npm/calendar/components/Calendar.js +43 -31
- package/dist/npm/calendar/components/CalendarCell.js +1 -1
- package/dist/npm/calendar/components/CalendarNavigationItem.js +1 -1
- package/dist/npm/calendar/components/CalendarWeekCell.js +1 -1
- package/dist/npm/calendar/components/Header.d.ts +1 -0
- package/dist/npm/calendar/components/Header.js +3 -3
- package/dist/npm/calendar/components/HorizontalViewList.js +3 -2
- package/dist/npm/calendar/components/MultiViewCalendar.d.ts +3 -3
- package/dist/npm/calendar/components/MultiViewCalendar.js +49 -42
- package/dist/npm/calendar/components/Navigation.d.ts +1 -1
- package/dist/npm/calendar/components/Navigation.js +13 -8
- package/dist/npm/calendar/components/TodayCommand.js +9 -7
- package/dist/npm/calendar/components/View.d.ts +4 -4
- package/dist/npm/calendar/components/View.js +16 -14
- package/dist/npm/calendar/components/ViewList.d.ts +3 -3
- package/dist/npm/calendar/components/ViewList.js +19 -11
- package/dist/npm/calendar/services/BusViewService.js +1 -1
- package/dist/npm/calendar/services/CenturyViewService.js +38 -38
- package/dist/npm/calendar/services/DOMService.js +33 -15
- package/dist/npm/calendar/services/DecadeViewService.js +32 -32
- package/dist/npm/calendar/services/MonthViewService.js +36 -36
- package/dist/npm/calendar/services/NavigationService.js +1 -1
- package/dist/npm/calendar/services/ScrollSyncService.js +5 -1
- package/dist/npm/calendar/services/WeekNamesService.js +1 -1
- package/dist/npm/calendar/services/YearViewService.js +33 -33
- package/dist/npm/calendar/utils/ScrollSync.d.ts +3 -3
- package/dist/npm/calendar/utils/ScrollSync.js +2 -0
- package/dist/npm/common/PickerWrap.js +1 -1
- package/dist/npm/dateinput/DateInput.d.ts +11 -7
- package/dist/npm/dateinput/DateInput.js +32 -26
- package/dist/npm/dateinput/models/kendo-date.js +12 -12
- package/dist/npm/dateinput/models/mask.js +1 -0
- package/dist/npm/dateinput/utils.d.ts +1 -1
- package/dist/npm/datepicker/DatePicker.d.ts +8 -8
- package/dist/npm/datepicker/DatePicker.js +17 -16
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +7 -5
- package/dist/npm/daterangepicker/DateRangePicker.js +17 -17
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +7 -7
- package/dist/npm/datetimepicker/DateTimePicker.js +15 -15
- package/dist/npm/datetimepicker/DateTimeSelector.d.ts +1 -1
- package/dist/npm/datetimepicker/DateTimeSelector.js +13 -8
- package/dist/npm/hooks/usePickerFloatingLabel.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimeList.d.ts +3 -3
- package/dist/npm/timepicker/TimeList.js +29 -11
- package/dist/npm/timepicker/TimePart.d.ts +4 -4
- package/dist/npm/timepicker/TimePart.js +14 -11
- package/dist/npm/timepicker/TimePicker.d.ts +8 -8
- package/dist/npm/timepicker/TimePicker.js +19 -18
- package/dist/npm/timepicker/TimeSelector.d.ts +2 -2
- package/dist/npm/timepicker/TimeSelector.js +14 -10
- package/dist/npm/timepicker/services/DOMService.js +6 -4
- package/dist/npm/timepicker/services/DayPeriodService.js +10 -4
- package/dist/npm/timepicker/services/HoursService.js +20 -11
- package/dist/npm/timepicker/services/MinutesService.js +16 -10
- package/dist/npm/timepicker/services/SecondsService.js +16 -10
- package/dist/npm/timepicker/utils.js +11 -11
- package/dist/npm/utils.js +16 -12
- package/dist/npm/virtualization/Virtualization.d.ts +2 -1
- package/dist/npm/virtualization/Virtualization.js +16 -8
- package/dist/npm/virtualization/services/RowHeightService.js +9 -5
- package/dist/npm/virtualization/services/ScrollerService.js +9 -3
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +13 -13
|
@@ -18,6 +18,10 @@ export interface DateInputChangeEvent<T = DateInput> {
|
|
|
18
18
|
export interface DateInputProps<T extends DateInput = any> extends FormComponentProps, DateInputSettings {
|
|
19
19
|
/** @hidden */
|
|
20
20
|
_ref?: React.MutableRefObject<DateInput | null>;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
children?: React.ReactNode;
|
|
21
25
|
/**
|
|
22
26
|
* Sets a class of the DateInput DOM element.
|
|
23
27
|
*/
|
|
@@ -146,18 +150,18 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
146
150
|
required: PropTypes.Requireable<boolean>;
|
|
147
151
|
validate: PropTypes.Requireable<boolean>;
|
|
148
152
|
valid: PropTypes.Requireable<boolean>;
|
|
149
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
150
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
|
|
151
|
-
fillMode: PropTypes.Requireable<"flat" | "
|
|
153
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
154
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
|
|
155
|
+
fillMode: PropTypes.Requireable<"flat" | "outline" | "solid" | null | undefined>;
|
|
152
156
|
};
|
|
153
157
|
/**
|
|
154
158
|
* @hidden
|
|
155
159
|
*/
|
|
156
160
|
static defaultProps: {
|
|
157
161
|
format: string;
|
|
158
|
-
size: "small" | "medium" | "large";
|
|
159
|
-
rounded: "small" | "medium" | "full" | "large";
|
|
160
|
-
fillMode: "flat" | "
|
|
162
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
163
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
164
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
161
165
|
formatPlaceholder: DateInputFormatPlaceholder;
|
|
162
166
|
spinners: boolean;
|
|
163
167
|
disabled: boolean;
|
|
@@ -168,7 +172,7 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
168
172
|
required: boolean;
|
|
169
173
|
validityStyles: boolean;
|
|
170
174
|
validationMessage: string;
|
|
171
|
-
placeholder:
|
|
175
|
+
placeholder: null;
|
|
172
176
|
};
|
|
173
177
|
private kendoDate;
|
|
174
178
|
private currentFormat;
|
|
@@ -24,10 +24,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
28
|
-
for (var i = 0,
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
28
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
29
|
+
if (ar || !(i in from)) {
|
|
30
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
31
|
+
ar[i] = from[i];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
35
|
};
|
|
32
36
|
import * as React from 'react';
|
|
33
37
|
import * as PropTypes from 'prop-types';
|
|
@@ -52,10 +56,12 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
52
56
|
function DateInputWithoutContext(props) {
|
|
53
57
|
var _this = _super.call(this, props) || this;
|
|
54
58
|
_this.kendoDate = null;
|
|
59
|
+
_this.currentFormat = '';
|
|
55
60
|
_this.paste = false;
|
|
56
61
|
_this._element = null;
|
|
57
62
|
_this._wrapper = null;
|
|
58
63
|
_this._inputId = guid();
|
|
64
|
+
_this._lastSelectedSymbol = '';
|
|
59
65
|
/**
|
|
60
66
|
* @hidden
|
|
61
67
|
*/
|
|
@@ -260,7 +266,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
260
266
|
if (this.value !== null) {
|
|
261
267
|
ariaProps['aria-valuenow'] = this.value.getTime();
|
|
262
268
|
}
|
|
263
|
-
var wrapperClassesInstance = __spreadArray([], wrapperClasses);
|
|
269
|
+
var wrapperClassesInstance = __spreadArray([], wrapperClasses, true);
|
|
264
270
|
if (this.props.className) {
|
|
265
271
|
wrapperClassesInstance.push(this.props.className);
|
|
266
272
|
}
|
|
@@ -270,9 +276,9 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
270
276
|
return (React.createElement("span", { ref: function (span) { _this._wrapper = span; }, style: !label
|
|
271
277
|
? { width: _this.props.width }
|
|
272
278
|
: undefined, dir: _this.props.dir, className: classNames('k-dateinput', 'k-input', (_b = {},
|
|
273
|
-
_b["k-input-"
|
|
274
|
-
_b["k-input-"
|
|
275
|
-
_b["k-rounded-"
|
|
279
|
+
_b["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
280
|
+
_b["k-input-".concat(fillMode)] = fillMode,
|
|
281
|
+
_b["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
276
282
|
_b['k-invalid'] = !isValid,
|
|
277
283
|
_b['k-required'] = _this.required,
|
|
278
284
|
_b['k-disabled'] = _this.props.disabled,
|
|
@@ -324,7 +324,7 @@ var KendoDate = /** @class */ (function () {
|
|
|
324
324
|
return { text: resultText, format: resultFormat };
|
|
325
325
|
};
|
|
326
326
|
KendoDate.prototype.dateFieldName = function (part) {
|
|
327
|
-
var formatPlaceholder = this.formatPlaceholder || 'wide';
|
|
327
|
+
var formatPlaceholder = (this.formatPlaceholder || 'wide');
|
|
328
328
|
if (formatPlaceholder[part.type]) {
|
|
329
329
|
return formatPlaceholder[part.type];
|
|
330
330
|
}
|
|
@@ -143,16 +143,16 @@ export declare class DatePickerWithoutContext extends React.Component<DatePicker
|
|
|
143
143
|
required: PropTypes.Requireable<boolean>;
|
|
144
144
|
validate: PropTypes.Requireable<boolean>;
|
|
145
145
|
valid: PropTypes.Requireable<boolean>;
|
|
146
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
147
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
|
|
148
|
-
fillMode: PropTypes.Requireable<"flat" | "
|
|
146
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
147
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
|
|
148
|
+
fillMode: PropTypes.Requireable<"flat" | "outline" | "solid" | null | undefined>;
|
|
149
149
|
};
|
|
150
150
|
/**
|
|
151
151
|
* @hidden
|
|
152
152
|
*/
|
|
153
153
|
static defaultProps: {
|
|
154
154
|
defaultShow: boolean;
|
|
155
|
-
defaultValue:
|
|
155
|
+
defaultValue: null;
|
|
156
156
|
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
157
157
|
calendar: React.ComponentType<CalendarProps<any>>;
|
|
158
158
|
toggleButton: React.ComponentType<ToggleButtonProps>;
|
|
@@ -167,9 +167,9 @@ export declare class DatePickerWithoutContext extends React.Component<DatePicker
|
|
|
167
167
|
weekNumber: boolean;
|
|
168
168
|
required: boolean;
|
|
169
169
|
validityStyles: boolean;
|
|
170
|
-
size: "small" | "medium" | "large";
|
|
171
|
-
rounded: "small" | "medium" | "full" | "large";
|
|
172
|
-
fillMode: "flat" | "
|
|
170
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
171
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
172
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
173
173
|
};
|
|
174
174
|
/**
|
|
175
175
|
* @hidden
|
|
@@ -249,7 +249,7 @@ export declare class DatePickerWithoutContext extends React.Component<DatePicker
|
|
|
249
249
|
*/
|
|
250
250
|
render(): JSX.Element;
|
|
251
251
|
protected setCalendarRef: (calendar: any) => void;
|
|
252
|
-
protected nextValue: (nextProps: DatePickerProps, nextState: DatePickerState) => Date;
|
|
252
|
+
protected nextValue: (nextProps: DatePickerProps, nextState: DatePickerState) => Date | null;
|
|
253
253
|
protected nextShow: (nextProps: DatePickerProps, nextState: DatePickerState) => boolean;
|
|
254
254
|
protected setShow(show: boolean): void;
|
|
255
255
|
protected mergeTime(value: Date | null): Date | null;
|
|
@@ -60,6 +60,7 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
60
60
|
_this._dateInput = React.createRef();
|
|
61
61
|
_this._calendar = null;
|
|
62
62
|
_this.shouldFocusDateInput = false;
|
|
63
|
+
_this.prevShow = false;
|
|
63
64
|
/**
|
|
64
65
|
* @hidden
|
|
65
66
|
*/
|
|
@@ -406,9 +407,9 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
406
407
|
var _b;
|
|
407
408
|
var onFocus = _a.onFocus, onBlur = _a.onBlur;
|
|
408
409
|
return (React.createElement("span", { role: "group", "aria-expanded": _this.show, ref: function (span) { _this._element = span; }, className: classNames('k-input', 'k-datepicker', (_b = {},
|
|
409
|
-
_b["k-input-"
|
|
410
|
-
_b["k-rounded-"
|
|
411
|
-
_b["k-input-"
|
|
410
|
+
_b["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
411
|
+
_b["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
412
|
+
_b["k-input-".concat(fillMode)] = fillMode,
|
|
412
413
|
_b['k-invalid'] = !isValid,
|
|
413
414
|
_b['k-required'] = _this.required,
|
|
414
415
|
_b['k-disabled'] = _this.props.disabled,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import { DateInput } from '../dateinput/DateInput';
|
|
4
|
-
import { MultiViewCalendar } from '../calendar/components/MultiViewCalendar';
|
|
4
|
+
import { MultiViewCalendar, MultiViewCalendarHandle } from '../calendar/components/MultiViewCalendar';
|
|
5
5
|
import { SelectionRange } from '../calendar/models';
|
|
6
6
|
import { DateRangePickerSettings } from './models';
|
|
7
7
|
/**
|
|
@@ -125,9 +125,11 @@ export declare class DateRangePickerWithoutContext extends React.Component<DateR
|
|
|
125
125
|
required: PropTypes.Requireable<boolean>;
|
|
126
126
|
validate: PropTypes.Requireable<boolean>;
|
|
127
127
|
valid: PropTypes.Requireable<boolean>;
|
|
128
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
129
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
|
|
130
|
-
fillMode: PropTypes.Requireable<"flat" | "
|
|
128
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
129
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
|
|
130
|
+
fillMode: PropTypes.Requireable<"flat" | "outline" | "solid" | null | undefined>; /**
|
|
131
|
+
* Gets the wrapping element of the DateRangePicker.
|
|
132
|
+
*/
|
|
131
133
|
}>>;
|
|
132
134
|
focusedDate: PropTypes.Requireable<Date>;
|
|
133
135
|
format: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
@@ -235,7 +237,7 @@ export declare class DateRangePickerWithoutContext extends React.Component<DateR
|
|
|
235
237
|
* @hidden
|
|
236
238
|
*/
|
|
237
239
|
render(): JSX.Element;
|
|
238
|
-
protected setCalendarRef: (calendar:
|
|
240
|
+
protected setCalendarRef: (calendar: MultiViewCalendarHandle | null) => void;
|
|
239
241
|
protected focusCalendarElement: () => void;
|
|
240
242
|
protected focusDateInputElement(): void;
|
|
241
243
|
protected calculateValue: (props: DateRangePickerProps, state: DateRangePickerState) => SelectionRange;
|
|
@@ -145,16 +145,16 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
145
145
|
validate: PropTypes.Requireable<boolean>;
|
|
146
146
|
valid: PropTypes.Requireable<boolean>;
|
|
147
147
|
cancelButton: PropTypes.Requireable<boolean>;
|
|
148
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
149
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
|
|
150
|
-
fillMode: PropTypes.Requireable<"flat" | "
|
|
148
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
149
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
|
|
150
|
+
fillMode: PropTypes.Requireable<"flat" | "outline" | "solid" | null | undefined>;
|
|
151
151
|
};
|
|
152
152
|
/**
|
|
153
153
|
* @hidden
|
|
154
154
|
*/
|
|
155
155
|
static defaultProps: {
|
|
156
156
|
defaultShow: boolean;
|
|
157
|
-
defaultValue:
|
|
157
|
+
defaultValue: null;
|
|
158
158
|
disabled: boolean;
|
|
159
159
|
format: string;
|
|
160
160
|
max: Date;
|
|
@@ -166,9 +166,9 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
166
166
|
validityStyles: boolean;
|
|
167
167
|
cancelButton: boolean;
|
|
168
168
|
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
169
|
-
size: "small" | "medium" | "large";
|
|
170
|
-
rounded: "small" | "medium" | "full" | "large";
|
|
171
|
-
fillMode: "flat" | "
|
|
169
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
170
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
171
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
172
172
|
};
|
|
173
173
|
/**
|
|
174
174
|
* @hidden
|
|
@@ -333,9 +333,9 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
333
333
|
return (React.createElement("div", { ref: function (div) {
|
|
334
334
|
_this._element = div;
|
|
335
335
|
}, className: classNames('k-input', 'k-datetimepicker', (_b = {},
|
|
336
|
-
_b["k-input-"
|
|
337
|
-
_b["k-rounded-"
|
|
338
|
-
_b["k-input-"
|
|
336
|
+
_b["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
337
|
+
_b["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
338
|
+
_b["k-input-".concat(fillMode)] = fillMode,
|
|
339
339
|
_b['k-invalid'] = !isValid,
|
|
340
340
|
_b['k-required'] = _this.required,
|
|
341
341
|
_b['k-disabled'] = _this.props.disabled,
|
|
@@ -71,7 +71,7 @@ export declare class DateTimeSelector extends React.Component<DateTimeSelectorPr
|
|
|
71
71
|
protected get minTime(): Date | null;
|
|
72
72
|
protected get maxTime(): Date | null;
|
|
73
73
|
protected normalizeRange(candidate: Date, value: Date | null): Date | null;
|
|
74
|
-
protected hasActiveButton(): boolean;
|
|
74
|
+
protected hasActiveButton(): boolean | null;
|
|
75
75
|
protected mergeTime(current: Date | null, candidate: Date | null): Date | null;
|
|
76
76
|
protected mergeDate(candidate: Date | null, value: Date): Date | null;
|
|
77
77
|
protected move: (direction: 'left' | 'right') => void;
|
|
@@ -42,7 +42,12 @@ var DateTimeSelector = /** @class */ (function (_super) {
|
|
|
42
42
|
__extends(DateTimeSelector, _super);
|
|
43
43
|
function DateTimeSelector(props) {
|
|
44
44
|
var _this = _super.call(this, props) || this;
|
|
45
|
+
_this._calendar = null;
|
|
46
|
+
_this._timePart = null;
|
|
47
|
+
_this._cancelButton = null;
|
|
48
|
+
_this._acceptButton = null;
|
|
45
49
|
_this._calendarWrap = null;
|
|
50
|
+
_this.shouldFocusPart = false;
|
|
46
51
|
_this.focus = function (args) {
|
|
47
52
|
// Async to avoid stealing the focus from the DateInput on close
|
|
48
53
|
Promise.resolve().then(function () {
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-dateinputs',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1654761838,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -29,8 +29,8 @@ export declare class TimeList extends React.Component<TimeListProps, {}> {
|
|
|
29
29
|
id: PropTypes.Requireable<number>;
|
|
30
30
|
max: PropTypes.Requireable<Date>;
|
|
31
31
|
min: PropTypes.Requireable<Date>;
|
|
32
|
-
part: (props: TimeListProps, propName: string, componentName: string) =>
|
|
33
|
-
step: (props: TimeListProps, propName: string, componentName: string) =>
|
|
32
|
+
part: (props: TimeListProps, propName: string, componentName: string) => null;
|
|
33
|
+
step: (props: TimeListProps, propName: string, componentName: string) => null;
|
|
34
34
|
value: PropTypes.Requireable<Date>;
|
|
35
35
|
smoothScroll: PropTypes.Requireable<boolean>;
|
|
36
36
|
show: PropTypes.Requireable<boolean>;
|
|
@@ -71,7 +71,7 @@ export declare class TimeList extends React.Component<TimeListProps, {}> {
|
|
|
71
71
|
/**
|
|
72
72
|
* @hidden
|
|
73
73
|
*/
|
|
74
|
-
render(): JSX.Element;
|
|
74
|
+
render(): JSX.Element | undefined;
|
|
75
75
|
focus: (args?: any) => void;
|
|
76
76
|
protected itemOffset: (scrollTop: number) => number;
|
|
77
77
|
protected calculateHeights: () => void;
|
|
@@ -45,6 +45,16 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
45
45
|
__extends(TimeList, _super);
|
|
46
46
|
function TimeList(props) {
|
|
47
47
|
var _this = _super.call(this, props) || this;
|
|
48
|
+
_this.intl = null;
|
|
49
|
+
_this._element = null;
|
|
50
|
+
_this.service = null;
|
|
51
|
+
_this.virtualization = null;
|
|
52
|
+
_this.topOffset = 0;
|
|
53
|
+
_this.bottomOffset = 0;
|
|
54
|
+
_this.itemHeight = 0;
|
|
55
|
+
_this.listHeight = 0;
|
|
56
|
+
_this.topThreshold = 0;
|
|
57
|
+
_this.bottomThreshold = 0;
|
|
48
58
|
_this.animateToIndex = false;
|
|
49
59
|
_this.focus = function (args) {
|
|
50
60
|
Promise.resolve().then(function () {
|
|
@@ -55,7 +65,7 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
55
65
|
});
|
|
56
66
|
};
|
|
57
67
|
_this.itemOffset = function (scrollTop) {
|
|
58
|
-
if (!_this.virtualization) {
|
|
68
|
+
if (!_this.virtualization || !_this.service) {
|
|
59
69
|
return -1;
|
|
60
70
|
}
|
|
61
71
|
var valueIndex = _this.service.selectedIndex(_this.props.value);
|
|
@@ -82,8 +92,10 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
82
92
|
};
|
|
83
93
|
_this.configureServices = function (_a) {
|
|
84
94
|
var _b = _a === void 0 ? _this.props : _a, min = _b.min, max = _b.max, value = _b.value;
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
if (_this.service) {
|
|
96
|
+
var _c = _this.service.limitRange(min || _this.min, max || _this.max, value || _this.props.value), newMin = _c[0], newMax = _c[1];
|
|
97
|
+
_this.service.configure(_this.serviceSettings({ min: newMin, max: newMax }));
|
|
98
|
+
}
|
|
87
99
|
};
|
|
88
100
|
_this.serviceSettings = function (settings) {
|
|
89
101
|
var defaults = {
|
|
@@ -100,7 +112,7 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
100
112
|
};
|
|
101
113
|
_this.handleScrollAction = function (_a) {
|
|
102
114
|
var target = _a.target, animationInProgress = _a.animationInProgress;
|
|
103
|
-
if (!_this.virtualization) {
|
|
115
|
+
if (!_this.virtualization || !_this.service) {
|
|
104
116
|
return;
|
|
105
117
|
}
|
|
106
118
|
if (target && !animationInProgress) {
|
|
@@ -131,6 +143,9 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
131
143
|
}
|
|
132
144
|
};
|
|
133
145
|
_this.handleKeyDown = function (event) {
|
|
146
|
+
if (!_this.service) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
134
149
|
var keyCode = event.keyCode;
|
|
135
150
|
if (keyCode === Keys.down
|
|
136
151
|
|| keyCode === Keys.up
|
|
@@ -145,6 +160,9 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
145
160
|
}
|
|
146
161
|
};
|
|
147
162
|
_this.handleChange = function (dataItem) {
|
|
163
|
+
if (!_this.service) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
148
166
|
var candidate = _this.service.apply(_this.props.value, dataItem.value);
|
|
149
167
|
if (_this.props.value.getTime() === candidate.getTime()) {
|
|
150
168
|
return;
|
|
@@ -215,7 +233,7 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
215
233
|
* @hidden
|
|
216
234
|
*/
|
|
217
235
|
TimeList.prototype.componentDidUpdate = function () {
|
|
218
|
-
if (!this.virtualization) {
|
|
236
|
+
if (!this.virtualization || !this.service) {
|
|
219
237
|
return;
|
|
220
238
|
}
|
|
221
239
|
var index = this.service.selectedIndex(this.props.value);
|
|
@@ -252,14 +270,14 @@ var TimeList = /** @class */ (function (_super) {
|
|
|
252
270
|
part: function (props, propName, componentName) {
|
|
253
271
|
var prop = props[propName];
|
|
254
272
|
if (!prop || !services[prop.type]) {
|
|
255
|
-
throw new Error("\n Invalid prop '"
|
|
273
|
+
throw new Error("\n Invalid prop '".concat(propName, "' supplied to ").concat(componentName, ".\n Supported part types are hour|minute|second|dayperiod.\n "));
|
|
256
274
|
}
|
|
257
275
|
return null;
|
|
258
276
|
},
|
|
259
277
|
step: function (props, propName, componentName) {
|
|
260
278
|
var prop = props[propName];
|
|
261
279
|
if (prop !== undefined && prop <= 0) {
|
|
262
|
-
throw new Error("\n Invalid prop '"
|
|
280
|
+
throw new Error("\n Invalid prop '".concat(propName, "' supplied to ").concat(componentName, ".\n ").concat(propName, " cannot be less than 1.\n "));
|
|
263
281
|
}
|
|
264
282
|
return null;
|
|
265
283
|
},
|
|
@@ -82,7 +82,7 @@ export declare class TimePart extends React.Component<TimePartProps, TimePartSta
|
|
|
82
82
|
show: PropTypes.Requireable<boolean>;
|
|
83
83
|
};
|
|
84
84
|
static defaultProps: {
|
|
85
|
-
value:
|
|
85
|
+
value: null;
|
|
86
86
|
disabled: boolean;
|
|
87
87
|
nowButton: boolean;
|
|
88
88
|
cancelButton: boolean;
|
|
@@ -123,10 +123,10 @@ export declare class TimePart extends React.Component<TimePartProps, TimePartSta
|
|
|
123
123
|
protected timeFormatReducer: (acc: string, current: DateFormatPart) => string;
|
|
124
124
|
protected timeFormatFilter: (part: DateFormatPart, index: number, all: DateFormatPart[]) => boolean;
|
|
125
125
|
protected nextTick(f: () => any): void;
|
|
126
|
-
protected hasActiveButton(): boolean;
|
|
126
|
+
protected hasActiveButton(): boolean | null;
|
|
127
127
|
protected focusList: (dir: Direction) => void;
|
|
128
|
-
protected listReducer: (state: any, list: any, idx:
|
|
129
|
-
protected showNowButton: () => boolean;
|
|
128
|
+
protected listReducer: (state: any, list: any, idx: number, all: any) => any;
|
|
129
|
+
protected showNowButton: () => boolean | undefined;
|
|
130
130
|
protected hasSteps(): boolean;
|
|
131
131
|
private handleKeyDown;
|
|
132
132
|
private handleListBlur;
|
|
@@ -35,7 +35,7 @@ import { MIDNIGHT_DATE, MIN_TIME, MAX_TIME } from '../utils';
|
|
|
35
35
|
import { TIME_PART } from './models/TimePart';
|
|
36
36
|
import { generateSnappers, getNow, isInTimeRange, snapTime, timeInRange } from './utils';
|
|
37
37
|
import { Button } from '@progress/kendo-react-buttons';
|
|
38
|
-
var formatRegExp = new RegExp(TIME_PART.hour
|
|
38
|
+
var formatRegExp = new RegExp("".concat(TIME_PART.hour, "|").concat(TIME_PART.minute, "|").concat(TIME_PART.second, "|").concat(TIME_PART.dayperiod, "|literal"));
|
|
39
39
|
/**
|
|
40
40
|
* @hidden
|
|
41
41
|
*/
|
|
@@ -51,6 +51,9 @@ var TimePart = /** @class */ (function (_super) {
|
|
|
51
51
|
__extends(TimePart, _super);
|
|
52
52
|
function TimePart(props) {
|
|
53
53
|
var _this = _super.call(this, props) || this;
|
|
54
|
+
_this._element = null;
|
|
55
|
+
_this._nowButton = null;
|
|
56
|
+
_this.dateFormatParts = [];
|
|
54
57
|
_this.timeLists = [];
|
|
55
58
|
_this.focus = function (args) {
|
|
56
59
|
Promise.resolve().then(function () {
|
|
@@ -145,16 +145,16 @@ export declare class TimePickerWithoutContext extends React.Component<TimePicker
|
|
|
145
145
|
required: PropTypes.Requireable<boolean>;
|
|
146
146
|
validate: PropTypes.Requireable<boolean>;
|
|
147
147
|
valid: PropTypes.Requireable<boolean>;
|
|
148
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
149
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
|
|
150
|
-
fillMode: PropTypes.Requireable<"flat" | "
|
|
148
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
149
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
|
|
150
|
+
fillMode: PropTypes.Requireable<"flat" | "outline" | "solid" | null | undefined>;
|
|
151
151
|
};
|
|
152
152
|
/**
|
|
153
153
|
* @hidden
|
|
154
154
|
*/
|
|
155
155
|
static defaultProps: {
|
|
156
156
|
defaultShow: boolean;
|
|
157
|
-
defaultValue:
|
|
157
|
+
defaultValue: null;
|
|
158
158
|
disabled: boolean;
|
|
159
159
|
format: string;
|
|
160
160
|
max: Date;
|
|
@@ -165,9 +165,9 @@ export declare class TimePickerWithoutContext extends React.Component<TimePicker
|
|
|
165
165
|
required: boolean;
|
|
166
166
|
validityStyles: boolean;
|
|
167
167
|
dateInput: React.ComponentType<DateInputProps<any>>;
|
|
168
|
-
size: "small" | "medium" | "large";
|
|
169
|
-
rounded: "small" | "medium" | "full" | "large";
|
|
170
|
-
fillMode: "flat" | "
|
|
168
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
169
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
170
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
171
171
|
};
|
|
172
172
|
/**
|
|
173
173
|
* @hidden
|
|
@@ -238,7 +238,7 @@ export declare class TimePickerWithoutContext extends React.Component<TimePicker
|
|
|
238
238
|
* @hidden
|
|
239
239
|
*/
|
|
240
240
|
render(): JSX.Element;
|
|
241
|
-
protected setTimeSelectorRef: (timeSelector:
|
|
241
|
+
protected setTimeSelectorRef: (timeSelector: TimeSelector | null) => void;
|
|
242
242
|
protected nextValue: (nextProps: TimePickerProps, nextState: TimePickerState) => Date | null;
|
|
243
243
|
protected nextShow: (nextProps: TimePickerProps, nextState: TimePickerState) => boolean;
|
|
244
244
|
protected normalizeTime(date: Date): Date;
|
|
@@ -60,6 +60,7 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
60
60
|
_this._dateInput = React.createRef();
|
|
61
61
|
_this._timeSelector = null;
|
|
62
62
|
_this.shouldFocusDateInput = false;
|
|
63
|
+
_this.prevShow = false;
|
|
63
64
|
/**
|
|
64
65
|
* @hidden
|
|
65
66
|
*/
|
|
@@ -372,9 +373,9 @@ var TimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
372
373
|
var _b;
|
|
373
374
|
var onFocus = _a.onFocus, onBlur = _a.onBlur;
|
|
374
375
|
return (React.createElement("div", { ref: function (span) { _this._element = span; }, className: classNames('k-input', 'k-timepicker', (_b = {},
|
|
375
|
-
_b["k-input-"
|
|
376
|
-
_b["k-rounded-"
|
|
377
|
-
_b["k-input-"
|
|
376
|
+
_b["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
377
|
+
_b["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
378
|
+
_b["k-input-".concat(fillMode)] = fillMode,
|
|
378
379
|
_b['k-invalid'] = !isValid,
|
|
379
380
|
_b['k-required'] = _this.required,
|
|
380
381
|
_b['k-disabled'] = _this.props.disabled,
|
|
@@ -84,7 +84,7 @@ export declare class TimeSelector extends React.Component<TimeSelectorProps, Tim
|
|
|
84
84
|
show: PropTypes.Requireable<boolean>;
|
|
85
85
|
};
|
|
86
86
|
static defaultProps: {
|
|
87
|
-
value:
|
|
87
|
+
value: null;
|
|
88
88
|
disabled: boolean;
|
|
89
89
|
cancelButton: boolean;
|
|
90
90
|
format: string;
|
|
@@ -119,7 +119,7 @@ export declare class TimeSelector extends React.Component<TimeSelectorProps, Tim
|
|
|
119
119
|
render(): JSX.Element;
|
|
120
120
|
focusActiveList: () => void;
|
|
121
121
|
protected nextTick(f: () => any): void;
|
|
122
|
-
protected hasActiveButton(): boolean;
|
|
122
|
+
protected hasActiveButton(): boolean | null;
|
|
123
123
|
private handleKeyDown;
|
|
124
124
|
private handleAccept;
|
|
125
125
|
private handleReject;
|
|
@@ -49,6 +49,10 @@ var TimeSelector = /** @class */ (function (_super) {
|
|
|
49
49
|
__extends(TimeSelector, _super);
|
|
50
50
|
function TimeSelector(props) {
|
|
51
51
|
var _this = _super.call(this, props) || this;
|
|
52
|
+
_this._element = null;
|
|
53
|
+
_this._cancelButton = null;
|
|
54
|
+
_this._acceptButton = null;
|
|
55
|
+
_this.timePart = null;
|
|
52
56
|
_this.focusActiveList = function () {
|
|
53
57
|
if (!_this.timePart) {
|
|
54
58
|
return;
|
|
@@ -5,6 +5,8 @@ import { canUseDOM } from '@progress/kendo-react-common';
|
|
|
5
5
|
*/
|
|
6
6
|
var DOMService = /** @class */ (function () {
|
|
7
7
|
function DOMService() {
|
|
8
|
+
this.itemHeight = 0;
|
|
9
|
+
this.timeListHeight = 0;
|
|
8
10
|
this.didCalculate = false;
|
|
9
11
|
}
|
|
10
12
|
DOMService.prototype.ensureHeights = function () {
|
|
@@ -14,6 +14,9 @@ var inReverseRange = function (value, min, max) { return ((!min && !max) || valu
|
|
|
14
14
|
var DayPeriodService = /** @class */ (function () {
|
|
15
15
|
function DayPeriodService(intl) {
|
|
16
16
|
this.intl = intl;
|
|
17
|
+
this.min = null;
|
|
18
|
+
this.max = null;
|
|
19
|
+
this.part = null;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* @hidden
|
|
@@ -42,8 +45,8 @@ var DayPeriodService = /** @class */ (function () {
|
|
|
42
45
|
* @hidden
|
|
43
46
|
*/
|
|
44
47
|
DayPeriodService.prototype.data = function (_) {
|
|
45
|
-
var names = this.part.names;
|
|
46
|
-
if (!names) {
|
|
48
|
+
var names = this.part && this.part.names;
|
|
49
|
+
if (!names || !this.min) {
|
|
47
50
|
return [];
|
|
48
51
|
}
|
|
49
52
|
var data = [];
|
|
@@ -86,7 +89,7 @@ var DayPeriodService = /** @class */ (function () {
|
|
|
86
89
|
* @hidden
|
|
87
90
|
*/
|
|
88
91
|
DayPeriodService.prototype.selectedIndex = function (value) {
|
|
89
|
-
if (!this.valueInList(value)) {
|
|
92
|
+
if (!this.valueInList(value) || !this.min) {
|
|
90
93
|
return -1;
|
|
91
94
|
}
|
|
92
95
|
var index = Math.floor(value.getHours() / 12);
|
|
@@ -96,6 +99,9 @@ var DayPeriodService = /** @class */ (function () {
|
|
|
96
99
|
* @hidden
|
|
97
100
|
*/
|
|
98
101
|
DayPeriodService.prototype.valueInList = function (value) {
|
|
102
|
+
if (!this.min || !this.max) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
99
105
|
var reverse = this.min.getHours() !== this.normalizedRange()[0];
|
|
100
106
|
var isInRange = reverse ? inReverseRange : inRange;
|
|
101
107
|
return isInRange(value.getHours(), this.min.getHours(), this.max.getHours());
|