Fix ng-select labels
This commit is contained in:
parent
ff7ac05d11
commit
7c9089ecc2
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<my-select-checkbox
|
<my-select-checkbox
|
||||||
id="instanceCategories"
|
labelForId="instanceCategories"
|
||||||
formControlName="categories" [availableItems]="categoryItems"
|
formControlName="categories" [availableItems]="categoryItems"
|
||||||
[selectableGroup]="false"
|
[selectableGroup]="false"
|
||||||
i18n-placeholder placeholder="Add a new category"
|
i18n-placeholder placeholder="Add a new category"
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<my-select-checkbox
|
<my-select-checkbox
|
||||||
id="instanceLanguages"
|
labelForId="instanceLanguages"
|
||||||
formControlName="languages" [availableItems]="languageItems"
|
formControlName="languages" [availableItems]="languageItems"
|
||||||
[selectableGroup]="false"
|
[selectableGroup]="false"
|
||||||
i18n-placeholder placeholder="Add a new language"
|
i18n-placeholder placeholder="Add a new language"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<my-select-checkbox-all
|
<my-select-checkbox-all
|
||||||
|
[labelForId]="labelForId"
|
||||||
[(ngModel)]="selectedCategories"
|
[(ngModel)]="selectedCategories"
|
||||||
(ngModelChange)="onModelChange()"
|
(ngModelChange)="onModelChange()"
|
||||||
[availableItems]="availableCategories"
|
[availableItems]="availableCategories"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, forwardRef, OnInit } from '@angular/core'
|
import { Component, forwardRef, Input, OnInit } from '@angular/core'
|
||||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'
|
||||||
import { ServerService } from '@app/core'
|
import { ServerService } from '@app/core'
|
||||||
import { SelectOptionsItem } from '../../../../types/select-options-item.model'
|
import { SelectOptionsItem } from '../../../../types/select-options-item.model'
|
||||||
|
@ -20,6 +20,8 @@ import { SelectCheckboxAllComponent } from './select-checkbox-all.component'
|
||||||
imports: [ SelectCheckboxAllComponent, FormsModule ]
|
imports: [ SelectCheckboxAllComponent, FormsModule ]
|
||||||
})
|
})
|
||||||
export class SelectCategoriesComponent implements ControlValueAccessor, OnInit {
|
export class SelectCategoriesComponent implements ControlValueAccessor, OnInit {
|
||||||
|
@Input({ required: true }) labelForId: string
|
||||||
|
|
||||||
selectedCategories: ItemSelectCheckboxValue[] = []
|
selectedCategories: ItemSelectCheckboxValue[] = []
|
||||||
availableCategories: SelectOptionsItem[] = []
|
availableCategories: SelectOptionsItem[] = []
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { ItemSelectCheckboxValue, SelectCheckboxComponent } from './select-check
|
||||||
[availableItems]="availableItems"
|
[availableItems]="availableItems"
|
||||||
[selectableGroup]="true" [selectableGroupAsModel]="true"
|
[selectableGroup]="true" [selectableGroupAsModel]="true"
|
||||||
[placeholder]="placeholder"
|
[placeholder]="placeholder"
|
||||||
|
[labelForId]="labelForId"
|
||||||
(focusout)="onBlur()"
|
(focusout)="onBlur()"
|
||||||
>
|
>
|
||||||
</my-select-checkbox>`,
|
</my-select-checkbox>`,
|
||||||
|
@ -29,6 +30,7 @@ import { ItemSelectCheckboxValue, SelectCheckboxComponent } from './select-check
|
||||||
imports: [ SelectCheckboxComponent, FormsModule ]
|
imports: [ SelectCheckboxComponent, FormsModule ]
|
||||||
})
|
})
|
||||||
export class SelectCheckboxAllComponent implements ControlValueAccessor {
|
export class SelectCheckboxAllComponent implements ControlValueAccessor {
|
||||||
|
@Input({ required: true }) labelForId: string
|
||||||
@Input() availableItems: SelectOptionsItem[] = []
|
@Input() availableItems: SelectOptionsItem[] = []
|
||||||
@Input() allGroupLabel: string
|
@Input() allGroupLabel: string
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ export type ItemSelectCheckboxValue = { id?: string, group?: string } | string
|
||||||
imports: [ NgSelectModule, FormsModule ]
|
imports: [ NgSelectModule, FormsModule ]
|
||||||
})
|
})
|
||||||
export class SelectCheckboxComponent implements OnInit, ControlValueAccessor {
|
export class SelectCheckboxComponent implements OnInit, ControlValueAccessor {
|
||||||
|
@Input({ required: true }) labelForId: string
|
||||||
@Input() availableItems: SelectOptionsItem[] = []
|
@Input() availableItems: SelectOptionsItem[] = []
|
||||||
@Input() selectedItems: ItemSelectCheckboxValue[] = []
|
@Input() selectedItems: ItemSelectCheckboxValue[] = []
|
||||||
@Input() selectableGroup: boolean
|
@Input() selectableGroup: boolean
|
||||||
|
|
|
@ -5,5 +5,6 @@
|
||||||
[maxItems]="maxLanguages"
|
[maxItems]="maxLanguages"
|
||||||
i18n-placeholder placeholder="Add a new language"
|
i18n-placeholder placeholder="Add a new language"
|
||||||
[allGroupLabel]="allLanguagesGroup"
|
[allGroupLabel]="allLanguagesGroup"
|
||||||
|
[labelForId]="labelForId"
|
||||||
>
|
>
|
||||||
</my-select-checkbox-all>
|
</my-select-checkbox-all>
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { SelectCheckboxAllComponent } from './select-checkbox-all.component'
|
||||||
imports: [ SelectCheckboxAllComponent, FormsModule ]
|
imports: [ SelectCheckboxAllComponent, FormsModule ]
|
||||||
})
|
})
|
||||||
export class SelectLanguagesComponent implements ControlValueAccessor, OnInit {
|
export class SelectLanguagesComponent implements ControlValueAccessor, OnInit {
|
||||||
|
@Input({ required: true }) labelForId: string
|
||||||
@Input() maxLanguages: number
|
@Input() maxLanguages: number
|
||||||
|
|
||||||
selectedLanguages: ItemSelectCheckboxValue[]
|
selectedLanguages: ItemSelectCheckboxValue[]
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
</my-help>
|
</my-help>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<my-select-languages [maxLanguages]="20" formControlName="videoLanguages"></my-select-languages>
|
<my-select-languages labelForId="videoLanguages" [maxLanguages]="20" formControlName="videoLanguages"></my-select-languages>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<label class="with-description" for="languageOneOf" i18n>Languages:</label>
|
<label class="with-description" for="languageOneOf" i18n>Languages:</label>
|
||||||
<ng-template *ngTemplateOutlet="updateSettings; context: { $implicit: 'video-languages-subtitles' }"></ng-template>
|
<ng-template *ngTemplateOutlet="updateSettings; context: { $implicit: 'video-languages-subtitles' }"></ng-template>
|
||||||
|
|
||||||
<my-select-languages [maxLanguages]="20" formControlName="languageOneOf"></my-select-languages>
|
<my-select-languages labelForId="languageOneOf" [maxLanguages]="20" formControlName="languageOneOf"></my-select-languages>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" role="radiogroup">
|
<div class="form-group" role="radiogroup">
|
||||||
|
@ -134,7 +134,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="categoryOneOf" i18n>Categories:</label>
|
<label for="categoryOneOf" i18n>Categories:</label>
|
||||||
|
|
||||||
<my-select-categories formControlName="categoryOneOf"></my-select-categories>
|
<my-select-categories labelForId="categoryOneOf" formControlName="categoryOneOf"></my-select-categories>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" *ngIf="canSeeAllVideos()">
|
<div class="form-group" *ngIf="canSeeAllVideos()">
|
||||||
|
|
Loading…
Reference in New Issue