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

class Carousel {
    constructor() {
        /**
         * Defines the accessible name of the component.
         */
        this.accessibleName = input(...(ngDevMode ? [undefined, { debugName: "accessibleName" }] : []));
        /**
         * Defines the IDs of the elements that label the input.
         */
        this.accessibleNameRef = input(...(ngDevMode ? [undefined, { debugName: "accessibleNameRef" }] : []));
        /**
         * Defines whether the carousel should loop, i.e show the first page after the last page is reached and vice versa.
         */
        this.cyclic = input(false, ...(ngDevMode ? [{ debugName: "cyclic", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines the number of items per page depending on the carousel width.
      
      - 'S' for screens smaller than 600 pixels.
      - 'M' for screens greater than or equal to 600 pixels and smaller than 1024 pixels.
      - 'L' for screens greater than or equal to 1024 pixels and smaller than 1440 pixels.
      - 'XL' for screens greater than or equal to 1440 pixels.
      
      One item per page is shown by default.
         */
        this.itemsPerPage = input("S1 M1 L1 XL1", ...(ngDevMode ? [{ debugName: "itemsPerPage" }] : []));
        /**
         * Defines the visibility of the navigation arrows.
      If set to true the navigation arrows will be hidden.
         */
        this.hideNavigationArrows = input(false, ...(ngDevMode ? [{ debugName: "hideNavigationArrows", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines the visibility of the page indicator.
      If set to true the page indicator will be hidden.
         */
        this.hidePageIndicator = input(false, ...(ngDevMode ? [{ debugName: "hidePageIndicator", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
        /**
         * Defines the style of the page indicator.
      Available options are:
      
      - `Default` - The page indicator will be visualized as dots if there are fewer than 9 pages. If there are more pages, the page indicator will switch to displaying the current page and the total number of pages. (e.g. X of Y)
      - `Numeric` - The page indicator will display the current page and the total number of pages. (e.g. X of Y)
         */
        this.pageIndicatorType = input("Default", ...(ngDevMode ? [{ debugName: "pageIndicatorType" }] : []));
        /**
         * Defines the carousel's background design.
         */
        this.backgroundDesign = input("Translucent", ...(ngDevMode ? [{ debugName: "backgroundDesign" }] : []));
        /**
         * Defines the page indicator background design.
         */
        this.pageIndicatorBackgroundDesign = input("Solid", ...(ngDevMode ? [{ debugName: "pageIndicatorBackgroundDesign" }] : []));
        /**
         * Defines the page indicator border design.
         */
        this.pageIndicatorBorderDesign = input("Solid", ...(ngDevMode ? [{ debugName: "pageIndicatorBorderDesign" }] : []));
        /**
         * Defines the position of arrows.
      
      Available options are:
      
      - `Content` - the arrows are placed on the sides of the current page.
      - `Navigation` - the arrows are placed on the sides of the page indicator.
         */
        this.arrowsPlacement = input("Content", ...(ngDevMode ? [{ debugName: "arrowsPlacement" }] : [])); // className is now passed
        /**
         * Fired whenever the page changes due to user interaction,
      when the user clicks on the navigation arrows or while resizing,
      based on the `items-per-page` property.
         */
        this.ui5Navigate = 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.
      
      **Note:** Items with the `hidden` attribute will be automatically excluded from carousel navigation and page calculations.
      They will not be displayed or accessible via keyboard navigation. See [sample](./#carousel-with-hidden-items).
         *
         * @example
         * ```html
         * <ui5-carousel>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-carousel>
         * ```
         *
         * @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.\n\n**Note:** Items with the `hidden` attribute will be automatically excluded from carousel navigation and page calculations.\nThey will not be displayed or accessible via keyboard navigation. See [sample](./#carousel-with-hidden-items)."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    /**
     * The indices of the currently visible items of the component.
     * @readonly This property is managed by the web component.
     */
    get visibleItemsIndices() {
        return this.element?.visibleItemsIndices ?? [];
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'accessibleName',
            'accessibleNameRef',
            'cyclic',
            'itemsPerPage',
            'hideNavigationArrows',
            'hidePageIndicator',
            'pageIndicatorType',
            'backgroundDesign',
            'pageIndicatorBackgroundDesign',
            'pageIndicatorBorderDesign',
            'arrowsPlacement',
        ];
        // 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 = [
            'ui5Navigate',
        ];
        // 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: Carousel, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: Carousel, isStandalone: true, selector: "ui5-carousel, [ui5-carousel]", inputs: { accessibleName: { classPropertyName: "accessibleName", publicName: "accessibleName", isSignal: true, isRequired: false, transformFunction: null }, accessibleNameRef: { classPropertyName: "accessibleNameRef", publicName: "accessibleNameRef", isSignal: true, isRequired: false, transformFunction: null }, cyclic: { classPropertyName: "cyclic", publicName: "cyclic", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPage: { classPropertyName: "itemsPerPage", publicName: "itemsPerPage", isSignal: true, isRequired: false, transformFunction: null }, hideNavigationArrows: { classPropertyName: "hideNavigationArrows", publicName: "hideNavigationArrows", isSignal: true, isRequired: false, transformFunction: null }, hidePageIndicator: { classPropertyName: "hidePageIndicator", publicName: "hidePageIndicator", isSignal: true, isRequired: false, transformFunction: null }, pageIndicatorType: { classPropertyName: "pageIndicatorType", publicName: "pageIndicatorType", isSignal: true, isRequired: false, transformFunction: null }, backgroundDesign: { classPropertyName: "backgroundDesign", publicName: "backgroundDesign", isSignal: true, isRequired: false, transformFunction: null }, pageIndicatorBackgroundDesign: { classPropertyName: "pageIndicatorBackgroundDesign", publicName: "pageIndicatorBackgroundDesign", isSignal: true, isRequired: false, transformFunction: null }, pageIndicatorBorderDesign: { classPropertyName: "pageIndicatorBorderDesign", publicName: "pageIndicatorBorderDesign", isSignal: true, isRequired: false, transformFunction: null }, arrowsPlacement: { classPropertyName: "arrowsPlacement", publicName: "arrowsPlacement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5Navigate: "ui5Navigate" }, exportAs: ["ui5Carousel"], 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: Carousel, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-carousel, [ui5-carousel]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5Carousel',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

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