@sbcore/ng-absolute-validator 14.0.2 → 14.1.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.
- package/README.md +14 -16
- package/deprecation.util.d.ts +1 -0
- package/esm2020/deprecation.util.mjs +9 -0
- package/esm2020/i18n/ar.mjs +68 -0
- package/esm2020/i18n/de.mjs +1 -1
- package/esm2020/i18n/en.mjs +1 -1
- package/esm2020/i18n/es.mjs +1 -1
- package/esm2020/i18n/fr.mjs +1 -1
- package/esm2020/i18n/hi.mjs +1 -1
- package/esm2020/i18n/index.mjs +12 -0
- package/esm2020/lib/common.utils.mjs +12 -1
- package/esm2020/lib/config-interface.mjs +1 -1
- package/esm2020/lib/constant.mjs +2 -2
- package/esm2020/lib/directive/error-trigger/error-trigger-on.directive.mjs +1 -1
- package/esm2020/lib/interface.mjs +2 -14
- package/esm2020/lib/lang.config.mjs +26 -0
- package/esm2020/lib/ng-absolute-validator.component.mjs +5 -3
- package/esm2020/lib/ng-absolute-validator.module.mjs +10 -22
- package/esm2020/lib/ng-absolute-validator.service.mjs +14 -6
- package/esm2020/lib/pipe/index.mjs +2 -0
- package/esm2020/lib/pipe/replaceWith/replace-with.pipe.mjs +17 -0
- package/esm2020/lib/rule/rule.directive.mjs +14 -3
- package/esm2020/lib/services/http.request.service.mjs +4 -3
- package/esm2020/lib/services/messages-builder.service.mjs +30 -33
- package/esm2020/lib/services/reactive.validate.mjs +4 -3
- package/esm2020/lib/services/utils.service.mjs +4 -3
- package/esm2020/lib/services/validate-rule.service.mjs +15 -10
- package/esm2020/lib/transator.loader.mjs +35 -24
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/sbcore-ng-absolute-validator.mjs +234 -99
- package/fesm2015/sbcore-ng-absolute-validator.mjs.map +1 -1
- package/fesm2020/sbcore-ng-absolute-validator.mjs +233 -101
- package/fesm2020/sbcore-ng-absolute-validator.mjs.map +1 -1
- package/i18n/ar.d.ts +68 -0
- package/i18n/index.d.ts +11 -0
- package/lib/common.utils.d.ts +4 -0
- package/lib/config-interface.d.ts +1 -2
- package/lib/constant.d.ts +1 -1
- package/lib/interface.d.ts +7 -3
- package/lib/lang.config.d.ts +1 -0
- package/lib/ng-absolute-validator.module.d.ts +6 -9
- package/lib/ng-absolute-validator.service.d.ts +8 -3
- package/lib/pipe/index.d.ts +1 -0
- package/lib/pipe/replaceWith/replace-with.pipe.d.ts +7 -0
- package/lib/rule/rule.directive.d.ts +5 -1
- package/lib/services/messages-builder.service.d.ts +5 -3
- package/lib/services/validate-rule.service.d.ts +4 -2
- package/lib/transator.loader.d.ts +5 -3
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
package/i18n/ar.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
above: string;
|
|
3
|
+
accepted: string;
|
|
4
|
+
after: string;
|
|
5
|
+
alpha: string;
|
|
6
|
+
alpha_dash: string;
|
|
7
|
+
alpha_numeric: string;
|
|
8
|
+
array: string;
|
|
9
|
+
before: string;
|
|
10
|
+
boolean: string;
|
|
11
|
+
confirmed: string;
|
|
12
|
+
credit_card: string;
|
|
13
|
+
cvv: string;
|
|
14
|
+
date: string;
|
|
15
|
+
date_format: string;
|
|
16
|
+
debit_card: string;
|
|
17
|
+
different: string;
|
|
18
|
+
dimension: string;
|
|
19
|
+
email: string;
|
|
20
|
+
ends_with: string;
|
|
21
|
+
equals: string;
|
|
22
|
+
exists: string;
|
|
23
|
+
image: string;
|
|
24
|
+
in: string;
|
|
25
|
+
includes: string;
|
|
26
|
+
integer: string;
|
|
27
|
+
ip: string;
|
|
28
|
+
ipv4: string;
|
|
29
|
+
ipv6: string;
|
|
30
|
+
json: string;
|
|
31
|
+
max: {
|
|
32
|
+
array: string;
|
|
33
|
+
numeric: string;
|
|
34
|
+
string: string;
|
|
35
|
+
};
|
|
36
|
+
min: {
|
|
37
|
+
array: string;
|
|
38
|
+
numeric: string;
|
|
39
|
+
string: string;
|
|
40
|
+
};
|
|
41
|
+
mimes: string;
|
|
42
|
+
not_equals: string;
|
|
43
|
+
not_in: string;
|
|
44
|
+
not_regex: string;
|
|
45
|
+
number: string;
|
|
46
|
+
phone_no: string;
|
|
47
|
+
range: string;
|
|
48
|
+
between: string;
|
|
49
|
+
regex: string;
|
|
50
|
+
required: string;
|
|
51
|
+
required_if: string;
|
|
52
|
+
required_unless: string;
|
|
53
|
+
required_with: string;
|
|
54
|
+
required_with_all: string;
|
|
55
|
+
required_without: string;
|
|
56
|
+
required_without_all: string;
|
|
57
|
+
same: string;
|
|
58
|
+
size: string;
|
|
59
|
+
starts_with: string;
|
|
60
|
+
string: string;
|
|
61
|
+
strength: string;
|
|
62
|
+
under: string;
|
|
63
|
+
url: string;
|
|
64
|
+
uuid: string;
|
|
65
|
+
unique: string;
|
|
66
|
+
video: string;
|
|
67
|
+
};
|
|
68
|
+
export default _default;
|
package/i18n/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './ar';
|
|
2
|
+
export * from './bn';
|
|
3
|
+
export * from './de';
|
|
4
|
+
export * from './en';
|
|
5
|
+
export * from './es';
|
|
6
|
+
export * from './fr';
|
|
7
|
+
export * from './hi';
|
|
8
|
+
export * from './ja';
|
|
9
|
+
export * from './pt';
|
|
10
|
+
export * from './ru';
|
|
11
|
+
export * from './zh';
|
package/lib/common.utils.d.ts
CHANGED
|
@@ -6,3 +6,7 @@ export declare const json: (string: string) => boolean;
|
|
|
6
6
|
export declare const bytesToSize: (bytes: any, seperator?: string) => string | null;
|
|
7
7
|
export declare function toCharClass(chars: string): string;
|
|
8
8
|
export declare function cloneDeep(data: any): any;
|
|
9
|
+
export declare function formatMessage(template: string, data: {
|
|
10
|
+
attr: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
}): string;
|
|
@@ -7,9 +7,8 @@ export interface ConfigInterface {
|
|
|
7
7
|
strengthColor?: StrengthColor[];
|
|
8
8
|
strengthLevel?: StrengthLevel[];
|
|
9
9
|
translations?: LocalizedMessageGroup;
|
|
10
|
-
replaceTranslations?: LocalizedMessageGroup;
|
|
11
10
|
defaultLanguage?: string;
|
|
12
|
-
supportedLanguages?: string[];
|
|
13
11
|
showErrorOn?: ErrorTriggerState;
|
|
12
|
+
showAllErrors?: boolean;
|
|
14
13
|
}
|
|
15
14
|
export declare const LIB_CONFIG: InjectionToken<ConfigInterface>;
|
package/lib/constant.d.ts
CHANGED
|
@@ -49,11 +49,11 @@ export declare const GlobalConstant: {
|
|
|
49
49
|
max?: undefined;
|
|
50
50
|
})[];
|
|
51
51
|
};
|
|
52
|
+
export declare const I18N_LANG_PREFIX = "NG_ABSOLUTE_VALIDATOR";
|
|
52
53
|
export declare const CUSTOM_OBJECT_NAME = "ng_abs";
|
|
53
54
|
export declare const DEFAULT_STRENGTH_COLOR = "#6c757d";
|
|
54
55
|
export declare const DEFAULT_DATE_FORMAT = "dd-MM-yyyy";
|
|
55
56
|
export declare const DEFAULT_LOCALE_LANG = "en";
|
|
56
|
-
export declare const SUPPORTED_LOCALE_LANGS: string[];
|
|
57
57
|
export declare const DEFAULT_TRIGGER_STATE: string[];
|
|
58
58
|
export declare const EMIT_METHODS: string[];
|
|
59
59
|
export declare const CROSS_FIELD_VALIDATORS: string[];
|
package/lib/interface.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AbstractControl, FormGroupDirective, NgForm } from "@angular/forms";
|
|
2
|
-
import { SUPPORTED_LOCALE_LANGS } from "./constant";
|
|
3
2
|
export interface AbstractControl2 extends AbstractControl {
|
|
4
3
|
[key: string]: any;
|
|
5
4
|
}
|
|
@@ -17,8 +16,6 @@ export interface HttpRequestArgs {
|
|
|
17
16
|
params?: object;
|
|
18
17
|
method?: 'GET' | 'POST';
|
|
19
18
|
}
|
|
20
|
-
export declare type LocaleLang = typeof SUPPORTED_LOCALE_LANGS[number];
|
|
21
|
-
export declare const LOCALE_LANG_LABELS: Record<LocaleLang, string>;
|
|
22
19
|
export interface LocalizedMessage {
|
|
23
20
|
en?: string;
|
|
24
21
|
ar?: string;
|
|
@@ -100,6 +97,13 @@ export interface ValidationMessages {
|
|
|
100
97
|
unique: LocalizedMessage;
|
|
101
98
|
video: LocalizedMessage;
|
|
102
99
|
}
|
|
100
|
+
export interface MessageBuilder {
|
|
101
|
+
args: any[];
|
|
102
|
+
attr: string;
|
|
103
|
+
i18nKey: string;
|
|
104
|
+
readonly lang: string;
|
|
105
|
+
readonly message: string;
|
|
106
|
+
}
|
|
103
107
|
export interface StrengthLevel {
|
|
104
108
|
id: string;
|
|
105
109
|
description?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BUILT_IN_TRANSLATIONS: Record<string, any>;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
2
|
import { ConfigInterface } from './config-interface';
|
|
3
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
-
import { InlineTranslateLoader } from './transator.loader';
|
|
5
3
|
import * as i0 from "@angular/core";
|
|
6
4
|
import * as i1 from "./ng-absolute-validator.component";
|
|
7
5
|
import * as i2 from "./directive/native-element/native-element.directive";
|
|
8
6
|
import * as i3 from "./directive/error-trigger/error-trigger-on.directive";
|
|
9
|
-
import * as i4 from "
|
|
10
|
-
import * as i5 from "
|
|
11
|
-
import * as i6 from "
|
|
12
|
-
import * as i7 from "@
|
|
13
|
-
|
|
14
|
-
export declare function appInitializerFactory(translate: TranslateService, config: ConfigInterface): () => Promise<any>;
|
|
7
|
+
import * as i4 from "./pipe/replaceWith/replace-with.pipe";
|
|
8
|
+
import * as i5 from "@angular/common";
|
|
9
|
+
import * as i6 from "./rule/rule.module";
|
|
10
|
+
import * as i7 from "@angular/common/http";
|
|
11
|
+
import * as i8 from "@ngx-translate/core";
|
|
15
12
|
export declare class NgAbsoluteValidatorModule {
|
|
16
13
|
static forRoot(config?: ConfigInterface): ModuleWithProviders<NgAbsoluteValidatorModule>;
|
|
17
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgAbsoluteValidatorModule, never>;
|
|
18
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgAbsoluteValidatorModule, [typeof i1.NgAbsoluteValidatorComponent, typeof i2.NativeElementDirective, typeof i3.ErrorTriggerOn], [typeof
|
|
15
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgAbsoluteValidatorModule, [typeof i1.NgAbsoluteValidatorComponent, typeof i2.NativeElementDirective, typeof i3.ErrorTriggerOn, typeof i4.ReplaceWithPipe], [typeof i5.CommonModule, typeof i6.RuleModule, typeof i7.HttpClientModule, typeof i8.TranslateModule], [typeof i6.RuleModule, typeof i1.NgAbsoluteValidatorComponent, typeof i3.ErrorTriggerOn, typeof i8.TranslateModule]>;
|
|
19
16
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgAbsoluteValidatorModule>;
|
|
20
17
|
}
|
|
@@ -36,10 +36,15 @@ export declare class NgAbsoluteValidatorService {
|
|
|
36
36
|
**/
|
|
37
37
|
get delayLoader(): number;
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
* @description This method state of triger validation
|
|
40
|
+
* @returns boolean
|
|
41
|
+
**/
|
|
42
42
|
get showErrorOn(): ErrorTriggerState[];
|
|
43
|
+
/**
|
|
44
|
+
* @description Display all validation error instande of latest one
|
|
45
|
+
* @returns boolean
|
|
46
|
+
**/
|
|
47
|
+
get showAllErrors(): boolean;
|
|
43
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgAbsoluteValidatorService, never>;
|
|
44
49
|
static ɵprov: i0.ɵɵInjectableDeclaration<NgAbsoluteValidatorService>;
|
|
45
50
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './replaceWith/replace-with.pipe';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ReplaceWithPipe implements PipeTransform {
|
|
4
|
+
transform(value: string, data: any): string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ReplaceWithPipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ReplaceWithPipe, "replaceWith", false>;
|
|
7
|
+
}
|
|
@@ -9,9 +9,13 @@ export declare class Rule implements Validator {
|
|
|
9
9
|
private vmessage;
|
|
10
10
|
private fieldName;
|
|
11
11
|
rule: string | string[];
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `rule` (lowercase) instead. Will be removed in 16.0.0.
|
|
14
|
+
**/
|
|
15
|
+
set legacyRule(value: string | string[]);
|
|
12
16
|
set message(data: LocalizedMessageGroup);
|
|
13
17
|
constructor(ruleValidate: ValidateRuleService, el: ElementRef);
|
|
14
18
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
15
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<Rule, never>;
|
|
16
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<Rule, "[
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<Rule, "[rule],[Rule]", never, { "rule": "rule"; "legacyRule": "Rule"; "message": "message"; }, {}, never, never, false>;
|
|
17
21
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { TranslateService } from '@ngx-translate/core';
|
|
2
|
+
import { MessageBuilder } from '../interface';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class MessageBuilderService {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
6
|
-
call(langAttr: string, attribute: string, ...args: any):
|
|
5
|
+
private translate;
|
|
6
|
+
constructor(translate: TranslateService);
|
|
7
|
+
call(langAttr: string, attribute: string, ...args: any): MessageBuilder;
|
|
8
|
+
private injectToTranslation;
|
|
7
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageBuilderService, never>;
|
|
8
10
|
static ɵprov: i0.ɵɵInjectableDeclaration<MessageBuilderService>;
|
|
9
11
|
}
|
|
@@ -2,14 +2,16 @@ import { UtilService } from './utils.service';
|
|
|
2
2
|
import { MessageBuilderService } from './messages-builder.service';
|
|
3
3
|
import { ValidationErrors } from '@angular/forms';
|
|
4
4
|
import { AbstractControl2, LocalizedMessageGroup } from '../interface';
|
|
5
|
+
import { NgAbsoluteValidatorService } from '../ng-absolute-validator.service';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class ValidateRuleService {
|
|
7
8
|
private mb;
|
|
9
|
+
private abs;
|
|
8
10
|
private utl;
|
|
9
11
|
private subMessageMethod;
|
|
10
12
|
private wiredRulesMap;
|
|
11
|
-
constructor(mb: MessageBuilderService, utl: UtilService);
|
|
12
|
-
gererateRuleAndValidate(fieldName: string, control: AbstractControl2, rule: string | string[],
|
|
13
|
+
constructor(mb: MessageBuilderService, abs: NgAbsoluteValidatorService, utl: UtilService);
|
|
14
|
+
gererateRuleAndValidate(fieldName: string, control: AbstractControl2, rule: string | string[], customMessage: LocalizedMessageGroup): ValidationErrors | null;
|
|
13
15
|
private getMessageKeyRespectToValue;
|
|
14
16
|
private wireSiblingWatchers;
|
|
15
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<ValidateRuleService, never>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { TranslateLoader } from "@ngx-translate/core";
|
|
1
|
+
import { TranslateLoader, TranslateService } from "@ngx-translate/core";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
|
+
import { ConfigInterface } from "./config-interface";
|
|
4
|
+
export declare function TranslateLoaderFactory(config: ConfigInterface): InlineTranslateLoader;
|
|
5
|
+
export declare function appInitializerFactory(translate: TranslateService, config: ConfigInterface, activeLoader: TranslateLoader): () => Promise<any>;
|
|
3
6
|
export declare class InlineTranslateLoader implements TranslateLoader {
|
|
4
|
-
private mergeTranslations;
|
|
5
7
|
private replaceTranslations;
|
|
6
8
|
private translations;
|
|
7
|
-
constructor(
|
|
9
|
+
constructor(replaceTranslations?: Record<string, any>);
|
|
8
10
|
init(): void;
|
|
9
11
|
getTranslation(lang: string): Observable<any>;
|
|
10
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbcore/ng-absolute-validator",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A complete Angular form validation library — built-in, custom, and advanced/async validators for reactive and template-driven forms.",
|
|
6
6
|
"author": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"validation-rules",
|
|
30
30
|
"angular14"
|
|
31
31
|
],
|
|
32
|
-
"homepage": "https://package.sbdeveloper.in/docs/ng-absolute-form-validator/14.
|
|
32
|
+
"homepage": "https://package.sbdeveloper.in/docs/ng-absolute-form-validator/14.1",
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
package/public-api.d.ts
CHANGED