import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { and, or } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import EuiFormControlLayoutIcons from './eui-form-control-layout-icons.js';

const EuiFormControlLayout = setComponentTemplate(precompileTemplate(`
    <div
      class={{classNames
        (if @fullWidth "euiFormControlLayout--fullWidth")
        (if @compressed "euiFormControlLayout--compressed")
        (if @readOnly "euiFormControlLayout--readOnly")
        (if
          (and
            (argOrDefault @useGroup true)
            (or (has-block "append") (has-block "prepend"))
          )
          "euiFormControlLayout--group"
        )
        (if (or @disabled @isDisabled) "euiFormControlLayout--isDisabled")
        "euiFormControlLayout"
      }}
      ...attributes
    >
      {{#if (has-block "prepend")}}
        {{yield "euiFormControlLayout__prepend" to="prepend"}}
      {{/if}}
      <div class="euiFormControlLayout__childrenWrapper">
        {{#if (has-block "field")}}
          {{yield to="field"}}
        {{else}}
          {{yield}}
        {{/if}}
        <EuiFormControlLayoutIcons
          @icon={{@icon}}
          @iconSide={{@iconSide}}
          @clear={{@clear}}
          @compressed={{@compressed}}
          @isLoading={{@isLoading}}
        />
      </div>
      {{#if (has-block "append")}}
        {{yield "euiFormControlLayout__append" to="append"}}
      {{/if}}
    </div>
  `, {
  strictMode: true,
  scope: () => ({
    classNames,
    and,
    argOrDefault,
    or,
    EuiFormControlLayoutIcons
  })
}), templateOnly("eui-form-control-layout", "EuiFormControlLayout"));

export { EuiFormControlLayout as default };
//# sourceMappingURL=eui-form-control-layout.js.map
