@ngrdt/forms 0.0.65 → 0.0.67

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, Injector, signal, model, linkedSignal, input, booleanAttribute, computed, effect, untracked, Directive, InjectionToken, forwardRef, output, numberAttribute, ElementRef, Pipe } from '@angular/core';
2
+ import { inject, Injector, signal, model, linkedSignal, input, booleanAttribute, computed, effect, untracked, Directive, InjectionToken, output, forwardRef, numberAttribute, ElementRef, Pipe } from '@angular/core';
3
3
  import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
4
4
  import { FormControlName, FormControlDirective, NgModel, NgControl, Validators, NG_VALUE_ACCESSOR, FormControl, FormGroup } from '@angular/forms';
5
5
  import { RdtInteractiveElementComponent, RdtComponentOutletDirective } from '@ngrdt/core';
@@ -235,12 +235,16 @@ const RDT_CHECKBOX_BASE_PROVIDER = new InjectionToken('RdtCheckbox');
235
235
 
236
236
  class RdtCheckboxOutletDirective extends RdtFormInputOutletDirective {
237
237
  componentClass = inject(RDT_CHECKBOX_BASE_PROVIDER);
238
+ checkedChange = output();
238
239
  constructor() {
239
240
  super();
240
241
  this.initComponentRef();
242
+ this.componentRef?.instance.checkedChange.subscribe((val) => {
243
+ this.checkedChange.emit(val);
244
+ });
241
245
  }
242
246
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RdtCheckboxOutletDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
243
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: RdtCheckboxOutletDirective, isStandalone: true, selector: "[rdtCheckboxOutlet]", providers: [
247
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: RdtCheckboxOutletDirective, isStandalone: true, selector: "[rdtCheckboxOutlet]", outputs: { checkedChange: "checkedChange" }, providers: [
244
248
  {
245
249
  provide: NG_VALUE_ACCESSOR,
246
250
  useExisting: forwardRef(() => RdtCheckboxOutletDirective),
@@ -725,7 +729,7 @@ function getRdtSelectStore(initialState = rdtSelectInitialState) {
725
729
  selected: selectedMap.has(it.id),
726
730
  }));
727
731
  }
728
- const selected = Array.from(selectedMap.values()).map((it) => ({ ...it, selected: true }));
732
+ const selected = [];
729
733
  const missingPlaceholder = state.missingValuePlaceholder();
730
734
  const placeholders = missing.map((id) => ({
731
735
  id,
@@ -735,9 +739,7 @@ function getRdtSelectStore(initialState = rdtSelectInitialState) {
735
739
  }));
736
740
  placeholders.forEach((pl) => selected.push(pl));
737
741
  items.forEach((item) => {
738
- if (!selectedMap.has(item.id)) {
739
- selected.push({ ...item, selected: false });
740
- }
742
+ selected.push({ ...item, selected: selectedMap.has(item.id) });
741
743
  });
742
744
  return selected;
743
745
  }),