/** Core */ import { CoreComponent } from "cmf.core/src/core"; /** Angular */ import * as ng from "@angular/core"; import * as ngRouter from "@angular/router"; /** Nested */ import { Button } from "cmf.core.controls/src/components/baseWidget/baseWidget"; import { GenericDiagramNodeComponent } from "cmf.core.controls/src/components/genericDiagram/genericDiagramModel"; /** Lbos */ import Cmf from "cmf.lbos"; /** * StateModelDiagramNodeContext */ export interface StateModelDiagramNodeContext { instance: Cmf.Foundation.BusinessObjects.StateModelState; onFinish: any; } /** * InfoBadge */ export interface InfoBadge { text: string; icon: string; italic?: boolean; } /** * StateBoxType */ export declare enum StateBoxType { Begin = 0, End = 1, State = 2, Note = 3 } /** * ExecutionState */ export declare enum ExecutionState { None = 0, NotExecuted = 1, Skipped = 2, Executed = 3, Current = 4 } /** * @whatItDoes * This component is used to represent a node in the StateModelDiagram. It can be a box of a state, a begin/end point or a note * * @howToUse * This component should be instantiated automatically by the generic diagram * * ### Inputs * `StateBoxType` : **stateBoxType** - Defines if the node represents a state, a begin/end point or a note; * `boolean` : **expanded** - Defines if the node is expanded or collapsed * `string` : **settingsAction** - The action to call when the 'settings' menu button is pressed * `boolean` : **showDescription** - Determines if the state's description is shown in the state boxes * `function` : **infoBadgesBuilder** - A function that acts as a constructor for the informative badges that are shown in the state boxes * `ExecutionState` : **executionState** - State execution state * `boolean` : **allowStateOptions** - Allow state options * */ export declare class StateModelDiagramNode extends CoreComponent implements ng.OnChanges, ng.AfterViewInit, GenericDiagramNodeComponent { private _elementRef; private _zone; private _router; /** * Context menu */ private contextMenu; /** * Dropdown menu options */ _menuOptions: Button[]; /** * Header icon */ _headerIcon: string; /** * Header title */ _headerTitle: string; /** * Show state body */ _showStateBody: boolean; /** * Name of the state */ stateName: string; /** * Description of the state */ description: string; /** * Info badges */ infoBadges: InfoBadge[]; /** * Show description */ showDescription: boolean; /** * Id */ id: any; /** * If box is selected */ isSelected: boolean; /** * If box is highlighted */ isHighlighted: boolean; /** * State box type */ stateBoxType: StateBoxType; /** * Execution State */ executionState: ExecutionState; /** * Allow state options */ allowStateOptions: boolean; /** * If box is expanded */ expanded: boolean; /** * Object */ object: any; /** * Settings action */ settingsAction: string; /** * Info badges builder */ infoBadgesBuilder: (object: any) => InfoBadge[]; /** * On save state settings */ onSaveStateSettings: () => Promise; /** * On box size change * @event onSizeChange */ onSizeChange: ng.EventEmitter; /** * On remove click * @event onRemove */ onRemove: ng.EventEmitter; /** * On object updated * @event onRemove */ onObjectUpdated: ng.EventEmitter<{ id: any; object: any; }>; /** * Constructor */ constructor(_elementRef: ng.ElementRef, _zone: ng.NgZone, _router: ngRouter.Router); /** * On state settings changed */ private onStateSettingsChanged; /** * On state settings click */ private onStateSettings; /** * On mousedown in widget body */ blockMouseEvents: (event: any) => void; /** * On menu option click * @param option the option */ onMenuOptionClick(option: Button): void; /** * Update box */ updateBox(): void; /** * Toggle expanded */ toggleExpanded(): void; /** * Setup mouse events */ private setupMouseEvents; /** * Update header */ private updateHeader; /** * On note change */ onNoteChange(note: string): void; /** * Context click */ contextClick(): void; /** * After View Init */ ngAfterViewInit(): void; /** * Handle input changes. * @param changes Changes */ ngOnChanges(changes: ng.SimpleChanges): void; } export declare class StateModelDiagramNodeModule { }