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

class CalendarDateRange {
    constructor() {
        /**
         * Start of date range formatted according to the `formatPattern` property
      of the `ui5-calendar` that hosts the component.
         */
        this.startValue = input("", ...(ngDevMode ? [{ debugName: "startValue" }] : []));
        /**
         * End of date range formatted according to the `formatPattern` property
      of the `ui5-calendar` that hosts the component.
         */
        this.endValue = input("", ...(ngDevMode ? [{ debugName: "endValue" }] : [])); // 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 = [
            'startValue',
            'endValue',
        ];
        // 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: CalendarDateRange, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: CalendarDateRange, isStandalone: true, selector: "ui5-date-range, [ui5-date-range]", inputs: { startValue: { classPropertyName: "startValue", publicName: "startValue", isSignal: true, isRequired: false, transformFunction: null }, endValue: { classPropertyName: "endValue", publicName: "endValue", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ui5CalendarDateRange"], 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: CalendarDateRange, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-date-range, [ui5-date-range]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5CalendarDateRange',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { CalendarDateRange };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-calendar-date-range.mjs.map
