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

21 lines
589 B
JavaScript
Raw Normal View History

import Component from '@ember/component';
import { computed } from '@ember/object';
import { computed as overridable } from 'ember-overridable-computed';
import { classNames, tagName } from '@ember-decorators/component';
import classic from 'ember-classic-decorator';
2017-09-19 14:47:10 +00:00
@classic
@tagName('table')
@classNames('table')
export default class ListTable extends Component {
@overridable(() => []) source;
2017-09-19 14:47:10 +00:00
// Plan for a future with metadata (e.g., isSelected)
@computed('source.[]')
get decoratedSource() {
2021-12-28 14:45:20 +00:00
return (this.source || []).map((row) => ({
2017-09-19 14:47:10 +00:00
model: row,
}));
}
}