clr-angular-static-fix
Version:
1. Install Clarity Icons package through npm:
53 lines (43 loc) • 1.63 kB
text/typescript
/*
* Copyright (c) 2016-2018 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
import { Component, EventEmitter, Input, Output } from '@angular/core';
let wizardHeaderActionIndex = 0;
export class ClrWizardHeaderAction {
// title is explanatory text added to the header action
title: string = '';
// If our host has an ID attribute, we use this instead of our index.
_id: string = (wizardHeaderActionIndex++).toString();
public get id(): string {
return `clr-wizard-header-action-${this._id}`;
}
public disabled: boolean = false;
headerActionClicked: EventEmitter<string> = new EventEmitter(false);
click(): void {
if (this.disabled) {
return;
}
// passing the header action id allows users to have one method that
// routes to many different actions based on the type of header action
// clicked. this is further aided by users being able to specify ids
// for their header actions.
this.headerActionClicked.emit(this._id);
}
}