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

class ExpandableText {
    constructor() {
        /**
         * Text of the component.
         */
        this.text = input(...(ngDevMode ? [undefined, { debugName: "text" }] : []));
        /**
         * Maximum number of characters to be displayed initially. If the text length exceeds this limit, the text will be truncated with an ellipsis, and the "More" link will be displayed.
         */
        this.maxCharacters = input(100, ...(ngDevMode ? [{ debugName: "maxCharacters" }] : []));
        /**
         * Determines how the full text will be displayed.
         */
        this.overflowMode = input("InPlace", ...(ngDevMode ? [{ debugName: "overflowMode" }] : []));
        /**
         * Specifies if an empty indicator should be displayed when there is no text.
         */
        this.emptyIndicatorMode = input("Off", ...(ngDevMode ? [{ debugName: "emptyIndicatorMode" }] : [])); // 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 = [
            'text',
            'maxCharacters',
            'overflowMode',
            'emptyIndicatorMode',
        ];
        // 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: ExpandableText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: ExpandableText, isStandalone: true, selector: "ui5-expandable-text, [ui5-expandable-text]", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, overflowMode: { classPropertyName: "overflowMode", publicName: "overflowMode", isSignal: true, isRequired: false, transformFunction: null }, emptyIndicatorMode: { classPropertyName: "emptyIndicatorMode", publicName: "emptyIndicatorMode", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ui5ExpandableText"], 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: ExpandableText, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-expandable-text, [ui5-expandable-text]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5ExpandableText',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { ExpandableText };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-expandable-text.mjs.map
