fixes after ng update

This commit is contained in:
2024-02-11 17:37:50 +01:00
parent d71bd41495
commit 2f5a732ffc
27 changed files with 115 additions and 145 deletions

View File

@@ -25,7 +25,7 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import {CdkDragDrop, moveItemInArray} from '@angular/cdk/drag-drop';
import {fade} from '../../../animations';
import {MatLegacyDialog as MatDialog} from '@angular/material/legacy-dialog';
import {MatDialog} from '@angular/material/dialog';
import {ArchiveDialogComponent} from '../dialog/archive-dialog/archive-dialog.component';
import {closeFullscreen, openFullscreen} from '../../../services/fullscreen';

View File

@@ -7,9 +7,10 @@
<div *ngIf="!show.published && !fullscreen" class="song">
<span class="title">{{ iSong.title }}</span>
<span *ngIf="!edit" class="keys">
<span *ngIf="iSong.keyOriginal !== iSong.key">{{ iSong.keyOriginal }}&nbsp;&nbsp;</span>
<mat-form-field *ngIf="keys" appearance="standard" class="keys">
<mat-select [formControl]="keyFormControl">
<span *ngIf="iSong.keyOriginal !== iSong.key">{{ iSong.keyOriginal }}&nbsp;&nbsp;</span><span
(click)="openKeySelect()">{{ iSong.key }}</span>
<mat-form-field (click)="option.open()" *ngIf="keys" class="transpose">
<mat-select #option [formControl]="keyFormControl">
<mat-option *ngFor="let key of keys" [value]="key">{{ key }}</mat-option>
</mat-select>
</mat-form-field>

View File

@@ -17,8 +17,18 @@
}
.keys {
width: 40px;
margin: -24px 0 -20px 0;
position: relative;
margin-right: 10px;
cursor: pointer;
&:hover {
color: var(--color-primary);
}
}
.transpose {
height: 0;
position: absolute;
}
.btn-up {
@@ -54,6 +64,7 @@
grid-area: delete;
justify-content: flex-end;
}
.btn-edit {
grid-area: edit;
justify-content: flex-end;

View File

@@ -1,4 +1,4 @@
import {Component, Input, OnInit} from '@angular/core';
import {Component, Input, OnInit, ViewChild} from '@angular/core';
import {ShowSongService} from '../../services/show-song.service';
import {ShowSong} from '../../services/show-song';
import {getScale} from '../../../songs/services/key.helper';
@@ -7,6 +7,7 @@ import {ChordMode} from '../../../../widget-modules/components/song-text/song-te
import {Show} from '../../services/show';
import {faEraser, faPenToSquare, faSave, faTrash} from '@fortawesome/free-solid-svg-icons';
import {fade} from '../../../../animations';
import {MatSelect} from '@angular/material/select';
@Component({
selector: 'app-song',
@@ -21,6 +22,8 @@ export class SongComponent implements OnInit {
@Input() public index = -1;
@Input() public fullscreen = false;
@ViewChild('option') private keyOptions: MatSelect;
public keys: string[] = [];
public faDelete = faTrash;
public faEdit = faPenToSquare;
@@ -75,4 +78,8 @@ export class SongComponent implements OnInit {
chordMode: value,
});
}
public openKeySelect(): void {
this.keyOptions.open();
}
}