/** Core */ import { CoreComponent } from "cmf.core/src/core"; /** Nested modules */ import { ComparisonMode, DropdownElement } from "../dropdown/dropdown"; /** Kendo */ import "kendo.core"; /** Angular */ import * as ng from "@angular/core"; /** * Dropdown possible states */ export declare enum DropdownState { Open = 0, Close = 1 } /** * @whatItDoes * This component shows is a Combobox that allows to select multiple values to an array * * @howToUse * This component is used with the inputs and outputs mentioned below. * * * ### Inputs * `string` : **dataNameField** - Field to apply to the item on doing search string comparison. If not defined it will * attempt to search by the item itself as if items was a string[] * `string` : **dataDescriptionField** - Item field to fetch the description from * `string` : **dataGroupField** - Item field to fetch the group from * `string[]` : **inputExclusions** - An array of items to exclude from the input - usefull when preventing some of the selected items to appear in the input * `any[]` : **data** - An array of items to the displayed. * `string` : **rowTemplate** - Row template to be used in the comboBox. String with HTML. Ex: #: data.text # * `any[]` : **preSelectedData** - An array of items to be Pre Selected * `function` : **compareFunctionForSelection** - A compare function to be used for dropdown item selection * `ComparisonMode` **comparisonMode** - Comparison mode to be used by default is Strict * * * ### Outputs * `any` : **valueChange** - Triggered when the value change * * ### Example * To use the component, assume this HTML Template as an example: * * ```HTML * * * ``` * * * @description * * ## MultiCombobox Component * * ### Dependencies * * Dropdown: `cmf.core.controls` * * MultiStringInput: `cmf.core.controls` * * #### Directives * * ElementQueryModule : `cmf.core.controls` * * #### Pipes * * UnsafeHTMLModule: `cmf.core.controls` * * */ export declare class MultiComboboxInput extends CoreComponent implements ng.OnChanges, ng.AfterViewInit, ng.OnInit { private viewContainerRef; /** * Stores the element query */ private _elementQuery; /** * Nested Dropdown component */ private _dropdown; /** * Nested MultiStringInput Component */ private _multiStringInput; /** * Nested dropdown comparison mode */ private _comparisonMode; /** * Items that will be disabled in the dropdown * If complex object supplied will compare with the supplied data name field (for instance the name) */ disabledItems: string[]; /** * Items in the dropdown that won't have a checkbox and won't be interactable * If complex object supplied will compare with the supplied data name field (for instance the name) */ notSelectableItems: string[]; /** * Comparison mode used for selection, by default is Strict meaning that === will be used. */ comparisonMode: ComparisonMode; /** * Defines of the input is mandatory */ _required: boolean; /** * Gets the required property. */ /** * Sets the required property */ required: boolean; /** * Field is disabled */ _disabled: boolean; /** * Gets the disabled property. */ /** * Sets the disabled property */ disabled: boolean; /** * Dropdown items */ data: any[]; /** * Compare function that will be used for item selection on drop down */ compareFunctionForSelection: (targetItem: string, compareObj: any) => boolean; /** * The data that must be preSelected */ preSelectedData: any[]; /** * Field to get from the object to determine the name to display */ dataNameField: string; /** * FItem field to fetch the description from */ dataDescriptionField: string; /** * Item field to fetch the group from */ dataGroupField: string; /** * HTML Template to apply to items */ rowTemplate: string; /** * Selected dropdown strings */ _multiSelectedItems: string[]; /** * Items to exclude from the input * Used in some scenarios where the dropdown list doesn't match the * elements that can appear in the input */ inputExclusions: string[]; /** * MultiStringInput Value */ _value: string[] | string; /** * String item focused */ _highlightedItem: string; /** * Index of item focused */ highlightIndex: number; /** * Data filtered */ _filteredItems: any; /** * Currently selected data */ selectedData: any[]; /** * Dropdown Width */ _dropdownWidth: any; /** * Value Changed */ valueChange: ng.EventEmitter; /** * Constructor * * @param viewContainerRef the reference to the component view container */ constructor(viewContainerRef: ng.ViewContainerRef); /** * Based on the supplied data and the available configurations setups the items * If "dataGroupField" is supplied will create the appropriate grouping (extra item with specific template) * If "dataNameField" and "dataDescriptionField" is supplied will set the appropriate template */ private setupItems; /** * On changes method * Kendo template implementation * * @param changes the changes made to the component properties */ ngOnChanges(changes: ng.SimpleChanges): void; /** * Update selection based on the currently selected items and input exclusions */ updateSelection(): void; /** * On Init * Sets the dropdown width to be the same as the dropdown insert box */ ngOnInit(): void; /** * Set the event handler for the content resize change * Calculates the dropdown width to be the same as the dropdown insert box */ ngAfterViewInit(): void; /** * Searches for the best match in the data * @param value Entered value */ onInputFilter(value: string): void; /** * On item selected saves new value * @param newSelectedItems Array of selected items */ itemSelect(newSelectedItems: DropdownElement[]): void; /** * Value change from MultiStringInput * @param updateValues */ onValueChange(updateValues: string[]): void; /** * Tab or Enter key down */ onTabEnterPress(): void; /** * Gets the next available index * @param notSelectableItems Arrays of not selectable items * @param items Original array * @param currentIndex Current index - starting point * @param dataNameField Data name field */ getNextAvailableIndex(notSelectableItems: string[], items: any[], currentIndex: number, dataNameField: string, increment?: number): number; /** * Arrow Down focus item */ onArrowDown(): void; /** * Arrow Up focus item */ onArrowUp(): void; /** * Dropdown Closes removes focus * @param event */ onDropdownClose(event: any): void; /** * Drodown Opens focus first element * @param event */ onDropdownOpen(event: any): void; } export declare class MultiComboboxInputModule { }