adb-shared 22.0.0-beta.0 → 22.0.0-beta.2
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.
package/fesm2022/adb-shared.mjs
CHANGED
|
@@ -4556,13 +4556,13 @@ var AdbAreaPickerComponent = class AdbAreaPickerComponent {
|
|
|
4556
4556
|
if (!area || Object.keys(area).length === 0) return "";
|
|
4557
4557
|
return area ? `${area.name} ${this.translate.instant("AREATYPES." + area.areaType)}` : "";
|
|
4558
4558
|
};
|
|
4559
|
-
|
|
4559
|
+
loadAreaIdentifier = (identifier) => {
|
|
4560
4560
|
this.loading = true;
|
|
4561
|
-
const url = `${this.config.areas}/${
|
|
4561
|
+
const url = `${this.config.areas}/${identifier}`;
|
|
4562
4562
|
return this.http.get(url).pipe(tap(() => this.loading = false));
|
|
4563
4563
|
};
|
|
4564
4564
|
onSelect(area) {
|
|
4565
|
-
const value = this.useObject ? area : area?.
|
|
4565
|
+
const value = this.useObject ? area : area?.identifier ?? null;
|
|
4566
4566
|
this.onChange(value);
|
|
4567
4567
|
}
|
|
4568
4568
|
onFocus() {
|
|
@@ -4574,11 +4574,11 @@ var AdbAreaPickerComponent = class AdbAreaPickerComponent {
|
|
|
4574
4574
|
return;
|
|
4575
4575
|
}
|
|
4576
4576
|
if (this.useObject) {
|
|
4577
|
-
if (value.
|
|
4577
|
+
if (value.identifier) this.loadAreaIdentifier(value.identifier).subscribe((area) => {
|
|
4578
4578
|
this.initialValue.set(area);
|
|
4579
4579
|
});
|
|
4580
4580
|
else this.initialValue.set(value);
|
|
4581
|
-
} else this.
|
|
4581
|
+
} else this.loadAreaIdentifier(value).subscribe((area) => {
|
|
4582
4582
|
this.initialValue.set(area);
|
|
4583
4583
|
});
|
|
4584
4584
|
}
|