/** Core */ import { CoreComponent } from "cmf.core/src/core"; import Cmf from "cmf.lbos"; /** Nested modules */ import { PropertyViewerType } from "../propertyViewer/propertyViewer"; /** Angular */ import * as ng from "@angular/core"; /** * Type of tab that can be displayed */ export declare enum ChangeTab { /** * Base natives changes tab */ Properties = 0, /** * Attributes tab (changes) */ Attributes = 1, /** * Operation attributes values tab */ OperationAttributes = 2 } /** * Tab list item object - used to pass data to the select list */ export interface ChangesTabListItem { /** * Display name of the tab */ name: string; /** * Value of the tab */ value: ChangeTab; } /** * Generic changes */ export interface Changes { /** * Unique changes identifier */ key: string; /** * Flag that shows if this changes are processed or not */ isProcessed: boolean; /** * Main title of the changes */ mainTitle: string; /** * Instance that change applies to */ instance: Cmf.Foundation.Common.Base.CoreBase; } export interface ProcessedChanges extends Changes { /** * Native properties */ Properties: Array; /** * Attributes */ Attributes?: Array; /** * Operation attributes */ OperationAttributes?: Array; } /** * Changes details non-processed data interface */ export interface RawChanges extends Changes { /** * Properties details */ nativeDetails: any; /** * Attributes details */ attributeDetails: any; /** * Id of the service where this change was applied */ serviceHistoryId: string; /** * Operation history sequence */ operationHistorySequence: string; /** * Entity type name where it was applied */ entityTypeName: string; } /** * Interface that holds the important information for a changes attribute */ export interface ChangesAttribute { /** * Type of value */ valueType: PropertyViewerType; /** * Id of the entity type property */ valueReferenceType: Cmf.Foundation.Common.ReferenceType; /** * Name of the entity type property */ name: string; /** * Previous attribute value */ oldValue: any[]; /** * New attribute value */ value: any[]; } /** * Represents a field change */ export interface ChangedField { name: string; oldValue: any; newValue: any; hasChanged: boolean; referenceType?: Cmf.Foundation.Common.ReferenceType; } /** * @whatItDoes * * This component details the entity changes in a single operation, for both properties, attributes and operation attributes. * * @howToUse * * To use this component you should supply the changes object, either as raw or as processed. If you supply the raw changes, the processed changes will be * output so you can use them and optimize a future usage. * * ### Inputs * `Changes` : **changesDetails** - Raw or processed changes that contain the data. * `boolean` : **onlyChangedFields** - Boolean that that controls if only changed fields are shown, or all. Defaults to true. * * ### Outputs * `ProcessedChanges` : **changesProcessed** - Event containing the processed changes for the previously supplied raw changes. * `null` : **close** - Event indicating that the user clicked the close button to dismiss the changes. * * @description * * ## EntityHistoryChanges Component * * ### Dependencies * * #### Components * * SelectListModule : `cmf.core.controls` * * LabelModule : `cmf.core.controls` * * #### Services * _The component component does not depend on any service_ * * #### Directives * _The component component does not depend on any directive_ * */ export declare class EntityHistoryChanges extends CoreComponent implements ng.OnChanges { private elementRef; changesDetails: Changes; /** * Controls if only the changed fields are disabled on the properties section */ onlyChangedFields: boolean; /** * Currently selected change. After closing change, this should be set to null. */ _nativeChanges: Array; /** * Currently displayed attribute changes */ _attributeChanges: Array; /** * Currently displayed operation attribute changes */ _operationAttributeChanges: Array; /** * Output triggered when changes processing finishes */ changesProcessed: ng.EventEmitter; /** * Close event triggered when the close button is pressed */ close: ng.EventEmitter; /** * Currently selected tabs */ _selectedTab: ChangeTab; /** * Available tabs for the different views */ _tabs: ChangesTabListItem[]; /** * Evaluates wether the raw changes have any attribute or native changes * @param rawChanges Changes to evaluate * @returns True if there are any changes in the raw changes */ static hasAnyChanges(rawChanges: RawChanges): boolean; /** * EntityHistory constructor * * @param viewContainerRef View Container Ref */ constructor(elementRef: ng.ElementRef, viewContainerRef: ng.ViewContainerRef); /** * Gets the properties changes of an operation. * * @param details The properties details (before and after the operation), provided by the service output * @param requestedServiceHistoryId The request serviceHistoryId * @param requestedOperationSequence The requested operation sequence * @param entityTypeName The name of the entity type associated to this operation * * @return Array of ChangedFields, with the old and new values */ private getNativeFields; /** * Applies filters on set of changed fields (show all changes or just modified properties) * * @param change array of changed fields */ private applyFiltersOnChange; /** * On instance change, get its history services. * * @param changes Changes */ ngOnChanges(changes: ng.SimpleChanges): Promise; /** * Convert raw changes into processed changes * @param rawChanges Raw Changes * @returns The processed changes */ private processRawChanges; /** * Extract the attribute fields from the details * @param attributeDetails Returned by the service */ private getAttributeFields; /** * Update the visible tabs according to the available changes */ private updateTabs; /** * When a tab is altered, change the displayed data */ changeSelectedTab(tab: ChangesTabListItem): void; /** * On close of operation changes */ onChangesClose(): void; } export declare class EntityHistoryChangesModule { }