]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-forms/select/select-options.component.ts
Use ng select for multiselect
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-forms / select / select-options.component.ts
similarity index 85%
rename from client/src/app/shared/shared-forms/select-options.component.ts
rename to client/src/app/shared/shared-forms/select/select-options.component.ts
index 09f7df53b49ba4745b7b08d9ae441c55805cd345..3ba24c732965846813e450398211e9e08bfccf33 100644 (file)
@@ -1,7 +1,13 @@
 import { Component, Input, forwardRef } from '@angular/core'
 import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms'
 
-export type SelectOptionsItem = { id: number | string, label: string, description?: string }
+export type SelectOptionsItem = {
+  id: string | number
+  label: string
+  description?: string
+  group?: string
+  groupLabel?: string
+}
 
 @Component({
   selector: 'my-select-options',
@@ -19,14 +25,10 @@ export class SelectOptionsComponent implements ControlValueAccessor {
   @Input() items: SelectOptionsItem[] = []
   @Input() clearable = false
   @Input() searchable = false
-  @Input() bindValue = 'id'
   @Input() groupBy: string
 
   selectedId: number | string
 
-  // ng-select options
-  bindLabel = 'label'
-
   propagateChange = (_: any) => { /* empty */ }
 
   writeValue (id: number | string) {