minor ui fixes

This commit is contained in:
CITE\spapacharalampous 2024-08-29 14:54:05 +03:00
parent 15efa81131
commit e2e337370b
3 changed files with 15 additions and 16 deletions

View File

@ -14,7 +14,7 @@
<div class="col-12"> <div class="col-12">
<app-navigation-breadcrumb /> <app-navigation-breadcrumb />
</div> </div>
<div *ngIf="!versionsModeEnabled && !isLoading && (hasListingItems || hasFilters) && !isPublic" class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()"> <div *ngIf="!versionsModeEnabled && (isLoading || hasListingItems || hasFilters) && !isPublic" class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()">
<button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="filtersCount === 0" matBadgePosition="before"> <button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="filtersCount === 0" matBadgePosition="before">
<mat-icon class="mr-4 filter-icon">filter_alt</mat-icon> <mat-icon class="mr-4 filter-icon">filter_alt</mat-icon>
</button> </button>
@ -47,15 +47,10 @@
<div class="col-12 col-xl-auto ml-auto order-4"> <div class="col-12 col-xl-auto ml-auto order-4">
<div class="row"> <div class="row">
<div class="col-12 col-xl-auto d-flex align-items-center"> <div class="col-12 col-xl-auto d-flex align-items-center">
<span *ngIf="!isPublic" class="center-content mb-1 mb-xl-4" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</span> <span *ngIf="!isPublic" class="center-content" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</span>
</div> </div>
<div class="col-12 col-xl-auto"> <div class="col-12 col-xl-auto">
<app-text-filter [(value)]=lookup.like (valueChange)="controlModified()" /> <app-text-filter suffixIcon="search" floatLabel="never" placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [(value)]=lookup.like (valueChange)="controlModified()" />
<!-- <mat-form-field class="search-form w-100" floatLabel="never">
<mat-icon matSuffix>search</mat-icon>
<input matInput placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
</mat-form-field> -->
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,4 +1,5 @@
<mat-form-field class="col-12" subscriptSizing="dynamic"> <mat-form-field subscriptSizing="dynamic" [floatLabel]="floatLabel">
<mat-label>{{getPlaceholder()}}</mat-label> <mat-icon *ngIf="suffixIcon" matSuffix>{{suffixIcon}}</mat-icon>
<input autocomplete="nope" matInput class="search-box" [(ngModel)]="inputValue"> <mat-label *ngIf="label">{{label}}</mat-label>
<input autocomplete="nope" matInput class="search-box" [placeholder]="textPlaceholder" [(ngModel)]="inputValue">
</mat-form-field> </mat-form-field>

View File

@ -14,12 +14,19 @@ import { debounceTime, takeUntil } from 'rxjs/operators';
export class TextFilterComponent extends BaseComponent implements OnInit, OnChanges { export class TextFilterComponent extends BaseComponent implements OnInit, OnChanges {
@Input() typeaheadMS = 700; @Input() typeaheadMS = 700;
@Input() disableTransform = false; @Input() disableTransform = false;
@Input() placeholder: string; @Input() floatLabel: string = "never";
@Input() label: string | null;
@Input() placeholder: string | null;
@Input() suffixIcon: string | null;
@Input() value: string; @Input() value: string;
@Output() valueChange = new EventEmitter<string>(); @Output() valueChange = new EventEmitter<string>();
private valueSubject: Subject<string>; private valueSubject: Subject<string>;
get textPlaceholder(): string {
return this.placeholder ? this.language.instant(this.placeholder) : this.language.instant('GENERAL.CRITERIA.LIKE');
}
private _inputValue: string; private _inputValue: string;
public get inputValue(): string { return this._inputValue; } public get inputValue(): string { return this._inputValue; }
public set inputValue(value: string) { public set inputValue(value: string) {
@ -53,8 +60,4 @@ export class TextFilterComponent extends BaseComponent implements OnInit, OnChan
this._inputValue = this.filterService.reverseLikeTransformation(this.value); this._inputValue = this.filterService.reverseLikeTransformation(this.value);
} }
} }
getPlaceholder(): string {
return this.placeholder ? this.language.instant(this.placeholder) : this.language.instant('COMMONS.TEXT-FILTER.LIKE');
}
} }