'use strict';

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

const dropdownItemCss = ":root{--ifx-font-family:\"Source Sans 3\", 'Arial, sans-serif'}.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}.icon{margin-right:4px}";

const DropdownItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.ifxDropdownItem = index.createEvent(this, "ifxDropdownItem", 7);
        this.href = "";
        this.target = "_self";
        this.hide = false;
        this.size = 'l';
    }
    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' : ""}`,
            onClick: () => this.handleEventEmission(),
            role: 'menuitem'
        };
        if (!hasHref)
            common.tabIndex = 0;
        return (index.h("a", Object.assign({ key: '0fa61b25ba8f7f8dec6828def32fca24c753970b' }, common, (hasHref ? { href: this.href, target: this.target } : {})), this.icon && index.h("ifx-icon", { key: '7676baff54e17a8ac7a3de6a47fb00e773b80718', class: "icon", icon: this.icon }), index.h("span", { key: 'a2b3213b15b3e0d0b40c12cf7863158f5233c400' }, index.h("slot", { key: 'b0c64b7c89c088900c65736450ebb366fcccad3c' }))));
    }
    get el() { return index.getElement(this); }
};
DropdownItem.style = dropdownItemCss;

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

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