@smartbit4all/ng-client 3.3.177 → 3.3.179

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.
@@ -5178,12 +5178,6 @@ class UiActionToolbarComponent {
5178
5178
  }
5179
5179
  this.setUp();
5180
5180
  }
5181
- ngAfterViewInit() {
5182
- this.changeDetector.detectChanges();
5183
- }
5184
- ngAfterViewChecked() {
5185
- this.changeDetector.detectChanges();
5186
- }
5187
5181
  ngOnChanges(changes) {
5188
5182
  if (changes['uiActionModels']) {
5189
5183
  let uiActionModels = changes['uiActionModels'].currentValue;
@@ -6266,6 +6260,20 @@ class SmartformComponent {
6266
6260
  }
6267
6261
  this.onBlurSubject = new SmartSubject(this._destroy$);
6268
6262
  }
6263
+ // ngAfterViewInit(): void {
6264
+ // if (this.smartWidgetsQL) {
6265
+ // this.handleQueryList(this.smartWidgetsQL, (widget) => {
6266
+ // // ???
6267
+ // });
6268
+ // }
6269
+ // }
6270
+ // // TODO this is a duplicate from SmartFormApiClient -> move it to a utility
6271
+ // protected handleQueryList<T>(ql: QueryList<T>, handler: (el: T) => void) {
6272
+ // ql.forEach((el) => handler(el));
6273
+ // ql.changes
6274
+ // .pipe(takeUntil(this._destroy$))
6275
+ // .subscribe((list) => (list as QueryList<T>).forEach((el) => handler(el)));
6276
+ // }
6269
6277
  refresh() {
6270
6278
  this.service.setValuesFromModel();
6271
6279
  }
@@ -6286,11 +6294,15 @@ class SmartformComponent {
6286
6294
  this.form = this.service.toFormGroup();
6287
6295
  if (this.smartForm.translateService) {
6288
6296
  this.smartForm.translateService.onLangChange.pipe(takeUntil(this._destroy$)).subscribe(() => {
6289
- this.service.translateWidgets(this.smartForm.widgets);
6297
+ this.translateWidgets(this.smartForm.widgets);
6290
6298
  });
6291
- this.service.translateWidgets(this.smartForm.widgets);
6299
+ this.translateWidgets(this.smartForm.widgets);
6292
6300
  }
6293
6301
  }
6302
+ async translateWidgets(widgets) {
6303
+ await this.service.translateWidgets(this.smartForm.widgets);
6304
+ this.smartWidgetsQL?.forEach((widget) => widget.changeDetector.markForCheck());
6305
+ }
6294
6306
  ngOnDestroy() {
6295
6307
  this._destroy$.next();
6296
6308
  this._destroy$.complete();
@@ -15457,19 +15469,6 @@ class SmartComponentApiClient {
15457
15469
  await toolbar.setUp();
15458
15470
  });
15459
15471
  this.changeDetector?.detectChanges();
15460
- // Promise.all(
15461
- // toolbars.map((toolbar) => {
15462
- // toolbar.uiActionModels = toolbarModels.get(toolbar.id!);
15463
- // return toolbar.setUp();
15464
- // })
15465
- // )
15466
- // .then(() => {
15467
- // // continue code here if needed
15468
- // this.changeDetector?.detectChanges();
15469
- // })
15470
- // .catch((error) => {
15471
- // console.error('An error occurred during toolbar setup:', error);
15472
- // });
15473
15472
  }
15474
15473
  }
15475
15474
  run() {