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

class Link {
    constructor() {
        /**
         * Defines whether the component is disabled.
      
      **Note:** When disabled, the click event cannot be triggered by the user.
         */
        this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines the tooltip of the component.
         */
        this.tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : []));
        /**
         * Defines the component href.
      
      **Note:** Standard hyperlink behavior is supported.
         */
        this.href = input(...(ngDevMode ? [undefined, { debugName: "href" }] : []));
        /**
         * Defines the component target.
      
      **Notes:**
      
      - `_self`
      - `_top`
      - `_blank`
      - `_parent`
      - `_search`
      
      **This property must only be used when the `href` property is set.**
         */
        this.target = input(...(ngDevMode ? [undefined, { debugName: "target" }] : []));
        /**
         * Defines the component design.
      
      **Note:** Avaialble options are `Default`, `Subtle`, and `Emphasized`.
         */
        this.design = input("Default", ...(ngDevMode ? [{ debugName: "design" }] : []));
        /**
         * Defines the target area size of the link:
      - **InteractiveAreaSize.Normal**: The default target area size.
      - **InteractiveAreaSize.Large**: The target area size is enlarged to 24px in height.
      
      **Note:**The property is designed to make links easier to activate and helps meet the WCAG 2.2 Target Size requirement. It is applicable only for the SAP Horizon themes.
      **Note:**To improve <code>ui5-link</code>'s reliability and usability, it is recommended to use the <code>InteractiveAreaSize.Large</code> value in scenarios where the <code>ui5-link</code> component is placed inside another interactive component, such as a list item or a table cell.
      Setting the <code>interactiveAreaSize</code> property to <code>InteractiveAreaSize.Large</code> increases the <code>ui5-link</code>'s invisible touch area. As a result, the user's intended one-time selection command is more likely to activate the desired <code>ui5-link</code>, with minimal chance of unintentionally activating the underlying component.
         */
        this.interactiveAreaSize = input("Normal", ...(ngDevMode ? [{ debugName: "interactiveAreaSize" }] : []));
        /**
         * Defines how the text of a component will be displayed when there is not enough space.
      
      **Note:** By default the text will wrap. If "None" is set - the text will truncate.
         */
        this.wrappingType = input("Normal", ...(ngDevMode ? [{ debugName: "wrappingType" }] : []));
        /**
         * Defines the accessible ARIA name of the component.
         */
        this.accessibleName = input(...(ngDevMode ? [undefined, { debugName: "accessibleName" }] : []));
        /**
         * Receives id(or many ids) of the elements that label the input
         */
        this.accessibleNameRef = input(...(ngDevMode ? [undefined, { debugName: "accessibleNameRef" }] : []));
        /**
         * Defines the ARIA role of the component.
      
      **Note:** Use the <code>LinkAccessibleRole.Button</code> role in cases when navigation is not expected to occur and the href property is not defined.
         */
        this.accessibleRole = input("Link", ...(ngDevMode ? [{ debugName: "accessibleRole" }] : []));
        /**
         * Defines the additional accessibility attributes that will be applied to the component.
      The following fields are supported:
      
      - **expanded**: Indicates whether the button, or another grouping element it controls, is currently expanded or collapsed.
      Accepts the following string values: `true` or `false`.
      
      - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.
      Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.
         */
        this.accessibilityAttributes = input({}, ...(ngDevMode ? [{ debugName: "accessibilityAttributes" }] : []));
        /**
         * Defines the accessible description of the component.
         */
        this.accessibleDescription = input(...(ngDevMode ? [undefined, { debugName: "accessibleDescription" }] : []));
        /**
         * Defines the icon, displayed as graphical element within the component before the link's text.
      The SAP-icons font provides numerous options.
      
      **Note:** Usage of icon-only link is not supported, the link must always have a text.
      
      **Note:** We recommend using аn icon in the beginning or the end only, and with text.
      
      See all the available icons within 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 icon, displayed as graphical element within the component after the link's text.
      The SAP-icons font provides numerous options.
      
      **Note:** Usage of icon-only link is not supported, the link must always have a text.
      
      **Note:** We recommend using аn icon in the beginning or the end only, and with text.
      
      See all the available icons within the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).
         */
        this.endIcon = input(...(ngDevMode ? [undefined, { debugName: "endIcon" }] : [])); // className is now passed
        /**
         * Fired when the component is triggered either with a mouse/tap
      or by using the Enter key.
         */
        this.ui5Click = output();
        /**
         * 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)**: Defines the text of the component.
      
      **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
         *
         * @example
         * ```html
         * <ui5-link>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-link>
         * ```
         *
         * @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": "Defines the text of the component.\n\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'disabled',
            'tooltip',
            'href',
            'target',
            'design',
            'interactiveAreaSize',
            'wrappingType',
            'accessibleName',
            'accessibleNameRef',
            'accessibleRole',
            'accessibilityAttributes',
            'accessibleDescription',
            'icon',
            'endIcon',
        ];
        // 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;
                        }
                    });
                });
            }
        }
        const outputsToSync = [
            'ui5Click',
        ];
        // Synchronize outputs (events)
        for (const outputName of outputsToSync) {
            // Map Angular output name to UI5 web component event name
            const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
            // Ensure the output property exists and has an emit function before adding listener
            if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
                // Cast the listener to the correct type to satisfy TypeScript
                wcElement.addEventListener(eventName, (e) => {
                    this[outputName].emit(e);
                });
            }
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: Link, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: Link, isStandalone: true, selector: "ui5-link, [ui5-link]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, design: { classPropertyName: "design", publicName: "design", isSignal: true, isRequired: false, transformFunction: null }, interactiveAreaSize: { classPropertyName: "interactiveAreaSize", publicName: "interactiveAreaSize", isSignal: true, isRequired: false, transformFunction: null }, wrappingType: { classPropertyName: "wrappingType", publicName: "wrappingType", isSignal: true, isRequired: false, transformFunction: null }, accessibleName: { classPropertyName: "accessibleName", publicName: "accessibleName", isSignal: true, isRequired: false, transformFunction: null }, accessibleNameRef: { classPropertyName: "accessibleNameRef", publicName: "accessibleNameRef", isSignal: true, isRequired: false, transformFunction: null }, accessibleRole: { classPropertyName: "accessibleRole", publicName: "accessibleRole", isSignal: true, isRequired: false, transformFunction: null }, accessibilityAttributes: { classPropertyName: "accessibilityAttributes", publicName: "accessibilityAttributes", isSignal: true, isRequired: false, transformFunction: null }, accessibleDescription: { classPropertyName: "accessibleDescription", publicName: "accessibleDescription", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, endIcon: { classPropertyName: "endIcon", publicName: "endIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5Click: "ui5Click" }, exportAs: ["ui5Link"], 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: Link, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-link, [ui5-link]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5Link',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

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