X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-forms%2Fselect%2Fselect-options.component.ts;fp=client%2Fsrc%2Fapp%2Fshared%2Fshared-forms%2Fselect-options.component.ts;h=3ba24c732965846813e450398211e9e08bfccf33;hb=52c4976fcf4ee255a3af68ff9778e4f5c4f84bd4;hp=09f7df53b49ba4745b7b08d9ae441c55805cd345;hpb=3d25d5de33d8aa0ba00d7514522b25d22bf0e0a1;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-forms/select-options.component.ts b/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 09f7df53b..3ba24c732 100644 --- a/client/src/app/shared/shared-forms/select-options.component.ts +++ b/client/src/app/shared/shared-forms/select/select-options.component.ts @@ -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) {