chrv-components 1.12.233 → 1.12.234
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
|
|
@@ -8301,6 +8301,7 @@ class DataGrid {
|
|
|
8301
8301
|
this.metadatas = input(null, /* @ts-ignore */
|
|
8302
8302
|
...(ngDevMode ? [{ debugName: "metadatas" }] : /* istanbul ignore next */ []));
|
|
8303
8303
|
this.autoDataSource = null;
|
|
8304
|
+
this.destroyRef = inject(DestroyRef);
|
|
8304
8305
|
this.onFilterValue = (columnName, value) => {
|
|
8305
8306
|
if (this.allowFetchDistinctValues()) {
|
|
8306
8307
|
this.onFilterValueChange.emit({
|
|
@@ -8559,22 +8560,15 @@ class DataGrid {
|
|
|
8559
8560
|
const mode = this.table()?.hasPrimaryKey ? 'primaryKey' : 'index';
|
|
8560
8561
|
this.trackByMode.set(mode);
|
|
8561
8562
|
});
|
|
8562
|
-
effect(() => {
|
|
8563
|
-
const data = this.data();
|
|
8564
|
-
if (!data)
|
|
8565
|
-
return;
|
|
8566
|
-
if (this.metadatas() !== null) {
|
|
8567
|
-
if (this.autoDataSource != null)
|
|
8568
|
-
this.autoDataSource.setRows(data);
|
|
8569
|
-
}
|
|
8570
|
-
});
|
|
8571
8563
|
}
|
|
8572
8564
|
ngOnInit() {
|
|
8573
8565
|
if (this.table() === undefined || this.table() === null) {
|
|
8574
8566
|
if (this.autoDataSource) {
|
|
8575
8567
|
this.autoDataSource.setData(new AutoDataTable(this.name() ?? '', this.primaryKey(), this.metadatas() ?? []));
|
|
8576
8568
|
this.autoDataSource.registerDataGrid(this);
|
|
8577
|
-
|
|
8569
|
+
toObservable(this.data)
|
|
8570
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
8571
|
+
.subscribe((data) => this.autoDataSource?.setRows(data ?? []));
|
|
8578
8572
|
}
|
|
8579
8573
|
}
|
|
8580
8574
|
this.onInit.emit();
|