@progress/kendo-angular-dateinputs 16.0.0-develop.21 → 16.0.0-develop.23

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.
@@ -628,6 +628,7 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
628
628
  private verifyChanges;
629
629
  private verifyValue;
630
630
  private bindEvents;
631
+ private setRangeSelectionToValue;
631
632
  private emitBlur;
632
633
  private emitFocus;
633
634
  private handleComponentClick;
@@ -638,6 +638,7 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
638
638
  private updateButtonState;
639
639
  private parseSelectionToValue;
640
640
  private setValue;
641
+ private setRangeSelectionToValue;
641
642
  private performRangeSelection;
642
643
  private performSelection;
643
644
  static ɵfac: i0.ɵɵFactoryDeclaration<MultiViewCalendarComponent, never>;
@@ -584,6 +584,12 @@ export class CalendarComponent {
584
584
  }
585
585
  ngDoCheck() {
586
586
  if (this.valueSetter || this.selectionSetter) {
587
+ if (this.selection === 'range' &&
588
+ (this.value?.start || this.value?.end) &&
589
+ this.focusedDate.getTime() !== this.value.start?.getTime() &&
590
+ this.focusedDate.getTime() !== this.value.end?.getTime()) {
591
+ this.focusedDate = this.value.start || this.value.end || getToday();
592
+ }
587
593
  this.setValue(this.value);
588
594
  this.valueSetter = false;
589
595
  this.selectionSetter = false;
@@ -995,7 +1001,15 @@ export class CalendarComponent {
995
1001
  }
996
1002
  bindEvents() {
997
1003
  const element = this.element.nativeElement;
998
- this.domEvents.push(this.renderer.listen(element, 'focus', this.handleFocus.bind(this)), this.renderer.listen(element, 'mousedown', preventDefault), this.renderer.listen(element, 'click', this.handleComponentClick.bind(this)), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));
1004
+ this.domEvents.push(this.renderer.listen(element, 'focus', this.handleFocus.bind(this)), this.renderer.listen(element, 'mousedown', preventDefault), this.renderer.listen(element, 'click', this.handleComponentClick.bind(this)), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)), this.renderer.listen(element, 'mouseleave', this.setRangeSelectionToValue.bind(this)));
1005
+ }
1006
+ setRangeSelectionToValue() {
1007
+ if (this.selection === 'range' && this.value) {
1008
+ this.ngZone.run(() => {
1009
+ this.selectionRange = this.value;
1010
+ this.cdr.markForCheck();
1011
+ });
1012
+ }
999
1013
  }
