shirkasoft-ui-components 1.0.10 → 1.0.11

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.
@@ -1095,7 +1095,7 @@ class ModalService {
1095
1095
  modalStack = computed(() => this.stackSignal(), ...(ngDevMode ? [{ debugName: "modalStack" }] : /* istanbul ignore next */ []));
1096
1096
  currentModal = computed(() => {
1097
1097
  const stack = this.stackSignal();
1098
- return stack.length > 0 ? stack[stack.length - 0] : null;
1098
+ return stack.length > 0 ? stack[stack.length - 1] : null;
1099
1099
  }, ...(ngDevMode ? [{ debugName: "currentModal" }] : /* istanbul ignore next */ []));
1100
1100
  closeRequest = computed(() => this.closeRequestSignal(), ...(ngDevMode ? [{ debugName: "closeRequest" }] : /* istanbul ignore next */ []));
1101
1101
  open(config) {
@@ -1136,6 +1136,7 @@ class ModalComponent {
1136
1136
  destroyRef = inject(DestroyRef);
1137
1137
  modalSrv = inject(ModalService);
1138
1138
  transloco = inject(TranslocoService);
1139
+ cdr = inject(ChangeDetectorRef);
1139
1140
  container = viewChild('dynamicContent', { ...(ngDevMode ? { debugName: "container" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
1140
1141
  currentConfig = signal(null, ...(ngDevMode ? [{ debugName: "currentConfig" }] : /* istanbul ignore next */ []));
1141
1142
  title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
@@ -1161,15 +1162,17 @@ class ModalComponent {
1161
1162
  this.title.set(config.title);
1162
1163
  this.isExpanded.set(false);
1163
1164
  this.visible.set(true);
1165
+ this.isProcessing.set(false);
1166
+ this.loading.set(false);
1167
+ this.cdr.markForCheck();
1164
1168
  setTimeout(() => {
1165
1169
  untracked(() => this.loadComponent(config));
1166
1170
  });
1167
- this.isProcessing.set(false);
1168
- this.loading.set(false);
1169
1171
  }
1170
1172
  else {
1171
1173
  this.visible.set(false);
1172
1174
  this.currentConfig.set(null);
1175
+ this.cdr.markForCheck();
1173
1176
  }
1174
1177
  });
1175
1178
  this.destroyRef.onDestroy(() => this.cleanup());
@@ -1179,6 +1182,7 @@ class ModalComponent {
1179
1182
  if (!show) {
1180
1183
  this.closeModal();
1181
1184
  }
1185
+ this.cdr.markForCheck();
1182
1186
  }
1183
1187
  loadComponent(config) {
1184
1188
  const containerRef = this.container();
@@ -1193,10 +1197,14 @@ class ModalComponent {
1193
1197
  });
1194
1198
  }
1195
1199
  const instance = this.componentRef.instance;
1196
- this.subscribeToOutput(instance.formValid, (valid) => this.isFormValid.set(valid));
1200
+ this.subscribeToOutput(instance.formValid, (valid) => {
1201
+ this.isFormValid.set(valid);
1202
+ this.cdr.markForCheck();
1203
+ });
1197
1204
  this.subscribeToOutput(instance.submitSuccess, () => this.handleSubmit(true));
1198
1205
  this.subscribeToOutput(instance.submitError, () => this.handleSubmit(false));
1199
1206
  this.componentRef.changeDetectorRef.markForCheck();
1207
+ this.cdr.markForCheck();
1200
1208
  }
1201
1209
  subscribeToOutput(output, callback) {
1202
1210
  if (output?.subscribe) {
@@ -1206,6 +1214,7 @@ class ModalComponent {
1206
1214
  handleSubmit(success) {
1207
1215
  this.isProcessing.set(false);
1208
1216
  this.loading.set(false);
1217
+ this.cdr.markForCheck();
1209
1218
  if (success) {
1210
1219
  untracked(() => this.modalSrv.accept());
1211
1220
  }
@@ -1223,6 +1232,7 @@ class ModalComponent {
1223
1232
  if (this.isExpanded()) {
1224
1233
  this.isExpanded.set(false);
1225
1234
  }
1235
+ this.cdr.markForCheck();
1226
1236
  setTimeout(() => {
1227
1237
  this.cleanup();
1228
1238
  this.modalSrv.close();
@@ -1230,6 +1240,7 @@ class ModalComponent {
1230
1240
  }
1231
1241
  toggleExpand() {
1232
1242
  this.isExpanded.update((v) => !v);
1243
+ this.cdr.markForCheck();
1233
1244
  }
1234
1245
  onAccept() {
1235
1246
  if (!this.componentRef || !this.isDynamicComponent(this.componentRef.instance))
@@ -1241,6 +1252,7 @@ class ModalComponent {
1241
1252
  if (form) {
1242
1253
  this.markAllAsTouched(form);
1243
1254
  this.componentRef.changeDetectorRef.markForCheck();
1255
+ this.cdr.markForCheck();
1244
1256
  if (this.hasRealErrors(form)) {
1245
1257
  this.notificationSrv.addNotification(this.transloco.translate('modal.formInvalid'), 'warning');
1246
1258
  return;
@@ -1248,6 +1260,7 @@ class ModalComponent {
1248
1260
  }
1249
1261
  this.isProcessing.set(true);
1250
1262
  this.loading.set(true);
1263
+ this.cdr.markForCheck();
1251
1264
  instance.onSubmit();
1252
1265
  }
1253
1266
  getForm(instance) {