From e4b26961b0fd48e054baa0d120ba5ccebeab861b Mon Sep 17 00:00:00 2001 From: Hlars Date: Tue, 8 Jul 2025 07:51:06 +0200 Subject: [PATCH] stuff --- src/app/app.component.html | 10 + src/app/app.component.ts | 251 +++++++++++++++--- src/app/gantt/gantt.component.html | 13 +- src/app/gantt/gantt.component.scss | 20 +- src/app/gantt/gantt.component.ts | 73 ++++- src/app/gantt/views/base.ts | 5 +- ...oss-net-calculator-input.directive.spec.ts | 8 + .../gross-net-calculator-input.directive.ts | 63 +++++ .../gross-net-calculator.component.html | 34 +++ .../gross-net-calculator.component.scss | 0 .../gross-net-calculator.component.spec.ts | 23 ++ .../gross-net-calculator.component.ts | 13 + .../toggle-button.component.html | 4 + .../toggle-button.component.scss | 0 .../toggle-button.component.spec.ts | 23 ++ .../toggle-button/toggle-button.component.ts | 14 + .../progress-stepper.component.html | 2 +- src/styles.scss | 10 +- 18 files changed, 507 insertions(+), 59 deletions(-) create mode 100644 src/app/gross-net-calculator/gross-net-calculator-input.directive.spec.ts create mode 100644 src/app/gross-net-calculator/gross-net-calculator-input.directive.ts create mode 100644 src/app/gross-net-calculator/gross-net-calculator.component.html create mode 100644 src/app/gross-net-calculator/gross-net-calculator.component.scss create mode 100644 src/app/gross-net-calculator/gross-net-calculator.component.spec.ts create mode 100644 src/app/gross-net-calculator/gross-net-calculator.component.ts create mode 100644 src/app/gross-net-calculator/toggle-button/toggle-button.component.html create mode 100644 src/app/gross-net-calculator/toggle-button/toggle-button.component.scss create mode 100644 src/app/gross-net-calculator/toggle-button/toggle-button.component.spec.ts create mode 100644 src/app/gross-net-calculator/toggle-button/toggle-button.component.ts diff --git a/src/app/app.component.html b/src/app/app.component.html index 03412db..a22645d 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -37,6 +37,16 @@
Comment Value: {{parseComment(form)}}
+
+ + Currency Input + + + +
Value: {{currencyFormControl.value}}
+ +
+ Choose an option diff --git a/src/app/app.component.ts b/src/app/app.component.ts index dc8877d..34efc94 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,11 +1,10 @@ import { Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; -import { CommentBoxComponent } from "./comment-box/comment-box.component"; +import { CommentBoxComponent, MentionItem } from "./comment-box/comment-box.component"; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; -import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { ProgressStepperComponent } from "./progress-stepper/progress-stepper.component"; -import { Observable, startWith, map } from 'rxjs'; import { MatOptionModule } from '@angular/material/core'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { MatChipsModule } from '@angular/material/chips'; @@ -19,10 +18,11 @@ import { GanttComponent, GanttItem } from "./gantt/gantt.component"; import { GrossNetCalculatorComponent } from "./gross-net-calculator/gross-net-calculator.component"; import { GrossNetCalculatorInputDirective } from './gross-net-calculator/gross-net-calculator-input.directive'; import { GrossNetCalculatorToggleButtonComponent } from "./gross-net-calculator/toggle-button/toggle-button.component"; +import { CurrencyInputComponent } from "./currency-input/currency-input.component"; @Component({ selector: 'app-root', - imports: [RouterOutlet, MatToolbarModule, GrossNetCalculatorInputDirective, MatIconModule, MatButtonModule, CommentBoxComponent, MatFormFieldModule, MatInputModule, ReactiveFormsModule, ProgressStepperComponent, MatOptionModule, MatSelectModule, MatAutocompleteModule, MatChipsModule, AsyncPipe, FormsModule, SelectFilterComponent, GanttComponent, GrossNetCalculatorComponent, GrossNetCalculatorToggleButtonComponent], + imports: [RouterOutlet, MatToolbarModule, GrossNetCalculatorInputDirective, MatIconModule, MatButtonModule, CommentBoxComponent, MatFormFieldModule, MatInputModule, ReactiveFormsModule, ProgressStepperComponent, MatOptionModule, MatSelectModule, MatAutocompleteModule, MatChipsModule, AsyncPipe, FormsModule, SelectFilterComponent, GanttComponent, GrossNetCalculatorComponent, GrossNetCalculatorToggleButtonComponent, CurrencyInputComponent], providers: [GrossNetCalculatorInputDirective], templateUrl: './app.component.html', styleUrl: './app.component.scss' @@ -30,9 +30,11 @@ import { GrossNetCalculatorToggleButtonComponent } from "./gross-net-calculator/ export class AppComponent { title = 'material-mentions'; - selectionList = ["Franz Kaiser", "Melanie Ochse", "Peter Pfeifer", "Hans Wurst", "Hans Ochse", "Max Hintern", "Hansi Hinterseer", "Gustav Gans"]; + selectionList: MentionItem[] = [{ title: "Franz Kaiser" }, { title: "Melanie Ochse", color: 'red' }, { title: "Peter Pfeifer" }, { title: "Hans Wurst" }, { title: "Hans Ochse" }, { title: "Max Hintern" }, { title: "Hansi Hinterseer" }, { title: "Gustav Gans" }]; form = new FormControl("fdaf
@Franz Kaiser
 "); + + currencyFormControl = new FormControl(null, [Validators.required]); test = ''; parseComment(comment: FormControl): any { @@ -56,43 +58,224 @@ export class AppComponent { ganttItems: GanttItem[] = [{ id: '000', title: 'Test 1', - items: [{ - title: '124', - start: 1743487875, - duration_sec: 7200, - }, { - title: 'F242', - start: 1743660675, - duration_sec: 16 * 3600, - } + items: [ + { + "title": "dznAFoN", + "orig_start": 1735718400, + "orig_end": 1735790400, + "duration": 72000, + "start": 1735718400, + "end": 1735920000, + "effective_duration": 201600 + }, + { + "title": "FddMLSo", + "orig_start": 1735693200, + "orig_end": 1735758000, + "duration": 64800, + "start": 1735920000, + "end": 1736337600, + "effective_duration": 417600 + }, + { + "title": "I8UNM7Q", + "orig_start": 1735704000, + "orig_end": 1735714800, + "duration": 10800, + "start": 1736337600, + "end": 1736352000, + "effective_duration": 14400 + }, + { + "title": "lDpkEvQ", + "orig_start": 1735700400, + "orig_end": 1735765200, + "duration": 64800, + "start": 1736352000, + "end": 1736769600, + "effective_duration": 417600 + }, + { + "title": "j3awoij", + "orig_start": 1735689600, + "orig_end": 1735747200, + "duration": 57600, + "start": 1736769600, + "end": 1736953200, + "effective_duration": 183600 + }, + { + "title": "6Em6nMj", + "orig_start": 1735689600, + "orig_end": 1735714800, + "duration": 25200, + "start": 1736953200, + "end": 1737039600, + "effective_duration": 86400 + }, + { + "title": "stzG5kS", + "orig_start": 1735700400, + "orig_end": 1735747200, + "duration": 46800, + "start": 1737039600, + "end": 1737381600, + "effective_duration": 342000 + }, + { + "title": "XqZVBX3", + "orig_start": 1735725600, + "orig_end": 1735729200, + "duration": 3600, + "start": 1737381600, + "end": 1737385200, + "effective_duration": 3600 + }, + { + "title": "YFLNNja", + "orig_start": 1735758000, + "orig_end": 1735815600, + "duration": 57600, + "start": 1737385200, + "end": 1737565200, + "effective_duration": 180000 + }, + { + "title": "mSP8cLK", + "orig_start": 1735786800, + "orig_end": 1735833600, + "duration": 46800, + "start": 1737565200, + "end": 1737734400, + "effective_duration": 169200 + }, + { + "title": "4Clgbi7", + "orig_start": 1735768800, + "orig_end": 1735772400, + "duration": 3600, + "start": 1737734400, + "end": 1737738000, + "effective_duration": 3600 + }, + { + "title": "zNEqjve", + "orig_start": 1735768800, + "orig_end": 1735815600, + "duration": 46800, + "start": 1737738000, + "end": 1738080000, + "effective_duration": 342000 + }, + { + "title": "JDWUyY4", + "orig_start": 1735804800, + "orig_end": 1735858800, + "duration": 54000, + "start": 1738080000, + "end": 1738256400, + "effective_duration": 176400 + }, + { + "title": "gzCfIBH", + "orig_start": 1735815600, + "orig_end": 1735869600, + "duration": 54000, + "start": 1738256400, + "end": 1738663200, + "effective_duration": 406800 + }, + { + "title": "9BcHUE1", + "orig_start": 1735819200, + "orig_end": 1735830000, + "duration": 10800, + "start": 1738663200, + "end": 1738677600, + "effective_duration": 14400 + }, + { + "title": "cqY6QW7", + "orig_start": 1735819200, + "orig_end": 1735891200, + "duration": 72000, + "start": 1738677600, + "end": 1738929600, + "effective_duration": 252000 + }, + { + "title": "kWlI5wm", + "orig_start": 1735758000, + "orig_end": 1735776000, + "duration": 18000, + "start": 1738929600, + "end": 1739181600, + "effective_duration": 252000 + }, + { + "title": "KGHy9oL", + "orig_start": 1735797600, + "orig_end": 1735869600, + "duration": 72000, + "start": 1739181600, + "end": 1739379600, + "effective_duration": 198000 + }, + { + "title": "1yTL2to", + "orig_start": 1735826400, + "orig_end": 1735898400, + "duration": 72000, + "start": 1739379600, + "end": 1739808000, + "effective_duration": 428400 + }, + { + "title": "JuVrwIN", + "orig_start": 1735844400, + "orig_end": 1735916400, + "duration": 72000, + "start": 1739808000, + "end": 1740063600, + "effective_duration": 255600 + } ] }, { id: '001', title: 'Test 2', items: [{ - title: '124', - start: 1743487875, - duration_sec: 7200, - }, { - title: 'F242', - start: 1743660675, - duration_sec: 72000, + "title": "", + "orig_start": 1735898400, + "orig_end": 1735934400, + "duration": 36000, + "start": 1738335600, + "end": 1738663200, + "effective_duration": 327600 + }, + { + "title": "", + "orig_start": 1735938000, + "orig_end": 1735984800, + "duration": 46800, + "start": 1738663200, + "end": 1738774800, + "effective_duration": 111600 } ] }, - { - id: 'dfaf', - title: 'WeekTest', - items: [ - { title: '1', start: 1744005600, duration_sec: 72000 }, - { title: '2', start: 1744092000, duration_sec: 72000 }, - { title: '3', start: 1744178400, duration_sec: 72000 }, - { title: '4', start: 1744264800, duration_sec: 72000 }, - { title: '5', start: 1744351200, duration_sec: 72000 }, - { title: '6', start: 1744437600, duration_sec: 72000 }, - { title: '7', start: 1744524000, duration_sec: 72000 } - ] - } + // { + // id: 'dfaf', + // title: 'WeekTest', + // items: [ + // { title: '1', start: 1744005600, duration: 72000 }, + // { title: '2', start: 1744092000, duration: 72000 }, + // { title: '3', start: 1744178400, duration: 72000 }, + // { title: '4', start: 1744264800, duration: 72000 }, + // { title: '5', start: 1744351200, duration: 72000 }, + // { title: '6', start: 1744437600, duration: 72000 }, + // { title: '7', start: 1744524000, duration: 72000 } + // ] + // } ] } diff --git a/src/app/gantt/gantt.component.html b/src/app/gantt/gantt.component.html index 9fdac69..108de78 100644 --- a/src/app/gantt/gantt.component.html +++ b/src/app/gantt/gantt.component.html @@ -32,7 +32,7 @@ }} @for (bar of item.items; track $index) { -
{{bar.title}}
} @@ -120,7 +120,7 @@
@for (bar of item.items; track $index) { -
{{bar.title}}
} @@ -148,6 +148,13 @@
+
+
+ + +
+ +