@dhutaryan/ngx-mat-timepicker 13.2.2 → 13.2.4
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/esm2020/lib/time-input-base.mjs +5 -15
- package/fesm2015/dhutaryan-ngx-mat-timepicker.mjs +4 -14
- package/fesm2015/dhutaryan-ngx-mat-timepicker.mjs.map +1 -1
- package/fesm2020/dhutaryan-ngx-mat-timepicker.mjs +4 -14
- package/fesm2020/dhutaryan-ngx-mat-timepicker.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1016,19 +1016,8 @@ function withZeroPrefixMeridiem(value, isMeridiem) {
|
|
|
1016
1016
|
const newValue = isMeridiem && value === 0 ? 12 : value;
|
|
1017
1017
|
return withZeroPrefix(newValue);
|
|
1018
1018
|
}
|
|
1019
|
-
const DIGIT_KEYS =
|
|
1020
|
-
|
|
1021
|
-
'Digit1',
|
|
1022
|
-
'Digit2',
|
|
1023
|
-
'Digit3',
|
|
1024
|
-
'Digit4',
|
|
1025
|
-
'Digit5',
|
|
1026
|
-
'Digit6',
|
|
1027
|
-
'Digit7',
|
|
1028
|
-
'Digit8',
|
|
1029
|
-
'Digit9',
|
|
1030
|
-
];
|
|
1031
|
-
const SPECIAL_KEYS = ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight'];
|
|
1019
|
+
const DIGIT_KEYS = Array.from({ length: 10 }, (_, i) => `${i}`);
|
|
1020
|
+
const SPECIAL_KEYS = ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab'];
|
|
1032
1021
|
class MatTimeInputBase {
|
|
1033
1022
|
constructor(element, _cdr, _document) {
|
|
1034
1023
|
this.element = element;
|
|
@@ -1047,7 +1036,8 @@ class MatTimeInputBase {
|
|
|
1047
1036
|
this.setInputPlaceholder(this._value);
|
|
1048
1037
|
}
|
|
1049
1038
|
_keydown(event) {
|
|
1050
|
-
const isAllow = (DIGIT_KEYS.includes(event.
|
|
1039
|
+
const isAllow = (DIGIT_KEYS.includes(event.key) && !event.shiftKey) ||
|
|
1040
|
+
SPECIAL_KEYS.includes(event.code);
|
|
1051
1041
|
if (!isAllow) {
|
|
1052
1042
|
event.preventDefault();
|
|
1053
1043
|
}
|