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

class SuggestionItemGroup {
    constructor() {
        /**
         * Defines the header text of the <code>ui5-li-group</code>.
         */
        this.headerText = input(...(ngDevMode ? [undefined, { debugName: "headerText" }] : []));
        /**
         * Defines the accessible name of the header.
         */
        this.headerAccessibleName = input(...(ngDevMode ? [undefined, { debugName: "headerAccessibleName" }] : []));
        /**
         * Defines if the text of the component should wrap when it's too long.
      When set to "Normal", the content (title, description) will be wrapped
      using the `ui5-expandable-text` component.<br/>
      
      The text can wrap up to 100 characters on small screens (size S) and
      up to 300 characters on larger screens (size M and above). When text exceeds
      these limits, it truncates with an ellipsis followed by a text expansion trigger.
      
      Available options are:
      - `None` (default) - The text will truncate with an ellipsis.
      - `Normal` - The text will wrap (without truncation).
         */
        this.wrappingType = input("None", ...(ngDevMode ? [{ debugName: "wrappingType" }] : [])); // className is now passed
        /**
         * Fired when a movable list item is moved over a potential drop target during a dragging operation.
      
      If the new position is valid, prevent the default action of the event using `preventDefault()`.
         */
        this.ui5MoveOver = output();
        /**
         * Fired when a movable list item is dropped onto a drop target.
      
      **Note:** `move` event is fired only if there was a preceding `move-over` with prevented default action.
         */
        this.ui5Move = 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 <code>ui5-suggestion-item-group</code>.
         * - **header**: Defines the header of the component.
      
      **Note:** Using this slot, the default header text of group and the value of `headerText` property will be overwritten.
         *
         * @example
         * ```html
         * <ui5-suggestion-item-group>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-suggestion-item-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 <code>ui5-suggestion-item-group</code>."
            },
            {
                "name": "header",
                "description": "Defines the header of the component.\n\n**Note:** Using this slot, the default header text of group and the value of `headerText` property will be overwritten."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'headerText',
            'headerAccessibleName',
            'wrappingType',
        ];
        // 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 = [
            'ui5MoveOver',
            'ui5Move',
        ];
        // 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: SuggestionItemGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: SuggestionItemGroup, isStandalone: true, selector: "ui5-suggestion-item-group, [ui5-suggestion-item-group]", inputs: { headerText: { classPropertyName: "headerText", publicName: "headerText", isSignal: true, isRequired: false, transformFunction: null }, headerAccessibleName: { classPropertyName: "headerAccessibleName", publicName: "headerAccessibleName", isSignal: true, isRequired: false, transformFunction: null }, wrappingType: { classPropertyName: "wrappingType", publicName: "wrappingType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5MoveOver: "ui5MoveOver", ui5Move: "ui5Move" }, exportAs: ["ui5SuggestionItemGroup"], 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: SuggestionItemGroup, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-suggestion-item-group, [ui5-suggestion-item-group]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5SuggestionItemGroup',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { SuggestionItemGroup };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-suggestion-item-group.mjs.map
