miguelcobain / ember-yeti-table

Yeti Table
https://miguelcobain.github.io/ember-yeti-table
MIT License
61 stars 15 forks source link

Overriding labels is now possible in the pagination component #447

Closed bracke closed 2 months ago

bracke commented 2 years ago

Example of this with Danish labels:

<table.pagination
    @previousLabel="Forrige" 
    @nextLabel="Næste" 
    @rowselectorLabel="Rækker pr. side: "
>

Viser række {{table.paginationData.pageStart}} til {{table.paginationData.pageEnd}} af {{table.paginationData.totalRows}} rækker

</table.pagination>
miguelcobain commented 2 years ago

@bracke thank you for this PR.

I don't really like the fact that some labels are customized via a @*Label argument, and another using the component's block.

So, what about an API like the following:

<table.pagination
  @previousLabel="Forrige" 
  @nextLabel="Næste" 
  @rowSelectorLabel="Rækker pr. side: "
  @paginationStatusLabel="Viser række {pageStart} til {pageEnd} af {totalRows} rækker"/>

Another thing, can you please rebase this PR agains the v1 branch? The master branch has a glimmer migration ongoing. The v1 branch is what is more easily released right now.

cah-brian-gantzler commented 2 years ago

How about this :)

Every label is named block. If no block present do the default. Else use the named block.

This takes off passing parameters and dealing with how to default parameters, to the user optionally providing blocks.

Just a thought