/** Core */ import { CoreComponent } from "cmf.core/src/core"; import Cmf from "cmf.lbos"; /** Angular */ import * as ng from "@angular/core"; /** * Selection type, only used internally */ export declare enum EditorType { ComboBox = 0, SelectExpanded = 1 } /** * The base transition item */ export interface TransitionItem { toStateName: string; transitionName: string; toStateColor: string; transitionId?: string; } /** * @whatItDoes * * Entity basic info viewer component. * * @howToUse * * This component is used with the inputs and outputs mentioned below. * * ### Inputs * `boolean` : **disabled** - Defines if the element is disabled to be filed. * `boolean` : **hasLabel** - Defines if editor has labels or not. * `string[]` : **editorType** - Editor type names. * `Cmf.Foundation.BusinessObjects.StateModelTransitionCollection` : **transitions** - The possible transitions data collection used to populate the component. * This property isn't used directly by the component. * `Cmf.Foundation.BusinessObjects.StateModelState` : **currentState** - Defines the current entity state. * `boolean` : **forceStateChange** - Defines if the control will allow the entity to remain in the same state. * If not, a blank transition will be added. * `Map` : **reasonsToIgnore** - The reasons to ignore for the current transition. * `Cmf.Foundation.BusinessObjects.StateModelTransition` : **transitionSelectedValue** - The currently selected entity transition. * `any` : **reasonSelectedValue** - The currently selected reason for the transition. * `boolean` : **disableUnselect** - The object field that should be accessed to set if unselect is disabled. * `boolean` : **isReasonRequired** - Decides if the reason property editor is required * ### Outputs * `any` : **transitionSelectedValueChanged** - When the transition value of the component change, * this output informs the upper component that the value was changed. * `any` : **reasonSelectedValueChanged** - When the reason value of the component change, * this output informs the upper component that the value was changed. * * * ## Examples * * ```html * * * ``` * * @description * * ## EntityChangeState Component * * ### Dependencies * * #### Components * * _This component does not depend on any component_ * * #### Services * * _This component does not depend on any service_ * * #### Directives * _This component does not depend on any directive_ * */ export declare class EntityChangeState extends CoreComponent implements ng.OnInit, ng.AfterContentInit, ng.OnChanges { /** * Default no transition text * * * @property {string} */ private static NO_TRANSITION_ID; /** * Editor type names * * @property {string[]} */ private static EditorTypeNames; /** * Defines if the element is disabled to be filed */ _disabled: boolean; /** * The possible transitions data collection used to populate the component. This property isn't used directly by the component * * @property {Cmf.Foundation.BusinessObjects.StateModelTransitionCollection} The StateModelTransitions collection */ private _transitions; /** * The data that represents the possible transitions data collection used to populate the component. * * @property Array The data representing the basic info of each one of the StateModelTransitions */ _transitionsData: Array; /** * The id of the reason lookup table to get the values from * * @property {string} the id designation */ _reasonsLookupTableName: string; /** * The currently selected entity transition * * @property {Cmf.Foundation.BusinessObjects.StateModelTransition} transition object */ _transitionSelectedValue: Cmf.Foundation.BusinessObjects.StateModelTransition; /** * The currently selected data of an entity transition * * @property {SelectionItem} item data of a transition object */ _transitionsDataSelectedValue: TransitionItem; /** * The currently selected reason for the transition * * @property {string} selected reason */ private _reasonSelectedValue; /** * The reasons to ignore for the current transition * * @property {string[]} array of invalid reasons */ _currentReasonsToIgnore: string[]; /** * Defines if the control will allow the entity to remain in the same state * If not, a blank transition will be added. * * @property {boolean} */ private _forceStateChange; /** * Defines the editor used to select a new state. If it is a ComboBox or a SelectExpanded * * @property {boolean} */ _editorType: EditorType; /** * Defines the current state * * @property {Cmf.Foundation.BusinessObjects.StateModelState} */ private _currentState; /** * State transition comboBox row template */ _transitionRowTemplate: string; /** * Current State getter/setter */ currentState: Cmf.Foundation.BusinessObjects.StateModelState; /** * Returns EditorTypeNames array * * @return {string[]} EditorTypeNames array */ readonly EditorTypeNames: string[]; /** * Property _forceStateChange getter * * @return {boolean} current value of property _comboBoxType * @method comboBoxType */ /** * Property forceStateChange setter * * @param {boolean | string} [value] new value for property _forceStateChange * @method forceStateChange */ forceStateChange: boolean | string; /** * Contains transitions and for each one te reasons to ignore * * @property {Map} Map object */ reasonsToIgnore: Map; /** * Defines if editor has labels or not * * @property {boolean} if editor has labels or not */ hasLabel: boolean; /** * Property transitions value getter * * @return {Cmf.Foundation.BusinessObjects.StateModelTransitionCollection} current value for property transitions * @method transitions */ /** * Property transitions value setter. * * @param {Cmf.Foundation.BusinessObjects.StateModelTransitionCollection} [value] new value for property transitions * @method transitions */ transitions: Cmf.Foundation.BusinessObjects.StateModelTransitionCollection; /** * Property editorType value getter * * @return {EditorType} current value for property editorType * @method editorType */ /** * Property editorType value setter. * * @param {EditorType} [value] new value for property editorType * @method editorType */ editorType: EditorType | string; /** * Property transitions selected value getter * * @return {Cmf.Foundation.BusinessObjects.StateModelTransition} current value for property transitions selected value * @method transitionSelectedValue */ /** * Property transitions selected value setter. This method also sets the value of properties _transitionSelectedValue, _currentReasonsToIgnore, _reasonsLookupTableName, _reasonSelectedValue and notifies the parent component. * * @param {Cmf.Foundation.BusinessObjects.StateModelTransition} [value] new value for property transitions selected value * @method transitionSelectedValue */ transitionSelectedValue: Cmf.Foundation.BusinessObjects.StateModelTransition; /** * Property reasons selected value getter * * @return {any} current value for property reasons selected value * @method reasonSelectedValue */ /** * Property reasons selected value setter. This method also notifies the parent component. * * @param {any} [value] new value for property transitions selected value * @method reasonSelectedValue */ reasonSelectedValue: any; /** * Gets the disabled Property. */ /** * Sets the disabled Property */ disabled: boolean; /** * The transition value change event, so the component can inform the upper components that the selected value has changed * * @property {ng.EventEmitter} init event */ transitionSelectedValueChanged: ng.EventEmitter; /** * The reason value change event, so the component can inform the upper components that the selected value has changed * * @property {ng.EventEmitter} init event */ reasonSelectedValueChanged: ng.EventEmitter; /** * Decides if the reason property editor is required */ isReasonRequired: boolean; constructor(); /** * When transitions selected value changes - notify parent component * * @method onInit */ onTransitionSelectedValueValueChange(value: TransitionItem): void; /** * Returns the TransitionItem mapped from a StateModelTransition * * @return {TransitionItem} the item * @param {Cmf.Foundation.BusinessObjects.StateModelTransition} the state model transition */ private getTransitionItem; /** * Based on the currently selected transition, updates que reasons comboBox * * @return {void} * @method _updateReasons */ private _updateReasons; /** * Adds to transition data a blank transition to the current state just in case * the state change is not mandatory * * @return {void} * @method _addCurrentStateTransition */ private _addCurrentStateTransition; /** * Update the Selected Transition Data Item */ private updateTransitionSelectedValue; /** * Update Transitions Data Items */ private updateTransitions; /** * When select component is initiated - set defaults and initial value * * @method onInit */ ngAfterContentInit(): void; /** * When select component is initiated - set defaults and initial value * * @method onInit */ ngOnInit(): void; /** * On changes method * * @param changes the changes made to the component properties */ ngOnChanges(changes: ng.SimpleChanges): void; /** * When reasons selected value changes - notify parent component * * @method onInit */ onReasonSelectedValueValueChange(value: any): void; } export declare class EntityChangeStateModule { }