import * as i0 from '@angular/core';
import { input, computed, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import { t, SiTranslatePipe } from '@siemens/element-translate-ng/translate';

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiProgressbarComponent {
    /**
     * Needed for a11y
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_PROGRESSBAR.LABEL:Progress`)
     * ```
     */
    ariaLabel = input(t(() => $localize `:@@SI_PROGRESSBAR.LABEL:Progress`), ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
    /**
     * Max value for progressbar
     *
     * @defaultValue 100
     */
    max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
    /**
     * Current value
     *
     * @defaultValue 0
     */
    value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
    /**
     * Heading to display on top of progress bar.
     */
    heading = input(...(ngDevMode ? [undefined, { debugName: "heading" }] : []));
    /**
     * Optional progress text to be shown on top right (in LTR).
     * It can be percentage value or a progress status. E.g `50 %` or `Downloading 2/8`.
     */
    progress = input(...(ngDevMode ? [undefined, { debugName: "progress" }] : []));
    /**
     * Height for progress bar.
     *
     * @defaultValue 'normal'
     */
    height = input('normal', ...(ngDevMode ? [{ debugName: "height" }] : []));
    percent = computed(() => (100 * Number(this.value() ?? 0)) / Number(this.max() ?? 100), ...(ngDevMode ? [{ debugName: "percent" }] : []));
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiProgressbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiProgressbarComponent, isStandalone: true, selector: "si-progressbar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (heading() || progress()) {\n  <div\n    class=\"d-flex align-items-baseline\"\n    [class.justify-content-end]=\"!heading()\"\n    [class.justify-content-between]=\"heading()\"\n  >\n    @if (heading()) {\n      <span class=\"si-h5 mb-2\">{{ heading() | translate }}</span>\n    }\n    @if (progress()) {\n      <small class=\"text-nowrap\">{{ progress() }}</small>\n    }\n  </div>\n}\n<div class=\"progress\" [class.si-progress-small]=\"height() === 'small'\">\n  <div\n    class=\"progress-bar\"\n    role=\"progressbar\"\n    [attr.aria-valuemin]=\"0\"\n    [attr.aria-valuemax]=\"max()\"\n    [attr.aria-valuenow]=\"value()\"\n    [attr.aria-valuetext]=\"value() !== undefined ? percent().toFixed(0) + '%' : null\"\n    [attr.aria-label]=\"ariaLabel() | translate\"\n    [style.width.%]=\"percent()\"\n  >\n  </div>\n</div>\n", styles: [".si-progress-small{block-size:.125rem;border-radius:.0625rem}\n"], dependencies: [{ kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiProgressbarComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-progressbar', imports: [SiTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (heading() || progress()) {\n  <div\n    class=\"d-flex align-items-baseline\"\n    [class.justify-content-end]=\"!heading()\"\n    [class.justify-content-between]=\"heading()\"\n  >\n    @if (heading()) {\n      <span class=\"si-h5 mb-2\">{{ heading() | translate }}</span>\n    }\n    @if (progress()) {\n      <small class=\"text-nowrap\">{{ progress() }}</small>\n    }\n  </div>\n}\n<div class=\"progress\" [class.si-progress-small]=\"height() === 'small'\">\n  <div\n    class=\"progress-bar\"\n    role=\"progressbar\"\n    [attr.aria-valuemin]=\"0\"\n    [attr.aria-valuemax]=\"max()\"\n    [attr.aria-valuenow]=\"value()\"\n    [attr.aria-valuetext]=\"value() !== undefined ? percent().toFixed(0) + '%' : null\"\n    [attr.aria-label]=\"ariaLabel() | translate\"\n    [style.width.%]=\"percent()\"\n  >\n  </div>\n</div>\n", styles: [".si-progress-small{block-size:.125rem;border-radius:.0625rem}\n"] }]
        }], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], progress: [{ type: i0.Input, args: [{ isSignal: true, alias: "progress", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiProgressbarModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiProgressbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: SiProgressbarModule, imports: [SiProgressbarComponent], exports: [SiProgressbarComponent] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiProgressbarModule });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiProgressbarModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [SiProgressbarComponent],
                    exports: [SiProgressbarComponent]
                }]
        }] });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

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

export { SiProgressbarComponent, SiProgressbarModule };
//# sourceMappingURL=siemens-element-ng-progressbar.mjs.map
