///
/** Angular 2 */
import * as ng from "@angular/core";
import { FormGroup } from '@angular/forms';
/** Core */
import { CoreComponent, EventArgs } from "cmf.core/src/core";
import Cmf from "cmf.lbos";
import { OnValidateArgs, OnValidate } from "cmf.core.controls/src/directives/validator/validator";
/** Kendo */
import "kendo.autocomplete";
/**
* Find entity onSelect event args
*/
export interface FindStaticSelectEventArgs extends EventArgs {
result: Cmf.Foundation.Common.Base.CoreBase;
}
/**
* Allows a user to search for a given static type by a given query.
*
* Important note: data and query properties are mutually exclusive.
*
* By default fields like 'Id', 'Name', 'Description', 'Version', 'LastServiceHistoryId' are retrieved. To retrieve more fields
* use the property "data-fields" to specify more.
*
* ### Example
*
* ```
*
* ```
*/
/**
* Allows a user to search for a given entity type by a given query.
*
* Important note: data and query properties are mutually exclusive.
*
* By default fields like 'Id', 'Name', 'Description', 'Version', 'LastServiceHistoryId' are retrieved. To retrieve more fields
* use the property "data-fields" to specify more.
*
* ## Inputs
*
* * **search-field**: Gets or sets the used searchable field. By default it uses "Name"
* * **data-text-field**: Text field that will be displayed in the component when an item is selected
* * **data**: Searching pool. If defined no query to the server will be made.
* * **data-fields**: Additional entity fields to be retrieved by the control.
* * **additionalFilters**: Additional filters
* * **required**: Defines if the value is mandatory to be filled
* * **disabled**: Sets the disabled property
* * **value**: Currently selected entity type instance. This property changes when the user interacts with the component
* * **orderField**: The field of the objects in the results that will be used to sort the list
*
* ## Outputs
* * **valueChange**: The selected value change event, so the component can inform the upper components that the selected value has changed
*
* ### Example
*
* ```
*
* ```
*/
export declare class FindStatic extends CoreComponent implements ng.OnChanges, ng.OnInit, ng.OnDestroy, OnValidate {
private _elementRef;
/**
* Internal Find Static Id, useful for connecting with kendo ui Auto Complete dropDown.
*/
private _internalId;
/**
* Static Type reference type
*/
_referenceType: Cmf.Foundation.Common.ReferenceType;
/**
* Query object to be used in the lbo call. This property is defined by the component input or using the queryBuilder().
*/
private _queryToExecute;
/**
* Static type constructor. To be used to create instances of a specific static type
*/
private _staticTypeConstructor;
/**
* Angular form control group that wraps the component
*/
_form: FormGroup;
/**
* Kendo ui auto complete options that is used to configure the kendo web components
*/
private _autocompleteOptions;
/**
* The kendo dataSource for the current component. Must have the following structure (examples):
*
* @property {kendo.data.DataSource} DataSource Object
*/
private _ds;
/**
* Kendo ui auto complete reference
*/
private _kendoAutoComplete;
/**
* Clear button classes
*/
_clearClasses: any;
/**
* Search button classes
*/
_searchClasses: any;
/**
* Component currently has a selected instance
*/
private _hasSelectedInstance;
/**
* This array will conceal all registered static types that the component is able to work with
*/
private _registeredServices;
/**
* The service implementation used for the component which will be set once the static type name is resolved
*/
private _service;
/**
* does this control have errors
*/
_hasErrors: boolean;
/**
* anchor for the autocomplete
*/
private _autoCompleteRef;
/**
* Static type full namespace to be used in the nested cmf-core-business-controls-navigation component
*/
staticTypeName: string;
/**
* Gets or sets the used searchable field. By default it uses "Name"
*/
querySearchableFieldName: string;
/**
* Text field that will be displayed in the component when an item is selected
*/
dataTextField: string;
/**
* Static data that is provided to the component to prevent server round-trips
*/
staticData: any[];
/**
* Navigable
*/
navigable: boolean;
/**
* Additional entity fields to be retrieved by the control.
* ### Example
*
* ```
*
* ```
*/
additionalFields: string[];
/**
* Additional filters
*/
additionalFilters: Cmf.Foundation.BusinessObjects.QueryObject.Filter[];
/**
* Determines if the present component need to have a value
*/
isRequired: boolean;
/**
* DEPRECATED: Sets the disabled property
*/
isDisabled: boolean;
/**
* Sets the disabled property
*/
disabled: boolean;
/**
* Currently selected static type instance. This property changes when the user interacts with the component
*/
value: Cmf.Foundation.Common.Base.CoreBase | string;
/**
* The field of the objects in the results that will be used to sort the list
*/
orderField: string;
/**
* If tokens are supported
*/
supportTokens: boolean;
/**
* The selected value change event, so the component can inform the upper components that the selected value has changed
*/
valueChange: ng.EventEmitter;
constructor(_elementRef: ng.ElementRef);
/**
* This method registers all services to handle each static type
* @param servicePath path to the static service module
* @param serviceClass class name that will handle the service operations of a specific static type
*/
private use;
/**
* This method checks the static type passed as an input and validates it
* If the static type is valid, it loads the proper service to be used as a delegate to upcoming tasks (loading, filtering, ...)
* @param staticTypeNameToResolve
*/
private resolveService;
/**
* This method defines kendo auto complete template and bindings
*/
private configureKendoOptions;
/**
* Handles the output generated by the service call - creates the field "fields" in each item that
is a flatten string representation of all the objects fields, except the header fields
*
* @param {any} [dataSet] NGPDataset normally
* @return {any} Appended objects
*/
private handleDataOutput;
/**
* Internal Validation Method
*/
private internalValidation;
/**
* Toggles the visibility of the progress indicator
*/
private toggleProgressIndicator;
/**
* Update Kendo auto complete data source - Based on the current query
*/
private updateDataSource;
/**
* Update value - based on user input through auto-complete
*/
private updateValue;
/**
* Set value - based on data binding
*/
private setValue;
/**
* Update combo box state
*/
private updateFindStaticState;
/**
* When the user clicks in the search button - executes search with the current text as input
*
* @param {kendo.ui.AutoComplete} [args] Kendo UI Autocomplete
* @method onSearchClick
*/
onSearchClick(autocomplete: HTMLInputElement): void;
/**
* When the autocomplete closes - happens when the input looses focus
*
* @param {kendo.ui.AutoCompleteSelectEvent} [args] Kendo UI Autocomplete Select Event arguments
* @method onSelect
*/
protected onClose(args: kendo.ui.AutoCompleteCloseEvent): void;
/**
* When the user selects an item from the list - selects a new entity type instance
*
* @param {kendo.ui.AutoCompleteSelectEvent} [args] Kendo UI Autocomplete Select Event arguments
* @method onSelect
*/
protected onSelect(args: kendo.ui.AutoCompleteSelectEvent): void;
/**
* When the user clicks in the clear button - clears selection
*
* @param {kendo.ui.AutoComplete} [args] Kendo UI Autocomplete
* @method onClearClick
*/
onClearClick(autocomplete: HTMLInputElement): void;
/**
* When the component displays the list of items - clears the selected instance
*
* @param {kendo.ui.AutoComplete} [args] Kendo UI Autocomplete Open Event arguments
* @method onOpen Kendo UI Autocomplete
*/
protected onOpen(args: kendo.ui.AutoCompleteOpenEvent): void;
/**
* On Validate method
*/
onValidate(args: OnValidateArgs): Promise;
/**
* Resets the styling option of the validation process
*
* @see OnValidate interface
*/
reset(): Promise;
/**
* When the component input looses focus - validate
*
* @param {kendo.ui.AutoComplete} [args] Kendo UI Autocomplete Open Event arguments
*/
onBlur(args: Event, value: any): void;
/**
* When component is initiated - check if entity type name is defined
*/
ngOnInit(): void;
/**
* On component destruction - destroy kendo auto complete.
*/
ngOnDestroy(): void;
/**
* When the component changes - set query. kendo ui autocomplete options and data text field
*/
ngOnChanges(changes: any): void;
}
export declare class FindStaticModule {
}