@progress/kendo-vue-dateinputs 2.6.4 → 2.6.5-dev.202112061452
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 +7 -2
- package/dist/es/daterangepicker/DateRangePicker.js +148 -150
- package/dist/es/daterangepicker/models/DateRangePickerSettings.d.ts +0 -4
- 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 +7 -2
- package/dist/npm/daterangepicker/DateRangePicker.js +146 -148
- package/dist/npm/daterangepicker/models/DateRangePickerSettings.d.ts +0 -4
- 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));
|
|
@@ -10,16 +10,17 @@ import { DateRangePickerSettings } from './models';
|
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
12
|
export interface ReverseClickEvent {
|
|
13
|
-
|
|
13
|
+
event?: any;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* The arguments for the `onChange` event of the DateRangePicker.
|
|
17
17
|
*/
|
|
18
18
|
export interface DateRangePickerChangeEvent {
|
|
19
|
-
|
|
19
|
+
event?: any;
|
|
20
20
|
value: SelectionRange;
|
|
21
21
|
show?: boolean;
|
|
22
22
|
target: any;
|
|
23
|
+
component?: any;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Represents the props of the [Kendo UI for Vue DateRangePicker component]({% slug overview_daterangepicker %}).
|
|
@@ -68,6 +69,7 @@ export interface DateRangePickerState {
|
|
|
68
69
|
_popupId: string;
|
|
69
70
|
_startInputId: string;
|
|
70
71
|
_endInputId: string;
|
|
72
|
+
_calendarId: string;
|
|
71
73
|
shouldFocusDateInput: boolean;
|
|
72
74
|
shouldFocusCalendar: boolean;
|
|
73
75
|
initialAnimation: boolean;
|
|
@@ -77,6 +79,7 @@ export interface DateRangePickerState {
|
|
|
77
79
|
*/
|
|
78
80
|
export interface DateRangePickerComputed {
|
|
79
81
|
[key: string]: any;
|
|
82
|
+
rootClassName: object;
|
|
80
83
|
computedValue: SelectionRange;
|
|
81
84
|
computedShow: boolean;
|
|
82
85
|
}
|
|
@@ -85,6 +88,8 @@ export interface DateRangePickerComputed {
|
|
|
85
88
|
*/
|
|
86
89
|
export interface DateRangePickerMethods {
|
|
87
90
|
[key: string]: any;
|
|
91
|
+
getStartInput: () => any;
|
|
92
|
+
getEndInput: () => any;
|
|
88
93
|
}
|
|
89
94
|
/**
|
|
90
95
|
* @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;
|
|
@@ -6,7 +22,7 @@ var ref = allVue.ref;
|
|
|
6
22
|
var inject = allVue.inject;
|
|
7
23
|
import { Popup } from '@progress/kendo-vue-popup';
|
|
8
24
|
import { cloneDate } from '@progress/kendo-date-math';
|
|
9
|
-
import { guid,
|
|
25
|
+
import { guid, Keys, canUseDOM } from '@progress/kendo-vue-common';
|
|
10
26
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
11
27
|
import { validatePackage, templateRendering, getListeners, getTemplate } from '@progress/kendo-vue-common';
|
|
12
28
|
import { packageMetadata } from '../package-metadata';
|
|
@@ -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();
|
|
@@ -172,6 +169,12 @@ var DateRangePicker = {
|
|
|
172
169
|
};
|
|
173
170
|
},
|
|
174
171
|
computed: {
|
|
172
|
+
rootClassName: function rootClassName() {
|
|
173
|
+
return {
|
|
174
|
+
'k-daterangepicker': true,
|
|
175
|
+
'k-state-disabled': this.$props.disabled
|
|
176
|
+
};
|
|
177
|
+
},
|
|
175
178
|
computedValue: function computedValue() {
|
|
176
179
|
var value = this.valueDuringOnChange !== undefined ? this.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.currentValue;
|
|
177
180
|
return value || EMPTY_SELECTIONRANGE;
|
|
@@ -199,33 +202,14 @@ var DateRangePicker = {
|
|
|
199
202
|
var value = this.computedValue || EMPTY_SELECTIONRANGE;
|
|
200
203
|
var startDateInputId = (this.$props.startDateInputSettings || {}).id || this._startInputId;
|
|
201
204
|
var endDateInputId = (this.$props.endDateInputSettings || {}).id || this._endInputId;
|
|
202
|
-
var rootClassName = classNames('k-daterangepicker', {
|
|
203
|
-
'k-state-disabled': this.$props.disabled
|
|
204
|
-
}, this.$props.className);
|
|
205
205
|
var localizationService = provideLocalizationService(this);
|
|
206
206
|
var startMessage = localizationService.toLanguageString(start, messages[start]);
|
|
207
207
|
var endMessage = localizationService.toLanguageString(end, messages[end]);
|
|
208
208
|
var separatorMessage = localizationService.toLanguageString(separator, messages[separator]);
|
|
209
209
|
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',
|
|
210
|
+
|
|
211
|
+
var startSettings = __assign({
|
|
215
212
|
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
213
|
format: this.$props.format,
|
|
230
214
|
min: this.min,
|
|
231
215
|
max: this.max,
|
|
@@ -234,12 +218,20 @@ var DateRangePicker = {
|
|
|
234
218
|
valid: this.$props.valid,
|
|
235
219
|
ariaHasPopup: true,
|
|
236
220
|
ariaExpanded: this.computedShow,
|
|
237
|
-
value: value.start
|
|
238
|
-
|
|
221
|
+
value: value.start
|
|
222
|
+
}, this.$props.startDateInputSettings);
|
|
223
|
+
|
|
224
|
+
var startDateInputDefaultRendering = h(DateInput, __assign(__assign({
|
|
225
|
+
ref: this.v3 ? function (el) {
|
|
226
|
+
_this.startDateInputRef = el;
|
|
227
|
+
} : 'startDateInput',
|
|
228
|
+
attrs: this.v3 ? undefined : startSettings
|
|
229
|
+
}, startSettings), {
|
|
230
|
+
onChange: this.handleEndChange,
|
|
239
231
|
on: this.v3 ? undefined : {
|
|
240
|
-
|
|
232
|
+
'change': this.handleEndChange
|
|
241
233
|
}
|
|
242
|
-
});
|
|
234
|
+
}));
|
|
243
235
|
var startDateInputRendering = getTemplate.call(this, {
|
|
244
236
|
h: h,
|
|
245
237
|
template: startDateInputRender,
|
|
@@ -249,25 +241,9 @@ var DateRangePicker = {
|
|
|
249
241
|
}
|
|
250
242
|
});
|
|
251
243
|
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',
|
|
244
|
+
|
|
245
|
+
var endSettings = __assign({
|
|
257
246
|
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
247
|
format: this.$props.format,
|
|
272
248
|
min: this.min,
|
|
273
249
|
max: this.max,
|
|
@@ -276,12 +252,20 @@ var DateRangePicker = {
|
|
|
276
252
|
valid: this.$props.valid,
|
|
277
253
|
ariaHasPopup: true,
|
|
278
254
|
ariaExpanded: this.computedShow,
|
|
279
|
-
value: value.end
|
|
255
|
+
value: value.end
|
|
256
|
+
}, this.$props.endDateInputSettings);
|
|
257
|
+
|
|
258
|
+
var endDateInputDefaultRendering = h(DateInput, __assign(__assign({
|
|
259
|
+
ref: this.v3 ? function (el) {
|
|
260
|
+
_this.endDateInputRef = el;
|
|
261
|
+
} : 'endDateInput',
|
|
262
|
+
attrs: this.v3 ? undefined : endSettings
|
|
263
|
+
}, endSettings), {
|
|
280
264
|
onChange: this.handleEndChange,
|
|
281
265
|
on: this.v3 ? undefined : {
|
|
282
|
-
|
|
266
|
+
'change': this.handleEndChange
|
|
283
267
|
}
|
|
284
|
-
});
|
|
268
|
+
}));
|
|
285
269
|
var endDateInputRendering = getTemplate.call(this, {
|
|
286
270
|
h: h,
|
|
287
271
|
template: endDateInputRender,
|
|
@@ -291,72 +275,53 @@ var DateRangePicker = {
|
|
|
291
275
|
}
|
|
292
276
|
});
|
|
293
277
|
var calendarRender = this.$props.calendar ? templateRendering.call(this, this.$props.calendar, getListeners.call(this)) : undefined;
|
|
294
|
-
|
|
295
|
-
|
|
278
|
+
|
|
279
|
+
var calendarSettings = __assign({
|
|
280
|
+
id: this._calendarId,
|
|
281
|
+
min: this.min,
|
|
282
|
+
max: this.max,
|
|
283
|
+
views: 2,
|
|
284
|
+
allowReverse: this.$props.allowReverse,
|
|
285
|
+
mode: 'range',
|
|
286
|
+
focusedDate: this.$props.focusedDate,
|
|
287
|
+
disabled: this.$props.disabled,
|
|
288
|
+
value: value
|
|
289
|
+
}, this.$props.calendarSettings);
|
|
290
|
+
|
|
291
|
+
var calendarDefaultRendering = h(Calendar, __assign({
|
|
296
292
|
ref: this.v3 ? function (el) {
|
|
297
293
|
_this.calendarRef = el;
|
|
298
294
|
} : 'calendar',
|
|
295
|
+
attrs: this.v3 ? undefined : calendarSettings,
|
|
299
296
|
onKeydown: this.handleKeyDown,
|
|
300
297
|
on: this.v3 ? undefined : {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
298
|
+
'keydown': this.handleKeyDown,
|
|
299
|
+
'focus': this.calendarFocus,
|
|
300
|
+
'blur': this.calendarBlur,
|
|
301
|
+
'change': this.handleCalendarChange
|
|
305
302
|
},
|
|
306
303
|
onFocus: this.calendarFocus,
|
|
307
304
|
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
305
|
onChange: this.handleCalendarChange
|
|
328
|
-
});
|
|
306
|
+
}, calendarSettings));
|
|
329
307
|
var calendarRendering = getTemplate.call(this, {
|
|
330
308
|
h: h,
|
|
331
309
|
template: calendarRender,
|
|
332
310
|
defaultRendering: calendarDefaultRendering,
|
|
333
311
|
additionalListeners: {
|
|
334
|
-
change: this.handleCalendarChange
|
|
312
|
+
change: this.handleCalendarChange,
|
|
313
|
+
keydown: this.handleKeyDown,
|
|
314
|
+
focus: this.calendarFocus,
|
|
315
|
+
blur: this.calendarBlur
|
|
335
316
|
}
|
|
336
317
|
});
|
|
337
318
|
var _a = this.$props.popupSettings,
|
|
338
319
|
popupClass = _a.popupClass,
|
|
339
|
-
animate = _a.animate
|
|
340
|
-
appendTo = _a.appendTo;
|
|
320
|
+
animate = _a.animate;
|
|
341
321
|
var popupRender = this.$props.popup ? templateRendering.call(this, this.$props.popup, getListeners.call(this)) : undefined;
|
|
342
|
-
|
|
343
|
-
|
|
322
|
+
|
|
323
|
+
var popupSettings = __assign({
|
|
344
324
|
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
325
|
anchor: this._anchor,
|
|
361
326
|
id: this._popupId,
|
|
362
327
|
anchorAlign: {
|
|
@@ -367,10 +332,13 @@ var DateRangePicker = {
|
|
|
367
332
|
horizontal: 'left',
|
|
368
333
|
vertical: 'top'
|
|
369
334
|
},
|
|
370
|
-
animate: this.initialAnimation ? false : animate
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
335
|
+
animate: this.initialAnimation ? false : animate
|
|
336
|
+
}, this.$props.popupSettings);
|
|
337
|
+
|
|
338
|
+
var popupDefaultRendering = h(Popup, __assign({
|
|
339
|
+
attrs: this.v3 ? undefined : popupSettings,
|
|
340
|
+
'class': popupClass
|
|
341
|
+
}, popupSettings), this.v3 ? function () {
|
|
374
342
|
return [calendarRendering];
|
|
375
343
|
} : [calendarRendering]);
|
|
376
344
|
var popupRendering = getTemplate.call(this, {
|
|
@@ -404,7 +372,7 @@ var DateRangePicker = {
|
|
|
404
372
|
"class": "k-icon k-i-arrows-swap"
|
|
405
373
|
})]);
|
|
406
374
|
return h("span", {
|
|
407
|
-
"class": rootClassName,
|
|
375
|
+
"class": this.rootClassName,
|
|
408
376
|
style: this.$props.style,
|
|
409
377
|
id: this.$props.id,
|
|
410
378
|
attrs: this.v3 ? undefined : {
|
|
@@ -434,30 +402,35 @@ var DateRangePicker = {
|
|
|
434
402
|
},
|
|
435
403
|
methods: {
|
|
436
404
|
focus: function focus() {
|
|
437
|
-
|
|
438
|
-
|
|
405
|
+
var startInput = this.getStartInput();
|
|
406
|
+
|
|
407
|
+
if (startInput) {
|
|
408
|
+
startInput.focus();
|
|
439
409
|
}
|
|
440
410
|
},
|
|
441
411
|
focusCalendarElement: function focusCalendarElement() {
|
|
442
|
-
var
|
|
412
|
+
var calendar = this.getCalendar();
|
|
443
413
|
|
|
444
|
-
if (
|
|
445
|
-
|
|
414
|
+
if (calendar) {
|
|
415
|
+
calendar.focus({
|
|
446
416
|
preventScroll: true
|
|
447
417
|
});
|
|
448
418
|
}
|
|
449
419
|
},
|
|
450
420
|
focusDateInputElement: function focusDateInputElement() {
|
|
451
|
-
|
|
421
|
+
var startInput = this.getStartInput();
|
|
422
|
+
var endInput = this.getEndInput();
|
|
423
|
+
|
|
424
|
+
if (!document || !startInput || !endInput) {
|
|
452
425
|
return;
|
|
453
426
|
}
|
|
454
427
|
|
|
455
|
-
if ((this.computedValue.start === null || this.computedValue.end !== null) && document.activeElement !==
|
|
456
|
-
|
|
428
|
+
if ((this.computedValue.start === null || this.computedValue.end !== null) && document.activeElement !== endInput) {
|
|
429
|
+
startInput.focus({
|
|
457
430
|
preventScroll: true
|
|
458
431
|
});
|
|
459
|
-
} else if (document.activeElement !==
|
|
460
|
-
|
|
432
|
+
} else if (document.activeElement !== startInput) {
|
|
433
|
+
endInput.focus({
|
|
461
434
|
preventScroll: true
|
|
462
435
|
});
|
|
463
436
|
}
|
|
@@ -484,7 +457,7 @@ var DateRangePicker = {
|
|
|
484
457
|
end: this.computedValue.start
|
|
485
458
|
};
|
|
486
459
|
var args = {
|
|
487
|
-
|
|
460
|
+
event: event.event
|
|
488
461
|
};
|
|
489
462
|
this.handleChange(value, args);
|
|
490
463
|
},
|
|
@@ -492,16 +465,19 @@ var DateRangePicker = {
|
|
|
492
465
|
event.preventDefault();
|
|
493
466
|
},
|
|
494
467
|
handleFocus: function handleFocus(event) {
|
|
468
|
+
var startInput = this.getStartInput();
|
|
469
|
+
var endInput = this.getEndInput();
|
|
470
|
+
|
|
495
471
|
if (!this.shouldFocusDateInput) {
|
|
496
472
|
this.setShow(true);
|
|
497
473
|
}
|
|
498
474
|
|
|
499
|
-
if (
|
|
500
|
-
|
|
475
|
+
if (startInput) {
|
|
476
|
+
startInput.classList.add('k-state-focused');
|
|
501
477
|
}
|
|
502
478
|
|
|
503
|
-
if (
|
|
504
|
-
|
|
479
|
+
if (endInput) {
|
|
480
|
+
endInput.classList.add('k-state-focused');
|
|
505
481
|
}
|
|
506
482
|
|
|
507
483
|
this.$emit('focus', event);
|
|
@@ -519,19 +495,32 @@ var DateRangePicker = {
|
|
|
519
495
|
var _this = this;
|
|
520
496
|
|
|
521
497
|
this._blurTimeout = setTimeout(function () {
|
|
522
|
-
|
|
523
|
-
|
|
498
|
+
var startInput = _this.getStartInput();
|
|
499
|
+
|
|
500
|
+
var endInput = _this.getEndInput();
|
|
501
|
+
|
|
502
|
+
if (startInput) {
|
|
503
|
+
startInput.classList.remove('k-state-focused');
|
|
524
504
|
}
|
|
525
505
|
|
|
526
|
-
if (
|
|
527
|
-
|
|
506
|
+
if (endInput) {
|
|
507
|
+
endInput.classList.remove('k-state-focused');
|
|
528
508
|
}
|
|
529
509
|
|
|
530
|
-
if (
|
|
510
|
+
if (startInput && endInput && canUseDOM && startInput && document.activeElement !== endInput) {
|
|
531
511
|
_this.setShow(false);
|
|
532
512
|
}
|
|
533
513
|
}, 200);
|
|
534
514
|
},
|
|
515
|
+
getStartInput: function getStartInput() {
|
|
516
|
+
return this._startDateInput && this._startDateInput.element ? this._startDateInput.element() : document.getElementById(this._startInputId);
|
|
517
|
+
},
|
|
518
|
+
getEndInput: function getEndInput() {
|
|
519
|
+
return this._endDateInput && this._endDateInput.element ? this._endDateInput.element() : document.getElementById(this._endInputId);
|
|
520
|
+
},
|
|
521
|
+
getCalendar: function getCalendar() {
|
|
522
|
+
return this._calendar && this._calendar.element ? this._calendar : document.getElementById(this._calendarId);
|
|
523
|
+
},
|
|
535
524
|
handleBlur: function handleBlur(event) {
|
|
536
525
|
this.createBlurTimeout();
|
|
537
526
|
this.$emit('blur', event);
|
|
@@ -568,6 +557,8 @@ var DateRangePicker = {
|
|
|
568
557
|
handleKeyDown: function handleKeyDown(event) {
|
|
569
558
|
var keyCode = event.keyCode,
|
|
570
559
|
altKey = event.altKey;
|
|
560
|
+
var endInput = this.getEndInput();
|
|
561
|
+
var calendar = this.getCalendar();
|
|
571
562
|
|
|
572
563
|
if (keyCode === Keys.esc) {
|
|
573
564
|
event.preventDefault();
|
|
@@ -577,10 +568,12 @@ var DateRangePicker = {
|
|
|
577
568
|
event.preventDefault();
|
|
578
569
|
this.shouldFocusCalendar = true;
|
|
579
570
|
this.setShow(true);
|
|
580
|
-
} else if (keyCode === Keys.tab && this.computedShow &&
|
|
571
|
+
} else if (keyCode === Keys.tab && this.computedShow && calendar && endInput && document && document.activeElement === endInput) {
|
|
581
572
|
event.preventDefault();
|
|
582
573
|
this.focusCalendarElement();
|
|
583
574
|
}
|
|
575
|
+
|
|
576
|
+
this.$emit('keydown', event);
|
|
584
577
|
},
|
|
585
578
|
handleChange: function handleChange(value, event) {
|
|
586
579
|
this.currentValue = value;
|
|
@@ -589,7 +582,12 @@ var DateRangePicker = {
|
|
|
589
582
|
event: event.event,
|
|
590
583
|
value: this.computedValue,
|
|
591
584
|
show: this.computedShow,
|
|
592
|
-
|
|
585
|
+
component: this,
|
|
586
|
+
target: {
|
|
587
|
+
name: this.$props.name,
|
|
588
|
+
value: this.computedValue,
|
|
589
|
+
show: this.computedShow
|
|
590
|
+
}
|
|
593
591
|
};
|
|
594
592
|
this.$emit('change', args);
|
|
595
593
|
this.valueDuringOnChange = undefined;
|
|
@@ -35,10 +35,6 @@ export interface DateRangePickerSettings {
|
|
|
35
35
|
* Represents the additional props that can be passed to the [MultiViewCalendar]({% slug overview_multiviewcalendar %}) inside the DateRangePicker ([see example]({% slug child_settings_daterangepicker %}#toc-configuring-the-multiviewcalendar)).
|
|
36
36
|
*/
|
|
37
37
|
calendarSettings?: DateRangePickerCalendarSettings;
|
|
38
|
-
/**
|
|
39
|
-
* Sets the `className` of the DateRangePicker.
|
|
40
|
-
*/
|
|
41
|
-
className?: string;
|
|
42
38
|
/**
|
|
43
39
|
* Sets the default state of the DateRangePicker upon render ([see example]({% slug default_value_daterangepicker %})).
|
|
44
40
|
*/
|
|
@@ -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: 1638801929,
|
|
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
|
};
|