{"version":3,"file":"ngwr-progress.mjs","sources":["../../../projects/lib/progress/progress.ts","../../../projects/lib/progress/ngwr-progress.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport type { WrColor } from 'ngwr/theme';\n\n/**\n * Horizontal progress bar.\n *\n * @example\n * ```html\n * <wr-progress [value]=\"42\" />\n * <wr-progress color=\"success\" [value]=\"80\" />\n * ```\n *\n * @see https://ngwr.dev/components/progress\n */\n@Component({\n  selector: 'wr-progress',\n  template: `<div class=\"wr-progress__bar\" [style.width.%]=\"clamped()\"></div>`,\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    role: 'progressbar',\n    'aria-valuemin': '0',\n    'aria-valuemax': '100',\n    '[attr.aria-valuenow]': 'clamped()',\n    '[class]': 'classes()',\n  },\n})\nexport class WrProgress {\n  /**\n   * Bar color.\n   *\n   * @default 'primary'\n   */\n  readonly color = input<WrColor>('primary');\n\n  /**\n   * Progress value, clamped to `[0, 100]`.\n   *\n   * @default 0\n   */\n  readonly value = input(0, { transform: (v: unknown): number => coerceNumberProperty(v, 0) });\n\n  protected readonly clamped = computed(() => Math.max(0, Math.min(100, this.value())));\n\n  protected readonly classes = computed(() => `wr-progress wr-progress--${this.color()}`);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAOH;;;;;;;;;;AAUG;MAaU,UAAU,CAAA;AACrB;;;;AAIG;IACM,KAAK,GAAG,KAAK,CAAU,SAAS;8EAAC;AAE1C;;;;AAIG;AACM,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,S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