@lagoshny/ngx-validation-messages 20.0.0 → 21.0.1
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.
|
@@ -22,13 +22,13 @@ class NgxCustomMessageComponent {
|
|
|
22
22
|
* Contains overridden message for validator.
|
|
23
23
|
*/
|
|
24
24
|
message;
|
|
25
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
26
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxCustomMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.2", type: NgxCustomMessageComponent, isStandalone: true, selector: "ngx-custom-message", inputs: { validatorName: ["forValidator", "validatorName"] }, viewQueries: [{ propertyName: "message", first: true, predicate: ["message"], descendants: true }], ngImport: i0, template: `
|
|
27
27
|
<div #message>
|
|
28
28
|
<ng-content></ng-content>
|
|
29
29
|
</div>`, isInline: true });
|
|
30
30
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxCustomMessageComponent, decorators: [{
|
|
32
32
|
type: Component,
|
|
33
33
|
args: [{
|
|
34
34
|
standalone: true,
|
|
@@ -71,10 +71,10 @@ class NgxValidatorNameDirective {
|
|
|
71
71
|
ngAfterViewInit() {
|
|
72
72
|
this.message = this.elem.nativeElement.innerText;
|
|
73
73
|
}
|
|
74
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
75
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
74
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxValidatorNameDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
75
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.2", type: NgxValidatorNameDirective, isStandalone: true, selector: "[ngxValidatorName]", inputs: { validatorName: "validatorName" }, ngImport: i0 });
|
|
76
76
|
}
|
|
77
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxValidatorNameDirective, decorators: [{
|
|
78
78
|
type: Directive,
|
|
79
79
|
args: [{
|
|
80
80
|
standalone: true,
|
|
@@ -121,7 +121,7 @@ class NgxValidationMessagesService {
|
|
|
121
121
|
expandParameterizedTemplateMessage(msg, params) {
|
|
122
122
|
while (this.paramsRegExp.test(msg)) {
|
|
123
123
|
const foundParams = this.paramsRegExp.exec(msg);
|
|
124
|
-
foundParams
|
|
124
|
+
foundParams?.forEach(value => {
|
|
125
125
|
const paramPlaceholder = value;
|
|
126
126
|
value = value.replace('#[', '').replace(']', '');
|
|
127
127
|
msg = msg.replace(paramPlaceholder, this.getParameter(params, value));
|
|
@@ -139,15 +139,17 @@ class NgxValidationMessagesService {
|
|
|
139
139
|
* @return property value or empty string
|
|
140
140
|
*/
|
|
141
141
|
getParameter(obj, prop) {
|
|
142
|
-
return prop.split('.')
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
return prop.split('.').reduce((acc, key) => {
|
|
143
|
+
if (acc != null && typeof acc === 'object') {
|
|
144
|
+
return acc[key];
|
|
145
|
+
}
|
|
146
|
+
return '';
|
|
147
|
+
}, obj) ?? '';
|
|
146
148
|
}
|
|
147
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
148
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
149
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxValidationMessagesService, deps: [{ token: NGX_VALIDATION_MESSAGES_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
150
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxValidationMessagesService, providedIn: 'root' });
|
|
149
151
|
}
|
|
150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxValidationMessagesService, decorators: [{
|
|
151
153
|
type: Injectable,
|
|
152
154
|
args: [{
|
|
153
155
|
providedIn: 'root',
|
|
@@ -233,17 +235,17 @@ class NgxValidationMessagesComponent {
|
|
|
233
235
|
return;
|
|
234
236
|
}
|
|
235
237
|
let message = (msg instanceof NgxCustomMessageComponent)
|
|
236
|
-
? msg.message
|
|
238
|
+
? msg.message?.nativeElement.innerText : msg.message;
|
|
237
239
|
message = this.ngxValidationMessagesService.expandParameterizedTemplateMessage(message, this.formControl.errors[msg.validatorName]);
|
|
238
240
|
typeof this.formControl.errors[msg.validatorName] === 'object'
|
|
239
241
|
? this.formControl.errors[msg.validatorName].customMessage = message
|
|
240
242
|
: this.formControl.errors[msg.validatorName] = { customMessage: message };
|
|
241
243
|
});
|
|
242
244
|
}
|
|
243
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
244
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
245
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxValidationMessagesComponent, deps: [{ token: NGX_VALIDATION_MESSAGES_CONFIG }, { token: NgxValidationMessagesService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
246
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.2", type: NgxValidationMessagesComponent, isStandalone: true, 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@if (!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0) {\n <div\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\n@if (errorMessages.length > 0) {\n <!--To show error messages in material ui style-->\n @if (isMaterialError) {\n @for (message of errorMessages; track message) {\n <mat-error>{{ message }}</mat-error>\n }\n } @else {\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n @for (message of errorMessages; track message) {\n <div>\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n {{ message }}\n </span>\n </div>\n }\n </div>\n }\n <!--To show error messages in user style-->\n}\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: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }] });
|
|
245
247
|
}
|
|
246
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
248
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgxValidationMessagesComponent, decorators: [{
|
|
247
249
|
type: Component,
|
|
248
250
|
args: [{ standalone: true, selector: 'ngx-validation-messages, [ngxValidationMessages]', imports: [
|
|
249
251
|
CommonModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lagoshny-ngx-validation-messages.mjs","sources":["../../../projects/ngx-validation-messages/src/lib/interface/ngx-validation-messages.config.ts","../../../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/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.providers.ts","../../../projects/ngx-validation-messages/src/public-api.ts","../../../projects/ngx-validation-messages/src/lagoshny-ngx-validation-messages.ts"],"sourcesContent":["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 { Component, ElementRef, Input, ViewChild } from '@angular/core';\n\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 standalone: true,\n selector: 'ngx-custom-message',\n template: `\n <div #message>\n <ng-content></ng-content>\n </div>`,\n imports: []\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 standalone: true,\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 { 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({\n providedIn: 'root',\n})\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';\nimport { CommonModule } from '@angular/common';\nimport { MatFormFieldModule } from '@angular/material/form-field';\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 standalone: true,\n selector: 'ngx-validation-messages, [ngxValidationMessages]',\n templateUrl: './ngx-validation-messages.component.html',\n styleUrls: ['./ngx-validation-messages.component.scss'],\n imports: [\n CommonModule,\n MatFormFieldModule,\n ]\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: any;\n\n /**\n * Contains {@link NgxValidatorNameDirective} if present.\n */\n @ContentChildren(NgxValidatorNameDirective)\n public customMsgDirective: any;\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@if (!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0) {\n <div\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\n@if (errorMessages.length > 0) {\n <!--To show error messages in material ui style-->\n @if (isMaterialError) {\n @for (message of errorMessages; track message) {\n <mat-error>{{ message }}</mat-error>\n }\n } @else {\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n @for (message of errorMessages; track message) {\n <div>\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n {{ message }}\n </span>\n </div>\n }\n </div>\n }\n <!--To show error messages in user style-->\n}\n","import { Provider } from '@angular/core';\r\nimport { NGX_VALIDATION_MESSAGES_CONFIG, NgxValidationMessagesConfig } from './interface/ngx-validation-messages.config';\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\nexport function provideNgxValidationMessages(config: NgxValidationMessagesConfig): Provider[] {\r\n return [\r\n {\r\n provide: NGX_VALIDATION_MESSAGES_CONFIG,\r\n useValue: config\r\n }\r\n ];\r\n}\r\n","/*\n * Public API Surface of ngx-validation-messages\n */\nexport * from './lib/ngx-validation-messages.providers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NgxValidationMessagesService"],"mappings":";;;;;;;MAEa,8BAA8B,GACvC,IAAI,cAAc,CAA8B,6BAA6B;;ACAjF;;;;;AAKG;MAUU,yBAAyB,CAAA;AAEpC;;AAEG;AAEI,IAAA,aAAa;AAEpB;;AAEG;AAEI,IAAA,OAAO;wGAZH,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,aAAA,EAAA,CAAA,cAAA,EAAA,eAAA,CAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,SAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA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A,CAAA,QAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAGb,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAV1C,SAAS;iCACI,IAAI,EAAA,QAAA,EACN,kDAAkD,EAAA,OAAA,EAGjD;wBACL,YAAY;wBACZ,kBAAkB;AACrB,qBAAA,EAAA,QAAA,EAAA,smCAAA,EAAA,MAAA,EAAA,CAAA,0OAAA,CAAA,EAAA;;0BA+BU,MAAM;2BAAC,8BAA8B;;sBAxBjD,KAAK;uBAAC,KAAK;;sBAMX,eAAe;uBAAC,yBAAyB;;sBAMzC,eAAe;uBAAC,yBAAyB;;;AElCtC,SAAU,4BAA4B,CAAC,MAAmC,EAAA;IAC9E,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,8BAA8B;AACvC,YAAA,QAAQ,EAAE;AACX;KACF;AACH;;ACfA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lagoshny-ngx-validation-messages.mjs","sources":["../../../projects/ngx-validation-messages/src/lib/interface/ngx-validation-messages.config.ts","../../../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/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.providers.ts","../../../projects/ngx-validation-messages/src/public-api.ts","../../../projects/ngx-validation-messages/src/lagoshny-ngx-validation-messages.ts"],"sourcesContent":["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 { Component, ElementRef, Input, ViewChild } from '@angular/core';\n\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 standalone: true,\n selector: 'ngx-custom-message',\n template: `\n <div #message>\n <ng-content></ng-content>\n </div>`,\n imports: []\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 | undefined;\n\n /**\n * Contains overridden message for validator.\n */\n @ViewChild('message')\n public message: ElementRef | undefined;\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 standalone: true,\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 | undefined;\n\n /**\n * Contains overridden message for validator.\n */\n public message: string | undefined;\n\n constructor(private elem: ElementRef) {\n }\n\n public ngAfterViewInit(): void {\n this.message = this.elem.nativeElement.innerText;\n }\n\n}\n","import { Inject, Injectable } from '@angular/core';\nimport {\n NGX_VALIDATION_MESSAGES_CONFIG,\n NgxValidationMessagesConfig\n} 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({\n providedIn: 'root',\n})\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: unknown, prop: string): string {\n return prop.split('.').reduce((acc: unknown, key: string) => {\n if (acc != null && typeof acc === 'object') {\n return (acc as Record<string, unknown>)[key];\n }\n return '';\n }, obj) as string ?? '';\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';\nimport { CommonModule } from '@angular/common';\nimport { MatFormFieldModule } from '@angular/material/form-field';\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 standalone: true,\n selector: 'ngx-validation-messages, [ngxValidationMessages]',\n templateUrl: './ngx-validation-messages.component.html',\n styleUrls: ['./ngx-validation-messages.component.scss'],\n imports: [\n CommonModule,\n MatFormFieldModule,\n ]\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: any;\n\n /**\n * Contains {@link NgxValidatorNameDirective} if present.\n */\n @ContentChildren(NgxValidatorNameDirective)\n public customMsgDirective: any;\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@if (!formControl && customMsgComponent.length == 0 && customMsgDirective.length == 0) {\n <div\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\n@if (errorMessages.length > 0) {\n <!--To show error messages in material ui style-->\n @if (isMaterialError) {\n @for (message of errorMessages; track message) {\n <mat-error>{{ message }}</mat-error>\n }\n } @else {\n <div [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.blockClassNames || 'ngx_vm__def_error_block'\">\n @for (message of errorMessages; track message) {\n <div>\n <span [ngClass]=\"ngxValidationConfig?.validationMessagesStyle?.textClassNames || 'ngx_vm__def_error_text'\">\n {{ message }}\n </span>\n </div>\n }\n </div>\n }\n <!--To show error messages in user style-->\n}\n","import { Provider } from '@angular/core';\r\nimport {\r\n NGX_VALIDATION_MESSAGES_CONFIG,\r\n NgxValidationMessagesConfig\r\n} from './interface/ngx-validation-messages.config';\r\n\r\nexport { NGX_VALIDATION_MESSAGES_CONFIG } from './interface/ngx-validation-messages.config';\r\nexport type { 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\nexport function provideNgxValidationMessages(config: NgxValidationMessagesConfig): Provider[] {\r\n return [\r\n {\r\n provide: NGX_VALIDATION_MESSAGES_CONFIG,\r\n useValue: config\r\n }\r\n ];\r\n}\r\n","/*\n * Public API Surface of ngx-validation-messages\n */\nexport * from './lib/ngx-validation-messages.providers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NgxValidationMessagesService"],"mappings":";;;;;;;MAEa,8BAA8B,GACvC,IAAI,cAAc,CAA8B,6BAA6B;;ACAjF;;;;;AAKG;MAUU,yBAAyB,CAAA;AAEpC;;AAEG;AAEI,IAAA,aAAa;AAEpB;;AAEG;AAEI,IAAA,OAAO;uGAZH,yBAAyB,EAAA,IAAA,EAAA,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"@lagoshny/ngx-validation-messages",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.1",
|
|
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>",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"Angular 15",
|
|
27
27
|
"Angular 16",
|
|
28
28
|
"Angular 17",
|
|
29
|
+
"Angular 18",
|
|
30
|
+
"Angular 19",
|
|
31
|
+
"Angular 20",
|
|
32
|
+
"Angular 21",
|
|
29
33
|
"Material ui"
|
|
30
34
|
],
|
|
31
35
|
"homepage": "https://github.com/lagoshny/ngx-validation-messages",
|
|
@@ -37,18 +41,18 @@
|
|
|
37
41
|
"url": "https://github.com/lagoshny/ngx-validation-messages"
|
|
38
42
|
},
|
|
39
43
|
"dependencies": {
|
|
40
|
-
"tslib": "^2.
|
|
44
|
+
"tslib": "^2.3.0"
|
|
41
45
|
},
|
|
46
|
+
"sideEffects": false,
|
|
42
47
|
"module": "fesm2022/lagoshny-ngx-validation-messages.mjs",
|
|
43
|
-
"typings": "
|
|
48
|
+
"typings": "types/lagoshny-ngx-validation-messages.d.ts",
|
|
44
49
|
"exports": {
|
|
45
50
|
"./package.json": {
|
|
46
51
|
"default": "./package.json"
|
|
47
52
|
},
|
|
48
53
|
".": {
|
|
49
|
-
"types": "./
|
|
54
|
+
"types": "./types/lagoshny-ngx-validation-messages.d.ts",
|
|
50
55
|
"default": "./fesm2022/lagoshny-ngx-validation-messages.mjs"
|
|
51
56
|
}
|
|
52
|
-
}
|
|
53
|
-
"sideEffects": false
|
|
57
|
+
}
|
|
54
58
|
}
|
|
@@ -28,11 +28,11 @@ declare class NgxCustomMessageComponent {
|
|
|
28
28
|
/**
|
|
29
29
|
* The name of the validator for which you want to override the message.
|
|
30
30
|
*/
|
|
31
|
-
validatorName: string;
|
|
31
|
+
validatorName: string | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* Contains overridden message for validator.
|
|
34
34
|
*/
|
|
35
|
-
message: ElementRef;
|
|
35
|
+
message: ElementRef | undefined;
|
|
36
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxCustomMessageComponent, never>;
|
|
37
37
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgxCustomMessageComponent, "ngx-custom-message", never, { "validatorName": { "alias": "forValidator"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
38
38
|
}
|
|
@@ -123,11 +123,11 @@ declare class NgxValidatorNameDirective implements AfterViewInit {
|
|
|
123
123
|
/**
|
|
124
124
|
* The name of the validator for which you want to override the message.
|
|
125
125
|
*/
|
|
126
|
-
validatorName: string;
|
|
126
|
+
validatorName: string | undefined;
|
|
127
127
|
/**
|
|
128
128
|
* Contains overridden message for validator.
|
|
129
129
|
*/
|
|
130
|
-
message: string;
|
|
130
|
+
message: string | undefined;
|
|
131
131
|
constructor(elem: ElementRef);
|
|
132
132
|
ngAfterViewInit(): void;
|
|
133
133
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxValidatorNameDirective, never>;
|