import * as i0 from '@angular/core';
import { input, output, inject, ElementRef, Injector, runInInjectionContext, effect, ChangeDetectionStrategy, Component } from '@angular/core';
import '@ui5/webcomponents/dist/AvatarGroup.js';

class AvatarGroup {
    constructor() {
        /**
         * Defines the mode of the `AvatarGroup`.
         */
        this.type = input("Group", ...(ngDevMode ? [{ debugName: "type" }] : []));
        /**
         * Defines the additional accessibility attributes that will be applied to the component.
      The following field is supported:
      
      - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.
      Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.
         */
        this.accessibilityAttributes = input({}, ...(ngDevMode ? [{ debugName: "accessibilityAttributes" }] : []));
        /**
         * Defines the accessible name of the AvatarGroup.
      When provided, this will override the default aria-label text.
         */
        this.accessibleName = input(...(ngDevMode ? [undefined, { debugName: "accessibleName" }] : []));
        /**
         * Receives id(s) of the elements that describe the AvatarGroup.
      When provided, this will be used as aria-labelledby instead of aria-label.
         */
        this.accessibleNameRef = input(...(ngDevMode ? [undefined, { debugName: "accessibleNameRef" }] : [])); // className is now passed
        /**
         * Fired when the component is activated either with a
      click/tap or by using the Enter or Space key.
         */
        this.ui5Click = output();
        /**
         * Fired when the count of visible `ui5-avatar` elements in the
      component has changed
         */
        this.ui5Overflow = output();
        /**
         * Available slots for content projection in this component.
         *
         * Slots allow you to insert custom content into predefined areas of the web component.
         * Use the `slot` attribute on child elements to target specific slots.
         *
         * - **(default)**: Defines the items of the component. Use the `ui5-avatar` component as an item.
      
      **Note:** The UX guidelines recommends using avatars with "Circle" shape.
      
      Moreover, if you use avatars with "Square" shape, there will be visual inconsistency
      as the built-in overflow action has "Circle" shape.
         * - **overflowButton**: Defines the overflow button of the component.
      
      **Note:** We recommend using the `ui5-button` component.
      
      **Note:** If this slot is not used, the component will display the built-in overflow button.
         *
         * @example
         * ```html
         * <ui5-avatar-group>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-avatar-group>
         * ```
         *
         * @readonly
         * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots | MDN Web Components Slots}
         */
        this.slots = [
            {
                "name": "default",
                "description": "Defines the items of the component. Use the `ui5-avatar` component as an item.\n\n**Note:** The UX guidelines recommends using avatars with \"Circle\" shape.\n\nMoreover, if you use avatars with \"Square\" shape, there will be visual inconsistency\nas the built-in overflow action has \"Circle\" shape."
            },
            {
                "name": "overflowButton",
                "description": "Defines the overflow button of the component.\n\n**Note:** We recommend using the `ui5-button` component.\n\n**Note:** If this slot is not used, the component will display the built-in overflow button.",
                "since": "1.0.0-rc.13"
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    /**
     * Returns an array containing the `ui5-avatar` instances that are currently not displayed due to lack of space.
     * @readonly This property is managed by the web component.
     */
    get hiddenItems() {
        return this.element?.hiddenItems ?? [];
    }
    /**
     * Returns an array containing the `AvatarColorScheme` values that correspond to the avatars in the component.
     * @readonly This property is managed by the web component.
     */
    get colorScheme() {
        return this.element?.colorScheme ?? [];
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'type',
            'accessibilityAttributes',
            'accessibleName',
            'accessibleNameRef',
        ];
        // Synchronize inputs (properties)
        for (const inputName of inputsToSync) {
            // Find the corresponding camelCase signal property on the Angular component
            const signalName = inputName.replace(/-./g, (x) => x[1].toUpperCase());
            // Use the Injector to run the effect in the correct context
            if (this[signalName] && typeof this[signalName] === 'function') {
                runInInjectionContext(this.injector, () => {
                    effect(() => {
                        // Read the signal value
                        const value = this[signalName]();
                        if (wcElement) {
                            // Write the value to the Web Component's property
                            wcElement[inputName] = value;
                        }
                    });
                });
            }
        }
        const outputsToSync = [
            'ui5Click',
            'ui5Overflow',
        ];
        // Synchronize outputs (events)
        for (const outputName of outputsToSync) {
            // Map Angular output name to UI5 web component event name
            const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
            // Ensure the output property exists and has an emit function before adding listener
            if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
                // Cast the listener to the correct type to satisfy TypeScript
                wcElement.addEventListener(eventName, (e) => {
                    this[outputName].emit(e);
                });
            }
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AvatarGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: AvatarGroup, isStandalone: true, selector: "ui5-avatar-group, [ui5-avatar-group]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, accessibilityAttributes: { classPropertyName: "accessibilityAttributes", publicName: "accessibilityAttributes", isSignal: true, isRequired: false, transformFunction: null }, accessibleName: { classPropertyName: "accessibleName", publicName: "accessibleName", isSignal: true, isRequired: false, transformFunction: null }, accessibleNameRef: { classPropertyName: "accessibleNameRef", publicName: "accessibleNameRef", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5Click: "ui5Click", ui5Overflow: "ui5Overflow" }, exportAs: ["ui5AvatarGroup"], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AvatarGroup, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-avatar-group, [ui5-avatar-group]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5AvatarGroup',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { AvatarGroup };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-avatar-group.mjs.map
