Skip to content

Commit

Permalink
fix datalist
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia committed Jul 29, 2024
1 parent 688aa59 commit 5f1d083
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { filter } from 'rxjs/operators';
import {
Component,
OnInit,
Input,
OnChanges,
DoCheck,
IterableDiffers,
IterableDiffer,
SimpleChanges,
} from '@angular/core';
import { DataFormService } from '../data-form.service';
import { GenericFormComponent } from '@geonature_common/form/genericForm.component';
Expand All @@ -17,7 +11,7 @@ import { CommonService } from '../../service/common.service';
selector: 'pnx-datalist',
templateUrl: './datalist.component.html',
})
export class DatalistComponent extends GenericFormComponent implements OnInit, OnChanges {
export class DatalistComponent extends GenericFormComponent implements OnInit {
formId: string; // Unique form id

@Input() designStyle: 'bootstrap' | 'material' = 'material';
Expand Down Expand Up @@ -60,10 +54,6 @@ export class DatalistComponent extends GenericFormComponent implements OnInit, O
this.getData();
}

ngOnChanges(changes: SimpleChanges): void {
console.log('?????', changes);
}

onToppingRemoved(val) {
const value = this.parentFormControl.value;
this.parentFormControl.patchValue(value.filter((v) => v !== val));
Expand Down Expand Up @@ -134,7 +124,7 @@ export class DatalistComponent extends GenericFormComponent implements OnInit, O
return undefined;
}

initValues(data) {
initValues(data) {
this.values = data ? data.map((v) => (typeof v !== 'object' ? { label: v, value: v } : v)) : [];
this.filteredValues = this.getFilteredValues();
// si requis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@
[application]="formDefComp['application']"
[values]="formDefComp['values']"
[api]="formDefComp['api']"
[values]="formDefComp['values']"
[keyValue]="formDefComp['keyValue'] || 'value'"
[keyLabel]="formDefComp['keyLabel'] || 'label'"
[keyTitle]="formDefComp['keyTitle']"
Expand Down

0 comments on commit 5f1d083

Please sign in to comment.