@acorex/core 17.0.23 → 17.0.25
Sign up to get free protection for your applications and to get access to all the features.
@@ -5,16 +5,23 @@ export class AXCallbackValidationRule {
|
|
5
5
|
return 'callback';
|
6
6
|
}
|
7
7
|
async validate(value, options) {
|
8
|
-
const validationResult = options?.validate
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
const validationResult = options?.validate
|
9
|
+
? options?.validate(value, options)
|
10
|
+
: {
|
11
|
+
result: false,
|
12
|
+
message: 'Invalid callback function',
|
13
|
+
};
|
12
14
|
const createResult = (result) => ({
|
13
15
|
rule: this.name,
|
14
16
|
result: result.result,
|
15
17
|
message: result.message ?? options?.message ?? '',
|
16
18
|
value: value,
|
17
19
|
});
|
20
|
+
if (typeof validationResult === 'boolean') {
|
21
|
+
return createResult({
|
22
|
+
result: validationResult,
|
23
|
+
});
|
24
|
+
}
|
18
25
|
if (validationResult instanceof Promise) {
|
19
26
|
return validationResult.then(createResult);
|
20
27
|
}
|
@@ -26,4 +33,4 @@ export class AXCallbackValidationRule {
|
|
26
33
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXCallbackValidationRule, decorators: [{
|
27
34
|
type: Injectable
|
28
35
|
}] });
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsbGJhY2stcnVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS92YWxpZGF0aW9uL3NyYy9saWIvcnVsZXMvY2FsbGJhY2stcnVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQXNCM0MsTUFBTSxPQUFPLHdCQUF3QjtJQUNuQyxJQUFJLElBQUk7UUFDTixPQUFPLFVBQV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1bHQudGhlbihjcmVhdGVSZXN1bHQpO1xuICAgIH1cblxuICAgIHJldHVybiBjcmVhdGVSZXN1bHQodmFsaWRhdGlvblJlc3VsdCk7XG4gIH1cbn1cbiJdfQ==
|
@@ -9,16 +9,23 @@ class AXCallbackValidationRule {
|
|
9
9
|
return 'callback';
|
10
10
|
}
|
11
11
|
async validate(value, options) {
|
12
|
-
const validationResult = options?.validate
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
const validationResult = options?.validate
|
13
|
+
? options?.validate(value, options)
|
14
|
+
: {
|
15
|
+
result: false,
|
16
|
+
message: 'Invalid callback function',
|
17
|
+
};
|
16
18
|
const createResult = (result) => ({
|
17
19
|
rule: this.name,
|
18
20
|
result: result.result,
|
19
21
|
message: result.message ?? options?.message ?? '',
|
20
22
|
value: value,
|
21
23
|
});
|
24
|
+
if (typeof validationResult === 'boolean') {
|
25
|
+
return createResult({
|
26
|
+
result: validationResult,
|
27
|
+
});
|
28
|
+
}
|
22
29
|
if (validationResult instanceof Promise) {
|
23
30
|
return validationResult.then(createResult);
|
24
31
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-validation.mjs","sources":["../../../../libs/core/validation/src/lib/rules/callback-rule.ts","../../../../libs/core/validation/src/lib/rules/regex-rule.ts","../../../../libs/core/validation/src/lib/rules/required-rule.ts","../../../../libs/core/validation/src/lib/rules/length-rule.ts","../../../../libs/core/validation/src/lib/rules/maxlength-rule.ts","../../../../libs/core/validation/src/lib/rules/minlength-rule.ts","../../../../libs/core/validation/src/lib/rules/between-rule.ts","../../../../libs/core/validation/src/lib/rules/equal-rule.ts","../../../../libs/core/validation/src/lib/rules/greater-than.ts","../../../../libs/core/validation/src/lib/rules/less-than-rule.ts","../../../../libs/core/validation/src/lib/validation.config.ts","../../../../libs/core/validation/src/lib/validation.service.ts","../../../../libs/core/validation/src/lib/validation.module.ts","../../../../libs/core/validation/src/lib/validation.types.ts","../../../../libs/core/validation/src/acorex-core-validation.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\n\nexport type AXCallbackValidation<T> = (\n value: T,\n options?: AXCallbackValidationRuleOptions<T>\n) =>\n | Promise<{ result: boolean; message?: string }>\n | { result: boolean; message?: string };\n\nexport interface AXCallbackValidationRuleOptions<T>\n extends AXValidationRuleOptions {\n validate: AXCallbackValidation<T>;\n}\n\n// Augment the AXValidationRuleOptionsMap\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n callback: AXCallbackValidationRuleOptions<unknown>;\n }\n}\n\n@Injectable()\nexport class AXCallbackValidationRule<T> implements AXValidationRule {\n get name(): string {\n return 'callback';\n }\n\n async validate(\n value: T,\n options: AXCallbackValidationRuleOptions<T>\n ): Promise<AXValidationRuleResult> {\n const validationResult = options?.validate(value, options) || {\n result: false,\n message: 'Invalid callback function',\n };\n const createResult = (result: { result: boolean; message?: string }) => ({\n rule: this.name,\n result: result.result,\n message: result.message ?? options?.message ?? '',\n value: value,\n });\n\n if (validationResult instanceof Promise) {\n return validationResult.then(createResult);\n }\n\n return createResult(validationResult);\n }\n}\n","import { isEmpty, isString } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nexport interface AXRegexValidationRuleOptions extends AXValidationRuleOptions {\n pattern: string | RegExp;\n}\n\n// Augment the AXValidationRuleOptionsMap\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n regex: AXRegexValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXRegexValidationRule implements AXValidationRule {\n private traslationService = inject(AXTranslationService);\n\n get name(): string {\n return 'regex';\n }\n\n async validate(\n value: string,\n options: AXRegexValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n // Convert string pattern to RegExp if necessary\n const regexPattern =\n typeof options.pattern === 'string'\n ? new RegExp(options.pattern)\n : options.pattern;\n\n if (!value || (isString(value) && isEmpty(value.trim()))) {\n return {\n rule: this.name,\n result: true,\n message: null,\n value: value,\n };\n } else if (!isString(value)) {\n return {\n rule: this.name,\n result: false,\n message: `${value} is not string value.`,\n value: value,\n };\n }\n\n const isValid = regexPattern.test(value);\n const translatedMessage = await this.traslationService.translateAsync(\n options?.message ??\n `The value does not match the pattern ${regexPattern}.`,\n { params: { title: options?.['title'] } }\n );\n return {\n rule: this.name,\n result: isValid,\n message: isValid ? null : translatedMessage,\n value: value,\n };\n }\n}\n","import {\n find,\n isArray,\n isEmpty,\n isNull,\n isNumber,\n isString,\n isUndefined,\n} from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { firstValueFrom, lastValueFrom } from 'rxjs';\n\nexport interface AXRequiredValidationRuleOptions\n extends AXValidationRuleOptions {}\n\n// Augment the AXValidationRuleOptionsMap\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n required: AXRequiredValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXRequiredValidationRule implements AXValidationRule {\n private traslationService = inject(AXTranslationService);\n\n get name(): string {\n return 'required';\n }\n\n async validate(\n value?: unknown,\n options?: AXRequiredValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const rules = [\n { test: (val) => isNull(val) || isUndefined(val) },\n { test: (val) => isString(val) && isEmpty(val.trim()) },\n { test: (val) => isNumber(val) && isNaN(val) },\n { test: (val) => isArray(val) && isEmpty(val) },\n ];\n\n const failedRule = find(rules, (rule) => rule.test(value));\n const isValid = !failedRule;\n const translatedMessage = await this.traslationService.translateAsync(\n 'validation.messages.required',\n { params: { title: options?.['title'] } }\n );\n const message = failedRule ? options?.message ?? translatedMessage : null;\n\n return {\n rule: this.name,\n result: isValid,\n message: message,\n value,\n };\n }\n}\n","// ax-max-length-validation-rule.ts\nimport { Injectable } from '@angular/core';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\n\nexport interface AXLengthValidationRuleOptions extends AXValidationRuleOptions {\n min: number;\n max: number;\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n length: AXLengthValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXLengthValidationRule implements AXValidationRule {\n get name(): string {\n return 'length';\n }\n\n async validate(\n value: string,\n options: AXLengthValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid =\n value?.length >= options.min && value?.length <= options.max;\n return {\n rule: this.name,\n result: isValid,\n message: isValid\n ? null\n : options?.message ??\n `The value must be between ${options.min} and ${options.max} chars`,\n value: value,\n };\n }\n}\n","// ax-max-length-validation-rule.ts\nimport { isEmpty } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXMaxLengthValidationRuleOptions\n extends AXValidationRuleOptions {\n value: number;\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n maxLength: AXMaxLengthValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXMaxLengthValidationRule implements AXValidationRule {\n get name(): string {\n return 'maxLength';\n }\n\n async validate(\n value: string,\n options: AXMaxLengthValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid = isEmpty(value) ? true : value?.length <= options.value;\n return {\n rule: this.name,\n result: isValid,\n message: isValid\n ? ''\n : options?.message ??\n `The value must not exceed ${options.value} characters.`,\n value: value,\n };\n }\n}\n","import { isEmpty } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXMinLengthValidationRuleOptions\n extends AXValidationRuleOptions {\n value: number;\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n minLength: AXMinLengthValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXMinLengthValidationRule implements AXValidationRule {\n get name(): string {\n return 'minLength';\n }\n\n async validate(\n value: string,\n options: AXMinLengthValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid = isEmpty(value) ? true : value?.length >= options.value;\n return {\n rule: this.name,\n result: isValid,\n message: isValid\n ? ''\n : options?.message ??\n `The value must be at least ${options.value} characters long.`,\n value: value,\n };\n }\n}\n","import { isEmpty } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXBetweenValidationRuleOptions<T = number | Date>\n extends AXValidationRuleOptions {\n lowerValue: T;\n upperValue: T;\n inclusive?: boolean; // Optional flag for inclusiveness\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n between: AXBetweenValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXBetweenValidationRule<T = number | Date>\n implements AXValidationRule\n{\n get name(): string {\n return 'between';\n }\n\n async validate(\n value: T,\n options: AXBetweenValidationRuleOptions<T>\n ): Promise<AXValidationRuleResult> {\n let isValid;\n if (options.inclusive) {\n isValid = value >= options.lowerValue && value <= options.upperValue;\n } else {\n isValid = value > options.lowerValue && value < options.upperValue;\n }\n\n const rangeType = options.inclusive ? 'inclusive' : 'exclusive';\n const baseMessage = `The value must be within the ${rangeType} range of ${options.lowerValue} to ${options.upperValue}.`;\n\n return {\n rule: this.name,\n result: isValid || isEmpty(value),\n message: isValid ? '' : options?.message ?? baseMessage,\n value: value,\n };\n }\n}\n","// ax-equal-validation-rule.ts\nimport { isEqual } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXEqualValidationRuleOptions extends AXValidationRuleOptions {\n value: any;\n not?: boolean; // Optional flag to invert the validation logic\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n equal: AXEqualValidationRuleOptions;\n }\n}\n@Injectable()\nexport class AXEqualValidationRule implements AXValidationRule {\n get name(): string {\n return 'equal';\n }\n\n async validate(\n value: any,\n options: AXEqualValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValueEqual = isEqual(value, options.value);\n const isValid = options.not ? !isValueEqual : isValueEqual;\n\n const defaultMessage = `The value must ${\n options.not ? 'not ' : ''\n }be equal to ${options.value}.`;\n return {\n rule: this.name,\n result: isValid,\n message: isValid ? '' : options?.message ?? defaultMessage,\n value: value,\n };\n }\n}\n","// ax-greater-than-validation-rule.ts\nimport { isNull, isUndefined } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXGreaterThanValidationRuleOptions\n extends AXValidationRuleOptions {\n value: number;\n inclusive?: boolean; // Optional flag for inclusiveness\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n greaterThan: AXGreaterThanValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXGreaterThanValidationRule implements AXValidationRule {\n get name(): string {\n return 'greaterThan';\n }\n\n async validate(\n value: number,\n options: AXGreaterThanValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid =\n isNull(value) || isUndefined(value)\n ? true\n : options.inclusive\n ? value >= options.value\n : value > options.value;\n const baseMessage = `The value must be ${\n options.inclusive ? 'greater than or equal to' : 'greater than'\n } ${options.value}.`;\n\n return {\n rule: this.name,\n result: isValid,\n message: isValid ? '' : options?.message ?? baseMessage,\n value: value,\n };\n }\n}\n","// ax-less-than-validation-rule.ts\nimport { isNull, isUndefined } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXLessThanValidationRuleOptions\n extends AXValidationRuleOptions {\n value: number;\n inclusive?: boolean; // Optional flag for inclusiveness\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n lessThan: AXLessThanValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXLessThanValidationRule implements AXValidationRule {\n get name(): string {\n return 'lessThan';\n }\n\n async validate(\n value: number,\n options: AXLessThanValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid =\n isNull(value) || isUndefined(value)\n ? true\n : options.inclusive\n ? value <= options.value\n : value < options.value;\n const baseMessage = `The value must be ${\n options.inclusive ? 'less than or equal to' : 'less than'\n } ${options.value}.`;\n\n return {\n rule: this.name,\n result: isValid,\n message: isValid ? '' : options?.message ?? baseMessage,\n value: value,\n };\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport {\n AXValidationRuleOptions,\n AXValidationRuleOptionsMap,\n} from './validation.types';\n\nexport type AXValidationConfigRules = {\n [key: string]: {\n rule: keyof AXValidationRuleOptionsMap;\n options: AXValidationRuleOptions;\n };\n};\n\nexport interface AXValidationConfig {\n rules: AXValidationConfigRules;\n}\n\nexport const AX_VALIDATION_CONFIG = new InjectionToken<AXValidationConfig>(\n 'AX_VALIDATION_CONFIG',\n {\n providedIn: 'root',\n factory: () => {\n return AXValidationDefaultConfig;\n },\n }\n);\n\nexport const AXValidationDefaultConfig: AXValidationConfig = {\n rules: {\n email: {\n rule: 'regex',\n options: {\n pattern:\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,\n message: 'validation.messages.email',\n },\n },\n phone: {\n rule: 'regex',\n options: {\n pattern: /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$/,\n message: 'validation.messages.phone',\n },\n },\n },\n};\n\nexport type AXPartialValidationConfig = Partial<AXValidationConfig>;\n\nexport function validationConfig(\n config: AXPartialValidationConfig = {}\n): AXValidationConfig {\n const result = {\n ...AXValidationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { Injectable, Injector, inject } from '@angular/core';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleOptionsMap,\n AXValidationRuleResult,\n AXValidationSummary,\n} from './validation.types';\nimport {\n AXValidationConfigRules,\n AX_VALIDATION_CONFIG,\n} from './validation.config';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { merge } from 'lodash-es';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXValidationRegistryService {\n private plugins: AXValidationRule[] = [];\n\n private configs = inject(AX_VALIDATION_CONFIG);\n\n public get customRules(): AXValidationConfigRules {\n return this.configs.rules;\n }\n\n private injector: Injector;\n\n constructor(injector: Injector) {\n this.injector = injector;\n }\n\n register(...plugins: (new () => AXValidationRule)[]) {\n plugins.forEach((t) => {\n const childInjector = Injector.create({\n providers: [{ provide: t, useClass: t, deps: [] }],\n parent: this.injector,\n });\n const v = childInjector.get(t);\n\n if (v && !this.plugins.some((p) => p.name == v.name)) {\n this.plugins.push(v);\n }\n });\n }\n\n get(ruleName: string): AXValidationRule | undefined {\n return this.plugins.find((c) => c.name == ruleName);\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXValidationService {\n constructor(\n private pluginRegistry: AXValidationRegistryService,\n private translationService: AXTranslationService\n ) {}\n\n async validate(\n ruleName: string,\n value: unknown,\n options?: AXValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const customRule = this.pluginRegistry.customRules[ruleName];\n const validator = this.pluginRegistry.get(ruleName);\n\n if (!validator && !customRule) {\n return {\n rule: ruleName,\n result: false,\n message: await this.translationService.translateAsync(\n 'validation.messages.invalid-rull-name',\n { params: { name: ruleName } }\n ),\n value,\n };\n }\n\n if (options?.message) {\n options.message = await this.translationService.translateAsync(\n options.message\n );\n }\n //\n if (validator) return validator.validate(value, options);\n else {\n return this.validate(\n customRule.rule,\n value,\n merge(options, customRule.options)\n );\n }\n }\n\n ruleFor(value: unknown): AXValidationRuleChain {\n return new AXValidationRuleChain(this, value);\n }\n}\n\nclass AXValidationRuleChain {\n private rules: { name: string; options?: AXValidationRuleOptions }[] = [];\n private validationSummary: AXValidationSummary = { result: true, rules: [] };\n\n constructor(\n private validationService: AXValidationService,\n private initialValue: unknown\n ) {}\n\n addRule<K extends keyof AXValidationRuleOptionsMap>(\n name: K,\n options?: AXValidationRuleOptionsMap[K]\n ): AXValidationRuleChain {\n this.rules.push({ name, options });\n return this;\n }\n\n async validate(): Promise<AXValidationSummary> {\n for (const rule of this.rules) {\n const result = await this.validationService.validate(\n rule.name,\n this.initialValue,\n rule.options\n );\n this.validationSummary.rules.push(result);\n if (!result.result) {\n this.validationSummary.result = false;\n }\n }\n return this.validationSummary;\n }\n}\n","import {\n APP_INITIALIZER,\n Inject,\n Injector,\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport { AXValidationRegistryService } from './validation.service';\nimport { AXValidationRule } from './validation.types';\nimport { AXRegexValidationRule } from './rules/regex-rule';\nimport { AXRequiredValidationRule } from './rules/required-rule';\nimport { AXCallbackValidationRule } from './rules/callback-rule';\nimport { AXMinLengthValidationRule } from './rules/minlength-rule';\nimport { AXMaxLengthValidationRule } from './rules/maxlength-rule';\nimport { AXLengthValidationRule } from './rules/length-rule';\nimport { AXEqualValidationRule } from './rules/equal-rule';\nimport { AXLessThanValidationRule } from './rules/less-than-rule';\nimport { AXGreaterThanValidationRule } from './rules/greater-than';\nimport { AXBetweenValidationRule } from './rules/between-rule';\n\nconst BUILT_IN_RULES = [\n AXRequiredValidationRule,\n AXRegexValidationRule,\n AXRequiredValidationRule,\n AXCallbackValidationRule,\n //\n AXMinLengthValidationRule,\n AXMaxLengthValidationRule,\n AXLengthValidationRule,\n //\n AXEqualValidationRule,\n AXLessThanValidationRule,\n AXGreaterThanValidationRule,\n AXBetweenValidationRule,\n];\n\nexport interface AXValidationModuleConfigs {\n rules: (new () => AXValidationRule)[];\n}\n\n@NgModule({\n imports: [],\n providers: [...BUILT_IN_RULES],\n})\nexport class AXValidationModule {\n static forRoot(\n configs?: AXValidationModuleConfigs\n ): ModuleWithProviders<AXValidationModule> {\n return {\n ngModule: AXValidationModule,\n providers: [\n ...(configs?.rules || []),\n {\n provide: 'AXValidationModuleFactory',\n useFactory: (pluginRegistry: AXValidationRegistryService) => () => {\n pluginRegistry.register(\n ...[...BUILT_IN_RULES, ...(configs?.rules || [])]\n );\n },\n deps: [AXValidationRegistryService],\n multi: true,\n },\n ],\n };\n }\n\n static forChild(\n configs?: AXValidationModuleConfigs\n ): ModuleWithProviders<AXValidationModule> {\n return {\n ngModule: AXValidationModule,\n providers: [\n ...(configs?.rules || []),\n {\n provide: 'AXValidationModuleFactory',\n useFactory: (pluginRegistry: AXValidationRegistryService) => () => {\n pluginRegistry.register(\n ...[...BUILT_IN_RULES, ...(configs?.rules || [])]\n );\n },\n deps: [AXValidationRegistryService],\n multi: true,\n },\n ],\n };\n }\n\n /**\n * @ignore\n */\n constructor(@Inject('AXValidationModuleFactory') instances: any[]) {\n instances.forEach((f) => {\n f();\n });\n }\n}\n","export interface AXValidationRuleOptions {\n message?: string;\n [key: string]: unknown;\n}\n\nexport interface AXValidationRuleOptionsMap {\n // initially empty, but will be extended by other modules\n}\n\nexport abstract class AXValidationRule {\n abstract get name(): string;\n abstract validate(\n value: unknown,\n options?: AXValidationRuleOptions\n ): Promise<AXValidationRuleResult>;\n}\n\nexport interface AXValidationRuleResult {\n rule: string;\n value?: unknown;\n message?: string | null;\n result: boolean;\n [key: string]: unknown;\n}\n\nexport interface AXValidationSummary {\n result: boolean;\n rules: AXValidationRuleResult[];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA2Ba,wBAAwB,CAAA;AACnC,IAAA,IAAI,I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
|
1
|
+
{"version":3,"file":"acorex-core-validation.mjs","sources":["../../../../libs/core/validation/src/lib/rules/callback-rule.ts","../../../../libs/core/validation/src/lib/rules/regex-rule.ts","../../../../libs/core/validation/src/lib/rules/required-rule.ts","../../../../libs/core/validation/src/lib/rules/length-rule.ts","../../../../libs/core/validation/src/lib/rules/maxlength-rule.ts","../../../../libs/core/validation/src/lib/rules/minlength-rule.ts","../../../../libs/core/validation/src/lib/rules/between-rule.ts","../../../../libs/core/validation/src/lib/rules/equal-rule.ts","../../../../libs/core/validation/src/lib/rules/greater-than.ts","../../../../libs/core/validation/src/lib/rules/less-than-rule.ts","../../../../libs/core/validation/src/lib/validation.config.ts","../../../../libs/core/validation/src/lib/validation.service.ts","../../../../libs/core/validation/src/lib/validation.module.ts","../../../../libs/core/validation/src/lib/validation.types.ts","../../../../libs/core/validation/src/acorex-core-validation.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXValidationRule, AXValidationRuleOptions, AXValidationRuleResult } from '../validation.types';\n\nexport type AXCallbackValidationRuleResult =\n | Promise<{ result: boolean; message?: string }>\n | { result: boolean; message?: string }\n | boolean;\n\nexport type AXCallbackValidation<T> = (value: T, options?: AXCallbackValidationRuleOptions<T>) => AXCallbackValidationRuleResult;\n\nexport interface AXCallbackValidationRuleOptions<T> extends AXValidationRuleOptions {\n validate: AXCallbackValidation<T>;\n}\n\n// Augment the AXValidationRuleOptionsMap\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n callback: AXCallbackValidationRuleOptions<unknown>;\n }\n}\n\n@Injectable()\nexport class AXCallbackValidationRule<T> implements AXValidationRule {\n get name(): string {\n return 'callback';\n }\n\n async validate(value: T, options: AXCallbackValidationRuleOptions<T>): Promise<AXValidationRuleResult> {\n const validationResult = options?.validate\n ? options?.validate(value, options)\n : {\n result: false,\n message: 'Invalid callback function',\n };\n const createResult = (result: { result: boolean; message?: string }) => ({\n rule: this.name,\n result: result.result,\n message: result.message ?? options?.message ?? '',\n value: value,\n });\n\n if (typeof validationResult === 'boolean') {\n return createResult({\n result: validationResult,\n });\n }\n\n if (validationResult instanceof Promise) {\n return validationResult.then(createResult);\n }\n\n return createResult(validationResult);\n }\n}\n","import { isEmpty, isString } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nexport interface AXRegexValidationRuleOptions extends AXValidationRuleOptions {\n pattern: string | RegExp;\n}\n\n// Augment the AXValidationRuleOptionsMap\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n regex: AXRegexValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXRegexValidationRule implements AXValidationRule {\n private traslationService = inject(AXTranslationService);\n\n get name(): string {\n return 'regex';\n }\n\n async validate(\n value: string,\n options: AXRegexValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n // Convert string pattern to RegExp if necessary\n const regexPattern =\n typeof options.pattern === 'string'\n ? new RegExp(options.pattern)\n : options.pattern;\n\n if (!value || (isString(value) && isEmpty(value.trim()))) {\n return {\n rule: this.name,\n result: true,\n message: null,\n value: value,\n };\n } else if (!isString(value)) {\n return {\n rule: this.name,\n result: false,\n message: `${value} is not string value.`,\n value: value,\n };\n }\n\n const isValid = regexPattern.test(value);\n const translatedMessage = await this.traslationService.translateAsync(\n options?.message ??\n `The value does not match the pattern ${regexPattern}.`,\n { params: { title: options?.['title'] } }\n );\n return {\n rule: this.name,\n result: isValid,\n message: isValid ? null : translatedMessage,\n value: value,\n };\n }\n}\n","import {\n find,\n isArray,\n isEmpty,\n isNull,\n isNumber,\n isString,\n isUndefined,\n} from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { firstValueFrom, lastValueFrom } from 'rxjs';\n\nexport interface AXRequiredValidationRuleOptions\n extends AXValidationRuleOptions {}\n\n// Augment the AXValidationRuleOptionsMap\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n required: AXRequiredValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXRequiredValidationRule implements AXValidationRule {\n private traslationService = inject(AXTranslationService);\n\n get name(): string {\n return 'required';\n }\n\n async validate(\n value?: unknown,\n options?: AXRequiredValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const rules = [\n { test: (val) => isNull(val) || isUndefined(val) },\n { test: (val) => isString(val) && isEmpty(val.trim()) },\n { test: (val) => isNumber(val) && isNaN(val) },\n { test: (val) => isArray(val) && isEmpty(val) },\n ];\n\n const failedRule = find(rules, (rule) => rule.test(value));\n const isValid = !failedRule;\n const translatedMessage = await this.traslationService.translateAsync(\n 'validation.messages.required',\n { params: { title: options?.['title'] } }\n );\n const message = failedRule ? options?.message ?? translatedMessage : null;\n\n return {\n rule: this.name,\n result: isValid,\n message: message,\n value,\n };\n }\n}\n","// ax-max-length-validation-rule.ts\nimport { Injectable } from '@angular/core';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\n\nexport interface AXLengthValidationRuleOptions extends AXValidationRuleOptions {\n min: number;\n max: number;\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n length: AXLengthValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXLengthValidationRule implements AXValidationRule {\n get name(): string {\n return 'length';\n }\n\n async validate(\n value: string,\n options: AXLengthValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid =\n value?.length >= options.min && value?.length <= options.max;\n return {\n rule: this.name,\n result: isValid,\n message: isValid\n ? null\n : options?.message ??\n `The value must be between ${options.min} and ${options.max} chars`,\n value: value,\n };\n }\n}\n","// ax-max-length-validation-rule.ts\nimport { isEmpty } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXMaxLengthValidationRuleOptions\n extends AXValidationRuleOptions {\n value: number;\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n maxLength: AXMaxLengthValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXMaxLengthValidationRule implements AXValidationRule {\n get name(): string {\n return 'maxLength';\n }\n\n async validate(\n value: string,\n options: AXMaxLengthValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid = isEmpty(value) ? true : value?.length <= options.value;\n return {\n rule: this.name,\n result: isValid,\n message: isValid\n ? ''\n : options?.message ??\n `The value must not exceed ${options.value} characters.`,\n value: value,\n };\n }\n}\n","import { isEmpty } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXMinLengthValidationRuleOptions\n extends AXValidationRuleOptions {\n value: number;\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n minLength: AXMinLengthValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXMinLengthValidationRule implements AXValidationRule {\n get name(): string {\n return 'minLength';\n }\n\n async validate(\n value: string,\n options: AXMinLengthValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid = isEmpty(value) ? true : value?.length >= options.value;\n return {\n rule: this.name,\n result: isValid,\n message: isValid\n ? ''\n : options?.message ??\n `The value must be at least ${options.value} characters long.`,\n value: value,\n };\n }\n}\n","import { isEmpty } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXBetweenValidationRuleOptions<T = number | Date>\n extends AXValidationRuleOptions {\n lowerValue: T;\n upperValue: T;\n inclusive?: boolean; // Optional flag for inclusiveness\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n between: AXBetweenValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXBetweenValidationRule<T = number | Date>\n implements AXValidationRule\n{\n get name(): string {\n return 'between';\n }\n\n async validate(\n value: T,\n options: AXBetweenValidationRuleOptions<T>\n ): Promise<AXValidationRuleResult> {\n let isValid;\n if (options.inclusive) {\n isValid = value >= options.lowerValue && value <= options.upperValue;\n } else {\n isValid = value > options.lowerValue && value < options.upperValue;\n }\n\n const rangeType = options.inclusive ? 'inclusive' : 'exclusive';\n const baseMessage = `The value must be within the ${rangeType} range of ${options.lowerValue} to ${options.upperValue}.`;\n\n return {\n rule: this.name,\n result: isValid || isEmpty(value),\n message: isValid ? '' : options?.message ?? baseMessage,\n value: value,\n };\n }\n}\n","// ax-equal-validation-rule.ts\nimport { isEqual } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXEqualValidationRuleOptions extends AXValidationRuleOptions {\n value: any;\n not?: boolean; // Optional flag to invert the validation logic\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n equal: AXEqualValidationRuleOptions;\n }\n}\n@Injectable()\nexport class AXEqualValidationRule implements AXValidationRule {\n get name(): string {\n return 'equal';\n }\n\n async validate(\n value: any,\n options: AXEqualValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValueEqual = isEqual(value, options.value);\n const isValid = options.not ? !isValueEqual : isValueEqual;\n\n const defaultMessage = `The value must ${\n options.not ? 'not ' : ''\n }be equal to ${options.value}.`;\n return {\n rule: this.name,\n result: isValid,\n message: isValid ? '' : options?.message ?? defaultMessage,\n value: value,\n };\n }\n}\n","// ax-greater-than-validation-rule.ts\nimport { isNull, isUndefined } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXGreaterThanValidationRuleOptions\n extends AXValidationRuleOptions {\n value: number;\n inclusive?: boolean; // Optional flag for inclusiveness\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n greaterThan: AXGreaterThanValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXGreaterThanValidationRule implements AXValidationRule {\n get name(): string {\n return 'greaterThan';\n }\n\n async validate(\n value: number,\n options: AXGreaterThanValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid =\n isNull(value) || isUndefined(value)\n ? true\n : options.inclusive\n ? value >= options.value\n : value > options.value;\n const baseMessage = `The value must be ${\n options.inclusive ? 'greater than or equal to' : 'greater than'\n } ${options.value}.`;\n\n return {\n rule: this.name,\n result: isValid,\n message: isValid ? '' : options?.message ?? baseMessage,\n value: value,\n };\n }\n}\n","// ax-less-than-validation-rule.ts\nimport { isNull, isUndefined } from 'lodash-es';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleResult,\n} from '../validation.types';\nimport { Injectable } from '@angular/core';\n\nexport interface AXLessThanValidationRuleOptions\n extends AXValidationRuleOptions {\n value: number;\n inclusive?: boolean; // Optional flag for inclusiveness\n}\n\ndeclare module '../validation.types' {\n interface AXValidationRuleOptionsMap {\n lessThan: AXLessThanValidationRuleOptions;\n }\n}\n\n@Injectable()\nexport class AXLessThanValidationRule implements AXValidationRule {\n get name(): string {\n return 'lessThan';\n }\n\n async validate(\n value: number,\n options: AXLessThanValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const isValid =\n isNull(value) || isUndefined(value)\n ? true\n : options.inclusive\n ? value <= options.value\n : value < options.value;\n const baseMessage = `The value must be ${\n options.inclusive ? 'less than or equal to' : 'less than'\n } ${options.value}.`;\n\n return {\n rule: this.name,\n result: isValid,\n message: isValid ? '' : options?.message ?? baseMessage,\n value: value,\n };\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport {\n AXValidationRuleOptions,\n AXValidationRuleOptionsMap,\n} from './validation.types';\n\nexport type AXValidationConfigRules = {\n [key: string]: {\n rule: keyof AXValidationRuleOptionsMap;\n options: AXValidationRuleOptions;\n };\n};\n\nexport interface AXValidationConfig {\n rules: AXValidationConfigRules;\n}\n\nexport const AX_VALIDATION_CONFIG = new InjectionToken<AXValidationConfig>(\n 'AX_VALIDATION_CONFIG',\n {\n providedIn: 'root',\n factory: () => {\n return AXValidationDefaultConfig;\n },\n }\n);\n\nexport const AXValidationDefaultConfig: AXValidationConfig = {\n rules: {\n email: {\n rule: 'regex',\n options: {\n pattern:\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,\n message: 'validation.messages.email',\n },\n },\n phone: {\n rule: 'regex',\n options: {\n pattern: /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$/,\n message: 'validation.messages.phone',\n },\n },\n },\n};\n\nexport type AXPartialValidationConfig = Partial<AXValidationConfig>;\n\nexport function validationConfig(\n config: AXPartialValidationConfig = {}\n): AXValidationConfig {\n const result = {\n ...AXValidationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { Injectable, Injector, inject } from '@angular/core';\nimport {\n AXValidationRule,\n AXValidationRuleOptions,\n AXValidationRuleOptionsMap,\n AXValidationRuleResult,\n AXValidationSummary,\n} from './validation.types';\nimport {\n AXValidationConfigRules,\n AX_VALIDATION_CONFIG,\n} from './validation.config';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { merge } from 'lodash-es';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXValidationRegistryService {\n private plugins: AXValidationRule[] = [];\n\n private configs = inject(AX_VALIDATION_CONFIG);\n\n public get customRules(): AXValidationConfigRules {\n return this.configs.rules;\n }\n\n private injector: Injector;\n\n constructor(injector: Injector) {\n this.injector = injector;\n }\n\n register(...plugins: (new () => AXValidationRule)[]) {\n plugins.forEach((t) => {\n const childInjector = Injector.create({\n providers: [{ provide: t, useClass: t, deps: [] }],\n parent: this.injector,\n });\n const v = childInjector.get(t);\n\n if (v && !this.plugins.some((p) => p.name == v.name)) {\n this.plugins.push(v);\n }\n });\n }\n\n get(ruleName: string): AXValidationRule | undefined {\n return this.plugins.find((c) => c.name == ruleName);\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXValidationService {\n constructor(\n private pluginRegistry: AXValidationRegistryService,\n private translationService: AXTranslationService\n ) {}\n\n async validate(\n ruleName: string,\n value: unknown,\n options?: AXValidationRuleOptions\n ): Promise<AXValidationRuleResult> {\n const customRule = this.pluginRegistry.customRules[ruleName];\n const validator = this.pluginRegistry.get(ruleName);\n\n if (!validator && !customRule) {\n return {\n rule: ruleName,\n result: false,\n message: await this.translationService.translateAsync(\n 'validation.messages.invalid-rull-name',\n { params: { name: ruleName } }\n ),\n value,\n };\n }\n\n if (options?.message) {\n options.message = await this.translationService.translateAsync(\n options.message\n );\n }\n //\n if (validator) return validator.validate(value, options);\n else {\n return this.validate(\n customRule.rule,\n value,\n merge(options, customRule.options)\n );\n }\n }\n\n ruleFor(value: unknown): AXValidationRuleChain {\n return new AXValidationRuleChain(this, value);\n }\n}\n\nclass AXValidationRuleChain {\n private rules: { name: string; options?: AXValidationRuleOptions }[] = [];\n private validationSummary: AXValidationSummary = { result: true, rules: [] };\n\n constructor(\n private validationService: AXValidationService,\n private initialValue: unknown\n ) {}\n\n addRule<K extends keyof AXValidationRuleOptionsMap>(\n name: K,\n options?: AXValidationRuleOptionsMap[K]\n ): AXValidationRuleChain {\n this.rules.push({ name, options });\n return this;\n }\n\n async validate(): Promise<AXValidationSummary> {\n for (const rule of this.rules) {\n const result = await this.validationService.validate(\n rule.name,\n this.initialValue,\n rule.options\n );\n this.validationSummary.rules.push(result);\n if (!result.result) {\n this.validationSummary.result = false;\n }\n }\n return this.validationSummary;\n }\n}\n","import {\n APP_INITIALIZER,\n Inject,\n Injector,\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport { AXValidationRegistryService } from './validation.service';\nimport { AXValidationRule } from './validation.types';\nimport { AXRegexValidationRule } from './rules/regex-rule';\nimport { AXRequiredValidationRule } from './rules/required-rule';\nimport { AXCallbackValidationRule } from './rules/callback-rule';\nimport { AXMinLengthValidationRule } from './rules/minlength-rule';\nimport { AXMaxLengthValidationRule } from './rules/maxlength-rule';\nimport { AXLengthValidationRule } from './rules/length-rule';\nimport { AXEqualValidationRule } from './rules/equal-rule';\nimport { AXLessThanValidationRule } from './rules/less-than-rule';\nimport { AXGreaterThanValidationRule } from './rules/greater-than';\nimport { AXBetweenValidationRule } from './rules/between-rule';\n\nconst BUILT_IN_RULES = [\n AXRequiredValidationRule,\n AXRegexValidationRule,\n AXRequiredValidationRule,\n AXCallbackValidationRule,\n //\n AXMinLengthValidationRule,\n AXMaxLengthValidationRule,\n AXLengthValidationRule,\n //\n AXEqualValidationRule,\n AXLessThanValidationRule,\n AXGreaterThanValidationRule,\n AXBetweenValidationRule,\n];\n\nexport interface AXValidationModuleConfigs {\n rules: (new () => AXValidationRule)[];\n}\n\n@NgModule({\n imports: [],\n providers: [...BUILT_IN_RULES],\n})\nexport class AXValidationModule {\n static forRoot(\n configs?: AXValidationModuleConfigs\n ): ModuleWithProviders<AXValidationModule> {\n return {\n ngModule: AXValidationModule,\n providers: [\n ...(configs?.rules || []),\n {\n provide: 'AXValidationModuleFactory',\n useFactory: (pluginRegistry: AXValidationRegistryService) => () => {\n pluginRegistry.register(\n ...[...BUILT_IN_RULES, ...(configs?.rules || [])]\n );\n },\n deps: [AXValidationRegistryService],\n multi: true,\n },\n ],\n };\n }\n\n static forChild(\n configs?: AXValidationModuleConfigs\n ): ModuleWithProviders<AXValidationModule> {\n return {\n ngModule: AXValidationModule,\n providers: [\n ...(configs?.rules || []),\n {\n provide: 'AXValidationModuleFactory',\n useFactory: (pluginRegistry: AXValidationRegistryService) => () => {\n pluginRegistry.register(\n ...[...BUILT_IN_RULES, ...(configs?.rules || [])]\n );\n },\n deps: [AXValidationRegistryService],\n multi: true,\n },\n ],\n };\n }\n\n /**\n * @ignore\n */\n constructor(@Inject('AXValidationModuleFactory') instances: any[]) {\n instances.forEach((f) => {\n f();\n });\n }\n}\n","export interface AXValidationRuleOptions {\n message?: string;\n [key: string]: unknown;\n}\n\nexport interface AXValidationRuleOptionsMap {\n // initially empty, but will be extended by other modules\n}\n\nexport abstract class AXValidationRule {\n abstract get name(): string;\n abstract validate(\n value: unknown,\n options?: AXValidationRuleOptions\n ): Promise<AXValidationRuleResult>;\n}\n\nexport interface AXValidationRuleResult {\n rule: string;\n value?: unknown;\n message?: string | null;\n result: boolean;\n [key: string]: unknown;\n}\n\nexport interface AXValidationSummary {\n result: boolean;\n rules: AXValidationRuleResult[];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsBa,wBAAwB,CAAA;AACnC,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,UAAU,CAAC;KACnB;AAED,IAAA,MAAM,QAAQ,CAAC,KAAQ,EAAE,OAA2C,EAAA;AAClE,QAAA,MAAM,gBAAgB,GAAG,OAAO,EAAE,QAAQ;cACtC,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;AACnC,cAAE;AACE,gBAAA,MAAM,EAAE,KAAK;AACb,gBAAA,OAAO,EAAE,2BAA2B;aACrC,CAAC;AACN,QAAA,MAAM,YAAY,GAAG,CAAC,MAA6C,MAAM;YACvE,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,OAAO,EAAE,OAAO,IAAI,EAAE;AACjD,YAAA,KAAK,EAAE,KAAK;AACb,SAAA,CAAC,CAAC;AAEH,QAAA,IAAI,OAAO,gBAAgB,KAAK,SAAS,EAAE;AACzC,YAAA,OA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A,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,kBA8CT,2BAA2B,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GA9CpC,kBAAkB,EAAA,CAAA,CAAA,EAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAFlB,SAAA,EAAA,CAAC,GAAG,cAAc,CAAC,EAAA,CAAA,CAAA,EAAA;;2FAEnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,SAAS,EAAE,CAAC,GAAG,cAAc,CAAC;AAC/B,iBAAA,CAAA;;0BA+Cc,MAAM;2BAAC,2BAA2B,CAAA;;;MCjF3B,gBAAgB,CAAA;AAMrC;;ACfD;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
import { AXValidationRule, AXValidationRuleOptions, AXValidationRuleResult } from '../validation.types';
|
2
2
|
import * as i0 from "@angular/core";
|
3
|
-
export type
|
3
|
+
export type AXCallbackValidationRuleResult = Promise<{
|
4
4
|
result: boolean;
|
5
5
|
message?: string;
|
6
6
|
}> | {
|
7
7
|
result: boolean;
|
8
8
|
message?: string;
|
9
|
-
};
|
9
|
+
} | boolean;
|
10
|
+
export type AXCallbackValidation<T> = (value: T, options?: AXCallbackValidationRuleOptions<T>) => AXCallbackValidationRuleResult;
|
10
11
|
export interface AXCallbackValidationRuleOptions<T> extends AXValidationRuleOptions {
|
11
12
|
validate: AXCallbackValidation<T>;
|
12
13
|
}
|