import * as i0 from '@angular/core';
import { EventEmitter, QueryList, AfterViewInit } from '@angular/core';
import { MXInteractiveComponent, MXColorComponent, AXClickEvent, AXStyleColorType, AXItemClickEvent, AXStyleLookType, AXHotKeyAction, MXButtonBaseComponent } from '@acorex/cdk/common';
import * as polytype from 'polytype';
import { AXLoadingComponent } from '@acorex/components/loading';

interface AXButtonItemListItem {
    name: string;
    text: string;
    icon: string;
    divided?: boolean;
    disabled?: boolean;
    selected?: boolean;
    color?: AXStyleColorType;
}
declare const AXButtonItemComponent_base: polytype.Polytype.ClusteredConstructor<[typeof MXInteractiveComponent, typeof MXColorComponent]>;
/**
 * Represents a button item with optional content like icons, text, and dropdowns.
 *
 * @category Components
 */
declare class AXButtonItemComponent extends AXButtonItemComponent_base {
    /**
     * Text displayed on the button item.
     */
    text: string;
    /**
     *  @ignore
     */
    private _selected;
    /**
     * Indicates whether the button item is selected.
     *
     * @param v - A boolean indicating the selected state.
     * Updates the view when the value changes.
     */
    get selected(): boolean;
    set selected(v: boolean);
    /**
     * Whether the item is visually separated from other items.
     *  @defaultValue false
     */
    divided: boolean;
    /**
     * Data associated with the button item.
     */
    data: unknown;
    /**
     * The name of the button item.
     */
    name: string;
    /**
     * Emitted when the button item is clicked.
     * @event
     * The emitted value is an `AXClickEvent` object containing event details.
     */
    onClick: EventEmitter<AXClickEvent>;
    /**
     * Handles click events on the button item host element.
     * Emits the onClick event if the component is not disabled.
     *
     * @param e - The mouse event that triggered the click.
     * @ignore
     */
    private __hostClick;
    /**
     * Handles focus events on the button item host element.
     * Emits the onFocus event.
     *
     * @param e - The focus event that was triggered.
     * @ignore
     */
    private __hostFocus;
    /**
     * Handles blur events on the button item host element.
     * Emits the onBlur event.
     *
     * @param e - The blur event that was triggered.
     * @ignore
     */
    private __hostBlur;
    /**
     * Generates the CSS classes for the button item host element.
     * Includes classes for icon-only state, disabled state, selected state, divided state, and color.
     *
     * @returns string - The space-separated CSS class names.
     * @ignore
     */
    private get __hostClass();
    /**
     * Sets the tabindex attribute for keyboard navigation.
     *
     * @ignore
     */
    tabindex: string;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXButtonItemComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXButtonItemComponent, "ax-button-item", never, { "color": { "alias": "color"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "text": { "alias": "text"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "divided": { "alias": "divided"; "required": false; }; "data": { "alias": "data"; "required": false; }; "name": { "alias": "name"; "required": false; }; }, { "onClick": "onClick"; "onFocus": "onFocus"; "onBlur": "onBlur"; "disabledChange": "disabledChange"; }, never, ["ax-prefix", "ax-loading", "ax-icon", "ax-suffix", "ax-dropdown-panel"], true, never>;
}

/**
 * A component for rendering a list of button items with optional dividers between them.
 *
 * @category Components
 */
declare class AXButtonItemListComponent extends MXInteractiveComponent {
    private parent;
    protected _contentButtons: QueryList<AXButtonItemComponent>;
    /**
     * The list of button items to display.
     *
     * @defaultValue []
     */
    items: i0.InputSignal<AXButtonItemListItem[]>;
    /**
     * Emits an event when an item is clicked.
     * The event contains details about the clicked item.
     *
     * @event {AXItemClickEvent<AXButtonItemComponent>} - The event object containing clicked item details.
     */
    onItemClick: EventEmitter<AXItemClickEvent<AXButtonItemComponent>>;
    /**
     * Initializes the button item list component.
     * Sets up content change detection and initializes content after the next render.
     *
     * @ignore
     */
    constructor();
    /**
     * Initializes the content of the button item list.
     * Binds events and properties to content button items and marks for change detection.
     *
     * @ignore
     */
    private _initContents;
    /**
     * Binds click events to content button items.
     * Subscribes to onClick events of child button items if not already subscribed.
     *
     * @ignore
     */
    private _bindEvents;
    /**
     * Binds properties to content button items.
     * Sets the disabled state of child button items based on the parent's disabled state.
     *
     * @ignore
     */
    private _bindProps;
    /**
     * Handles click events from button items.
     * Closes the parent component if available and emits the item click event.
     *
     * @param e - The click event from the button item.
     * @ignore
     */
    protected _handleOnItemClick(e: AXClickEvent): void;
    /**
     * Emits the onItemClick event with details about the clicked item.
     *
     * @param e - The click event from the button item.
     * @param item - The button item component that was clicked.
     * @ignore
     */
    _emitOnItemClickEvent(e: AXClickEvent, item: AXButtonItemComponent): void;
    /**
     * Generates the CSS classes for the button item list host element.
     * Includes classes for action list and vertical layout.
     *
     * @returns string - The space-separated CSS class names.
     * @ignore
     */
    private get __hostClass();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXButtonItemListComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXButtonItemListComponent, "ax-button-item-list", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; }, { "onItemClick": "onItemClick"; }, ["_contentButtons"], ["*"], true, never>;
}

type AXButtonType = 'submit' | 'button' | 'cancel' | 'reset';
interface AXButtonItem {
    cssClass?: string;
    color?: AXStyleColorType;
    look?: AXStyleLookType;
    text?: string;
    tooltip?: string;
    iconClass?: string;
    badge?: string;
    disabled?: boolean;
    selected?: boolean;
    separated?: boolean;
    name?: string;
    data?: unknown;
    onClick?: (e?: {
        source: AXButtonItem;
        handled?: boolean;
    }) => void;
    hotkey?: string | AXHotKeyAction;
    type?: AXButtonType;
    loading?: boolean;
    autofocus?: boolean;
}

/**
 * The Button is a component which detects user interaction and triggers a corresponding event
 *
 * @category Components
 */
declare class AXButtonComponent extends MXButtonBaseComponent implements AfterViewInit {
    iconOnly: i0.InputSignal<boolean>;
    protected showIcon: i0.Signal<boolean>;
    protected loadingIcon: i0.Signal<AXLoadingComponent>;
    protected hasLoadingIcon: i0.Signal<boolean>;
    /**
     *  Fires each time the user clicks the button.
     *  @event
     */
    onClick: EventEmitter<AXClickEvent>;
    /**
     * Specifies the type of button to be used in the action sheet.
     *
     * @defaultValue 'button'
     */
    type: i0.InputSignal<AXButtonType>;
    /**
     * Defines the text displayed while the action sheet is loading.
     *
     * @defaultValue null
     */
    loadingText: i0.ModelSignal<string>;
    /**
     *  @ignore
     */
    ngAfterViewInit(): void;
    /**
     *  @ignore
     */
    private getButton;
    /**
     *  @ignore
     */
    _handleClick(e: MouseEvent): void;
    /**
     * Triggers a click event on the button element.
     */
    click(): void;
    /**
     *  @ignore
     */
    private get __hostClass();
    /**
     * Sets focus on the button element and adds a focus style class.
     *
     */
    focus(): void;
    /**
     * Removes the focus style class from the button element
     * when the button loses focus.
     */
    blur(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXButtonComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXButtonComponent, "ax-button", never, { "disabled": { "alias": "disabled"; "required": false; }; "size": { "alias": "size"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "color": { "alias": "color"; "required": false; }; "look": { "alias": "look"; "required": false; }; "text": { "alias": "text"; "required": false; }; "toggleable": { "alias": "toggleable"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "iconOnly": { "alias": "iconOnly"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; }, { "onBlur": "onBlur"; "onFocus": "onFocus"; "onClick": "onClick"; "selectedChange": "selectedChange"; "toggleableChange": "toggleableChange"; "lookChange": "lookChange"; "colorChange": "colorChange"; "disabledChange": "disabledChange"; "loadingText": "loadingTextChange"; }, ["loadingIcon"], ["ax-loading, ax-loading-spinner", "ax-prefix, ax-icon", "ax-content", "ax-suffix", "ax-dropdown-panel", ".tab-content", "*"], true, never>;
}

declare class AXButtonModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXButtonModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXButtonModule, never, [typeof AXButtonComponent, typeof AXButtonItemComponent, typeof AXButtonItemListComponent], [typeof AXButtonComponent, typeof AXButtonItemComponent, typeof AXButtonItemListComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXButtonModule>;
}

export { AXButtonComponent, AXButtonItemComponent, AXButtonItemListComponent, AXButtonModule };
export type { AXButtonItem, AXButtonItemListItem, AXButtonType };
