Files
mixtape/zero.Backoffice.UI/app/schemas/list/list-action.ts
T

33 lines
503 B
TypeScript
Raw Normal View History

2020-10-21 11:48:21 +02:00
class ListAction
{
key;
label;
icon;
autoclose = true;
action = () =>
{
console.warn(`[zero] A list action needs a "action" callback`);
};
2021-08-02 12:57:08 +02:00
constructor(key, label, icon, action, autoclose: boolean = true)
2020-10-21 11:48:21 +02:00
{
this.key = key;
this.label = label;
this.icon = icon;
this.action = action;
2021-08-02 12:57:08 +02:00
this.autoclose = autoclose;
2020-10-21 11:48:21 +02:00
}
/**
* Calls the action
* @returns {ListColumn}
*/
call(options)
{
this.action(options);
}
}
export default ListAction;