mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { Component, EventEmitter, Input, Output } from '@angular/core'
 | |
| import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'
 | |
| import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
 | |
| import { DocumentSuggestions } from 'src/app/data/document-suggestions'
 | |
| import { pngxPopperOptions } from 'src/app/utils/popper-options'
 | |
| 
 | |
| @Component({
 | |
|   selector: 'pngx-suggestions-dropdown',
 | |
|   imports: [NgbDropdownModule, NgxBootstrapIconsModule],
 | |
|   templateUrl: './suggestions-dropdown.component.html',
 | |
|   styleUrl: './suggestions-dropdown.component.scss',
 | |
| })
 | |
| export class SuggestionsDropdownComponent {
 | |
|   public popperOptions = pngxPopperOptions
 | |
| 
 | |
|   @Input()
 | |
|   suggestions: DocumentSuggestions = null
 | |
| 
 | |
|   @Input()
 | |
|   loading: boolean = false
 | |
| 
 | |
|   @Input()
 | |
|   disabled: boolean = false
 | |
| 
 | |
|   @Output()
 | |
|   getSuggestions: EventEmitter<SuggestionsDropdownComponent> =
 | |
|     new EventEmitter()
 | |
| 
 | |
|   @Output()
 | |
|   addTag: EventEmitter<string> = new EventEmitter()
 | |
| 
 | |
|   @Output()
 | |
|   addDocumentType: EventEmitter<string> = new EventEmitter()
 | |
| 
 | |
|   @Output()
 | |
|   addCorrespondent: EventEmitter<string> = new EventEmitter()
 | |
| 
 | |
|   get totalSuggestions(): number {
 | |
|     return (
 | |
|       this.suggestions?.suggested_correspondents?.length +
 | |
|         this.suggestions?.suggested_tags?.length +
 | |
|         this.suggestions?.suggested_document_types?.length || 0
 | |
|     )
 | |
|   }
 | |
| }
 | 
