komponents erstellen
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<p>kpi-card works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-kpi-card',
|
||||
imports: [],
|
||||
templateUrl: './kpi-card.component.html',
|
||||
styleUrl: './kpi-card.component.css'
|
||||
})
|
||||
export class KpiCardComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>form-field works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-form-field',
|
||||
imports: [],
|
||||
templateUrl: './form-field.component.html',
|
||||
styleUrl: './form-field.component.css'
|
||||
})
|
||||
export class FormFieldComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>slide-toggle works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-slide-toggle',
|
||||
imports: [],
|
||||
templateUrl: './slide-toggle.component.html',
|
||||
styleUrl: './slide-toggle.component.css'
|
||||
})
|
||||
export class SlideToggleComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>page-header works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-header',
|
||||
imports: [],
|
||||
templateUrl: './page-header.component.html',
|
||||
styleUrl: './page-header.component.css'
|
||||
})
|
||||
export class PageHeaderComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>search-bar works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-search-bar',
|
||||
imports: [],
|
||||
templateUrl: './search-bar.component.html',
|
||||
styleUrl: './search-bar.component.css'
|
||||
})
|
||||
export class SearchBarComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>user-profile works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-user-profile',
|
||||
imports: [],
|
||||
templateUrl: './user-profile.component.html',
|
||||
styleUrl: './user-profile.component.css'
|
||||
})
|
||||
export class UserProfileComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>dialog works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dialog',
|
||||
imports: [],
|
||||
templateUrl: './dialog.component.html',
|
||||
styleUrl: './dialog.component.css'
|
||||
})
|
||||
export class DialogComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>menu works!</p>
|
||||
11
src/app/shared/components/overlays/menu/menu.component.ts
Normal file
11
src/app/shared/components/overlays/menu/menu.component.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
imports: [],
|
||||
templateUrl: './menu.component.html',
|
||||
styleUrl: './menu.component.css'
|
||||
})
|
||||
export class MenuComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/* src\app\shared\snackbar\components\snackbar-container\snackbar-container.component.css */
|
||||
/* Stile, die NUR für den Container gelten */
|
||||
.snackbar-container-wrapper {
|
||||
position: fixed;
|
||||
bottom: 2rem;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 1050;
|
||||
width: 350px;
|
||||
max-width: 90vw;
|
||||
height: 300px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.snackbar-container-wrapper.position-top {
|
||||
bottom: auto;
|
||||
top: 2rem;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="snackbar-container-wrapper" [class.position-top]="(position$ | async) === 'top'">
|
||||
<app-snackbar
|
||||
*ngFor="let snack of (snackbars$ | async); let i = index"
|
||||
[message]="snack.message"
|
||||
[style]="getSnackbarStyle(i, snack.state, (position$ | async)!)"
|
||||
(close)="closeSnackbar(snack.id)">
|
||||
</app-snackbar>
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Snackbar, SnackbarService } from '../../services/snackbar.service';
|
||||
import { SnackbarComponent } from '../snackbar/snackbar.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-snackbar-container',
|
||||
standalone: true,
|
||||
imports: [CommonModule, SnackbarComponent],
|
||||
templateUrl: './snackbar-container.component.html',
|
||||
styleUrl: './snackbar-container.component.css'
|
||||
})
|
||||
export class SnackbarContainerComponent {
|
||||
snackbars$: Observable<Snackbar[]>;
|
||||
position$: Observable<'top' | 'bottom'>;
|
||||
|
||||
constructor(private snackbarService: SnackbarService) {
|
||||
this.snackbars$ = this.snackbarService.snackbars$;
|
||||
this.position$ = this.snackbarService.position$;
|
||||
}
|
||||
|
||||
// Diese Methode gehört hierher, da der Container die Position aller Kinder kennen muss.
|
||||
getSnackbarStyle(index: number, state: 'visible' | 'fading', position: 'top' | 'bottom'): { [key: string]: any } {
|
||||
const snackbarHeight = 75;
|
||||
const verticalOffset = index * snackbarHeight;
|
||||
const positionProperty = position === 'bottom' ? 'bottom' : 'top';
|
||||
|
||||
const opacity = 1 - (index * 0.2);
|
||||
const scale = 1 - (index * 0.02);
|
||||
|
||||
const visibleStyle = {
|
||||
[positionProperty]: `${verticalOffset}px`,
|
||||
'opacity': opacity,
|
||||
'transform': `scale(${scale})`,
|
||||
'z-index': 1000 - index
|
||||
};
|
||||
const fadingStyle = { ...visibleStyle, 'opacity': 0, 'transform': 'scale(0.8)' };
|
||||
|
||||
return state === 'visible' ? visibleStyle : fadingStyle;
|
||||
}
|
||||
|
||||
closeSnackbar(id: number): void {
|
||||
this.snackbarService.close(id);
|
||||
}
|
||||
}
|
||||
47
src/app/shared/components/snackbar/snackbar.component.css
Normal file
47
src/app/shared/components/snackbar/snackbar.component.css
Normal file
@@ -0,0 +1,47 @@
|
||||
/* src\app\shared\snackbar\components\snackbar\snackbar.component.css */
|
||||
/* Stile, die NUR für eine einzelne Snackbar gelten */
|
||||
:host {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 0.75rem;
|
||||
border-radius: var(--border-radius-md);
|
||||
background-color: var(--color-surface);
|
||||
color: var(--color-text);
|
||||
border: 1px solid var(--color-border);
|
||||
box-shadow: var(--box-shadow-md);
|
||||
pointer-events: auto;
|
||||
transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
.snackbar-icon-container {
|
||||
flex-shrink: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background-color: #dcfce7;
|
||||
color: #166534;
|
||||
}
|
||||
:host-context(body.dark-theme) .snackbar-icon-container {
|
||||
background-color: #166534;
|
||||
color: #dcfce7;
|
||||
}
|
||||
.snackbar-message {
|
||||
flex-grow: 1;
|
||||
font-weight: 500;
|
||||
}
|
||||
.snackbar-close-btn {
|
||||
flex-shrink: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
font-size: 1.5rem;
|
||||
color: var(--color-text-light);
|
||||
}
|
||||
.snackbar-close-btn:hover {
|
||||
background-color: var(--color-body-bg);
|
||||
}
|
||||
10
src/app/shared/components/snackbar/snackbar.component.html
Normal file
10
src/app/shared/components/snackbar/snackbar.component.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="snackbar-icon-container">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
||||
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="snackbar-message">{{ message }}</span>
|
||||
<button class="btn btn-icon snackbar-close-btn" (click)="onClose()" data-tooltip="Schließen">
|
||||
×
|
||||
</button>
|
||||
17
src/app/shared/components/snackbar/snackbar.component.ts
Normal file
17
src/app/shared/components/snackbar/snackbar.component.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-snackbar',
|
||||
standalone: true,
|
||||
imports: [],
|
||||
templateUrl: './snackbar.component.html',
|
||||
styleUrl: './snackbar.component.css'
|
||||
})
|
||||
export class SnackbarComponent {
|
||||
@Input() message: string = '';
|
||||
@Output() close = new EventEmitter<void>();
|
||||
|
||||
onClose() {
|
||||
this.close.emit();
|
||||
}
|
||||
}
|
||||
1
src/app/shared/components/ui/alert/alert.component.html
Normal file
1
src/app/shared/components/ui/alert/alert.component.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>alert works!</p>
|
||||
11
src/app/shared/components/ui/alert/alert.component.ts
Normal file
11
src/app/shared/components/ui/alert/alert.component.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-alert',
|
||||
imports: [],
|
||||
templateUrl: './alert.component.html',
|
||||
styleUrl: './alert.component.css'
|
||||
})
|
||||
export class AlertComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>button works!</p>
|
||||
11
src/app/shared/components/ui/button/button.component.ts
Normal file
11
src/app/shared/components/ui/button/button.component.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-button',
|
||||
imports: [],
|
||||
templateUrl: './button.component.html',
|
||||
styleUrl: './button.component.css'
|
||||
})
|
||||
export class ButtonComponent {
|
||||
|
||||
}
|
||||
1
src/app/shared/components/ui/card/card.component.html
Normal file
1
src/app/shared/components/ui/card/card.component.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>card works!</p>
|
||||
11
src/app/shared/components/ui/card/card.component.ts
Normal file
11
src/app/shared/components/ui/card/card.component.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-card',
|
||||
imports: [],
|
||||
templateUrl: './card.component.html',
|
||||
styleUrl: './card.component.css'
|
||||
})
|
||||
export class CardComponent {
|
||||
|
||||
}
|
||||
1
src/app/shared/components/ui/chip/chip.component.html
Normal file
1
src/app/shared/components/ui/chip/chip.component.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>chip works!</p>
|
||||
11
src/app/shared/components/ui/chip/chip.component.ts
Normal file
11
src/app/shared/components/ui/chip/chip.component.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chip',
|
||||
imports: [],
|
||||
templateUrl: './chip.component.html',
|
||||
styleUrl: './chip.component.css'
|
||||
})
|
||||
export class ChipComponent {
|
||||
|
||||
}
|
||||
1
src/app/shared/components/ui/icon/icon.component.html
Normal file
1
src/app/shared/components/ui/icon/icon.component.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>icon works!</p>
|
||||
11
src/app/shared/components/ui/icon/icon.component.ts
Normal file
11
src/app/shared/components/ui/icon/icon.component.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-icon',
|
||||
imports: [],
|
||||
templateUrl: './icon.component.html',
|
||||
styleUrl: './icon.component.css'
|
||||
})
|
||||
export class IconComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>status-pill works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-status-pill',
|
||||
imports: [],
|
||||
templateUrl: './status-pill.component.html',
|
||||
styleUrl: './status-pill.component.css'
|
||||
})
|
||||
export class StatusPillComponent {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user