@lagoshny/ngx-validation-messages 3.0.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,18 +13,18 @@ import { MatFormFieldModule } from '@angular/material/form-field';
13
13
  */
14
14
  class NgxCustomMessageComponent {
15
15
  }
16
- NgxCustomMessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxCustomMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
17
- NgxCustomMessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: NgxCustomMessageComponent, selector: "ngx-custom-message", inputs: { validatorName: ["forValidator", "validatorName"] }, viewQueries: [{ propertyName: "message", first: true, predicate: ["message"], descendants: true }], ngImport: i0, template: `
18
- <div #message>
19
- <ng-content></ng-content>
16
+ NgxCustomMessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxCustomMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
17
+ NgxCustomMessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NgxCustomMessageComponent, selector: "ngx-custom-message", inputs: { validatorName: ["forValidator", "validatorName"] }, viewQueries: [{ propertyName: "message", first: true, predicate: ["message"], descendants: true }], ngImport: i0, template: `
18
+ <div #message>
19
+ <ng-content></ng-content>
20
20
  </div>`, isInline: true });
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxCustomMessageComponent, decorators: [{
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxCustomMessageComponent, decorators: [{
22
22
  type: Component,
23
23
  args: [{
24
24
  selector: 'ngx-custom-message',
25
- template: `
26
- <div #message>
27
- <ng-content></ng-content>
25
+ template: `
26
+ <div #message>
27
+ <ng-content></ng-content>
28
28
  </div>`
29
29
  }]