1000
1014
  emitBlur(args) {
1001
1015
  if (this.pickerService) {
@@ -1118,11 +1132,8 @@ export class CalendarComponent {
1118
1132
  this.activeRangeEnd = 'start';
1119
1133
  this.canHover = true;
1120
1134
  }
1121
- if (this.activeRangeEnd === 'end') {
1122
- this.focusedDate = this.selectionRange.start || this.selectionRange.end || getToday();
1123
- }
1124
- else {
1125
- this.focusedDate = this.selectionRange.end || this.selectionRange.start || getToday();
1135
+ if (this._value?.end && this._value?.start) {
1136
+ this.canHover = false;
1126
1137
  }
1127
1138
  }
1128
1139
  else {
@@ -1140,6 +1151,7 @@ export class CalendarComponent {
1140
1151
  }
1141
1152
  }
1142
1153
  performRangeSelection(date) {
1154
+ this.focusedDate = date;
1143
1155
  const clonedRangeSelection = Object.assign({}, this.selectionRange);
1144
1156
  const emitValueChange = (this.activeRangeEnd === 'start' && this.value?.start?.getTime() !== date?.getTime()) ||
1145
1157
  (this.activeRangeEnd === 'end' && this.value?.end?.getTime() !== date?.getTime());
@@ -1148,14 +1160,9 @@ export class CalendarComponent {
1148
1160
  this.activeRangeEnd = rangeSelection.activeRangeEnd;
1149
1161
  if (this.canHover && rangeSelection.activeRangeEnd === 'end' && rangeSelection.selectionRange.end?.getTime() === date.getTime()) {
1150
1162
  this.activeRangeEnd = 'start';
1163
+ rangeSelection.activeRangeEnd = 'start';
1151
1164
  }
1152
- if ((this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start) ||
1153
- (this.activeRangeEnd === 'start' && rangeSelection.selectionRange.end)) {
1154
- this.canHover = true;
1155
- }
1156
- else {
1157
- this.canHover = false;
1158
- }
1165
+ this.canHover = this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start && !rangeSelection.selectionRange.end;
1159
1166
  if (emitValueChange && (this.value?.start?.getTime() !== rangeSelection.selectionRange?.start?.getTime() ||
1160
1167
  this.value?.end?.getTime() !== rangeSelection.selectionRange?.end?.getTime())) {
1161
1168
  this.value = rangeSelection.selectionRange;
@@ -24,12 +24,13 @@ export function handleRangeSelection(date, selectionRange, activeRangeEnd, allow
24
24
  if (activeRangeEnd === 'start' && date > selectionRange.end ||
25
25
  activeRangeEnd === 'end' && date < selectionRange.start) {
26
26
  selectionRange = { start: date, end: null };
27
+ activeRangeEnd = 'end';
27
28
  }
28
29
  else if (activeRangeEnd === 'start' && date <= selectionRange.end) {
29
30
  selectionRange.start = date;
30
31
  activeRangeEnd = 'end';
31
32
  }
32
- else if (activeRangeEnd === 'end' && date >= selectionRange.start) {
33
+ else if (activeRangeEnd === 'end' && date >= selectionRange.start && date.getTime() !== selectionRange.end?.getTime()) {
33
34
  selectionRange.end = date;
34
35
  activeRangeEnd = 'start';
35
36
  }
@@ -587,6 +587,7 @@ export class MultiViewCalendarComponent {
587
587
  */
588
588
  handleMouseLeave() {
589
589
  this.isHovered = false;
590
+ this.setRangeSelectionToValue();
590
591
  }
591
592
  /**
592
593
  * @hidden
@@ -687,6 +688,12 @@ export class MultiViewCalendarComponent {
687
688
  }
688
689
  ngDoCheck() {
689
690
  if (this.valueSetter || this.selectionSetter) {
691
+ if (this.selection === 'range' &&
692
+ (this.value?.start || this.value?.end) &&
693
+ this.focusedDate.getTime() !== this.value.start?.getTime() &&
694
+ this.focusedDate.getTime() !== this.value.end?.getTime()) {
695
+ this.focusedDate = this.value.start || this.value.end || getToday();
696
+ }
690
697
  this.setValue(this.value);
691
698
  this.valueSetter = false;
692
699
  this.selectionSetter = false;
@@ -1024,11 +1031,8 @@ export class MultiViewCalendarComponent {
1024
1031
  this.activeRangeEnd = 'start';
1025
1032
  this.canHover = true;
1026
1033
  }
1027
- if (this.activeRangeEnd === 'end') {
1028
- this.focusedDate = this.selectionRange.start || this.selectionRange.end || getToday();
1029
- }
1030
- else {
1031
- this.focusedDate = this.selectionRange.end || this.selectionRange.start || getToday();
1034
+ if (this._value?.end && this._value?.start) {
1035
+ this.canHover = false;
1032
1036
  }
1033
1037
  }
1034
1038
  else {
@@ -1045,7 +1049,14 @@ export class MultiViewCalendarComponent {
1045
1049
  }
1046
1050
  }
1047
1051
  }
1052
+ setRangeSelectionToValue() {
1053
+ if (this.selection === 'range' && this.value) {
1054
+ this.selectionRange = this.value;
1055
+ this.cdr.markForCheck();
1056
+ }
1057
+ }
1048
1058
  performRangeSelection(date) {
1059
+ this.focusedDate = date;
1049
1060
  const clonedRangeSelection = Object.assign({}, this.selectionRange);
1050
1061
  const emitValueChange = (this.activeRangeEnd === 'start' && this.value?.start?.getTime() !== date?.getTime()) ||
1051
1062
  (this.activeRangeEnd === 'end' && this.value?.end?.getTime() !== date?.getTime());
@@ -1054,6 +1065,7 @@ export class MultiViewCalendarComponent {
1054
1065
  this.activeRangeEnd = rangeSelection.activeRangeEnd;
1055
1066
  if (this.canHover && rangeSelection.activeRangeEnd === 'end' && rangeSelection.selectionRange.end?.getTime() === date.getTime()) {
1056
1067
  this.activeRangeEnd = 'start';
1068
+ rangeSelection.activeRangeEnd = 'start';
1057
1069
  }
1058
1070
  this.canHover = this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start && !rangeSelection.selectionRange.end;
1059
1071
  if (emitValueChange && (this.value?.start?.getTime() !== rangeSelection.selectionRange?.start?.getTime() ||
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-dateinputs',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1715351340,
13
- version: '16.0.0-develop.21',
12
+ publishDate: 1715621291,
13
+ version: '16.0.0-develop.23',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
15
15
  };
@@ -38,8 +38,8 @@ const packageMetadata = {
38
38
  name: '@progress/kendo-angular-dateinputs',
39
39
  productName: 'Kendo UI for Angular',
40
40
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
41
- publishDate: 1715351340,
42
- version: '16.0.0-develop.21',
41
+ publishDate: 1715621291,
42
+ version: '16.0.0-develop.23',
43
43
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
44
44
  };
45
45
 
@@ -3218,7 +3218,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3218
3218
  * @hidden
3219
3219
  */
3220
3220
  function handleRangeSelection(date, selectionRange, activeRangeEnd, allowReverse = false) {
3221
- var _a, _b;
3221
+ var _a, _b, _c;
3222
3222
  if ((activeRangeEnd === 'start' && ((_a = selectionRange.start) === null || _a === void 0 ? void 0 : _a.getTime()) === (date === null || date === void 0 ? void 0 : date.getTime()) && ((allowReverse && !selectionRange.end) || !allowReverse)) ||
3223
3223
  (activeRangeEnd === 'end' && ((_b = selectionRange.end) === null || _b === void 0 ? void 0 : _b.getTime()) === (date === null || date === void 0 ? void 0 : date.getTime()))) {
3224
3224
  return { activeRangeEnd: activeRangeEnd, selectionRange: selectionRange };
@@ -3237,12 +3237,13 @@ function handleRangeSelection(date, selectionRange, activeRangeEnd, allowReverse
3237
3237
  if (activeRangeEnd === 'start' && date > selectionRange.end ||
3238
3238
  activeRangeEnd === 'end' && date < selectionRange.start) {
3239
3239
  selectionRange = { start: date, end: null };
3240
+ activeRangeEnd = 'end';
3240
3241
  }
3241
3242
  else if (activeRangeEnd === 'start' && date <= selectionRange.end) {
3242
3243
  selectionRange.start = date;
3243
3244
  activeRangeEnd = 'end';
3244
3245
  }
3245
- else if (activeRangeEnd === 'end' && date >= selectionRange.start) {
3246
+ else if (activeRangeEnd === 'end' && date >= selectionRange.start && date.getTime() !== ((_c = selectionRange.end) === null || _c === void 0 ? void 0 : _c.getTime())) {
3246
3247
  selectionRange.end = date;
3247
3248
  activeRangeEnd = 'start';
3248
3249
  }
@@ -4085,6 +4086,7 @@ class MultiViewCalendarComponent {
4085
4086
  */
4086
4087
  handleMouseLeave() {
4087
4088
  this.isHovered = false;
4089
+ this.setRangeSelectionToValue();
4088
4090
  }
4089
4091
  /**
4090
4092
  * @hidden
@@ -4184,7 +4186,14 @@ class MultiViewCalendarComponent {
4184
4186
  this.bus.configure(this.bottomViewEnum, this.topViewEnum);
4185
4187
  }
4186
4188
  ngDoCheck() {
4189
+ var _a, _b, _c, _d;
4187
4190
  if (this.valueSetter || this.selectionSetter) {
4191
+ if (this.selection === 'range' &&
4192
+ (((_a = this.value) === null || _a === void 0 ? void 0 : _a.start) || ((_b = this.value) === null || _b === void 0 ? void 0 : _b.end)) &&
4193
+ this.focusedDate.getTime() !== ((_c = this.value.start) === null || _c === void 0 ? void 0 : _c.getTime()) &&
4194
+ this.focusedDate.getTime() !== ((_d = this.value.end) === null || _d === void 0 ? void 0 : _d.getTime())) {
4195
+ this.focusedDate = this.value.start || this.value.end || getToday();
4196
+ }
4188
4197
  this.setValue(this.value);
4189
4198
  this.valueSetter = false;
4190
4199
  this.selectionSetter = false;
@@ -4499,7 +4508,7 @@ class MultiViewCalendarComponent {
4499
4508
  return this.selection === 'single' ? cloneDate(last(selection)) : selection.map(date => cloneDate(date));
4500
4509
  }
4501
4510
  setValue(candidate) {
4502
- var _a, _b, _c, _d;
4511
+ var _a, _b, _c, _d, _e, _f;
4503
4512
  this.verifyValue(candidate);
4504
4513
  if (candidate === null) {
4505
4514
  this._value = null;
@@ -4524,11 +4533,8 @@ class MultiViewCalendarComponent {
4524
4533
  this.activeRangeEnd = 'start';
4525
4534
  this.canHover = true;
4526
4535
  }
4527
- if (this.activeRangeEnd === 'end') {
4528
- this.focusedDate = this.selectionRange.start || this.selectionRange.end || getToday();
4529
- }
4530
- else {
4531
- this.focusedDate = this.selectionRange.end || this.selectionRange.start || getToday();
4536
+ if (((_e = this._value) === null || _e === void 0 ? void 0 : _e.end) && ((_f = this._value) === null || _f === void 0 ? void 0 : _f.start)) {
4537
+ this.canHover = false;
4532
4538
  }
4533
4539
  }
4534
4540
  else {
@@ -4545,8 +4551,15 @@ class MultiViewCalendarComponent {
4545
4551
  }
4546
4552
  }
4547
4553
  }
4554
+ setRangeSelectionToValue() {
4555
+ if (this.selection === 'range' && this.value) {
4556
+ this.selectionRange = this.value;
4557
+ this.cdr.markForCheck();
4558
+ }
4559
+ }
4548
4560
  performRangeSelection(date) {
4549
4561
  var _a, _b, _c, _d;
4562
+ this.focusedDate = date;
4550
4563
  const clonedRangeSelection = Object.assign({}, this.selectionRange);
4551
4564
  const emitValueChange = (this.activeRangeEnd === 'start' && ((_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.start) === null || _b === void 0 ? void 0 : _b.getTime()) !== (date === null || date === void 0 ? void 0 : date.getTime())) ||
4552
4565
  (this.activeRangeEnd === 'end' && ((_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.end) === null || _d === void 0 ? void 0 : _d.getTime()) !== (date === null || date === void 0 ? void 0 : date.getTime()));
@@ -4556,6 +4569,7 @@ class MultiViewCalendarComponent {
4556
4569
  this.activeRangeEnd = rangeSelection.activeRangeEnd;
4557
4570
  if (this.canHover && rangeSelection.activeRangeEnd === 'end' && ((_a = rangeSelection.selectionRange.end) === null || _a === void 0 ? void 0 : _a.getTime()) === date.getTime()) {
4558
4571
  this.activeRangeEnd = 'start';
4572
+ rangeSelection.activeRangeEnd = 'start';
4559
4573
  }
4560
4574
  this.canHover = this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start && !rangeSelection.selectionRange.end;
4561
4575
  if (emitValueChange && (((_c = (_b = this.value) === null || _b === void 0 ? void 0 : _b.start) === null || _c === void 0 ? void 0 : _c.getTime()) !== ((_e = (_d = rangeSelection.selectionRange) === null || _d === void 0 ? void 0 : _d.start) === null || _e === void 0 ? void 0 : _e.getTime()) ||
@@ -6912,7 +6926,14 @@ class CalendarComponent {
6912
6926
  this.scrollSyncService.configure(this.activeViewEnum);
6913
6927
  }
6914
6928
  ngDoCheck() {
6929
+ var _a, _b, _c, _d;
6915
6930
  if (this.valueSetter || this.selectionSetter) {
6931
+ if (this.selection === 'range' &&
6932
+ (((_a = this.value) === null || _a === void 0 ? void 0 : _a.start) || ((_b = this.value) === null || _b === void 0 ? void 0 : _b.end)) &&
6933
+ this.focusedDate.getTime() !== ((_c = this.value.start) === null || _c === void 0 ? void 0 : _c.getTime()) &&
6934
+ this.focusedDate.getTime() !== ((_d = this.value.end) === null || _d === void 0 ? void 0 : _d.getTime())) {
6935
+ this.focusedDate = this.value.start || this.value.end || getToday();
6936
+ }
6916
6937
  this.setValue(this.value);
6917
6938
  this.valueSetter = false;
6918
6939
  this.selectionSetter = false;
@@ -7326,7 +7347,15 @@ class CalendarComponent {
7326
7347
  }
7327
7348
  bindEvents() {
7328
7349
  const element = this.element.nativeElement;
7329
- this.domEvents.push(this.renderer.listen(element, 'focus', this.handleFocus.bind(this)), this.renderer.listen(element, 'mousedown', preventDefault), this.renderer.listen(element, 'click', this.handleComponentClick.bind(this)), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));
7350
+ this.domEvents.push(this.renderer.listen(element, 'focus', this.handleFocus.bind(this)), this.renderer.listen(element, 'mousedown', preventDefault), this.renderer.listen(element, 'click', this.handleComponentClick.bind(this)), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)), this.renderer.listen(element, 'mouseleave', this.setRangeSelectionToValue.bind(this)));
7351
+ }
7352
+ setRangeSelectionToValue() {
7353
+ if (this.selection === 'range' && this.value) {
7354
+ this.ngZone.run(() => {
7355
+ this.selectionRange = this.value;
7356
+ this.cdr.markForCheck();
7357
+ });
7358
+ }
7330
7359
  }
7331
7360
  emitBlur(args) {
7332
7361
  if (this.pickerService) {
@@ -7425,7 +7454,7 @@ class CalendarComponent {
7425
7454
  return this.selection === 'single' ? cloneDate(last(selection)) : selection.map(date => cloneDate(date));
7426
7455
  }
7427
7456
  setValue(candidate) {
7428
- var _a, _b, _c, _d;
7457
+ var _a, _b, _c, _d, _e, _f;
7429
7458
  this.verifyValue(candidate);
7430
7459
  if (candidate === null) {
7431
7460
  this._value = null;
@@ -7451,11 +7480,8 @@ class CalendarComponent {
7451
7480
  this.activeRangeEnd = 'start';
7452
7481
  this.canHover = true;
7453
7482
  }
7454
- if (this.activeRangeEnd === 'end') {
7455
- this.focusedDate = this.selectionRange.start || this.selectionRange.end || getToday();
7456
- }
7457
- else {
7458
- this.focusedDate = this.selectionRange.end || this.selectionRange.start || getToday();
7483
+ if (((_e = this._value) === null || _e === void 0 ? void 0 : _e.end) && ((_f = this._value) === null || _f === void 0 ? void 0 : _f.start)) {
7484
+ this.canHover = false;
7459
7485
  }
7460
7486
  }
7461
7487
  else {
@@ -7474,6 +7500,7 @@ class CalendarComponent {
7474
7500
  }
7475
7501
  performRangeSelection(date) {
7476
7502
  var _a, _b, _c, _d;
7503
+ this.focusedDate = date;
7477
7504
  const clonedRangeSelection = Object.assign({}, this.selectionRange);
7478
7505
  const emitValueChange = (this.activeRangeEnd === 'start' && ((_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.start) === null || _b === void 0 ? void 0 : _b.getTime()) !== (date === null || date === void 0 ? void 0 : date.getTime())) ||
7479
7506
  (this.activeRangeEnd === 'end' && ((_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.end) === null || _d === void 0 ? void 0 : _d.getTime()) !== (date === null || date === void 0 ? void 0 : date.getTime()));
@@ -7483,14 +7510,9 @@ class CalendarComponent {
7483
7510
  this.activeRangeEnd = rangeSelection.activeRangeEnd;
7484
7511
  if (this.canHover && rangeSelection.activeRangeEnd === 'end' && ((_a = rangeSelection.selectionRange.end) === null || _a === void 0 ? void 0 : _a.getTime()) === date.getTime()) {
7485
7512
  this.activeRangeEnd = 'start';
7513
+ rangeSelection.activeRangeEnd = 'start';
7486
7514
  }
7487
- if ((this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start) ||
7488
- (this.activeRangeEnd === 'start' && rangeSelection.selectionRange.end)) {
7489
- this.canHover = true;
7490
- }
7491
- else {
7492
- this.canHover = false;
7493
- }
7515
+ this.canHover = this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start && !rangeSelection.selectionRange.end;
7494
7516
  if (emitValueChange && (((_c = (_b = this.value) === null || _b === void 0 ? void 0 : _b.start) === null || _c === void 0 ? void 0 : _c.getTime()) !== ((_e = (_d = rangeSelection.selectionRange) === null || _d === void 0 ? void 0 : _d.start) === null || _e === void 0 ? void 0 : _e.getTime()) ||
7495
7517
  ((_g = (_f = this.value) === null || _f === void 0 ? void 0 : _f.end) === null || _g === void 0 ? void 0 : _g.getTime()) !== ((_j = (_h = rangeSelection.selectionRange) === null || _h === void 0 ? void 0 : _h.end) === null || _j === void 0 ? void 0 : _j.getTime()))) {
7496
7518
  this.value = rangeSelection.selectionRange;
@@ -38,8 +38,8 @@ const packageMetadata = {
38
38
  name: '@progress/kendo-angular-dateinputs',
39
39
  productName: 'Kendo UI for Angular',
40
40
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
41
- publishDate: 1715351340,
42
- version: '16.0.0-develop.21',
41
+ publishDate: 1715621291,
42
+ version: '16.0.0-develop.23',
43
43
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
44
44
  };
45
45
 
@@ -3236,12 +3236,13 @@ function handleRangeSelection(date, selectionRange, activeRangeEnd, allowReverse
3236
3236
  if (activeRangeEnd === 'start' && date > selectionRange.end ||
3237
3237
  activeRangeEnd === 'end' && date < selectionRange.start) {
3238
3238
  selectionRange = { start: date, end: null };
3239
+ activeRangeEnd = 'end';
3239
3240
  }
3240
3241
  else if (activeRangeEnd === 'start' && date <= selectionRange.end) {
3241
3242
  selectionRange.start = date;
3242
3243
  activeRangeEnd = 'end';
3243
3244
  }
3244
- else if (activeRangeEnd === 'end' && date >= selectionRange.start) {
3245
+ else if (activeRangeEnd === 'end' && date >= selectionRange.start && date.getTime() !== selectionRange.end?.getTime()) {
3245
3246
  selectionRange.end = date;
3246
3247
  activeRangeEnd = 'start';
3247
3248
  }
@@ -4084,6 +4085,7 @@ class MultiViewCalendarComponent {
4084
4085
  */
4085
4086
  handleMouseLeave() {
4086
4087
  this.isHovered = false;
4088
+ this.setRangeSelectionToValue();
4087
4089
  }
4088
4090
  /**
4089
4091
  * @hidden
@@ -4184,6 +4186,12 @@ class MultiViewCalendarComponent {
4184
4186
  }
4185
4187
  ngDoCheck() {
4186
4188
  if (this.valueSetter || this.selectionSetter) {
4189
+ if (this.selection === 'range' &&
4190
+ (this.value?.start || this.value?.end) &&
4191
+ this.focusedDate.getTime() !== this.value.start?.getTime() &&
4192
+ this.focusedDate.getTime() !== this.value.end?.getTime()) {
4193
+ this.focusedDate = this.value.start || this.value.end || getToday();
4194
+ }
4187
4195
  this.setValue(this.value);
4188
4196
  this.valueSetter = false;
4189
4197
  this.selectionSetter = false;
@@ -4521,11 +4529,8 @@ class MultiViewCalendarComponent {
4521
4529
  this.activeRangeEnd = 'start';
4522
4530
  this.canHover = true;
4523
4531
  }
4524
- if (this.activeRangeEnd === 'end') {
4525
- this.focusedDate = this.selectionRange.start || this.selectionRange.end || getToday();
4526
- }
4527
- else {
4528
- this.focusedDate = this.selectionRange.end || this.selectionRange.start || getToday();
4532
+ if (this._value?.end && this._value?.start) {
4533
+ this.canHover = false;
4529
4534
  }
4530
4535
  }
4531
4536
  else {
@@ -4542,7 +4547,14 @@ class MultiViewCalendarComponent {
4542
4547
  }
4543
4548
  }
4544
4549
  }
4550
+ setRangeSelectionToValue() {
4551
+ if (this.selection === 'range' && this.value) {
4552
+ this.selectionRange = this.value;
4553
+ this.cdr.markForCheck();
4554
+ }
4555
+ }
4545
4556
  performRangeSelection(date) {
4557
+ this.focusedDate = date;
4546
4558
  const clonedRangeSelection = Object.assign({}, this.selectionRange);
4547
4559
  const emitValueChange = (this.activeRangeEnd === 'start' && this.value?.start?.getTime() !== date?.getTime()) ||
4548
4560
  (this.activeRangeEnd === 'end' && this.value?.end?.getTime() !== date?.getTime());
@@ -4551,6 +4563,7 @@ class MultiViewCalendarComponent {
4551
4563
  this.activeRangeEnd = rangeSelection.activeRangeEnd;
4552
4564
  if (this.canHover && rangeSelection.activeRangeEnd === 'end' && rangeSelection.selectionRange.end?.getTime() === date.getTime()) {
4553
4565
  this.activeRangeEnd = 'start';
4566
+ rangeSelection.activeRangeEnd = 'start';
4554
4567
  }
4555
4568
  this.canHover = this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start && !rangeSelection.selectionRange.end;
4556
4569
  if (emitValueChange && (this.value?.start?.getTime() !== rangeSelection.selectionRange?.start?.getTime() ||
@@ -6905,6 +6918,12 @@ class CalendarComponent {
6905
6918
  }
6906
6919
  ngDoCheck() {
6907
6920
  if (this.valueSetter || this.selectionSetter) {
6921
+ if (this.selection === 'range' &&
6922
+ (this.value?.start || this.value?.end) &&
6923
+ this.focusedDate.getTime() !== this.value.start?.getTime() &&
6924
+ this.focusedDate.getTime() !== this.value.end?.getTime()) {
6925
+ this.focusedDate = this.value.start || this.value.end || getToday();
6926
+ }
6908
6927
  this.setValue(this.value);
6909
6928
  this.valueSetter = false;
6910
6929
  this.selectionSetter = false;
@@ -7316,7 +7335,15 @@ class CalendarComponent {
7316
7335
  }
7317
7336
  bindEvents() {
7318
7337
  const element = this.element.nativeElement;
7319
- this.domEvents.push(this.renderer.listen(element, 'focus', this.handleFocus.bind(this)), this.renderer.listen(element, 'mousedown', preventDefault), this.renderer.listen(element, 'click', this.handleComponentClick.bind(this)), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));
7338
+ this.domEvents.push(this.renderer.listen(element, 'focus', this.handleFocus.bind(this)), this.renderer.listen(element, 'mousedown', preventDefault), this.renderer.listen(element, 'click', this.handleComponentClick.bind(this)), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)), this.renderer.listen(element, 'mouseleave', this.setRangeSelectionToValue.bind(this)));
7339
+ }
7340
+ setRangeSelectionToValue() {
7341
+ if (this.selection === 'range' && this.value) {
7342
+ this.ngZone.run(() => {
7343
+ this.selectionRange = this.value;
7344
+ this.cdr.markForCheck();
7345
+ });
7346
+ }
7320
7347
  }
7321
7348
  emitBlur(args) {
7322
7349
  if (this.pickerService) {
@@ -7439,11 +7466,8 @@ class CalendarComponent {
7439
7466
  this.activeRangeEnd = 'start';
7440
7467
  this.canHover = true;
7441
7468
  }
7442
- if (this.activeRangeEnd === 'end') {
7443
- this.focusedDate = this.selectionRange.start || this.selectionRange.end || getToday();
7444
- }
7445
- else {
7446
- this.focusedDate = this.selectionRange.end || this.selectionRange.start || getToday();
7469
+ if (this._value?.end && this._value?.start) {
7470
+ this.canHover = false;
7447
7471
  }
7448
7472
  }
7449
7473
  else {
@@ -7461,6 +7485,7 @@ class CalendarComponent {
7461
7485
  }
7462
7486
  }
7463
7487
  performRangeSelection(date) {
7488
+ this.focusedDate = date;
7464
7489
  const clonedRangeSelection = Object.assign({}, this.selectionRange);
7465
7490
  const emitValueChange = (this.activeRangeEnd === 'start' && this.value?.start?.getTime() !== date?.getTime()) ||
7466
7491
  (this.activeRangeEnd === 'end' && this.value?.end?.getTime() !== date?.getTime());
@@ -7469,14 +7494,9 @@ class CalendarComponent {
7469
7494
  this.activeRangeEnd = rangeSelection.activeRangeEnd;
7470
7495
  if (this.canHover && rangeSelection.activeRangeEnd === 'end' && rangeSelection.selectionRange.end?.getTime() === date.getTime()) {
7471
7496
  this.activeRangeEnd = 'start';
7497
+ rangeSelection.activeRangeEnd = 'start';
7472
7498
  }
7473
- if ((this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start) ||
7474
- (this.activeRangeEnd === 'start' && rangeSelection.selectionRange.end)) {
7475
- this.canHover = true;
7476
- }
7477
- else {
7478
- this.canHover = false;
7479
- }
7499
+ this.canHover = this.activeRangeEnd === 'end' && rangeSelection.selectionRange.start && !rangeSelection.selectionRange.end;
7480
7500
  if (emitValueChange && (this.value?.start?.getTime() !== rangeSelection.selectionRange?.start?.getTime() ||
7481
7501
  this.value?.end?.getTime() !== rangeSelection.selectionRange?.end?.getTime())) {
7482
7502
  this.value = rangeSelection.selectionRange;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-dateinputs",
3
- "version": "16.0.0-develop.21",
3
+ "version": "16.0.0-develop.23",
4
4
  "description": "Kendo UI for Angular Date Inputs Package - Everything you need to add date selection functionality to apps (DatePicker, TimePicker, DateInput, DateRangePicker, DateTimePicker, Calendar, and MultiViewCalendar).",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -34,17 +34,17 @@
34
34
  "@angular/forms": "15 - 17",
35
35
  "@angular/platform-browser": "15 - 17",
36
36
  "@progress/kendo-licensing": "^1.0.2",
37
- "@progress/kendo-angular-common": "16.0.0-develop.21",
38
- "@progress/kendo-angular-intl": "16.0.0-develop.21",
39
- "@progress/kendo-angular-l10n": "16.0.0-develop.21",
40
- "@progress/kendo-angular-icons": "16.0.0-develop.21",
41
- "@progress/kendo-angular-popup": "16.0.0-develop.21",
42
- "@progress/kendo-angular-navigation": "16.0.0-develop.21",
37
+ "@progress/kendo-angular-common": "16.0.0-develop.23",
38
+ "@progress/kendo-angular-intl": "16.0.0-develop.23",
39
+ "@progress/kendo-angular-l10n": "16.0.0-develop.23",
40
+ "@progress/kendo-angular-icons": "16.0.0-develop.23",
41
+ "@progress/kendo-angular-popup": "16.0.0-develop.23",
42
+ "@progress/kendo-angular-navigation": "16.0.0-develop.23",
43
43
  "rxjs": "^6.5.3 || ^7.0.0"
44
44
  },
45
45
  "dependencies": {
46
46
  "tslib": "^2.3.1",
47
- "@progress/kendo-angular-schematics": "16.0.0-develop.21",
47
+ "@progress/kendo-angular-schematics": "16.0.0-develop.23",
48
48
  "@progress/kendo-common": "^0.2.0",
49
49
  "@progress/kendo-date-math": "^1.1.0",
50
50
  "@progress/kendo-dateinputs-common": "^0.3.3"
@@ -4,7 +4,7 @@ const schematics_1 = require("@angular-devkit/schematics");
4
4
  function default_1(options) {
5
5
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'DateInputsModule', package: 'dateinputs', peerDependencies: {
6
6
  // Peer dependency of icons
7
- '@progress/kendo-svg-icons': '^2.0.0'
7
+ '@progress/kendo-svg-icons': '^3.0.0'
8
8
  } });
9
9
  return (0, schematics_1.externalSchematic)('@progress/kendo-angular-schematics', 'ng-add', finalOptions);
10
10
  }