import * as i0 from '@angular/core';
import { booleanAttribute, Input, HostBinding, Component } from '@angular/core';

/**
 * Container component that positions an icon relative to an input field.
 * Supports icon placement at the start (left) or end (right) of the input.
 * Typically used to enhance form inputs with visual indicators like search icons, validation states, or action triggers.
 *
 * @usageNotes
 * ### Icon at start of input
 * ```html
 * <eui-icon-input [euiIconPositionStart]="true">
 *   <eui-icon-svg icon="search"></eui-icon-svg>
 *   <input euiInputText placeholder="Search..." />
 * </eui-icon-input>
 * ```
 *
 * ### Icon at end of input
 * ```html
 * <eui-icon-input [euiIconPositionEnd]="true">
 *   <input euiInputText type="password" />
 *   <eui-icon-svg icon="visibility"></eui-icon-svg>
 * </eui-icon-input>
 * ```
 *
 * ### Accessibility
 * - Icon should be decorative or have proper aria-label
 * - Input field maintains full keyboard accessibility
 * - Ensure sufficient touch target size for mobile
 *
 * ### Notes
 * - Default position is start (left in LTR)
 * - When both positions are true, end takes precedence
 * - Icon is automatically sized and positioned
 * - Works with all eui-input-text variants
 */
class EuiIconInputComponent {
    constructor() {
        /**
         * Positions the icon at the start (left in LTR layouts) of the input field.
         * @default true. Mutually exclusive with euiIconPositionEnd when both are true, end takes precedence.
         */
        this.euiIconPositionStart = true;
        /**
         * Positions the icon at the end (right in LTR layouts) of the input field.
         * @default false. When true, overrides euiIconPositionStart positioning.
         */
        this.euiIconPositionEnd = false;
    }
    get cssClasses() {
        return [
            'eui-icon-input',
            this.euiIconPositionStart && !this.euiIconPositionEnd ? 'eui-icon-input--start' : '',
            this.euiIconPositionEnd ? 'eui-icon-input--end' : '',
        ]
            .join(' ')
            .trim();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: EuiIconInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.1.0", type: EuiIconInputComponent, isStandalone: true, selector: "eui-icon-input", inputs: { euiIconPositionStart: ["euiIconPositionStart", "euiIconPositionStart", booleanAttribute], euiIconPositionEnd: ["euiIconPositionEnd", "euiIconPositionEnd", booleanAttribute] }, host: { properties: { "class": "this.cssClasses" } }, ngImport: i0, template: "<span class=\"eui-icon-input-wrapper\">\n    <span class=\"eui-icon-input__content\">\n        <ng-content></ng-content>\n    </span>\n    <span class=\"eui-icon-input__icon\">\n        <ng-content select=\"eui-icon-svg\"></ng-content>\n        <ng-content select=\"eui-button\"></ng-content>\n    </span>\n</span>\n", styles: [".eui-21 :host.eui-icon-input{display:flex;width:100%}.eui-21 :host.eui-icon-input .eui-icon-input-wrapper{display:flex;width:100%;position:relative}.eui-21 :host.eui-icon-input .eui-icon-input__content{display:flex;width:100%}.eui-21 :host.eui-icon-input .eui-icon-input__icon{position:absolute}.eui-21 :host.eui-icon-input.eui-icon-input--end ::ng-deep .eui-input-text{padding-right:var(--eui-s-5xl)}.eui-21 :host.eui-icon-input.eui-icon-input--end .eui-icon-input__content ::ng-deep .eui-icon-svg.eui-input-text--clearable-icon{right:var(--eui-s-5xl)}.eui-21 :host.eui-icon-input.eui-icon-input--end .eui-icon-input__icon{right:var(--eui-s-s);top:calc(var(--eui-s-m) / 16 * 10)}.eui-21 :host.eui-icon-input.eui-icon-input--start ::ng-deep .eui-input-text{padding-left:var(--eui-s-5xl)}.eui-21 :host.eui-icon-input.eui-icon-input--start .eui-icon-input__icon{left:var(--eui-s-xs);top:var(--eui-s-xs)}\n"] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: EuiIconInputComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-icon-input', template: "<span class=\"eui-icon-input-wrapper\">\n    <span class=\"eui-icon-input__content\">\n        <ng-content></ng-content>\n    </span>\n    <span class=\"eui-icon-input__icon\">\n        <ng-content select=\"eui-icon-svg\"></ng-content>\n        <ng-content select=\"eui-button\"></ng-content>\n    </span>\n</span>\n", styles: [".eui-21 :host.eui-icon-input{display:flex;width:100%}.eui-21 :host.eui-icon-input .eui-icon-input-wrapper{display:flex;width:100%;position:relative}.eui-21 :host.eui-icon-input .eui-icon-input__content{display:flex;width:100%}.eui-21 :host.eui-icon-input .eui-icon-input__icon{position:absolute}.eui-21 :host.eui-icon-input.eui-icon-input--end ::ng-deep .eui-input-text{padding-right:var(--eui-s-5xl)}.eui-21 :host.eui-icon-input.eui-icon-input--end .eui-icon-input__content ::ng-deep .eui-icon-svg.eui-input-text--clearable-icon{right:var(--eui-s-5xl)}.eui-21 :host.eui-icon-input.eui-icon-input--end .eui-icon-input__icon{right:var(--eui-s-s);top:calc(var(--eui-s-m) / 16 * 10)}.eui-21 :host.eui-icon-input.eui-icon-input--start ::ng-deep .eui-input-text{padding-left:var(--eui-s-5xl)}.eui-21 :host.eui-icon-input.eui-icon-input--start .eui-icon-input__icon{left:var(--eui-s-xs);top:var(--eui-s-xs)}\n"] }]
        }], propDecorators: { cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], euiIconPositionStart: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], euiIconPositionEnd: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }] } });

const EUI_ICON_INPUT = [
    EuiIconInputComponent,
];
// export { EuiIconInputComponent as EuiIconInput } from './eui-icon-input.component';

/**
 * Generated bundle index. Do not edit.
 */

export { EUI_ICON_INPUT, EuiIconInputComponent };
//# sourceMappingURL=eui-components-eui-icon-input.mjs.map
