import { default as CortexElement } from '../../../../base/src/cortex-element.ts';
import { MenuItemCheckPlacement } from '../../../../types/src/menu-item';
import { CSSResultGroup, TemplateResult } from 'lit';
import { default as CxIcon } from '../icon/icon';
import { default as CxPopup } from '../popup/popup';
import { default as CxSpinner } from '../spinner/spinner';

/**
 * @summary Menu items provide options for the user to pick from in a menu.
 *
 * @event cx-lazy-load - Emitted when a lazy item is selected. Use this event to asynchronously load submenu
 *
 * @slot (default) - The menu item's label.
 * @slot prefix - Used to prepend an icon or similar element to the menu item.
 * @slot suffix - Used to append an icon or similar element to the menu item.
 * @slot submenu - Used to denote a nested menu.
 * @slot submenu-icon - The icon shown when the menu item has a submenu. Defaults to a chevron icon.
 *
 * @attr {boolean} no-uncheck - When `type` is `checkbox`, activating the item does not clear `checked` when it is already checked. Parent `cx-menu` may set `no-uncheck` to apply the same behavior to every checkbox item in that menu.
 * @attr {string} submenu-placement - The placement of the submenu relative to the menu item. When not set, uses RTL-aware positioning ('left-start' in RTL, 'right-start' in LTR).
 * @attr {'prefix' | 'suffix'} check-placement - Placement of the built-in checked icon relative to the label. Defaults to `suffix`. When set to `suffix` on an item that also has a submenu, the check icon renders after the submenu chevron.
 *
 * @csspart base - The component's base wrapper.
 * @csspart checked-icon - The checked icon, which is only visible when the menu item is checked.
 * @csspart prefix - The prefix container.
 * @csspart label - The menu item label.
 * @csspart suffix - The suffix container.
 * @csspart spinner - The spinner that shows when the menu item is in the loading state.
 * @csspart spinner__base - The spinner's base part.
 * @csspart submenu-icon - The submenu icon, visible only when the menu item has a submenu (not yet implemented).
 *
 * @cssproperty [--submenu-offset=-2px] - The distance submenus shift to overlap the parent menu.
 */
export default class CxMenuItem extends CortexElement {
    static readonly styles: CSSResultGroup;
    static readonly dependencies: {
        'cx-icon': typeof CxIcon;
        'cx-popup': typeof CxPopup;
        'cx-spinner': typeof CxSpinner;
    };
    private cachedTextLabel;
    defaultSlot: HTMLSlotElement;
    anchor: HTMLAnchorElement | null;
    menuItem: HTMLElement;
    submenuIcon: HTMLElement;
    /** The type of menu item to render. To use `checked`, this value must be set to `checkbox`. */
    type: 'normal' | 'checkbox';
    /** The trigger type for the submenu. */
    submenuTrigger: 'hover' | 'click' | 'both';
    /** Draws the item in a checked state. */
    checked: boolean;
    /**
     * For `type="checkbox"`, the parent menu toggles `checked` on activate. When the item is already checked, it stays
     * checked instead of toggling off if this item has `no-uncheck`, or if the hosting `cx-menu` has `no-uncheck`.
     */
    noUncheck: boolean;
    /** A unique value to store in the menu item. This can be used as a way to identify menu items when selected. */
    value: string;
    /** When set, the underlying menu item will be rendered as an `<a>` with this `href`. */
    href: string;
    /** Tells the browser where to open the link. Only used when `href` is set. */
    target?: '_blank' | '_parent' | '_self' | '_top';
    /**
     * When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the
     * default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a
     * specific tab/window, this will prevent that from working correctly. You can remove or change the default value by
     * setting the attribute to an empty string or a value of your choice, respectively.
     */
    rel: string;
    /** Tells the browser to download the linked file as this filename. Only used when `href` is set. */
    download?: string;
    /** Draws the menu item in a loading state. */
    loading: boolean;
    /** Draws the menu item in a disabled state, preventing selection. */
    disabled: boolean;
    /** Draws the menu item in an active - selected state. */
    active: boolean;
    /** Makes the menu item readonly */
    readonly: boolean;
    /** The flip boundary for the submenu. */
    flipBoundary: Element | Element[];
    /** The shift boundary for the submenu. */
    shiftBoundary: Element | Element[];
    menu: string;
    /** Whether to always show the checked icon. */
    alwaysShowCheckedIcon: boolean;
    /** Placement of the built-in checked icon relative to the label. */
    checkPlacement: MenuItemCheckPlacement;
    /** The placement of the submenu relative to the menu item. When null/undefined, uses RTL-aware default positioning. */
    submenuPlacement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
    /** Enables lazy loading submenu behavior. */
    lazy: boolean;
    private readonly localize;
    private readonly hasSlotController;
    private readonly submenuController;
    constructor();
    runConnectedCallback(): void;
    disconnectedCallback(): void;
    private handleDocumentWheel;
    private handleDefaultSlotChange;
    private handleHostClick;
    private handleMouseOver;
    private handleAnchorClick;
    handleCheckedChange(): void;
    handleDisabledChange(): void;
    handleTypeChange(): void;
    /** Returns a text label based on the contents of the menu item's default slot. */
    getTextLabel(): string;
    isSubmenu(): boolean;
    renderBase(inner: TemplateResult): TemplateResult<1>;
    render(): TemplateResult<1>;
}
declare global {
    interface HTMLElementTagNameMap {
        'cx-menu-item': CxMenuItem;
    }
}
