import { OnInit, Renderer, EventEmitter, ElementRef, QueryList } from '@angular/core'; import { CfCoreComponent } from '../core/core.component'; import { IconModel } from '../../models/icon/icon.model'; import { SelectModel } from '../../models/select/select.model'; import { SelectOptionModel } from '../../models/select/select-option.model'; import { SelectStylingModel } from '../../models/select/select-styling.model'; import { CfSelectOptionComponent } from '../select-option/select-option.component'; import { TemplateService } from '../../services/template-service/template.service'; /** *
CF Select Component
*
*
* import {{'{'}} SelectModel {{'}'}} from 'cedrus-fusion'
* import {{'{'}} SelectStylingModel {{'}'}} from 'cedrus-fusion'
* <cf-select></cf-select>
*
*
*/
export declare class CfSelectComponent extends CfCoreComponent implements OnInit {
private _renderer;
/**@hidden */ elementRef: ElementRef;
/**@hidden
* Bind class to component :host itself
*/
notificationClickable: string;
/**@hidden
* List of children options from html view
*/
contentOptions: QueryListExample of SelectModel Class:
*{{'{'}}
* placeholder: 'Select fruit: ',
* staticPlaceholder: 'Open list',
* optionsSource: 'fromModel',
* options: [
* {{'{'}} val: 'apl', text: 'Apple' {{'}'}},
* {{'{'}} val: 'ban', text: 'Banana' {{'}'}},
* {{'{'}} val: 'che', text: 'Cherry' {{'}'}}
* ],
* selected: 'che',
* showFilter: false,
* showIcon: false,
* iconProperty: this.myFruitsIcon,
* iconChangeable: false,
* required: false,
* multiple: true,
* dropdownUnder: true,
* optionValueField: 'val',
* optionLabelField: 'text',
* optionItemField: null,
* optionIconField: null
* {{'}'}}
* Placeholder text
*Not changable static placeholder text
*Options source type
*Array with options
*Select component must have some selected item and it is value of item property described in itemValue
*Show/Hide filter
*Show/Hide icon
*Icon
*If main icon can be changed with selected option icon
*Required
*Options multipleselection
*If select dropdown must be under it placeholder
*Option property name to be used as option value
*Option property name to be used as select text when option is selected and as option text if item property is not specified
*Option property name to be used as option item
*Option property name to be used as option icon
*/ properties: SelectModel; /** *{{'{'}}
* // styling of the container surrounding the select
* container: {{'{'}}
* dynamic class: function() -> string, //function that returns a string of the name of the class
* class: string //name of the class specified in you scss/css file
* {{'}'}},
* // Styling of select trigger by StylingModel
* select: {{'{'}}
* dynamic class: function() -> string,
* class: string ,
* themeColor: string , // primary/accent/warn
* {{'}'}},
* // Styling of filter by StylingModel
* filter: {{'{'}}
* dynamic class: function() -> string,
* class: string
* {{'}'}},
* // Styling of options by StylingModel
* options: {{'{'}}
* dynamic class: function() -> string,
* class: string
* {{'}'}},
* // Styling of static placeholder by StylingModel
* staticPlaceholder: {{'{'}}
* dynamic class: function() -> string,
* class: string
* {{'}'}},
* // Styling of dropdown panel by StylingModel
* dropdownPanel: {{'{'}}
* dynamic class: function() -> string,
* class: string
* {{'}'}}
*{{'}'}}
*
*/
styling: SelectStylingModel;
/**
*Text for placeholder
*/ placeholder: string; /** *Not changable static placeholder text
*/ staticPlaceholder: string; /** *Source of options. For current time can be only fromModel and means that options will be set by SelectModel call. If that property is not specified it means that options will be created from the view.
*/ optionsSource: string; /** *Array with options to be send to SelectModel
*/ options: SelectOptionModel[]; /** *Value to select some option
*/ selected: any; /** *If to show filter in dropdown list
*/ showFilter: boolean; /** *If to show select icon
*/ showIcon: boolean; /** *IconModel object
*/ iconProperty: IconModel; /** *If main icon can be changed with selected option icon
*/ iconChangeable: boolean; /** *If select is required
*/ required: boolean; /** *If select has multipleselection options
*/ multiple: boolean; /** *If select dropdown must be under it placeholder
*/ dropdownUnder: boolean; /** *Option property name to be used as option value
*/ optionValueField: string; /** *Option property name to be used as select text when option is selected and as option text if item property is not specified
*/ optionLabelField: string; /** *Option property name to be used as option item
*/ optionItemField: string; /** *Option property name to be used as option icon
*/ optionIconField: string; /** *Event to call when Select dropdown list was opened
*/ onOpen: EventEmitterEvent to call when value of Select was changed
*/ onChange: EventEmitterEvent to call when Select dropdown list was closed
*/ onClose: EventEmitterValue of the Filter input by which whole dropdown list items will be filtered
*/ cfFilterBy: string; /**@hidden * True or false whether md-select is focused */ selectIsFocused: boolean; /**@hidden * Object to register element state and compute differences. */ /**@hidden*/ _lastOffsetLeft: any; /**@hidden * It is method which will emit corresponding event when Select dropdown list was opened. */ selectOpened(): void; /**@hidden */ writeValue(obj: any): void; /**@hidden */ registerOnChange(fn: any): void; /**@hidden */ registerOnTouched(fn: any): void; /**@hidden */ setDisabledState(isDisabled: boolean): void; /**@hidden */ onValueChange: any; /**@hidden */ onTouched: any; /**hidden * It is method which will emit corresponding event when value of Select was changed. */ selectChanged(): void; /**hidden * It is method which will emit corresponding event when Select dropdown list was closed. */ selectClosed(): void; /**hidden * It is function for creating Notification click events by using Core Component notificationAction event emmiter. * @param notification it is json notification object */ cfNotificationAction(notification: any): void; /**@hidden */ resetSelect(): void; /**@hidden */ constructor(_renderer: Renderer, /**@hidden */ elementRef: ElementRef, /**@hidden */ templateService: TemplateService); /**@hidden * It will be generated cfSelect object and rendered inside component template. */ ngOnInit(): void; /** @hidden * Function for filter dropdown options list * @param searchVal string text value by which dropdown options list will be filtered */ filterOptions(searchVal: any): any; /**@hidden * Function to reflect selected option icon into select icon */ reflectIcon(): void; /**@hidden * Method to check each single option item if it has template (html content) */ _checkTemplates(): void; /** @hidden * Function to check if md-select element is focused and adding class 'cf-select-is-focused' to main component div * @param is boolead true or false whether md-select is focused */ setFocused(is: any): void; /**@hidden * Function to move dropdown panel under the select trigger */ makeDropdownUnder(): void; /**@hidden*/ checkUnderline(): void; /**@hidden * Method to set 'mat-selected' class to the option.cf-option-data when option is selected * @param option option object */ checkIfSelected(option: any): "" | "mat-selected"; }