Page size select component

This commit is contained in:
Michael Lange 2020-03-30 21:12:46 -07:00
parent 3fc1874c0e
commit 06524fe5a7
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import Component from '@ember/component';
import { inject as service } from '@ember/service';
export default Component.extend({
tagName: '',
userSettings: service(),
pageSizeOptions: Object.freeze([10, 25, 50]),
});

View File

@ -0,0 +1,11 @@
<div class="field is-horizontal">
<span class="field-label is-small">Per page</span>
<PowerSelect
@tagName="div"
class="field-body"
@options={{pageSizeOptions}}
@selected={{userSettings.pageSize}}
@onChange={{action (mut userSettings.pageSize)}} as |option|>
{{option}}
</PowerSelect>
</div>