feat(frontend/search): added card search template, moved institutions and projects to it
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -3,104 +3,89 @@
|
||||
|
||||
<mat-divider />
|
||||
|
||||
<div class="search-and-sorting">
|
||||
<app-query-param-input
|
||||
[label]="'Suche nach Namen'"
|
||||
[debounceTime]="400"
|
||||
[queryParamKey]="'search'" />
|
||||
|
||||
<div class="sorting">
|
||||
<app-query-param-selector
|
||||
[options]="sortingOptions"
|
||||
[queryParamKey]="'sort_by'"
|
||||
label="Sortieren nach" />
|
||||
|
||||
<app-query-param-selector
|
||||
[options]="sortingDirectionOptions"
|
||||
[queryParamKey]="'sorting_order'"
|
||||
label="Sortierreihenfolge" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<mat-divider />
|
||||
|
||||
@let institutionPageValue = institutionPage();
|
||||
|
||||
@if (
|
||||
institutionPageValue.elements && institutionPageValue.elements.length > 0
|
||||
) {
|
||||
<div class="cards">
|
||||
@for (institution of institutionPageValue.elements; track $index) {
|
||||
@let institutionId = extractInstitutionId(institution);
|
||||
<mat-card
|
||||
class="card"
|
||||
appearance="outlined"
|
||||
[routerLink]="
|
||||
institution.id
|
||||
? ['/institution', institution.id.split('/').pop() ?? '']
|
||||
: null
|
||||
">
|
||||
<mat-card-header>
|
||||
<mat-card-title>{{ getDisplayName(institution) }}</mat-card-title>
|
||||
<mat-card-subtitle
|
||||
>{{ institution.geo?.city }},
|
||||
{{ institution.geo?.country }}</mat-card-subtitle
|
||||
>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-card-content class="card-content">
|
||||
<mat-divider />
|
||||
<div class="card-metadata">
|
||||
<span>Publikationen: {{ institution.works_count }}</span>
|
||||
<span>Zitationen: {{ institution.cited_by_count }}</span>
|
||||
</div>
|
||||
<mat-divider />
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-footer>
|
||||
<mat-card-actions>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="['/institution', institutionId, 'overview']"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>info</mat-icon>
|
||||
Übersicht
|
||||
</a>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="['/institution', institutionId, 'publications']"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>article</mat-icon>
|
||||
Publikationen
|
||||
</a>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="['/institution', institutionId, 'projects']"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>work</mat-icon>
|
||||
Projekte
|
||||
</a>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="['/institution', institutionId, 'patents']"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>verified</mat-icon>
|
||||
Patente
|
||||
</a>
|
||||
</mat-card-actions>
|
||||
</mat-card-footer>
|
||||
</mat-card>
|
||||
}
|
||||
</div>
|
||||
} @else {
|
||||
<div class="no-results">
|
||||
<p>Keine passenden Institutionen gefunden.</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
<mat-divider />
|
||||
|
||||
<app-query-param-paginator
|
||||
[total]="institutionPageValue.total ?? 0"
|
||||
[pageSizeOptions]="[10, 20, 50]" />
|
||||
<app-card-search
|
||||
[page]="page()"
|
||||
[cardMinWidth]="300"
|
||||
[cardTmp]="cardTmp"
|
||||
[cardMinWidth]="550"
|
||||
searchLabel="Suche nach Namen"
|
||||
[sortingOptions]="sortingOptions"
|
||||
[sortingDirectionOptions]="sortingDirectionOptions" />
|
||||
</div>
|
||||
|
||||
<ng-template #cardTmp let-institution>
|
||||
<mat-card
|
||||
class="card"
|
||||
appearance="outlined"
|
||||
[routerLink]="
|
||||
institution.id
|
||||
? ['/institution', institution.id.split('/').pop() ?? '']
|
||||
: null
|
||||
">
|
||||
<mat-card-header>
|
||||
<mat-card-title>{{ getDisplayName(institution) }}</mat-card-title>
|
||||
<mat-card-subtitle
|
||||
>{{ institution.geo?.city }},
|
||||
{{ institution.geo?.country }}</mat-card-subtitle
|
||||
>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-card-content class="card-content">
|
||||
<mat-divider />
|
||||
<div class="card-metadata">
|
||||
<span>Publikationen: {{ institution.works_count }}</span>
|
||||
<span>Zitationen: {{ institution.cited_by_count }}</span>
|
||||
</div>
|
||||
<mat-divider />
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-footer>
|
||||
<mat-card-actions>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="[
|
||||
'/institution',
|
||||
extractInstitutionId(institution),
|
||||
'overview',
|
||||
]"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>info</mat-icon>
|
||||
Übersicht
|
||||
</a>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="[
|
||||
'/institution',
|
||||
extractInstitutionId(institution),
|
||||
'publications',
|
||||
]"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>article</mat-icon>
|
||||
Publikationen
|
||||
</a>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="[
|
||||
'/institution',
|
||||
extractInstitutionId(institution),
|
||||
'projects',
|
||||
]"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>work</mat-icon>
|
||||
Projekte
|
||||
</a>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="[
|
||||
'/institution',
|
||||
extractInstitutionId(institution),
|
||||
'patents',
|
||||
]"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>verified</mat-icon>
|
||||
Patente
|
||||
</a>
|
||||
</mat-card-actions>
|
||||
</mat-card-footer>
|
||||
</mat-card>
|
||||
</ng-template>
|
||||
|
||||
@@ -5,23 +5,6 @@
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.sorting {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.sorting select {
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: var(--sg-radius-sm);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.sorting select:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
@@ -71,13 +54,3 @@ mat-card-actions a {
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: var(--sg-radius-sm);
|
||||
}
|
||||
|
||||
.no-results {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
color: var(--sg-text-secondary);
|
||||
}
|
||||
|
||||
.search-and-sorting {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
import { Component, computed, input } from '@angular/core';
|
||||
import { Institution, InstitutionPage } from '../../api';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
|
||||
|
||||
import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component';
|
||||
import {
|
||||
QueryParamSelectorComponent,
|
||||
SelectorOption,
|
||||
} from '../../shared/ui/query-param-selector/query-param-selector.component';
|
||||
import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component';
|
||||
Page,
|
||||
CardSearchComponent,
|
||||
} from '../../shared/ui/card-search/card-search.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-institutions',
|
||||
@@ -20,9 +20,7 @@ import { QueryParamInputComponent } from '../../shared/ui/query-param-input/quer
|
||||
MatIconModule,
|
||||
MatDividerModule,
|
||||
RouterModule,
|
||||
QueryParamPaginatorComponent,
|
||||
QueryParamSelectorComponent,
|
||||
QueryParamInputComponent,
|
||||
CardSearchComponent,
|
||||
],
|
||||
templateUrl: './institutions.component.html',
|
||||
styleUrl: './institutions.component.scss',
|
||||
@@ -30,6 +28,13 @@ import { QueryParamInputComponent } from '../../shared/ui/query-param-input/quer
|
||||
export class InstitutionsComponent {
|
||||
institutionPage = input.required<InstitutionPage>();
|
||||
|
||||
page = computed<Page>(() => ({
|
||||
page: this.institutionPage().page || 0,
|
||||
size: this.institutionPage().size || 10,
|
||||
total: this.institutionPage().total || 0,
|
||||
elements: this.institutionPage().elements || [],
|
||||
}));
|
||||
|
||||
sortingOptions: SelectorOption[] = [
|
||||
{ value: 'relevance', display_name: 'Relevanz' },
|
||||
{ value: 'name', display_name: 'Name' },
|
||||
|
||||
@@ -2,98 +2,59 @@
|
||||
<h1>Passende Projekte finden</h1>
|
||||
|
||||
<mat-divider />
|
||||
|
||||
<div style="padding: 0 1rem">
|
||||
<app-query-param-input
|
||||
label="Suche nach Namen"
|
||||
[debounceTime]="400"
|
||||
queryParamKey="search">
|
||||
</app-query-param-input>
|
||||
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
">
|
||||
<mat-chip-listbox
|
||||
[value]="urlChips()"
|
||||
(change)="handleChipBoxChange($event)"
|
||||
multiple>
|
||||
<mat-chip-option value="eu">EU</mat-chip-option>
|
||||
<mat-chip-option value="bund">BUND</mat-chip-option>
|
||||
<mat-chip-option value="dfg">DFG</mat-chip-option>
|
||||
</mat-chip-listbox>
|
||||
|
||||
<div class="sorting">
|
||||
<app-query-param-selector
|
||||
[options]="sortingOptions"
|
||||
queryParamKey="sort_by"
|
||||
label="Sortieren nach" />
|
||||
|
||||
<app-query-param-selector
|
||||
[options]="sortingDirectionOptions"
|
||||
queryParamKey="sorting_order"
|
||||
label="Sortierreihenfolge" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<mat-divider />
|
||||
|
||||
@let fundingProjectPageValue = fundingProjectPage();
|
||||
|
||||
@if (
|
||||
fundingProjectPageValue.elements &&
|
||||
fundingProjectPageValue.elements.length > 0
|
||||
) {
|
||||
<div class="cards">
|
||||
@for (fundingProject of fundingProjectPageValue.elements; track $index) {
|
||||
<mat-card
|
||||
class="card"
|
||||
appearance="outlined"
|
||||
[routerLink]="getDetaiLink(fundingProject)">
|
||||
<mat-card-header>
|
||||
<mat-card-title>{{ fundingProject.title }}</mat-card-title>
|
||||
<mat-card-subtitle>{{
|
||||
fundingProject.type | uppercase
|
||||
}}</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-card-content class="card-content">
|
||||
<mat-divider />
|
||||
<div class="card-metadata">
|
||||
<span
|
||||
>Von {{ fundingProject.start_date | date: 'dd.MM.yyyy' }} bis
|
||||
{{ fundingProject.end_date | date: 'dd.MM.yyyy' }}</span
|
||||
>
|
||||
</div>
|
||||
<mat-divider />
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-footer>
|
||||
<mat-card-actions>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="getDetaiLink(fundingProject)"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>info</mat-icon>
|
||||
Übersicht
|
||||
</a>
|
||||
</mat-card-actions>
|
||||
</mat-card-footer>
|
||||
</mat-card>
|
||||
}
|
||||
</div>
|
||||
} @else {
|
||||
<div class="no-results">
|
||||
<p>Keine passenden Projekte gefunden.</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
<mat-divider />
|
||||
|
||||
<app-query-param-paginator
|
||||
[total]="fundingProjectPageValue.total || 0"
|
||||
[pageSizeOptions]="[10, 25, 50]" />
|
||||
<app-card-search
|
||||
[page]="page()"
|
||||
[cardTmp]="cardTmp"
|
||||
[additionalFiltersTmp]="additionalFiltersTmp"
|
||||
[cardMinWidth]="380"
|
||||
[sortingOptions]="sortingOptions"
|
||||
[sortingDirectionOptions]="sortingDirectionOptions"
|
||||
searchLabel="Suche nach Namen" />
|
||||
</div>
|
||||
|
||||
<ng-template #cardTmp let-element>
|
||||
<mat-card
|
||||
class="card"
|
||||
appearance="outlined"
|
||||
[routerLink]="getDetaiLink(element)">
|
||||
<mat-card-header>
|
||||
<mat-card-title>{{ element.title }}</mat-card-title>
|
||||
<mat-card-subtitle>{{ element.type | uppercase }}</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-card-content class="card-content">
|
||||
<mat-divider />
|
||||
<div class="card-metadata">
|
||||
<span
|
||||
>Von {{ element.start_date | date: 'dd.MM.yyyy' }} bis
|
||||
{{ element.end_date | date: 'dd.MM.yyyy' }}</span
|
||||
>
|
||||
</div>
|
||||
<mat-divider />
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-footer>
|
||||
<mat-card-actions>
|
||||
<a
|
||||
mat-button
|
||||
[routerLink]="getDetaiLink(element)"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>info</mat-icon>
|
||||
Übersicht
|
||||
</a>
|
||||
</mat-card-actions>
|
||||
</mat-card-footer>
|
||||
</mat-card>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #additionalFiltersTmp>
|
||||
<mat-chip-listbox
|
||||
[value]="urlChips()"
|
||||
(change)="handleChipBoxChange($event)"
|
||||
multiple
|
||||
style="padding: 0rem 1rem">
|
||||
<mat-chip-option value="eu">EU</mat-chip-option>
|
||||
<mat-chip-option value="bund">BUND</mat-chip-option>
|
||||
<mat-chip-option value="dfg">DFG</mat-chip-option>
|
||||
</mat-chip-listbox>
|
||||
</ng-template>
|
||||
|
||||
@@ -5,23 +5,6 @@
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.sorting {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.sorting select {
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: var(--sg-radius-sm);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.sorting select:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
@@ -29,10 +12,6 @@
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
mat-paginator {
|
||||
background-color: var(--sg-background);
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 0.5rem;
|
||||
background-color: var(--sg-background);
|
||||
@@ -76,12 +55,6 @@ mat-card-actions a {
|
||||
border-radius: var(--sg-radius-sm);
|
||||
}
|
||||
|
||||
.no-results {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
color: var(--sg-text-secondary);
|
||||
}
|
||||
|
||||
.mat-mdc-standard-chip {
|
||||
border-radius: var(--sg-radius-sm);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, input, signal } from '@angular/core';
|
||||
import { Component, computed, input, signal } from '@angular/core';
|
||||
import { FundingProject, FundingProjectPage, ProjectType } from '../../api';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@@ -8,12 +8,12 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { DatePipe, UpperCasePipe } from '@angular/common';
|
||||
import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips';
|
||||
import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component';
|
||||
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
|
||||
|
||||
import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component';
|
||||
import {
|
||||
QueryParamSelectorComponent,
|
||||
SelectorOption,
|
||||
} from '../../shared/ui/query-param-selector/query-param-selector.component';
|
||||
CardSearchComponent,
|
||||
Page,
|
||||
} from '../../shared/ui/card-search/card-search.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-projects',
|
||||
@@ -26,9 +26,7 @@ import {
|
||||
UpperCasePipe,
|
||||
DatePipe,
|
||||
MatChipsModule,
|
||||
QueryParamInputComponent,
|
||||
QueryParamPaginatorComponent,
|
||||
QueryParamSelectorComponent,
|
||||
CardSearchComponent,
|
||||
],
|
||||
templateUrl: './projects.component.html',
|
||||
styleUrl: './projects.component.scss',
|
||||
@@ -36,6 +34,13 @@ import {
|
||||
export class ProjectsComponent {
|
||||
fundingProjectPage = input.required<FundingProjectPage>();
|
||||
|
||||
page = computed<Page>(() => ({
|
||||
page: this.fundingProjectPage().page || 0,
|
||||
size: this.fundingProjectPage().size || 10,
|
||||
total: this.fundingProjectPage().total || 0,
|
||||
elements: this.fundingProjectPage().elements || [],
|
||||
}));
|
||||
|
||||
urlChips = signal<ProjectType[]>(['eu', 'bund', 'dfg']);
|
||||
|
||||
sortingOptions: SelectorOption[] = [{ value: 'title', display_name: 'Name' }];
|
||||
@@ -72,13 +77,14 @@ export class ProjectsComponent {
|
||||
|
||||
getDetaiLink(fundingProject: FundingProject): string | null {
|
||||
if (fundingProject.type === 'bund') {
|
||||
const encodedId = encodeURIComponent(fundingProject.id)
|
||||
const encodedId = encodeURIComponent(fundingProject.id);
|
||||
return '/projects/bund/' + encodedId;
|
||||
} else if (fundingProject.type === 'dfg') {
|
||||
return '/projects/dfg/' + fundingProject.id;
|
||||
} else if (fundingProject.type === 'eu') {
|
||||
return '/projects/eu/' + fundingProject.id;
|
||||
} else
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<div class="card-search">
|
||||
<div class="card-search-filter">
|
||||
@if (withSearch()) {
|
||||
<app-query-param-input
|
||||
[label]="searchLabel()"
|
||||
[debounceTime]="400"
|
||||
[queryParamKey]="searchQueryParamKey()"
|
||||
style="width: 100%" />
|
||||
}
|
||||
@if (sortingOptions() && sortingOptions()!.length > 0) {
|
||||
<app-query-param-selector
|
||||
[options]="sortingOptions()!"
|
||||
[queryParamKey]="sortByQueryParamKey()"
|
||||
[label]="sortByLabel()" />
|
||||
}
|
||||
|
||||
@if (sortingDirectionOptions() && sortingDirectionOptions()!.length > 0) {
|
||||
<app-query-param-selector
|
||||
[options]="sortingDirectionOptions()!"
|
||||
[queryParamKey]="sortingDirectionQueryParamKey()"
|
||||
[label]="sortingDirectionLabel()" />
|
||||
}
|
||||
</div>
|
||||
@if (additionalFiltersTmp()) {
|
||||
<ng-container [ngTemplateOutlet]="additionalFiltersTmp()"></ng-container>
|
||||
}
|
||||
|
||||
<mat-divider />
|
||||
@let pageValue = page();
|
||||
@if (pageValue.elements && pageValue.elements.length > 0) {
|
||||
<div class="cards" [style.--card-min-width.px]="cardMinWidth()">
|
||||
@for (element of pageValue.elements; track $index) {
|
||||
<ng-container
|
||||
[ngTemplateOutlet]="cardTmp()"
|
||||
[ngTemplateOutletContext]="{ $implicit: element }">
|
||||
</ng-container>
|
||||
}
|
||||
</div>
|
||||
<mat-divider />
|
||||
} @else {
|
||||
@if (this.noResultsTmp()) {
|
||||
<ng-container [ngTemplateOutlet]="noResultsTmp()"></ng-container>
|
||||
} @else {
|
||||
<div class="no-results">
|
||||
<span>Keine Ergebnisse gefunden.</span>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<div class="pagination">
|
||||
<app-query-param-paginator
|
||||
[pageSizeOptions]="[10, 25, 100]"
|
||||
[total]="page().total" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
.card-search {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.card-search-filter {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 1rem;
|
||||
padding: 0rem 1rem;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr));
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
padding: 0rem 1rem;
|
||||
}
|
||||
|
||||
.no-results {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
color: var(--sg-text-secondary);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { Component, input, TemplateRef } from '@angular/core';
|
||||
import { QueryParamInputComponent } from '../query-param-input/query-param-input.component';
|
||||
import {
|
||||
QueryParamSelectorComponent,
|
||||
SelectorOption,
|
||||
} from '../query-param-selector/query-param-selector.component';
|
||||
import { MatDivider } from '@angular/material/divider';
|
||||
import { QueryParamPaginatorComponent } from '../query-param-paginator/query-param-paginator.component';
|
||||
import { NgTemplateOutlet } from '@angular/common';
|
||||
|
||||
export type Page = {
|
||||
page: number;
|
||||
size: number;
|
||||
total: number;
|
||||
elements: any[];
|
||||
};
|
||||
|
||||
@Component({
|
||||
selector: 'app-card-search',
|
||||
imports: [
|
||||
QueryParamInputComponent,
|
||||
QueryParamSelectorComponent,
|
||||
MatDivider,
|
||||
QueryParamPaginatorComponent,
|
||||
NgTemplateOutlet,
|
||||
],
|
||||
templateUrl: './card-search.component.html',
|
||||
styleUrl: './card-search.component.scss',
|
||||
})
|
||||
export class CardSearchComponent {
|
||||
cardTmp = input.required<TemplateRef<any>>();
|
||||
additionalFiltersTmp = input<TemplateRef<any>>();
|
||||
noResultsTmp = input<TemplateRef<any>>();
|
||||
|
||||
|
||||
cardMinWidth = input<number>(300);
|
||||
|
||||
page = input.required<Page>();
|
||||
|
||||
withSearch = input<boolean>(true);
|
||||
searchLabel = input<string>('Suchen');
|
||||
searchQueryParamKey = input<string>('search');
|
||||
|
||||
sortingOptions = input<SelectorOption[]>();
|
||||
sortByQueryParamKey = input<string>('sort_by');
|
||||
sortByLabel = input<string>('Sortieren nach');
|
||||
sortingDirectionOptions = input<SelectorOption[]>();
|
||||
sortingDirectionQueryParamKey = input<string>('sorting_order');
|
||||
sortingDirectionLabel = input<string>('Sortierreihenfolge');
|
||||
}
|
||||
Reference in New Issue
Block a user