chrv-components 1.11.52 → 1.11.53
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.
|
Binary file
|
|
@@ -1279,7 +1279,7 @@ class ChrBaseInputComponent {
|
|
|
1279
1279
|
if (this.type() === 'number' && value !== null)
|
|
1280
1280
|
value = Number(value);
|
|
1281
1281
|
this.onChange(value);
|
|
1282
|
-
this.
|
|
1282
|
+
this.writeValue(value);
|
|
1283
1283
|
});
|
|
1284
1284
|
};
|
|
1285
1285
|
this.configureTouchBehavior = () => {
|
|
@@ -1725,7 +1725,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
1725
1725
|
|
|
1726
1726
|
class ChrTagSelectComponent extends ChrBaseInputComponent {
|
|
1727
1727
|
constructor() {
|
|
1728
|
-
const ngControl = inject(NgControl, { optional: true });
|
|
1729
1728
|
super();
|
|
1730
1729
|
this.predicate = true;
|
|
1731
1730
|
this.autocomplete = viewChild.required('auto');
|
|
@@ -1819,6 +1818,7 @@ class ChrTagSelectComponent extends ChrBaseInputComponent {
|
|
|
1819
1818
|
value[value.indexOf(entry)] = res;
|
|
1820
1819
|
return [...(value ?? [])];
|
|
1821
1820
|
});
|
|
1821
|
+
this.onValueChange(this.value());
|
|
1822
1822
|
};
|
|
1823
1823
|
this.registerFilters = () => {
|
|
1824
1824
|
this.filteredModelOptions = this.values.pipe(startWith(''), combineLatestWith(this.data$), map((value) => this._filterModel(this.textInputValue() || -1)), map((values) => {
|
|
@@ -1894,8 +1894,8 @@ class ChrTagSelectComponent extends ChrBaseInputComponent {
|
|
|
1894
1894
|
};
|
|
1895
1895
|
this.addSubject.subscribe((entry) => {
|
|
1896
1896
|
if (!this.value()?.find((v) => v == entry)) {
|
|
1897
|
-
|
|
1898
|
-
|
|
1897
|
+
const updated = [...(this.value() || []), entry];
|
|
1898
|
+
this.onValueChange(updated.length > 0 ? updated : null);
|
|
1899
1899
|
}
|
|
1900
1900
|
});
|
|
1901
1901
|
this.editSubject.subscribe((entry) => {
|
|
@@ -1904,7 +1904,7 @@ class ChrTagSelectComponent extends ChrBaseInputComponent {
|
|
|
1904
1904
|
value[index] = entry;
|
|
1905
1905
|
return [...(value ?? [])];
|
|
1906
1906
|
});
|
|
1907
|
-
|
|
1907
|
+
return this.onValueChange(this.value());
|
|
1908
1908
|
});
|
|
1909
1909
|
effect(() => {
|
|
1910
1910
|
this.data$.next(this.data() || []);
|
|
@@ -1915,14 +1915,12 @@ class ChrTagSelectComponent extends ChrBaseInputComponent {
|
|
|
1915
1915
|
//console.log(this.value);
|
|
1916
1916
|
this.registerFilters();
|
|
1917
1917
|
}
|
|
1918
|
-
writeValue(obj) {
|
|
1919
|
-
super.writeValue(obj);
|
|
1920
|
-
}
|
|
1921
1918
|
remove(value) {
|
|
1919
|
+
const updated = this.value()?.filter((v) => v != value);
|
|
1922
1920
|
if (this.value() !== null)
|
|
1923
|
-
this.
|
|
1924
|
-
if (
|
|
1925
|
-
this.
|
|
1921
|
+
this.onValueChange(updated);
|
|
1922
|
+
if (updated.length === 0)
|
|
1923
|
+
this.onValueChange(null);
|
|
1926
1924
|
this.removeCallback()?.(value);
|
|
1927
1925
|
}
|
|
1928
1926
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ChrTagSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|