{"version":3,"file":"ng-forge-dynamic-forms-primeng-lazy-checkbox.mjs","mappings":";;;;;;;;AAmDc;;AAGH;;AAEU;;;;AAIf;;QAGF;;;;AAZiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA1CT","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-primeng/src/lib/fields/checkbox/prime-checkbox.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { FormField } from '@angular/forms/signals';\nimport { Checkbox } from 'primeng/checkbox';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport { NgForgeControl, injectNgForgeField, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';\nimport { PrimeCheckboxProps } from './prime-checkbox.type';\nimport { AsyncPipe } from '@angular/common';\n\n@Component({\n  selector: 'df-prime-checkbox',\n  imports: [Checkbox, DynamicTextPipe, AsyncPipe, FormField, NgForgeControl],\n  styleUrl: '../../styles/_form-field.scss',\n  hostDirectives: [NgForgeFieldHost],\n  template: `\n    @let f = ngf.field(); @let checkboxId = ngf.key() + '-checkbox';\n\n    <div class=\"flex items-center\">\n      <p-checkbox\n        ngForgeControl=\"input[type='checkbox']\"\n        [formField]=\"f\"\n        [inputId]=\"checkboxId\"\n        [binary]=\"props()?.binary ?? true\"\n        [trueValue]=\"props()?.trueValue ?? true\"\n        [falseValue]=\"props()?.falseValue ?? false\"\n        [styleClass]=\"checkboxClasses()\"\n        [tabindex]=\"ngf.tabIndex() ?? 0\"\n      />\n      @if (ngf.label(); as labelText) {\n        <label [for]=\"checkboxId\" class=\"ml-2\">{{ labelText | dynamicText | async }}</label>\n      }\n    </div>\n\n    @if (ngf.errorsToDisplay()[0]; as error) {\n      <small class=\"p-error\" [id]=\"ngf.errorId()\" role=\"alert\">{{ error.message }}</small>\n    } @else if (props()?.hint; as hint) {\n      <small class=\"p-hint\" [id]=\"ngf.hintId()\" [attr.hidden]=\"f().hidden() || null\">{{ hint | dynamicText | async }}</small>\n    }\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 PrimeCheckboxFieldComponent {\n  protected readonly ngf = injectNgForgeField<boolean>();\n\n  readonly props = input<PrimeCheckboxProps>();\n\n  protected readonly checkboxClasses = computed(() => {\n    const classes: string[] = [];\n    const styleClass = this.props()?.styleClass;\n    if (styleClass) {\n      classes.push(styleClass);\n    }\n    // Note: p-invalid is handled by [invalid] input binding, not manual class\n    return classes.join(' ');\n  });\n}\n"]}