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

class MessageStrip {
    constructor() {
        /**
         * Defines the component type.
         */
        this.design = input("Information", ...(ngDevMode ? [{ debugName: "design" }] : []));
        /**
         * Defines the color scheme of the component.
      There are 10 predefined schemes.
      To use one you can set a number from `"1"` to `"10"`. The `colorScheme` `"1"` will be set by default.
         */
        this.colorScheme = input("1", ...(ngDevMode ? [{ debugName: "colorScheme" }] : []));
        /**
         * Defines whether the MessageStrip will show an icon in the beginning.
      You can directly provide an icon with the `icon` slot. Otherwise, the default icon for the type will be used.
      
       * **Note:** If <code>MessageStripDesign.ColorSet1</code> or <code>MessageStripDesign.ColorSet2</code> value is set to the <code>design</code> property, default icon will not be presented.
         */
        this.hideIcon = input(false, ...(ngDevMode ? [{ debugName: "hideIcon", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines whether the MessageStrip renders close button.
         */
        this.hideCloseButton = input(false, ...(ngDevMode ? [{ debugName: "hideCloseButton", transform: booleanAttribute }] : [{ transform: booleanAttribute }])); // className is now passed
        /**
         * Fired when the close button is pressed either with a
      click/tap or by using the Enter or Space key.
         */
        this.ui5Close = 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 text of the component.
      
      **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
         * - **icon**: Defines the content to be displayed as graphical element within the component.
      
      **Note:** If no icon is given, the default icon for the component type will be used.
      The SAP-icons font provides numerous options.
      
      See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).
         *
         * @example
         * ```html
         * <ui5-message-strip>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-message-strip>
         * ```
         *
         * @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 text of the component.\n\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design."
            },
            {
                "name": "icon",
                "description": "Defines the content to be displayed as graphical element within the component.\n\n**Note:** If no icon is given, the default icon for the component type will be used.\nThe SAP-icons font provides numerous options.\n\nSee all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html)."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'design',
            'colorScheme',
            'hideIcon',
            'hideCloseButton',
        ];
        // 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 = [
            'ui5Close',
        ];
        // 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: MessageStrip, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: MessageStrip, isStandalone: true, selector: "ui5-message-strip, [ui5-message-strip]", inputs: { design: { classPropertyName: "design", publicName: "design", isSignal: true, isRequired: false, transformFunction: null }, colorScheme: { classPropertyName: "colorScheme", publicName: "colorScheme", isSignal: true, isRequired: false, transformFunction: null }, hideIcon: { classPropertyName: "hideIcon", publicName: "hideIcon", isSignal: true, isRequired: false, transformFunction: null }, hideCloseButton: { classPropertyName: "hideCloseButton", publicName: "hideCloseButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5Close: "ui5Close" }, exportAs: ["ui5MessageStrip"], 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: MessageStrip, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-message-strip, [ui5-message-strip]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5MessageStrip',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { MessageStrip };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-message-strip.mjs.map
