ember-assembly
Version:
A collection of beautiful UI components built by Goods
33 lines (27 loc) • 749 B
text/typescript
import Component from '@ember/component';
// @ts-ignore: Ignore import of compiled template
import template from './template';
import { isNone } from '@ember/utils';
import { action, computed } from '@ember/object';
export default class UiTag extends Component {
layout = template;
tagName: string = '';
label!: string;
icon?: string | null = null;
appearance?: string = 'default'; //Enum: default, strong, minimal
onClick?: Function | null = null;
('onClick')
get disabled() {
return isNone(this.onClick);
}
('appearance')
get appearanceClass(): string {
return `appearance-${this.appearance}`;
}
onLocalClick() {
if (!isNone(this.onClick)) {
this.onClick();
}
}
}