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

class BusyIndicator {
    constructor() {
        /**
         * Defines text to be displayed below the component. It can be used to inform the user of the current operation.
         */
        this.text = input(...(ngDevMode ? [undefined, { debugName: "text" }] : []));
        /**
         * Defines the size of the component.
         */
        this.size = input("M", ...(ngDevMode ? [{ debugName: "size" }] : []));
        /**
         * Defines if the busy indicator is visible on the screen. By default it is not.
         */
        this.active = input(false, ...(ngDevMode ? [{ debugName: "active", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines the delay in milliseconds, after which the busy indicator will be visible on the screen.
         */
        this.delay = input(1000, ...(ngDevMode ? [{ debugName: "delay" }] : []));
        /**
         * Defines the placement of the text.
         */
        this.textPlacement = input("Bottom", ...(ngDevMode ? [{ debugName: "textPlacement" }] : [])); // className is now passed
        /**
         * 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)**: Determines the content over which the component will appear.
         *
         * @example
         * ```html
         * <ui5-busy-indicator>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-busy-indicator>
         * ```
         *
         * @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": "Determines the content over which the component will appear."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'text',
            'size',
            'active',
            'delay',
            'textPlacement',
        ];
        // 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: BusyIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: BusyIndicator, isStandalone: true, selector: "ui5-busy-indicator, [ui5-busy-indicator]", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, textPlacement: { classPropertyName: "textPlacement", publicName: "textPlacement", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ui5BusyIndicator"], 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: BusyIndicator, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-busy-indicator, [ui5-busy-indicator]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5BusyIndicator',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { BusyIndicator };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-busy-indicator.mjs.map
