Input make close uk-close. Search-filter: remove stopPropagation from sorting

This commit is contained in:
Konstantinos Triantafyllou 2022-04-17 01:42:10 +03:00
parent e28e06b239
commit 0384fe87b9
4 changed files with 17 additions and 16 deletions

View File

@ -113,7 +113,6 @@ export class EntitiesSelectionComponent {
this.entities.push({label: OpenaireEntities.ORGANIZATIONS, value: 'organization'});
this.entities.push({label: OpenaireEntities.DATASOURCES, value: 'dataprovider'});
}
console.log(this.entities);
}
this.selectedEntity = this.currentEntity;
this.selectionChange.emit({

View File

@ -12,7 +12,7 @@
</div>
</div>
<div *ngIf="addShowMore && (filter.values.length) > filterValuesNum">
<a *ngIf="filterValuesNum > 0 " [class]="((isDisabled)?'uk-disabled uk-link-muted ':'uk-link') + ' uk-margin-small-top'" (click)="toggle()">
<a *ngIf="filterValuesNum > 0 " [class]="((isDisabled)?'uk-disabled uk-link-muted ':'uk-link') + ' uk-margin-small-top'" (click)="toggle($event)">
<span *ngIf="!isOpen">+ View all</span>
</a>
<div *ngIf="isOpen" class="uk-text-small uk-margin-small-bottom">
@ -33,7 +33,7 @@
</ng-container>
</div>
</div>
<a *ngIf="filterValuesNum > 0 && filterValuesNum !=0" [class]="(isDisabled)?'uk-disabled uk-link-muted ':'uk-link'" (click)="toggle()">
<a *ngIf="filterValuesNum > 0 && filterValuesNum !=0" [class]="(isDisabled)?'uk-disabled uk-link-muted ':'uk-link'" (click)="toggle($event)">
<span *ngIf="isOpen">- View less</span>
</a>
</div>

View File

@ -246,12 +246,11 @@ export class SearchFilterComponent implements OnInit, OnChanges {
}
});
}
event.stopPropagation();
this.sortedValues = Object.assign(sorted);
}
toggle() {
toggle(event) {
this.isOpen = !this.isOpen;
event.stopPropagation();
}

View File

@ -84,7 +84,7 @@ declare var UIkit;
</ng-template>
<ng-template [ngIf]="type === 'chips'">
<div class="uk-grid uk-grid-small uk-grid-row-collapse uk-width-expand" uk-grid>
<div *ngFor="let chip of formAsArray.controls; let i=index" [class.hidden]="!focused && i > 0" class="chip">
<div *ngFor="let chip of formAsArray.controls; let i=index" [class.uk-hidden]="!focused && i > 0" class="chip">
<div class="uk-label uk-flex uk-flex-middle">
<span class="uk-text-truncate uk-width-expand">{{getLabel(chip.value)}}</span>
<icon (click)="remove(i, $event)" class="uk-link-text uk-margin-small-left clickable" [flex]="true"
@ -107,8 +107,9 @@ declare var UIkit;
<ng-template [ngIf]="formControl.enabled">
<icon *ngIf="!formControl.value && icon" [name]="icon" [flex]="true"></icon>
<icon *ngIf="!icon && type === 'select' && selectArrow" name="arrow_drop_down" [flex]="true"></icon>
<icon *ngIf="searchControl?.value && type === 'autocomplete'" class="clickable" (click)="resetSearch($event)"
[flex]="true" name="close"></icon>
<button *ngIf="searchControl?.value && type === 'autocomplete'" class="uk-close uk-icon" (click)="resetSearch($event)">
<icon [flex]="true" name="close"></icon>
</button>
</ng-template>
</div>
</div>
@ -178,7 +179,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@Input() disabledIcon: string = 'lock';
@Input() value: any | any[];
@Output() valueChange = new EventEmitter<any | any[]>();
@Input('hint') hint: string;
@Input() hint: string;
/** Text */
@ViewChild('input') input: ElementRef;
/** Textarea options */
@ -235,9 +236,9 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
return {
label: option,
value: option
}
};
} else {
return option
return option;
}
});
}
@ -406,11 +407,13 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
}
remove(index: number, event) {
this.formAsArray.removeAt(index);
this.formAsArray.markAsDirty();
this.focus(true);
this.searchControl.setValue('');
event.stopPropagation();
if(this.focused) {
this.formAsArray.removeAt(index);
this.formAsArray.markAsDirty();
this.focus(true);
this.searchControl.setValue('');
event.stopPropagation();
}
}
private filter(value: string): Option[] {