<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.inputGroup}}>
        <span class="input-group-addon">{{@themeInstance.groupByLabelMsg}}</span>
        <DataGroupBySelect.Select/>
        <span class="input-group-btn">
          <button
            class={{@themeInstance.sortGroupedPropertyBtn}}
            {{on "click" this.doSort}}
            type="button">
            {{#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>
        </span>
      </div>
    {{/if}}
  {{/let}}
</div>
