import { __decorate, __metadata } from 'tslib';
import { DecimalPipe } from '@angular/common';
import * as i0 from '@angular/core';
import { Input, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
import { applyCssClass } from '@fundamental-ngx/cdk/utils';

class ObjectNumberComponent {
    /** @hidden */
    constructor(elementRef) {
        this.elementRef = elementRef;
        /**
         * Number of decimal places to show
         */
        this.decimal = 0;
        /** Set the value to true to display the object number in bold text */
        this.emphasized = false;
        /** Set the value to true to display the object number in large text */
        this.large = false;
        /** @hidden */
        this._numberPipeConfig = '';
    }
    /** @hidden
     * CssClassBuilder interface implementation
     * function must return single string
     * function is responsible for order which css classes are applied
     */
    buildComponentCssClass() {
        return [
            'fd-object-number',
            this.large ? 'fd-object-number--large' : '',
            this.status ? `fd-object-number--${this.status}` : '',
            this.class
        ];
    }
    /** @hidden */
    ngOnChanges() {
        this._onChanges();
    }
    /** @hidden */
    ngOnInit() {
        this._onChanges();
    }
    /** @hidden */
    _onChanges() {
        this.buildComponentCssClass();
        this._buildNumberPipeConfig();
    }
    /** @hidden */
    _buildNumberPipeConfig() {
        this._numberPipeConfig = `0.${this.decimal}-${this.decimal}`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ObjectNumberComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: ObjectNumberComponent, isStandalone: true, selector: "fd-object-number", inputs: { number: "number", decimal: "decimal", unit: "unit", emphasized: "emphasized", large: "large", status: "status", class: "class", ariaLabelledBy: "ariaLabelledBy", ariaLabel: "ariaLabel" }, host: { properties: { "attr.aria-labelledby": "ariaLabelledBy", "attr.aria-label": "ariaLabel" } }, usesOnChanges: true, ngImport: i0, template: "<span class=\"fd-object-number__text\" [class.fd-object-number__text--bold]=\"!large && emphasized\">\n    {{ number | number: (decimal ? _numberPipeConfig : '1.0-0') }}\n</span>\n<span class=\"fd-object-number__unit\">{{ unit }}</span>\n", styles: ["@charset \"UTF-8\";.fd-object-number{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapNeutralTextColor);display:inline-block;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;max-width:100%;padding-block:0;padding-inline:0;text-shadow:var(--sapContent_TextShadow)}.fd-object-number:after,.fd-object-number:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-object-number__text,.fd-object-number__unit{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:inline-block;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;line-height:1;margin-block:0;margin-inline:0;max-width:100%;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.fd-object-number__text:after,.fd-object-number__text:before,.fd-object-number__unit:after,.fd-object-number__unit:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-object-number__text:after{content:\"\\a0\"}.fd-object-number__text--bold{font-weight:700}.fd-object-number__unit{font-family:var(--sapFontLightFamily)}.fd-object-number--positive .fd-object-number__text,.fd-object-number--positive .fd-object-number__unit{color:var(--sapPositiveTextColor)}.fd-object-number--critical .fd-object-number__text,.fd-object-number--critical .fd-object-number__unit{color:var(--sapCriticalTextColor)}.fd-object-number--negative .fd-object-number__text,.fd-object-number--negative .fd-object-number__unit{color:var(--sapNegativeTextColor)}.fd-object-number--informative .fd-object-number__text,.fd-object-number--informative .fd-object-number__unit{color:var(--sapInformativeTextColor)}.fd-object-number--large .fd-object-number__text,.fd-object-number--large .fd-object-number__unit{font-family:var(--sapFontLightFamily);font-size:1.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/object-number.css:\n  (*!\n   * Fundamental Library Styles v0.40.1\n   * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"], dependencies: [{ kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
__decorate([
    applyCssClass,
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", Array)
], ObjectNumberComponent.prototype, "buildComponentCssClass", null);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ObjectNumberComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-object-number', host: {
                        '[attr.aria-labelledby]': 'ariaLabelledBy',
                        '[attr.aria-label]': 'ariaLabel'
                    }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [DecimalPipe], template: "<span class=\"fd-object-number__text\" [class.fd-object-number__text--bold]=\"!large && emphasized\">\n    {{ number | number: (decimal ? _numberPipeConfig : '1.0-0') }}\n</span>\n<span class=\"fd-object-number__unit\">{{ unit }}</span>\n", styles: ["@charset \"UTF-8\";.fd-object-number{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapNeutralTextColor);display:inline-block;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;max-width:100%;padding-block:0;padding-inline:0;text-shadow:var(--sapContent_TextShadow)}.fd-object-number:after,.fd-object-number:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-object-number__text,.fd-object-number__unit{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:inline-block;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;line-height:1;margin-block:0;margin-inline:0;max-width:100%;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.fd-object-number__text:after,.fd-object-number__text:before,.fd-object-number__unit:after,.fd-object-number__unit:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-object-number__text:after{content:\"\\a0\"}.fd-object-number__text--bold{font-weight:700}.fd-object-number__unit{font-family:var(--sapFontLightFamily)}.fd-object-number--positive .fd-object-number__text,.fd-object-number--positive .fd-object-number__unit{color:var(--sapPositiveTextColor)}.fd-object-number--critical .fd-object-number__text,.fd-object-number--critical .fd-object-number__unit{color:var(--sapCriticalTextColor)}.fd-object-number--negative .fd-object-number__text,.fd-object-number--negative .fd-object-number__unit{color:var(--sapNegativeTextColor)}.fd-object-number--informative .fd-object-number__text,.fd-object-number--informative .fd-object-number__unit{color:var(--sapInformativeTextColor)}.fd-object-number--large .fd-object-number__text,.fd-object-number--large .fd-object-number__unit{font-family:var(--sapFontLightFamily);font-size:1.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/object-number.css:\n  (*!\n   * Fundamental Library Styles v0.40.1\n   * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"] }]
        }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { number: [{
                type: Input
            }], decimal: [{
                type: Input
            }], unit: [{
                type: Input
            }], emphasized: [{
                type: Input
            }], large: [{
                type: Input
            }], status: [{
                type: Input
            }], class: [{
                type: Input
            }], ariaLabelledBy: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }], buildComponentCssClass: [] } });

/**
 * @deprecated
 * Use direct import of `ObjectNumberComponent`
 */
class ObjectNumberModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ObjectNumberModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: ObjectNumberModule, imports: [ObjectNumberComponent], exports: [ObjectNumberComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ObjectNumberModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ObjectNumberModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [ObjectNumberComponent],
                    exports: [ObjectNumberComponent]
                }]
        }] });

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

export { ObjectNumberComponent, ObjectNumberModule };
//# sourceMappingURL=fundamental-ngx-core-object-number.mjs.map
