meilisearch-admin/app/components/royal-table/column.hbs
2022-09-06 14:57:55 +03:00

40 lines
983 B
Handlebars

{{#if this.isHead}}
{{! template-lint-disable no-invalid-interactive }}
<th
role={{if @sortable 'button'}}
align={{@align}}
...attributes
{{on 'click' this.handleClickHead}}
{{on 'click' this.handleSort}}
{{! DOTO: align is depricated, use styles align instead }}
>
{{#if @sortable}}
{{#if this.isAscSorted}}
<Icons::ArrowDown />
{{else if this.isDescSorted}}
<Icons::ArrowUp />
{{else}}
<Icons::ArrowUpDown />
{{/if}}
{{/if}}
{{#if (has-block 'name')}}
{{yield to='name'}}
{{else if @name}}
{{@name}}
{{else if @prop}}
{{capitalize @prop}}
{{/if}}
</th>
{{else if this.isBody}}
<td align={{@align}} ...attributes>
{{#if (has-block)}}
{{yield}}
{{else if @bodyComponent}}
{{#let @bodyComponent as |BodyComponent|}}
<BodyComponent @data={{@data}} />
{{/let}}
{{else}}
{{get @data @prop}}
{{/if}}
</td>
{{/if}}