/** Core */
import { CoreComponent } from "cmf.core/src/core";
import { DataGridBusinessColumn } from "../dataGrid/dataGrid";
import { OnValidate, OnValidateArgs } from "cmf.core.controls/src/directives/validator/validator";
/** Angular */
import * as ng from "@angular/core";
import * as ngRouter from "@angular/router";
/** LBOS */
import { Cmf } from "cmf.lbos";
/**
* ChangeSet selected arg. To be sent to parent component
*/
export interface ChangeSetSelectedArgs {
ChangeSet: Cmf.Foundation.BusinessObjects.ChangeSet;
ApproverRole?: Cmf.Foundation.Security.Role;
}
/**
* Enumeration of the origin of the ChangeSet Selector usage
*/
export declare enum ChangeSetOriginContext {
CREATE = 0,
CLONE = 1,
IMPORT = 2
}
/**
* Minimum width until the component appear in 2 rows (input + button)
*/
export declare const CHANGESET_MAX_WIDTH = 290;
/**
* @whatItDoes
*
* This components allows the selection of a change set. It's meant to be used on a wizard (e.g.Create entity).
*
* @howToUse
*
* This component is used with the inputs and outputs mentioned below.
*
* ### Inputs
* `Object` : **instance** - Instance which will be approved by the chosen Change Set
* `ChangeSetOriginContext` : **context** - Optional input that tells where it's used.
*
* ### Outputs
* `Object` : **changeSetChanged** - When the information related to the Change Set changes, emits the new value.
*
* ### Example
* To use the component, assume this HTML Template as an example:
*
* ```HTML
*
*
* ```
*
* ### _NOTES_ (optional)
* A exception is logged if the instance used is not versionated.
*
* @description
*
* ## ChangeSetSelector Component
*
* ### Dependencies
*
* #### Components
* * PropertyEditor : `cmf.core.business.controls`
* * DataGridBusiness : `cmf.core.business.controls`
* * BaseWidget : `cmf.core.controls`
*
* #### Directives
* * Validator : `cmf.core.controls`
* * ElementQuery : `cmf.core.controls`
*
*/
export declare class ChangeSetSelector extends CoreComponent implements ng.OnChanges, OnValidate, ng.AfterViewInit, ng.OnDestroy {
private _ngRouter;
private _elementRef;
/**
* EntityType
*/
private _entityType;
/**
* Gets the ElementQuery element.
*/
private _elementQuery;
/**
* Event size subscription
*/
private _componentSizeSubscription;
/**
* Show approver role edition. Default is true.
* Its false when its a clone and its a non-versioned entity
*/
_showApproverRoleEditor: boolean;
/**
* Target instance.
*/
instance: Cmf.Foundation.BusinessObjects.Entity;
/**
* EntityType metadata: allowImplicitChangeSet. Loaded with metadata.
*/
allowAutomaticChangeSet: boolean;
/**
* Use automatic changeSet. Appears to user when the entityType allows implicit changeSet.
* If set to true, its not necessary to provide a changeset.
*/
useAutomaticChangeSet: boolean;
/**
* Target changeSet.
*/
changeSet: Cmf.Foundation.BusinessObjects.ChangeSet;
/**
* ChangeSet items. To be shown on grid.
*/
changeSetItems: Cmf.Foundation.BusinessObjects.ChangeSetItem[];
/**
* Approver role selected by user. It's optional.
*/
approverRole: Cmf.Foundation.Security.Role;
/**
* Information provided to datagrid related to column content.
*/
gridColumns: DataGridBusinessColumn[];
/**
* Show information about why change set selector is used when DisplayChangeSetOnClone is set to true
*/
showDisplayChangeSetOnClone: boolean;
/**
* Query used to fetch changeSets.
* Necessary to pass a valid changeSet for services.
* Performance reasons, only fetch the first 30.
*/
changeSetQueryObject: Cmf.Foundation.BusinessObjects.QueryObject.QueryObject;
/**
* Event to pass by context if the button create change set is clicked
*/
eventEmitter: ng.EventEmitter;
/**
* Event emmiter.
*/
changeSetChanged: ng.EventEmitter;
/**
* Tells the context where this component is used. By default this is used in Create wizards.
* When the context is Clone, checks info about the DisplayChangeSetOnClone
*/
context: ChangeSetOriginContext;
/**
* Remove padding space when propertyEditor custom has less than CHANGESET_MAX_WIDTH
*/
removeButtonPadding: boolean;
/**
* Constructor
*/
constructor(viewContainerRef: ng.ViewContainerRef, _ngRouter: ngRouter.Router, _elementRef: ng.ElementRef);
private loadEntityMetadata;
private getQueryForChangeSet;
/**
* On changes method
*/
ngOnChanges(changes: ng.SimpleChanges): void;
/**
* Set the event handler for the content resize change
*/
ngAfterViewInit(): void;
/**
* On Destroy Angular handler
*/
ngOnDestroy(): void;
/**
* On click Create button.
* Navigates to ChangeSet.Create.
*/
onCreateChangeSet(): void;
/**
* ChangeSet changed event.
* Loads changeSet items if changeSet is selected or cleans information if changeset selection was removed.
*/
onSelectedChangeSetChanged(event: any): void;
/**
* On set automatic changeSet.
* If set true, clean information about choosed changeSet.
* Emits value to parent
*/
onSetAutomaticChangeSet(event: any): void;
/**
* On approver role changed, emit new value.
*/
onApproverRoleChanged(event: any): void;
/**
* Validation logic.
* Is valid if a changeSet is provided or if useAutomaticChangeSet is true
*/
onValidate(args: OnValidateArgs): Promise;
/**
* Created object to be emited to other components.
*/
emitChangeSet(): ChangeSetSelectedArgs;
}
export declare class ChangeSetSelectorModule {
}