/** Core */ import { EventArgs } from "cmf.taura/src/base/base.mediator"; import { CoreComponent } from 'cmf.core/src/core'; import { OnValidate, OnValidateArgs } from '../../directives/validator/validator'; /** Angular2 */ import * as ng from "@angular/core"; export interface ComponentData { index: number; name: string; secondName: string; itemColor: string; obj: any; } /** * @whatItDoes * Select expanded component (list). Used to select an item in the provided collection. * * @howToUse * This component is used with the inputs and outputs mentioned below. * * ### Inputs * `boolean` : **required** - Defines if the control is mandatory or not ; * `any[]` : **data** - The data collection used to populate the select component. Must have a name/text field, passed through property nameField ; * `string` : **nameField** - The object field that should be accessed to get the text to display in the component items ; * `string` : **secondNameField** - The object field that should be accessed to get the sub-text to display in the component items ; * `string` : **colorField** - The object field that should be accessed to get the color to display in the component items ; * `string | boolean` : **value** - The currently selected value . * `boolean` : **disableUnselect** - If true, do not allow unselect. * * ### Outputs * `any` : **valueChange** - Triggered when the value change . * * ### Example * To use the component, assume this HTML Template as an example: * * ```HTML * * * * ``` * */ export declare class SelectExpanded extends CoreComponent implements ng.OnInit, OnValidate { /** * Component error class. */ private static ERROR_CLASS; /** * Selected item class. */ private static SELECTED_ITEM_CLASS; /** * The data collection used to populate the select component. Must have a name/text field, passed through property nameField. * * @property {any[]} Array of objects that represent te items that will appear in the component */ private _data; /** * Defines if the component is required to be filled by the user * * @property {boolean} */ private _required; /** * The data collection, used to populate the Select component. Its 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 */ _componentData: Array; /** * The index of the currently selected value */ private _valueIndex; /** * The currently selected value */ private _value; /** * The selected value change event, so the component can inform the upper components that the selected value has changed * * @property {ng.EventEmitter} init event */ valueChanged: ng.EventEmitter; /** * The object field that should be accessed to get the text to display in the component items * * @property {string} the field designation */ nameField: string; /** * The object field that should be accessed to get the sub-text to display in the component items * * @property {string} the field designation */ secondNameField: string; /** * The object field that should be accessed to get the color to display in the component items * * @property {string} the field designation */ colorField: string; /** * The object field that should be accessed to set if unselect is NOT possible * * @property {boolean} the field designation */ disableUnselect: boolean; /** * Classes to be applied to the component */ componentClasses: any; /** * Property _isRequired getter * * @return {boolean} current value of property _required */ /** * Property _required setter * * @param {string | boolean} [value] new value for property _required */ required: string | boolean; /** * Property value getter * * @return {any} current value */ /** * Property value setter * * @param {any} [value] new value */ value: any; /** * Property value index getter * * @return {any} current value for property transitions value index */ /** * Property value index setter. This method also sets the value property * * @param {any} [value] new value for property transitions value index */ valueIndex: any; /** * Property data getter * * @return {any[]} current value for property data */ /** * Property data setter * * @param {any[]} [value] new value for property data */ data: any[]; constructor(); /** * Based on property data, set component data */ private setComponentData; /** * Using the current value, set the selected item */ private setSelectedByValue; /** * Validate component and apply error classes */ private internalValidation; /** * Item class - applies when item is selected * * @return {string} class to be used in the row */ itemClass(element: ComponentData): string; /** * Item attribute - applies when item is selected * * @return {string} state if the row is selected or not */ itemSelection(element: ComponentData): string; /** * 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; /** * When list is clicked - update selected value and perform validation * * @param {Taura.EventArgs} [event] object containing event data * @param {any} [selectedItem] date time picker current value */ onClick(event: EventArgs, selectedIndex: any, selectedItem: any): void; /** * When select component is initiated - set defaults and initial value */ ngOnInit(): void; } export declare class SelectExpandedModule { }