@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
172 lines (171 loc) • 6.42 kB
TypeScript
import { AfterContentInit, Injector, OnInit, QueryList } from '@angular/core';
import { Strings } from '../../../../generated/strings';
import { FormFieldComponent } from '../form-field.component';
import { FormFieldOptionComponent } from './form-field-option.component';
import * as i0 from "@angular/core";
declare type OptionsFormFieldTrackBy = 'index' | 'value' | 'label' | 'default';
/**
* Defines a base class form form field components with options
*/
export declare abstract class OptionsFormFieldComponent<TStrings, TModel> extends FormFieldComponent<TStrings, TModel> implements OnInit, AfterContentInit {
/**
* Indicates if multiple option selection is supported
*/
abstract multiple: boolean;
/**
* Sets the comparator function to determined complex object equality of option.value and values
* Defaults to '===' object equality. Meaning that value is always a literal subset of all the option.value's.
*/
valueComparator: MsftSme.Func2<TModel, TModel, boolean>;
/**
* Indicates if the select all option should be shown in multi-select mode
*/
showSelectAll: boolean;
/**
* Indicates the mode to track options by
*/
trackBy: OptionsFormFieldTrackBy;
/**
* The options for this control.
*/
options: QueryList<FormFieldOptionComponent>;
/**
* The options for this control.
*/
selectedOptions: FormFieldOptionComponent[];
/**
* The options for this control.
*/
selectedOptionsDisplayValue: string;
/**
* indicates if all options are selected
*/
get isAllOptionsSelected(): boolean;
/**
* indicates if some options are selected
*/
get isSomeOptionsSelected(): boolean;
/**
* The current keyCodes for autocompletion
*/
private autoCompleteKeyCodes;
/**
* the Filtered options specifically using for combobox with option filters
*/
optionsFiltered: QueryList<FormFieldOptionComponent>;
/**
* indicates whether the combobox has option filters
*/
searchable: boolean;
/**
* indicates the search string for filtering options
*/
get searchString(): string;
set searchString(value: string);
/**
* indicates the internal search string
*/
private searchStringInternal;
/**
* Initializes a new instance of the OptionsFormFieldComponent
*/
constructor(injector: Injector);
/**
* Implementation of Angular OnInit interface
*/
ngOnInit(): void;
/**
* Implementation of Angular AfterContentInit interface
*/
ngAfterContentInit(): void;
/**
* Gets the option display string for a given value
* @param value The value to get a display string for
*/
getValueDisplayString(value: TModel): string;
/**
* Selects an option.
*/
toggleOption(option: FormFieldOptionComponent, select: boolean): boolean;
/**
* Gets the selected option index (always -1 in multiple selection mode)
*/
getSelectedIndex(): number;
/**
* Selects/Deselects an option by its index
*/
toggleOptionByIndex(index: number, select?: boolean): boolean;
/**
* Selects the next option.
* @returns a boolean indicating if the select was successful
*/
selectNextOption(): boolean;
/**
* Selects the previous option.
* @returns a boolean indicating if the select was successful
*/
selectPreviousOption(): boolean;
/**
* Selects or deselects all options
* @returns a boolean indicating if the select was successful
*/
toggleAllOptions(select?: boolean): boolean;
/**
* Selects all options. Only allowed in multiple select mode
* @returns a boolean indicating if the select was successful
*/
selectAllOptions(): boolean;
/**
* Clears all options. Only allowed in multiple select mode
* @returns a boolean indicating if the unselect was successful
*/
clearAllOptions(): boolean;
/**
*
*/
trackOption(index: number, option: FormFieldOptionComponent): any;
/**
* Adds a keycode from KeyPress event to the autocomplete processor
*/
protected progressiveAutoComplete(keyCode: number): void;
/**
* Selects an option by the keys entered. Only allowed in single select mode
*/
private processAutoComplete;
/**
* Occurs whenever the internal value of this form control changes
*/
protected onValueChanged(value: TModel): void;
/**
* Synchronizes the displayed and selected options with the actual form control value
*/
protected syncSelectionChanged(value: TModel): void;
/**
* Base function for filter options by search string, will be called only if searchable to true
*/
protected filterOptionBySearchString(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<OptionsFormFieldComponent<any, any>, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<OptionsFormFieldComponent<any, any>, never, never, { "valueComparator": "valueComparator"; "showSelectAll": "showSelectAll"; "trackBy": "trackBy"; "searchable": "searchable"; }, {}, ["options"], never, false, never>;
}
/**
* Internal base component for SME form fields with options.
* It simply removes the need to supply the string type parameter to FormFieldComponent
* This class is exported from this file, but not meant to be exported from index.ts bundles.
*/
export declare abstract class SmeInternalOptionsFormFieldComponent<TModel> extends OptionsFormFieldComponent<Strings, TModel> {
/**
* Indicates if the select all option should be shown in multi-select mode
*/
selectAllLabel: string;
/**
* assigns an Id to select all option for dropdowns
*/
selectAllUtaId: string;
/**
* Internal class for sme options controls
*/
constructor(injector: Injector);
static ɵfac: i0.ɵɵFactoryDeclaration<SmeInternalOptionsFormFieldComponent<any>, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<SmeInternalOptionsFormFieldComponent<any>, never, never, { "selectAllLabel": "selectAllLabel"; "selectAllUtaId": "selectAllUtaId"; }, {}, never, never, false, never>;
}
export {};