@ibragim-dev-org/ui-forge-library 1.3.2 → 1.3.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.
|
@@ -3829,16 +3829,28 @@ class UiTimeDropdownDirective {
|
|
|
3829
3829
|
ngOnInit() {
|
|
3830
3830
|
this.setInitialTime();
|
|
3831
3831
|
}
|
|
3832
|
+
onHourKeydown(event) {
|
|
3833
|
+
this.filterNonNumericInput(event);
|
|
3834
|
+
}
|
|
3832
3835
|
onHourInput(_) {
|
|
3833
3836
|
const newValue = this.normalizeHourInput(this.$hour().value());
|
|
3834
3837
|
this.$hour().value.set(newValue);
|
|
3835
3838
|
this.emitTime();
|
|
3836
3839
|
}
|
|
3840
|
+
onMinuteKeydown(event) {
|
|
3841
|
+
this.filterNonNumericInput(event);
|
|
3842
|
+
}
|
|
3837
3843
|
onMinuteInput(_) {
|
|
3838
3844
|
const newValue = this.normalizeMinuteInput(this.$minute().value());
|
|
3839
3845
|
this.$minute().value.set(newValue);
|
|
3840
3846
|
this.emitTime();
|
|
3841
3847
|
}
|
|
3848
|
+
filterNonNumericInput(event) {
|
|
3849
|
+
if ([8, 9, 27, 13, 46, 37, 38, 39, 40].includes(event.keyCode) || (event.key >= '0' && event.key <= '9')) {
|
|
3850
|
+
return;
|
|
3851
|
+
}
|
|
3852
|
+
event.preventDefault();
|
|
3853
|
+
}
|
|
3842
3854
|
onPeriodInput(_) {
|
|
3843
3855
|
if (!this.is12HourFormat) {
|
|
3844
3856
|
return;
|