mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-20 10:01:19 +00:00
Adds quick filters from document detail
This commit is contained in:
@@ -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)])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user