<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}}
      <this.BSForm
        class="globalSearch pull-left"
        @formLayout="inline"
        @model={{this}}
        @onSubmit={{this.noop}}
      as |Form|>
        <Form.element
          @property="args.value"
          class={{@themeInstance.inputGroup}}
        as |GroupByField|>
          {{#if @themeInstance.groupByLabelMsg}}
            <span class="input-group-text">{{@themeInstance.groupByLabelMsg}}</span>
          {{/if}}
          <DataGroupBySelect.Select
            @id={{GroupByField.id}}
            @value={{GroupByField.value}}/>
          <this.BsButton
            class={{@themeInstance.sortGroupedPropertyBtn}}
            @outline={{true}}
            @onClick={{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}}
          </this.BsButton>
        </Form.element>
      </this.BSForm>
    {{/if}}
  {{/let}}
</div>