{"version":3,"file":"koalarx-ui-shared-components-input-field-input-url.mjs","sources":["../../projects/koala-ui/shared/components/input-field/input-url/input-url.ts","../../projects/koala-ui/shared/components/input-field/input-url/input-url.html","../../projects/koala-ui/shared/components/input-field/input-url/koalarx-ui-shared-components-input-field-input-url.ts"],"sourcesContent":["import {\n  ChangeDetectionStrategy,\n  Component,\n  effect,\n  inject,\n} from '@angular/core';\nimport { Validators } from '@angular/forms';\nimport { AppConfig } from '@koalarx/ui/core/config';\nimport {\n  InputField,\n  InputFieldBase,\n} from '@koalarx/ui/shared/components/input-field';\n\n@Component({\n  selector: 'kl-input-url',\n  templateUrl: './input-url.html',\n  imports: [InputField],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class InputUrl extends InputFieldBase {\n  readonly translations = inject(AppConfig).translation.form;\n\n  constructor() {\n    super();\n\n    effect(() => {\n      const control = this.control();\n\n      control.addValidators(\n        Validators.pattern(/^(https?|ftp):\\/\\/[^\\s/$.?#].[^\\s]*$/)\n      );\n    });\n  }\n}\n","<kl-input-field\n  [control]=\"control()\"\n  [label]=\"label()\"\n  [placeholder]=\"placeholder()\"\n  [hint]=\"hint()\"\n  type=\"url\">\n\n  <ng-container errors>\n    @if (control().errors?.['pattern']) {\n      <div class=\"error-message\">{{ translations.invalidURL }}</div>\n    }\n  </ng-container>\n</kl-input-field>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAmBM,MAAO,QAAS,SAAQ,cAAc,CAAA;IACjC,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,IAAI;AAE1D,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QAEP,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;YAE9B,OAAO,CAAC,aAAa,CACnB,UAAU,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAC3D;AACH,SAAC,CAAC;;uGAZO,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECnBrB,yUAaA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDGY,UAAU,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,KAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAGT,QAAQ,EAAA,UAAA,EAAA,CAAA;kBANpB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,WAEf,CAAC,UAAU,CAAC,EAAA,eAAA,EACJ,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yUAAA,EAAA;;;AEjBjD;;AAEG;;;;"}