@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
260 lines (259 loc) • 8.23 kB
TypeScript
import { ElementRef, OnDestroy, OnInit } from '@angular/core';
import { TreeNodeDataItem } from '../../controls/data-table/data-table-contract';
import { DataSchema, SchemaFieldContext, SchemaProperty } from '../schema/schema-models';
import * as i0 from "@angular/core";
export declare class SchemaFormEditorSchemaTreeComponent implements OnInit, OnDestroy {
private elementRef;
strings: {
Title: string;
SwitchToCodeViewMessage: string;
PreviewForm: {
Title: string;
EmptySchemaMessage: string;
ValidationResult: {
Passed: string;
Failed: string;
Title: string;
};
};
Welcome: {
Title: string;
Row1: string;
Row2: string;
Row3: string;
Row4: string;
Row5: string;
Row6: string;
Row7: string;
Row8: string;
Row9: string;
Row10: string;
Row11: string;
};
SchemaView: {
Title: string;
Visual: string;
Code: string;
};
ApplySchemaButton: {
Text: string;
};
GoToCodeViewButton: {
Text: string;
};
CloseButton: {
Text: string;
};
SchemaTree: {
Welcome: {
Row1: string;
Row2: string;
Row3: string;
Row4: string;
Row5: string;
};
};
PropertyForm: {
Header: string;
Footer: string;
DataType: string;
Advance: string;
Required: string;
DefaultValue: string;
Description: string;
HideCondition: string;
ConditionForDisabled: string;
CustomValidation: string;
ReadonlyCondition: string;
MoreOptions: string;
EmptyByDefault: string;
NoOptionSchema: string;
Welcome: {
Row1: string;
Row2: string;
Row3: string;
Row4: string;
Row5: string;
Row6: string;
Row7: string;
};
Type: {
Description: string;
};
Format: {
Description: string;
};
Name: {
Description: string;
};
Label: {
Description: string;
};
MultipleLine: {
Title: string;
};
ObjectType: {
ColumnCount: string;
Collapsible: string;
HideHeader: string;
Yes: string;
State: string;
Collapsed: string;
Expanded: string;
};
Options: {
StaticOptions: string;
DynamicOptions: string;
Label: string;
Value: string;
};
CodeEditor: {
Language: {
label: string;
description: string;
};
Options: {
label: string;
description: string;
};
};
};
SchemaText: {
Message1: string;
Message2: string;
LintMessage: string;
CopyToClipboardButton: {
Text: string;
};
};
ViewModel: {
Message: string;
GenerateButton: {
Text: string;
};
};
ResourceStringPicker: {
ActualTextPrefix: string;
InvalidResourceKey: string;
NoResourceKeyMessage: string;
CannotFindResourceKey: string;
WrongFormatActualText: string;
};
};
private timer;
private isInitialized;
private internalSchema;
private currentSelectedPropertyFullType;
private schemaDataTypeStore;
private propertyFormSchema;
private availableDataTypes;
private propertyForm;
private schemaTree;
private internalSelectedSchemaTreeNode;
/**
* The data bind to the schema tree.
* It describes the data schema in a tree visual style.
*/
schemaTreeData: TreeNodeDataItem[];
/**
* The form schema used to render the form for the individual property.
* Some of its content (e.g. schema of "options" property) is constructed dynamically per each individual property.
*/
currentPropertyFormSchema: DataSchema;
get isPropertyFormValid(): boolean;
treeWidth: number;
propertyFormController: {
isRootNodeSelected: () => boolean;
isNotObjectType: (context: SchemaFieldContext) => boolean;
};
/**
* The schema from the form to be edited.
*/
get schema(): DataSchema;
set schema(value: DataSchema);
/**
* The selected schema tree node.
* Every time when it's selected, the form schema for the property related tree node will be constructed dynamically
* and the property form will be rendered based on the form schema.
*/
get selectedSchemaTreeNode(): TreeNodeDataItem;
set selectedSchemaTreeNode(value: TreeNodeDataItem);
constructor(elementRef: ElementRef);
ngOnInit(): void;
ngOnDestroy(): void;
private getPropertyFormSchema;
getPropertyTreeNodeType(nodeData: SchemaTreeNodeData): string;
getItemIdentityFunction(data: SchemaTreeNodeData): string;
getSchemaTreeNodeDisplayText(schemaTreeData: SchemaTreeNodeData): string;
private handleSchemaFormChange;
private refreshSchemaTreeData;
private generateSchemaTreeNodeInternal;
generateSchema(): DataSchema;
addProperty(): void;
moveUp(): void;
moveDown(): void;
delete(): void;
shouldShowWelcomeTextForSchemaTree(): boolean;
private generatePropertyInternal;
static ɵfac: i0.ɵɵFactoryDeclaration<SchemaFormEditorSchemaTreeComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<SchemaFormEditorSchemaTreeComponent, "sme-schema-form-editor-schema-tree", never, { "schema": "schema"; }, {}, never, never, false, never>;
}
export interface SchemaTreeNodeData {
schema?: PropertySchemaViewModel;
tag?: string;
previousChildren?: {
[fullType: string]: TreeNodeDataItem[];
};
previousOptions?: any;
}
export declare class PropertySchemaDataTypePropertiesViewModel {
private dataTypeStore;
private isInitialized;
private internalType;
isRoot: boolean;
types: {
value: string;
label: string;
}[];
formats: {
value: string;
label: string;
}[];
get type(): string;
set type(value: string);
private internalFormat;
format: string;
constructor(types: {
value: string;
label: string;
}[]);
}
export declare class PropertySchemaAdvancePropertiesViewModel {
required: boolean;
defaultValue: string;
description: string;
hideCondition: string;
disabledCondition: string;
readonlyCondition: string;
customValidation: string;
customAsyncValidation: {
handler: string;
pendingMessage: string;
debounceTime: number;
};
emptyByDefault: boolean;
}
export declare class PropertySchemaViewModel {
dataType: PropertySchemaDataTypePropertiesViewModel;
name: string;
label: string;
advanceProperties: PropertySchemaAdvancePropertiesViewModel;
options: any;
properties: SchemaProperty[];
item: SchemaProperty;
constructor(propertySchemaModel: SchemaProperty, avaiableTypes: {
value: string;
label: string;
}[], isRoot?: boolean);
toPropertySchemaModel(): SchemaProperty;
}