'use strict';

var index = require('./index-CpWVsZ_u.js');

const dropdownItemCss = () => `.dropdown-item{text-decoration:none;color:#1D1D1D;display:flex;align-items:center;padding:8px 16px;gap:8px;font-family:var(--ifx-font-family)}.dropdown-item:focus{outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.dropdown-item.hide{display:none}.dropdown-item span{color:#1D1D1D;font-size:16px;font-style:normal;font-weight:400;line-height:24px;}.dropdown-item.small span{font-size:14px}.dropdown-item:hover{cursor:pointer;background-color:#EEEDED}.dropdown-item:active{background-color:#BFBBBB}.dropdown-item.error{color:#CD002F}.dropdown-item.error span{color:#CD002F}.icon{margin-right:4px}`;

const DropdownItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.ifxDropdownItem = index.createEvent(this, "ifxDropdownItem", 7);
    }
    icon;
    href = "";
    target = "_self";
    hide = false;
    error = false;
    size = 'l';
    ifxDropdownItem;
    get el() { return index.getElement(this); }
    handleMenuSize(event) {
        this.size = event.detail;
    }
    handleEventEmission() {
        this.ifxDropdownItem.emit(this.el.textContent);
    }
    render() {
        const hasHref = this.href !== undefined && this.href !== null && this.href !== '';
        const common = {
            class: `dropdown-item ${this.size === 's' ? 'small' : ""} ${this.hide ? 'hide' : ""} ${this.error ? 'error' : ""}`,
            onClick: () => this.handleEventEmission(),
            role: 'menuitem'
        };
        if (!hasHref)
            common.tabIndex = 0;
        return (index.h("a", { key: 'ce14919e0b2dc157d12e9e3fa9b938a91395ec80', ...common, ...(hasHref ? { href: this.href, target: this.target, error: this.error } : {}) }, this.icon && index.h("ifx-icon", { key: 'a12b67769ecf4e4c3ef252e6c67ef784647014c4', class: "icon", icon: this.icon }), index.h("span", { key: 'd0b40bddd0bedf4e3c39af19339a387665d02812' }, index.h("slot", { key: '4043c5aa45aed6ae94762ae43f318fe6f1073c1d' }))));
    }
};
DropdownItem.style = dropdownItemCss();

exports.ifx_dropdown_item = DropdownItem;
//# sourceMappingURL=ifx-dropdown-item.entry.cjs.js.map

//# sourceMappingURL=ifx-dropdown-item.cjs.entry.js.map