import { Component, OnInit } from '@angular/core';
import { ButtonModel } from '../../../models/button/button.model';
import { NotificationModel } from '../../../models/notification';
import { SelectModel } from '../../../models/select/select.model';
@Component({
selector: 'cf-demo-select-1',
template: "
{{title}}:
List of CF Demo Select 1 events:
{{ i + ': ' + selectEvent }}
{{title2}}:
",
styles: [":host { text-align: center; display: flex; flex-direction: column; } cf-select { margin: 20px; } "]
})
export class CfDemoSelect1 implements OnInit {
title: string = "CF Demo Select 1 (with filter)";
title2: string = "CF Demo Select 1 (with HTML options)";
isVisible: Boolean = true;
isDisable: Boolean = false;
isRequired: Boolean = true;
selectEvents: Array = [];
log(ev): void { this.selectEvents.push(ev); }
myFruits = new SelectModel ({
placeholder: 'Selected fruit is: ',
items: [
{itemValue: 'apl', itemLabel: 'Apple'},
{itemValue: 'ban', itemLabel: 'Banana'},
{itemValue: 'wtm', itemLabel: 'Watermelon'},
{itemValue: 'per', itemLabel: 'Pear'},
{itemValue: 'pec', itemLabel: 'Peach'},
{itemValue: 'org', itemLabel: 'Orange'},
{itemValue: 'man', itemLabel: 'Mango'},
{itemValue: 'gra', itemLabel: 'Grapes'},
{itemValue: 'lim', itemLabel: 'Lime'},
{itemValue: 'lem', itemLabel: 'Lemon'}
],
selected: '',
showFilter: true
});
myCurrency: string = 'usd';
myAccounts = new SelectModel ({
placeholder: 'Select currency: ',
items: [
{itemValue: 'usd', itemLabel: 'USD'},
{itemValue: 'eur', itemLabel: 'EURO'},
{itemValue: 'gbp', itemLabel: 'GBP'}
],
selected: this.myCurrency,
showFilter: false
});
letters = 0;
myNotifications: NotificationModel = {
value: this.letters
};
sender = new ButtonModel({
label: "Send mail",
color: {
foreground: "",
background: "primary"
},
icon: null,
icon_position:"right"
});
sendMessage() { ++this.myNotifications.value; }
constructor() {}
ngOnInit() {}
}