import { CoreModel } from '../core/core.model'; import { IconModel } from '../icon/icon.model'; export class ButtonModel extends CoreModel { /** *
It is the label of the button. Default is Button.
*/ label: string='BTN'; /** *It is the icon object on the button.
*/ iconProperty?: IconModel; /** *The position of the icon (Left of Right)
*/ iconPosition?: string="left"; /** * System for 'waiting' state of the button. Optional. Button can be in that state anabled or disabled. */ waiting?: { /** * It is a property to toggle button into/out of 'waiting' state. */ value: boolean; /** * It is a property to disable button when it is in 'waiting' state. */ disabled: boolean; /** * It is an icon representing button in 'waiting' state. */ iconProperty: IconModel; }; /** * It is the constructor for the button component. It takes the required string values to create the button object */ constructor(values: Object = {}) { super(values); Object.assign(this, values); if(this.iconProperty!=null) this.iconProperty = new IconModel(this.iconProperty); if(this.iconPosition==null) this.iconPosition = "left"; } }