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

class FormItem {
    constructor() {
        /**
         * Defines the column span of the component,
      e.g how many columns the component should span to.
      
      **Note:** The column span should be a number between 1 and the available columns of the FormGroup (when items are placed in a group)
      or the Form. The available columns can be affected by the FormGroup#columnSpan and/or the Form#layout.
      A number bigger than the available columns won't take effect.
         */
        this.columnSpan = input(...(ngDevMode ? [undefined, { debugName: "columnSpan" }] : [])); // 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.
         *
         * - **labelContent**: Defines the label of the component.
         * - **(default)**: Defines the content of the component,
      associated to `labelContent`.
         *
         * @example
         * ```html
         * <ui5-form-item>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-form-item>
         * ```
         *
         * @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": "labelContent",
                "description": "Defines the label of the component."
            },
            {
                "name": "default",
                "description": "Defines the content of the component,\nassociated to `labelContent`."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'columnSpan',
        ];
        // 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: FormItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: FormItem, isStandalone: true, selector: "ui5-form-item, [ui5-form-item]", inputs: { columnSpan: { classPropertyName: "columnSpan", publicName: "columnSpan", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ui5FormItem"], 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: FormItem, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-form-item, [ui5-form-item]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5FormItem',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { FormItem };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-form-item.mjs.map
