UNPKG

@koalarx/ui

Version:

Koala UI is a modern and accessible component library designed to speed up interface development in Angular projects. With simple integration and clear documentation, you can easily build robust and visually appealing applications.

1 lines 1.74 kB
{"version":3,"file":"koalarx-ui-shared-components-field-errors.mjs","sources":["../../projects/koala-ui/shared/components/field-errors/field-errors.ts","../../projects/koala-ui/shared/components/field-errors/field-errors.html","../../projects/koala-ui/shared/components/field-errors/koalarx-ui-shared-components-field-errors.ts"],"sourcesContent":["import { Component, inject, input } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { AppConfig } from '@koalarx/ui/core/config';\n\n@Component({\n selector: 'kl-field-errors',\n templateUrl: './field-errors.html',\n})\nexport class FieldErrors {\n readonly translations = inject(AppConfig).translation.form;\n field = input.required<FormControl>();\n}\n","@if (field().errors && field().touched) {\n <p class=\"validator-hint show mb-1.5\">\n <ng-content select=\"[errors]\" />\n\n @if (field().errors?.['required']) {\n {{translations.required}}<br/>\n }\n\n @if (field().errors?.['email']) {\n {{translations.invalidEmail}}<br/>\n }\n\n @if (field().errors?.['minlength']) {\n {{translations.invalidMinLength(field().errors?.['minlength'].requiredLength)}}<br/>\n }\n </p>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,WAAW,CAAA;IACb,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,IAAI;AAC1D,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAe;uGAF1B,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,8MCRxB,+cAiBA,EAAA,CAAA;;2FDTa,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,SAAS;+BACE,iBAAiB,EAAA,QAAA,EAAA,+cAAA,EAAA;;;AEL7B;;AAEG;;;;"}