aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-forms/select/select-custom-input.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-forms/select/select-custom-input.component.ts')
-rw-r--r--client/src/app/shared/shared-forms/select/select-custom-input.component.ts44
1 files changed, 0 insertions, 44 deletions
diff --git a/client/src/app/shared/shared-forms/select/select-custom-input.component.ts b/client/src/app/shared/shared-forms/select/select-custom-input.component.ts
deleted file mode 100644
index ba6fef8ad..000000000
--- a/client/src/app/shared/shared-forms/select/select-custom-input.component.ts
+++ /dev/null
@@ -1,44 +0,0 @@
1import { Component, forwardRef, Input } from '@angular/core'
2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
3
4@Component({
5 selector: 'my-select-custom-input',
6 styleUrls: [ './select-custom-input.component.scss' ],
7 templateUrl: './select-custom-input.component.html',
8 providers: [
9 {
10 provide: NG_VALUE_ACCESSOR,
11 useExisting: forwardRef(() => SelectCustomInputComponent),
12 multi: true
13 }
14 ]
15})
16export class SelectCustomInputComponent implements ControlValueAccessor {
17 @Input() items: any[] = []
18
19 selectedId: number
20
21 // ng-select options
22 bindLabel = 'label'
23 bindValue = 'id'
24 clearable = false
25 searchable = false
26
27 propagateChange = (_: any) => { /* empty */ }
28
29 writeValue (id: number) {
30 this.selectedId = id
31 }
32
33 registerOnChange (fn: (_: any) => void) {
34 this.propagateChange = fn
35 }
36
37 registerOnTouched () {
38 // Unused
39 }
40
41 onModelChange () {
42 this.propagateChange(this.selectedId)
43 }
44}