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

35 lines
918 B
CoffeeScript

import Ember from 'ember'
export default Ember.Component.extend
tagName: 'span'
type: null
classNames: ['value-type-display']
classNameBindings: ['typeClass']
typeClass: Ember.computed 'type', -> @get('type') || 'no-typ'
iconClass: Ember.computed 'type', ->
switch @get('type')
when 'boolean' then 'checkmark box'
when 'date' then 'calendar'
when 'select' then 'list'
when 'string' then 'terminal'
when 'text' then 'sticky note outline'
when 'number' then 'hashtag'
when 'timestamp' then 'wait'
else 'red warning circle'
# &.date
# @extend .fa-calendar
# &.number
# @extend .fa-hashtag
# &.select
# @extend .fa-list-ul
# &.string
# @extend .fa-terminal
# &.text
# @extend .fa-sticky-note-o
# &.window_from
# @extend .fa-clock-o
# &.window_to
# @extend .fa-clock-o
# &.timestamp
# @extend .fa-clock-o