@progress/kendo-react-dateinputs 5.4.0-dev.202205250548 → 5.4.0-dev.202206081230
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/PopupSettings.js +1 -0
- package/dist/es/calendar/components/Calendar.d.ts +10 -10
- package/dist/es/calendar/components/Calendar.js +26 -12
- package/dist/es/calendar/components/CalendarCell.js +7 -3
- package/dist/es/calendar/components/CalendarHeaderTitle.js +7 -3
- package/dist/es/calendar/components/CalendarNavigationItem.js +7 -3
- package/dist/es/calendar/components/CalendarWeekCell.js +7 -3
- package/dist/es/calendar/components/Header.d.ts +5 -4
- package/dist/es/calendar/components/Header.js +8 -6
- package/dist/es/calendar/components/HorizontalViewList.d.ts +4 -4
- package/dist/es/calendar/components/HorizontalViewList.js +8 -5
- package/dist/es/calendar/components/MultiViewCalendar.d.ts +13 -13
- package/dist/es/calendar/components/MultiViewCalendar.js +24 -15
- package/dist/es/calendar/components/Navigation.d.ts +2 -2
- package/dist/es/calendar/components/Navigation.js +13 -6
- package/dist/es/calendar/components/TodayCommand.d.ts +3 -3
- package/dist/es/calendar/components/TodayCommand.js +10 -6
- package/dist/es/calendar/components/View.d.ts +11 -11
- package/dist/es/calendar/components/View.js +17 -13
- package/dist/es/calendar/components/ViewList.d.ts +9 -9
- package/dist/es/calendar/components/ViewList.js +19 -9
- package/dist/es/calendar/models/ActiveView.js +1 -0
- package/dist/es/calendar/models/CalendarSettings.js +1 -0
- package/dist/es/calendar/models/CellContext.js +1 -0
- package/dist/es/calendar/models/MultiViewCalendarMode.js +1 -0
- package/dist/es/calendar/models/MultiViewCalendarSettings.js +1 -0
- package/dist/es/calendar/models/SelectionRangeEnd.js +1 -0
- package/dist/es/calendar/models/ViewService.js +1 -0
- 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 +24 -20
- package/dist/es/dateinput/DateInput.js +32 -19
- package/dist/es/dateinput/models/DateInputSettings.js +1 -0
- package/dist/es/dateinput/models/format-placeholder.js +1 -0
- package/dist/es/dateinput/models/incremental-steps.js +1 -0
- package/dist/es/dateinput/models/kendo-date.d.ts +2 -2
- package/dist/es/dateinput/models/kendo-date.js +3 -3
- package/dist/es/dateinput/models/mask.js +1 -0
- package/dist/es/dateinput/models/selection.js +1 -0
- package/dist/es/dateinput/utils.d.ts +2 -2
- package/dist/es/datepicker/DatePicker.d.ts +25 -25
- package/dist/es/datepicker/DatePicker.js +28 -23
- package/dist/es/datepicker/models/DatePickerSettings.js +1 -0
- package/dist/es/datepicker/models/index.js +1 -0
- package/dist/es/daterangepicker/DateRangePicker.d.ts +16 -14
- package/dist/es/daterangepicker/DateRangePicker.js +16 -14
- package/dist/es/daterangepicker/models/DateRangePickerCalendarSettings.js +1 -0
- package/dist/es/daterangepicker/models/DateRangePickerDateInputSettings.js +1 -0
- package/dist/es/daterangepicker/models/DateRangePickerPopupSettings.js +1 -0
- package/dist/es/daterangepicker/models/DateRangePickerSettings.js +1 -0
- package/dist/es/daterangepicker/models/index.js +1 -0
- package/dist/es/datetimepicker/DateTimePicker.d.ts +19 -19
- package/dist/es/datetimepicker/DateTimePicker.js +33 -18
- package/dist/es/datetimepicker/DateTimeSelector.d.ts +7 -7
- package/dist/es/datetimepicker/DateTimeSelector.js +17 -7
- package/dist/es/datetimepicker/models/DateTimePickerSettings.js +1 -0
- package/dist/es/datetimepicker/models/index.js +1 -0
- package/dist/es/hooks/usePickerFloatingLabel.d.ts +1 -1
- package/dist/es/messages/index.d.ts +21 -21
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.d.ts +8 -8
- package/dist/es/timepicker/TimeList.js +33 -13
- package/dist/es/timepicker/TimePart.d.ts +11 -11
- package/dist/es/timepicker/TimePart.js +14 -9
- package/dist/es/timepicker/TimePicker.d.ts +23 -23
- package/dist/es/timepicker/TimePicker.js +27 -22
- package/dist/es/timepicker/TimeSelector.d.ts +6 -6
- package/dist/es/timepicker/TimeSelector.js +11 -5
- package/dist/es/timepicker/models/IncrementalSteps.js +1 -0
- package/dist/es/timepicker/models/ListItem.js +1 -0
- package/dist/es/timepicker/models/ListService.js +1 -0
- package/dist/es/timepicker/models/ListServiceSettings.js +1 -0
- package/dist/es/timepicker/models/TimePickerSettings.js +1 -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/timepicker/utils.d.ts +4 -4
- package/dist/es/utils.d.ts +1 -1
- package/dist/es/utils.js +10 -1
- package/dist/es/virtualization/Virtualization.d.ts +9 -8
- package/dist/es/virtualization/Virtualization.js +23 -13
- package/dist/es/virtualization/services/RowHeightService.js +10 -1
- package/dist/es/virtualization/services/ScrollerService.js +9 -3
- package/dist/npm/calendar/components/Calendar.d.ts +10 -10
- package/dist/npm/calendar/components/Calendar.js +53 -38
- package/dist/npm/calendar/components/CalendarCell.js +9 -4
- package/dist/npm/calendar/components/CalendarHeaderTitle.js +8 -3
- package/dist/npm/calendar/components/CalendarNavigationItem.js +9 -4
- package/dist/npm/calendar/components/CalendarWeekCell.js +9 -4
- package/dist/npm/calendar/components/Header.d.ts +5 -4
- package/dist/npm/calendar/components/Header.js +11 -8
- package/dist/npm/calendar/components/HorizontalViewList.d.ts +4 -4
- package/dist/npm/calendar/components/HorizontalViewList.js +11 -7
- package/dist/npm/calendar/components/MultiViewCalendar.d.ts +13 -13
- package/dist/npm/calendar/components/MultiViewCalendar.js +62 -52
- package/dist/npm/calendar/components/Navigation.d.ts +2 -2
- package/dist/npm/calendar/components/Navigation.js +18 -10
- package/dist/npm/calendar/components/TodayCommand.d.ts +3 -3
- package/dist/npm/calendar/components/TodayCommand.js +16 -11
- package/dist/npm/calendar/components/View.d.ts +11 -11
- package/dist/npm/calendar/components/View.js +27 -22
- package/dist/npm/calendar/components/ViewList.d.ts +9 -9
- package/dist/npm/calendar/components/ViewList.js +29 -18
- package/dist/npm/calendar/models/CalendarViewEnum.js +1 -0
- package/dist/npm/calendar/models/NavigationAction.js +1 -0
- package/dist/npm/calendar/models/SelectionRange.js +1 -0
- package/dist/npm/calendar/models/index.js +4 -3
- package/dist/npm/calendar/services/BusViewService.js +3 -2
- package/dist/npm/calendar/services/CenturyViewService.js +40 -39
- package/dist/npm/calendar/services/DOMService.js +34 -15
- package/dist/npm/calendar/services/DecadeViewService.js +34 -33
- package/dist/npm/calendar/services/MonthViewService.js +38 -37
- package/dist/npm/calendar/services/NavigationService.js +2 -1
- package/dist/npm/calendar/services/ScrollSyncService.js +6 -1
- package/dist/npm/calendar/services/WeekNamesService.js +2 -1
- package/dist/npm/calendar/services/YearViewService.js +35 -34
- package/dist/npm/calendar/services/index.js +10 -9
- 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 +2 -1
- package/dist/npm/dateinput/DateInput.d.ts +24 -20
- package/dist/npm/dateinput/DateInput.js +51 -37
- package/dist/npm/dateinput/models/index.js +3 -2
- package/dist/npm/dateinput/models/kendo-date.d.ts +2 -2
- package/dist/npm/dateinput/models/kendo-date.js +15 -14
- package/dist/npm/dateinput/models/mask.js +2 -0
- package/dist/npm/dateinput/utils.d.ts +2 -2
- package/dist/npm/dateinput/utils.js +9 -4
- package/dist/npm/datepicker/DatePicker.d.ts +25 -25
- package/dist/npm/datepicker/DatePicker.js +42 -36
- package/dist/npm/datepicker/ToggleButton.js +1 -0
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +16 -14
- package/dist/npm/daterangepicker/DateRangePicker.js +34 -31
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +19 -19
- package/dist/npm/datetimepicker/DateTimePicker.js +46 -30
- package/dist/npm/datetimepicker/DateTimeSelector.d.ts +7 -7
- package/dist/npm/datetimepicker/DateTimeSelector.js +26 -15
- package/dist/npm/defaults.js +1 -0
- package/dist/npm/hooks/usePickerFloatingLabel.d.ts +1 -1
- package/dist/npm/hooks/usePickerFloatingLabel.js +6 -3
- package/dist/npm/main.js +22 -21
- package/dist/npm/messages/index.d.ts +21 -21
- package/dist/npm/messages/index.js +2 -1
- package/dist/npm/package-metadata.js +2 -1
- package/dist/npm/timepicker/TimeList.d.ts +8 -8
- package/dist/npm/timepicker/TimeList.js +39 -18
- package/dist/npm/timepicker/TimePart.d.ts +11 -11
- package/dist/npm/timepicker/TimePart.js +25 -19
- package/dist/npm/timepicker/TimePicker.d.ts +23 -23
- package/dist/npm/timepicker/TimePicker.js +43 -37
- package/dist/npm/timepicker/TimeSelector.d.ts +6 -6
- package/dist/npm/timepicker/TimeSelector.js +22 -15
- package/dist/npm/timepicker/models/TimePart.js +1 -0
- package/dist/npm/timepicker/models/index.js +2 -1
- package/dist/npm/timepicker/services/DOMService.js +7 -4
- package/dist/npm/timepicker/services/DayPeriodService.js +11 -4
- package/dist/npm/timepicker/services/HoursService.js +21 -11
- package/dist/npm/timepicker/services/MinutesService.js +17 -10
- package/dist/npm/timepicker/services/SecondsService.js +17 -10
- package/dist/npm/timepicker/services/index.js +6 -5
- package/dist/npm/timepicker/utils.d.ts +4 -4
- package/dist/npm/timepicker/utils.js +30 -20
- package/dist/npm/utils.d.ts +1 -1
- package/dist/npm/utils.js +43 -20
- package/dist/npm/virtualization/Virtualization.d.ts +9 -8
- package/dist/npm/virtualization/Virtualization.js +27 -16
- package/dist/npm/virtualization/services/RowHeightService.js +11 -1
- package/dist/npm/virtualization/services/ScrollerService.js +10 -3
- package/dist/npm/virtualization/services/index.js +5 -4
- package/dist/systemjs/kendo-react-dateinputs.js +1 -1
- package/package.json +13 -13
|
@@ -6,7 +6,25 @@ import { canUseDOM } from '@progress/kendo-react-common';
|
|
|
6
6
|
*/
|
|
7
7
|
var DOMService = /** @class */ (function () {
|
|
8
8
|
function DOMService() {
|
|
9
|
+
// heights
|
|
10
|
+
this.calendarHeight = 0;
|
|
11
|
+
this.headerHeight = 0;
|
|
12
|
+
this.monthViewHeight = 0;
|
|
13
|
+
this.yearViewHeight = 0;
|
|
14
|
+
this.decadeViewHeight = 0;
|
|
15
|
+
this.centuryViewHeight = 0;
|
|
16
|
+
this.navigationItemHeight = 0;
|
|
17
|
+
this.scrollableContentHeight = 0;
|
|
18
|
+
this.scrollableYearContentHeight = 0;
|
|
19
|
+
// widths
|
|
20
|
+
this.calendarWidth = 0;
|
|
21
|
+
this.monthViewWidth = 0;
|
|
22
|
+
this.yearViewWidth = 0;
|
|
23
|
+
this.decadeViewWidth = 0;
|
|
24
|
+
this.centuryViewWidth = 0;
|
|
25
|
+
this.scrollableContentWidth = 0;
|
|
9
26
|
this.didCalculate = false;
|
|
27
|
+
this.hostContainer = null;
|
|
10
28
|
}
|
|
11
29
|
DOMService.prototype.ensureHeights = function () {
|
|
12
30
|
if (this.calendarHeight !== undefined) {
|
|
@@ -38,7 +56,7 @@ var DOMService = /** @class */ (function () {
|
|
|
38
56
|
var content = function (rows, cells) {
|
|
39
57
|
if (cells === void 0) { cells = 1; }
|
|
40
58
|
return (table([
|
|
41
|
-
tbody([tr([td('1', 'k-calendar-td k-alt')])].concat(repeat(rows, function () { return tr(repeat(cells, function (c) { return td("<span class=\"k-link\">"
|
|
59
|
+
tbody([tr([td('1', 'k-calendar-td k-alt')])].concat(repeat(rows, function () { return tr(repeat(cells, function (c) { return td("<span class=\"k-link\">".concat(c, "</span>"), 'k-calendar-td'); }), 'k-calendar-tr'); })), 'k-calendar-tbody')
|
|
42
60
|
], 'k-calendar-table'));
|
|
43
61
|
};
|
|
44
62
|
var scrollable = function (children) { return div(children, 'k-content k-calendar-content k-scrollable'); };
|
|
@@ -80,7 +98,7 @@ var DOMService = /** @class */ (function () {
|
|
|
80
98
|
var getScrollable = function (element) { return element.querySelector('.k-scrollable'); };
|
|
81
99
|
var horizontal = function (element) {
|
|
82
100
|
var scrollableElement = getScrollable(element);
|
|
83
|
-
scrollableElement.className = scrollableElement.className
|
|
101
|
+
scrollableElement.className = "".concat(scrollableElement.className, " k-scrollable-horizontal");
|
|
84
102
|
return element;
|
|
85
103
|
};
|
|
86
104
|
var monthView = viewFactory({ cells: 7, rows: 6 }, 'k-calendar-view k-calendar-monthview k-vstack', true);
|
|
@@ -144,13 +162,13 @@ var DOMService = /** @class */ (function () {
|
|
|
144
162
|
var viewProp = dimension === 'height' ? 'ViewHeight' : 'ViewWidth';
|
|
145
163
|
switch (viewType) {
|
|
146
164
|
case CalendarViewEnum.month:
|
|
147
|
-
return this["month"
|
|
165
|
+
return this["month".concat(viewProp)];
|
|
148
166
|
case CalendarViewEnum.year:
|
|
149
|
-
return this["year"
|
|
167
|
+
return this["year".concat(viewProp)];
|
|
150
168
|
case CalendarViewEnum.decade:
|
|
151
|
-
return this["decade"
|
|
169
|
+
return this["decade".concat(viewProp)];
|
|
152
170
|
case CalendarViewEnum.century:
|
|
153
|
-
return this["century"
|
|
171
|
+
return this["century".concat(viewProp)];
|
|
154
172
|
default:
|
|
155
173
|
return 1;
|
|
156
174
|
}
|
|
@@ -51,7 +51,7 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
51
51
|
: _this.isSelectedFromArray(cellDate, selectedDate, min, max));
|
|
52
52
|
return intersects(cellDate, firstDate, lastDate) ? ({
|
|
53
53
|
formattedValue: _this.value(cellDate),
|
|
54
|
-
id: ""
|
|
54
|
+
id: "".concat(cellUID).concat(cellDate.getTime()),
|
|
55
55
|
isFocused: _this.isEqual(cellDate, focusedDate),
|
|
56
56
|
isSelected: isSelected,
|
|
57
57
|
isWeekend: false,
|
|
@@ -120,7 +120,7 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
120
120
|
if (!value) {
|
|
121
121
|
return '';
|
|
122
122
|
}
|
|
123
|
-
return firstYearOfDecade(value).getFullYear()
|
|
123
|
+
return "".concat(firstYearOfDecade(value).getFullYear(), " - ").concat(lastYearOfDecade(value).getFullYear());
|
|
124
124
|
};
|
|
125
125
|
DecadeViewService.prototype.rowLength = function (_) {
|
|
126
126
|
return CELLS_LENGTH;
|
|
@@ -60,7 +60,7 @@ var MonthViewService = /** @class */ (function () {
|
|
|
60
60
|
: _this.isSelectedFromArray(cellDate, selectedDate, min, max));
|
|
61
61
|
var cell = {
|
|
62
62
|
formattedValue: _this.value(cellDate),
|
|
63
|
-
id: ""
|
|
63
|
+
id: "".concat(cellUID).concat(cellDate.getTime()),
|
|
64
64
|
isFocused: _this.isEqual(cellDate, focusedDate),
|
|
65
65
|
isSelected: isSelected,
|
|
66
66
|
isInRange: isInRange(cellDate, min, max),
|
|
@@ -126,7 +126,7 @@ var MonthViewService = /** @class */ (function () {
|
|
|
126
126
|
return this.isRangeStart(value) ? value.getFullYear().toString() : this.abbrMonthNames()[value.getMonth()];
|
|
127
127
|
};
|
|
128
128
|
MonthViewService.prototype.title = function (current) {
|
|
129
|
-
return this.wideMonthNames()[current.getMonth()]
|
|
129
|
+
return "".concat(this.wideMonthNames()[current.getMonth()], " ").concat(current.getFullYear());
|
|
130
130
|
};
|
|
131
131
|
MonthViewService.prototype.rowLength = function (prependCell) {
|
|
132
132
|
return CELLS_LENGTH + (prependCell ? 1 : 0);
|
|
@@ -19,7 +19,7 @@ var NavigationService = /** @class */ (function () {
|
|
|
19
19
|
this.bus = bus;
|
|
20
20
|
}
|
|
21
21
|
NavigationService.prototype.action = function (event) {
|
|
22
|
-
var action = ""
|
|
22
|
+
var action = "".concat(event.ctrlKey || event.metaKey ? 'meta+' : '').concat(event.keyCode);
|
|
23
23
|
return KEY_TO_ACTION[action];
|
|
24
24
|
};
|
|
25
25
|
NavigationService.prototype.move = function (value, action, activeView, service, event) {
|
|
@@ -6,6 +6,10 @@ var powerByMagnitude = function (magnitude) { return function (x) { return x * m
|
|
|
6
6
|
var ScrollSyncService = /** @class */ (function () {
|
|
7
7
|
function ScrollSyncService(dom) {
|
|
8
8
|
this.dom = dom;
|
|
9
|
+
this.divideByMagnitude = null;
|
|
10
|
+
this.powerByMagnitude = null;
|
|
11
|
+
this.navigator = null;
|
|
12
|
+
this.view = null;
|
|
9
13
|
this.monthScrolled = false;
|
|
10
14
|
this.navScrolled = false;
|
|
11
15
|
}
|
|
@@ -47,7 +51,7 @@ var ScrollSyncService = /** @class */ (function () {
|
|
|
47
51
|
};
|
|
48
52
|
ScrollSyncService.prototype.calculateScroll = function (component, scrollTop) {
|
|
49
53
|
var modifier = component === this.navigator ? this.divideByMagnitude : this.powerByMagnitude;
|
|
50
|
-
return modifier(scrollTop);
|
|
54
|
+
return modifier ? modifier(scrollTop) : 0;
|
|
51
55
|
};
|
|
52
56
|
return ScrollSyncService;
|
|
53
57
|
}());
|
|
@@ -77,7 +77,7 @@ var YearViewService = /** @class */ (function () {
|
|
|
77
77
|
: _this.isSelectedFromArray(cellDate, selectedDate, min, max));
|
|
78
78
|
return {
|
|
79
79
|
formattedValue: months[cellDate.getMonth()],
|
|
80
|
-
id: ""
|
|
80
|
+
id: "".concat(cellUID).concat(cellDate.getTime()),
|
|
81
81
|
isFocused: _this.isEqual(cellDate, focusedDate),
|
|
82
82
|
isSelected: isSelected,
|
|
83
83
|
isInRange: isInRange(cellDate, min, max),
|
|
@@ -138,7 +138,7 @@ var YearViewService = /** @class */ (function () {
|
|
|
138
138
|
return modifier(value);
|
|
139
139
|
};
|
|
140
140
|
YearViewService.prototype.cellTitle = function (value) {
|
|
141
|
-
return value.getFullYear()
|
|
141
|
+
return "".concat(value.getFullYear(), " ").concat(this.value(value));
|
|
142
142
|
};
|
|
143
143
|
YearViewService.prototype.navigationTitle = function (value) {
|
|
144
144
|
return this.title(value);
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
export default class ScrollSync {
|
|
5
5
|
private scrollDetails;
|
|
6
6
|
private scrollNavigation;
|
|
7
|
-
areDetailsSynced:
|
|
8
|
-
isNavigationSynced:
|
|
9
|
-
magnitude:
|
|
7
|
+
areDetailsSynced: boolean;
|
|
8
|
+
isNavigationSynced: boolean;
|
|
9
|
+
magnitude: number;
|
|
10
10
|
constructor(detailsMonthHeight: number, navigationMonthHeight: number, scrollDetails: (scrollTo: number) => void, scrollNavigation: (scrollTo: number) => void);
|
|
11
11
|
syncDetails(navigationScrollTop: number): void;
|
|
12
12
|
syncNavigation(detailsScrollTop: number): void;
|
|
@@ -5,6 +5,8 @@ var ScrollSync = /** @class */ (function () {
|
|
|
5
5
|
function ScrollSync(detailsMonthHeight, navigationMonthHeight, scrollDetails, scrollNavigation) {
|
|
6
6
|
this.scrollDetails = scrollDetails;
|
|
7
7
|
this.scrollNavigation = scrollNavigation;
|
|
8
|
+
this.areDetailsSynced = false;
|
|
9
|
+
this.isNavigationSynced = false;
|
|
8
10
|
this.magnitude = Math.max(detailsMonthHeight / navigationMonthHeight, 1);
|
|
9
11
|
}
|
|
10
12
|
ScrollSync.prototype.syncDetails = function (navigationScrollTop) {
|
|
@@ -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
|
*/
|
|
@@ -110,7 +114,7 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
110
114
|
second: PropTypes.Requireable<string>;
|
|
111
115
|
timeZoneName: PropTypes.Requireable<string>;
|
|
112
116
|
}>>;
|
|
113
|
-
formatPlaceholder: PropTypes.Requireable<"
|
|
117
|
+
formatPlaceholder: PropTypes.Requireable<"short" | "narrow" | "wide" | "formatPattern" | PropTypes.InferProps<{
|
|
114
118
|
year: PropTypes.Requireable<string>;
|
|
115
119
|
month: PropTypes.Requireable<string>;
|
|
116
120
|
day: PropTypes.Requireable<string>;
|
|
@@ -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" | "
|
|
151
|
-
fillMode: PropTypes.Requireable<"
|
|
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" | "
|
|
160
|
-
fillMode: "
|
|
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;
|
|
@@ -198,21 +202,21 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
198
202
|
/**
|
|
199
203
|
* Gets the value of the DateInput.
|
|
200
204
|
*/
|
|
201
|
-
|
|
205
|
+
get value(): Date | null;
|
|
202
206
|
/**
|
|
203
207
|
* Gets the `name` property of the DateInput.
|
|
204
208
|
*/
|
|
205
|
-
|
|
206
|
-
protected
|
|
207
|
-
protected
|
|
209
|
+
get name(): string | undefined;
|
|
210
|
+
protected get min(): Date;
|
|
211
|
+
protected get max(): Date;
|
|
208
212
|
/**
|
|
209
213
|
* @hidden
|
|
210
214
|
*/
|
|
211
|
-
|
|
215
|
+
get text(): string;
|
|
212
216
|
/**
|
|
213
217
|
* Represents the validity state into which the DateInput is set.
|
|
214
218
|
*/
|
|
215
|
-
|
|
219
|
+
get validity(): FormComponentValidity;
|
|
216
220
|
/**
|
|
217
221
|
* Gets the element of the DateInput.
|
|
218
222
|
*
|
|
@@ -244,7 +248,7 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
244
248
|
* );
|
|
245
249
|
* ```
|
|
246
250
|
*/
|
|
247
|
-
|
|
251
|
+
get element(): HTMLInputElement | null;
|
|
248
252
|
/**
|
|
249
253
|
* @hidden
|
|
250
254
|
*/
|
|
@@ -252,15 +256,15 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
252
256
|
/**
|
|
253
257
|
* @hidden
|
|
254
258
|
*/
|
|
255
|
-
protected
|
|
259
|
+
protected get validityStyles(): boolean;
|
|
256
260
|
/**
|
|
257
261
|
* @hidden
|
|
258
262
|
*/
|
|
259
|
-
protected
|
|
263
|
+
protected get required(): boolean;
|
|
260
264
|
/**
|
|
261
265
|
* @hidden
|
|
262
266
|
*/
|
|
263
|
-
protected
|
|
267
|
+
protected get wrapper(): HTMLSpanElement | null;
|
|
264
268
|
/**
|
|
265
269
|
* @hidden
|
|
266
270
|
*/
|
|
@@ -269,7 +273,7 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
269
273
|
* @hidden
|
|
270
274
|
*/
|
|
271
275
|
protected setValidity: () => void;
|
|
272
|
-
protected updateOnPaste: (event: React.SyntheticEvent<HTMLInputElement
|
|
276
|
+
protected updateOnPaste: (event: React.SyntheticEvent<HTMLInputElement>) => void;
|
|
273
277
|
private spinnersMouseDown;
|
|
274
278
|
private handlePaste;
|
|
275
279
|
private elementChange;
|
|
@@ -281,7 +285,7 @@ export declare class DateInputWithoutContext extends React.Component<DateInputPr
|
|
|
281
285
|
private elementKeyDown;
|
|
282
286
|
private elementOnFocus;
|
|
283
287
|
private elementOnBlur;
|
|
284
|
-
private
|
|
288
|
+
private get selection();
|
|
285
289
|
private setSelection;
|
|
286
290
|
private triggerChange;
|
|
287
291
|
private selectionBySymbol;
|
|
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
2
2
|
var extendStatics = function (d, b) {
|
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -22,6 +24,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
22
24
|
};
|
|
23
25
|
return __assign.apply(this, arguments);
|
|
24
26
|
};
|
|
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));
|
|
35
|
+
};
|
|
25
36
|
import * as React from 'react';
|
|
26
37
|
import * as PropTypes from 'prop-types';
|
|
27
38
|
import { isEqual, cloneDate } from '@progress/kendo-date-math';
|
|
@@ -45,10 +56,12 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
45
56
|
function DateInputWithoutContext(props) {
|
|
46
57
|
var _this = _super.call(this, props) || this;
|
|
47
58
|
_this.kendoDate = null;
|
|
59
|
+
_this.currentFormat = '';
|
|
48
60
|
_this.paste = false;
|
|
49
61
|
_this._element = null;
|
|
50
62
|
_this._wrapper = null;
|
|
51
63
|
_this._inputId = guid();
|
|
64
|
+
_this._lastSelectedSymbol = '';
|
|
52
65
|
/**
|
|
53
66
|
* @hidden
|
|
54
67
|
*/
|
|
@@ -238,7 +251,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
238
251
|
this.props._ref.current = this;
|
|
239
252
|
}
|
|
240
253
|
var localizationService = provideLocalizationService(this);
|
|
241
|
-
var props = __assign({}, DateInputWithoutContext.defaultProps, this.props);
|
|
254
|
+
var props = __assign(__assign({}, DateInputWithoutContext.defaultProps), this.props);
|
|
242
255
|
var min = props.min, max = props.max, name = props.name, label = props.label, id = props.id;
|
|
243
256
|
var currentText = this.text;
|
|
244
257
|
var text = currentText === this.props.placeholder ? '' : currentText;
|
|
@@ -253,19 +266,19 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
253
266
|
if (this.value !== null) {
|
|
254
267
|
ariaProps['aria-valuenow'] = this.value.getTime();
|
|
255
268
|
}
|
|
256
|
-
var wrapperClassesInstance = wrapperClasses
|
|
269
|
+
var wrapperClassesInstance = __spreadArray([], wrapperClasses, true);
|
|
257
270
|
if (this.props.className) {
|
|
258
271
|
wrapperClassesInstance.push(this.props.className);
|
|
259
272
|
}
|
|
260
273
|
var dateinput = (React.createElement(AsyncFocusBlur, { onFocus: this.elementOnFocus, onBlur: this.elementOnBlur }, function (_a) {
|
|
261
|
-
var onFocus = _a.onFocus, onBlur = _a.onBlur;
|
|
262
274
|
var _b;
|
|
275
|
+
var onFocus = _a.onFocus, onBlur = _a.onBlur;
|
|
263
276
|
return (React.createElement("span", { ref: function (span) { _this._wrapper = span; }, style: !label
|
|
264
277
|
? { width: _this.props.width }
|
|
265
278
|
: undefined, dir: _this.props.dir, className: classNames('k-dateinput', 'k-input', (_b = {},
|
|
266
|
-
_b["k-input-"
|
|
267
|
-
_b["k-input-"
|
|
268
|
-
_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,
|
|
269
282
|
_b['k-invalid'] = !isValid,
|
|
270
283
|
_b['k-required'] = _this.required,
|
|
271
284
|
_b['k-disabled'] = _this.props.disabled,
|
|
@@ -291,7 +304,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
291
304
|
}
|
|
292
305
|
return this.kendoDate && this.kendoDate.getDateObject();
|
|
293
306
|
},
|
|
294
|
-
enumerable:
|
|
307
|
+
enumerable: false,
|
|
295
308
|
configurable: true
|
|
296
309
|
});
|
|
297
310
|
Object.defineProperty(DateInputWithoutContext.prototype, "name", {
|
|
@@ -301,7 +314,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
301
314
|
get: function () {
|
|
302
315
|
return this.props.name;
|
|
303
316
|
},
|
|
304
|
-
enumerable:
|
|
317
|
+
enumerable: false,
|
|
305
318
|
configurable: true
|
|
306
319
|
});
|
|
307
320
|
Object.defineProperty(DateInputWithoutContext.prototype, "min", {
|
|
@@ -310,7 +323,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
310
323
|
? this.props.min
|
|
311
324
|
: DateInputWithoutContext.defaultProps.min;
|
|
312
325
|
},
|
|
313
|
-
enumerable:
|
|
326
|
+
enumerable: false,
|
|
314
327
|
configurable: true
|
|
315
328
|
});
|
|
316
329
|
Object.defineProperty(DateInputWithoutContext.prototype, "max", {
|
|
@@ -319,7 +332,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
319
332
|
? this.props.max
|
|
320
333
|
: DateInputWithoutContext.defaultProps.max;
|
|
321
334
|
},
|
|
322
|
-
enumerable:
|
|
335
|
+
enumerable: false,
|
|
323
336
|
configurable: true
|
|
324
337
|
});
|
|
325
338
|
Object.defineProperty(DateInputWithoutContext.prototype, "text", {
|
|
@@ -327,7 +340,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
327
340
|
* @hidden
|
|
328
341
|
*/
|
|
329
342
|
get: function () {
|
|
330
|
-
var props = __assign({}, DateInput.defaultProps, this.props);
|
|
343
|
+
var props = __assign(__assign({}, DateInput.defaultProps), this.props);
|
|
331
344
|
var _a = props.formatPlaceholder, formatPlaceholder = _a === void 0 ? DateInputWithoutContext.defaultProps.formatPlaceholder : _a, _b = props.format, format = _b === void 0 ? DateInputWithoutContext.defaultProps.format : _b, value = props.value, defaultValue = props.defaultValue;
|
|
332
345
|
if (this.kendoDate === null) {
|
|
333
346
|
this.kendoDate = new KendoDate(this.intl.bind(this), formatPlaceholder, format);
|
|
@@ -348,7 +361,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
348
361
|
? props.placeholder
|
|
349
362
|
: currentText;
|
|
350
363
|
},
|
|
351
|
-
enumerable:
|
|
364
|
+
enumerable: false,
|
|
352
365
|
configurable: true
|
|
353
366
|
});
|
|
354
367
|
Object.defineProperty(DateInputWithoutContext.prototype, "validity", {
|
|
@@ -369,7 +382,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
369
382
|
valueMissing: this.value === null
|
|
370
383
|
};
|
|
371
384
|
},
|
|
372
|
-
enumerable:
|
|
385
|
+
enumerable: false,
|
|
373
386
|
configurable: true
|
|
374
387
|
});
|
|
375
388
|
Object.defineProperty(DateInputWithoutContext.prototype, "element", {
|
|
@@ -407,7 +420,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
407
420
|
get: function () {
|
|
408
421
|
return this._element;
|
|
409
422
|
},
|
|
410
|
-
enumerable:
|
|
423
|
+
enumerable: false,
|
|
411
424
|
configurable: true
|
|
412
425
|
});
|
|
413
426
|
Object.defineProperty(DateInputWithoutContext.prototype, "validityStyles", {
|
|
@@ -419,7 +432,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
419
432
|
? this.props.validityStyles
|
|
420
433
|
: DateInputWithoutContext.defaultProps.validityStyles;
|
|
421
434
|
},
|
|
422
|
-
enumerable:
|
|
435
|
+
enumerable: false,
|
|
423
436
|
configurable: true
|
|
424
437
|
});
|
|
425
438
|
Object.defineProperty(DateInputWithoutContext.prototype, "required", {
|
|
@@ -431,7 +444,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
431
444
|
? this.props.required
|
|
432
445
|
: DateInputWithoutContext.defaultProps.required;
|
|
433
446
|
},
|
|
434
|
-
enumerable:
|
|
447
|
+
enumerable: false,
|
|
435
448
|
configurable: true
|
|
436
449
|
});
|
|
437
450
|
Object.defineProperty(DateInputWithoutContext.prototype, "wrapper", {
|
|
@@ -441,7 +454,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
441
454
|
get: function () {
|
|
442
455
|
return this._wrapper;
|
|
443
456
|
},
|
|
444
|
-
enumerable:
|
|
457
|
+
enumerable: false,
|
|
445
458
|
configurable: true
|
|
446
459
|
});
|
|
447
460
|
/**
|
|
@@ -459,7 +472,7 @@ var DateInputWithoutContext = /** @class */ (function (_super) {
|
|
|
459
472
|
}
|
|
460
473
|
return returnValue;
|
|
461
474
|
},
|
|
462
|
-
enumerable:
|
|
475
|
+
enumerable: false,
|
|
463
476
|
configurable: true
|
|
464
477
|
});
|
|
465
478
|
DateInputWithoutContext.prototype.setSelection = function (selection) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -25,9 +25,9 @@ export declare class KendoDate {
|
|
|
25
25
|
private knownParts;
|
|
26
26
|
private symbols;
|
|
27
27
|
private intlProvider;
|
|
28
|
-
|
|
28
|
+
get intl(): IntlService;
|
|
29
29
|
private _value;
|
|
30
|
-
|
|
30
|
+
get value(): Date;
|
|
31
31
|
constructor(intlProvider: () => IntlService, formatPlaceholder: DateInputFormatPlaceholder, format: string | DateFormatOptions);
|
|
32
32
|
setValue(value: Date | null): void;
|
|
33
33
|
hasValue(): boolean;
|
|
@@ -37,14 +37,14 @@ var KendoDate = /** @class */ (function () {
|
|
|
37
37
|
get: function () {
|
|
38
38
|
return this.intlProvider();
|
|
39
39
|
},
|
|
40
|
-
enumerable:
|
|
40
|
+
enumerable: false,
|
|
41
41
|
configurable: true
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(KendoDate.prototype, "value", {
|
|
44
44
|
get: function () {
|
|
45
45
|
return this._value;
|
|
46
46
|
},
|
|
47
|
-
enumerable:
|
|
47
|
+
enumerable: false,
|
|
48
48
|
configurable: true
|
|
49
49
|
});
|
|
50
50
|
KendoDate.prototype.setValue = function (value) {
|
|
@@ -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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,7 +9,7 @@ export declare const defaultFormatPlaceholder = "wide";
|
|
|
9
9
|
/**
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
|
-
export declare const padZero: (length:
|
|
12
|
+
export declare const padZero: (length: number) => string;
|
|
13
13
|
/**
|
|
14
14
|
* @hidden
|
|
15
15
|
*/
|
|
@@ -21,7 +21,7 @@ export declare const dateSymbolMap: (map: any, part: any) => Function;
|
|
|
21
21
|
/**
|
|
22
22
|
* @hidden
|
|
23
23
|
*/
|
|
24
|
-
export declare const isInRange: (candidate: Date, min: Date, max: Date) => boolean;
|
|
24
|
+
export declare const isInRange: (candidate: Date | null, min: Date, max: Date) => boolean;
|
|
25
25
|
/**
|
|
26
26
|
* @hidden
|
|
27
27
|
*/
|