chore(ui): clear eslint angular style guide bucket
Rename reader dialog outputs away from native DOM event names and convert the menu item component to an element selector so the remaining Angular style-guide lint rules are satisfied without changing behavior. Validation: just ui lint
This commit is contained in:
@@ -21,14 +21,14 @@
|
||||
@if (showNoteDialog) {
|
||||
<app-cbx-note-dialog
|
||||
[data]="noteDialogData"
|
||||
(save)="onNoteSave($event)"
|
||||
(cancel)="onNoteCancel()"
|
||||
(saved)="onNoteSave($event)"
|
||||
(cancelled)="onNoteCancel()"
|
||||
></app-cbx-note-dialog>
|
||||
}
|
||||
|
||||
@if (showShortcutsHelp) {
|
||||
<app-cbx-shortcuts-help
|
||||
(close)="onShortcutsHelpClose()"
|
||||
(closed)="onShortcutsHelpClose()"
|
||||
></app-cbx-shortcuts-help>
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ export class CbxNoteDialogComponent implements OnChanges {
|
||||
private readonly t = inject(TranslocoService);
|
||||
|
||||
@Input() data: CbxNoteDialogData | null = null;
|
||||
@Output() save = new EventEmitter<CbxNoteDialogResult>();
|
||||
@Output() cancel = new EventEmitter<void>();
|
||||
@Output() saved = new EventEmitter<CbxNoteDialogResult>();
|
||||
@Output() cancelled = new EventEmitter<void>();
|
||||
|
||||
noteContent = '';
|
||||
selectedColor = '#FFC107';
|
||||
@@ -57,7 +57,7 @@ export class CbxNoteDialogComponent implements OnChanges {
|
||||
|
||||
onSave(): void {
|
||||
if (this.noteContent.trim()) {
|
||||
this.save.emit({
|
||||
this.saved.emit({
|
||||
noteContent: this.noteContent.trim(),
|
||||
color: this.selectedColor
|
||||
});
|
||||
@@ -65,7 +65,7 @@ export class CbxNoteDialogComponent implements OnChanges {
|
||||
}
|
||||
|
||||
onCancel(): void {
|
||||
this.cancel.emit();
|
||||
this.cancelled.emit();
|
||||
}
|
||||
|
||||
selectColor(color: string): void {
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ interface ShortcutGroup {
|
||||
export class CbxShortcutsHelpComponent {
|
||||
private readonly t = inject(TranslocoService);
|
||||
|
||||
@Output() close = new EventEmitter<void>();
|
||||
@Output() closed = new EventEmitter<void>();
|
||||
|
||||
get shortcutGroups(): ShortcutGroup[] {
|
||||
return [
|
||||
@@ -70,7 +70,7 @@ export class CbxShortcutsHelpComponent {
|
||||
isMobile = window.innerWidth < 768;
|
||||
|
||||
onClose(): void {
|
||||
this.close.emit();
|
||||
this.closed.emit();
|
||||
}
|
||||
|
||||
onOverlayClick(event: MouseEvent): void {
|
||||
|
||||
@@ -14,7 +14,7 @@ import {UrlHelperService} from '../../../../shared/service/url-helper.service';
|
||||
})
|
||||
export class ReaderBookMetadataDialogComponent {
|
||||
@Input() book: Book | null = null;
|
||||
@Output() close = new EventEmitter<void>();
|
||||
@Output() closed = new EventEmitter<void>();
|
||||
|
||||
private urlHelperService = inject(UrlHelperService);
|
||||
private readonly t = inject(TranslocoService);
|
||||
|
||||
@@ -27,8 +27,8 @@ export interface NoteDialogResult {
|
||||
})
|
||||
export class ReaderNoteDialogComponent implements OnChanges {
|
||||
@Input() data: NoteDialogData | null = null;
|
||||
@Output() save = new EventEmitter<NoteDialogResult>();
|
||||
@Output() cancel = new EventEmitter<void>();
|
||||
@Output() saved = new EventEmitter<NoteDialogResult>();
|
||||
@Output() cancelled = new EventEmitter<void>();
|
||||
|
||||
noteContent = '';
|
||||
selectedColor = '#FFC107';
|
||||
@@ -55,7 +55,7 @@ export class ReaderNoteDialogComponent implements OnChanges {
|
||||
|
||||
onSave(): void {
|
||||
if (this.noteContent.trim()) {
|
||||
this.save.emit({
|
||||
this.saved.emit({
|
||||
noteContent: this.noteContent.trim(),
|
||||
color: this.selectedColor
|
||||
});
|
||||
@@ -63,7 +63,7 @@ export class ReaderNoteDialogComponent implements OnChanges {
|
||||
}
|
||||
|
||||
onCancel(): void {
|
||||
this.cancel.emit();
|
||||
this.cancelled.emit();
|
||||
}
|
||||
|
||||
selectColor(color: string): void {
|
||||
|
||||
@@ -25,7 +25,7 @@ export class ReaderSettingsDialogComponent implements OnInit {
|
||||
@Input() viewManager!: ReaderViewManagerService;
|
||||
@Input() bookId!: number;
|
||||
|
||||
@Output() close = new EventEmitter<void>();
|
||||
@Output() closed = new EventEmitter<void>();
|
||||
|
||||
activeTab: 'theme' | 'typography' | 'layout' = 'theme';
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ interface ShortcutGroup {
|
||||
styleUrls: ['./shortcuts-help.component.scss']
|
||||
})
|
||||
export class EbookShortcutsHelpComponent {
|
||||
@Output() close = new EventEmitter<void>();
|
||||
@Output() closed = new EventEmitter<void>();
|
||||
|
||||
private readonly t = inject(TranslocoService);
|
||||
|
||||
@@ -68,7 +68,7 @@ export class EbookShortcutsHelpComponent {
|
||||
isMobile = window.innerWidth < 768;
|
||||
|
||||
onClose(): void {
|
||||
this.close.emit();
|
||||
this.closed.emit();
|
||||
}
|
||||
|
||||
onOverlayClick(event: MouseEvent): void {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<app-reader-quick-settings
|
||||
[stateService]="stateService"
|
||||
[bookId]="bookId"
|
||||
(close)="showQuickSettings = false"
|
||||
(closed)="showQuickSettings = false"
|
||||
(openFullSettings)="showControls = true">
|
||||
</app-reader-quick-settings>
|
||||
}
|
||||
@@ -55,14 +55,14 @@
|
||||
[stateService]="stateService"
|
||||
[viewManager]="viewManager"
|
||||
[bookId]="bookId"
|
||||
(close)="showControls = false">
|
||||
(closed)="showControls = false">
|
||||
</app-settings-dialog>
|
||||
}
|
||||
|
||||
@if (showMetadata) {
|
||||
<app-reader-book-metadata-dialog
|
||||
[book]="book"
|
||||
(close)="showMetadata = false"
|
||||
(closed)="showMetadata = false"
|
||||
></app-reader-book-metadata-dialog>
|
||||
}
|
||||
|
||||
@@ -78,12 +78,12 @@
|
||||
@if (noteDialogState().visible) {
|
||||
<app-reader-note-dialog
|
||||
[data]="noteDialogState().data"
|
||||
(save)="onNoteSave($event)"
|
||||
(cancel)="onNoteCancel()"
|
||||
(saved)="onNoteSave($event)"
|
||||
(cancelled)="onNoteCancel()"
|
||||
></app-reader-note-dialog>
|
||||
}
|
||||
|
||||
@if (showShortcutsHelp) {
|
||||
<app-ebook-shortcuts-help (close)="showShortcutsHelp = false"></app-ebook-shortcuts-help>
|
||||
<app-ebook-shortcuts-help (closed)="showShortcutsHelp = false"></app-ebook-shortcuts-help>
|
||||
}
|
||||
</div>
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@ import {EbookViewerSetting} from '../../../../book/model/book.model';
|
||||
export class ReaderQuickSettingsComponent {
|
||||
@Input() stateService!: ReaderStateService;
|
||||
@Input() bookId!: number;
|
||||
@Output() close = new EventEmitter<void>();
|
||||
@Output() closed = new EventEmitter<void>();
|
||||
@Output() openFullSettings = new EventEmitter<void>();
|
||||
|
||||
constructor(private bookService: BookService) {}
|
||||
@@ -73,11 +73,11 @@ export class ReaderQuickSettingsComponent {
|
||||
}
|
||||
|
||||
onOpenFullSettings(): void {
|
||||
this.close.emit();
|
||||
this.closed.emit();
|
||||
this.openFullSettings.emit();
|
||||
}
|
||||
|
||||
onOverlayClick(): void {
|
||||
this.close.emit();
|
||||
this.closed.emit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@if (homeMenu(); as homeMenu) {
|
||||
@for (item of homeMenu; track item.label; let i = $index) {
|
||||
@if (!item.separator) {
|
||||
<li app-menuitem [item]="item" [index]="i" [root]="true" menuKey="home"></li>
|
||||
<app-menuitem [item]="item" [index]="i" [root]="true" menuKey="home"></app-menuitem>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@
|
||||
@if (libraryMenu(); as libraryMenu) {
|
||||
@for (item of libraryMenu; track item.label; let i = $index) {
|
||||
@if (!item.separator) {
|
||||
<li app-menuitem [item]="item" [index]="i" [root]="true" menuKey="library"></li>
|
||||
<app-menuitem [item]="item" [index]="i" [root]="true" menuKey="library"></app-menuitem>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
@if (shelfMenu(); as shelfMenu) {
|
||||
@for (item of shelfMenu; track item.label; let i = $index) {
|
||||
@if (!item.separator) {
|
||||
<li app-menuitem [item]="item" [index]="i" [root]="true" menuKey="shelf"></li>
|
||||
<app-menuitem [item]="item" [index]="i" [root]="true" menuKey="shelf"></app-menuitem>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@
|
||||
@if (magicShelfMenu(); as shelfMenu) {
|
||||
@for (item of shelfMenu; track item.label; let i = $index) {
|
||||
@if (!item.separator) {
|
||||
<li app-menuitem [item]="item" [index]="i" [root]="true" menuKey="magicShelf"></li>
|
||||
<app-menuitem [item]="item" [index]="i" [root]="true" menuKey="magicShelf"></app-menuitem>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
@if (item.items) {
|
||||
<ul>
|
||||
@for (child of item.items; track child.routerLink?.[0] ?? child.label; let i = $index) {
|
||||
<li app-menuitem [item]="child" [index]="i" [parentKey]="key" [class]="child.badgeClass"></li>
|
||||
<app-menuitem [item]="child" [index]="i" [parentKey]="key" [class]="child.badgeClass"></app-menuitem>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import {IconSelection} from '../../../service/icon-picker.service';
|
||||
import {TranslocoPipe} from '@jsverse/transloco';
|
||||
|
||||
@Component({
|
||||
selector: '[app-menuitem]',
|
||||
selector: 'app-menuitem',
|
||||
templateUrl: './app.menuitem.component.html',
|
||||
styleUrls: ['./app.menuitem.component.scss'],
|
||||
imports: [
|
||||
|
||||
Reference in New Issue
Block a user