@progress/kendo-angular-dateinputs 19.3.0-develop.4 → 19.3.0-develop.41

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.
@@ -17,7 +17,6 @@ import { CenturyCellTemplateDirective } from './templates/century-cell-template.
17
17
  import { WeekNumberCellTemplateDirective } from './templates/weeknumber-cell-template.directive';
18
18
  import { HeaderTitleTemplateDirective } from './templates/header-title-template.directive';
19
19
  import { Action } from './models/navigation-action.enum';
20
- import { KeyDown } from './models/keydown.interface';
21
20
  import { CalendarView } from './models/view.type';
22
21
  import { CalendarViewEnum } from './models/view.enum';
23
22
  import { SelectionRangeEnd } from './models/selection-range-end.type';
@@ -326,15 +325,15 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
326
325
  /**
327
326
  * @hidden
328
327
  */
329
- onClosePopup: EventEmitter<KeyDown>;
328
+ onClosePopup: EventEmitter<any>;
330
329
  /**
331
330
  * @hidden
332
331
  */
333
- onTabPress: EventEmitter<KeyDown>;
332
+ onTabPress: EventEmitter<any>;
334
333
  /**
335
334
  * @hidden
336
335
  */
337
- onShiftTabPress: EventEmitter<KeyDown>;
336
+ onShiftTabPress: EventEmitter<any>;
338
337
  /**
339
338
  * @hidden
340
339
  *
@@ -543,7 +542,7 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
543
542
  /**
544
543
  * @hidden
545
544
  */
546
- keydown(event: KeyDown): void;
545
+ keydown(event: KeyboardEvent): void;
547
546
  constructor(bus: BusViewService, element: ElementRef, navigator: NavigationService, renderer: Renderer2, cdr: ChangeDetectorRef, zone: NgZone, disabledDatesService: DisabledDatesService, selectionService: SelectionService);
548
547
  ngOnInit(): void;
549
548
  ngOnChanges(changes: any): void;
@@ -3,7 +3,6 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Action } from '../models/navigation-action.enum';
6
- import { KeyDown } from '../models/keydown.interface';
7
6
  import { CalendarViewEnum } from '../models/view.enum';
8
7
  import { BusViewService } from '../services/bus-view.service';
9
8
  import * as i0 from "@angular/core";
