import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { d as defineCustomElement$2 } from './bal-icon2.js';

const FieldControl = /*@__PURE__*/ proxyCustomElement(class FieldControl extends HTMLElement {
    constructor(registerHost) {
        super();
        if (registerHost !== false) {
            this.__registerHost();
        }
        /**
         * @deprecated
         * Baloise icon for the right side of the input
         */
        this.iconRight = '';
        /**
         * @deprecated
         * Baloise icon for the left side of the input
         */
        this.iconLeft = '';
        /**
         * If `true` on mobile devices the form control children are aligned verticaly and expanded to the full width
         */
        this.expandedOnMobile = undefined;
        /**
         * If `true` a loading spinner is visible at the end of the input
         */
        this.loading = false;
    }
    get buildIconLeftTemplate() {
        if (this.iconLeft) {
            return h("bal-icon", { name: this.iconLeft, color: "info", class: "is-left", size: "small" });
        }
        return '';
    }
    get buildIconRightTemplate() {
        if (this.iconRight) {
            return h("bal-icon", { name: this.iconRight, color: "info", class: "is-right", size: "small" });
        }
        return '';
    }
    render() {
        return (h(Host, { key: 'f2dbde868506b54d5b5e2fc14b5c29c417d42891', class: {
                'bal-field-control': true,
                'control': true,
                'has-icons-left': !!this.iconLeft,
                'has-icons-right': !!this.iconRight,
                'is-loading': this.loading,
                'bal-field-control--expanded-on-mobile': !!this.expandedOnMobile,
            } }, h("slot", { key: '274cd16bccefc825d85e4b1222da7c523a1aa937' }), this.buildIconLeftTemplate, this.buildIconRightTemplate));
    }
}, [262, "bal-field-control", {
        "iconRight": [1, "icon-right"],
        "iconLeft": [1, "icon-left"],
        "expandedOnMobile": [4, "expanded-on-mobile"],
        "loading": [4]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["bal-field-control", "bal-icon"];
    components.forEach(tagName => { switch (tagName) {
        case "bal-field-control":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, FieldControl);
            }
            break;
        case "bal-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const BalFieldControl = FieldControl;
const defineCustomElement = defineCustomElement$1;

export { BalFieldControl, defineCustomElement };
