@progress/kendo-vue-dateinputs 3.6.4 → 3.6.5-dev.202210181442
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 +17 -48
- package/dist/es/calendar/components/CalendarCell.js +16 -25
- package/dist/es/calendar/components/CalendarHeaderTitle.js +2 -4
- package/dist/es/calendar/components/CalendarWeekCell.js +0 -3
- package/dist/es/calendar/components/Header.js +6 -17
- package/dist/es/calendar/components/View.js +8 -19
- package/dist/es/calendar/components/ViewList.js +11 -14
- package/dist/es/common/PickerWrap.js +0 -2
- package/dist/es/dateinput/DateInput.js +33 -78
- package/dist/es/datepicker/DatePicker.js +32 -42
- package/dist/es/datepicker/ToggleButton.js +0 -2
- package/dist/es/datepicker/models/DatePickerSettings.js +2 -1
- package/dist/es/daterangepicker/DateRangePicker.js +10 -43
- package/dist/es/datetimepicker/DateTimePicker.js +39 -53
- package/dist/es/datetimepicker/DateTimeSelector.js +25 -36
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.js +16 -46
- package/dist/es/timepicker/TimePart.js +7 -23
- package/dist/es/timepicker/TimePicker.js +37 -53
- package/dist/es/timepicker/TimeSelector.js +16 -23
- package/dist/es/virtualization/Virtualization.js +4 -36
- package/dist/esm/calendar/components/Calendar.js +17 -48
- package/dist/esm/calendar/components/CalendarCell.js +16 -25
- package/dist/esm/calendar/components/CalendarHeaderTitle.js +2 -4
- package/dist/esm/calendar/components/CalendarWeekCell.js +0 -3
- package/dist/esm/calendar/components/Header.js +6 -17
- package/dist/esm/calendar/components/View.js +8 -19
- package/dist/esm/calendar/components/ViewList.js +11 -14
- package/dist/esm/common/PickerWrap.js +0 -2
- package/dist/esm/dateinput/DateInput.js +33 -78
- package/dist/esm/datepicker/DatePicker.js +32 -42
- package/dist/esm/datepicker/ToggleButton.js +0 -2
- package/dist/esm/datepicker/models/DatePickerSettings.js +2 -1
- package/dist/esm/daterangepicker/DateRangePicker.js +10 -43
- package/dist/esm/datetimepicker/DateTimePicker.js +39 -53
- package/dist/esm/datetimepicker/DateTimeSelector.js +25 -36
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/timepicker/TimeList.js +16 -46
- package/dist/esm/timepicker/TimePart.js +7 -23
- package/dist/esm/timepicker/TimePicker.js +37 -53
- package/dist/esm/timepicker/TimeSelector.js +16 -23
- package/dist/esm/virtualization/Virtualization.js +4 -36
- package/dist/npm/calendar/components/Calendar.js +17 -62
- package/dist/npm/calendar/components/CalendarCell.js +18 -30
- package/dist/npm/calendar/components/CalendarHeaderTitle.js +4 -10
- package/dist/npm/calendar/components/CalendarWeekCell.js +2 -8
- package/dist/npm/calendar/components/Header.js +8 -30
- package/dist/npm/calendar/components/View.js +10 -31
- package/dist/npm/calendar/components/ViewList.js +13 -25
- package/dist/npm/common/PickerWrap.js +2 -7
- package/dist/npm/dateinput/DateInput.js +35 -94
- package/dist/npm/datepicker/DatePicker.js +34 -58
- package/dist/npm/datepicker/ToggleButton.js +0 -4
- package/dist/npm/datepicker/models/DatePickerSettings.js +2 -1
- package/dist/npm/daterangepicker/DateRangePicker.js +10 -56
- package/dist/npm/datetimepicker/DateTimePicker.js +41 -71
- package/dist/npm/datetimepicker/DateTimeSelector.js +27 -50
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimeList.js +16 -55
- package/dist/npm/timepicker/TimePart.js +9 -36
- package/dist/npm/timepicker/TimePicker.js +37 -67
- package/dist/npm/timepicker/TimeSelector.js +18 -35
- package/dist/npm/virtualization/Virtualization.js +4 -40
- package/package.json +7 -7
|
@@ -18,7 +18,6 @@ import { calculateValue, extractDateFromValue, extractMultipleFromValue, extract
|
|
|
18
18
|
/**
|
|
19
19
|
* @hidden
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
21
|
var CalendarVue2 = {
|
|
23
22
|
name: 'KendoCalendar',
|
|
24
23
|
inject: {
|
|
@@ -159,7 +158,6 @@ var CalendarVue2 = {
|
|
|
159
158
|
this._lastView = this.$props.activeView || this.$data.currentActiveView;
|
|
160
159
|
this._lastViewsCount = this.$props.views;
|
|
161
160
|
this._oldValue = this.computedValue();
|
|
162
|
-
|
|
163
161
|
if (!this.calendarViewList) {
|
|
164
162
|
this.calendarViewList = this.v3 ? this.calendarViewListRef : this.$refs.calendarViewList;
|
|
165
163
|
}
|
|
@@ -184,9 +182,9 @@ var CalendarVue2 = {
|
|
|
184
182
|
computedValue: function computedValue() {
|
|
185
183
|
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;
|
|
186
184
|
},
|
|
187
|
-
focus: function focus(
|
|
185
|
+
focus: function focus() {
|
|
188
186
|
if (this.calendarViewList) {
|
|
189
|
-
this.calendarViewList.$el.firstElementChild.focus(
|
|
187
|
+
this.calendarViewList.$el.firstElementChild.focus();
|
|
190
188
|
}
|
|
191
189
|
},
|
|
192
190
|
handleBlur: function handleBlur() {
|
|
@@ -205,7 +203,6 @@ var CalendarVue2 = {
|
|
|
205
203
|
if (this.$props.disabled) {
|
|
206
204
|
return;
|
|
207
205
|
}
|
|
208
|
-
|
|
209
206
|
this.$data.didNavigationChange = true;
|
|
210
207
|
var focusedDate = cloneDate(event.value);
|
|
211
208
|
this.$data.currentFocusedDate = focusedDate;
|
|
@@ -219,11 +216,9 @@ var CalendarVue2 = {
|
|
|
219
216
|
handlePrevClick: function handlePrevClick(event) {
|
|
220
217
|
var focusedDate = cloneDate(event.value);
|
|
221
218
|
this.focus();
|
|
222
|
-
|
|
223
219
|
if (this.$props.disabled) {
|
|
224
220
|
return;
|
|
225
221
|
}
|
|
226
|
-
|
|
227
222
|
this.$data.currentFocusedDate = focusedDate;
|
|
228
223
|
},
|
|
229
224
|
handleTitleClick: function handleTitleClick() {
|
|
@@ -232,11 +227,9 @@ var CalendarVue2 = {
|
|
|
232
227
|
handleNextClick: function handleNextClick(event) {
|
|
233
228
|
var focusedDate = cloneDate(event.value);
|
|
234
229
|
this.focus();
|
|
235
|
-
|
|
236
230
|
if (this.$props.disabled) {
|
|
237
231
|
return;
|
|
238
232
|
}
|
|
239
|
-
|
|
240
233
|
this.$data.currentFocusedDate = focusedDate;
|
|
241
234
|
},
|
|
242
235
|
handleCellEnter: function handleCellEnter(value) {
|
|
@@ -246,16 +239,14 @@ var CalendarVue2 = {
|
|
|
246
239
|
},
|
|
247
240
|
generateRange: function generateRange(candidate, value) {
|
|
248
241
|
var end = value.end,
|
|
249
|
-
|
|
242
|
+
start = value.start;
|
|
250
243
|
var shouldSwap = value.start !== null && candidate.getTime() <= value.start.getTime();
|
|
251
|
-
|
|
252
244
|
if (!this.$props.allowReverse && shouldSwap) {
|
|
253
245
|
return {
|
|
254
246
|
start: candidate,
|
|
255
247
|
end: this._selectedRange.start
|
|
256
248
|
};
|
|
257
249
|
}
|
|
258
|
-
|
|
259
250
|
return this.activeRange !== 'end' ? {
|
|
260
251
|
start: candidate,
|
|
261
252
|
end: end
|
|
@@ -278,35 +269,27 @@ var CalendarVue2 = {
|
|
|
278
269
|
},
|
|
279
270
|
handleDateChange: function handleDateChange(event) {
|
|
280
271
|
var focusedDate = cloneDate(event.value);
|
|
281
|
-
|
|
282
272
|
var canNavigateDown = this._bus.canMoveDown(this.$data.currentActiveView);
|
|
283
|
-
|
|
284
273
|
if (this.$props.disabled) {
|
|
285
274
|
return;
|
|
286
275
|
}
|
|
287
|
-
|
|
288
276
|
if (canNavigateDown) {
|
|
289
277
|
if (event.isTodayClick) {
|
|
290
278
|
this._bus.moveToBottom(this.$data.currentActiveView);
|
|
291
279
|
} else {
|
|
292
280
|
this._bus.moveDown(this.$data.currentActiveView, event.event);
|
|
293
|
-
|
|
294
281
|
this.$data.currentFocusedDate = focusedDate;
|
|
295
282
|
return;
|
|
296
283
|
}
|
|
297
284
|
}
|
|
298
|
-
|
|
299
285
|
var value;
|
|
300
|
-
|
|
301
286
|
switch (this.$props.mode) {
|
|
302
287
|
case 'single':
|
|
303
288
|
value = cloneDate(event.value);
|
|
304
289
|
break;
|
|
305
|
-
|
|
306
290
|
case 'multiple':
|
|
307
291
|
if (Array.isArray(this._selectedMultiple)) {
|
|
308
292
|
var result = this._selectedMultiple.slice();
|
|
309
|
-
|
|
310
293
|
var index_1 = -1;
|
|
311
294
|
result.forEach(function (date, idx) {
|
|
312
295
|
if (isEqualDate(date, event.value)) {
|
|
@@ -322,20 +305,16 @@ var CalendarVue2 = {
|
|
|
322
305
|
value = [cloneDate(event.value)];
|
|
323
306
|
}
|
|
324
307
|
}
|
|
325
|
-
|
|
326
308
|
break;
|
|
327
|
-
|
|
328
309
|
case 'range':
|
|
329
310
|
var hasSelection = this._selectedRange.start !== null && this._selectedRange.end !== null && this.activeRange === 'start';
|
|
330
311
|
value = hasSelection ? this.clampRange(event.value) : this.generateRange(event.value, this._selectedRange);
|
|
331
312
|
this.$data.currentActiveRangeEnd = this.activeRange !== 'end' ? 'end' : 'start';
|
|
332
313
|
break;
|
|
333
|
-
|
|
334
314
|
default:
|
|
335
315
|
value = cloneDate(event.value);
|
|
336
316
|
break;
|
|
337
317
|
}
|
|
338
|
-
|
|
339
318
|
this.$data.currentValue = value;
|
|
340
319
|
this.triggerChange(value, event);
|
|
341
320
|
},
|
|
@@ -358,17 +337,14 @@ var CalendarVue2 = {
|
|
|
358
337
|
},
|
|
359
338
|
handleMouseDown: function handleMouseDown(event) {
|
|
360
339
|
var focusedDate = cloneDate(event.value);
|
|
361
|
-
|
|
362
340
|
if (this.$props.disabled || this.$data.currentActiveView !== 0) {
|
|
363
341
|
return;
|
|
364
342
|
}
|
|
365
|
-
|
|
366
343
|
this.$data.currentFocusedDate = focusedDate;
|
|
367
344
|
},
|
|
368
345
|
tableKeyDown: function tableKeyDown(event) {
|
|
369
346
|
var keyCode = event.keyCode;
|
|
370
347
|
this.$emit('keydown', event);
|
|
371
|
-
|
|
372
348
|
if (keyCode === Keys.enter) {
|
|
373
349
|
var args = {
|
|
374
350
|
event: event,
|
|
@@ -383,36 +359,35 @@ var CalendarVue2 = {
|
|
|
383
359
|
this.handleDateChange(args);
|
|
384
360
|
} else {
|
|
385
361
|
var candidate = dateInRange(this._navigation.move(this._focusedDate, this._navigation.action(event), this.$data.currentActiveView, this._service, event), this.currentMin, this.currentMax);
|
|
386
|
-
|
|
387
362
|
if (isEqualDate(this._focusedDate, candidate)) {
|
|
388
363
|
return;
|
|
389
364
|
}
|
|
390
|
-
|
|
391
365
|
this._calculateFocusFromValue = false;
|
|
392
366
|
this.$data.currentFocusedDate = candidate;
|
|
393
367
|
}
|
|
394
|
-
|
|
395
368
|
event.preventDefault();
|
|
396
369
|
},
|
|
397
370
|
isValueEqual: function isValueEqual(newValue, oldValue) {
|
|
398
371
|
if (newValue instanceof Date && oldValue instanceof Date) {
|
|
399
|
-
return isEqualDate(newValue, oldValue);
|
|
372
|
+
return isEqualDate(newValue, oldValue);
|
|
373
|
+
// @ts-ignore
|
|
400
374
|
} else if (newValue instanceof Object && oldValue instanceof Object) {
|
|
401
|
-
if (newValue && oldValue &&
|
|
375
|
+
if (newValue && oldValue &&
|
|
376
|
+
// @ts-ignore
|
|
402
377
|
isEqualDate(newValue.start, oldValue.start) && isEqualDate(newValue.end, oldValue.end)) {
|
|
403
378
|
return true;
|
|
404
379
|
} else {
|
|
405
380
|
return false;
|
|
406
381
|
}
|
|
407
382
|
} else if (newValue instanceof Array && oldValue instanceof Array) {
|
|
408
|
-
if (newValue && oldValue &&
|
|
383
|
+
if (newValue && oldValue &&
|
|
384
|
+
// @ts-ignore
|
|
409
385
|
newValue.length === oldValue.length) {
|
|
410
386
|
return true;
|
|
411
387
|
} else {
|
|
412
388
|
return false;
|
|
413
389
|
}
|
|
414
390
|
}
|
|
415
|
-
|
|
416
391
|
return false;
|
|
417
392
|
},
|
|
418
393
|
rangeWithFocused: function rangeWithFocused(range, focusedDate) {
|
|
@@ -425,7 +400,6 @@ var CalendarVue2 = {
|
|
|
425
400
|
// @ts-ignore
|
|
426
401
|
render: function render(createElement) {
|
|
427
402
|
var _this = this;
|
|
428
|
-
|
|
429
403
|
var h = gh || createElement;
|
|
430
404
|
var views = this.$props.views;
|
|
431
405
|
var currentValue = this.computedValue();
|
|
@@ -442,37 +416,31 @@ var CalendarVue2 = {
|
|
|
442
416
|
this._selectedRange = extractRangeFromValue(currentValue);
|
|
443
417
|
var calculatedFocus = extractFocusedDate(this._selectedDate, this._selectedMultiple, this._selectedRange);
|
|
444
418
|
var currentDateInRange = dateInRange(didValueChange && calculatedFocus !== null ? calculatedFocus : currentFocusedDate, this.currentMin, this.currentMax);
|
|
445
|
-
|
|
446
419
|
if (currentDateInRange instanceof Date) {
|
|
447
420
|
this._focusedDate = getDate(currentDateInRange);
|
|
448
421
|
} else if (calculatedFocus) {
|
|
449
422
|
this._focusedDate = calculatedFocus;
|
|
450
423
|
}
|
|
451
|
-
|
|
452
424
|
var visualizedRange = this.rangeWithFocused(this._selectedRange, currentFocusedDate);
|
|
453
425
|
this._intl = provideIntlService(this);
|
|
454
|
-
|
|
455
426
|
this._bus.configure(CalendarViewEnum[this.$props.bottomView], CalendarViewEnum[this.$props.topView]);
|
|
456
|
-
|
|
457
427
|
this._service = this._bus.service(activeView, this._intl);
|
|
458
428
|
var rootClassNames = classNames('k-widget k-calendar', 'k-calendar-range', {
|
|
459
429
|
'k-disabled': this.$props.disabled,
|
|
460
430
|
'k-week-number': this.$props.weekNumber
|
|
461
431
|
}, this.$props.className);
|
|
462
432
|
var didViewChange = this._lastView !== this.$data.currentActiveView;
|
|
463
|
-
|
|
464
433
|
var isDateInList = this._dates && this._service.isInArray(this._focusedDate, this._dates);
|
|
465
|
-
|
|
466
434
|
var didViewsCountChange = this._lastViewsCount !== this.$props.views;
|
|
467
|
-
|
|
468
435
|
if (!isDateInList || didViewChange || didViewsCountChange) {
|
|
469
436
|
this._dates = this._service.datesList(this._focusedDate, views);
|
|
470
437
|
}
|
|
471
|
-
|
|
472
438
|
var activeDate = cloneDate(this._dates && this._dates[0] ? this._dates[0] : undefined);
|
|
473
|
-
var calendarBody = [this.$props.navigation &&
|
|
439
|
+
var calendarBody = [this.$props.navigation &&
|
|
440
|
+
// @ts-ignore function children
|
|
474
441
|
h(Header, {
|
|
475
|
-
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined
|
|
442
|
+
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined
|
|
443
|
+
// key={`.kendo.calendar.header.${this.$data.currentFocusedDate.getTime()}`}
|
|
476
444
|
,
|
|
477
445
|
attrs: this.v3 ? undefined : {
|
|
478
446
|
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined,
|
|
@@ -505,8 +473,10 @@ var CalendarVue2 = {
|
|
|
505
473
|
bus: this._bus,
|
|
506
474
|
service: this._service,
|
|
507
475
|
headerTitle: headerTitle
|
|
508
|
-
}),
|
|
509
|
-
|
|
476
|
+
}),
|
|
477
|
+
// @ts-ignore function children
|
|
478
|
+
h(ViewList
|
|
479
|
+
// key={`.kendo.calendar.viewlist.${this.$data.currentFocusedDate.getTime()}`}
|
|
510
480
|
, {
|
|
511
481
|
allowReverse: this.$props.allowReverse,
|
|
512
482
|
attrs: this.v3 ? undefined : {
|
|
@@ -590,6 +560,5 @@ var CalendarVue2 = {
|
|
|
590
560
|
/**
|
|
591
561
|
* @hidden
|
|
592
562
|
*/
|
|
593
|
-
|
|
594
563
|
var Calendar = CalendarVue2;
|
|
595
564
|
export { Calendar, CalendarVue2 };
|
|
@@ -7,30 +7,23 @@ import { getDefaultSlots } from '@progress/kendo-vue-common';
|
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
var compareProps = function compareProps(x, y) {
|
|
12
11
|
var xProps = Object.getOwnPropertyNames(x);
|
|
13
12
|
var yProps = Object.getOwnPropertyNames(y);
|
|
14
|
-
|
|
15
13
|
if (xProps.length !== yProps.length) {
|
|
16
14
|
return false;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
for (var i = 0; i < xProps.length; i++) {
|
|
20
17
|
var propName = xProps[i];
|
|
21
|
-
|
|
22
18
|
if (x[propName] !== y[propName]) {
|
|
23
19
|
return false;
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
return true;
|
|
28
23
|
};
|
|
29
24
|
/**
|
|
30
25
|
* @hidden
|
|
31
26
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
27
|
var CalendarCellVue2 = {
|
|
35
28
|
name: 'KendoCalendarCell',
|
|
36
29
|
// @ts-ignore
|
|
@@ -62,11 +55,11 @@ var CalendarCellVue2 = {
|
|
|
62
55
|
// due to date object being compared by instance
|
|
63
56
|
// and new Date object is created
|
|
64
57
|
// every time and fails the shallow compare of the Vue.
|
|
65
|
-
|
|
66
58
|
/**
|
|
67
59
|
* @hidden
|
|
68
60
|
*/
|
|
69
|
-
updated: function updated() {
|
|
61
|
+
updated: function updated() {
|
|
62
|
+
// const { value, ...props } = this.props;
|
|
70
63
|
// const { value: newValue, ...newProps } = nextProps;
|
|
71
64
|
// const valueEqual = !(value && newValue) || value.getTime() === newValue.getTime();
|
|
72
65
|
// return !(valueEqual && compareProps(props, newProps));
|
|
@@ -79,7 +72,6 @@ var CalendarCellVue2 = {
|
|
|
79
72
|
};
|
|
80
73
|
},
|
|
81
74
|
// tslint:disable:max-line-length
|
|
82
|
-
|
|
83
75
|
/**
|
|
84
76
|
* @return
|
|
85
77
|
* Returns a `<td />` element with a `<span class="k-link" />` inside to apply the styles. The text inside is the [`formattedValue`]({% slug api_dateinputs_calendarcellprops %}#toc-formattedvalue) of the `cell`.
|
|
@@ -89,20 +81,20 @@ var CalendarCellVue2 = {
|
|
|
89
81
|
var h = gh || createElement;
|
|
90
82
|
var defaultSlot = getDefaultSlots(this);
|
|
91
83
|
var _a = this.$props,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
84
|
+
formattedValue = _a.formattedValue,
|
|
85
|
+
isWeekend = _a.isWeekend,
|
|
86
|
+
isFocused = _a.isFocused,
|
|
87
|
+
isInRange = _a.isInRange,
|
|
88
|
+
isSelected = _a.isSelected,
|
|
89
|
+
isRangeStart = _a.isRangeStart,
|
|
90
|
+
isRangeMid = _a.isRangeMid,
|
|
91
|
+
isRangeEnd = _a.isRangeEnd,
|
|
92
|
+
isRangeSplitStart = _a.isRangeSplitStart,
|
|
93
|
+
isRangeSplitEnd = _a.isRangeSplitEnd,
|
|
94
|
+
isToday = _a.isToday,
|
|
95
|
+
isDisabled = _a.isDisabled,
|
|
96
|
+
view = _a.view,
|
|
97
|
+
value = _a.value;
|
|
106
98
|
var isEndActive = this.$props.activeRangeEnd === 'end' && isRangeEnd;
|
|
107
99
|
var isStartActive = this.$props.activeRangeEnd === 'start' && isRangeStart;
|
|
108
100
|
return h("td", {
|
|
@@ -163,6 +155,5 @@ var CalendarCellVue2 = {
|
|
|
163
155
|
/**
|
|
164
156
|
* @hidden
|
|
165
157
|
*/
|
|
166
|
-
|
|
167
158
|
var CalendarCell = CalendarCellVue2;
|
|
168
159
|
export { CalendarCell, CalendarCellVue2 };
|
|
@@ -8,7 +8,6 @@ import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
|
8
8
|
/**
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
11
|
var CalendarHeaderTitleVue2 = {
|
|
13
12
|
name: 'KendoHeaderTitle',
|
|
14
13
|
// @ts-ignore
|
|
@@ -32,7 +31,6 @@ var CalendarHeaderTitleVue2 = {
|
|
|
32
31
|
v3: v3
|
|
33
32
|
};
|
|
34
33
|
},
|
|
35
|
-
|
|
36
34
|
/**
|
|
37
35
|
* @return
|
|
38
36
|
* Returns a `<button />` element with the [`value`]({% slug api_dateinputs_calendarheadertitleprops %}#toc-value) of the title as a child.
|
|
@@ -41,7 +39,8 @@ var CalendarHeaderTitleVue2 = {
|
|
|
41
39
|
render: function render(createElement) {
|
|
42
40
|
var h = gh || createElement;
|
|
43
41
|
var defaultSlot = getDefaultSlots(this);
|
|
44
|
-
return (
|
|
42
|
+
return (
|
|
43
|
+
// @ts-ignore function children
|
|
45
44
|
h(KButton, {
|
|
46
45
|
type: "button",
|
|
47
46
|
attrs: this.v3 ? undefined : {
|
|
@@ -68,6 +67,5 @@ var CalendarHeaderTitleVue2 = {
|
|
|
68
67
|
/**
|
|
69
68
|
* @hidden
|
|
70
69
|
*/
|
|
71
|
-
|
|
72
70
|
var CalendarHeaderTitle = CalendarHeaderTitleVue2;
|
|
73
71
|
export { CalendarHeaderTitle, CalendarHeaderTitleVue2 };
|
|
@@ -7,7 +7,6 @@ import { getDefaultSlots } from '@progress/kendo-vue-common';
|
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
var CalendarWeekCellVue2 = {
|
|
12
11
|
props: {
|
|
13
12
|
id: String,
|
|
@@ -24,7 +23,6 @@ var CalendarWeekCellVue2 = {
|
|
|
24
23
|
v3: v3
|
|
25
24
|
};
|
|
26
25
|
},
|
|
27
|
-
|
|
28
26
|
/**
|
|
29
27
|
* @return
|
|
30
28
|
* Returns a `<td />` element with the [`value`]({% slug api_dateinputs_calendarweekcellprops %}#toc-value) as a child.
|
|
@@ -54,6 +52,5 @@ var CalendarWeekCellVue2 = {
|
|
|
54
52
|
/**
|
|
55
53
|
* @hidden
|
|
56
54
|
*/
|
|
57
|
-
|
|
58
55
|
var CalendarWeekCell = CalendarWeekCellVue2;
|
|
59
56
|
export { CalendarWeekCell, CalendarWeekCellVue2 };
|
|
@@ -16,7 +16,6 @@ import { classNames, Keys, getTemplate } from '@progress/kendo-vue-common';
|
|
|
16
16
|
/**
|
|
17
17
|
* @hidden
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
19
|
var HeaderVue2 = {
|
|
21
20
|
name: 'KendoHeader',
|
|
22
21
|
inheritAttrs: false,
|
|
@@ -84,22 +83,18 @@ var HeaderVue2 = {
|
|
|
84
83
|
if (!this.$props.currentDate) {
|
|
85
84
|
return '';
|
|
86
85
|
}
|
|
87
|
-
|
|
88
86
|
var take = this.$props.rangeLength - 1;
|
|
89
87
|
var title = this.$props.service.title(this.$props.currentDate);
|
|
90
88
|
var nextDate = this.$props.service.addToDate(this.$props.currentDate, take);
|
|
91
|
-
|
|
92
89
|
if (take < 1 || !this.$props.service.isInRange(nextDate, this.$props.min, this.$props.max)) {
|
|
93
90
|
return title;
|
|
94
91
|
}
|
|
95
|
-
|
|
96
92
|
return "".concat(title, " - ").concat(this.$props.service.title(nextDate));
|
|
97
93
|
},
|
|
98
94
|
handleTitleClick: function handleTitleClick(event) {
|
|
99
95
|
if (!this.navigate) {
|
|
100
96
|
return;
|
|
101
97
|
}
|
|
102
|
-
|
|
103
98
|
this.$props.bus.moveUp(this.$props.activeView, event);
|
|
104
99
|
this.$emit('titleclick', event);
|
|
105
100
|
},
|
|
@@ -107,7 +102,6 @@ var HeaderVue2 = {
|
|
|
107
102
|
if (!this.$props.service) {
|
|
108
103
|
return false;
|
|
109
104
|
}
|
|
110
|
-
|
|
111
105
|
var candidate = this.$props.service.move(this.$props.focusedDate, action);
|
|
112
106
|
return this.$props.min <= candidate && candidate <= this.$props.max || this.$props.service.isInSameView(candidate, this.$props.min) || this.$props.service.isInSameView(candidate, this.$props.max);
|
|
113
107
|
},
|
|
@@ -137,7 +131,6 @@ var HeaderVue2 = {
|
|
|
137
131
|
if (!this.todayIsInRange) {
|
|
138
132
|
return;
|
|
139
133
|
}
|
|
140
|
-
|
|
141
134
|
this.$props.bus.moveToBottom(this.$props.activeView);
|
|
142
135
|
var args = {
|
|
143
136
|
event: event,
|
|
@@ -148,7 +141,6 @@ var HeaderVue2 = {
|
|
|
148
141
|
},
|
|
149
142
|
todayKeyDown: function todayKeyDown(event) {
|
|
150
143
|
var keyCode = event.keyCode;
|
|
151
|
-
|
|
152
144
|
if (keyCode === Keys.enter) {
|
|
153
145
|
this.handleTodayClick(event);
|
|
154
146
|
}
|
|
@@ -167,15 +159,10 @@ var HeaderVue2 = {
|
|
|
167
159
|
render: function render(createElement) {
|
|
168
160
|
var h = gh || createElement;
|
|
169
161
|
this._localization = provideLocalizationService(this);
|
|
170
|
-
|
|
171
162
|
var todayMessage = this._localization.toLanguageString(today, messages[today]);
|
|
172
|
-
|
|
173
163
|
var title = this.getTitle();
|
|
174
|
-
|
|
175
164
|
var prevViewTitle = this._localization.toLanguageString(prevView, messages[prevView]);
|
|
176
|
-
|
|
177
165
|
var nextViewTittle = this._localization.toLanguageString(nextView, messages[nextView]);
|
|
178
|
-
|
|
179
166
|
var isPrevDisabled = !this.canNavigate(Action.PrevView);
|
|
180
167
|
var isNextDisabled = !this.canNavigate(Action.NextView);
|
|
181
168
|
var titleClassNames = classNames('k-calendar-title', 'k-title', {
|
|
@@ -185,7 +172,8 @@ var HeaderVue2 = {
|
|
|
185
172
|
'k-disabled': !this.todayIsInRange
|
|
186
173
|
});
|
|
187
174
|
var headerTitle;
|
|
188
|
-
var headerTitleDefaultRendering =
|
|
175
|
+
var headerTitleDefaultRendering =
|
|
176
|
+
// @ts-ignore function children
|
|
189
177
|
h(CalendarHeaderTitle, {
|
|
190
178
|
value: title,
|
|
191
179
|
attrs: this.v3 ? undefined : {
|
|
@@ -212,7 +200,8 @@ var HeaderVue2 = {
|
|
|
212
200
|
"class": 'k-spacer'
|
|
213
201
|
}), h("span", {
|
|
214
202
|
"class": 'k-calendar-nav k-hstack'
|
|
215
|
-
}, [
|
|
203
|
+
}, [
|
|
204
|
+
// @ts-ignore
|
|
216
205
|
h(KButton, {
|
|
217
206
|
type: "button",
|
|
218
207
|
attrs: this.v3 ? undefined : {
|
|
@@ -247,7 +236,8 @@ var HeaderVue2 = {
|
|
|
247
236
|
"click": this.handleTodayClick
|
|
248
237
|
},
|
|
249
238
|
onClick: this.handleTodayClick
|
|
250
|
-
}, [todayMessage]),
|
|
239
|
+
}, [todayMessage]),
|
|
240
|
+
// @ts-ignore
|
|
251
241
|
h(KButton, {
|
|
252
242
|
type: "button",
|
|
253
243
|
attrs: this.v3 ? undefined : {
|
|
@@ -276,6 +266,5 @@ var HeaderVue2 = {
|
|
|
276
266
|
/**
|
|
277
267
|
* @hidden
|
|
278
268
|
*/
|
|
279
|
-
|
|
280
269
|
var Header = HeaderVue2;
|
|
281
270
|
export { Header, HeaderVue2 };
|
|
@@ -15,7 +15,6 @@ import { WeekNamesService } from '../services/main';
|
|
|
15
15
|
/**
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
18
|
var ViewVue2 = {
|
|
20
19
|
name: 'KendoView',
|
|
21
20
|
inject: {
|
|
@@ -97,7 +96,6 @@ var ViewVue2 = {
|
|
|
97
96
|
if (!this.weekNumber) {
|
|
98
97
|
return null;
|
|
99
98
|
}
|
|
100
|
-
|
|
101
99
|
return weekInYear(date, this._intl.firstDay());
|
|
102
100
|
},
|
|
103
101
|
firstDate: function firstDate(row) {
|
|
@@ -108,14 +106,11 @@ var ViewVue2 = {
|
|
|
108
106
|
if (!this.weekNumber) {
|
|
109
107
|
return null;
|
|
110
108
|
}
|
|
111
|
-
|
|
112
109
|
var idx = 0;
|
|
113
110
|
var ctx = rowCtx[idx];
|
|
114
|
-
|
|
115
111
|
while (!ctx && idx < rowCtx.length) {
|
|
116
112
|
ctx = rowCtx[++idx];
|
|
117
113
|
}
|
|
118
|
-
|
|
119
114
|
return ctx;
|
|
120
115
|
},
|
|
121
116
|
handleClick: function handleClick(value, event) {
|
|
@@ -161,17 +156,16 @@ var ViewVue2 = {
|
|
|
161
156
|
render: function render(createElement) {
|
|
162
157
|
var h = gh || createElement;
|
|
163
158
|
this._intl = provideIntlService(this);
|
|
164
|
-
this._weekService = new WeekNamesService(this._intl);
|
|
165
|
-
|
|
159
|
+
this._weekService = new WeekNamesService(this._intl);
|
|
160
|
+
// tslint:disable-next-line jsx-use-translation-function
|
|
166
161
|
var emptyCell = function emptyCell(idx) {
|
|
167
162
|
return h("td", {
|
|
168
163
|
key: idx
|
|
169
164
|
});
|
|
170
|
-
};
|
|
165
|
+
};
|
|
166
|
+
// const weekNames = this._weekService.getWeekNames(this.weekNumber);
|
|
171
167
|
// const colSpan = this.$props.service.rowLength(this.weekNumber);
|
|
172
168
|
// const title = this.$props.service.title(this.$props.viewDate);
|
|
173
|
-
|
|
174
|
-
|
|
175
169
|
var time = getToday();
|
|
176
170
|
var focusedDate = this.$props.isActive ? this.$props.focusedDate : null;
|
|
177
171
|
var viewDate = setTime(this.$props.viewDate, time);
|
|
@@ -185,17 +179,15 @@ var ViewVue2 = {
|
|
|
185
179
|
selectionRange: this.$props.selectionRange,
|
|
186
180
|
viewDate: viewDate
|
|
187
181
|
});
|
|
188
|
-
|
|
189
182
|
var buildWeekNumber = function buildWeekNumber(row, idx) {
|
|
190
183
|
var firstDayOfWeek = this.firstDate(row);
|
|
191
|
-
|
|
192
184
|
if (!firstDayOfWeek) {
|
|
193
185
|
return emptyCell("week-cell-".concat(idx));
|
|
194
186
|
}
|
|
195
|
-
|
|
196
187
|
var weekCellValue = this.getWeekNumber(this.firstDate(row));
|
|
197
188
|
var uniqueID = "kendo-vue-calendar-week-cell-".concat(weekCellValue);
|
|
198
|
-
var cellDefaultRendering =
|
|
189
|
+
var cellDefaultRendering =
|
|
190
|
+
// @ts-ignore function children
|
|
199
191
|
h(CalendarWeekCell, {
|
|
200
192
|
"class": 'k-calendar-td k-alt',
|
|
201
193
|
value: weekCellValue,
|
|
@@ -224,15 +216,14 @@ var ViewVue2 = {
|
|
|
224
216
|
}
|
|
225
217
|
});
|
|
226
218
|
};
|
|
227
|
-
|
|
228
219
|
var buildRow = function buildRow(row) {
|
|
229
220
|
return row.map(function (cell, idx) {
|
|
230
221
|
if (!cell) {
|
|
231
222
|
return emptyCell(idx);
|
|
232
223
|
}
|
|
233
|
-
|
|
234
224
|
var uniqueID = "kendo-vue-calendar-cell-".concat(cell.value.getTime());
|
|
235
|
-
var cellDefaultRendering =
|
|
225
|
+
var cellDefaultRendering =
|
|
226
|
+
// @ts-ignore function children
|
|
236
227
|
h(CalendarCell, {
|
|
237
228
|
"aria-selected": cell.isSelected,
|
|
238
229
|
attrs: this.v3 ? undefined : {
|
|
@@ -317,7 +308,6 @@ var ViewVue2 = {
|
|
|
317
308
|
});
|
|
318
309
|
}, this);
|
|
319
310
|
};
|
|
320
|
-
|
|
321
311
|
return h("tbody", {
|
|
322
312
|
"class": 'k-calendar-tbody',
|
|
323
313
|
role: 'rowgroup',
|
|
@@ -339,6 +329,5 @@ var ViewVue2 = {
|
|
|
339
329
|
/**
|
|
340
330
|
* @hidden
|
|
341
331
|
*/
|
|
342
|
-
|
|
343
332
|
var View = ViewVue2;
|
|
344
333
|
export { View, ViewVue2 };
|