{"version":3,"file":"odx-angular-components-slider.mjs","sources":["../../../../libs/angular/components/slider/src/lib/slider.directive.ts","../../../../libs/angular/components/slider/src/odx-angular-components-slider.ts"],"sourcesContent":["import { Directive, ElementRef, HostBinding } from '@angular/core';\nimport { WithDisabledState } from '@odx/angular';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\n\n/**\n * SliderDirective enhances an HTML input of type range by integrating custom slider functionality.\n * It incorporates disabled state handling and custom style binding for visual feedback based on the slider's value.\n * Has host directives for disabled state handling.\n *\n * @see {WithDisabledState}\n */\n@CSSComponent('slider')\n@Directive({\n  standalone: true,\n  selector: 'input[type=range][odxSlider]',\n  hostDirectives: [WithDisabledState],\n})\nexport class SliderDirective {\n  public readonly element: ElementRef<HTMLInputElement> = injectElement();\n\n  /**\n   * Retrieves the current value of the slider.\n   *\n   * @returns {number}\n   */\n  public get value(): number {\n    return Number(this.element.nativeElement.value);\n  }\n\n  /**\n   * Retrieves the maximum value of the slider. Defaults to 100 if not specified.\n   *\n   * @returns {number}\n   */\n  public get max(): number {\n    return Number(this.element.nativeElement.max) || 100;\n  }\n\n  /**\n   * Retrieves the minimum value of the slider. Defaults to the native minimum if not specified.\n   *\n   * @returns {number}\n   */\n  public get min(): number {\n    return Number(this.element.nativeElement.min);\n  }\n\n  @HostBinding(`style.--odx-slider-filled.%`)\n  protected get valuePercentage(): number {\n    return (100 * (this.value - this.min)) / (this.max - this.min) || 0;\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAKA;;;;;;AAMG;AAOI,IAAM,eAAe,GAArB,MAAM,eAAe,CAAA;AAArB,IAAA,WAAA,GAAA;QACW,IAAA,CAAA,OAAO,GAAiC,aAAa,EAAE;AAiCxE,IAAA;AA/BC;;;;AAIG;AACH,IAAA,IAAW,KAAK,GAAA;QACd,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAA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