@truenas/ui-components 0.1.51 → 0.1.52

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 { inject, ElementRef, input, output, viewChild, signal, computed, effect, forwardRef, Component, model, afterNextRender, ChangeDetectionStrategy, Injectable, isDevMode, ViewEncapsulation, Directive, contentChildren, ViewContainerRef, contentChild, ChangeDetectorRef, HostListener, TemplateRef, DestroyRef, IterableDiffers, Pipe, ApplicationRef, EnvironmentInjector, createComponent, PLATFORM_ID } from '@angular/core';
2
+ import { inject, ElementRef, input, output, viewChild, signal, computed, effect, forwardRef, Component, model, afterNextRender, ChangeDetectionStrategy, Injectable, isDevMode, ViewEncapsulation, Directive, contentChildren, ViewContainerRef, contentChild, ChangeDetectorRef, HostListener, TemplateRef, DestroyRef, IterableDiffers, Pipe, untracked, ApplicationRef, EnvironmentInjector, createComponent, PLATFORM_ID } from '@angular/core';
3
3
  import * as i1$4 from '@angular/forms';
4
4
  import { NG_VALUE_ACCESSOR, FormsModule, NgControl } from '@angular/forms';
5
5
  import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
@@ -9940,6 +9940,17 @@ class TnButtonToggleGroupComponent {
9940
9940
  toggles.forEach(toggle => {
9941
9941
  toggle.buttonToggleGroup = this;
9942
9942
  });
9943
+ // Re-apply stored value to toggles that weren't available during writeValue
9944
+ if (toggles.length > 0) {
9945
+ untracked(() => {
9946
+ if (this.multiple()) {
9947
+ this.updateTogglesFromValues();
9948
+ }
9949
+ else {
9950
+ this.updateTogglesFromValue();
9951
+ }
9952
+ });
9953
+ }
9943
9954
  });
9944
9955
  }
9945
9956
  // ControlValueAccessor implementation