@3kles/kles-material-dynamicforms 19.4.10 → 19.5.0

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.
@@ -1588,6 +1588,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
1588
1588
  let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbstract {
1589
1589
  constructor() {
1590
1590
  super(...arguments);
1591
+ this.options$ = new BehaviorSubject([]);
1591
1592
  this.isLoading = false;
1592
1593
  this.openChange$ = new Subject();
1593
1594
  this.intl = inject(KlesDynamicFormIntl);
@@ -1619,7 +1620,7 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1619
1620
  }
1620
1621
  else if (this.field.options instanceof Function) {
1621
1622
  this.isLoading = true;
1622
- return this.field.options();
1623
+ return this.field.options(undefined, this.group.getRawValue());
1623
1624
  }
1624
1625
  else {
1625
1626
  return of(this.field.options);
@@ -1644,10 +1645,10 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1644
1645
  this.options$ = this.field.options;
1645
1646
  }
1646
1647
  else if (this.field.options instanceof Function) {
1647
- this.options$ = this.field.options();
1648
+ this.options$ = this.field.options(undefined, this.group.getRawValue());
1648
1649
  }
1649
1650
  else {
1650
- this.options$ = of(this.field.options);
1651
+ this.options$ = of(this.field.options ?? []);
1651
1652
  }
1652
1653
  }
1653
1654
  }
@@ -3340,6 +3341,7 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3340
3341
  this.searchControl = new UntypedFormControl();
3341
3342
  this.selectAllControl = new UntypedFormControl(false);
3342
3343
  this.isLoading = signal(false);
3344
+ this.options$ = new BehaviorSubject([]);
3343
3345
  this.optionsFiltered$ = new ReplaySubject(1);
3344
3346
  this.openChange$ = new BehaviorSubject(false);
3345
3347
  this.openClosed$ = new Subject();
@@ -3370,10 +3372,10 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3370
3372
  this.options$ = this.field.options;
3371
3373
  }
3372
3374
  else if (this.field.options instanceof Function) {
3373
- this.options$ = this.field.options();
3375
+ this.options$ = this.field.options(undefined, this.group.getRawValue());
3374
3376
  }
3375
3377
  else {
3376
- this.options$ = of(this.field.options);
3378
+ this.options$ = of(this.field.options ?? []);
3377
3379
  }
3378
3380
  }
3379
3381
  this.options$.pipe(takeUntil$1(this._onDestroy)).subscribe((options) => {
@@ -3440,10 +3442,10 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3440
3442
  }
3441
3443
  else if (this.field.options instanceof Function) {
3442
3444
  this.isLoading.set(true);
3443
- return this.field.options().pipe(takeUntil$1(this.openClosed$));
3445
+ return this.field.options(undefined, this.group.getRawValue()).pipe(takeUntil$1(this.openClosed$));
3444
3446
  }
3445
3447
  else {
3446
- return of(this.field.options);
3448
+ return of(this.field.options ?? []);
3447
3449
  }
3448
3450
  }
3449
3451
  else {
@@ -3500,7 +3502,7 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3500
3502
  updateSelectAllControl(values) {
3501
3503
  if (this.field.multiple) {
3502
3504
  if (values) {
3503
- const selected = this.field.property && values ? values?.map((s) => s[this.field.property]) : values;
3505
+ const selected = this.field.property && values ? values.map((s) => s[this.field.property]) : values;
3504
3506
  this.optionsFiltered$
3505
3507
  .pipe(take(1), map((options) => options?.filter((option) => !option?.disabled).map((option) => (this.field.property ? option[this.field.property] : option))), map((options) => {
3506
3508
  if (!selected) {
@@ -4158,7 +4160,7 @@ class KlesFormSelectionListComponent extends KlesFieldAbstract {
4158
4160
  this.options$ = this.field.options();
4159
4161
  }
4160
4162
  else {
4161
- this.options$ = of(this.field.options);
4163
+ this.options$ = of(this.field.options ?? []);
4162
4164
  }
4163
4165
  this.group.controls[this.field.name].valueChanges.pipe(takeUntil$1(this._onDestroy)).subscribe((value) => {
4164
4166
  this.selection.setSelection(Array.isArray(value) ? value : [value], { emitEvent: false });
@@ -4557,10 +4559,10 @@ class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
4557
4559
  if (this.field.options instanceof Function) {
4558
4560
  if (this.openChange$.getValue() && this.field.options instanceof Function) {
4559
4561
  if (value) {
4560
- return this.field.options(value).pipe(take(1));
4562
+ return this.field.options(value, this.group.getRawValue()).pipe(take(1));
4561
4563
  }
4562
4564
  else {
4563
- return this.field.options().pipe(take(1));
4565
+ return this.field.options(undefined, this.group.getRawValue()).pipe(take(1));
4564
4566
  }
4565
4567
  }
4566
4568
  return of(this.group.controls[this.field.name].value ? [this.group.controls[this.field.name].value] : []);