@dhutaryan/ngx-mat-timepicker 13.2.0 → 13.2.2
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/_timepicker-theme.scss +3 -3
- package/esm2020/lib/time-input-base.mjs +4 -2
- package/esm2020/lib/timepicker-base.mjs +2 -4
- package/fesm2015/dhutaryan-ngx-mat-timepicker.mjs +4 -4
- package/fesm2015/dhutaryan-ngx-mat-timepicker.mjs.map +1 -1
- package/fesm2020/dhutaryan-ngx-mat-timepicker.mjs +4 -4
- package/fesm2020/dhutaryan-ngx-mat-timepicker.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ import { mixinColor, MatRippleModule } from '@angular/material/core';
|
|
|
21
21
|
import * as i1$1 from '@angular/material/divider';
|
|
22
22
|
import { MatDividerModule } from '@angular/material/divider';
|
|
23
23
|
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
24
|
-
import { DOWN_ARROW, UP_ARROW,
|
|
24
|
+
import { DOWN_ARROW, UP_ARROW, PAGE_UP, PAGE_DOWN, ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
25
25
|
import { merge, fromEvent, debounceTime, take, BehaviorSubject, Subscription, Subject, first, filter } from 'rxjs';
|
|
26
26
|
import { trigger, transition, animate, keyframes, style, state } from '@angular/animations';
|
|
27
27
|
import { PlatformModule } from '@angular/cdk/platform';
|
|
@@ -1028,6 +1028,7 @@ const DIGIT_KEYS = [
|
|
|
1028
1028
|
'Digit8',
|
|
1029
1029
|
'Digit9',
|
|
1030
1030
|
];
|
|
1031
|
+
const SPECIAL_KEYS = ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight'];
|
|
1031
1032
|
class MatTimeInputBase {
|
|
1032
1033
|
constructor(element, _cdr, _document) {
|
|
1033
1034
|
this.element = element;
|
|
@@ -1046,7 +1047,8 @@ class MatTimeInputBase {
|
|
|
1046
1047
|
this.setInputPlaceholder(this._value);
|
|
1047
1048
|
}
|
|
1048
1049
|
_keydown(event) {
|
|
1049
|
-
|
|
1050
|
+
const isAllow = (DIGIT_KEYS.includes(event.code) && !event.shiftKey) || SPECIAL_KEYS.includes(event.code);
|
|
1051
|
+
if (!isAllow) {
|
|
1050
1052
|
event.preventDefault();
|
|
1051
1053
|
}
|
|
1052
1054
|
}
|
|
@@ -1824,8 +1826,6 @@ class MatTimepickerBase {
|
|
|
1824
1826
|
const keyCode = event.keyCode;
|
|
1825
1827
|
if (keyCode === UP_ARROW ||
|
|
1826
1828
|
keyCode === DOWN_ARROW ||
|
|
1827
|
-
keyCode === LEFT_ARROW ||
|
|
1828
|
-
keyCode === RIGHT_ARROW ||
|
|
1829
1829
|
keyCode === PAGE_UP ||
|
|
1830
1830
|
keyCode === PAGE_DOWN) {
|
|
1831
1831
|
event.preventDefault();
|