Browse Source

feat(lib): implement output signals

pull/6396/head
Kenrick Tandrian 1 month ago
parent
commit
2df4b4bdf4
  1. 9
      libs/ui/src/lib/assistant/assistant-list-item/assistant-list-item.component.ts
  2. 13
      libs/ui/src/lib/assistant/assistant.component.ts

9
libs/ui/src/lib/assistant/assistant-list-item/assistant-list-item.component.ts

@ -7,12 +7,11 @@ import {
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
ElementRef, ElementRef,
EventEmitter,
HostBinding, HostBinding,
Input, Input,
OnChanges, OnChanges,
Output, ViewChild,
ViewChild output
} from '@angular/core'; } from '@angular/core';
import { Params, RouterModule } from '@angular/router'; import { Params, RouterModule } from '@angular/router';
@ -39,14 +38,14 @@ export class GfAssistantListItemComponent
@Input() item: SearchResultItem; @Input() item: SearchResultItem;
@Output() clicked = new EventEmitter<void>();
@ViewChild('link') public linkElement: ElementRef; @ViewChild('link') public linkElement: ElementRef;
public hasFocus = false; public hasFocus = false;
public queryParams: Params; public queryParams: Params;
public routerLink: string[]; public routerLink: string[];
protected readonly clicked = output<void>();
public constructor(private changeDetectorRef: ChangeDetectorRef) {} public constructor(private changeDetectorRef: ChangeDetectorRef) {}
public ngOnChanges() { public ngOnChanges() {

13
libs/ui/src/lib/assistant/assistant.component.ts

@ -12,16 +12,15 @@ import {
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
ElementRef, ElementRef,
EventEmitter,
HostListener, HostListener,
Input, Input,
OnChanges, OnChanges,
OnDestroy, OnDestroy,
OnInit, OnInit,
Output,
QueryList, QueryList,
ViewChild, ViewChild,
ViewChildren ViewChildren,
output
} from '@angular/core'; } from '@angular/core';
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
@ -124,10 +123,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
@Input() hasPermissionToChangeFilters: boolean; @Input() hasPermissionToChangeFilters: boolean;
@Input() user: User; @Input() user: User;
@Output() closed = new EventEmitter<void>();
@Output() dateRangeChanged = new EventEmitter<DateRange>();
@Output() filtersChanged = new EventEmitter<Filter[]>();
@ViewChild('menuTrigger') menuTriggerElement: MatMenuTrigger; @ViewChild('menuTrigger') menuTriggerElement: MatMenuTrigger;
@ViewChild('search', { static: true }) searchElement: ElementRef; @ViewChild('search', { static: true }) searchElement: ElementRef;
@ -166,6 +161,10 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
}; };
public tags: Filter[] = []; public tags: Filter[] = [];
protected readonly closed = output<void>();
protected readonly dateRangeChanged = output<DateRange>();
protected readonly filtersChanged = output<Filter[]>();
private readonly PRESELECTION_DELAY = 100; private readonly PRESELECTION_DELAY = 100;
private filterTypes: Filter['type'][] = [ private filterTypes: Filter['type'][] = [

Loading…
Cancel
Save