@arsedizioni/ars-utils 22.0.71 → 22.0.72

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Service, viewChild, output, inject, signal, ChangeDetectionStrategy, Component, ChangeDetectorRef, Injectable, DestroyRef, ElementRef, computed, Renderer2, input, effect, Input, Optional, Self, booleanAttribute, afterNextRender, model } from '@angular/core';
2
+ import { Service, viewChild, output, inject, signal, ChangeDetectionStrategy, Component, ChangeDetectorRef, afterNextRender, Injectable, DestroyRef, ElementRef, computed, Renderer2, input, effect, Input, Optional, Self, booleanAttribute, model } from '@angular/core';
3
3
  import * as i1$1 from '@arsedizioni/ars-utils/ui';
4
4
  import { DialogService, FlexLayoutModule, OtpInputComponent, UIService } from '@arsedizioni/ars-utils/ui';
5
5
  import * as i5 from '@angular/cdk/text-field';
@@ -702,16 +702,16 @@ class SelectDialogComponent {
702
702
  this.filterOptions.set(d.filters ?? []);
703
703
  }
704
704
  }
705
- if (d.filter || d.lookupOnInit) {
706
- this.doFilter(d.filter);
707
- }
708
- }
709
- ngAfterViewInit() {
710
- this.isViewReady = true;
711
- const selectedOption = this.filterOptions().find(x => x.checked);
712
- if (selectedOption) {
713
- this.applyFilterByOptions(selectedOption);
714
- }
705
+ afterNextRender(() => {
706
+ this.isViewReady = true;
707
+ const selectedOption = this.filterOptions().find(x => x.checked);
708
+ if (selectedOption) {
709
+ this.applyFilterByOptions(selectedOption);
710
+ }
711
+ if (d.lookupOnInit) {
712
+ this.applyFilter();
713
+ }
714
+ });
715
715
  }
716
716
  /**
717
717
  * Updates the total item count signal, triggering UI refresh.
@@ -843,11 +843,17 @@ class SelectDialogComponent {
843
843
  }
844
844
  if (this.dialogData().canLookup) {
845
845
  if (!e || e.key === 'Enter') {
846
- this.clearSelection();
847
- this.lookup.emit({ items: this.dialogData().items, filter: this.filterText, owner: this });
846
+ this.applyFilter();
848
847
  }
849
848
  }
850
849
  }
850
+ /**
851
+ * Applies the current filter text, emitting a lookup event.
852
+ */
853
+ applyFilter() {
854
+ this.clearSelection();
855
+ this.lookup.emit({ items: this.dialogData().items, filter: this.filterText, owner: this });
856
+ }
851
857
  /**
852
858
  * Applies a structured filter option, emitting the filter output event.
853
859
  * @param filterOption - The selected filter option object.