open-nomad/ui/app/components/list-table.js

18 lines
453 B
JavaScript
Raw Normal View History

import Component from '@ember/component';
import { computed } from '@ember/object';
import { computed as overridable } from 'ember-overridable-computed';
2017-09-19 14:47:10 +00:00
export default Component.extend({
tagName: 'table',
classNames: ['table'],
source: overridable(() => []),
2017-09-19 14:47:10 +00:00
// Plan for a future with metadata (e.g., isSelected)
decoratedSource: computed('source.[]', function() {
2019-03-26 07:46:44 +00:00
return this.source.map(row => ({
2017-09-19 14:47:10 +00:00
model: row,
}));
}),
});