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

class ColorPalette {
    constructor() {
        // className is now passed
        /**
         * Fired when the user selects a color.
         */
        this.ui5ItemClick = 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 `ui5-color-palette-item` elements.
         *
         * @example
         * ```html
         * <ui5-color-palette>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-color-palette>
         * ```
         *
         * @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 `ui5-color-palette-item` elements."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const outputsToSync = [
            'ui5ItemClick',
        ];
        // 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: ColorPalette, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: ColorPalette, isStandalone: true, selector: "ui5-color-palette, [ui5-color-palette]", outputs: { ui5ItemClick: "ui5ItemClick" }, exportAs: ["ui5ColorPalette"], 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: ColorPalette, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-color-palette, [ui5-color-palette]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5ColorPalette',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { ColorPalette };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-color-palette.mjs.map
