{"version":3,"file":"seniorsistemas-angular-components-progressbar.mjs","sources":["../../projects/angular-components/progressbar/src/lib/progressbar/components/progressbar-determinate/progressbar-determinate.component.ts","../../projects/angular-components/progressbar/src/lib/progressbar/components/progressbar-determinate/progressbar-determinate.component.html","../../projects/angular-components/progressbar/src/lib/progressbar/components/progressbar-indeterminate/progressbar-indeterminate.component.ts","../../projects/angular-components/progressbar/src/lib/progressbar/components/progressbar-indeterminate/progressbar-indeterminate.component.html","../../projects/angular-components/progressbar/src/lib/progressbar/progressbar.component.ts","../../projects/angular-components/progressbar/src/lib/progressbar/progressbar.component.html","../../projects/angular-components/progressbar/src/lib/progressbar/progressbar.module.ts","../../projects/angular-components/progressbar/src/seniorsistemas-angular-components-progressbar.ts"],"sourcesContent":["import { Component, Input, OnInit, inject } from '@angular/core';\n\nimport { ProgressBarColors } from '../../types';\nimport { LocaleService } from '@seniorsistemas/angular-components/locale';\n\n@Component({\n\tselector: 's-progressbar-determinate',\n\ttemplateUrl: './progressbar-determinate.component.html',\n\tstyleUrls: ['./progressbar-determinate.component.scss'],\n})\nexport class ProgressBarDeterminateComponent implements OnInit {\n\tprivate readonly localeService = inject(LocaleService);\n\n\t@Input({ required: true })\n\tpublic value!: number;\n\n\t@Input({ required: true })\n\tpublic activeColor!: ProgressBarColors;\n\n\t@Input()\n\tpublic numberFormatOptions?: Intl.NumberFormatOptions;\n\n\t@Input()\n\tpublic targetValue?: number;\n\n\t@Input()\n\tpublic targetLabel?: string;\n\n\t@Input()\n\tpublic showValue = true;\n\n\tpublic numberFormat?: Intl.NumberFormat = new Intl.NumberFormat('pt-BR');\n\n\tpublic ngOnInit() {\n\t\tthis.validateValues();\n\n\t\tthis.onGetLocale();\n\t}\n\n\tprivate onGetLocale(): void {\n\t\tthis.localeService.getLocale().subscribe({\n\t\t\tnext: (locale) => {\n\t\t\t\tthis.numberFormat = new Intl.NumberFormat(locale ?? 'pt-BR', this.numberFormatOptions);\n\t\t\t},\n\t\t\terror: () => {\n\t\t\t\tthis.numberFormat = new Intl.NumberFormat('pt-BR', this.numberFormatOptions);\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate validateValues(): void {\n\t\tif (this.value < 0 || this.value > 100) {\n\t\t\tthrow new Error('Invalid value for value');\n\t\t}\n\t\tif (this.targetValue && (this.targetValue < 0 || this.targetValue > 100)) {\n\t\t\tthrow new Error('Invalid value for targetValue');\n\t\t}\n\t}\n}\n","<div class=\"progressbar-determinate\">\n    <div class=\"progressbar-container\">\n        <div\n            class=\"progressbar-active\"\n            [ngClass]=\"{\n                'progressbar-active--blue': activeColor === 'blue',\n                'progressbar-active--green': activeColor === 'green',\n                'progressbar-active--red': activeColor === 'red',\n                'progressbar-active--yellow': activeColor === 'yellow',\n            }\"\n            [ngStyle]=\"{ width: value + '%' }\"\n        >\n            {{ showValue && value ? numberFormat?.format(value) + '%' : '' }}\n        </div>\n    </div>\n    @if (targetValue) {\n        <div\n            class=\"target\"\n            [ngStyle]=\"{\n                left: targetValue <= 50 ? targetValue + '%' : 'unset',\n                right: targetValue > 50 ? 100 - targetValue + '%' : 'unset',\n                'align-items': targetValue > 50 ? 'flex-end' : 'flex-start',\n            }\"\n        >\n            <span class=\"target-line\"></span>\n            <span class=\"target-label\">\n                {{ targetLabel || numberFormat?.format(value) + '%' }}\n            </span>\n        </div>\n    }\n</div>\n","import { Component, Input } from '@angular/core';\n\nimport { ProgressBarColors } from '../../types';\n\n@Component({\n    selector: 's-progressbar-indeterminate',\n    templateUrl: './progressbar-indeterminate.component.html',\n    styleUrls: ['./progressbar-indeterminate.component.scss'],\n})\nexport class ProgressBarIndeterminateComponent {\n    @Input({ required: true })\n    public activeColor!: ProgressBarColors;\n\n    @Input()\n    public label?: string;\n}\n","<div class=\"progressbar-indeterminate\">\n    <div class=\"progressbar-container\">\n        <div class=\"indeterminate-bar\" [ngClass]=\"{\n            'indeterminate-bar--blue': activeColor === 'blue',\n            'indeterminate-bar--green': activeColor === 'green',\n            'indeterminate-bar--red': activeColor === 'red',\n            'indeterminate-bar--yellow': activeColor === 'yellow'\n        }\"></div>\n    </div>\n\n    @if (label) {\n        <span class=\"progressbar-label\">{{ label }}</span>\n    }\n</div>\n","import { Component, Input, OnInit } from '@angular/core';\n\nimport { ProgressBarColors, ProgressBarMode } from './types';\n\n/**\n * @description Componente de barra de progresso que representa visualmente o avanço de uma tarefa.\n * Suporta modo determinado (valor percentual) e indeterminado (progresso desconhecido),\n * além de um valor-alvo para comparação.\n *\n * @example\n * ```html\n * <s-progressbar\n *   [value]=\"75\"\n *   activeColor=\"blue\"\n *   label=\"Upload\"\n *   [showValue]=\"true\"\n * />\n * ```\n *\n * @category Feedback\n */\n@Component({\n    selector: 's-progressbar',\n    templateUrl: './progressbar.component.html',\n    styleUrls: ['./progressbar.component.scss'],\n})\nexport class ProgressBarComponent implements OnInit {\n    /**\n     * @description Valor atual do progresso, em percentual (0 a 100).\n     * Não utilizado quando `mode` é `'indeterminate'`.\n     * Lança erro se o valor estiver fora do intervalo permitido.\n     */\n    @Input()\n    public value!: number;\n\n    /**\n     * @description Cor ativa da barra de progresso. Campo obrigatório.\n     * Valores aceitos: `'blue'`, `'green'`, `'red'`, `'yellow'`.\n     */\n    @Input({ required: true })\n    public activeColor!: ProgressBarColors;\n\n    /**\n     * @description Opções de formatação numérica utilizadas para exibir o valor percentual.\n     * Baseado na API `Intl.NumberFormat`.\n     *\n     * @default `{ style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 2 }`\n     */\n    @Input()\n    public numberFormatOptions: Intl.NumberFormatOptions = {\n        style: 'decimal',\n        minimumFractionDigits: 0,\n        maximumFractionDigits: 2,\n        roundingMode: 'trunc',\n    };\n\n    /**\n     * @description Valor-alvo em percentual (0 a 100), exibido como marcador de referência na barra.\n     * Não utilizado quando `mode` é `'indeterminate'`.\n     */\n    @Input()\n    public targetValue?: number;\n\n    /** @description Rótulo descritivo exibido ao lado da barra de progresso principal. */\n    @Input()\n    public label?: string;\n\n    /** @description Rótulo descritivo exibido ao lado do marcador de valor-alvo. */\n    @Input()\n    public targetLabel?: string;\n\n    /**\n     * @description Quando `true`, exibe o valor percentual atual sobre ou próximo da barra.\n     *\n     * @default true\n     */\n    @Input()\n    public showValue = true;\n\n    /**\n     * @description Modo de operação da barra de progresso.\n     * - `'determinate'`: exibe o progresso baseado em `value` (padrão).\n     * - `'indeterminate'`: animação contínua sem valor definido; `value`, `targetValue` e `targetLabel` não devem ser usados.\n     *\n     * @default 'determinate'\n     */\n    @Input()\n    public mode: ProgressBarMode = 'determinate';\n\n    public ngOnInit(): void {\n        this.validateInputs();\n    }\n\n    private validateInputs(): void {\n        if (this.value < 0 || this.value > 100) {\n            throw new Error('Invalid value for value');\n        }\n\n        if (this.targetValue && (this.targetValue < 0 || this.targetValue > 100)) {\n            throw new Error('Invalid value for targetValue');\n        }\n\n        if (this.mode === 'indeterminate' && (this.value || this.targetValue || this.targetLabel)) {\n            throw new Error(\n                'When the mode is indeterminate, the value, targetValue and targetLabel parameters are not expected.',\n            );\n        }\n    }\n}\n\n","@if (mode === 'determinate') {\n    <s-progressbar-determinate\n        [value]=\"value\"\n        [numberFormatOptions]=\"numberFormatOptions\"\n        [targetValue]=\"targetValue\"\n        [targetLabel]=\"targetLabel\"\n        [activeColor]=\"activeColor\"\n        [showValue]=\"showValue\"\n    >\n    </s-progressbar-determinate>\n} @else {\n    <s-progressbar-indeterminate\n        [activeColor]=\"activeColor\"\n        [label]=\"label\"\n    >\n    </s-progressbar-indeterminate>\n}\n","/* eslint-disable max-len */\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { LocaleModule } from '@seniorsistemas/angular-components/locale';\nimport { ProgressBarComponent } from './progressbar.component';\nimport { ProgressBarDeterminateComponent } from './components/progressbar-determinate/progressbar-determinate.component';\nimport { ProgressBarIndeterminateComponent } from './components/progressbar-indeterminate/progressbar-indeterminate.component';\n\n@NgModule({\n\timports: [CommonModule, LocaleModule],\n\tdeclarations: [ProgressBarComponent, ProgressBarDeterminateComponent, ProgressBarIndeterminateComponent],\n\texports: [ProgressBarComponent],\n})\nexport class ProgressBarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ProgressBarDeterminateComponent","i2.ProgressBarIndeterminateComponent"],"mappings":";;;;;;MAUa,+BAA+B,CAAA;AAC1B,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAGhD,IAAA,KAAK,CAAU;AAGf,IAAA,WAAW,CAAqB;AAGhC,IAAA,mBAAmB,CAA4B;AAG/C,IAAA,WAAW,CAAU;AAGrB,IAAA,WAAW,CAAU;IAGrB,SAAS,GAAG,IAAI,CAAC;IAEjB,YAAY,GAAuB,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAElE,QAAQ,GAAA;QACd,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,IAAI,CAAC,WAAW,EAAE,CAAC;KACnB;IAEO,WAAW,GAAA;AAClB,QAAA,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC;AACxC,YAAA,IAAI,EAAE,CAAC,MAAM,KAAI;AAChB,gBAAA,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;aACvF;YACD,KAAK,EAAE,MAAK;AACX,gBAAA,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;aAC7E;AACD,SAAA,CAAC,CAAC;KACH;IAEO,cAAc,GAAA;AACrB,QAAA,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE;AACvC,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC3C;AACD,QAAA,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,CAA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