/** Angular2 */ import * as ng from "@angular/core"; /** Core */ import { CoreComponent } from "cmf.core/src/core"; import { ModuleLoaderComponent } from 'cmf.core/src/domain/extensions/module.loader'; import { ExecutionViewFooter } from "./footer"; import { ExecutionViewDef } from "./executionViewDef"; import { ExecutionViewTabDef } from "../executionViewTab/executionViewTab"; import { ValidatorModel } from "../../directives/validator/validator"; import { ModalViewInstance } from "../modalView/modalView"; /** Bags */ import { PageBag } from "../page/pageBag"; import { ExecutionViewBag } from "./executionViewBag"; import { ExecutionViewEventArgs, ExecutionViewOperation } from "./executionViewDef"; import { ResultType, ResultEventArgs } from "../resultMessage/resultType"; import { ResultMessageBag, ResultMessageType } from "../resultMessage/resultMessageBag"; export { ResultType }; export { ResultMessageBag, ResultMessageType }; export { ExecutionViewEventArgs, ExecutionViewOperation }; export declare type ExecutionViewInterface = ExecutionViewDef; export declare type ExecutionViewTabInterface = ExecutionViewTabDef; /** * Execution View component serves as the container for a number of tabs. * Each tabs is represented by an instance of the {@link ExecutionViewTab} component. * * @whatItDoes * The Execution View is used to model a continuous series of transactions that express a mode of continuous interaction. * A common case is equipment maintenance, where you keep the same screen open and perform successive operations, * like reporting used parts and executing a checklist. * * The execution view permits you to save your work at any time and to cancel any alteration since your last save. * * @howToUse * Execution View is a normal component, and as such it can be used in any other component. * * ### Inputs * `string` : **mainTitle** - Title of the execution view ; * `string` : **action-id** - The name of the action to be used for validation ; * `string` : **action-name** - The name of the action to be used when save and closed is clicked ; * `string` : **iconClass** - String indicating the icon class to be used ; * `string` : **secondaryActionName** - The secondary-action-name of the execution view ; * `boolean` : **isSecondaryActionValidationEnabled** - If the _Save Now_ option have validation or not ; * `boolean` : **isCommentable** - Is the user allowed to add a comment to the transaction ; * `boolean` : **isSaveNowButtonShown** - Should the execution view allow the user to save whenever they want ; * `boolean` : **isCancelButtonShown** - Should the execution view allow the user to cancel whenever they want ; * `boolean` : **switchCancelToClose** - Controls wether the 'cancel' is changed to 'close' after save now. Defaults to true . * `string` : **cancelActionName** - If defined, instead of 'cancel' it will be appear this custom label. * `boolean` : **cancelAsDefault** - If true, cancel will be the default action (primary button) * `boolean` : **showPopOverForAllMsgTypes** - If there are messages for popover show it even if they're not of error type * `boolean` : **avoidRefreshOnClose** - Avoid refresh page when execution view is closed * `boolean` : **avoidFeedbackMessageOnSave** - Avoid showing the feedback message when saving the execution view. Only the success message * is prevented from showing, both error and warning messages, if they occur, are shown to the user. * `boolean` : **isViewOnly** - Execution View is used only for View purposes * ### Outputs * `ExecutionViewTabDef` : **tabSelect** - Triggered whenever there is a tab change. As an argument it receives the info of the triggered tab, * in an _ExecutionViewTabDef_ object ; * `any` : **init** -Event triggered to inform other components that the execution view is initializing. * Contains as payload an _ExecutionViewEventArgs_ object, which provides info on the basic structure of * the execution view and a callback to continues the execution view lifecycle ; * `any` : **save** - Event triggered when the Save Now button is clicked. Contains as payload an _ExecutionViewEventArgs_ object ; * `any` : **perform** - Event triggered when the Save and Close button is clicked. Will cause the execution view to close * if the service call is successful. Contains as payload an _ExecutionViewEventArgs_ object ; * `any` : **cancel** - Event triggered when the Cancel button is clicked. Contains as payload an _ExecutionViewEventArgs_ object ; * `any` : **afterCancel** - Event triggered when the execution view actually closes. Can be used for cleanup purposes. * Contains as payload an _ExecutionViewEventArgs_ object ; * `void` : **afterClose** - Flag that defines if the cancel button is switched to close after a successful save now ; * * ### Example * To use the component, assume this HTML Template as an example: * * ```HTML * * * * * * ``` * */ export declare class ExecutionView extends CoreComponent implements ng.OnChanges, ng.AfterContentInit, ng.AfterViewInit { private element; private modalInstance; private pageBag; private _validatorModel; private bag; private _loader; /** * the current control displayed in the detailsControl section */ private _currentDetailsComponent; private _detailsRef; /** * The title of the execution view * * @property {string} mainTitle which is delegated to the header component */ private mainTitle; /** * Deprecated title input */ private title; /** * The action-id of the execution view, which will be used as the context for validation. This is normally a string. * * @property {string} context */ private actionId; /** * The action-name of the execution view. * * @property {string} used to describe the name of the atomic action */ private actionName; /** * DEPRECATED: Gets or sets the Execution View Icon */ private icon; /** * The secondary-action-name of the execution view. * * @property {string} used to describe the name of the secondary action */ private secondaryActionName; /** * If defined, instead of 'cancel' it will be appear this custom label. * * @property {string} used to describe the name of the cancel action */ private cancelActionName; /** * Boolean if the save now option have validation or not * */ isSecondaryActionValidationEnabled: boolean; /** * Gets or sets the Execution View Icon */ private iconClass; /** * If the comments are allowed or nor */ isCommentable: boolean; /** * DEPRECATED: If the 'Save Now' button is shown */ private isSaveNowButtonShowed; /** * If the 'Save Now' button is shown */ isSaveNowButtonShown: boolean; /** * If the 'Cancel' button is shown */ isCancelButtonShown: boolean; /** * Flag that defines if the cancel button is switched to close after a successful save now */ switchCancelToClose: boolean; /** * If true, cancel will be the default action (primary button) */ cancelAsDefault: boolean; /** * If there are messages for popover show it even if they're not of error type */ showPopOverForAllMsgTypes: boolean; /** * Avoid refresh on close */ avoidRefreshOnClose: boolean; /** * Stop the feedback message from appearing on the screen when the user closes the * Execution View. This only prevents the Success messages from appearing. Any errors * and warnings that might occur are still shown to the user. */ avoidFeedbackMessageOnSave: boolean; /** * When a tab is selected, notify parent component * * @property {ng.EventEmitter} select event */ private tabSelect; /** * The init event, so the execution view can inform the upper components that it is initiating * * @property {ng.EventEmitter} init event */ private init; /** * The save event, so which will bubble up to the consume, so it can append its async tasks. * * @property {ng.EventEmitter} save event */ private save; /** * The cancel event, so which will bubble up to the consumer, so it can append its async tasks. * * @property {ng.EventEmitter} cancel event */ private cancel; /** * The after cancel event, so the execution view can notify the parent components when it actually cancels * * @property {ng.EventEmitter} cancel event */ private afterCancel; /** * The after close event, so the execution view can notify the parent components it actually closes */ private afterClose; /** * The perform event, so which will bubble up to the consume, so it can append its async tasks. * * @property {ng.EventEmitter} perform event */ private perform; /** * In case there is a non recoverable error, then this Array will be used to feed the messages to display to the user via the ResultMessage component */ _resultMessages: Array; /** * When there is a non recoverable error, then the execution view should be become invalid */ _isInvalid: boolean; /** * When there is a recoverable error, then the execution view shouldn't be closed on Perform */ private _isRecuperableError; /** * After the first Save Now, the foot should show the close button instead of cancel. */ _closeInsteadOfCancel: boolean; /** * Execution View is used only for View purposes */ isViewOnly: boolean; private tabQueryList; private commentsQueryList; private _footer; /** * Get footer component */ readonly footer: ExecutionViewFooter; /** * Get current comments */ readonly _comments: string; /** * Signature enabled */ signatureEnabled: boolean; /** * @method constructor */ constructor(element: ng.ElementRef, modalInstance: ModalViewInstance, pageBag: PageBag, _validatorModel: ValidatorModel, bag: ExecutionViewBag, _loader: ng.NgModuleFactoryLoader); private closeExecutionView; /** * This creates the callback that the user needs to invoke to complete the cycle */ private buildGenericCallBack; /** * Will trigger the an event where all consumers will be able to append their async loading operations while the * screen is blocked by the progress indicator */ private triggerExecutionViewEvent; /** * Get the modal view instance */ getModalInstance(): ModalViewInstance; /** * When the component is initiated, we place the title and icon class in the execution view bag */ ngOnChanges(changes: ng.SimpleChanges): void; /** * Set a tab as visible * @param tabIndex Tab index to set */ setVisibleTab(tabIndex?: number): void; /** * Evaluates the page bag context pre-conditions using the supplied to changes to the context * @param changes Object containing the changes that should be considered on the context, such as {'instance': newInstance} * so that the validation can use the new data * @param finishExecutionViewOnFail (Defaults to true) Finishes the execution view in case that any issue is found on the context evaluation * @returns True if the evaluation was successful, or there was nothing to evaluate */ reEvaluateContextPreConditions(changes?: any, finishExecutionViewOnFail?: boolean): Promise; /** * Stop the progress indicator */ stopProgressIndicator(): void; /** * When all the changes to the component and its children are performed */ ngAfterContentInit(): void; /** * A callback method that is invoked immediately after Angular has completed initialization of a component's view. * It is invoked only once when the view is instantiated. */ ngAfterViewInit(): void; /** * On save now event handler that will trigger the save event. * * @param {Event} [event] saveNow event */ onSaveNow(event: Event): void; /** * On perform event handler that will trigger the perform event, plus will close the execution view. * * @param {Event} [event] perform event */ onPerform(event: Event): void; /** * On cancel event when the footer issues the order to cancel the execution view. The event closes the execution view. * * @param {Event} [event] cancel event */ onCancel(event: Event): void; /** * Opens a modal to edit comments */ openCommentsOpen(): void; /** * This method deals with the ending the ExecutionView. It receives a CompleteWizardArgs object which will be used to determine * if the ExecutionView triggered a non recuperable error or not. When there is an error an this error is recuperable, we just send a feedback message * because the user can retry. If the error is non recuperable, then we invalidate the ExecutionView by allowing only the Cancel. * */ completeExecutionView(resultArgs: ResultEventArgs): void; /** * Add a validator model to the execution view existing validator(s). * * @param validatorModel Validator Model to add. */ addValidatorModel(validatorModel: ValidatorModel, allowNodes?: boolean): void; /** * On tab select notify parent component * * @param {ExecutionViewTabBag} [viewTab] The execution view tab */ onTabSelect(tab: ExecutionViewTabDef): void; setDetailsControl(detailsComponent: ModuleLoaderComponent): void; } export declare class ExecutionViewModule { }