update angular

This commit is contained in:
2025-01-02 15:01:59 +01:00
parent 73d3ecfd42
commit 802c309679
199 changed files with 13745 additions and 11691 deletions

View File

@@ -25,9 +25,10 @@
[class.chord]="line.type === 0"
[class.disabled]="checkDisabled(i)"
class="line"
>{{ line.text }}</div>
>{{ line.text }}
</div>
</div>
<div class="error" *ngIf="sections.length===0">
<div *ngIf="sections.length===0" class="error">
Es wurden keine Liedabschnitte gefunden! Bitte mindestens einen Abschnitt festlegen!
</div>
</div>
@@ -52,7 +53,7 @@
</button>
<div [class.offset]="fullscreen" [style.top.px]="offset + 50">
<h1 *ngIf="header">{{header}}</h1>
<h1 *ngIf="header">{{ header }}</h1>
<div
#section
*ngFor="let section of sections; let i = index"
@@ -64,7 +65,8 @@
[class.chord]="line.type === 0"
[class.disabled]="checkDisabled(i)"
class="line"
>{{ line.text.trim() }}</div>
>{{ line.text.trim() }}
</div>
</div>
</div>

View File

@@ -11,7 +11,7 @@ describe('SongTextComponent', () => {
void TestBed.configureTestingModule({
declarations: [SongTextComponent],
}).compileComponents();
})
}),
);
beforeEach(() => {

View File

@@ -1,4 +1,14 @@
import {ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnInit, Output, QueryList, ViewChildren} from '@angular/core';
import {
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
OnInit,
Output,
QueryList,
ViewChildren,
} from '@angular/core';
import {TextRenderingService} from '../../../modules/songs/services/text-rendering.service';
import {faGripLines} from '@fortawesome/free-solid-svg-icons';
import {songSwitch} from './animation';
@@ -15,6 +25,7 @@ export type ChordMode = 'show' | 'hide' | 'onlyFirst';
templateUrl: './song-text.component.html',
styleUrls: ['./song-text.component.less'],
animations: [songSwitch],
standalone: false,
})
export class SongTextComponent implements OnInit {
public sections: Section[] = [];
@@ -30,7 +41,8 @@ export class SongTextComponent implements OnInit {
private iText = '';
private iTranspose: TransposeMode | null = null;
public constructor(private textRenderingService: TextRenderingService, private elRef: ElementRef<HTMLElement>, private cRef: ChangeDetectorRef) {}
public constructor(private textRenderingService: TextRenderingService, private elRef: ElementRef<HTMLElement>, private cRef: ChangeDetectorRef) {
}
@Input()
public set chordMode(value: ChordMode) {
@@ -61,20 +73,6 @@ export class SongTextComponent implements OnInit {
}, 100);
}
private render() {
this.offset = 0;
this.sections = [];
if (this.fullscreen) {
setTimeout(() => {
this.sections = this.textRenderingService.parse(this.iText, this.iTranspose);
this.cRef.markForCheck();
}, 100);
} else {
this.sections = this.textRenderingService.parse(this.iText, this.iTranspose); //.sort((a, b) => a.type - b.type);
this.cRef.markForCheck();
}
}
public getLines(section: Section): Line[] {
return section.lines.filter(_ => {
if (_.type !== LineType.chord) {
@@ -108,6 +106,20 @@ export class SongTextComponent implements OnInit {
return this.index !== -1 && this.index !== i;
}
private render() {
this.offset = 0;
this.sections = [];
if (this.fullscreen) {
setTimeout(() => {
this.sections = this.textRenderingService.parse(this.iText, this.iTranspose);
this.cRef.markForCheck();
}, 100);
} else {
this.sections = this.textRenderingService.parse(this.iText, this.iTranspose); //.sort((a, b) => a.type - b.type);
this.cRef.markForCheck();
}
}
private getNextChordMode(): ChordMode {
switch (this.iChordMode) {
case 'show':

View File

@@ -9,4 +9,5 @@ import {MatButtonModule} from '@angular/material/button';
exports: [SongTextComponent],
imports: [CommonModule, FontAwesomeModule, MatButtonModule],
})
export class SongTextModule {}
export class SongTextModule {
}