@@ -13,7 +12,7 @@ import * as i0 from "@angular/core";
13
12
  export declare class NavigationService {
14
13
  private bus;
15
14
  constructor(bus: BusViewService);
16
- action(event: KeyDown): Action;
15
+ action(event: KeyboardEvent): Action;
17
16
  move(value: Date, action: Action, activeView: CalendarViewEnum): Date;
18
17
  static ɵfac: i0.ɵɵFactoryDeclaration<NavigationService, never>;
19
18
  static ɵprov: i0.ɵɵInjectableDeclaration<NavigationService>;
package/common/utils.d.ts CHANGED
@@ -43,17 +43,7 @@ export declare const isDateArray: (value: any) => boolean;
43
43
  /**
44
44
  * @hidden
45
45
  */
46
- export declare const isArrowWithShiftPressed: (args: any) => boolean;
47
- /**
48
- * @hidden
49
- * Enum with key codes.
50
- */
51
- export declare enum Keys {
52
- ArrowDown = 40,
53
- ArrowLeft = 37,
54
- ArrowRight = 39,
55
- ArrowUp = 38
56
- }
46
+ export declare const isArrowWithShiftPressed: (args: KeyboardEvent) => boolean;
57
47
  /**
58
48
  * @hidden
59
49
  */
@@ -150,7 +150,6 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
150
150
  * Specifies the hint the DateInput displays when its value is `null`.
151
151
  * For more information, refer to the article on
152
152
  * [placeholders]({% slug placeholders_dateinput %}).
153
- * @default null
154
153
  */
155
154
  placeholder: string;
156
155
  /**
@@ -346,7 +346,6 @@ export declare class DatePickerComponent extends MultiTabStop implements Control
346
346
  /**
347
347
  * Specifies the hint the DatePicker displays when its value is `null`.
348
348
  * ([more information and exaples]({% slug placeholders_datepicker %})).
349
- * @default null
350
349
  */
351
350
  placeholder: string;
352
351
  /**
@@ -14,7 +14,6 @@ import { AdaptiveMode } from '../util';
14
14
  import { SVGIcon } from '@progress/kendo-svg-icons';
15
15
  import { DateRangeSelectionDirective } from './date-range-selection.directive';
16
16
  import { ActionSheetComponent } from '@progress/kendo-angular-navigation';
17
- import { KeyDown } from '../calendar/models/keydown.interface';
18
17
  import { DateInputSize } from '../common/models/size';
19
18
  import { CalendarView } from '../calendar/models/view.type';
20
19
  import { Day } from '@progress/kendo-date-math';
@@ -348,15 +347,15 @@ export declare class DateRangePopupComponent implements OnInit, OnDestroy {
348
347
  /**
349
348
  * @hidden
350
349
  */
351
- closePopup(event: KeyDown): void;
350
+ closePopup(event: KeyboardEvent): void;
352
351
  /**
353
352
  * @hidden
354
353
  */
355
- handleTab(event: KeyDown): void;
354
+ handleTab(event: KeyboardEvent): void;
356
355
  /**
357
356
  * @hidden
358
357
  */
359
- handleShiftTab(event: KeyDown): void;
358
+ handleShiftTab(event: KeyboardEvent): void;
360
359
  private handleWindowBlur;
361
360
  private handleMouseLeave;
362
361
  private handleKeydown;
@@ -6,7 +6,7 @@ import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, Ev
6
6
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
7
7
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { cloneDate, isEqual } from '@progress/kendo-date-math';
9
- import { hasObservers, KendoInput, guid, Keys, isObject, ResizeSensorComponent } from '@progress/kendo-angular-common';
9
+ import { hasObservers, KendoInput, guid, Keys, isObject, ResizeSensorComponent, normalizeNumpadKeys } from '@progress/kendo-angular-common';
10
10
  import { validatePackage } from '@progress/kendo-licensing';
11
11
  import { packageMetadata } from '../package-metadata';
12
12
  import { MultiViewCalendarComponent } from './multiview-calendar.component';
@@ -1048,7 +1048,7 @@ export class CalendarComponent {
1048
1048
  */
1049
1049
  handleMultiViewCalendarKeydown(args) {
1050
1050
  // Prevent form from submitting on enter if used in datepicker (classic view)
1051
- if (isPresent(this.pickerService) && args.keyCode === Keys.Enter) {
1051
+ if (isPresent(this.pickerService) && (args.code === Keys.Enter || args.code === Keys.NumpadEnter)) {
1052
1052
  args.preventDefault();
1053
1053
  }
1054
1054
  }
@@ -1129,7 +1129,8 @@ export class CalendarComponent {
1129
1129
  if (this.type === 'infinite') {
1130
1130
  // reserve the alt + arrow key commands for the picker
1131
1131
  const ctrlKey = args.ctrlKey || args.metaKey;
1132
- const arrowKeyPressed = [Keys.ArrowUp, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowLeft].indexOf(args.keyCode) !== -1;
1132
+ const code = normalizeNumpadKeys(args);
1133
+ const arrowKeyPressed = [Keys.ArrowUp, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowLeft].indexOf(code) !== -1;
1133
1134
  const reserveKeyCommandsForPicker = isPresent(this.pickerService) && arrowKeyPressed && args.altKey;
1134
1135
  if (reserveKeyCommandsForPicker) {
1135
1136
  return;
@@ -1138,7 +1139,7 @@ export class CalendarComponent {
1138
1139
  args.preventDefault();
1139
1140
  }
1140
1141
  // Prevent form from submitting on enter if used in datepicker (infinite view)
1141
- const preventSubmitInDatePicker = isPresent(this.pickerService) && args.keyCode === Keys.Enter;
1142
+ const preventSubmitInDatePicker = isPresent(this.pickerService) && code === Keys.Enter;
1142
1143
  if (preventSubmitInDatePicker) {
1143
1144
  args.preventDefault();
1144
1145
  }
@@ -1148,7 +1149,7 @@ export class CalendarComponent {
1148
1149
  this.detectChanges();
1149
1150
  args.preventDefault();
1150
1151
  }
1151
- if (args.keyCode === Keys.Enter) {
1152
+ if (code === Keys.Enter) {
1152
1153
  this.selectionService.lastClicked = this.focusedDate;
1153
1154
  if (this.selection !== 'range') {
1154
1155
  this.performSelection(this.focusedDate, args);
@@ -1157,7 +1158,7 @@ export class CalendarComponent {
1157
1158
  this.performRangeSelection(this.focusedDate);
1158
1159
  }
1159
1160
  }
1160
- if (args.keyCode === Keys.KeyT) {
1161
+ if (code === Keys.KeyT) {
1161
1162
  this.focusToday();
1162
1163
  }
1163
1164
  if (isArrowWithShiftPressed(args) && this.selection !== 'range') {
@@ -6,7 +6,7 @@ import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, Ev
6
6
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
7
7
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { cloneDate, isEqual } from '@progress/kendo-date-math';
9
- import { hasObservers, guid, Keys, isObject } from '@progress/kendo-angular-common';
9
+ import { hasObservers, guid, Keys, isObject, normalizeNumpadKeys } from '@progress/kendo-angular-common';
10
10
  import { HorizontalViewListComponent } from './horizontal-view-list.component';
11
11
  import { HeaderComponent } from './header.component';
12
12
  import { BusViewService } from './services/bus-view.service';
@@ -693,16 +693,17 @@ export class MultiViewCalendarComponent {
693
693
  * @hidden
694
694
  */
695
695
  keydown(event) {
696
- const arrowUpOrDownKeyPressed = [Keys.ArrowUp, Keys.ArrowDown].indexOf(event.keyCode) !== -1;
696
+ const code = normalizeNumpadKeys(event);
697
+ const arrowUpOrDownKeyPressed = [Keys.ArrowUp, Keys.ArrowDown].indexOf(code) !== -1;
697
698
  const ctrlKey = event.ctrlKey || event.metaKey;
698
- const onArrowRightAndControl = event.keyCode === Keys.ArrowRight && ctrlKey;
699
- const onArrowLeftAndControl = event.keyCode === Keys.ArrowLeft && ctrlKey;
700
- const onTKeyPress = event.keyCode === Keys.KeyT;
701
- const onEnterKeyPress = event.keyCode === Keys.Enter;
702
- const onArrowUpPress = event.keyCode === Keys.ArrowUp;
699
+ const onArrowRightAndControl = code === Keys.ArrowRight && ctrlKey;
700
+ const onArrowLeftAndControl = code === Keys.ArrowLeft && ctrlKey;
701
+ const onTKeyPress = code === Keys.KeyT;
702
+ const onEnterKeyPress = code === Keys.Enter;
703
+ const onArrowUpPress = code === Keys.ArrowUp;
703
704
  const altKey = event.altKey;
704
- const escKey = event.keyCode === Keys.Escape;
705
- const tabKeyPress = event.keyCode === Keys.Tab;
705
+ const escKey = code === Keys.Escape;
706
+ const tabKeyPress = code === Keys.Tab;
706
707
  const shiftKeyPress = event.shiftKey;
707
708
  if (onArrowRightAndControl) {
708
709
  event.preventDefault();
@@ -5,19 +5,20 @@
5
5
  import { Injectable } from '@angular/core';
6
6
  import { Action } from '../models/navigation-action.enum';
7
7
  import { BusViewService } from '../services/bus-view.service';
8
+ import { normalizeNumpadKeys } from '@progress/kendo-angular-common';
8
9
  import * as i0 from "@angular/core";
9
10
  import * as i1 from "../services/bus-view.service";
10
11
  const KEY_TO_ACTION = {
11
- '33': Action.PrevView,
12
- '34': Action.NextView,
13
- '35': Action.LastInView,
14
- '36': Action.FirstInView,
15
- '37': Action.Left,
16
- '38': Action.Up,
17
- '39': Action.Right,
18
- '40': Action.Down,
19
- 'meta+38': Action.UpperView,
20
- 'meta+40': Action.LowerView
12
+ 'PageUp': Action.PrevView,
13
+ 'PageDown': Action.NextView,
14
+ 'End': Action.LastInView,
15
+ 'Home': Action.FirstInView,
16
+ 'ArrowLeft': Action.Left,
17
+ 'ArrowUp': Action.Up,
18
+ 'ArrowRight': Action.Right,
19
+ 'ArrowDown': Action.Down,
20
+ 'meta+ArrowUp': Action.UpperView,
21
+ 'meta+ArrowDown': Action.LowerView
21
22
  };
22
23
  /**
23
24
  * @hidden
@@ -28,7 +29,9 @@ export class NavigationService {
28
29
  this.bus = bus;
29
30
  }
30
31
  action(event) {
31
- const action = `${event.ctrlKey || event.metaKey ? 'meta+' : ''}${event.keyCode}`;
32
+ // on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
33
+ const code = normalizeNumpadKeys(event);
34
+ const action = `${event.ctrlKey || event.metaKey ? 'meta+' : ''}${code}`;
32
35
  return KEY_TO_ACTION[action];
33
36
  }
34
37
  move(value, action, activeView) {
@@ -2,6 +2,7 @@
2
2
  * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
+ import { Keys, normalizeNumpadKeys } from "@progress/kendo-angular-common";
5
6
  /**
6
7
  * @hidden
7
8
  */
@@ -44,18 +45,10 @@ export const isDateArray = (value) => Array.isArray(value) && value.length > 0 &
44
45
  /**
45
46
  * @hidden
46
47
  */
47
- export const isArrowWithShiftPressed = (args) => args.shiftKey && (args.keyCode === Keys.ArrowRight || args.keyCode === Keys.ArrowLeft || args.keyCode === Keys.ArrowDown || args.keyCode === Keys.ArrowUp);
48
- /**
49
- * @hidden
50
- * Enum with key codes.
51
- */
52
- export var Keys;
53
- (function (Keys) {
54
- Keys[Keys["ArrowDown"] = 40] = "ArrowDown";
55
- Keys[Keys["ArrowLeft"] = 37] = "ArrowLeft";
56
- Keys[Keys["ArrowRight"] = 39] = "ArrowRight";
57
- Keys[Keys["ArrowUp"] = 38] = "ArrowUp";
58
- })(Keys || (Keys = {}));
48
+ export const isArrowWithShiftPressed = (args) => {
49
+ const code = normalizeNumpadKeys(args);
50
+ return args.shiftKey && (code === Keys.ArrowRight || code === Keys.ArrowLeft || code === Keys.ArrowDown || code === Keys.ArrowUp);
51
+ };
59
52
  /**
60
53
  * @hidden
61
54
  */
@@ -207,9 +207,8 @@ export class DateInputComponent {
207
207
  * Specifies the hint the DateInput displays when its value is `null`.
208
208
  * For more information, refer to the article on
209
209
  * [placeholders]({% slug placeholders_dateinput %}).
210
- * @default null
211
210
  */
212
- placeholder = null;
211
+ placeholder;
213
212
  /**
214
213
  * Configures the incremental steps of the DateInput.
215
214
  * For more information, refer to the article on
@@ -645,7 +644,7 @@ export class DateInputComponent {
645
644
  this.control = formControl;
646
645
  this.subs.add(this.formControl?.statusChanges.subscribe(() => this.setAriaInvalid()));
647
646
  this.setAriaInvalid();
648
- this.subs.add(this.dateInput?.nativeElement.addEventListener('keydown', this.handleKeyDown, true));
647
+ this.subs.add(this.renderer.listen(this.dateInput?.nativeElement, 'keydown', this.handleKeyDown));
649
648
  }
650
649
  ngOnDestroy() {
651
650
  this.subs.unsubscribe();
@@ -919,7 +918,7 @@ export class DateInputComponent {
919
918
  [tabindex]="tabindex"
920
919
  [disabled]="disabled"
921
920
  [readonly]="readonly"
922
- [placeholder]="placeholder"
921
+ [attr.placeholder]="placeholder"
923
922
  [attr.aria-expanded]="isPopupOpen"
924
923
  [attr.aria-haspopup]="hasPopup"
925
924
  [kendoEventsOutsideAngular]="{
@@ -1022,7 +1021,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1022
1021
  [tabindex]="tabindex"
1023
1022
  [disabled]="disabled"
1024
1023
  [readonly]="readonly"
1025
- [placeholder]="placeholder"
1024
+ [attr.placeholder]="placeholder"
1026
1025
  [attr.aria-expanded]="isPopupOpen"
1027
1026
  [attr.aria-haspopup]="hasPopup"
1028
1027
  [kendoEventsOutsideAngular]="{
@@ -7,7 +7,7 @@ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
7
7
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { PopupService } from '@progress/kendo-angular-popup';
9
9
  import { cloneDate } from '@progress/kendo-date-math';
10
- import { hasObservers, isControlRequired, KendoInput, Keys, MultiTabStop, ResizeSensorComponent, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
10
+ import { hasObservers, isControlRequired, KendoInput, Keys, MultiTabStop, ResizeSensorComponent, EventsOutsideAngularDirective, normalizeNumpadKeys } from '@progress/kendo-angular-common';
11
11
  import { validatePackage } from '@progress/kendo-licensing';
12
12
  import { packageMetadata } from '../package-metadata';
13
13
  import { MIN_DATE, MAX_DATE } from '../defaults';
@@ -399,9 +399,8 @@ export class DatePickerComponent extends MultiTabStop {
399
399
  /**
400
400
  * Specifies the hint the DatePicker displays when its value is `null`.
401
401
  * ([more information and exaples]({% slug placeholders_datepicker %})).
402
- * @default null
403
402
  */
404
- placeholder = null;
403
+ placeholder;
405
404
  /**
406
405
  * Sets the `tabindex` of the DatePicker.
407
406
  * This property is used to set the order in which the DatePicker will receive focus when navigating through the page using the Tab key.
@@ -924,22 +923,23 @@ export class DatePickerComponent extends MultiTabStop {
924
923
  * @hidden
925
924
  */
926
925
  handleKeydown(e) {
927
- const { altKey, shiftKey, keyCode, target } = e;
928
- if (keyCode === Keys.Escape) {
926
+ const { altKey, shiftKey, target } = e;
927
+ const code = normalizeNumpadKeys(e);
928
+ if (code === Keys.Escape) {
929
929
  this.dateInput.focus();
930
930
  this.show = false;
931
931
  hasObservers(this.escape) && this.escape.emit();
932
932
  }
933
933
  if (altKey) {
934
- if (keyCode === Keys.ArrowDown && !this.show) {
934
+ if (code === Keys.ArrowDown && !this.show) {
935
935
  this.show = true;
936
936
  }
937
- if (keyCode === Keys.ArrowUp) {
937
+ if (code === Keys.ArrowUp) {
938
938
  this.dateInput.focus();
939
939
  this.show = false;
940
940
  }
941
941
  }
942
- if (keyCode === Keys.Tab && this.show && this.calendar.isActive && isTabExitingCalendar(this.calendarType, target, shiftKey)) {
942
+ if (code === Keys.Tab && this.show && this.calendar.isActive && isTabExitingCalendar(this.calendarType, target, shiftKey)) {
943
943
  this.dateInput.focus();
944
944
  this.show = false;
945
945
  }
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ElementRef, Renderer2, NgZone, Directive } from '@angular/core';
6
6
  import { cloneDate } from '@progress/kendo-date-math';
7
- import { Keys } from '@progress/kendo-angular-common';
7
+ import { Keys, normalizeNumpadKeys } from '@progress/kendo-angular-common';
8
8
  import { Subscription, fromEvent } from 'rxjs';
9
9
  import { DateInputComponent } from '../dateinput/dateinput.component';
10
10
  import { DateRangeService } from './date-range.service';
@@ -59,7 +59,7 @@ export class DateRangeInput {
59
59
  this.dateRangeService.range$.subscribe(range => this.updateInputValue(range)),
60
60
  fromEvent(this.element.nativeElement, 'click').subscribe(() => this.activate()),
61
61
  fromEvent(this.element.nativeElement, 'keydown').subscribe((event) => this.togglePopup(event || {}))
62
- ].map(s => this.subscriptions.add(s));
62
+ ].forEach(s => this.subscriptions.add(s));
63
63
  }
64
64
  destroy() {
65
65
  this.subscriptions.unsubscribe();
@@ -107,11 +107,13 @@ export class DateRangeInput {
107
107
  this.dateRangeService.setRange(range);
108
108
  }
109
109
  }
110
- togglePopup({ altKey, keyCode }) {
111
- if (keyCode === Keys.Escape) {
110
+ togglePopup(e) {
111
+ const code = normalizeNumpadKeys(e);
112
+ const altKey = e.altKey;
113
+ if (code === Keys.Escape) {
112
114
  this.dateRangeService.cancelPopup();
113
115
  }
114
- else if (altKey && keyCode === Keys.ArrowDown) {
116
+ else if (altKey && code === Keys.ArrowDown) {
115
117
  this.dateRangeService.activatePopup();
116
118
  }
117
119
  }
@@ -9,7 +9,7 @@ import { DateRangePopupTemplateDirective } from './date-range-popup-template.dir
9
9
  import { DateRangeService } from './date-range.service';
10
10
  import { MultiViewCalendarComponent } from '../calendar/multiview-calendar.component';
11
11
  import { PreventableEvent } from '../preventable-event';
12
- import { isDocumentAvailable, guid, Keys, hasObservers, ResizeSensorComponent } from '@progress/kendo-angular-common';
12
+ import { isDocumentAvailable, guid, Keys, hasObservers, ResizeSensorComponent, normalizeNumpadKeys } from '@progress/kendo-angular-common';
13
13
  import { AdaptiveService } from '@progress/kendo-angular-utils';
14
14
  import { Subscription, fromEvent, merge } from 'rxjs';
15
15
  import { filter, map } from 'rxjs/operators';
@@ -547,8 +547,9 @@ export class DateRangePopupComponent {
547
547
  this.dateRangeService.setRange(this.dateRangeService.selectionRange);
548
548
  }
549
549
  handleKeydown(event) {
550
- const { altKey, keyCode } = event;
551
- if (keyCode === Keys.Escape || (altKey && keyCode === Keys.ArrowUp)) {
550
+ const { altKey } = event;
551
+ const code = normalizeNumpadKeys(event);
552
+ if (code === Keys.Escape || (altKey && code === Keys.ArrowUp)) {
552
553
  this.zone.run(() => this.cancelPopup());
553
554
  }
554
555
  }
@@ -7,7 +7,7 @@ import { validatePackage } from '@progress/kendo-licensing';
7
7
  import { packageMetadata } from '../package-metadata';
8
8
  import { DateRangePopupComponent } from './date-range-popup.component';
9
9
  import { DateRangeService } from './date-range.service';
10
- import { Keys } from '@progress/kendo-angular-common';
10
+ import { Keys, normalizeNumpadKeys } from '@progress/kendo-angular-common';
11
11
  import { NgIf } from '@angular/common';
12
12
  import * as i0 from "@angular/core";
13
13
  import * as i1 from "./date-range.service";
@@ -48,11 +48,12 @@ export class DateRangeComponent {
48
48
  * @hidden
49
49
  */
50
50
  keydown(event) {
51
- const shouldOpenPopup = event.keyCode === Keys.ArrowDown && event.altKey;
51
+ const code = normalizeNumpadKeys(event);
52
+ const shouldOpenPopup = code === Keys.ArrowDown && event.altKey;
52
53
  if (shouldOpenPopup) {
53
54
  this.dateRangeService.activatePopup();
54
55
  }
55
- const shouldClosePopup = (event.keyCode === Keys.ArrowUp && event.altKey) || event.keyCode === Keys.Escape;
56
+ const shouldClosePopup = (code === Keys.ArrowUp && event.altKey) || code === Keys.Escape;
56
57
  if (shouldClosePopup) {
57
58
  this.dateRangeService.deactivatePopup();
58
59
  }
@@ -9,7 +9,7 @@ import { tap } from 'rxjs/operators';
9
9
  import { cloneDate, isEqual, getDate } from '@progress/kendo-date-math';
10
10
  import { PopupService } from '@progress/kendo-angular-popup';
11
11
  import { IntlService } from '@progress/kendo-angular-intl';
12
- import { hasObservers, isControlRequired, KendoInput, Keys, MultiTabStop, ResizeSensorComponent, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
12
+ import { hasObservers, isControlRequired, KendoInput, Keys, MultiTabStop, ResizeSensorComponent, EventsOutsideAngularDirective, normalizeNumpadKeys } from '@progress/kendo-angular-common';
13
13
  import { AdaptiveService } from '@progress/kendo-angular-utils';
14
14
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
15
15
  import { validatePackage } from '@progress/kendo-licensing';
@@ -1114,8 +1114,9 @@ export class DateTimePickerComponent extends MultiTabStop {
1114
1114
  if (this.disabled || this.readonly) {
1115
1115
  return;
1116
1116
  }
1117
- const { keyCode, altKey } = event;
1118
- switch (keyCode) {
1117
+ const { altKey } = event;
1118
+ const code = normalizeNumpadKeys(event);
1119
+ switch (code) {
1119
1120
  case altKey && Keys.ArrowUp:
1120
1121
  case Keys.Escape:
1121
1122
  this.handleCancel();
@@ -1370,8 +1371,8 @@ export class DateTimePickerComponent extends MultiTabStop {
1370
1371
  this.popupRef.popupAnchorViewportLeave.subscribe(() => this.handleCancel());
1371
1372
  if (this.calendar.type === 'infinite') {
1372
1373
  this.subscriptions.add(fromEvent(this.calendar.monthView.list.nativeElement, 'keydown').subscribe((event) => {
1373
- const { keyCode, shiftKey } = event;
1374
- if (keyCode === Keys.Tab && !shiftKey) {
1374
+ const { code, shiftKey } = event;
1375
+ if (code === Keys.Tab && !shiftKey) {
1375
1376
  event.preventDefault();
1376
1377
  if (!this.calendarValue && !this.cancelButton) {
1377
1378
  this.dateTabButton.focus();
@@ -10,7 +10,7 @@ export const packageMetadata = {
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCode: 'KENDOUIANGULAR',
12
12
  productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1752065390,
14
- version: '19.3.0-develop.4',
13
+ publishDate: 1754998578,
14
+ version: '19.3.0-develop.41',
15
15
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
16
16
  };
@@ -16,13 +16,18 @@ const listTitle = () => span('hour', 'k-title k-timeselector-title');
16
16
  const listItem = () => li('<span>02</span>', 'k-item');
17
17
  const list = () => ul([listItem()], 'k-reset');
18
18
  const scrollable = () => (div([list()], 'k-time-container k-flex k-content k-scrollable'));
19
- const actionSheetContent = (isDateTimePicker) => ([
19
+ const actionSheetContent = (isDateTimePicker) => [
20
20
  isDateTimePicker ? div([div('button', 'k-button k-button-lg')], 'k-datetime-buttongroup') : null,
21
21
  div([
22
- div([span('title', 'k-title')], 'k-time-header'),
23
- div([listTitle(), div([scrollable()], 'k-time-list')], 'k-time-list-wrapper')
24
- ], 'k-timeselector k-timeselector-lg')
25
- ]);
22
+ div([span('04:08:48:49 AM', 'k-title k-timeselector-title'),
23
+ div('now', 'k-button k-button-md')
24
+ ], 'k-time-header'),
25
+ div([
26
+ span('', 'k-time-highlight'),
27
+ div([listTitle(), div([scrollable()], 'k-time-list')], 'k-time-list-wrapper'),
28
+ ], 'k-time-list-container'),
29
+ ], 'k-timeselector k-timeselector-lg'),
30
+ ];
26
31
  const timeListWrapper = (isAdaptiveEnabled = false, windowSize, isDateTimePicker) => {
27
32
  if (!isDocumentAvailable()) {
28
33
  return null;
@@ -30,13 +35,24 @@ const timeListWrapper = (isAdaptiveEnabled = false, windowSize, isDateTimePicker
30
35
  if (!isAdaptiveEnabled) {
31
36
  return div([listTitle(), div([scrollable()], 'k-time-list')], 'k-time-list-wrapper', { left: '-10000px', position: 'absolute' });
32
37
  }
33
- return div([div([div([div([div([], 'k-i-x k-button-icon k-icon')], 'k-icon-wrapper-host')], 'k-button k-icon-button k-button-lg')], 'k-actionsheet-titlebar'),
34
- div([
35
- isDateTimePicker ? div([...actionSheetContent(isDateTimePicker)], 'k-datetime-wrap k-time-tab') : actionSheetContent(isDateTimePicker)[1]
36
- ], 'k-actionsheet-content'),
38
+ return div([
37
39
  div([
38
- div('button', 'k-button k-button-lg')
39
- ], 'k-adaptive-actionsheet k-actionsheet-footer')], `k-actionsheet k-adaptive-actionsheet ${windowSize === 'small' ? 'k-actionsheet-fullscreen' : ''}`, { height: windowSize === 'small' ? '100%' : '60vh', left: '-10000px', position: 'absolute', top: 0 });
40
+ div([div([
41
+ div([], 'k-actionsheet-title'),
42
+ div([
43
+ div([
44
+ div([div('', 'k-i-check k-button-icon k-icon k-font-icon')], 'k-icon-wrapper-host'),
45
+ ], 'k-button k-icon-button k-button-lg'),
46
+ ], 'k-actionsheet-actions'),
47
+ ], 'k-actionsheet-titlebar-group')], 'k-actionsheet-titlebar'),
48
+ div([
49
+ isDateTimePicker
50
+ ? div([...actionSheetContent(isDateTimePicker)], 'k-datetime-wrap k-time-tab')
51
+ : actionSheetContent(isDateTimePicker)[1],
52
+ ], 'k-actionsheet-content'),
53
+ div([div('button', 'k-button k-button-lg')], 'k-actions k-actions-stretched k-actions-horizontal k-actionsheet-footer'),
54
+ ], 'k-actionsheet-view'),
55
+ ], `k-actionsheet k-adaptive-actionsheet ${windowSize === 'small' ? 'k-actionsheet-fullscreen' : ''}`, { height: windowSize === 'small' ? '100%' : '60vh', left: '-10000px', position: 'absolute', top: 0 });
40
56
  };
41
57
  /**
42
58
  * @hidden
@@ -59,6 +75,9 @@ export class TimePickerDOMService {
59
75
  }
60
76
  this.calculateHeights();
61
77
  }
78
+ sumCSSProperties(style, ...properties) {
79
+ return properties.reduce((sum, property) => sum + parseFloat(style.getPropertyValue(property)), 0) || 0;
80
+ }
62
81
  calculateHeights(container) {
63
82
  if (!isDocumentAvailable()) {
64
83
  return;
@@ -74,8 +93,15 @@ export class TimePickerDOMService {
74
93
  hostContainer = document.body;
75
94
  wrapper = hostContainer.appendChild(timeListWrapper(true, this.windowSize, this.isDateTimePicker));
76
95
  }
77
- this.timeListHeight = wrapper.querySelector('.k-scrollable').offsetHeight;
78
- this.itemHeight = wrapper.querySelector('li').offsetHeight;
96
+ const itemStyle = getComputedStyle(wrapper.querySelector('li'));
97
+ const listStyle = getComputedStyle(wrapper.querySelector('.k-scrollable'));
98
+ if (this.isAdaptiveEnabled && this.windowSize !== 'large') {
99
+ this.itemHeight = parseFloat(itemStyle.getPropertyValue('height'));
100
+ }
101
+ else {
102
+ this.itemHeight = this.sumCSSProperties(itemStyle, 'height', 'padding-top', 'padding-bottom');
103
+ }
104
+ this.timeListHeight = parseFloat(listStyle.getPropertyValue('height'));
79
105
  hostContainer.removeChild(wrapper);
80
106
  }
81
107
  isActive(element) {
@@ -17,7 +17,7 @@ import { MillisecondsService } from './services/milliseconds.service';
17
17
  import { DayPeriodService } from './services/dayperiod.service';
18
18
  import { closestInScope } from '../common/dom-queries';
19
19
  import { LocalizationService } from '@progress/kendo-angular-l10n';
20
- import { Keys, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
20
+ import { Keys, EventsOutsideAngularDirective, normalizeNumpadKeys } from '@progress/kendo-angular-common';
21
21
  import { NgStyle, NgFor } from '@angular/common';
22
22
  import * as i0 from "@angular/core";
23
23
  import * as i1 from "./services/dom.service";
@@ -26,10 +26,10 @@ const SNAP_THRESHOLD = 0.05; //% of the item height
26
26
  const SCROLL_THRESHOLD = 2; //< 2px threshold
27
27
  const nil = () => (null);
28
28
  const getters = {
29
- 35: (data, _) => data[data.length - 1],
30
- 36: (data, _) => data[0],
31
- 38: (data, index) => data[index - 1],
32
- 40: (data, index) => data[index + 1]
29
+ [Keys.End]: (data, _) => data[data.length - 1],
30
+ [Keys.Home]: (data, _) => data[0],
31
+ [Keys.ArrowUp]: (data, index) => data[index - 1],
32
+ [Keys.ArrowDown]: (data, index) => data[index + 1]
33
33
  };
34
34
  const services = {
35
35
  [TIME_PART.dayperiod]: DayPeriodService,
@@ -252,15 +252,16 @@ export class TimeListComponent {
252
252
  return oldData && newData && oldData.text !== newData.text;
253
253
  }
254
254
  handleKeyDown(e) {
255
- if (e.keyCode === Keys.Tab && !e.shiftKey && this.isLast) {
255
+ const code = normalizeNumpadKeys(e);
256
+ if (code === Keys.Tab && !e.shiftKey && this.isLast) {
256
257
  e.preventDefault();
257
258
  this.tabOutLastPart.emit();
258
259
  }
259
- if (e.keyCode === Keys.Tab && e.shiftKey && this.isFirst) {
260
+ if (code === Keys.Tab && e.shiftKey && this.isFirst) {
260
261
  e.preventDefault();
261
262
  this.tabOutFirstPart.emit();
262
263
  }
263
- const getter = getters[e.keyCode] || nil;
264
+ const getter = getters[code] || nil;
264
265
  const dataItem = getter(this.data, this.service.selectedIndex(this.value));
265
266
  if (dataItem) {
266
267
  this.handleChange(dataItem);