mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 18:46:52 +01:00
parent
f8c8161a3e
commit
f34202a82a
159 changed files with 3882 additions and 2716 deletions
|
|
@ -1,30 +1,29 @@
|
|||
import { Directive, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ControlValueAccessor } from '@angular/forms';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Directive, ElementRef, Input, OnInit, ViewChild } from '@angular/core'
|
||||
import { ControlValueAccessor } from '@angular/forms'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
@Directive()
|
||||
export class AbstractInputComponent<T> implements OnInit, ControlValueAccessor {
|
||||
|
||||
@ViewChild("inputField")
|
||||
@ViewChild('inputField')
|
||||
inputField: ElementRef
|
||||
|
||||
constructor() { }
|
||||
constructor() {}
|
||||
|
||||
onChange = (newValue: T) => {};
|
||||
onChange = (newValue: T) => {}
|
||||
|
||||
onTouched = () => {};
|
||||
onTouched = () => {}
|
||||
|
||||
writeValue(newValue: any): void {
|
||||
this.value = newValue
|
||||
}
|
||||
registerOnChange(fn: any): void {
|
||||
this.onChange = fn;
|
||||
this.onChange = fn
|
||||
}
|
||||
registerOnTouched(fn: any): void {
|
||||
this.onTouched = fn;
|
||||
this.onTouched = fn
|
||||
}
|
||||
setDisabledState?(isDisabled: boolean): void {
|
||||
this.disabled = isDisabled;
|
||||
this.disabled = isDisabled
|
||||
}
|
||||
|
||||
focus() {
|
||||
|
|
@ -37,7 +36,7 @@ export class AbstractInputComponent<T> implements OnInit, ControlValueAccessor {
|
|||
title: string
|
||||
|
||||
@Input()
|
||||
disabled = false;
|
||||
disabled = false
|
||||
|
||||
@Input()
|
||||
error: string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue