{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-lazy-slider.mjs","mappings":";;;;;;;;AA2Dc;;;;;;AAKH;;AAEA;;;AAPU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAlDT","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/fields/slider/bs-slider.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FormField } from '@angular/forms/signals';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport { NgForgeControl, injectNgForgeField, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';\nimport { BsSliderProps } from './bs-slider.type';\nimport { AsyncPipe } from '@angular/common';\nimport { InputConstraintsDirective } from '@ng-forge/dynamic-forms-bootstrap/shared';\n\n@Component({\n  selector: 'df-bs-slider',\n  imports: [FormField, DynamicTextPipe, AsyncPipe, InputConstraintsDirective, NgForgeControl],\n  styleUrl: '../../styles/_form-field.scss',\n  hostDirectives: [NgForgeFieldHost],\n  template: `\n    @let f = ngf.field(); @let inputId = ngf.key() + '-input';\n\n    <div class=\"mb-3\">\n      @if (ngf.label(); as label) {\n        <label [for]=\"inputId\" class=\"form-label\">\n          {{ label | dynamicText | async }}\n          @if (props()?.showValue) {\n            <span class=\"ms-2 badge bg-secondary\"> {{ props()?.valuePrefix }}{{ f().value() }}{{ props()?.valueSuffix }} </span>\n          }\n        </label>\n      }\n\n      <input\n        ngForgeControl\n        type=\"range\"\n        dfBsInputConstraints\n        [formField]=\"f\"\n        [id]=\"inputId\"\n        [dfMin]=\"f().min?.() ?? props()?.min ?? min()\"\n        [dfMax]=\"f().max?.() ?? props()?.max ?? max()\"\n        [dfStep]=\"step() ?? props()?.step ?? 1\"\n        [attr.tabindex]=\"ngf.tabIndex()\"\n        class=\"form-range\"\n      />\n\n      @if (ngf.errorsToDisplay()[0]; as error) {\n        <div class=\"invalid-feedback d-block\" [id]=\"ngf.errorId()\" role=\"alert\">{{ error.message }}</div>\n      } @else if (props()?.hint; as hint) {\n        <div class=\"form-text\" [id]=\"ngf.hintId()\">{{ hint | dynamicText | async }}</div>\n      }\n    </div>\n  `,\n  styles: [\n    `\n      :host {\n        display: block;\n      }\n\n      :host([hidden]) {\n        display: none !important;\n      }\n    `,\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class BsSliderFieldComponent {\n  protected readonly ngf = injectNgForgeField<number>();\n\n  readonly min = input<number>(0);\n  readonly max = input<number>(100);\n  readonly step = input<number>();\n\n  readonly props = input<BsSliderProps>();\n}\n"]}