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

class ListItemCustom {
    constructor() {
        /**
         * Defines whether the item is movable.
         */
        this.movable = input(false, ...(ngDevMode ? [{ debugName: "movable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines the text alternative of the component.
      
      **Note**: If not provided a default text alternative will be set, if present.
         */
        this.accessibleName = input(...(ngDevMode ? [undefined, { debugName: "accessibleName" }] : []));
        /**
         * Defines the visual indication and behavior of the list items.
      Available options are `Active` (by default), `Inactive`, `Detail` and `Navigation`.
      
      **Note:** When set to `Active` or `Navigation`, the item will provide visual response upon press and hover,
      while with type `Inactive` and `Detail` - will not.
         */
        this.type = input("Active", ...(ngDevMode ? [{ debugName: "type" }] : []));
        /**
         * Defines the additional accessibility attributes that will be applied to the component.
      The following fields are supported:
      
      - **ariaSetsize**: Defines the number of items in the current set  when not all items in the set are present in the DOM.
      **Note:** The value is an integer reflecting the number of items in the complete set. If the size of the entire set is unknown, set `-1`.
      
          - **ariaPosinset**: Defines an element's number or position in the current set when not all items are present in the DOM.
          **Note:** The value is an integer greater than or equal to 1, and less than or equal to the size of the set when that size is known.
         */
        this.accessibilityAttributes = input({}, ...(ngDevMode ? [{ debugName: "accessibilityAttributes" }] : []));
        /**
         * The navigated state of the list item.
      If set to `true`, a navigation indicator is displayed at the end of the list item.
         */
        this.navigated = input(false, ...(ngDevMode ? [{ debugName: "navigated", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines the text of the tooltip that would be displayed for the list item.
         */
        this.tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : []));
        /**
         * Defines the highlight state of the list items.
      Available options are: `"None"` (by default), `"Positive"`, `"Critical"`, `"Information"` and `"Negative"`.
         */
        this.highlight = input("None", ...(ngDevMode ? [{ debugName: "highlight" }] : []));
        /**
         * Defines the selected state of the component.
         */
        this.selected = input(false, ...(ngDevMode ? [{ debugName: "selected", transform: booleanAttribute }] : [{ transform: booleanAttribute }])); // className is now passed
        /**
         * Fired when the user clicks on the detail button when type is `Detail`.
         */
        this.ui5DetailClick = 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 content of the component.
         * - **deleteButton**: Defines the delete button, displayed in "Delete" mode.
      **Note:** While the slot allows custom buttons, to match
      design guidelines, please use the `ui5-button` component.
      **Note:** When the slot is not present, a built-in delete button will be displayed.
         *
         * @example
         * ```html
         * <ui5-li-custom>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-li-custom>
         * ```
         *
         * @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 content of the component."
            },
            {
                "name": "deleteButton",
                "description": "Defines the delete button, displayed in \"Delete\" mode.\n**Note:** While the slot allows custom buttons, to match\ndesign guidelines, please use the `ui5-button` component.\n**Note:** When the slot is not present, a built-in delete button will be displayed.",
                "since": "1.9.0"
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'movable',
            'accessibleName',
            'type',
            'accessibilityAttributes',
            'navigated',
            'tooltip',
            'highlight',
            'selected',
        ];
        // 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 = [
            'ui5DetailClick',
        ];
        // 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: ListItemCustom, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: ListItemCustom, isStandalone: true, selector: "ui5-li-custom, [ui5-li-custom]", inputs: { movable: { classPropertyName: "movable", publicName: "movable", isSignal: true, isRequired: false, transformFunction: null }, accessibleName: { classPropertyName: "accessibleName", publicName: "accessibleName", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, accessibilityAttributes: { classPropertyName: "accessibilityAttributes", publicName: "accessibilityAttributes", isSignal: true, isRequired: false, transformFunction: null }, navigated: { classPropertyName: "navigated", publicName: "navigated", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5DetailClick: "ui5DetailClick" }, exportAs: ["ui5ListItemCustom"], 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: ListItemCustom, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-li-custom, [ui5-li-custom]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5ListItemCustom',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { ListItemCustom };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-list-item-custom.mjs.map
