@3kles/kles-material-dynamicforms 19.4.13 → 19.5.1

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.
@@ -1626,6 +1626,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
1626
1626
  let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbstract {
1627
1627
  constructor() {
1628
1628
  super(...arguments);
1629
+ this.options$ = new BehaviorSubject([]);
1629
1630
  this.isLoading = false;
1630
1631
  this.openChange$ = new Subject();
1631
1632
  this.intl = inject(KlesDynamicFormIntl);
@@ -1657,7 +1658,7 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1657
1658
  }
1658
1659
  else if (this.field.options instanceof Function) {
1659
1660
  this.isLoading = true;
1660
- return this.field.options();
1661
+ return this.field.options(undefined, this.group.getRawValue());
1661
1662
  }
1662
1663
  else {
1663
1664
  return of(this.field.options);
@@ -1682,10 +1683,10 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1682
1683
  this.options$ = this.field.options;
1683
1684
  }
1684
1685
  else if (this.field.options instanceof Function) {
1685
- this.options$ = this.field.options();
1686
+ this.options$ = this.field.options(undefined, this.group.getRawValue());
1686
1687
  }
1687
1688
  else {
1688
- this.options$ = of(this.field.options);
1689
+ this.options$ = of(this.field.options ?? []);
1689
1690
  }
1690
1691
  }
1691
1692
  }
@@ -3378,6 +3379,7 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3378
3379
  this.searchControl = new UntypedFormControl();
3379
3380
  this.selectAllControl = new UntypedFormControl(false);
3380
3381
  this.isLoading = signal(false);
3382
+ this.options$ = new BehaviorSubject([]);
3381
3383
  this.optionsFiltered$ = new ReplaySubject(1);
3382
3384
  this.openChange$ = new BehaviorSubject(false);
3383
3385
  this.openClosed$ = new Subject();
@@ -3408,10 +3410,10 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3408
3410
  this.options$ = this.field.options;
3409
3411
  }
3410
3412
  else if (this.field.options instanceof Function) {
3411
- this.options$ = this.field.options();
3413
+ this.options$ = this.field.options(undefined, this.group.getRawValue());
3412
3414
  }
3413
3415
  else {
3414
- this.options$ = of(this.field.options);
3416
+ this.options$ = of(this.field.options ?? []);
3415
3417
  }
3416
3418
  }
3417
3419
  this.options$.pipe(takeUntil$1(this._onDestroy)).subscribe((options) => {
@@ -3478,10 +3480,10 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3478
3480
  }
3479
3481
  else if (this.field.options instanceof Function) {
3480
3482
  this.isLoading.set(true);
3481
- return this.field.options().pipe(takeUntil$1(this.openClosed$));
3483
+ return this.field.options(undefined, this.group.getRawValue()).pipe(takeUntil$1(this.openClosed$));
3482
3484
  }
3483
3485
  else {
3484
- return of(this.field.options);
3486
+ return of(this.field.options ?? []);
3485
3487
  }
3486
3488
  }
3487
3489
  else {
@@ -3538,7 +3540,7 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3538
3540
  updateSelectAllControl(values) {
3539
3541
  if (this.field.multiple) {
3540
3542
  if (values) {
3541
- const selected = this.field.property && values ? values?.map((s) => s[this.field.property]) : values;
3543
+ const selected = this.field.property && values ? values.map((s) => s[this.field.property]) : values;
3542
3544
  this.optionsFiltered$
3543
3545
  .pipe(take(1), map((options) => options?.filter((option) => !option?.disabled).map((option) => (this.field.property ? option[this.field.property] : option))), map((options) => {
3544
3546
  if (!selected) {
@@ -4196,7 +4198,7 @@ class KlesFormSelectionListComponent extends KlesFieldAbstract {
4196
4198
  this.options$ = this.field.options();
4197
4199
  }
4198
4200
  else {
4199
- this.options$ = of(this.field.options);
4201
+ this.options$ = of(this.field.options ?? []);
4200
4202
  }
4201
4203
  this.group.controls[this.field.name].valueChanges.pipe(takeUntil$1(this._onDestroy)).subscribe((value) => {
4202
4204
  this.selection.setSelection(Array.isArray(value) ? value : [value], { emitEvent: false });
@@ -4645,10 +4647,10 @@ class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
4645
4647
  if (this.field.options instanceof Function) {
4646
4648
  if (this.openChange$.getValue() && this.field.options instanceof Function) {
4647
4649
  if (value) {
4648
- return this.field.options(value).pipe(take(1));
4650
+ return this.field.options(value, this.group.getRawValue()).pipe(take(1));
4649
4651
  }
4650
4652
  else {
4651
- return this.field.options().pipe(take(1));
4653
+ return this.field.options(undefined, this.group.getRawValue()).pipe(take(1));
4652
4654
  }
4653
4655
  }
4654
4656
  return of(this.group.controls[this.field.name].value ? [this.group.controls[this.field.name].value] : []);