Files
ember-panda/addon/components/value-type-display.js
T
2017-12-21 11:51:55 +01:00

33 lines
798 B
JavaScript

// Generated by CoffeeScript 1.12.5
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'span',
type: null,
classNames: ['value-type-display'],
classNameBindings: ['typeClass'],
typeClass: Ember.computed('type', function() {
return this.get('type') || 'no-typ';
}),
iconClass: Ember.computed('type', function() {
switch (this.get('type')) {
case 'boolean':
return 'checkmark box';
case 'date':
return 'calendar';
case 'select':
return 'list';
case 'string':
return 'terminal';
case 'text':
return 'sticky note outline';
case 'number':
return 'hashtag';
case 'timestamp':
return 'wait';
default:
return 'red warning circle';
}
})
});