@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
141 lines (140 loc) • 6.72 kB
TypeScript
import { AfterViewChecked, DoCheck, Injector, IterableDiffers, OnChanges, OnDestroy, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ActivatedRouteSnapshot, NavigationExtras, Router, RouterStateSnapshot } from '@angular/router';
import { RpcDialogOverlayData } from '@microsoft/windows-admin-center-sdk/core/rpc/overlay/rpc-overlay-model';
import { Observable } from 'rxjs';
import { AppContextService } from '../../../service/app-context.service';
import { RpcShellService } from '../../../service/rpc-shell.service';
import { CoreBaseComponent } from '../../common/base.component';
import { Layout } from '../../common/layout';
import { SearchFormFieldComponent } from '../../form';
import { CanComponentDeactivate } from '../settings-can-deactivate-guard.service';
import { SettingsFormService } from '../settings-form.service';
import { SettingsComponent } from '../settings.component';
import { CommonSettingsNavigationItem, CommonSettingsNavigationItemWithForm } from './common-settings-navigation-item';
import * as i0 from "@angular/core";
export interface GroupToolsMenu {
group: string;
options: CommonSettingsNavigationItemWithForm[];
}
/**
* Container around settings component, handles common settings behavior.
*/
export declare class CommonSettingsComponent extends CoreBaseComponent implements OnInit, OnChanges, OnDestroy, DoCheck, AfterViewChecked {
router: Router;
private settingsForms;
private iterableDiffers;
private appContext;
private rpcShellService;
/**
* The source name to use for logging
*/
protected get logSourceName(): string;
/**
* If no header is being used internally, the control will depend on external header being customized
* For instance, a breadcrumb header can be used. And in this case, no extra scroll bar can be rendered on phone down.
*/
externalHeader: boolean;
combinedForm: FormGroup;
readonly defaultGroup = "default";
groupTools: GroupToolsMenu[];
layers: RpcDialogOverlayData[];
selectedSetting: CommonSettingsNavigationItem;
defaultIcon: string;
/**
* Search box filter.
*/
filter: string;
/**
* Search box placeholder.
*/
searchBoxPlaceholder: string;
filteredSettings: CommonSettingsNavigationItem[];
searchTextBox: SearchFormFieldComponent;
settingsTitle: string;
settings: CommonSettingsNavigationItem[];
showHeader: boolean;
hackShowOverlay: boolean;
hackToolHeader: boolean;
/**
* If connection settings page, the contents are all iframe, special logic to get rid of the extra scroll bar for iframe.
*/
connectionSettings: boolean;
backRoute: {
commands: any[];
extras?: NavigationExtras;
};
/**
* Controls whether the tab list showing the Settings items is scrollable or not
* Default to true. Allowing separate scroll bar for the navbar and the selected Settings.
* Set to false for backward compatibility and use previous behavior where there is
* only 1 single scroll bar for both navbar and content of the selected Settings item.
*/
scrollableSecondaryNav: boolean;
settingsComponent: SettingsComponent;
private latestForm;
private latestPristineFormValue;
private latestFormUpdateValueInComponent;
private settingsDiffer;
private autofocus;
private settingsResponsiveWindowManager;
constructor(injector: Injector, router: Router, settingsForms: SettingsFormService, iterableDiffers: IterableDiffers, appContext: AppContextService, rpcShellService: RpcShellService, layout: Layout);
ngOnInit(): void;
ngOnChanges(changes: any): void;
/**
* The deferred layout changed handler.
*/
private deferredOnLayoutChanged;
private onLayoutChanged;
private onWindowBreakpointChanged;
ngDoCheck(): void;
ngAfterViewChecked(): void;
createMenu(): void;
recalculateActivePanel(): void;
discardAllChildForms(): void;
acceptAllChildFormsValue(): void;
getSmeIconClass(setting: CommonSettingsNavigationItem): {};
canDeactivate(component: CanComponentDeactivate, route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean;
/**
* Gets the initial host classes to be applied to this element
*/
protected getInitialHostClasses(): string[];
/**
* Creates the idBag used by this component to store unique element ids.
* id values will be assigned be the @see BaseComponent super class.
*/
protected createIdBag(): MsftSme.StringMap<string>;
onOverlayClick(layer: RpcDialogOverlayData): void;
/**
* Returns the value of the current control and all its children recursivelly,
* including disabled controls.
*
* Workaround for missing functionality added in later versions of angular
* Currently getRawValue only returns the value of hte current control disabled
* children but only enabled controls of other descendants:
* https://github.com/angular/angular/commit/1ece7366c8b67f387fbe13f8d128c19f4c50dd19
*
* Once we upgrade angular version we can remove this code.
*
* @param formControl The form control to get the value from
*/
private getRawValueRecursive;
/**
* Update this.selectedSetting to the newly selected Settings item when user navigate to a new Settings item
* Also call the child component this.settingsComponent to update the settingsTitle to reflect the title
* of the newly selected Settings item
*
* @param newSetting The newly selected Settings item
*/
onSmeRouterLinkActivated(newSetting: CommonSettingsNavigationItem): void;
/**
* Callback function for the search field
*/
onSearch(): void;
/**
* Filter out the settings Item based on this.filter string and match the title of Settings Items
*/
private filterSetting;
static ɵfac: i0.ɵɵFactoryDeclaration<CommonSettingsComponent, [null, null, null, null, null, null, { optional: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<CommonSettingsComponent, "sme-common-settings", never, { "searchBoxPlaceholder": "searchBoxPlaceholder"; "settingsTitle": "settingsTitle"; "settings": "settings"; "showHeader": "showHeader"; "hackShowOverlay": "hackShowOverlay"; "hackToolHeader": "hackToolHeader"; "connectionSettings": "connectionSettings"; "backRoute": "backRoute"; "scrollableSecondaryNav": "scrollableSecondaryNav"; }, {}, never, ["*"], false, never>;
}