Adds quick filters from document detail

This commit is contained in:
shamoon
2023-05-27 23:16:33 -07:00
parent 97cf3b2079
commit 74c965d21d
13 changed files with 2647 additions and 51 deletions

View File

@@ -1,8 +1,16 @@
import { Component, forwardRef, Input, OnInit } from '@angular/core'
import {
Component,
EventEmitter,
forwardRef,
Input,
OnInit,
Output,
} from '@angular/core'
import { NG_VALUE_ACCESSOR } from '@angular/forms'
import {
NgbDateAdapter,
NgbDateParserFormatter,
NgbDateStruct,
} from '@ng-bootstrap/ng-bootstrap'
import { SettingsService } from 'src/app/services/settings.service'
import { AbstractInputComponent } from '../abstract-input'
@@ -34,6 +42,12 @@ export class DateComponent
@Input()
suggestions: string[]
@Input()
showFilter: boolean = false
@Output()
filterDocuments = new EventEmitter<NgbDateStruct[]>()
getSuggestions() {
return this.suggestions == null
? []
@@ -80,4 +94,8 @@ export class DateComponent
event.preventDefault()
}
}
onFilterDocuments() {
this.filterDocuments.emit([this.ngbDateParserFormatter.parse(this.value)])
}
}