@progress/kendo-react-dateinputs 5.14.0-dev.202305171438 → 5.14.0-dev.202305231015
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/MultiViewCalendar.d.ts +1 -0
- package/dist/es/calendar/components/MultiViewCalendar.js +14 -2
- package/dist/es/datepicker/DatePicker.js +6 -6
- package/dist/es/datetimepicker/DateTimePicker.d.ts +18 -0
- package/dist/es/datetimepicker/DateTimePicker.js +98 -28
- package/dist/es/datetimepicker/DateTimeSelector.d.ts +13 -3
- package/dist/es/datetimepicker/DateTimeSelector.js +27 -10
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/calendar/components/MultiViewCalendar.d.ts +1 -0
- package/dist/npm/calendar/components/MultiViewCalendar.js +14 -2
- package/dist/npm/datepicker/DatePicker.js +6 -6
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +18 -0
- package/dist/npm/datetimepicker/DateTimePicker.js +96 -26
- package/dist/npm/datetimepicker/DateTimeSelector.d.ts +13 -3
- package/dist/npm/datetimepicker/DateTimeSelector.js +27 -10
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +13 -13
|
@@ -108,6 +108,7 @@ export declare class MultiViewCalendarWithoutContext extends React.Component<Mul
|
|
|
108
108
|
private calendarViewList;
|
|
109
109
|
private isActive;
|
|
110
110
|
private calculateFocusFromValue;
|
|
111
|
+
private isRtl;
|
|
111
112
|
/**
|
|
112
113
|
* Gets the wrapping element of the MultiViewCalendar component.
|
|
113
114
|
*/
|
|
@@ -39,6 +39,12 @@ import { BusViewService, NavigationService } from '../services';
|
|
|
39
39
|
import { dateInRange, isInRange, viewInRange, getToday, nullable } from '../../utils';
|
|
40
40
|
import { HorizontalViewList } from './HorizontalViewList';
|
|
41
41
|
import { TodayCommand } from './TodayCommand';
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
function isRtl(element) {
|
|
46
|
+
return Boolean(element && getComputedStyle(element).direction === 'rtl');
|
|
47
|
+
}
|
|
42
48
|
var extractDateFromValue = function (min, max, value) {
|
|
43
49
|
if (min === void 0) { min = MultiViewCalendarWithoutContext.defaultProps.min; }
|
|
44
50
|
if (max === void 0) { max = MultiViewCalendarWithoutContext.defaultProps.max; }
|
|
@@ -88,6 +94,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
88
94
|
_this.calendarViewList = null;
|
|
89
95
|
_this.isActive = false;
|
|
90
96
|
_this.calculateFocusFromValue = true;
|
|
97
|
+
_this.isRtl = false;
|
|
91
98
|
/**
|
|
92
99
|
* @hidden
|
|
93
100
|
*/
|
|
@@ -409,6 +416,11 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
409
416
|
*/
|
|
410
417
|
MultiViewCalendarWithoutContext.prototype.componentDidMount = function () {
|
|
411
418
|
this.calculateFocusFromValue = true;
|
|
419
|
+
var rtl = isRtl(this._element);
|
|
420
|
+
this.isRtl = rtl;
|
|
421
|
+
if (this.isRtl) {
|
|
422
|
+
this.forceUpdate();
|
|
423
|
+
}
|
|
412
424
|
};
|
|
413
425
|
/**
|
|
414
426
|
* @hidden
|
|
@@ -463,9 +475,9 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
463
475
|
var activeDate = cloneDate(this.dates && this.dates[0] ? this.dates[0] : getToday());
|
|
464
476
|
return (React.createElement("div", { ref: function (el) { _this._element = el; }, className: wrapperClassName, id: this.props.id || this.wrapperID, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, tabIndex: !this.props.disabled ? this.props.tabIndex : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, onClick: this.handleClick, onKeyDown: this.handleKeyDown, "aria-disabled": this.props.disabled },
|
|
465
477
|
React.createElement(Header, { key: ".kendo.calendar.header.".concat(activeDate.getTime()), activeView: activeView, currentDate: activeDate, min: this.min, max: this.max, rangeLength: this.props.views, bus: this.bus, service: this.service, headerTitle: this.props.headerTitle, commands: (React.createElement(React.Fragment, null,
|
|
466
|
-
React.createElement(Button, __assign({ type: "button", className: "k-calendar-nav-prev", icon:
|
|
478
|
+
React.createElement(Button, __assign({ type: "button", className: "k-calendar-nav-prev", icon: this.isRtl ? 'chevron-right' : 'chevron-left', svgIcon: this.isRtl ? chevronRightIcon : chevronLeftIcon, fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
|
|
467
479
|
React.createElement(TodayCommand, { min: this.min, max: this.max, onClick: this.handleTodayClick, disabled: !this.todayIsInRange }),
|
|
468
|
-
React.createElement(Button, __assign({ type: "button", className: "k-calendar-nav-next", icon:
|
|
480
|
+
React.createElement(Button, __assign({ type: "button", className: "k-calendar-nav-next", icon: this.isRtl ? 'chevron-left' : 'chevron-right', svgIcon: this.isRtl ? chevronLeftIcon : chevronRightIcon, fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
|
|
469
481
|
React.createElement(HorizontalViewList, { ref: function (el) { _this.calendarViewList = el; }, dates: this.dates, activeView: activeView, focusedDate: this.focusedDate, min: this.min, max: this.max, bus: this.bus, service: this.service, selectionRange: visualizedRange, value: this.selectedMultiple || this.selectedDate, cellUID: this.cellUID, views: this.props.views, onChange: this.handleDateChange, showWeekNumbers: this.props.weekNumber, onCellEnter: this.handleCellEnter, cell: this.props.cell, weekCell: this.props.weekCell, headerTitle: this.props.headerTitle })));
|
|
470
482
|
};
|
|
471
483
|
/**
|
|
@@ -142,7 +142,9 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
142
142
|
});
|
|
143
143
|
_this.valueDuringOnChange = value;
|
|
144
144
|
_this.showDuringOnChange = false;
|
|
145
|
-
_this.
|
|
145
|
+
if (!_this.mobileMode) {
|
|
146
|
+
_this.shouldFocusDateInput = true;
|
|
147
|
+
}
|
|
146
148
|
var onChange = _this.props.onChange;
|
|
147
149
|
if (onChange) {
|
|
148
150
|
onChange.call(undefined, {
|
|
@@ -428,12 +430,10 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
428
430
|
*/
|
|
429
431
|
DatePickerWithoutContext.prototype.render = function () {
|
|
430
432
|
var _this = this;
|
|
431
|
-
var _a = this.props, _b = _a.size, size = _b === void 0 ? DatePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? DatePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? DatePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, format = _a.format, formatPlaceholder = _a.formatPlaceholder, min = _a.min, max = _a.max, className = _a.className, width = _a.width, name = _a.name, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, ariaLabel = _a.ariaLabel
|
|
432
|
-
var _e = this.state.windowWidth, windowWidth = _e === void 0 ? 0 : _e;
|
|
433
|
+
var _a = this.props, _b = _a.size, size = _b === void 0 ? DatePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? DatePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? DatePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, format = _a.format, formatPlaceholder = _a.formatPlaceholder, min = _a.min, max = _a.max, className = _a.className, width = _a.width, name = _a.name, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, ariaLabel = _a.ariaLabel;
|
|
433
434
|
var show = this.show;
|
|
434
435
|
var value = this.value;
|
|
435
436
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
436
|
-
var renderAdaptive = windowWidth <= MOBILE_MEDIUM_DEVISE && adaptive;
|
|
437
437
|
var dateInputProps = {
|
|
438
438
|
disabled: disabled,
|
|
439
439
|
format: format,
|
|
@@ -476,8 +476,8 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
476
476
|
_b), className), onKeyDown: _this.handleKeyDown, style: { width: width }, onFocus: onFocus, onBlur: onBlur, onClick: _this.mobileMode ? _this.handleIconClick : undefined },
|
|
477
477
|
React.createElement(_this.dateInputComp, __assign({ _ref: _this._dateInput, ariaRole: 'combobox', readonly: _this.mobileMode, ariaExpanded: _this.show, ariaControls: _this._popupId }, dateInputProps)),
|
|
478
478
|
React.createElement(_this.toggleButtonComp, { type: "button", icon: "calendar", svgIcon: calendarIcon, title: toggleButtonTitle, className: "k-input-button", rounded: null, onClick: _this.handleIconClick, "aria-label": toggleButtonTitle, onMouseDown: _this.handleIconMouseDown }),
|
|
479
|
-
!
|
|
480
|
-
|
|
479
|
+
!_this.mobileMode && _this.renderPopup()),
|
|
480
|
+
_this.mobileMode && _this.renderAdaptivePopup()));
|
|
481
481
|
}));
|
|
482
482
|
return this.props.label
|
|
483
483
|
? (React.createElement(PickerFloatingLabel, { dateInput: this._dateInput, label: this.props.label, editorId: id, editorValid: isValid, editorDisabled: this.props.disabled, children: datepicker, style: { width: this.props.width } }))
|
|
@@ -74,6 +74,14 @@ export interface DateTimePickerProps extends DateTimePickerSettings, FormCompone
|
|
|
74
74
|
* @default `solid`
|
|
75
75
|
*/
|
|
76
76
|
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
77
|
+
/**
|
|
78
|
+
* Providing different rendering of the popup element based on the screen dimensions.
|
|
79
|
+
*/
|
|
80
|
+
adaptive?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Specifies the text that is rendered as title in the adaptive popup.
|
|
83
|
+
*/
|
|
84
|
+
adaptiveTitle?: string;
|
|
77
85
|
}
|
|
78
86
|
/**
|
|
79
87
|
* @hidden
|
|
@@ -82,6 +90,7 @@ export interface DateTimePickerState {
|
|
|
82
90
|
value: Date | null;
|
|
83
91
|
show: boolean;
|
|
84
92
|
focused: boolean;
|
|
93
|
+
windowWidth?: number;
|
|
85
94
|
}
|
|
86
95
|
/** @hidden */
|
|
87
96
|
export declare class DateTimePickerWithoutContext extends React.Component<DateTimePickerProps, DateTimePickerState> implements FormComponent {
|
|
@@ -183,6 +192,8 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
183
192
|
private nextTickId;
|
|
184
193
|
private shouldFocusDateInput;
|
|
185
194
|
private prevShow;
|
|
195
|
+
private observerResize?;
|
|
196
|
+
private get document();
|
|
186
197
|
constructor(props: DateTimePickerProps);
|
|
187
198
|
/**
|
|
188
199
|
* Gets the wrapping element of the DateTimePicker.
|
|
@@ -204,6 +215,10 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
204
215
|
* Gets the `name` property of the DateTimePicker.
|
|
205
216
|
*/
|
|
206
217
|
get name(): string | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* The mobile mode of the ComboBox.
|
|
220
|
+
*/
|
|
221
|
+
get mobileMode(): boolean;
|
|
207
222
|
protected get min(): Date;
|
|
208
223
|
protected get max(): Date;
|
|
209
224
|
/**
|
|
@@ -242,6 +257,8 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
242
257
|
* @hidden
|
|
243
258
|
*/
|
|
244
259
|
render(): JSX.Element;
|
|
260
|
+
private renderPicker;
|
|
261
|
+
private renderAdaptivePopup;
|
|
245
262
|
protected setShow(show: boolean): void;
|
|
246
263
|
protected nextTick(f: () => any): void;
|
|
247
264
|
private handleReject;
|
|
@@ -252,6 +269,7 @@ export declare class DateTimePickerWithoutContext extends React.Component<DateTi
|
|
|
252
269
|
private handleIconMouseDown;
|
|
253
270
|
private handleKeyDown;
|
|
254
271
|
private dateInputElement;
|
|
272
|
+
private calculateMedia;
|
|
255
273
|
}
|
|
256
274
|
/**
|
|
257
275
|
* Represents the PropsContext of the `DateTimePicker` component.
|
|
@@ -31,16 +31,19 @@ import { cloneDate } from '@progress/kendo-date-math';
|
|
|
31
31
|
import { classNames, guid, Keys, AsyncFocusBlur, createPropsContext, withPropsContext, kendoThemeMaps } from '@progress/kendo-react-common';
|
|
32
32
|
import { calendarIcon } from '@progress/kendo-svg-icons';
|
|
33
33
|
import { DateInput } from '../dateinput/DateInput';
|
|
34
|
-
import { validatePackage } from '@progress/kendo-react-common';
|
|
34
|
+
import { validatePackage, canUseDOM } from '@progress/kendo-react-common';
|
|
35
35
|
import { Button } from '@progress/kendo-react-buttons';
|
|
36
36
|
import { packageMetadata } from '../package-metadata';
|
|
37
37
|
import { MIN_DATE, MAX_DATE, isInDateRange, MAX_TIME } from '../utils';
|
|
38
|
-
import {
|
|
38
|
+
import { MOBILE_MEDIUM_DEVISE } from '../common/constants';
|
|
39
|
+
import { dateTimePickerCancel, dateTimePickerSet, messages, toggleDateTimeSelector } from '../messages';
|
|
39
40
|
import { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
40
41
|
import { DateTimeSelector } from './DateTimeSelector';
|
|
41
42
|
import { isInTimeRange } from '../timepicker/utils';
|
|
42
43
|
import { MIN_TIME } from '../utils';
|
|
43
44
|
import { PickerFloatingLabel } from '../hooks/usePickerFloatingLabel';
|
|
45
|
+
import { AdaptiveMode } from '../common/AdaptiveMode';
|
|
46
|
+
import { ActionSheetContent } from '@progress/kendo-react-layout';
|
|
44
47
|
/** @hidden */
|
|
45
48
|
var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
46
49
|
__extends(DateTimePickerWithoutContext, _super);
|
|
@@ -61,6 +64,31 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
61
64
|
dateInputElement.focus();
|
|
62
65
|
}
|
|
63
66
|
};
|
|
67
|
+
_this.renderPicker = function () {
|
|
68
|
+
var _a = _this.props, disabled = _a.disabled, minTime = _a.minTime, maxTime = _a.maxTime, format = _a.format, calendar = _a.calendar, cancelButton = _a.cancelButton, weekNumber = _a.weekNumber, focusedDate = _a.focusedDate;
|
|
69
|
+
return (React.createElement(DateTimeSelector, { ref: function (dateTimeSelector) { _this._dateTimeSelector = dateTimeSelector; }, cancelButton: cancelButton, steps: _this.props.steps, value: _this.value, onChange: _this.handleValueChange, onReject: _this.handleReject, disabled: disabled, weekNumber: weekNumber, min: _this.min, max: _this.max, minTime: minTime, maxTime: maxTime, focusedDate: focusedDate, format: format, calendar: calendar, mobileMode: _this.mobileMode, footerActions: !_this.mobileMode }));
|
|
70
|
+
};
|
|
71
|
+
_this.renderAdaptivePopup = function () {
|
|
72
|
+
var _a = _this.state.windowWidth, windowWidth = _a === void 0 ? 0 : _a;
|
|
73
|
+
var cancelText = provideLocalizationService(_this)
|
|
74
|
+
.toLanguageString(dateTimePickerCancel, messages[dateTimePickerCancel]);
|
|
75
|
+
var applyText = provideLocalizationService(_this)
|
|
76
|
+
.toLanguageString(dateTimePickerSet, messages[dateTimePickerSet]);
|
|
77
|
+
var actionSheetProps = {
|
|
78
|
+
expand: _this.show,
|
|
79
|
+
onClose: _this.handleBlur,
|
|
80
|
+
adaptiveTitle: _this.props.adaptiveTitle,
|
|
81
|
+
windowWidth: windowWidth,
|
|
82
|
+
footer: {
|
|
83
|
+
cancelText: cancelText,
|
|
84
|
+
onCancel: function (event) { var _a; return (_a = _this._dateTimeSelector) === null || _a === void 0 ? void 0 : _a.handleReject(event); },
|
|
85
|
+
applyText: applyText,
|
|
86
|
+
onApply: function (event) { var _a; return (_a = _this._dateTimeSelector) === null || _a === void 0 ? void 0 : _a.handleAccept(event); }
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
return (React.createElement(AdaptiveMode, __assign({}, actionSheetProps),
|
|
90
|
+
React.createElement(ActionSheetContent, { className: '!k-overflow-hidden' }, _this.renderPicker())));
|
|
91
|
+
};
|
|
64
92
|
_this.handleReject = function () {
|
|
65
93
|
_this.shouldFocusDateInput = true;
|
|
66
94
|
_this.setShow(false);
|
|
@@ -72,7 +100,9 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
72
100
|
});
|
|
73
101
|
_this.valueDuringOnChange = event.value;
|
|
74
102
|
_this.showDuringOnChange = false;
|
|
75
|
-
_this.
|
|
103
|
+
if (!_this.mobileMode) {
|
|
104
|
+
_this.shouldFocusDateInput = true;
|
|
105
|
+
}
|
|
76
106
|
var onChange = _this.props.onChange;
|
|
77
107
|
if (onChange) {
|
|
78
108
|
onChange.call(undefined, {
|
|
@@ -129,6 +159,17 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
129
159
|
};
|
|
130
160
|
return _this;
|
|
131
161
|
}
|
|
162
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "document", {
|
|
163
|
+
get: function () {
|
|
164
|
+
if (!canUseDOM) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
// useful only for user actions
|
|
168
|
+
return (this.element && this.element.ownerDocument) || document;
|
|
169
|
+
},
|
|
170
|
+
enumerable: false,
|
|
171
|
+
configurable: true
|
|
172
|
+
});
|
|
132
173
|
Object.defineProperty(DateTimePickerWithoutContext.prototype, "element", {
|
|
133
174
|
/**
|
|
134
175
|
* Gets the wrapping element of the DateTimePicker.
|
|
@@ -188,6 +229,17 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
188
229
|
enumerable: false,
|
|
189
230
|
configurable: true
|
|
190
231
|
});
|
|
232
|
+
Object.defineProperty(DateTimePickerWithoutContext.prototype, "mobileMode", {
|
|
233
|
+
/**
|
|
234
|
+
* The mobile mode of the ComboBox.
|
|
235
|
+
*/
|
|
236
|
+
get: function () {
|
|
237
|
+
var isAdaptive = this.state.windowWidth && this.state.windowWidth <= MOBILE_MEDIUM_DEVISE && this.props.adaptive;
|
|
238
|
+
return !!isAdaptive;
|
|
239
|
+
},
|
|
240
|
+
enumerable: false,
|
|
241
|
+
configurable: true
|
|
242
|
+
});
|
|
191
243
|
Object.defineProperty(DateTimePickerWithoutContext.prototype, "min", {
|
|
192
244
|
get: function () {
|
|
193
245
|
return this.props.min !== undefined
|
|
@@ -265,10 +317,15 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
265
317
|
* @hidden
|
|
266
318
|
*/
|
|
267
319
|
DateTimePickerWithoutContext.prototype.componentDidMount = function () {
|
|
320
|
+
var _a;
|
|
321
|
+
this.observerResize = canUseDOM && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this));
|
|
268
322
|
if (this.show) {
|
|
269
323
|
// If defaultShow is true during the initial render, the popup is not aligned.
|
|
270
324
|
this.forceUpdate();
|
|
271
325
|
}
|
|
326
|
+
if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {
|
|
327
|
+
this.observerResize.observe(this.document.body);
|
|
328
|
+
}
|
|
272
329
|
};
|
|
273
330
|
/**
|
|
274
331
|
* @hidden
|
|
@@ -290,14 +347,18 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
290
347
|
* @hidden
|
|
291
348
|
*/
|
|
292
349
|
DateTimePickerWithoutContext.prototype.componentWillUnmount = function () {
|
|
350
|
+
var _a;
|
|
293
351
|
clearTimeout(this.nextTickId);
|
|
352
|
+
if (((_a = this.document) === null || _a === void 0 ? void 0 : _a.body) && this.observerResize) {
|
|
353
|
+
this.observerResize.disconnect();
|
|
354
|
+
}
|
|
294
355
|
};
|
|
295
356
|
/**
|
|
296
357
|
* @hidden
|
|
297
358
|
*/
|
|
298
359
|
DateTimePickerWithoutContext.prototype.render = function () {
|
|
299
360
|
var _this = this;
|
|
300
|
-
var _a = this.props, _b = _a.size, size = _b === void 0 ? DateTimePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? DateTimePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? DateTimePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, format = _a.format, formatPlaceholder = _a.formatPlaceholder, min = _a.min, max = _a.max,
|
|
361
|
+
var _a = this.props, _b = _a.size, size = _b === void 0 ? DateTimePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? DateTimePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? DateTimePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, format = _a.format, formatPlaceholder = _a.formatPlaceholder, min = _a.min, max = _a.max, className = _a.className, width = _a.width, name = _a.name, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, minTime = _a.minTime, maxTime = _a.maxTime, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, _e = _a.popup, PopupComponent = _e === void 0 ? Popup : _e;
|
|
301
362
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
302
363
|
var dataInputProps = {
|
|
303
364
|
id: id,
|
|
@@ -330,30 +391,31 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
330
391
|
var dateTimePicker = (React.createElement(AsyncFocusBlur, { onFocus: this.handleFocus, onBlur: this.handleBlur, onSyncFocus: this.props.onFocus, onSyncBlur: this.props.onBlur }, function (_a) {
|
|
331
392
|
var _b;
|
|
332
393
|
var onFocus = _a.onFocus, onBlur = _a.onBlur;
|
|
333
|
-
return (React.createElement(
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
394
|
+
return (React.createElement(React.Fragment, null,
|
|
395
|
+
React.createElement("div", { ref: function (div) {
|
|
396
|
+
_this._element = div;
|
|
397
|
+
}, className: classNames('k-input', 'k-datetimepicker', (_b = {},
|
|
398
|
+
_b["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
399
|
+
_b["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
400
|
+
_b["k-input-".concat(fillMode)] = fillMode,
|
|
401
|
+
_b['k-invalid'] = !isValid,
|
|
402
|
+
_b['k-required'] = _this.required,
|
|
403
|
+
_b['k-disabled'] = _this.props.disabled,
|
|
404
|
+
_b), className), onKeyDown: _this.handleKeyDown, style: { width: width }, onFocus: !_this.mobileMode ? onFocus : undefined, onBlur: onBlur, onClick: _this.mobileMode ? _this.handleDateIconClick : undefined },
|
|
405
|
+
React.createElement(_this.dateInputComp, __assign({ _ref: _this._dateInput, ariaRole: "combobox", ariaControls: _this._popupId, readonly: _this.mobileMode }, dataInputProps)),
|
|
406
|
+
React.createElement(Button, __assign({ tabIndex: -1, type: "button", icon: 'calendar', svgIcon: calendarIcon, onMouseDown: _this.handleIconMouseDown, onClick: _this.handleDateIconClick, title: provideLocalizationService(_this)
|
|
407
|
+
.toLanguageString(toggleDateTimeSelector, messages[toggleDateTimeSelector]), className: "k-input-button", rounded: null }, {
|
|
408
|
+
'aria-label': provideLocalizationService(_this)
|
|
409
|
+
.toLanguageString(toggleDateTimeSelector, messages[toggleDateTimeSelector])
|
|
410
|
+
})),
|
|
411
|
+
React.createElement(PopupComponent, { show: _this.show, animate: _this.element !== null, anchor: _this.element, popupClass: "k-datetime-container k-reset", id: _this._popupId, anchorAlign: {
|
|
412
|
+
horizontal: 'left',
|
|
413
|
+
vertical: 'bottom'
|
|
414
|
+
}, popupAlign: {
|
|
415
|
+
horizontal: 'left',
|
|
416
|
+
vertical: 'top'
|
|
417
|
+
} }, !_this.mobileMode && _this.renderPicker())),
|
|
418
|
+
_this.mobileMode && _this.renderAdaptivePopup()));
|
|
357
419
|
}));
|
|
358
420
|
return this.props.label
|
|
359
421
|
? (React.createElement(PickerFloatingLabel, { dateInput: this._dateInput, label: this.props.label, editorId: id, editorValid: isValid, editorDisabled: this.props.disabled, children: dateTimePicker, style: { width: this.props.width } }))
|
|
@@ -372,6 +434,14 @@ var DateTimePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
372
434
|
clearTimeout(this.nextTickId);
|
|
373
435
|
this.nextTickId = window.setTimeout(function () { return f(); });
|
|
374
436
|
};
|
|
437
|
+
DateTimePickerWithoutContext.prototype.calculateMedia = function (entries) {
|
|
438
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
439
|
+
var entry = entries_1[_i];
|
|
440
|
+
this.setState({ windowWidth: entry.target.clientWidth });
|
|
441
|
+
}
|
|
442
|
+
;
|
|
443
|
+
};
|
|
444
|
+
;
|
|
375
445
|
/**
|
|
376
446
|
* @hidden
|
|
377
447
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateFormatOptions } from '@progress/kendo-react-intl';
|
|
2
|
+
import { LocalizationService, DateFormatOptions } from '@progress/kendo-react-intl';
|
|
3
3
|
import { Calendar, CalendarProps } from '../calendar/components/Calendar';
|
|
4
4
|
import { TimePart } from '../timepicker/TimePart';
|
|
5
5
|
import { DateInputIncrementalSteps } from '../dateinput/models';
|
|
@@ -41,6 +41,8 @@ export interface DateTimeSelectorProps<T = DateTimeSelector> {
|
|
|
41
41
|
format?: string | DateFormatOptions;
|
|
42
42
|
calendar?: React.ComponentType<CalendarProps<any>>;
|
|
43
43
|
steps?: DateInputIncrementalSteps;
|
|
44
|
+
mobileMode?: boolean;
|
|
45
|
+
footerActions?: boolean;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* @hidden
|
|
@@ -54,6 +56,12 @@ export interface DateTimeSelectorState {
|
|
|
54
56
|
* @hidden
|
|
55
57
|
*/
|
|
56
58
|
export declare class DateTimeSelector extends React.Component<DateTimeSelectorProps, DateTimeSelectorState> {
|
|
59
|
+
/**
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
static defaultProps: {
|
|
63
|
+
footerActions: boolean;
|
|
64
|
+
};
|
|
57
65
|
private _calendar;
|
|
58
66
|
private _timePart;
|
|
59
67
|
private _cancelButton;
|
|
@@ -63,6 +71,7 @@ export declare class DateTimeSelector extends React.Component<DateTimeSelectorPr
|
|
|
63
71
|
get calendar(): Calendar | null;
|
|
64
72
|
get timePart(): TimePart | null;
|
|
65
73
|
protected get hasDateValue(): boolean;
|
|
74
|
+
protected get localizationService(): LocalizationService;
|
|
66
75
|
constructor(props: DateTimeSelectorProps);
|
|
67
76
|
componentDidUpdate(): void;
|
|
68
77
|
render(): JSX.Element;
|
|
@@ -75,8 +84,9 @@ export declare class DateTimeSelector extends React.Component<DateTimeSelectorPr
|
|
|
75
84
|
protected mergeTime(current: Date | null, candidate: Date | null): Date | null;
|
|
76
85
|
protected mergeDate(candidate: Date | null, value: Date): Date | null;
|
|
77
86
|
protected move: (direction: 'left' | 'right') => void;
|
|
78
|
-
private
|
|
79
|
-
|
|
87
|
+
private dateTimeFooter;
|
|
88
|
+
handleReject: (event: React.SyntheticEvent<any>) => void;
|
|
89
|
+
handleAccept: (event: React.SyntheticEvent<any>, timeOverride?: Date) => void;
|
|
80
90
|
private handleNowClick;
|
|
81
91
|
private handleCalendarValueChange;
|
|
82
92
|
private handleTimeListContainerChange;
|
|
@@ -75,6 +75,14 @@ var DateTimeSelector = /** @class */ (function (_super) {
|
|
|
75
75
|
_this.shouldFocusPart = true;
|
|
76
76
|
_this.setState({ tab: nextPart });
|
|
77
77
|
};
|
|
78
|
+
_this.dateTimeFooter = function () {
|
|
79
|
+
var cancelButton = _this.props.cancelButton;
|
|
80
|
+
var cancelMessage = _this.localizationService.toLanguageString(cancel, messages[cancel]);
|
|
81
|
+
var setMessage = _this.localizationService.toLanguageString(set, messages[set]);
|
|
82
|
+
return (React.createElement("div", { className: "k-datetime-footer k-actions k-actions-stretched " },
|
|
83
|
+
cancelButton && React.createElement(Button, __assign({ type: "button", ref: function (btn) { _this._cancelButton = btn; }, className: "k-time-cancel", onClick: _this.handleReject, title: cancelMessage }, { 'aria-label': cancelMessage }), cancelMessage),
|
|
84
|
+
React.createElement(Button, __assign({ type: "button", themeColor: "primary", ref: function (btn) { _this._acceptButton = btn; }, className: "k-time-accept", disabled: !_this.hasDateValue, onClick: _this.handleAccept, title: setMessage }, { 'aria-label': setMessage }), setMessage)));
|
|
85
|
+
};
|
|
78
86
|
_this.handleReject = function (event) {
|
|
79
87
|
_this.setState({ dateValue: _this.props.value, timeValue: _this.props.value || MIDNIGHT_DATE });
|
|
80
88
|
var value = _this.mergeDate(_this.props.value, _this.props.value || MIDNIGHT_DATE);
|
|
@@ -175,6 +183,13 @@ var DateTimeSelector = /** @class */ (function (_super) {
|
|
|
175
183
|
enumerable: false,
|
|
176
184
|
configurable: true
|
|
177
185
|
});
|
|
186
|
+
Object.defineProperty(DateTimeSelector.prototype, "localizationService", {
|
|
187
|
+
get: function () {
|
|
188
|
+
return provideLocalizationService(this);
|
|
189
|
+
},
|
|
190
|
+
enumerable: false,
|
|
191
|
+
configurable: true
|
|
192
|
+
});
|
|
178
193
|
DateTimeSelector.prototype.componentDidUpdate = function () {
|
|
179
194
|
if (this.shouldFocusPart) {
|
|
180
195
|
this.focus({ preventScroll: true });
|
|
@@ -183,17 +198,14 @@ var DateTimeSelector = /** @class */ (function (_super) {
|
|
|
183
198
|
};
|
|
184
199
|
DateTimeSelector.prototype.render = function () {
|
|
185
200
|
var _this = this;
|
|
186
|
-
var _a = this.props, disabled = _a.disabled,
|
|
201
|
+
var _a = this.props, disabled = _a.disabled, min = _a.min, max = _a.max, weekNumber = _a.weekNumber, focusedDate = _a.focusedDate, format = _a.format, mobileMode = _a.mobileMode, footerActions = _a.footerActions;
|
|
187
202
|
var rootClassName = classNames({
|
|
188
203
|
'k-date-tab': this.state.tab === 'date',
|
|
189
204
|
'k-time-tab': this.state.tab === 'time',
|
|
190
205
|
'k-disabled': disabled
|
|
191
206
|
}, 'k-datetime-wrap');
|
|
192
|
-
var
|
|
193
|
-
var
|
|
194
|
-
var timeMessage = localizationService.toLanguageString(time, messages[time]);
|
|
195
|
-
var cancelMessage = localizationService.toLanguageString(cancel, messages[cancel]);
|
|
196
|
-
var setMessage = localizationService.toLanguageString(set, messages[set]);
|
|
207
|
+
var dateMessage = this.localizationService.toLanguageString(date, messages[date]);
|
|
208
|
+
var timeMessage = this.localizationService.toLanguageString(time, messages[time]);
|
|
197
209
|
var calendarProps = {
|
|
198
210
|
min: min,
|
|
199
211
|
max: max,
|
|
@@ -213,10 +225,9 @@ var DateTimeSelector = /** @class */ (function (_super) {
|
|
|
213
225
|
React.createElement("div", { className: "k-datetime-calendar-wrap", ref: function (e) { return _this._calendarWrap = e; } }, this.props.calendar ?
|
|
214
226
|
React.createElement(this.props.calendar, __assign({}, calendarProps)) :
|
|
215
227
|
React.createElement(Calendar, __assign({ ref: function (calendar) { _this._calendar = calendar; } }, calendarProps))),
|
|
216
|
-
React.createElement("div", { className: "k-datetime-time-wrap" },
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
React.createElement(Button, __assign({ type: "button", themeColor: "primary", ref: function (btn) { _this._acceptButton = btn; }, className: "k-time-accept", disabled: !this.hasDateValue, onClick: this.handleAccept, title: setMessage }, { 'aria-label': setMessage }), setMessage))));
|
|
228
|
+
React.createElement("div", { className: "k-datetime-time-wrap" },
|
|
229
|
+
React.createElement("div", { className: mobileMode ? 'k-reset k-timeselector-lg k-timeselector' : '' }, React.createElement(TimePart, { key: 1, onNowClick: this.handleNowClick, disabled: disabled || this.state.tab !== 'time', ref: function (timePart) { _this._timePart = timePart; }, min: this.minTime || MIN_TIME, max: this.maxTime || MAX_TIME, steps: this.props.steps, value: this.state.timeValue, format: format, onChange: this.handleTimeListContainerChange, onMount: this.handleTimePartMount, mobileMode: mobileMode })))),
|
|
230
|
+
footerActions && this.dateTimeFooter()));
|
|
220
231
|
};
|
|
221
232
|
Object.defineProperty(DateTimeSelector.prototype, "minTime", {
|
|
222
233
|
get: function () {
|
|
@@ -254,6 +265,12 @@ var DateTimeSelector = /** @class */ (function (_super) {
|
|
|
254
265
|
DateTimeSelector.prototype.mergeDate = function (candidate, value) {
|
|
255
266
|
return candidate ? setTime(candidate || getToday(), value) : value;
|
|
256
267
|
};
|
|
268
|
+
/**
|
|
269
|
+
* @hidden
|
|
270
|
+
*/
|
|
271
|
+
DateTimeSelector.defaultProps = {
|
|
272
|
+
footerActions: true
|
|
273
|
+
};
|
|
257
274
|
return DateTimeSelector;
|
|
258
275
|
}(React.Component));
|
|
259
276
|
export { DateTimeSelector };
|
|
@@ -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: 1684834780,
|
|
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
|
};
|
|
@@ -108,6 +108,7 @@ export declare class MultiViewCalendarWithoutContext extends React.Component<Mul
|
|
|
108
108
|
private calendarViewList;
|
|
109
109
|
private isActive;
|
|
110
110
|
private calculateFocusFromValue;
|
|
111
|
+
private isRtl;
|
|
111
112
|
/**
|
|
112
113
|
* Gets the wrapping element of the MultiViewCalendar component.
|
|
113
114
|
*/
|
|
@@ -42,6 +42,12 @@ var services_1 = require("../services");
|
|
|
42
42
|
var utils_2 = require("../../utils");
|
|
43
43
|
var HorizontalViewList_1 = require("./HorizontalViewList");
|
|
44
44
|
var TodayCommand_1 = require("./TodayCommand");
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
48
|
+
function isRtl(element) {
|
|
49
|
+
return Boolean(element && getComputedStyle(element).direction === 'rtl');
|
|
50
|
+
}
|
|
45
51
|
var extractDateFromValue = function (min, max, value) {
|
|
46
52
|
if (min === void 0) { min = MultiViewCalendarWithoutContext.defaultProps.min; }
|
|
47
53
|
if (max === void 0) { max = MultiViewCalendarWithoutContext.defaultProps.max; }
|
|
@@ -91,6 +97,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
91
97
|
_this.calendarViewList = null;
|
|
92
98
|
_this.isActive = false;
|
|
93
99
|
_this.calculateFocusFromValue = true;
|
|
100
|
+
_this.isRtl = false;
|
|
94
101
|
/**
|
|
95
102
|
* @hidden
|
|
96
103
|
*/
|
|
@@ -412,6 +419,11 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
412
419
|
*/
|
|
413
420
|
MultiViewCalendarWithoutContext.prototype.componentDidMount = function () {
|
|
414
421
|
this.calculateFocusFromValue = true;
|
|
422
|
+
var rtl = isRtl(this._element);
|
|
423
|
+
this.isRtl = rtl;
|
|
424
|
+
if (this.isRtl) {
|
|
425
|
+
this.forceUpdate();
|
|
426
|
+
}
|
|
415
427
|
};
|
|
416
428
|
/**
|
|
417
429
|
* @hidden
|
|
@@ -466,9 +478,9 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
|
|
|
466
478
|
var activeDate = (0, kendo_date_math_1.cloneDate)(this.dates && this.dates[0] ? this.dates[0] : (0, utils_2.getToday)());
|
|
467
479
|
return (React.createElement("div", { ref: function (el) { _this._element = el; }, className: wrapperClassName, id: this.props.id || this.wrapperID, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, tabIndex: !this.props.disabled ? this.props.tabIndex : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, onClick: this.handleClick, onKeyDown: this.handleKeyDown, "aria-disabled": this.props.disabled },
|
|
468
480
|
React.createElement(Header_1.Header, { key: ".kendo.calendar.header.".concat(activeDate.getTime()), activeView: activeView, currentDate: activeDate, min: this.min, max: this.max, rangeLength: this.props.views, bus: this.bus, service: this.service, headerTitle: this.props.headerTitle, commands: (React.createElement(React.Fragment, null,
|
|
469
|
-
React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-calendar-nav-prev", icon:
|
|
481
|
+
React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-calendar-nav-prev", icon: this.isRtl ? 'chevron-right' : 'chevron-left', svgIcon: this.isRtl ? kendo_svg_icons_1.chevronRightIcon : kendo_svg_icons_1.chevronLeftIcon, fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
|
|
470
482
|
React.createElement(TodayCommand_1.TodayCommand, { min: this.min, max: this.max, onClick: this.handleTodayClick, disabled: !this.todayIsInRange }),
|
|
471
|
-
React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-calendar-nav-next", icon:
|
|
483
|
+
React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-calendar-nav-next", icon: this.isRtl ? 'chevron-left' : 'chevron-right', svgIcon: this.isRtl ? kendo_svg_icons_1.chevronLeftIcon : kendo_svg_icons_1.chevronRightIcon, fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
|
|
472
484
|
React.createElement(HorizontalViewList_1.HorizontalViewList, { ref: function (el) { _this.calendarViewList = el; }, dates: this.dates, activeView: activeView, focusedDate: this.focusedDate, min: this.min, max: this.max, bus: this.bus, service: this.service, selectionRange: visualizedRange, value: this.selectedMultiple || this.selectedDate, cellUID: this.cellUID, views: this.props.views, onChange: this.handleDateChange, showWeekNumbers: this.props.weekNumber, onCellEnter: this.handleCellEnter, cell: this.props.cell, weekCell: this.props.weekCell, headerTitle: this.props.headerTitle })));
|
|
473
485
|
};
|
|
474
486
|
/**
|
|
@@ -145,7 +145,9 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
145
145
|
});
|
|
146
146
|
_this.valueDuringOnChange = value;
|
|
147
147
|
_this.showDuringOnChange = false;
|
|
148
|
-
_this.
|
|
148
|
+
if (!_this.mobileMode) {
|
|
149
|
+
_this.shouldFocusDateInput = true;
|
|
150
|
+
}
|
|
149
151
|
var onChange = _this.props.onChange;
|
|
150
152
|
if (onChange) {
|
|
151
153
|
onChange.call(undefined, {
|
|
@@ -431,12 +433,10 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
431
433
|
*/
|
|
432
434
|
DatePickerWithoutContext.prototype.render = function () {
|
|
433
435
|
var _this = this;
|
|
434
|
-
var _a = this.props, _b = _a.size, size = _b === void 0 ? DatePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? DatePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? DatePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, format = _a.format, formatPlaceholder = _a.formatPlaceholder, min = _a.min, max = _a.max, className = _a.className, width = _a.width, name = _a.name, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, ariaLabel = _a.ariaLabel
|
|
435
|
-
var _e = this.state.windowWidth, windowWidth = _e === void 0 ? 0 : _e;
|
|
436
|
+
var _a = this.props, _b = _a.size, size = _b === void 0 ? DatePickerWithoutContext.defaultProps.size : _b, _c = _a.rounded, rounded = _c === void 0 ? DatePickerWithoutContext.defaultProps.rounded : _c, _d = _a.fillMode, fillMode = _d === void 0 ? DatePickerWithoutContext.defaultProps.fillMode : _d, disabled = _a.disabled, tabIndex = _a.tabIndex, title = _a.title, id = _a.id, format = _a.format, formatPlaceholder = _a.formatPlaceholder, min = _a.min, max = _a.max, className = _a.className, width = _a.width, name = _a.name, validationMessage = _a.validationMessage, required = _a.required, validityStyles = _a.validityStyles, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, ariaLabel = _a.ariaLabel;
|
|
436
437
|
var show = this.show;
|
|
437
438
|
var value = this.value;
|
|
438
439
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
439
|
-
var renderAdaptive = windowWidth <= constants_1.MOBILE_MEDIUM_DEVISE && adaptive;
|
|
440
440
|
var dateInputProps = {
|
|
441
441
|
disabled: disabled,
|
|
442
442
|
format: format,
|
|
@@ -479,8 +479,8 @@ var DatePickerWithoutContext = /** @class */ (function (_super) {
|
|
|
479
479
|
_b), className), onKeyDown: _this.handleKeyDown, style: { width: width }, onFocus: onFocus, onBlur: onBlur, onClick: _this.mobileMode ? _this.handleIconClick : undefined },
|
|
480
480
|
React.createElement(_this.dateInputComp, __assign({ _ref: _this._dateInput, ariaRole: 'combobox', readonly: _this.mobileMode, ariaExpanded: _this.show, ariaControls: _this._popupId }, dateInputProps)),
|
|
481
481
|
React.createElement(_this.toggleButtonComp, { type: "button", icon: "calendar", svgIcon: kendo_svg_icons_1.calendarIcon, title: toggleButtonTitle, className: "k-input-button", rounded: null, onClick: _this.handleIconClick, "aria-label": toggleButtonTitle, onMouseDown: _this.handleIconMouseDown }),
|
|
482
|
-
!
|
|
483
|
-
|
|
482
|
+
!_this.mobileMode && _this.renderPopup()),
|
|
483
|
+
_this.mobileMode && _this.renderAdaptivePopup()));
|
|
484
484
|
}));
|
|
485
485
|
return this.props.label
|
|
486
486
|
? (React.createElement(usePickerFloatingLabel_1.PickerFloatingLabel, { dateInput: this._dateInput, label: this.props.label, editorId: id, editorValid: isValid, editorDisabled: this.props.disabled, children: datepicker, style: { width: this.props.width } }))
|