30
30
  }], propDecorators: { validatorName: [{
@@ -51,9 +51,9 @@ class NgxValidatorNameDirective {
51
51
  this.message = this.elem.nativeElement.innerText;
52
52
  }
53
53
  }
54
- NgxValidatorNameDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidatorNameDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
55
- NgxValidatorNameDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: NgxValidatorNameDirective, selector: "[ngxValidatorName]", inputs: { validatorName: "validatorName" }, ngImport: i0 });
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidatorNameDirective, decorators: [{
54
+ NgxValidatorNameDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidatorNameDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
55
+ NgxValidatorNameDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: NgxValidatorNameDirective, selector: "[ngxValidatorName]", inputs: { validatorName: "validatorName" }, ngImport: i0 });
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidatorNameDirective, decorators: [{
57
57
  type: Directive,
58
58
  args: [{
59
59
  selector: '[ngxValidatorName]'
@@ -124,9 +124,9 @@ class NgxValidationMessagesService {
124
124
  }
125
125
  }
126
126
  NgxValidationMessagesService.SERVER_ERRORS = 'serverErrors';
127
- NgxValidationMessagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesService, deps: [{ token: NGX_VALIDATION_MESSAGES_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
128
- NgxValidationMessagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesService });
129
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesService, decorators: [{
127
+ NgxValidationMessagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesService, deps: [{ token: NGX_VALIDATION_MESSAGES_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
128
+ NgxValidationMessagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesService });
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesService, decorators: [{
130
130
  type: Injectable
131
131
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
132
132
  type: Inject,
@@ -202,11 +202,11 @@ class NgxValidationMessagesComponent {
202
202
  });
203
203
  }
204
204
  }
205
- NgxValidationMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesComponent, deps: [{ token: NGX_VALIDATION_MESSAGES_CONFIG }, { token: NgxValidationMessagesService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
206
- NgxValidationMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: NgxValidationMessagesComponent, selector: "ngx-validation-messages, [ngxValidationMessages]", inputs: { formControl: ["for", "formControl"] }, queries: [{ propertyName: "customMsgComponent", predicate: NgxCustomMessageComponent }, { propertyName: "customMsgDirective", predicate: NgxValidatorNameDirective }], ngImport: i0, template: "<!--To show error messages standalone without component-->\r\n<div *ngIf=\"!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0\"\r\n [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\r\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\r\n <ng-content></ng-content>\r\n </span>\r\n</div>\r\n\r\n<ng-container *ngIf=\"errorMessages.length > 0\">\r\n\r\n <!--To show error messages in material ui style-->\r\n <ng-container *ngIf=\"isMaterialError; else withoutMaterial\">\r\n <ng-container *ngFor=\"let message of errorMessages\">\r\n <mat-error>{{ message }}</mat-error>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!--To show error messages in user style-->\r\n <ng-template #withoutMaterial>\r\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\r\n <div *ngFor=\"let message of errorMessages\">\r\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\r\n {{ message }}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n</ng-container>\r\n", styles: [".ngx_vm__def_error_block{position:relative;display:inline-block;width:100%;margin-bottom:10px;margin-top:2px;padding:8px;border-radius:0;background:#c51244;box-shadow:1px 1px 1px #aaa;opacity:.8}.ngx_vm__def_error_text{color:#fff}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.MatError, selector: "mat-error", inputs: ["id"] }] });
207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesComponent, decorators: [{
205
+ NgxValidationMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesComponent, deps: [{ token: NGX_VALIDATION_MESSAGES_CONFIG }, { token: NgxValidationMessagesService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
206
+ NgxValidationMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NgxValidationMessagesComponent, selector: "ngx-validation-messages, [ngxValidationMessages]", inputs: { formControl: ["for", "formControl"] }, queries: [{ propertyName: "customMsgComponent", predicate: NgxCustomMessageComponent }, { propertyName: "customMsgDirective", predicate: NgxValidatorNameDirective }], ngImport: i0, template: "<!--To show error messages standalone without component-->\n<div *ngIf=\"!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0\"\n [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n <ng-content></ng-content>\n </span>\n</div>\n\n<ng-container *ngIf=\"errorMessages.length > 0\">\n\n <!--To show error messages in material ui style-->\n <ng-container *ngIf=\"isMaterialError; else withoutMaterial\">\n <ng-container *ngFor=\"let message of errorMessages\">\n <mat-error>{{ message }}</mat-error>\n </ng-container>\n </ng-container>\n\n <!--To show error messages in user style-->\n <ng-template #withoutMaterial>\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n <div *ngFor=\"let message of errorMessages\">\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n {{ message }}\n </span>\n </div>\n </div>\n </ng-template>\n\n</ng-container>\n", styles: [".ngx_vm__def_error_block{position:relative;display:inline-block;width:100%;margin-bottom:10px;margin-top:2px;padding:8px;border-radius:0;background:#c51244;box-shadow:1px 1px 1px #aaa;opacity:.8}.ngx_vm__def_error_text{color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }] });
207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesComponent, decorators: [{
208
208
  type: Component,
209
- args: [{ selector: 'ngx-validation-messages, [ngxValidationMessages]', template: "<!--To show error messages standalone without component-->\r\n<div *ngIf=\"!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0\"\r\n [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\r\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\r\n <ng-content></ng-content>\r\n </span>\r\n</div>\r\n\r\n<ng-container *ngIf=\"errorMessages.length > 0\">\r\n\r\n <!--To show error messages in material ui style-->\r\n <ng-container *ngIf=\"isMaterialError; else withoutMaterial\">\r\n <ng-container *ngFor=\"let message of errorMessages\">\r\n <mat-error>{{ message }}</mat-error>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!--To show error messages in user style-->\r\n <ng-template #withoutMaterial>\r\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\r\n <div *ngFor=\"let message of errorMessages\">\r\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\r\n {{ message }}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n</ng-container>\r\n", styles: [".ngx_vm__def_error_block{position:relative;display:inline-block;width:100%;margin-bottom:10px;margin-top:2px;padding:8px;border-radius:0;background:#c51244;box-shadow:1px 1px 1px #aaa;opacity:.8}.ngx_vm__def_error_text{color:#fff}\n"] }]
209
+ args: [{ selector: 'ngx-validation-messages, [ngxValidationMessages]', template: "<!--To show error messages standalone without component-->\n<div *ngIf=\"!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0\"\n [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n <ng-content></ng-content>\n </span>\n</div>\n\n<ng-container *ngIf=\"errorMessages.length > 0\">\n\n <!--To show error messages in material ui style-->\n <ng-container *ngIf=\"isMaterialError; else withoutMaterial\">\n <ng-container *ngFor=\"let message of errorMessages\">\n <mat-error>{{ message }}</mat-error>\n </ng-container>\n </ng-container>\n\n <!--To show error messages in user style-->\n <ng-template #withoutMaterial>\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n <div *ngFor=\"let message of errorMessages\">\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n {{ message }}\n </span>\n </div>\n </div>\n </ng-template>\n\n</ng-container>\n", styles: [".ngx_vm__def_error_block{position:relative;display:inline-block;width:100%;margin-bottom:10px;margin-top:2px;padding:8px;border-radius:0;background:#c51244;box-shadow:1px 1px 1px #aaa;opacity:.8}.ngx_vm__def_error_text{color:#fff}\n"] }]
210
210
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
211
211
  type: Inject,
212
212
  args: [NGX_VALIDATION_MESSAGES_CONFIG]
@@ -235,23 +235,21 @@ class NgxValidationMessagesModule {
235
235
  };
236
236
  }
237
237
  }
238
- NgxValidationMessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
239
- NgxValidationMessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesModule, declarations: [NgxValidationMessagesComponent,
238
+ NgxValidationMessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
239
+ NgxValidationMessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesModule, declarations: [NgxValidationMessagesComponent,
240
240
  NgxCustomMessageComponent,
241
241
  NgxValidatorNameDirective], imports: [CommonModule,
242
242
  MatFormFieldModule], exports: [NgxValidationMessagesComponent,
243
243
  NgxCustomMessageComponent,
244
244
  NgxValidatorNameDirective] });
245
- NgxValidationMessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesModule, imports: [[
246
- CommonModule,
247
- MatFormFieldModule
248
- ]] });
249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxValidationMessagesModule, decorators: [{
245
+ NgxValidationMessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesModule, imports: [CommonModule,
246
+ MatFormFieldModule] });
247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NgxValidationMessagesModule, decorators: [{
250
248
  type: NgModule,
251
249
  args: [{
252
250
  imports: [
253
251
  CommonModule,
254
- MatFormFieldModule
252
+ MatFormFieldModule,
255
253
  ],
256
254
  declarations: [
257
255
  NgxValidationMessagesComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"lagoshny-ngx-validation-messages.mjs","sources":["../../../projects/ngx-validation-messages/src/lib/components/ngx-custom-message/ngx-custom-message.component.ts","../../../projects/ngx-validation-messages/src/lib/directivies/ngx-validator-name.directive.ts","../../../projects/ngx-validation-messages/src/lib/interface/ngx-validation-messages.config.ts","../../../projects/ngx-validation-messages/src/lib/service/ngx-validation-messages.service.ts","../../../projects/ngx-validation-messages/src/lib/components/ngx-validation-messages/ngx-validation-messages.component.ts","../../../projects/ngx-validation-messages/src/lib/components/ngx-validation-messages/ngx-validation-messages.component.html","../../../projects/ngx-validation-messages/src/lib/ngx-validation-messages.module.ts","../../../projects/ngx-validation-messages/src/public-api.ts","../../../projects/ngx-validation-messages/src/lagoshny-ngx-validation-messages.ts"],"sourcesContent":["import { Component, ElementRef, Input, ViewChild } from '@angular/core';\r\n\r\n/**\r\n * Component allows specifying custom validation message for the specified\r\n * validator to override default message.\r\n *\r\n * Use this component as child in {@link NgxValidationMessagesComponent}.\r\n */\r\n@Component({\r\n selector: 'ngx-custom-message',\r\n template: `\r\n <div #message>\r\n <ng-content></ng-content>\r\n </div>`\r\n})\r\nexport class NgxCustomMessageComponent {\r\n\r\n /**\r\n * The name of the validator for which you want to override the message.\r\n */\r\n @Input('forValidator')\r\n public validatorName: string;\r\n\r\n /**\r\n * Contains overridden message for validator.\r\n */\r\n @ViewChild('message')\r\n public message: ElementRef;\r\n\r\n}\r\n","import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core';\r\n\r\n/**\r\n * Allows to specify custom validator message to override default message.\r\n *\r\n * It's alternative for {@link NgxCustomMessageComponent}.\r\n * If you want to use standard html tags to define custom message, use this directive on html tag within\r\n * {@link NgxValidationMessagesComponent} specifying validator name as directive parameter,\r\n * otherwise use {@link NgxCustomMessageComponent}.\r\n */\r\n@Directive({\r\n selector: '[ngxValidatorName]'\r\n})\r\nexport class NgxValidatorNameDirective implements AfterViewInit {\r\n\r\n /**\r\n * The name of the validator for which you want to override the message.\r\n */\r\n @Input()\r\n public validatorName: string;\r\n\r\n /**\r\n * Contains overridden message for validator.\r\n */\r\n public message: string;\r\n\r\n constructor(private elem: ElementRef) {\r\n }\r\n\r\n public ngAfterViewInit(): void {\r\n this.message = this.elem.nativeElement.innerText;\r\n }\r\n\r\n}\r\n","import { InjectionToken } from '@angular/core';\r\n\r\nexport const NGX_VALIDATION_MESSAGES_CONFIG: InjectionToken<NgxValidationMessagesConfig>\r\n = new InjectionToken<NgxValidationMessagesConfig>('NgxValidationMessagesConfig');\r\n\r\nexport interface NgxValidationMessagesConfig {\r\n\r\n /**\r\n * Object contains validation messages in validatorName: validatorMessage format.\r\n */\r\n messages: {\r\n [validatorName: string]: string;\r\n };\r\n\r\n /**\r\n * Define custom styles to display validation messages.\r\n */\r\n validationMessagesStyle?: {\r\n blockClassNames?: string;\r\n textClassNames?: string;\r\n };\r\n\r\n}\r\n","import { Inject, Injectable } from '@angular/core';\r\nimport { NGX_VALIDATION_MESSAGES_CONFIG, NgxValidationMessagesConfig } from '../interface/ngx-validation-messages.config';\r\n\r\n/**\r\n * Service allows getting validation messages from client's settings.\r\n * Injecting {@link NgxValidationMessagesConfig} to get client's configuration with validation messages.\r\n */\r\n@Injectable()\r\nexport class NgxValidationMessagesService {\r\n\r\n public static SERVER_ERRORS = 'serverErrors';\r\n\r\n /**\r\n * Regular expression to find params placeholder '#[paramName]'.\r\n */\r\n private paramsRegExp = new RegExp(/#[[a-zA-Z_\\\\-]*]/);\r\n\r\n constructor(@Inject(NGX_VALIDATION_MESSAGES_CONFIG) private messagesConfig: NgxValidationMessagesConfig) {\r\n }\r\n\r\n /**\r\n * Get validation message for specified validator.\r\n *\r\n * @param validatorName for which to get message\r\n * @param params passed from validator for more detailed validation message\r\n *\r\n * @returns string validation message\r\n */\r\n public getValidatorErrorMessages(validatorName: string, params?: object): string {\r\n const validationMessages = this.messagesConfig.messages;\r\n const validationMessage: string = validationMessages[validatorName];\r\n\r\n if (!validationMessage) {\r\n throw new Error('Validation message for validator: ' + validatorName\r\n + ' cannot be found, please check validation message key for validator it is case sensitive.');\r\n }\r\n\r\n if (params) {\r\n return this.expandParameterizedTemplateMessage(validationMessage, params);\r\n }\r\n\r\n return validationMessage;\r\n }\r\n\r\n public expandParameterizedTemplateMessage(msg: string, params: object): string {\r\n while (this.paramsRegExp.test(msg)) {\r\n const foundParams = this.paramsRegExp.exec(msg);\r\n foundParams.forEach(value => {\r\n const paramPlaceholder = value;\r\n value = value.replace('#[', '').replace(']', '');\r\n msg = msg.replace(paramPlaceholder, this.getParameter(params, value));\r\n });\r\n }\r\n\r\n return msg;\r\n }\r\n\r\n /**\r\n * A utilitarian method to get a property from an object.\r\n * if there is no property, an empty string is returned.\r\n *\r\n * @param obj from which the property must be obtained\r\n * @param prop property name\r\n *\r\n * @return property value or empty string\r\n */\r\n private getParameter(obj: object, prop: string): string {\r\n return prop.split('.')\r\n .reduce((m, i) => {\r\n return m && typeof m === 'object' ? m[i] : '';\r\n }, obj);\r\n }\r\n\r\n // public static applyServerError(control: AbstractControl | null, serverError: ServerError): void {\r\n // if (!control) {\r\n // return;\r\n // }\r\n // if (control.getError(NgxValidationMessagesService.SERVER_ERRORS)) {\r\n // const existingErrorMessages = control.getError(NgxValidationMessagesService.SERVER_ERRORS);\r\n // if (_.isArray(existingErrorMessages.customMessages) &&\r\n // existingErrorMessages.customMessages.indexOf(serverError.message) === -1) {\r\n // existingErrorMessages.customMessages.push(serverError.message);\r\n // }\r\n // } else {\r\n // control.setErrors({[NgxValidationMessagesService.SERVER_ERRORS]: {customMessages: [serverError.message]}});\r\n // }\r\n // control.markAsTouched();\r\n // }\r\n\r\n}\r\n","import { AfterViewInit, Component, ContentChildren, ElementRef, Inject, Input, QueryList } from '@angular/core';\r\nimport { NgxValidatorNameDirective } from '../../directivies/ngx-validator-name.directive';\r\nimport {\r\n NGX_VALIDATION_MESSAGES_CONFIG,\r\n NgxValidationMessagesConfig\r\n} from '../../interface/ngx-validation-messages.config';\r\nimport { NgxValidationMessagesService } from '../../service/ngx-validation-messages.service';\r\nimport { NgxCustomMessageComponent } from '../ngx-custom-message/ngx-custom-message.component';\r\n\r\n/**\r\n * Component for displaying validation messages, supports child components of type {@link NgxCustomMessageComponent}\r\n * and html elements with directive {@link NgxValidatorNameDirective} to override validation messages.\r\n */\r\n@Component({\r\n selector: 'ngx-validation-messages, [ngxValidationMessages]',\r\n templateUrl: './ngx-validation-messages.component.html',\r\n styleUrls: ['./ngx-validation-messages.component.scss']\r\n})\r\nexport class NgxValidationMessagesComponent implements AfterViewInit {\r\n\r\n /**\r\n * Form control for which need to show validation messages.\r\n */\r\n @Input('for')\r\n public formControl: any;\r\n\r\n /**\r\n * Contains {@link NgxCustomMessageComponent} if present.\r\n */\r\n @ContentChildren(NgxCustomMessageComponent)\r\n public customMsgComponent;\r\n\r\n /**\r\n * Contains {@link NgxValidatorNameDirective} if present.\r\n */\r\n @ContentChildren(NgxValidatorNameDirective)\r\n public customMsgDirective;\r\n\r\n public isMaterialError = false;\r\n\r\n /**\r\n * Key to get default validation message.\r\n */\r\n private defaultError = 'error';\r\n\r\n private materialErrorElement = 'MAT-ERROR';\r\n\r\n constructor(@Inject(NGX_VALIDATION_MESSAGES_CONFIG) public ngxValidationConfig: NgxValidationMessagesConfig,\r\n private ngxValidationMessagesService: NgxValidationMessagesService,\r\n private directiveElementRef: ElementRef) {\r\n }\r\n\r\n public ngAfterViewInit(): void {\r\n if (this.directiveElementRef && this.directiveElementRef.nativeElement\r\n && this.directiveElementRef.nativeElement.nodeName) {\r\n this.isMaterialError = this.materialErrorElement.toLocaleUpperCase()\r\n === this.directiveElementRef.nativeElement.nodeName.toLocaleUpperCase();\r\n }\r\n }\r\n\r\n /**\r\n * Get all validation messages for specified form control.\r\n */\r\n public get errorMessages(): Array<string> {\r\n const result: Array<string> = [];\r\n\r\n if (!this.formControl || !this.formControl.errors) {\r\n return result;\r\n }\r\n if (this.customMsgComponent && this.customMsgComponent.length > 0) {\r\n this.processingCustomMessages(this.customMsgComponent);\r\n }\r\n if (this.customMsgDirective && this.customMsgDirective.length > 0) {\r\n this.processingCustomMessages(this.customMsgDirective);\r\n }\r\n\r\n for (const property in this.formControl.errors) {\r\n if (this.formControl.errors.hasOwnProperty(property)\r\n && (this.formControl.touched || this.formControl.dirty)) {\r\n if (this.formControl.errors[property].customMessages instanceof Array) {\r\n result.push(...this.formControl.errors[property].customMessages);\r\n continue;\r\n }\r\n if (this.formControl.errors[property].customMessage) {\r\n result.push(this.formControl.errors[property].customMessage);\r\n continue;\r\n }\r\n const validationMessage: string =\r\n this.ngxValidationMessagesService.getValidatorErrorMessages(property, this.formControl.errors[property]);\r\n result.push(validationMessage || this.formControl.errors[property].message\r\n || this.ngxValidationMessagesService.getValidatorErrorMessages(this.defaultError));\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n private processingCustomMessages(customMessage: QueryList<any>): void {\r\n customMessage.forEach((msg: any) => {\r\n if (!this.formControl.errors[msg.validatorName]) {\r\n return;\r\n }\r\n let message = (msg instanceof NgxCustomMessageComponent)\r\n ? msg.message.nativeElement.innerText : msg.message;\r\n message = this.ngxValidationMessagesService.expandParameterizedTemplateMessage(message, this.formControl.errors[msg.validatorName]);\r\n\r\n typeof this.formControl.errors[msg.validatorName] === 'object'\r\n ? this.formControl.errors[msg.validatorName].customMessage = message\r\n : this.formControl.errors[msg.validatorName] = {customMessage: message};\r\n });\r\n }\r\n\r\n}\r\n","<!--To show error messages standalone without component-->\r\n<div *ngIf=\"!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0\"\r\n [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\r\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\r\n <ng-content></ng-content>\r\n </span>\r\n</div>\r\n\r\n<ng-container *ngIf=\"errorMessages.length > 0\">\r\n\r\n <!--To show error messages in material ui style-->\r\n <ng-container *ngIf=\"isMaterialError; else withoutMaterial\">\r\n <ng-container *ngFor=\"let message of errorMessages\">\r\n <mat-error>{{ message }}</mat-error>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!--To show error messages in user style-->\r\n <ng-template #withoutMaterial>\r\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\r\n <div *ngFor=\"let message of errorMessages\">\r\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\r\n {{ message }}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n</ng-container>\r\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule } from '@angular/core';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { NgxCustomMessageComponent } from './components/ngx-custom-message/ngx-custom-message.component';\r\nimport { NgxValidationMessagesComponent } from './components/ngx-validation-messages/ngx-validation-messages.component';\r\nimport { NgxValidatorNameDirective } from './directivies/ngx-validator-name.directive';\r\nimport { NGX_VALIDATION_MESSAGES_CONFIG, NgxValidationMessagesConfig } from './interface/ngx-validation-messages.config';\r\nimport { NgxValidationMessagesService } from './service/ngx-validation-messages.service';\r\n\r\nexport { NGX_VALIDATION_MESSAGES_CONFIG, NgxValidationMessagesConfig } from './interface/ngx-validation-messages.config';\r\nexport { NgxCustomMessageComponent } from './components/ngx-custom-message/ngx-custom-message.component';\r\nexport { NgxValidationMessagesComponent } from './components/ngx-validation-messages/ngx-validation-messages.component';\r\nexport { NgxValidatorNameDirective } from './directivies/ngx-validator-name.directive';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatFormFieldModule\r\n ],\r\n declarations: [\r\n NgxValidationMessagesComponent,\r\n NgxCustomMessageComponent,\r\n NgxValidatorNameDirective\r\n ],\r\n exports: [\r\n NgxValidationMessagesComponent,\r\n NgxCustomMessageComponent,\r\n NgxValidatorNameDirective\r\n ]\r\n})\r\nexport class NgxValidationMessagesModule {\r\n static forRoot(config: NgxValidationMessagesConfig): ModuleWithProviders<NgxValidationMessagesModule> {\r\n return {\r\n ngModule: NgxValidationMessagesModule,\r\n providers: [\r\n NgxValidationMessagesService,\r\n {\r\n provide: NGX_VALIDATION_MESSAGES_CONFIG,\r\n useValue: config\r\n }\r\n ]\r\n };\r\n }\r\n}\r\n","/*\r\n * Public API Surface of ngx-validation-messages\r\n */\r\nexport * from './lib/ngx-validation-messages.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAEA;;;;;;MAaa,yBAAyB;;sHAAzB,yBAAyB;0GAAzB,yBAAyB,4NAL1B;;;WAGD;2FAEE,yBAAyB;kBAPrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,QAAQ,EAAE;;;WAGD;iBACV;8BAOQ,aAAa;sBADnB,KAAK;uBAAC,cAAc;gBAOd,OAAO;sBADb,SAAS;uBAAC,SAAS;;;ACxBtB;;;;;;;;MAWa,yBAAyB;IAapC,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;KACnC;IAEM,eAAe;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;KAClD;;sHAlBU,yBAAyB;0GAAzB,yBAAyB;2FAAzB,yBAAyB;kBAHrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;iBAC/B;iGAOQ,aAAa;sBADnB,KAAK;;;MChBK,8BAA8B,GACvC,IAAI,cAAc,CAA8B,6BAA6B;;ACAjF;;;;MAKa,4BAA4B;IASvC,YAA4D,cAA2C;QAA3C,mBAAc,GAAd,cAAc,CAA6B;;;;QAF/F,iBAAY,GAAG,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAAC;KAGrD;;;;;;;;;IAUM,yBAAyB,CAAC,aAAqB,EAAE,MAAe;QACrE,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC;QACxD,MAAM,iBAAiB,GAAW,kBAAkB,CAAC,aAAa,CAAC,CAAC;QAEpE,IAAI,CAAC,iBAAiB,EAAE;YACtB,MAAM,IAAI,KAA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AAyB;qBAC1B;oBACD,OAAO,EAAE;wBACP,8BAA8B;wBAC9B,yBAAyB;wBACzB,yBAAyB;qBAC1B;iBACF;;;AC7BD;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"lagoshny-ngx-validation-messages.mjs","sources":["../../../projects/ngx-validation-messages/src/lib/components/ngx-custom-message/ngx-custom-message.component.ts","../../../projects/ngx-validation-messages/src/lib/directivies/ngx-validator-name.directive.ts","../../../projects/ngx-validation-messages/src/lib/interface/ngx-validation-messages.config.ts","../../../projects/ngx-validation-messages/src/lib/service/ngx-validation-messages.service.ts","../../../projects/ngx-validation-messages/src/lib/components/ngx-validation-messages/ngx-validation-messages.component.ts","../../../projects/ngx-validation-messages/src/lib/components/ngx-validation-messages/ngx-validation-messages.component.html","../../../projects/ngx-validation-messages/src/lib/ngx-validation-messages.module.ts","../../../projects/ngx-validation-messages/src/public-api.ts","../../../projects/ngx-validation-messages/src/lagoshny-ngx-validation-messages.ts"],"sourcesContent":["import { Component, ElementRef, Input, ViewChild } from '@angular/core';\n\n/**\n * Component allows specifying custom validation message for the specified\n * validator to override default message.\n *\n * Use this component as child in {@link NgxValidationMessagesComponent}.\n */\n@Component({\n selector: 'ngx-custom-message',\n template: `\n <div #message>\n <ng-content></ng-content>\n </div>`\n})\nexport class NgxCustomMessageComponent {\n\n /**\n * The name of the validator for which you want to override the message.\n */\n @Input('forValidator')\n public validatorName: string;\n\n /**\n * Contains overridden message for validator.\n */\n @ViewChild('message')\n public message: ElementRef;\n\n}\n","import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core';\n\n/**\n * Allows to specify custom validator message to override default message.\n *\n * It's alternative for {@link NgxCustomMessageComponent}.\n * If you want to use standard html tags to define custom message, use this directive on html tag within\n * {@link NgxValidationMessagesComponent} specifying validator name as directive parameter,\n * otherwise use {@link NgxCustomMessageComponent}.\n */\n@Directive({\n selector: '[ngxValidatorName]'\n})\nexport class NgxValidatorNameDirective implements AfterViewInit {\n\n /**\n * The name of the validator for which you want to override the message.\n */\n @Input()\n public validatorName: string;\n\n /**\n * Contains overridden message for validator.\n */\n public message: string;\n\n constructor(private elem: ElementRef) {\n }\n\n public ngAfterViewInit(): void {\n this.message = this.elem.nativeElement.innerText;\n }\n\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const NGX_VALIDATION_MESSAGES_CONFIG: InjectionToken<NgxValidationMessagesConfig>\n = new InjectionToken<NgxValidationMessagesConfig>('NgxValidationMessagesConfig');\n\nexport interface NgxValidationMessagesConfig {\n\n /**\n * Object contains validation messages in validatorName: validatorMessage format.\n */\n messages: {\n [validatorName: string]: string;\n };\n\n /**\n * Define custom styles to display validation messages.\n */\n validationMessagesStyle?: {\n blockClassNames?: string;\n textClassNames?: string;\n };\n\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { NGX_VALIDATION_MESSAGES_CONFIG, NgxValidationMessagesConfig } from '../interface/ngx-validation-messages.config';\n\n/**\n * Service allows getting validation messages from client's settings.\n * Injecting {@link NgxValidationMessagesConfig} to get client's configuration with validation messages.\n */\n@Injectable()\nexport class NgxValidationMessagesService {\n\n public static SERVER_ERRORS = 'serverErrors';\n\n /**\n * Regular expression to find params placeholder '#[paramName]'.\n */\n private paramsRegExp = new RegExp(/#[[a-zA-Z_\\\\-]*]/);\n\n constructor(@Inject(NGX_VALIDATION_MESSAGES_CONFIG) private messagesConfig: NgxValidationMessagesConfig) {\n }\n\n /**\n * Get validation message for specified validator.\n *\n * @param validatorName for which to get message\n * @param params passed from validator for more detailed validation message\n *\n * @returns string validation message\n */\n public getValidatorErrorMessages(validatorName: string, params?: object): string {\n const validationMessages = this.messagesConfig.messages;\n const validationMessage: string = validationMessages[validatorName];\n\n if (!validationMessage) {\n throw new Error('Validation message for validator: ' + validatorName\n + ' cannot be found, please check validation message key for validator it is case sensitive.');\n }\n\n if (params) {\n return this.expandParameterizedTemplateMessage(validationMessage, params);\n }\n\n return validationMessage;\n }\n\n public expandParameterizedTemplateMessage(msg: string, params: object): string {\n while (this.paramsRegExp.test(msg)) {\n const foundParams = this.paramsRegExp.exec(msg);\n foundParams.forEach(value => {\n const paramPlaceholder = value;\n value = value.replace('#[', '').replace(']', '');\n msg = msg.replace(paramPlaceholder, this.getParameter(params, value));\n });\n }\n\n return msg;\n }\n\n /**\n * A utilitarian method to get a property from an object.\n * if there is no property, an empty string is returned.\n *\n * @param obj from which the property must be obtained\n * @param prop property name\n *\n * @return property value or empty string\n */\n private getParameter(obj: object, prop: string): string {\n return prop.split('.')\n .reduce((m, i) => {\n return m && typeof m === 'object' ? m[i] : '';\n }, obj);\n }\n\n // public static applyServerError(control: AbstractControl | null, serverError: ServerError): void {\n // if (!control) {\n // return;\n // }\n // if (control.getError(NgxValidationMessagesService.SERVER_ERRORS)) {\n // const existingErrorMessages = control.getError(NgxValidationMessagesService.SERVER_ERRORS);\n // if (_.isArray(existingErrorMessages.customMessages) &&\n // existingErrorMessages.customMessages.indexOf(serverError.message) === -1) {\n // existingErrorMessages.customMessages.push(serverError.message);\n // }\n // } else {\n // control.setErrors({[NgxValidationMessagesService.SERVER_ERRORS]: {customMessages: [serverError.message]}});\n // }\n // control.markAsTouched();\n // }\n\n}\n","import { AfterViewInit, Component, ContentChildren, ElementRef, Inject, Input, QueryList } from '@angular/core';\nimport { NgxValidatorNameDirective } from '../../directivies/ngx-validator-name.directive';\nimport {\n NGX_VALIDATION_MESSAGES_CONFIG,\n NgxValidationMessagesConfig\n} from '../../interface/ngx-validation-messages.config';\nimport { NgxValidationMessagesService } from '../../service/ngx-validation-messages.service';\nimport { NgxCustomMessageComponent } from '../ngx-custom-message/ngx-custom-message.component';\n\n/**\n * Component for displaying validation messages, supports child components of type {@link NgxCustomMessageComponent}\n * and html elements with directive {@link NgxValidatorNameDirective} to override validation messages.\n */\n@Component({\n selector: 'ngx-validation-messages, [ngxValidationMessages]',\n templateUrl: './ngx-validation-messages.component.html',\n styleUrls: ['./ngx-validation-messages.component.scss']\n})\nexport class NgxValidationMessagesComponent implements AfterViewInit {\n\n /**\n * Form control for which need to show validation messages.\n */\n @Input('for')\n public formControl: any;\n\n /**\n * Contains {@link NgxCustomMessageComponent} if present.\n */\n @ContentChildren(NgxCustomMessageComponent)\n public customMsgComponent;\n\n /**\n * Contains {@link NgxValidatorNameDirective} if present.\n */\n @ContentChildren(NgxValidatorNameDirective)\n public customMsgDirective;\n\n public isMaterialError = false;\n\n /**\n * Key to get default validation message.\n */\n private defaultError = 'error';\n\n private materialErrorElement = 'MAT-ERROR';\n\n constructor(@Inject(NGX_VALIDATION_MESSAGES_CONFIG) public ngxValidationConfig: NgxValidationMessagesConfig,\n private ngxValidationMessagesService: NgxValidationMessagesService,\n private directiveElementRef: ElementRef) {\n }\n\n public ngAfterViewInit(): void {\n if (this.directiveElementRef && this.directiveElementRef.nativeElement\n && this.directiveElementRef.nativeElement.nodeName) {\n this.isMaterialError = this.materialErrorElement.toLocaleUpperCase()\n === this.directiveElementRef.nativeElement.nodeName.toLocaleUpperCase();\n }\n }\n\n /**\n * Get all validation messages for specified form control.\n */\n public get errorMessages(): Array<string> {\n const result: Array<string> = [];\n\n if (!this.formControl || !this.formControl.errors) {\n return result;\n }\n if (this.customMsgComponent && this.customMsgComponent.length > 0) {\n this.processingCustomMessages(this.customMsgComponent);\n }\n if (this.customMsgDirective && this.customMsgDirective.length > 0) {\n this.processingCustomMessages(this.customMsgDirective);\n }\n\n for (const property in this.formControl.errors) {\n if (this.formControl.errors.hasOwnProperty(property)\n && (this.formControl.touched || this.formControl.dirty)) {\n if (this.formControl.errors[property].customMessages instanceof Array) {\n result.push(...this.formControl.errors[property].customMessages);\n continue;\n }\n if (this.formControl.errors[property].customMessage) {\n result.push(this.formControl.errors[property].customMessage);\n continue;\n }\n const validationMessage: string =\n this.ngxValidationMessagesService.getValidatorErrorMessages(property, this.formControl.errors[property]);\n result.push(validationMessage || this.formControl.errors[property].message\n || this.ngxValidationMessagesService.getValidatorErrorMessages(this.defaultError));\n }\n }\n return result;\n }\n\n private processingCustomMessages(customMessage: QueryList<any>): void {\n customMessage.forEach((msg: any) => {\n if (!this.formControl.errors[msg.validatorName]) {\n return;\n }\n let message = (msg instanceof NgxCustomMessageComponent)\n ? msg.message.nativeElement.innerText : msg.message;\n message = this.ngxValidationMessagesService.expandParameterizedTemplateMessage(message, this.formControl.errors[msg.validatorName]);\n\n typeof this.formControl.errors[msg.validatorName] === 'object'\n ? this.formControl.errors[msg.validatorName].customMessage = message\n : this.formControl.errors[msg.validatorName] = {customMessage: message};\n });\n }\n\n}\n","<!--To show error messages standalone without component-->\n<div *ngIf=\"!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0\"\n [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n <ng-content></ng-content>\n </span>\n</div>\n\n<ng-container *ngIf=\"errorMessages.length > 0\">\n\n <!--To show error messages in material ui style-->\n <ng-container *ngIf=\"isMaterialError; else withoutMaterial\">\n <ng-container *ngFor=\"let message of errorMessages\">\n <mat-error>{{ message }}</mat-error>\n </ng-container>\n </ng-container>\n\n <!--To show error messages in user style-->\n <ng-template #withoutMaterial>\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n <div *ngFor=\"let message of errorMessages\">\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n {{ message }}\n </span>\n </div>\n </div>\n </ng-template>\n\n</ng-container>\n","import {CommonModule} from '@angular/common';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {NgxCustomMessageComponent} from './components/ngx-custom-message/ngx-custom-message.component';\nimport {NgxValidationMessagesComponent} from './components/ngx-validation-messages/ngx-validation-messages.component';\nimport {NgxValidatorNameDirective} from './directivies/ngx-validator-name.directive';\nimport {NGX_VALIDATION_MESSAGES_CONFIG, NgxValidationMessagesConfig} from './interface/ngx-validation-messages.config';\nimport {NgxValidationMessagesService} from './service/ngx-validation-messages.service';\nimport {MatFormFieldModule} from '@angular/material/form-field';\n\nexport {NGX_VALIDATION_MESSAGES_CONFIG, NgxValidationMessagesConfig} from './interface/ngx-validation-messages.config';\nexport {NgxCustomMessageComponent} from './components/ngx-custom-message/ngx-custom-message.component';\nexport {NgxValidationMessagesComponent} from './components/ngx-validation-messages/ngx-validation-messages.component';\nexport {NgxValidatorNameDirective} from './directivies/ngx-validator-name.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n MatFormFieldModule,\n ],\n declarations: [\n NgxValidationMessagesComponent,\n NgxCustomMessageComponent,\n NgxValidatorNameDirective\n ],\n exports: [\n NgxValidationMessagesComponent,\n NgxCustomMessageComponent,\n NgxValidatorNameDirective\n ]\n})\nexport class NgxValidationMessagesModule {\n static forRoot(config: NgxValidationMessagesConfig): ModuleWithProviders<NgxValidationMessagesModule> {\n return {\n ngModule: NgxValidationMessagesModule,\n providers: [\n NgxValidationMessagesService,\n {\n provide: NGX_VALIDATION_MESSAGES_CONFIG,\n useValue: config\n }\n ]\n };\n }\n}\n","/*\n * Public API Surface of ngx-validation-messages\n */\nexport * from './lib/ngx-validation-messages.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NgxValidationMessagesService"],"mappings":";;;;;;;AAEA;;;;;AAKG;MAQU,yBAAyB,CAAA;;uHAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAzB,yBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,yBAAyB,EAL1B,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,aAAA,EAAA,CAAA,cAAA,EAAA,eAAA,CAAA,EAAA,EAAA,WAAA,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AA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA3B,2BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,iBAVpC,8BAA8B;QAC9B,yBAAyB;AACzB,QAAA,yBAAyB,aANzB,YAAY;AACZ,QAAA,kBAAkB,aAQlB,8BAA8B;QAC9B,yBAAyB;QACzB,yBAAyB,CAAA,EAAA,CAAA,CAAA;AAGhB,2BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAdpC,YAAY;QACZ,kBAAkB,CAAA,EAAA,CAAA,CAAA;4FAaT,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAhBvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,kBAAkB;AACnB,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACZ,8BAA8B;wBAC9B,yBAAyB;wBACzB,yBAAyB;AAC1B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,8BAA8B;wBAC9B,yBAAyB;wBACzB,yBAAyB;AAC1B,qBAAA;AACF,iBAAA,CAAA;;;AC7BD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -16,5 +16,5 @@ export declare class NgxCustomMessageComponent {
16
16
  */
17
17
  message: ElementRef;
18
18
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxCustomMessageComponent, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxCustomMessageComponent, "ngx-custom-message", never, { "validatorName": "forValidator"; }, {}, never, ["*"]>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxCustomMessageComponent, "ngx-custom-message", never, { "validatorName": "forValidator"; }, {}, never, ["*"], false, never>;
20
20
  }
@@ -36,5 +36,5 @@ export declare class NgxValidationMessagesComponent implements AfterViewInit {
36
36
  get errorMessages(): Array<string>;
37
37
  private processingCustomMessages;
38
38
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxValidationMessagesComponent, never>;
39
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxValidationMessagesComponent, "ngx-validation-messages, [ngxValidationMessages]", never, { "formControl": "for"; }, {}, ["customMsgComponent", "customMsgDirective"], ["*"]>;
39
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxValidationMessagesComponent, "ngx-validation-messages, [ngxValidationMessages]", never, { "formControl": "for"; }, {}, ["customMsgComponent", "customMsgDirective"], ["*"], false, never>;
40
40
  }
@@ -21,5 +21,5 @@ export declare class NgxValidatorNameDirective implements AfterViewInit {
21
21
  constructor(elem: ElementRef);
22
22
  ngAfterViewInit(): void;
23
23
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxValidatorNameDirective, never>;
24
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxValidatorNameDirective, "[ngxValidatorName]", never, { "validatorName": "validatorName"; }, {}, never>;
24
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxValidatorNameDirective, "[ngxValidatorName]", never, { "validatorName": "validatorName"; }, {}, never, never, false, never>;
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lagoshny/ngx-validation-messages",
3
- "version": "3.0.0",
3
+ "version": "15.0.0",
4
4
  "description": "This module allows to simplify display form validator validation messages using single component.",
5
5
  "readme": "README.md",
6
6
  "author": "Ilya Lagoshny <ilya@lagoshny.ru>",
@@ -22,6 +22,7 @@
22
22
  "Angular",
23
23
  "Angular 12",
24
24
  "Angular 13",
25
+ "Angular 15",
25
26
  "Material ui"
26
27
  ],
27
28
  "homepage": "https://github.com/lagoshny/ngx-validation-messages",
@@ -40,13 +41,13 @@
40
41
  "esm2020": "esm2020/lagoshny-ngx-validation-messages.mjs",
41
42
  "fesm2020": "fesm2020/lagoshny-ngx-validation-messages.mjs",
42
43
  "fesm2015": "fesm2015/lagoshny-ngx-validation-messages.mjs",
43
- "typings": "lagoshny-ngx-validation-messages.d.ts",
44
+ "typings": "index.d.ts",
44
45
  "exports": {
45
46
  "./package.json": {
46
47
  "default": "./package.json"
47
48
  },
48
49
  ".": {
49
- "types": "./lagoshny-ngx-validation-messages.d.ts",
50
+ "types": "./index.d.ts",
50
51
  "esm2020": "./esm2020/lagoshny-ngx-validation-messages.mjs",
51
52
  "es2020": "./fesm2020/lagoshny-ngx-validation-messages.mjs",
52
53
  "es2015": "./fesm2015/lagoshny-ngx-validation-messages.mjs",