@ibragim-dev-org/ui-forge-library 1.3.1 → 1.3.3
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.
|
@@ -1067,7 +1067,6 @@ class UiAlertMessagesService {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
1069
1069
|
remove(alert) {
|
|
1070
|
-
// Cancel any active timer for this alert
|
|
1071
1070
|
const subscription = this.timerSubscriptions.get(alert.id);
|
|
1072
1071
|
if (subscription) {
|
|
1073
1072
|
subscription.unsubscribe();
|
|
@@ -1087,6 +1086,12 @@ class UiAlertMessagesService {
|
|
|
1087
1086
|
}))
|
|
1088
1087
|
.subscribe();
|
|
1089
1088
|
}
|
|
1089
|
+
removeById(id) {
|
|
1090
|
+
const alert = this.$alerts().find((x) => x.id === id);
|
|
1091
|
+
if (alert) {
|
|
1092
|
+
this.remove(alert);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1090
1095
|
removeAll() {
|
|
1091
1096
|
this.$alerts.set([]);
|
|
1092
1097
|
timer(250)
|
|
@@ -1118,16 +1123,14 @@ class UiAlertMessagesService {
|
|
|
1118
1123
|
}), take(1))
|
|
1119
1124
|
.subscribe();
|
|
1120
1125
|
this.$alerts.set([...this.$alerts(), alert]);
|
|
1121
|
-
// Create pausable timer with 100ms intervals
|
|
1122
1126
|
this.timerState.set(alert.id, { paused: false, elapsed: 0 });
|
|
1123
|
-
const DURATION = 10000;
|
|
1124
|
-
const CHECK_INTERVAL = 100;
|
|
1127
|
+
const DURATION = 10000;
|
|
1128
|
+
const CHECK_INTERVAL = 100;
|
|
1125
1129
|
const subscription = interval(CHECK_INTERVAL)
|
|
1126
1130
|
.pipe(takeWhile(() => {
|
|
1127
1131
|
const state = this.timerState.get(alert.id);
|
|
1128
1132
|
if (!state)
|
|
1129
1133
|
return false;
|
|
1130
|
-
// Only increment elapsed time if not paused
|
|
1131
1134
|
if (!state.paused) {
|
|
1132
1135
|
state.elapsed += CHECK_INTERVAL;
|
|
1133
1136
|
}
|
|
@@ -3826,16 +3829,28 @@ class UiTimeDropdownDirective {
|
|
|
3826
3829
|
ngOnInit() {
|
|
3827
3830
|
this.setInitialTime();
|
|
3828
3831
|
}
|
|
3832
|
+
onHourKeydown(event) {
|
|
3833
|
+
this.filterNonNumericInput(event);
|
|
3834
|
+
}
|
|
3829
3835
|
onHourInput(_) {
|
|
3830
3836
|
const newValue = this.normalizeHourInput(this.$hour().value());
|
|
3831
3837
|
this.$hour().value.set(newValue);
|
|
3832
3838
|
this.emitTime();
|
|
3833
3839
|
}
|
|
3840
|
+
onMinuteKeydown(event) {
|
|
3841
|
+
this.filterNonNumericInput(event);
|
|
3842
|
+
}
|
|
3834
3843
|
onMinuteInput(_) {
|
|
3835
3844
|
const newValue = this.normalizeMinuteInput(this.$minute().value());
|
|
3836
3845
|
this.$minute().value.set(newValue);
|
|
3837
3846
|
this.emitTime();
|
|
3838
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
|
+
}
|
|
3839
3854
|
onPeriodInput(_) {
|
|
3840
3855
|
if (!this.is12HourFormat) {
|
|
3841
3856
|
return;
|