diff --git a/src/app/components/filter-badge/filter-badge.component.ts b/src/app/components/filter-badge/filter-badge.component.ts new file mode 100644 index 0000000..77d6177 --- /dev/null +++ b/src/app/components/filter-badge/filter-badge.component.ts @@ -0,0 +1,41 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@Component({ + selector: 'app-filter-badge', + standalone: true, + imports: [CommonModule], + template: ` + + + {{ label }} + + + `, + styles: [` + :host { display: inline-flex; } + .badge { + background: var(--badge-bg, color-mix(in oklab, var(--card) 96%, black 4%)); + color: var(--badge-fg, var(--text-main)); + border: 1px solid color-mix(in oklab, var(--border) 70%, transparent 30%); + box-shadow: 0 1px 1.5px color-mix(in oklab, var(--shadow) 8%, transparent 92%); + } + :host-context(html.dark) .badge { + background: var(--badge-bg, color-mix(in oklab, var(--card) 86%, black 14%)); + color: var(--badge-fg, var(--text-main)); + border-color: color-mix(in oklab, var(--border) 55%, transparent 45%); + } + .remove { color: var(--text-muted); } + .remove:hover { background: color-mix(in oklab, var(--surface2) 25%, transparent 75%); color: var(--text-main); } + `] +}) +export class FilterBadgeComponent { + @Input() label = ''; + @Input() icon = ''; + @Output() remove = new EventEmitter(); +} diff --git a/src/app/features/list/notes-list.component.ts b/src/app/features/list/notes-list.component.ts index f39924e..506ef8e 100644 --- a/src/app/features/list/notes-list.component.ts +++ b/src/app/features/list/notes-list.component.ts @@ -8,6 +8,8 @@ import { NotesListStateService, SortBy, ViewMode } from '../../services/notes-li import { NoteCreationService } from '../../services/note-creation.service'; import { NoteContextMenuComponent } from '../../../components/note-context-menu/note-context-menu.component'; import { WarningPanelComponent } from '../../components/warning-panel/warning-panel.component'; +import { FilterBadgeComponent } from '../../components/filter-badge/filter-badge.component'; +import { FilterService } from '../../services/filter.service'; import { NoteContextMenuService } from '../../services/note-context-menu.service'; import { UrlStateService } from '../../services/url-state.service'; import { EditorStateService } from '../../../services/editor-state.service'; @@ -17,28 +19,16 @@ import { FileTypeDetectorService } from '../../../services/file-type-detector.se @Component({ selector: 'app-notes-list', standalone: true, - imports: [CommonModule, ScrollableOverlayDirective, NoteContextMenuComponent, WarningPanelComponent], + imports: [CommonModule, ScrollableOverlayDirective, NoteContextMenuComponent, WarningPanelComponent, FilterBadgeComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
-
- - - Filtre: #{{ t }} - - -
-
- - {{ ql.icon }} {{ ql.name }} - - + +
+
@@ -51,9 +41,10 @@ import { FileTypeDetectorService } from '../../../services/file-type-detector.se
-