/** Core */ import { CoreComponent } from "cmf.core/src/core"; import { ActionComponent, BaseActionButton } from "cmf.core/src/domain/metadata/action"; import { ResultMessageBag } from "../resultMessage/resultMessageBag"; /** Angular2 */ import * as ng from "@angular/core"; /** * ButtonSize */ export declare enum ButtonSize { Default = 0, Small = 1 } /** * Base Action Abstract Class - Used in ActionButton, ActionButtonGroup, ActionButtonGroupButton */ export declare abstract class BaseAction extends CoreComponent implements ActionComponent, ng.OnInit, ng.OnChanges { elementRef: ng.ElementRef; protected changeDetector: ng.ChangeDetectorRef; protected viewContainerRef?: ng.ViewContainerRef; /** * Action Icon Class */ protected icon: string; /** * Action style */ protected style: string; /** * Action visibility */ protected _isVisible: boolean; /** * Size fo the action button */ protected _buttonSize: ButtonSize; /** * Base action id */ readonly baseActionId: string; /** * Action Button Id- used to link the action and the metadata */ buttonId: string; /** * Action title */ title: string; /** * Action alt */ alt: string; /** * Action is disabled - Defines the action is disabled, this property overrides the isDisabled property */ isDisabledCodeBehind: boolean; /** * Action is disabled - Defines the action is disabled, this property is overridden by the isDisabledCodeBehind property */ isDisabled: boolean; /** * Action class */ class: any; /** * Action actionButton */ actionButton: BaseActionButton; /** * If the base action */ lessRelevant: boolean; protected actionType: string; readonly buttonIcon: string; readonly btnTitle: string; /** * Property _isVisible getter/setter */ isVisible: boolean; /** * Button page left (left limit X coordinate from page axis) */ readonly buttonPageLeft: number; /** * Button page right (right limit X coordinate from page axis) */ readonly buttonPageRight: number; /** * Button width */ readonly buttonWidth: number; /** * Used to define the size of the action button */ buttonSize: ButtonSize | string; showLabel: boolean; constructor(elementRef: ng.ElementRef, changeDetector: ng.ChangeDetectorRef, viewContainerRef?: ng.ViewContainerRef); /** * OnInit - Fetch action data from metadata, initialize button, check disabled state */ ngOnInit(): void; ngOnChanges(changes: ng.SimpleChanges): void; /** * onActionButtonMetadata - Called after fetching metadata action data from metadata */ protected abstract onActionButtonMetadata(button: BaseActionButton): Promise; /** * onIsDisableCheck - Called on disable state check, after fetching metadata action data from metadata */ protected abstract onIsDisableCheck(button: BaseActionButton, context?: any, messagesArray?: (string | ResultMessageBag)[]): Promise; /** * evaluate - (re)evaluate isDisabled state */ evaluate(context?: any, messagesArray?: (string | ResultMessageBag)[]): Promise; /** * Show or hide button */ setVisible(visible: boolean): void; }