@anglr/common 24.0.0-beta.20260126065643 → 24.0.0-beta.20260126082819

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.
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessagesExtractor.service.js","sourceRoot":"","sources":["../../../../../forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAqB,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAA+B,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAC,yBAAyB,EAAE,yBAAyB,EAAC,MAAM,mBAAmB,CAAC;;AAGvF;;GAEG;AACH,MAAM,oBAAoB,GAC1B;IACI,QAAQ,EAAE,oBAAoB;IAC9B,MAAM,EAAE,uBAAuB;IAC/B,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,qBAAqB;IAC/B,QAAQ,EAAE,mBAAmB;IAC7B,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,oBAAoB;CAClC,CAAC;AAEF;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAS/B,iEAAiE;IACjE,YAAmD,mBAAuC,EACjC,wBAAkC,EAChC,mBAAsC;QAF9C,wBAAmB,GAAnB,mBAAmB,CAAoB;QACjC,6BAAwB,GAAxB,wBAAwB,CAAU;QAGvF,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACtF,CAAC;IAED,oEAAoE;IAEpE;;;;OAIG;IACI,SAAS,CAAC,MAAkB,EAAE,QAA2B;QAE5D,MAAM,aAAa,GAAqB,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI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AUX,mBAAmB,aACnB,yBAAyB,aACzB,yBAAyB;kHAZpC,sBAAsB,cADV,MAAM;;2FAClB,sBAAsB;kBADlC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;0BAWf,MAAM;2BAAC,mBAAmB;;0BAC1B,MAAM;2BAAC,yBAAyB;;0BAChC,MAAM;2BAAC,yBAAyB;;0BAAG,QAAQ","sourcesContent":["import {Injectable, Inject, Optional} from '@angular/core';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {Dictionary, StringDictionary, isString} from '@jscrpt/common';\nimport {extend} from '@jscrpt/common/extend';\n\nimport {IGNORED_VALIDATION_ERRORS, VALIDATION_ERROR_MESSAGES} from '../../misc/tokens';\nimport {ValidationErrorsResult} from './errorMessagesExtractor.interface';\n\n/**\n * Default error messages displayed\n */\nconst defaultErrorMessages: StringDictionary =\n{\n required: 'Field is required.',\n number: 'Value must be number.',\n pattern: 'Value is not valid.',\n minValue: 'Value is too small.',\n maxValue: 'Value is too big.',\n minlength: 'Value is short.',\n maxlength: 'Value is too long.',\n};\n\n/**\n * Service used for extracting error messages from form control\n */\n@Injectable({providedIn: 'root'})\nexport class ErrorMessagesExtractor\n{\n //######################### protected fields #########################\n\n /**\n * Dictionary with error names that have defined message\n */\n protected _errorMessages: StringDictionary;\n\n //######################### constructor #########################\n constructor(@Inject(STRING_LOCALIZATION) protected _stringLocalization: StringLocalization,\n @Inject(IGNORED_VALIDATION_ERRORS) protected _ignoredValidationErrors: string[],\n @Inject(VALIDATION_ERROR_MESSAGES) @Optional() globalErrorMessages?: StringDictionary)\n {\n this._errorMessages = extend(true, {}, defaultErrorMessages, globalErrorMessages);\n }\n\n //######################### public methods #########################\n\n /**\n * Gets validation errors result for provided control, or null of no errors are present\n * @param errors - Dictionary containing validation errors\n * @param messages - Object containing error messages that should patch existing error messages\n */\n public getErrors(errors: Dictionary, messages?: StringDictionary): ValidationErrorsResult\n {\n const errorMessages: StringDictionary = extend(true, {}, this._errorMessages, messages);\n\n //no control or no errors\n if(!errors)\n {\n return null;\n }\n\n const result: ValidationErrorsResult =\n {\n errors: Object.keys(errors).filter(itm => this._ignoredValidationErrors.indexOf(itm) < 0),\n errorMessages: []\n };\n\n result.errors.forEach(error =>\n {\n const errorData = errors[error];\n\n //error message is present for error\n if(errorMessages[error])\n {\n result.errorMessages.push(this._stringLocalization.get(errorMessages[error], errors));\n }\n //display error data if it is string and there is missing translation\n else if(isString(errorData))\n {\n result.errorMessages.push(errorData);\n }\n //error data are array of strings, each string is considered error message\n else if(Array.isArray(errorData))\n {\n errorData.forEach(errorItm =>\n {\n if(isString(errorItm))\n {\n result.errorMessages.push(this._stringLocalization.get(errorItm, errors));\n }\n });\n }\n });\n\n return result;\n }\n}"]}
1
+ {"version":3,"file":"errorMessagesExtractor.service.js","sourceRoot":"","sources":["../../../../../forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAqB,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAA+B,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAC,yBAAyB,EAAE,yBAAyB,EAAC,MAAM,mBAAmB,CAAC;;AAGvF;;GAEG;AACH,MAAM,oBAAoB,GAC1B;IACI,QAAQ,EAAE,oBAAoB;IAC9B,MAAM,EAAE,uBAAuB;IAC/B,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,qBAAqB;IAC/B,QAAQ,EAAE,mBAAmB;IAC7B,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,oBAAoB;CAClC,CAAC;AAEF;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAS/B,iEAAiE;IACjE,YAAmD,mBAAuC,EACjC,wBAAkC,EAChC,mB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OAAO,CAAC,QAAQ,CAAC,EAAE;oBAEzB,IAAG,QAAQ,CAAC,QAAQ,CAAC,EACrB,CAAC;wBACG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;oBAC9E,CAAC;gBACL,CAAC,CAAC,CAAC;YACP,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAClB,CAAC;8GApEQ,sBAAsB,kBAUX,mBAAmB,aACnB,yBAAyB,aACzB,yBAAyB;kHAZpC,sBAAsB,cADV,MAAM;;2FAClB,sBAAsB;kBADlC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;0BAWf,MAAM;2BAAC,mBAAmB;;0BAC1B,MAAM;2BAAC,yBAAyB;;0BAChC,MAAM;2BAAC,yBAAyB;;0BAAG,QAAQ","sourcesContent":["import {Injectable, Inject, Optional} from '@angular/core';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {Dictionary, StringDictionary, isString} from '@jscrpt/common';\nimport {extend} from '@jscrpt/common/extend';\n\nimport {IGNORED_VALIDATION_ERRORS, VALIDATION_ERROR_MESSAGES} from '../../misc/tokens';\nimport {ValidationErrorsResult} from './errorMessagesExtractor.interface';\n\n/**\n * Default error messages displayed\n */\nconst defaultErrorMessages: StringDictionary =\n{\n required: 'Field is required.',\n number: 'Value must be number.',\n pattern: 'Value is not valid.',\n minValue: 'Value is too small.',\n maxValue: 'Value is too big.',\n minlength: 'Value is short.',\n maxlength: 'Value is too long.',\n};\n\n/**\n * Service used for extracting error messages from form control\n */\n@Injectable({providedIn: 'root'})\nexport class ErrorMessagesExtractor\n{\n //######################### protected fields #########################\n\n /**\n * Dictionary with error names that have defined message\n */\n protected _errorMessages: StringDictionary;\n\n //######################### constructor #########################\n constructor(@Inject(STRING_LOCALIZATION) protected _stringLocalization: StringLocalization,\n @Inject(IGNORED_VALIDATION_ERRORS) protected _ignoredValidationErrors: string[],\n @Inject(VALIDATION_ERROR_MESSAGES) @Optional() globalErrorMessages?: StringDictionary)\n {\n this._errorMessages = extend(true, {}, defaultErrorMessages, globalErrorMessages);\n }\n\n //######################### public methods #########################\n\n /**\n * Gets validation errors result for provided control, or null of no errors are present\n * @param errors - Dictionary containing validation errors\n * @param messages - Object containing error messages that should patch existing error messages\n */\n public getErrors(errors?: Dictionary, messages?: StringDictionary): ValidationErrorsResult\n {\n const errorMessages: StringDictionary = extend(true, {}, this._errorMessages, messages);\n\n //no control or no errors\n if(!errors)\n {\n return null;\n }\n\n const result: ValidationErrorsResult =\n {\n errors: Object.keys(errors).filter(itm => this._ignoredValidationErrors.indexOf(itm) < 0),\n errorMessages: []\n };\n\n result.errors.forEach(error =>\n {\n const errorData = errors[error];\n\n //error message is present for error\n if(errorMessages[error])\n {\n result.errorMessages.push(this._stringLocalization.get(errorMessages[error], errors));\n }\n //display error data if it is string and there is missing translation\n else if(isString(errorData))\n {\n result.errorMessages.push(errorData);\n }\n //error data are array of strings, each string is considered error message\n else if(Array.isArray(errorData))\n {\n errorData.forEach(errorItm =>\n {\n if(isString(errorItm))\n {\n result.errorMessages.push(this._stringLocalization.get(errorItm, errors));\n }\n });\n }\n });\n\n return result;\n }\n}"]}
@@ -18,7 +18,7 @@ export declare class ErrorMessagesExtractor {
18
18
  * @param errors - Dictionary containing validation errors
19
19
  * @param messages - Object containing error messages that should patch existing error messages
20
20
  */
21
- getErrors(errors: Dictionary, messages?: StringDictionary): ValidationErrorsResult;
21
+ getErrors(errors?: Dictionary, messages?: StringDictionary): ValidationErrorsResult;
22
22
  static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMessagesExtractor, [null, null, { optional: true; }]>;
23
23
  static ɵprov: i0.ɵɵInjectableDeclaration<ErrorMessagesExtractor>;
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessagesExtractor.service.d.ts","sourceRoot":"","sources":["errorMessagesExtractor.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAsB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAW,MAAM,gBAAgB,CAAC;AAItE,OAAO,EAAC,sBAAsB,EAAC,MAAM,oCAAoC,CAAC;;AAgB1E;;GAEG;AACH,qBACa,sBAAsB;IAUU,SAAS,CAAC,mBAAmB,EAAE,kBAAkB;IAC3C,SAAS,CAAC,wBAAwB,EAAE,MAAM,EAAE;IAP3F;;OAEG;IACH,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC;gBAGQ,mBAAmB,EAAE,kBAAkB,EACjC,wBAAwB,EAAE,MAAM,EAAE,EAChC,mBAAmB,CAAC,EAAE,gBAAgB;IAOjG;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,sBAAsB;yCAxBhF,sBAAsB;6CAAtB,sBAAsB;CAqElC"}
1
+ {"version":3,"file":"errorMessagesExtractor.service.d.ts","sourceRoot":"","sources":["errorMessagesExtractor.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAsB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAW,MAAM,gBAAgB,CAAC;AAItE,OAAO,EAAC,sBAAsB,EAAC,MAAM,oCAAoC,CAAC;;AAgB1E;;GAEG;AACH,qBACa,sBAAsB;IAUU,SAAS,CAAC,mBAAmB,EAAE,kBAAkB;IAC3C,SAAS,CAAC,wBAAwB,EAAE,MAAM,EAAE;IAP3F;;OAEG;IACH,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC;gBAGQ,mBAAmB,EAAE,kBAAkB,EACjC,wBAAwB,EAAE,MAAM,EAAE,EAChC,mBAAmB,CAAC,EAAE,gBAAgB;IAOjG;;;;OAIG;IACI,SAAS,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,sBAAsB;yCAxBjF,sBAAsB;6CAAtB,sBAAsB;CAqElC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/common",
3
- "version": "24.0.0-beta.20260126065643",
3
+ "version": "24.0.0-beta.20260126082819",
4
4
  "description": "Angular module for common angular stuff",
5
5
  "type": "module",
6
6
  "sideEffects": false,
package/version.bak CHANGED
@@ -1 +1 @@
1
- 24.0.0-beta.20260126065643
1
+ 24.0.0-beta.20260126082819