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

class Tab {
    constructor() {
        /**
         * The text to be displayed for the item.
         */
        this.text = input(...(ngDevMode ? [undefined, { debugName: "text" }] : []));
        /**
         * Disabled tabs can't be selected.
         */
        this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Represents the "additionalText" text, which is displayed in the tab. In the cases when in the same time there are tabs with icons and tabs without icons, if a tab has no icon the "additionalText" is displayed larger.
         */
        this.additionalText = input(...(ngDevMode ? [undefined, { debugName: "additionalText" }] : []));
        /**
         * Defines the icon source URI to be displayed as graphical element within the component.
      The SAP-icons font provides numerous built-in icons.
      See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).
         */
        this.icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
        /**
         * Defines the component's design color.
      
      The design is applied to:
      
      - the component icon
      - the `text` when the component overflows
      - the tab selection line
      
      Available designs are: `"Default"`, `"Neutral"`, `"Positive"`, `"Critical"` and `"Negative"`.
      
      **Note:** The design depends on the current theme.
         */
        this.design = input("Default", ...(ngDevMode ? [{ debugName: "design" }] : []));
        /**
         * Specifies if the component is selected.
         */
        this.selected = input(false, ...(ngDevMode ? [{ debugName: "selected", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines if the tab is movable.
         */
        this.movable = input(false, ...(ngDevMode ? [{ debugName: "movable", transform: booleanAttribute }] : [{ transform: booleanAttribute }])); // 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)**: Holds the content associated with this tab.
         * - **items**: Defines hierarchies with nested sub tabs.
      
      **Note:** Use `ui5-tab` and `ui5-tab-separator` for the intended design.
         *
         * @example
         * ```html
         * <ui5-tab>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-tab>
         * ```
         *
         * @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": "Holds the content associated with this tab."
            },
            {
                "name": "items",
                "description": "Defines hierarchies with nested sub tabs.\n\n**Note:** Use `ui5-tab` and `ui5-tab-separator` for the intended design."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'text',
            'disabled',
            'additionalText',
            'icon',
            'design',
            'selected',
            'movable',
        ];
        // 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: Tab, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: Tab, isStandalone: true, selector: "ui5-tab, [ui5-tab]", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, additionalText: { classPropertyName: "additionalText", publicName: "additionalText", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, design: { classPropertyName: "design", publicName: "design", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, movable: { classPropertyName: "movable", publicName: "movable", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ui5Tab"], 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: Tab, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-tab, [ui5-tab]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5Tab',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { Tab };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-tab.mjs.map
