/// /** Core */ import { CoreComponent } from "cmf.core/src/core"; import { OnValidate, OnValidateArgs } from '../../directives/validator/validator'; /** Angular2 */ import * as ng from "@angular/core"; /** Kendo */ import "kendo.combobox"; /** * @whatItDoes * ComboBox basic component * * @howToUse * Used to filter and select an item in the provided collection * * ### Inputs * `any[]` : **data** - The data collection, indirectly, used to populate the comboBox component. Must have at least one textual field ; * `string` : **orderField** - The field of the objects in the results that will be used to sort the list ; * `string[]` : **itemsToIgnore** - Array of items to ignore, each element will be matched with the dataNameField of each object in the collection ; * `string` : **name-field** - The object field that should be accessed to get the text to display on the list item ; * `string` : **comparison-field** - Gets or sets the comparison Field. By default is not defined ; * `string` : **enabled-field** - The object field that should be accessed to get the enabled flag on the list item ; * `any` : **value** - Input value ; * `string` : **placeholder** - The text that will appear in the comboBox if the there's no value filled ; * `boolean` : **required** - Required flag ; * `boolean` : **disabled** - Disabled flag ; * `string` : **rowTemplate** - Row template to be used in the comboBox ; * `boolean` : **singleElementPreSelect** - Single element pre select flag . * `boolean` : **allowCustomValue** - Defines if the component should allow user text. Default is 'false'. * * ### Outputs * `any` : **valueChange** - The selected value change event, so the component can inform the upper components that the selected value has changed . * * ### Example * To use the component, assume this HTML Template as an example: * * ```HTML * * ``` * */ export declare class ComboBox extends CoreComponent implements ng.OnInit, ng.OnChanges, ng.OnDestroy, OnValidate { private _element; /** * Component error class */ private static ERROR_CLASS; /** * Current combo box text value * Used to discard changes triggered by kendo when text didn't actually changed */ private _comboBoxTextValue; /** * The field of the objects in the results that will be used to sort the list */ orderField: string; /** * Array of items to ignore, each element will be matched with the dataNameField of each object in the collection */ itemsToIgnore: string[]; /** * The data collection, indirectly, used to populate the comboBox component. Must have at least one textual field. */ data: any[]; /** * Name Tag */ nameTag: string; /** * The text that will appear in the comboBox if the there's no value filled */ placeholder: string; /** * The object field that should be accessed to get the text to display on the list item */ dataNameField: string; /** * Gets or sets the comparison Field. By default is not defined. */ dataComparisonField: string; /** * The object field that should be accessed to get the enabled flag on the list item */ dataEnabledField: string; /** * Row template to be used in the comboBox */ rowTemplate: string; /** * Gets the input value */ /** * Sets both the input value and textValue */ value: any; /** * Gets the disabled Property. */ /** * Sets the disabled Property */ disabled: boolean; /** * Gets the required Property. */ /** * Sets the required Property */ required: boolean; /** * Gets/Sets the singleElementPreSelect Property. */ /** * Sets the singleElementPreSelect Property */ singleElementPreSelect: boolean; /** * Gets/Sets the allowCustomValue Property. */ /** * Sets the allowCustomValue Property */ allowCustomValue: boolean; /** * The selected value change event, so the component can inform the upper components that the selected value has changed * * @property {ng.EventEmitter} init event */ valueChange: ng.EventEmitter; /** * Kendo ui combo box instance that is used by the current component */ private _comboBox; /** * Kendo ui combo box grid Options that is used to configure the combo box */ private _comboBoxOptions; /** * The data collection, used to populate the comboBox component. It's a super set of the original supplied data collection. * * @property {any[]} Array of objects that represent the items that will appear in the select component */ private _componentData; /** * Defines if the element is disabled to be filed */ private _disabled; /** * Defines if the element requires to be filed */ private _required; /** * The currently selected value of the comboBox component * */ private _value; /** * Defines if the component should pre-select when there's only one element available. Default is 'true'. */ private _singleElementPreSelect; /** * Defines if the next selection update will pre-select */ private _preSelect; /** * Defines if the component should allow user text. Default is 'false'. */ private _allowCustomValue; private _comboBoxRef; constructor(_element: ng.ElementRef); /** * Update component data */ private updateComponentData; /** * Update component value based on a string of text * @returns true if the text matched and false otherwise */ private updateValueBasedOnText; /** * Based on the component current value, update combo box selected value */ private updateSelected; /** * Update combo box state */ private updateComboBoxState; /** * Internal Validation Method */ private internalValidation; /** * On Validate method * * @param args Validation arguments given by the framework */ onValidate(args: OnValidateArgs): Promise; /** * Resets the styling option of the validation process * * @see OnValidate interface */ reset(): Promise; /** * On kendo ui ComboBox change event - update value */ onComboBoxChange(args: kendo.ui.ComboBoxChangeEvent): void; onComboBoxSelect(args: kendo.ui.ComboBoxSelectEvent): void; /** * When comboBox component is initiated - set defaults and initial value */ ngOnInit(): void; /** * Setup comboBox */ private setupKendoComboBox; /** * On component destruction - destroy comboBox. */ ngOnDestroy(): void; /** * On changes method */ ngOnChanges(changes: any): void; } export declare class ComboBoxModule { }