@progress/kendo-vue-dateinputs 2.6.4 → 2.6.5-dev.202112031051
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-vue-dateinputs.js +1 -1
- package/dist/es/calendar/components/Calendar.js +4 -2
- package/dist/es/daterangepicker/DateRangePicker.d.ts +3 -0
- package/dist/es/daterangepicker/DateRangePicker.js +133 -143
- package/dist/es/datetimepicker/DateTimePicker.js +3 -1
- package/dist/es/datetimepicker/DateTimeSelector.d.ts +2 -0
- package/dist/es/datetimepicker/DateTimeSelector.js +11 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/calendar/components/Calendar.js +4 -2
- package/dist/npm/daterangepicker/DateRangePicker.d.ts +3 -0
- package/dist/npm/daterangepicker/DateRangePicker.js +132 -142
- package/dist/npm/datetimepicker/DateTimePicker.js +3 -1
- package/dist/npm/datetimepicker/DateTimeSelector.d.ts +2 -0
- package/dist/npm/datetimepicker/DateTimeSelector.js +11 -2
- package/dist/npm/package-metadata.js +1 -1
- package/package.json +7 -7
|
@@ -113,7 +113,7 @@ var Calendar = {
|
|
|
113
113
|
created: function created() {
|
|
114
114
|
validatePackage(packageMetadata);
|
|
115
115
|
var value = calculateValue(this.currentMin, this.currentMax, this.$props.defaultValue, this.$props.value || this.$props.modelValue);
|
|
116
|
-
var selectedDate =
|
|
116
|
+
var selectedDate = extractDateFromValue(this.currentMin, this.currentMax, value);
|
|
117
117
|
var selectedMultiple = extractMultipleFromValue(this.currentMin, this.currentMax, value);
|
|
118
118
|
var selectedRange = extractRangeFromValue(value);
|
|
119
119
|
var calculatedFocus = extractFocusedDate(selectedDate, selectedMultiple, selectedRange);
|
|
@@ -177,6 +177,9 @@ var Calendar = {
|
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
methods: {
|
|
180
|
+
element: function element() {
|
|
181
|
+
return this.$el;
|
|
182
|
+
},
|
|
180
183
|
computedValue: function computedValue() {
|
|
181
184
|
return this.$data.valueDuringOnChange !== undefined ? this.$data.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.$data.currentValue;
|
|
182
185
|
},
|
|
@@ -429,7 +432,6 @@ var Calendar = {
|
|
|
429
432
|
var didValueChange = currentValue !== null && this._oldValue !== null ? !this.isValueEqual(currentValue, this._oldValue) : currentValue !== this._oldValue;
|
|
430
433
|
this._selectedDate = extractDateFromValue(this.currentMin, this.currentMax, currentValue);
|
|
431
434
|
this._selectedMultiple = extractMultipleFromValue(this.currentMin, this.currentMax, currentValue);
|
|
432
|
-
this._selectedRange = extractRangeFromValue(currentValue);
|
|
433
435
|
var cell = templateRendering.call(this, this.$props.cell, getListeners.call(this));
|
|
434
436
|
var weekCell = templateRendering.call(this, this.$props.weekCell, getListeners.call(this));
|
|
435
437
|
var headerTitle = templateRendering.call(this, this.$props.headerTitle, getListeners.call(this));
|
|
@@ -68,6 +68,7 @@ export interface DateRangePickerState {
|
|
|
68
68
|
_popupId: string;
|
|
69
69
|
_startInputId: string;
|
|
70
70
|
_endInputId: string;
|
|
71
|
+
_calendarId: string;
|
|
71
72
|
shouldFocusDateInput: boolean;
|
|
72
73
|
shouldFocusCalendar: boolean;
|
|
73
74
|
initialAnimation: boolean;
|
|
@@ -85,6 +86,8 @@ export interface DateRangePickerComputed {
|
|
|
85
86
|
*/
|
|
86
87
|
export interface DateRangePickerMethods {
|
|
87
88
|
[key: string]: any;
|
|
89
|
+
getStartInput: () => any;
|
|
90
|
+
getEndInput: () => any;
|
|
88
91
|
}
|
|
89
92
|
/**
|
|
90
93
|
* @hidden
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
}; // @ts-ignore
|
|
16
|
+
|
|
17
|
+
|
|
2
18
|
import * as Vue from 'vue';
|
|
3
19
|
var allVue = Vue;
|
|
4
20
|
var gh = allVue.h;
|
|
@@ -25,7 +41,8 @@ var DateRangePicker = {
|
|
|
25
41
|
emits: {
|
|
26
42
|
blur: null,
|
|
27
43
|
change: null,
|
|
28
|
-
focus: null
|
|
44
|
+
focus: null,
|
|
45
|
+
keydown: null
|
|
29
46
|
},
|
|
30
47
|
props: {
|
|
31
48
|
allowReverse: {
|
|
@@ -47,6 +64,8 @@ var DateRangePicker = {
|
|
|
47
64
|
type: Boolean,
|
|
48
65
|
default: false
|
|
49
66
|
},
|
|
67
|
+
popup: [String, Object, Function],
|
|
68
|
+
calendar: [String, Object, Function],
|
|
50
69
|
startDateInput: [String, Object, Function],
|
|
51
70
|
endDateInput: [String, Object, Function],
|
|
52
71
|
endDateInputSettings: Object,
|
|
@@ -57,26 +76,6 @@ var DateRangePicker = {
|
|
|
57
76
|
return 'd';
|
|
58
77
|
}
|
|
59
78
|
},
|
|
60
|
-
// PropTypes.oneOfType([
|
|
61
|
-
// PropTypes.string,
|
|
62
|
-
// PropTypes.shape({
|
|
63
|
-
// skeleton: PropTypes.string,
|
|
64
|
-
// pattern: PropTypes.string,
|
|
65
|
-
// date: PropTypes.oneOf(['short', 'medium', 'long', 'full']),
|
|
66
|
-
// time: PropTypes.oneOf(['short', 'medium', 'long', 'full']),
|
|
67
|
-
// datetime: PropTypes.oneOf(['short', 'medium', 'long', 'full']),
|
|
68
|
-
// era: PropTypes.oneOf(['narrow', 'short', 'long']),
|
|
69
|
-
// year: PropTypes.oneOf(['numeric', '2-digit']),
|
|
70
|
-
// month: PropTypes.oneOf(['numeric', '2-digit', 'narrow', 'short', 'long']),
|
|
71
|
-
// day: PropTypes.oneOf(['numeric', '2-digit']),
|
|
72
|
-
// weekday: PropTypes.oneOf(['narrow', 'short', 'long']),
|
|
73
|
-
// hour: PropTypes.oneOf(['numeric', '2-digit']),
|
|
74
|
-
// hour12: Boolean,
|
|
75
|
-
// minute: PropTypes.oneOf(['numeric', '2-digit']),
|
|
76
|
-
// second: PropTypes.oneOf(['numeric', '2-digit']),
|
|
77
|
-
// timeZoneName: PropTypes.oneOf(['short', 'long'])
|
|
78
|
-
// })
|
|
79
|
-
// ]),
|
|
80
79
|
id: String,
|
|
81
80
|
ariaLabelledBy: String,
|
|
82
81
|
ariaDescribedBy: String,
|
|
@@ -113,21 +112,19 @@ var DateRangePicker = {
|
|
|
113
112
|
default: function _default() {
|
|
114
113
|
return undefined;
|
|
115
114
|
}
|
|
116
|
-
}
|
|
117
|
-
|
|
115
|
+
}
|
|
118
116
|
},
|
|
119
117
|
created: function created() {
|
|
120
118
|
this._element = null;
|
|
121
119
|
this._wrapper = null;
|
|
122
120
|
this._calendar = null;
|
|
123
121
|
this._startDateInput = null;
|
|
124
|
-
this._endDateInput = null;
|
|
125
|
-
// this.showDuringOnChange?: boolean;
|
|
126
|
-
|
|
122
|
+
this._endDateInput = null;
|
|
127
123
|
this._popupId = guid();
|
|
128
124
|
this._anchor = guid();
|
|
129
125
|
this._startInputId = guid();
|
|
130
126
|
this._endInputId = guid();
|
|
127
|
+
this._calendarId = guid();
|
|
131
128
|
validatePackage(packageMetadata);
|
|
132
129
|
this.currentShow = this.$props.show || this.$props.defaultShow;
|
|
133
130
|
this.currentValue = this.$props.value || this.$props.defaultValue;
|
|
@@ -147,9 +144,9 @@ var DateRangePicker = {
|
|
|
147
144
|
}
|
|
148
145
|
},
|
|
149
146
|
updated: function updated() {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
this._calendar = this.v3 ? this.calendarRef : this.$refs.calendar;
|
|
148
|
+
this._startDateInput = this.v3 ? this.startDateInputRef : this.$refs.startDateInput;
|
|
149
|
+
this._endDateInput = this.v3 ? this.endDateInputRef : this.$refs.endDateInput;
|
|
153
150
|
|
|
154
151
|
if (this.shouldFocusCalendar) {
|
|
155
152
|
this.focusCalendarElement();
|
|
@@ -207,25 +204,9 @@ var DateRangePicker = {
|
|
|
207
204
|
var endMessage = localizationService.toLanguageString(end, messages[end]);
|
|
208
205
|
var separatorMessage = localizationService.toLanguageString(separator, messages[separator]);
|
|
209
206
|
var startDateInputRender = this.$props.startDateInput ? templateRendering.call(this, this.$props.startDateInput, getListeners.call(this)) : undefined;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
ref: this.v3 ? function (el) {
|
|
213
|
-
_this.startDateInputRef = el;
|
|
214
|
-
} : 'startDateInput',
|
|
207
|
+
|
|
208
|
+
var startSettings = __assign({
|
|
215
209
|
label: startMessage,
|
|
216
|
-
attrs: this.v3 ? undefined : {
|
|
217
|
-
label: startMessage,
|
|
218
|
-
format: this.$props.format,
|
|
219
|
-
min: this.min,
|
|
220
|
-
max: this.max,
|
|
221
|
-
id: this._startInputId,
|
|
222
|
-
disabled: this.$props.disabled,
|
|
223
|
-
valid: this.$props.valid,
|
|
224
|
-
ariaHasPopup: true,
|
|
225
|
-
ariaExpanded: this.computedShow // ...this.$props.startDateInputSettings,
|
|
226
|
-
,
|
|
227
|
-
value: value.start
|
|
228
|
-
},
|
|
229
210
|
format: this.$props.format,
|
|
230
211
|
min: this.min,
|
|
231
212
|
max: this.max,
|
|
@@ -234,12 +215,20 @@ var DateRangePicker = {
|
|
|
234
215
|
valid: this.$props.valid,
|
|
235
216
|
ariaHasPopup: true,
|
|
236
217
|
ariaExpanded: this.computedShow,
|
|
237
|
-
value: value.start
|
|
238
|
-
|
|
218
|
+
value: value.start
|
|
219
|
+
}, this.$props.endDateInputSettings);
|
|
220
|
+
|
|
221
|
+
var startDateInputDefaultRendering = h(DateInput, __assign(__assign({
|
|
222
|
+
ref: this.v3 ? function (el) {
|
|
223
|
+
_this.startDateInputRef = el;
|
|
224
|
+
} : 'startDateInput',
|
|
225
|
+
attrs: this.v3 ? undefined : startSettings
|
|
226
|
+
}, startSettings), {
|
|
227
|
+
onChange: this.handleEndChange,
|
|
239
228
|
on: this.v3 ? undefined : {
|
|
240
|
-
|
|
229
|
+
'change': this.handleEndChange
|
|
241
230
|
}
|
|
242
|
-
});
|
|
231
|
+
}));
|
|
243
232
|
var startDateInputRendering = getTemplate.call(this, {
|
|
244
233
|
h: h,
|
|
245
234
|
template: startDateInputRender,
|
|
@@ -249,25 +238,9 @@ var DateRangePicker = {
|
|
|
249
238
|
}
|
|
250
239
|
});
|
|
251
240
|
var endDateInputRender = this.$props.endDateInput ? templateRendering.call(this, this.$props.endDateInput, getListeners.call(this)) : undefined;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
ref: this.v3 ? function (el) {
|
|
255
|
-
_this.endDateInputRef = el;
|
|
256
|
-
} : 'endDateInput',
|
|
241
|
+
|
|
242
|
+
var endSettings = __assign({
|
|
257
243
|
label: endMessage,
|
|
258
|
-
attrs: this.v3 ? undefined : {
|
|
259
|
-
label: endMessage,
|
|
260
|
-
format: this.$props.format,
|
|
261
|
-
min: this.min,
|
|
262
|
-
max: this.max,
|
|
263
|
-
id: this._endInputId,
|
|
264
|
-
disabled: this.$props.disabled,
|
|
265
|
-
valid: this.$props.valid,
|
|
266
|
-
ariaHasPopup: true,
|
|
267
|
-
ariaExpanded: this.computedShow // ...this.$props.endDateInputSettings,
|
|
268
|
-
,
|
|
269
|
-
value: value.end
|
|
270
|
-
},
|
|
271
244
|
format: this.$props.format,
|
|
272
245
|
min: this.min,
|
|
273
246
|
max: this.max,
|
|
@@ -276,12 +249,20 @@ var DateRangePicker = {
|
|
|
276
249
|
valid: this.$props.valid,
|
|
277
250
|
ariaHasPopup: true,
|
|
278
251
|
ariaExpanded: this.computedShow,
|
|
279
|
-
value: value.end
|
|
252
|
+
value: value.end
|
|
253
|
+
}, this.$props.endDateInputSettings);
|
|
254
|
+
|
|
255
|
+
var endDateInputDefaultRendering = h(DateInput, __assign(__assign({
|
|
256
|
+
ref: this.v3 ? function (el) {
|
|
257
|
+
_this.endDateInputRef = el;
|
|
258
|
+
} : 'endDateInput',
|
|
259
|
+
attrs: this.v3 ? undefined : endSettings
|
|
260
|
+
}, endSettings), {
|
|
280
261
|
onChange: this.handleEndChange,
|
|
281
262
|
on: this.v3 ? undefined : {
|
|
282
|
-
|
|
263
|
+
'change': this.handleEndChange
|
|
283
264
|
}
|
|
284
|
-
});
|
|
265
|
+
}));
|
|
285
266
|
var endDateInputRendering = getTemplate.call(this, {
|
|
286
267
|
h: h,
|
|
287
268
|
template: endDateInputRender,
|
|
@@ -291,72 +272,53 @@ var DateRangePicker = {
|
|
|
291
272
|
}
|
|
292
273
|
});
|
|
293
274
|
var calendarRender = this.$props.calendar ? templateRendering.call(this, this.$props.calendar, getListeners.call(this)) : undefined;
|
|
294
|
-
|
|
295
|
-
|
|
275
|
+
|
|
276
|
+
var calendarSettings = __assign({
|
|
277
|
+
id: this._calendarId,
|
|
278
|
+
min: this.min,
|
|
279
|
+
max: this.max,
|
|
280
|
+
views: 2,
|
|
281
|
+
allowReverse: this.$props.allowReverse,
|
|
282
|
+
mode: 'range',
|
|
283
|
+
focusedDate: this.$props.focusedDate,
|
|
284
|
+
disabled: this.$props.disabled,
|
|
285
|
+
value: value
|
|
286
|
+
}, this.$props.calendarSettings);
|
|
287
|
+
|
|
288
|
+
var calendarDefaultRendering = h(Calendar, __assign({
|
|
296
289
|
ref: this.v3 ? function (el) {
|
|
297
290
|
_this.calendarRef = el;
|
|
298
291
|
} : 'calendar',
|
|
292
|
+
attrs: this.v3 ? undefined : calendarSettings,
|
|
299
293
|
onKeydown: this.handleKeyDown,
|
|
300
294
|
on: this.v3 ? undefined : {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
295
|
+
'keydown': this.handleKeyDown,
|
|
296
|
+
'focus': this.calendarFocus,
|
|
297
|
+
'blur': this.calendarBlur,
|
|
298
|
+
'change': this.handleCalendarChange
|
|
305
299
|
},
|
|
306
300
|
onFocus: this.calendarFocus,
|
|
307
301
|
onBlur: this.calendarBlur,
|
|
308
|
-
min: this.min,
|
|
309
|
-
attrs: this.v3 ? undefined : {
|
|
310
|
-
min: this.min,
|
|
311
|
-
max: this.max,
|
|
312
|
-
views: 2,
|
|
313
|
-
allowReverse: this.$props.allowReverse,
|
|
314
|
-
mode: 'range',
|
|
315
|
-
focusedDate: this.$props.focusedDate,
|
|
316
|
-
disabled: this.$props.disabled // ...this.$props.calendarSettings,
|
|
317
|
-
,
|
|
318
|
-
value: value
|
|
319
|
-
},
|
|
320
|
-
max: this.max,
|
|
321
|
-
views: 2,
|
|
322
|
-
allowReverse: this.$props.allowReverse,
|
|
323
|
-
mode: 'range',
|
|
324
|
-
focusedDate: this.$props.focusedDate,
|
|
325
|
-
disabled: this.$props.disabled,
|
|
326
|
-
value: value,
|
|
327
302
|
onChange: this.handleCalendarChange
|
|
328
|
-
});
|
|
303
|
+
}, calendarSettings));
|
|
329
304
|
var calendarRendering = getTemplate.call(this, {
|
|
330
305
|
h: h,
|
|
331
306
|
template: calendarRender,
|
|
332
307
|
defaultRendering: calendarDefaultRendering,
|
|
333
308
|
additionalListeners: {
|
|
334
|
-
change: this.handleCalendarChange
|
|
309
|
+
change: this.handleCalendarChange,
|
|
310
|
+
keydown: this.handleKeyDown,
|
|
311
|
+
focus: this.calendarFocus,
|
|
312
|
+
blur: this.calendarBlur
|
|
335
313
|
}
|
|
336
314
|
});
|
|
337
315
|
var _a = this.$props.popupSettings,
|
|
338
316
|
popupClass = _a.popupClass,
|
|
339
|
-
animate = _a.animate
|
|
340
|
-
appendTo = _a.appendTo;
|
|
317
|
+
animate = _a.animate;
|
|
341
318
|
var popupRender = this.$props.popup ? templateRendering.call(this, this.$props.popup, getListeners.call(this)) : undefined;
|
|
342
|
-
|
|
343
|
-
|
|
319
|
+
|
|
320
|
+
var popupSettings = __assign({
|
|
344
321
|
show: this.computedShow,
|
|
345
|
-
attrs: this.v3 ? undefined : {
|
|
346
|
-
show: this.computedShow,
|
|
347
|
-
anchor: this._anchor,
|
|
348
|
-
id: this._popupId,
|
|
349
|
-
anchorAlign: {
|
|
350
|
-
horizontal: 'left',
|
|
351
|
-
vertical: 'bottom'
|
|
352
|
-
},
|
|
353
|
-
popupAlign: {
|
|
354
|
-
horizontal: 'left',
|
|
355
|
-
vertical: 'top'
|
|
356
|
-
},
|
|
357
|
-
animate: this.initialAnimation ? false : animate,
|
|
358
|
-
appendTo: appendTo
|
|
359
|
-
},
|
|
360
322
|
anchor: this._anchor,
|
|
361
323
|
id: this._popupId,
|
|
362
324
|
anchorAlign: {
|
|
@@ -367,10 +329,13 @@ var DateRangePicker = {
|
|
|
367
329
|
horizontal: 'left',
|
|
368
330
|
vertical: 'top'
|
|
369
331
|
},
|
|
370
|
-
animate: this.initialAnimation ? false : animate
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
332
|
+
animate: this.initialAnimation ? false : animate
|
|
333
|
+
}, this.$props.popupSettings);
|
|
334
|
+
|
|
335
|
+
var popupDefaultRendering = h(Popup, __assign({
|
|
336
|
+
attrs: this.v3 ? undefined : popupSettings,
|
|
337
|
+
'class': popupClass
|
|
338
|
+
}, popupSettings), this.v3 ? function () {
|
|
374
339
|
return [calendarRendering];
|
|
375
340
|
} : [calendarRendering]);
|
|
376
341
|
var popupRendering = getTemplate.call(this, {
|
|
@@ -434,30 +399,35 @@ var DateRangePicker = {
|
|
|
434
399
|
},
|
|
435
400
|
methods: {
|
|
436
401
|
focus: function focus() {
|
|
437
|
-
|
|
438
|
-
|
|
402
|
+
var startInput = this.getStartInput();
|
|
403
|
+
|
|
404
|
+
if (startInput) {
|
|
405
|
+
startInput.focus();
|
|
439
406
|
}
|
|
440
407
|
},
|
|
441
408
|
focusCalendarElement: function focusCalendarElement() {
|
|
442
|
-
var
|
|
409
|
+
var calendar = this.getCalendar();
|
|
443
410
|
|
|
444
|
-
if (
|
|
445
|
-
|
|
411
|
+
if (calendar) {
|
|
412
|
+
calendar.focus({
|
|
446
413
|
preventScroll: true
|
|
447
414
|
});
|
|
448
415
|
}
|
|
449
416
|
},
|
|
450
417
|
focusDateInputElement: function focusDateInputElement() {
|
|
451
|
-
|
|
418
|
+
var startInput = this.getStartInput();
|
|
419
|
+
var endInput = this.getEndInput();
|
|
420
|
+
|
|
421
|
+
if (!document || !startInput || !endInput) {
|
|
452
422
|
return;
|
|
453
423
|
}
|
|
454
424
|
|
|
455
|
-
if ((this.computedValue.start === null || this.computedValue.end !== null) && document.activeElement !==
|
|
456
|
-
|
|
425
|
+
if ((this.computedValue.start === null || this.computedValue.end !== null) && document.activeElement !== endInput) {
|
|
426
|
+
startInput.focus({
|
|
457
427
|
preventScroll: true
|
|
458
428
|
});
|
|
459
|
-
} else if (document.activeElement !==
|
|
460
|
-
|
|
429
|
+
} else if (document.activeElement !== startInput) {
|
|
430
|
+
endInput.focus({
|
|
461
431
|
preventScroll: true
|
|
462
432
|
});
|
|
463
433
|
}
|
|
@@ -492,16 +462,19 @@ var DateRangePicker = {
|
|
|
492
462
|
event.preventDefault();
|
|
493
463
|
},
|
|
494
464
|
handleFocus: function handleFocus(event) {
|
|
465
|
+
var startInput = this.getStartInput();
|
|
466
|
+
var endInput = this.getEndInput();
|
|
467
|
+
|
|
495
468
|
if (!this.shouldFocusDateInput) {
|
|
496
469
|
this.setShow(true);
|
|
497
470
|
}
|
|
498
471
|
|
|
499
|
-
if (
|
|
500
|
-
|
|
472
|
+
if (startInput) {
|
|
473
|
+
startInput.classList.add('k-state-focused');
|
|
501
474
|
}
|
|
502
475
|
|
|
503
|
-
if (
|
|
504
|
-
|
|
476
|
+
if (endInput) {
|
|
477
|
+
endInput.classList.add('k-state-focused');
|
|
505
478
|
}
|
|
506
479
|
|
|
507
480
|
this.$emit('focus', event);
|
|
@@ -519,19 +492,32 @@ var DateRangePicker = {
|
|
|
519
492
|
var _this = this;
|
|
520
493
|
|
|
521
494
|
this._blurTimeout = setTimeout(function () {
|
|
522
|
-
|
|
523
|
-
|
|
495
|
+
var startInput = _this.getStartInput();
|
|
496
|
+
|
|
497
|
+
var endInput = _this.getEndInput();
|
|
498
|
+
|
|
499
|
+
if (startInput) {
|
|
500
|
+
startInput.classList.remove('k-state-focused');
|
|
524
501
|
}
|
|
525
502
|
|
|
526
|
-
if (
|
|
527
|
-
|
|
503
|
+
if (endInput) {
|
|
504
|
+
endInput.classList.remove('k-state-focused');
|
|
528
505
|
}
|
|
529
506
|
|
|
530
|
-
if (
|
|
507
|
+
if (startInput && endInput && canUseDOM && startInput && document.activeElement !== endInput) {
|
|
531
508
|
_this.setShow(false);
|
|
532
509
|
}
|
|
533
510
|
}, 200);
|
|
534
511
|
},
|
|
512
|
+
getStartInput: function getStartInput() {
|
|
513
|
+
return this._startDateInput && this._startDateInput.element ? this._startDateInput.element() : document.getElementById(this._startInputId);
|
|
514
|
+
},
|
|
515
|
+
getEndInput: function getEndInput() {
|
|
516
|
+
return this._endDateInput && this._endDateInput.element ? this._endDateInput.element() : document.getElementById(this._endInputId);
|
|
517
|
+
},
|
|
518
|
+
getCalendar: function getCalendar() {
|
|
519
|
+
return this._calendar && this._calendar.element ? this._calendar : document.getElementById(this._calendarId);
|
|
520
|
+
},
|
|
535
521
|
handleBlur: function handleBlur(event) {
|
|
536
522
|
this.createBlurTimeout();
|
|
537
523
|
this.$emit('blur', event);
|
|
@@ -568,6 +554,8 @@ var DateRangePicker = {
|
|
|
568
554
|
handleKeyDown: function handleKeyDown(event) {
|
|
569
555
|
var keyCode = event.keyCode,
|
|
570
556
|
altKey = event.altKey;
|
|
557
|
+
var endInput = this.getEndInput();
|
|
558
|
+
var calendar = this.getCalendar();
|
|
571
559
|
|
|
572
560
|
if (keyCode === Keys.esc) {
|
|
573
561
|
event.preventDefault();
|
|
@@ -577,10 +565,12 @@ var DateRangePicker = {
|
|
|
577
565
|
event.preventDefault();
|
|
578
566
|
this.shouldFocusCalendar = true;
|
|
579
567
|
this.setShow(true);
|
|
580
|
-
} else if (keyCode === Keys.tab && this.computedShow &&
|
|
568
|
+
} else if (keyCode === Keys.tab && this.computedShow && calendar && endInput && document && document.activeElement === endInput) {
|
|
581
569
|
event.preventDefault();
|
|
582
570
|
this.focusCalendarElement();
|
|
583
571
|
}
|
|
572
|
+
|
|
573
|
+
this.$emit('keydown', event);
|
|
584
574
|
},
|
|
585
575
|
handleChange: function handleChange(value, event) {
|
|
586
576
|
this.currentValue = value;
|
|
@@ -367,7 +367,8 @@ var DateTimePicker = {
|
|
|
367
367
|
maxTime: maxTime,
|
|
368
368
|
focusedDate: focusedDate,
|
|
369
369
|
format: format,
|
|
370
|
-
calendar: calendar
|
|
370
|
+
calendar: calendar,
|
|
371
|
+
steps: steps
|
|
371
372
|
},
|
|
372
373
|
value: this.computedValue,
|
|
373
374
|
onChange: this.handleValueChange,
|
|
@@ -388,6 +389,7 @@ var DateTimePicker = {
|
|
|
388
389
|
focusedDate: focusedDate,
|
|
389
390
|
format: format,
|
|
390
391
|
calendar: calendar,
|
|
392
|
+
steps: steps,
|
|
391
393
|
onFocus: this.timeSelectorFocus,
|
|
392
394
|
onBlur: this.timeSelectorBlur,
|
|
393
395
|
onKeydown: this.handleKeyDown
|
|
@@ -4,6 +4,7 @@ declare type DefaultData<V> = object | ((this: V) => {});
|
|
|
4
4
|
declare type DefaultMethods<V> = {
|
|
5
5
|
[key: string]: (this: V, ...args: any[]) => any;
|
|
6
6
|
};
|
|
7
|
+
import { TimePickerIncrementalSteps } from '../timepicker/models';
|
|
7
8
|
import { DateFormatOptions } from '@progress/kendo-vue-intl';
|
|
8
9
|
import { CalendarChangeEvent } from '../main';
|
|
9
10
|
/**
|
|
@@ -36,6 +37,7 @@ export interface DateTimeSelectorProps {
|
|
|
36
37
|
minTime?: Date;
|
|
37
38
|
maxTime?: Date;
|
|
38
39
|
weekNumber?: boolean;
|
|
40
|
+
steps?: TimePickerIncrementalSteps;
|
|
39
41
|
focusedDate?: Date;
|
|
40
42
|
format?: string | DateFormatOptions;
|
|
41
43
|
calendar?: any;
|
|
@@ -51,6 +51,12 @@ var DateTimeSelector = {
|
|
|
51
51
|
type: Boolean,
|
|
52
52
|
default: false
|
|
53
53
|
},
|
|
54
|
+
steps: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: function _default() {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
},
|
|
54
60
|
focusedDate: Date,
|
|
55
61
|
format: String,
|
|
56
62
|
calendar: Object
|
|
@@ -126,7 +132,8 @@ var DateTimeSelector = {
|
|
|
126
132
|
max = _a.max,
|
|
127
133
|
weekNumber = _a.weekNumber,
|
|
128
134
|
focusedDate = _a.focusedDate,
|
|
129
|
-
format = _a.format
|
|
135
|
+
format = _a.format,
|
|
136
|
+
steps = _a.steps;
|
|
130
137
|
var rootClassName = classNames({
|
|
131
138
|
'k-date-tab': this.currentTab === 'date',
|
|
132
139
|
'k-time-tab': this.currentTab === 'time',
|
|
@@ -269,13 +276,15 @@ var DateTimeSelector = {
|
|
|
269
276
|
min: this.computedMinTime || MIN_TIME,
|
|
270
277
|
max: this.computedMaxTime || MAX_TIME,
|
|
271
278
|
value: this.timeValue,
|
|
272
|
-
format: format
|
|
279
|
+
format: format,
|
|
280
|
+
steps: steps
|
|
273
281
|
},
|
|
274
282
|
ref: 'timePart',
|
|
275
283
|
min: this.computedMinTime || MIN_TIME,
|
|
276
284
|
max: this.computedMaxTime || MAX_TIME,
|
|
277
285
|
value: this.timeValue,
|
|
278
286
|
format: format,
|
|
287
|
+
steps: steps,
|
|
279
288
|
onChange: this.handleTimeListContainerChange,
|
|
280
289
|
onMount: this.handleTimePartMount,
|
|
281
290
|
onFocus: this.handleFocus,
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-dateinputs',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1638528278,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -132,7 +132,7 @@ var Calendar = {
|
|
|
132
132
|
created: function created() {
|
|
133
133
|
kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
|
|
134
134
|
var value = utils_2.calculateValue(this.currentMin, this.currentMax, this.$props.defaultValue, this.$props.value || this.$props.modelValue);
|
|
135
|
-
var selectedDate =
|
|
135
|
+
var selectedDate = utils_2.extractDateFromValue(this.currentMin, this.currentMax, value);
|
|
136
136
|
var selectedMultiple = utils_2.extractMultipleFromValue(this.currentMin, this.currentMax, value);
|
|
137
137
|
var selectedRange = utils_2.extractRangeFromValue(value);
|
|
138
138
|
var calculatedFocus = utils_2.extractFocusedDate(selectedDate, selectedMultiple, selectedRange);
|
|
@@ -196,6 +196,9 @@ var Calendar = {
|
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
198
|
methods: {
|
|
199
|
+
element: function element() {
|
|
200
|
+
return this.$el;
|
|
201
|
+
},
|
|
199
202
|
computedValue: function computedValue() {
|
|
200
203
|
return this.$data.valueDuringOnChange !== undefined ? this.$data.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.$data.currentValue;
|
|
201
204
|
},
|
|
@@ -448,7 +451,6 @@ var Calendar = {
|
|
|
448
451
|
var didValueChange = currentValue !== null && this._oldValue !== null ? !this.isValueEqual(currentValue, this._oldValue) : currentValue !== this._oldValue;
|
|
449
452
|
this._selectedDate = utils_2.extractDateFromValue(this.currentMin, this.currentMax, currentValue);
|
|
450
453
|
this._selectedMultiple = utils_2.extractMultipleFromValue(this.currentMin, this.currentMax, currentValue);
|
|
451
|
-
this._selectedRange = utils_2.extractRangeFromValue(currentValue);
|
|
452
454
|
var cell = kendo_vue_common_1.templateRendering.call(this, this.$props.cell, kendo_vue_common_1.getListeners.call(this));
|
|
453
455
|
var weekCell = kendo_vue_common_1.templateRendering.call(this, this.$props.weekCell, kendo_vue_common_1.getListeners.call(this));
|
|
454
456
|
var headerTitle = kendo_vue_common_1.templateRendering.call(this, this.$props.headerTitle, kendo_vue_common_1.getListeners.call(this));
|
|
@@ -68,6 +68,7 @@ export interface DateRangePickerState {
|
|
|
68
68
|
_popupId: string;
|
|
69
69
|
_startInputId: string;
|
|
70
70
|
_endInputId: string;
|
|
71
|
+
_calendarId: string;
|
|
71
72
|
shouldFocusDateInput: boolean;
|
|
72
73
|
shouldFocusCalendar: boolean;
|
|
73
74
|
initialAnimation: boolean;
|
|
@@ -85,6 +86,8 @@ export interface DateRangePickerComputed {
|
|
|
85
86
|
*/
|
|
86
87
|
export interface DateRangePickerMethods {
|
|
87
88
|
[key: string]: any;
|
|
89
|
+
getStartInput: () => any;
|
|
90
|
+
getEndInput: () => any;
|
|
88
91
|
}
|
|
89
92
|
/**
|
|
90
93
|
* @hidden
|