<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"
        @formLayout="inline"
        @model={{this}}
        @onSubmit={{this.noop}}
      as |Form|>
        <Form.element
          @property="args.value"
          class="input-group"
        as |GroupByField|>
          {{#if @themeInstance.groupByLabelMsg}}
            <div class="input-group-prepend">
              <span class="input-group-text">{{@themeInstance.groupByLabelMsg}}</span>
            </div>
          {{/if}}
          <DataGroupBySelect.Select
            @id={{GroupByField.id}}
            @value={{GroupByField.value}}/>
          <div class="input-group-append">
            <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>
          </div>
        </Form.element>
      </this.BsForm>
    {{/if}}
  {{/let}}
</div>