meilisearch-admin/app/components/simple-table/column.hbs

46 lines
1.2 KiB
Handlebars
Raw Normal View History

2022-04-26 09:41:33 +00:00
{{#if this.isHead}}
{{! template-lint-disable no-invalid-interactive }}
<th
role={{if @sortable 'button'}}
2022-09-16 07:37:33 +00:00
{{! DOTO: align is depricated, use styles align instead }}
2022-04-26 09:41:33 +00:00
align={{@align}}
...attributes
{{on 'click' this.handleClickHead}}
{{on 'click' this.handleSort}}
>
2022-09-10 12:26:24 +00:00
<span class='inline-flex items-center'>
{{#if (has-block 'name')}}
{{yield to='name'}}
2022-09-16 08:19:44 +00:00
{{else if @headComponent}}
<@headComponent @data={{@data}} />
2022-09-10 12:26:24 +00:00
{{else if @name}}
{{@name}}
{{else if @prop}}
{{capitalize @prop}}
2022-09-06 11:57:55 +00:00
{{/if}}
2022-09-10 12:26:24 +00:00
{{#if @sortable}}
2022-09-16 07:37:33 +00:00
{{#let 'fill-base-3 ml-0.5' 14 as |class size|}}
{{#if this.isAscSorted}}
<Icons::ArrowDownThin class={{class}} @size={{size}} />
{{else if this.isDescSorted}}
<Icons::ArrowUpThin class={{class}} @size={{size}} />
{{else}}
<Icons::ArrowUpDown class={{class}} @size={{size}} />
{{/if}}
{{/let}}
2022-09-10 12:26:24 +00:00
{{/if}}
</span>
2022-04-26 09:41:33 +00:00
</th>
{{else if this.isBody}}
<td align={{@align}} ...attributes>
{{#if (has-block)}}
{{yield}}
{{else if @bodyComponent}}
2022-09-16 07:37:33 +00:00
<@bodyComponent @data={{@data}} />
2022-04-26 09:41:33 +00:00
{{else}}
{{get @data @prop}}
{{/if}}
</td>
{{/if}}