2017-12-15 21:39:18 +00:00
|
|
|
import Component from '@ember/component';
|
|
|
|
import { computed } from '@ember/object';
|
2019-10-15 18:32:58 +00:00
|
|
|
import { computed as overridable } from 'ember-overridable-computed';
|
2020-06-10 13:49:16 +00:00
|
|
|
import { classNames, tagName } from '@ember-decorators/component';
|
|
|
|
import classic from 'ember-classic-decorator';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +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)
|
2020-06-10 13:49:16 +00:00
|
|
|
@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,
|
|
|
|
}));
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|