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

class ButtonBadge {
    constructor() {
        /**
         * Defines the badge placement and appearance.
      - **InlineText** - displayed inside the button after its text, and recommended for **compact** density.
      - **OverlayText** - displayed at the top-end corner of the button, and recommended for **cozy** density.
      - **AttentionDot** - displayed at the top-end corner of the button as a dot, and suitable for both **cozy** and **compact** densities.
         */
        this.design = input("AttentionDot", ...(ngDevMode ? [{ debugName: "design" }] : []));
        /**
         * Defines the text of the component.
      
      **Note:** Text is not applied when the `design` property is set to `AttentionDot`.
      
      **Note:** The badge component only accepts numeric values and the "+" symbol. Using other characters or formats may result in unpredictable behavior, which is not guaranteed or supported.
         */
        this.text = input("", ...(ngDevMode ? [{ debugName: "text" }] : [])); // className is now passed
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'design',
            'text',
        ];
        // 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;
                        }
                    });
                });
            }
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ButtonBadge, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: ButtonBadge, isStandalone: true, selector: "ui5-button-badge, [ui5-button-badge]", inputs: { design: { classPropertyName: "design", publicName: "design", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ui5ButtonBadge"], 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: ButtonBadge, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-button-badge, [ui5-button-badge]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5ButtonBadge',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { ButtonBadge };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-button-badge.mjs.map
