import { Component } from '@angular/core'; import { CfInputComponent } from '../input.component'; import { NotificationModel } from '../../../models/notification'; import { InputModel } from '../../../models/input/input.model'; import { InputStylingModel } from '../../../models/input/input-styling.model'; import { IconModel } from '../../../models/icon/icon.model'; import { IconStylingModel } from '../../../models/icon/icon-styling.model'; import { ButtonModel } from '../../../models/button/button.model'; import { MenuModel } from '../../../models/menu/menu.model'; import { MenuItemModel } from '../../../models/menu/menu-item.model'; @Component ({ selector : 'cf-demo-input-1', template: " ", styles: ["p { margin-right: 16px; } cf-input { margin: 10px; } /deep/ .redInput { color: red; } /deep/ .orangeIcon { color: orange; } "] }) export class CfDemoInput1 { input2= new InputModel ({ type : "text", placeholder: " amount( USD )", prefix : "$", iconProperty: new IconModel ({ name: "fa-usd", size: "20px" }), iconPosition:"left" }); inputStyling2 = new InputStylingModel({ input:{ class:"redInput" }, iconStyling: new IconStylingModel ({ icon: { class: "redInput" } }) }); input3= new InputModel ( { type : "text", placeholder: "Accent", dividerColor : "accent", menu: new MenuModel({ menuItems:[ { buttonProperty: new ButtonModel({ label: 'Menu item 1', icon: new IconModel ({ name: 'fa-apple', size: '24px' }) }), divider: true, notification: '7', display: true, disable: false, onClick: this.clickFunc.bind(this) }, { buttonProperty: new ButtonModel({ label: 'Menu item 2', icon: new IconModel ({ name: 'thumb_up', size: '24px' }) }), notification: '', onClick: this.clickFunc.bind(this) } ]}) }); input4= new InputModel ({ type : "text", placeholder: "Warning", dividerColor : "warn", iconProperty: new IconModel ({ name: "fa-exclamation-triangle", size: "20px" }), iconPosition:"right" }); inputStyling4 = new InputStylingModel({ iconStyling: new IconStylingModel ({ icon: { class: "orangeIcon" } }) }); input5= new InputModel ({ type : "password", placeholder: "password", maxlength : "10", hint : { text : "from 1 to 10 chars", align : "start" } }); clickFunc(menuItem: MenuItemModel): void { this.input3.value = menuItem.buttonProperty.label; } letters = 0; myNotifications: NotificationModel = { value: this.letters }; sender = new ButtonModel({ label: "Send mail", icon: null, icon_position:"right" }); sendMessage() { ++this.myNotifications.value; } warning (): void { alert ("Warning!!!"); } }