/** Core */ import { EventArgs } from "cmf.taura/src/base/base.mediator"; import { CoreComponent } from "cmf.core/src/core"; /** Angular2 */ import * as ng from "@angular/core"; export interface ComponentData { index: number; name: string; class: string; fontImgClass: string; obj: any; enabled: boolean; visible: boolean; popOverText: string; } /** * List type enum. */ export declare enum ListSelectedItemBorderLocation { Top = 0, Right = 1, Bottom = 2, Left = 3, None = 4 } /** * List content type enum. */ export declare enum ListItemContentType { Img = 0, Text = 1, Both = 2 } /** * List content type enum. */ export declare enum ListItemType { Horizontal = 0, Vertical = 1 } /** * @whatItDoes * Select list (tab like) component. Used to select an item in the provided collection. * * @howToUse * This component is used with the inputs and outputs mentioned below. * * ### Inputs * `any` : **value** - The currently selected value of the Select component ; * `any[]` : **data** - The data collection used to populate the select component. Must have at least two fields: 'value' field and a 'text' field ; * `string` : **name-field** - The object field that should be accessed to get the text to display in the component items ; * `string` : **value-field** - The object field that should be accessed to set the current value ; * `string` : **enable-field** - The object field that should be accessed to determine if the item is enabled ; * `string` : **visible-field** - The object field that should be accessed to determine if the item is visible ; * `string` : **pop-over-text** - The object field that should be accessed to get the text to display in the popover; * `string` : **font-img-class-field** - The object field that should be accessed to get the image font to be displayed in the component items ; * `ListSelectedItemBorderLocation | string` : **list-item-border-location** - The component list item border location. * This property is used to define where the active border will appear ; * `ListItemType | string` : **list-item-type** - The component layout orientation type ; * `boolean` : **breadcrumb** - If this component should be used as a breadcrumb component ; * `boolean` : **isDraggable** - If this component should be draggable . * `boolean` : **showOnlyIcons** - If only the icons should appear. Not mandatory. Default is false. * * ### Outputs * `string` : **valueChange** - The selected value change event, so the component can inform the upper components that the selected value has changed ; * `string` : **dragStart** - The selected item drag start event ; * `string` : **selectItem** - An item was selected by double click . * * ### Example * To use the component, assume this HTML Template as an example: * * ```HTML * * * ``` * */ export declare class SelectList extends CoreComponent implements ng.OnChanges, ng.OnInit, ng.AfterViewInit { /** * Defines if the component is required to be filled by the user */ private _isRequired; /** * The component list item border location. This property is used to define where the active border will appear */ private _listSelectedItemBorderLocation; /** * Gets or sets the component layout orientation type */ private _listItemType; /** * Stores the element query */ private _elementQuery; /** * The data collection used to populate the select component. Must have at least two fields: 'value' field and a 'text' field. */ data: any[]; /** * The currently selected value of the Select component */ value: any; /** * The data collection, used to populate the Select component. Its a super set of the original supplied data collection. */ _componentData: ComponentData[]; /** * The selected element from the component data collection */ _componentDataSelectedElement: ComponentData; /** * The selected element index from the component data collection */ _componentDataSelectedElementIndex: number; /** * Item size */ itemSize: string; /** * The component list item border location. This property is used to define where the active border will appear */ listSelectedItemBorderLocation: ListSelectedItemBorderLocation | string; /** * Gets or sets the component layout orientation type */ listItemType: ListItemType | string; /** * Gets or sets if this component should be used as a breadcrumb component. */ isBreadcrumb: boolean; /** * Gets the input type */ readonly steps: any; /** * Gets or sets if this component should be draggable */ isDraggable: boolean; private _showOnlyIcons; /** * Gets the variable which controls if only icons are to be shown */ /** * Sets the variable which controls if only icons are to be shown */ showOnlyIcons: boolean; /** * The object field that should be accessed to get the text to display in the component items */ dataNameField: string; /** * The object field that should be accessed to set the current value. */ dataValueField: string; /** * Gets or sets the Data Enable Field */ dataEnabledField: string; /** * Gets or sets the Data Visible Field */ dataVisibleField: string; /** * The object field that should be accessed to get the image font to be displayed in the component items */ dataFontImgClassField: string; /** * Class of the icon */ itemTypeClass: string; /** * Text that will appear as popover content - if no text supplied popOver won't appear */ dataPopOverTextField: string; /** * 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; /** * The selected item drag start event */ dragStart: ng.EventEmitter; /** * An item was selected by double click */ selectItem: ng.EventEmitter; constructor(); /** * Set internal component data. */ private setComponentData; /** * Set the selected element form the component data collection */ private setSelectedComponentData; /** * Update tile size based on width */ private updateItemSize; /** * On List click - update selected value * * @param {Taura.EventArgs} [event] object containing event data * @param {ComponentData} [selectedItem] Currently selected component data */ onListItemClick(event: EventArgs, selectedItem: ComponentData): void; /** * On List double click. * Dispatch an event with selected item * * @param [event] object container event data * @param [selectedItem] Currently selected component data */ onListItemDoubleClick(event: EventArgs, selectedItem: ComponentData): void; /** * On List item drag start - ? * * @param [event] object containing event data * @param [selectedItem] Currently selected component data */ onListItemDragStart(event: DragEvent, selectedItem: ComponentData): void; /** * When select component is initiated - set defaults and initial value */ ngOnInit(): void; /** * Set the event handler for the content resize change */ ngAfterViewInit(): void; /** * On changes - update filtered widget list */ ngOnChanges(changes: any): void; } export declare class SelectListModule { }