import { CardModel } from './card.model'; import { IconModel } from '../icon/icon.model'; import { ButtonModel } from '../button/button.model'; import { LayoutModel } from '../layout.model'; /** * Class representing the stnadard card */ export class StandardCardModel extends CardModel{ /** *

The title of the card.

*/ title: string; /** *

It represents the edit action button in a normal card.

*/ edit: ButtonModel; /** *

It represents the delete action button in a normal card.

*/ delete: ButtonModel; /** *

Function to be called when the user presses Edit.

*/ onEdit: any; /** *

Function to be called when the user presses Delete.

*/ onDelete: any; /** * It is the constructor for the card component. It takes the required string values to create the card object */ constructor(values: Object = {}) { super(); Object.assign(this, values); this.layout= { type:"standard" }; let iconDelete = new IconModel( { name: "delete", type: "mi", size: "20px", color: { foreground: "red", background: "transparent" } }); this.delete = new ButtonModel( { label:"", color: { foreground: "white", background: "accent" }, icon: iconDelete, iconPosition: "right", menu: null }); let iconEdit = new IconModel( { name: "edit", type: "mi", size: "20px", color: { foreground: "lightblue", background: "transparent" } }); this.edit = new ButtonModel( { label:"", color: { foreground: "white", background: "primary" }, icon: iconEdit, iconPosition: "right", menu: null }); } }