<div class="{{@themeInstance.dataGroupBySelectWrapper}}" ...attributes>
  {{#let
    (hash
      Select=(
        component
        (ensure-safe-component @themeInstance.selectComponent)
        options=@options
        value=@value
        themeInstance=@themeInstance
        cssPropertyName=@themeInstance.changeGroupByField
        changeValue=@changeGroupingPropertyName
      )
      sort=this.doSort
    )
  as |DataGroupBySelect|
  }}
    {{#if (has-block)}}
      {{yield DataGroupBySelect}}
    {{else}}
      <div class={{@themeInstance.form}}>
        <div class={{@themeInstance.formElementWrapper}}>
          <label>{{@themeInstance.groupByLabelMsg}}</label>
          <DataGroupBySelect.Select/>
          <button
            class={{@themeInstance.sortGroupedPropertyBtn}}
            type="button"
            {{on "click" this.doSort}}>
            {{#if (is-equal @sortByGroupedFieldDirection "asc")}}
              {{#let (component (ensure-safe-component @themeInstance.sortAscIconComponent) themeInstance=@themeInstance) as |SortAscIcon|}}<SortAscIcon/>{{/let}}
            {{else}}
              {{#let (component (ensure-safe-component @themeInstance.sortDescIconComponent) themeInstance=@themeInstance) as |SortDescIcon|}}<SortDescIcon/>{{/let}}
            {{/if}}
          </button>
        </div>
      </div>
    {{/if}}
  {{/let}}
</div>