@dereekb/dbx-form 13.16.0 → 13.17.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.
@@ -6315,7 +6315,11 @@ class DbxForgeDateTimeFieldComponent {
6315
6315
  try {
6316
6316
  const state = this.field()?.();
6317
6317
  if (state?.value?.set) {
6318
- state.value.set(value);
6318
+ // Never write `undefined`: Signal Forms treats an undefined value as "this field no longer
6319
+ // exists" and orphans it from the parent structure, which throws NG01902 (Orphan field) /
6320
+ // NG01901 (Cannot resolve path) on the next computed read. Use `null` for "no value" instead
6321
+ // — that keeps the field attached (and matches what clearValue() writes).
6322
+ state.value.set(value ?? null);
6319
6323
  }
6320
6324
  }
6321
6325
  catch {
@@ -7066,7 +7070,10 @@ class DbxForgeFixedDateRangeFieldComponent {
7066
7070
  try {
7067
7071
  const fieldTree = this.field();
7068
7072
  const fieldState = fieldTree();
7069
- fieldState.value.set(value);
7073
+ // Never write `undefined`: Signal Forms orphans a field whose value becomes undefined, which
7074
+ // throws NG01902 (Orphan field) / NG01901 (Cannot resolve path) on the next computed read.
7075
+ // Use `null` for "no value" so the field stays attached to its parent structure.
7076
+ fieldState.value.set(value ?? null);
7070
7077
  fieldState.markAsTouched();
7071
7078
  fieldState.markAsDirty();
7072
7079
  }
@@ -7678,7 +7685,8 @@ class DbxForgeTimeDurationFieldComponent {
7678
7685
  this._syncing = true;
7679
7686
  const fieldTree = this.field();
7680
7687
  const fieldState = fieldTree();
7681
- fieldState.value.set(value);
7688
+ // Use null (not undefined) for "no value" — undefined orphans the Signal Forms field (NG01902/NG01901).
7689
+ fieldState.value.set(value ?? null);
7682
7690
  fieldState.markAsTouched();
7683
7691
  fieldState.markAsDirty();
7684
7692
  this._syncing = false;
@@ -8712,7 +8720,8 @@ class DbxForgeSearchableTextFieldComponent extends AbstractForgeSearchableFieldD
8712
8720
  return;
8713
8721
  const fieldState = fieldGetter();
8714
8722
  if (fieldState?.value?.set) {
8715
- fieldState.value.set(value);
8723
+ // Use null (not undefined) for "no value" — undefined orphans the Signal Forms field (NG01902/NG01901).
8724
+ fieldState.value.set(value ?? null);
8716
8725
  }
8717
8726
  }
8718
8727
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxForgeSearchableTextFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -8899,7 +8908,9 @@ class DbxForgeSearchableChipFieldComponent extends AbstractForgeSearchableFieldD
8899
8908
  }
8900
8909
  const fieldState = fieldGetter();
8901
8910
  if (fieldState?.value?.set) {
8902
- fieldState.value.set(newValue);
8911
+ // Use null (not undefined) for "no value": single-value mode yields `values[0]` === undefined
8912
+ // when empty, and undefined orphans the Signal Forms field (NG01902/NG01901).
8913
+ fieldState.value.set(newValue ?? null);
8903
8914
  }
8904
8915
  }
8905
8916
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxForgeSearchableChipFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -9122,7 +9133,9 @@ class AbstractForgePickableItemFieldDirective {
9122
9133
  }
9123
9134
  const fieldState = fieldGetter();
9124
9135
  if (fieldState?.value?.set) {
9125
- fieldState.value.set(newValue);
9136
+ // Use null (not undefined) for "no value": single-value mode yields `values[0]` === undefined
9137
+ // when the selection is empty, and undefined orphans the Signal Forms field (NG01902/NG01901).
9138
+ fieldState.value.set(newValue ?? null);
9126
9139
  }
9127
9140
  }
9128
9141
  }
@@ -9630,7 +9643,8 @@ class DbxForgeSourceSelectFieldComponent {
9630
9643
  return;
9631
9644
  const fieldState = fieldGetter();
9632
9645
  if (fieldState?.value?.set) {
9633
- fieldState.value.set(value);
9646
+ // Use null (not undefined) for "no value" — undefined orphans the Signal Forms field (NG01902/NG01901).
9647
+ fieldState.value.set(value ?? null);
9634
9648
  }
9635
9649
  }
9636
9650
  _loadSourceSelectValueForValues(values) {