@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Inject, EventEmitter, Component, Optional, Input, Output, ContentChild, Directive, NgModule, APP_INITIALIZER } from '@angular/core';
|
|
3
|
-
import { Subject,
|
|
2
|
+
import { InjectionToken, Injectable, Inject, EventEmitter, Component, Optional, Input, Output, ContentChild, Directive, NgModule, Pipe, APP_INITIALIZER } from '@angular/core';
|
|
3
|
+
import { Subject, takeUntil, debounceTime, of, from, distinctUntilChanged, switchMap, first, map as map$1, firstValueFrom } from 'rxjs';
|
|
4
4
|
import * as i1$2 from '@angular/forms';
|
|
5
5
|
import { FormGroupDirective, NgForm, NG_VALIDATORS, NG_ASYNC_VALIDATORS } from '@angular/forms';
|
|
6
6
|
import * as i1 from '@ngx-translate/core';
|
|
@@ -85,11 +85,11 @@ const GlobalConstant = {
|
|
|
85
85
|
{ min: 76, color: '#5cb85c' }
|
|
86
86
|
]
|
|
87
87
|
};
|
|
88
|
+
const I18N_LANG_PREFIX = 'NG_ABSOLUTE_VALIDATOR';
|
|
88
89
|
const CUSTOM_OBJECT_NAME = 'ng_abs';
|
|
89
90
|
const DEFAULT_STRENGTH_COLOR = '#6c757d';
|
|
90
91
|
const DEFAULT_DATE_FORMAT = 'dd-MM-yyyy';
|
|
91
92
|
const DEFAULT_LOCALE_LANG = 'en';
|
|
92
|
-
const SUPPORTED_LOCALE_LANGS = ['ar', 'bn', 'de', 'en', 'es', 'fr', 'hi', 'ja', 'pt', 'ru', 'zh'];
|
|
93
93
|
const DEFAULT_TRIGGER_STATE = ['touched', 'dirty'];
|
|
94
94
|
const EMIT_METHODS = ['credit_card', 'debit_card', 'strength'];
|
|
95
95
|
const CROSS_FIELD_VALIDATORS = [
|
|
@@ -148,17 +148,26 @@ class NgAbsoluteValidatorService {
|
|
|
148
148
|
return this.VLIDATOR_CONFIG.delayLoader || 0;
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
* @description This method state of triger validation
|
|
152
|
+
* @returns boolean
|
|
153
|
+
**/
|
|
154
154
|
get showErrorOn() {
|
|
155
155
|
return (this.VLIDATOR_CONFIG.showErrorOn || DEFAULT_TRIGGER_STATE);
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* @description Display all validation error instande of latest one
|
|
159
|
+
* @returns boolean
|
|
160
|
+
**/
|
|
161
|
+
get showAllErrors() {
|
|
162
|
+
var _a;
|
|
163
|
+
return (_a = this.VLIDATOR_CONFIG.showAllErrors) !== null && _a !== void 0 ? _a : false;
|
|
164
|
+
}
|
|
157
165
|
}
|
|
158
166
|
NgAbsoluteValidatorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgAbsoluteValidatorService, deps: [{ token: LIB_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
159
|
-
NgAbsoluteValidatorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgAbsoluteValidatorService });
|
|
167
|
+
NgAbsoluteValidatorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgAbsoluteValidatorService, providedIn: 'root' });
|
|
160
168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgAbsoluteValidatorService, decorators: [{
|
|
161
|
-
type: Injectable
|
|
169
|
+
type: Injectable,
|
|
170
|
+
args: [{ providedIn: 'root' }]
|
|
162
171
|
}], ctorParameters: function () {
|
|
163
172
|
return [{ type: undefined, decorators: [{
|
|
164
173
|
type: Inject,
|
|
@@ -197,6 +206,8 @@ class NgAbsoluteValidatorComponent {
|
|
|
197
206
|
this.isStrengthBarOn = this.avs.strengthBar;
|
|
198
207
|
this.strength_color = this.avs.strengthColor;
|
|
199
208
|
this.doCheckAndValidate();
|
|
209
|
+
this.translate.onLangChange.pipe(takeUntil(this.destroy$))
|
|
210
|
+
.subscribe(() => this.emitedData(this.formInstance));
|
|
200
211
|
}
|
|
201
212
|
get errorContext() {
|
|
202
213
|
return {
|
|
@@ -315,10 +326,10 @@ class NgAbsoluteValidatorComponent {
|
|
|
315
326
|
}
|
|
316
327
|
}
|
|
317
328
|
NgAbsoluteValidatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgAbsoluteValidatorComponent, deps: [{ token: NgAbsoluteValidatorService }, { token: i1.TranslateService }, { token: FormGroupDirective, optional: true }, { token: NgForm, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
318
|
-
NgAbsoluteValidatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NgAbsoluteValidatorComponent, selector: "ng-absolute-validator", inputs: { formInstance: "formInstance", loader: "loader", message: "message", defaultError: "defaultError", showErrorOn: "showErrorOn" }, outputs: { onValid: "onValid", onValidate: "onValidate" }, queries: [{ propertyName: "absError", first: true, predicate: ["absError"], descendants: true }, { propertyName: "absProgress", first: true, predicate: ["absProgress"], descendants: true }, { propertyName: "absLoader", first: true, predicate: ["absLoader"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"formInstance.pending && isLoaderOn\">\r\n <div class=\"av-loading-panel\">\r\n <ng-template [ngTemplateOutlet]=\"absLoader ?? absFbLoader\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"(formInstance.control?.ng_abs?.strength || formInstance?.ng_abs?.strength ) && isStrengthBarOn && indicatorScore > 0\">\r\n <div class=\"av-progress\">\r\n <ng-template [ngTemplateOutlet]=\"absProgress ?? absFbProgress\" [ngTemplateOutletContext]=\"progressContext\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"isDisplay && defaultError && errorMessage.length > 0\">\r\n <div class=\"av-error-panel\">\r\n <ng-template [ngTemplateOutlet]=\"absError ?? absFbError\"[ngTemplateOutletContext]=\"errorContext\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #absFbLoader>\r\n <div class=\"av-loading\" >\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #absFbProgress>\r\n <div\r\n\t\tclass=\"av-progress-bar\"\r\n\t\trole=\"progressbar\"\r\n\t\taria-valuenow=\"40\"\r\n\t\taria-valuemin=\"0\"\r\n\t\taria-valuemax=\"100\"\r\n\t\t[style.background-color]=\"indicatorColor\"\r\n\t\t[style.width.%]=\"indicatorScore\">\r\n\t</div>\r\n</ng-template>\r\n\r\n<ng-template #absFbError>\r\n <ul class=\"av-errors-list\">\r\n <ng-container *ngFor=\"let error of errorMessage\">\r\n <li [innerText]=\"error\"></li>\r\n </ng-container>\r\n </ul>\r\n</ng-template>\r\n", styles: [".av-progress{display:flex}.av-progress-bar{margin-top:5px;float:left;width:0%;height:3px;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;box-shadow:inset 0 -1px #00000026;transition:width .6s ease}.av-progress-bar.active,.av-progress.active .av-progress-bar{animation:av-progress-bar-stripes 2s linear infinite}.av-progress-bar-striped,.av-progress-striped .av-progress-bar{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.av-progress-bar-success{background-color:#5cb85c}.av-progress-bar-info{background-color:#5bc0de}.av-progress-bar-warning{background-color:#f0ad4e}.av-progress-bar-danger{background-color:#d9534f}.av-errors-list{margin:2px 0 3px;padding:0;list-style-type:none;font-size:.9em;color:#dc3545;line-height:1.6em;opacity:1;transition:all .3s ease-in;-o-transition:all .3s ease-in;-moz-transition:all .3s ease-in;-webkit-transition:all .3s ease-in}@keyframes av-loading{0%{left:32px;transform:scale(0)}25%{left:32px;transform:scale(1)}50%{left:100px}75%{left:168px;transform:scale(1)}to{left:168px;transform:scale(0)}}.av-loading{position:relative;width:100%;height:100%}.av-loading>div{position:absolute;transform:translate(-50%,-50%);width:40px;height:40px}.av-loading div>div{width:40px;height:40px;border-radius:50%;background:#f00;position:absolute;top:100px;left:32px;animation:av-loading .8s cubic-bezier(0,.5,.5,1) infinite forwards}.av-loading div:nth-child(1) div{animation:av-loading-2 .8s cubic-bezier(0,.5,.5,1) infinite forwards;background:#dce4eb}.av-loading div:nth-child(2) div{animation-delay:-.4s;background:#bbcedd}.av-loading div:nth-child(3) div{animation-delay:-.2s;background:#85a2b6}.av-loading div:nth-child(4) div{animation-delay:0s;background:#fdfdfd}.av-loading div:nth-child(5) div{animation:av-loading-3 .8s cubic-bezier(0,.5,.5,1) infinite forwards;background:#dce4eb}.av-loading{width:32px!important;height:32px!important;transform:translate(-16px,-16px) scale(.16) translate(16px,16px)}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
329
|
+
NgAbsoluteValidatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NgAbsoluteValidatorComponent, selector: "ng-absolute-validator", inputs: { formInstance: "formInstance", loader: "loader", message: "message", defaultError: "defaultError", showErrorOn: "showErrorOn" }, outputs: { onValid: "onValid", onValidate: "onValidate" }, queries: [{ propertyName: "absError", first: true, predicate: ["absError"], descendants: true }, { propertyName: "absProgress", first: true, predicate: ["absProgress"], descendants: true }, { propertyName: "absLoader", first: true, predicate: ["absLoader"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"formInstance.pending && isLoaderOn\">\r\n <div class=\"av-loading-panel\">\r\n <ng-template [ngTemplateOutlet]=\"absLoader ?? absFbLoader\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"(formInstance.control?.ng_abs?.strength || formInstance?.ng_abs?.strength ) && isStrengthBarOn && indicatorScore > 0\">\r\n <div class=\"av-progress\">\r\n <ng-template [ngTemplateOutlet]=\"absProgress ?? absFbProgress\" [ngTemplateOutletContext]=\"progressContext\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"isDisplay && defaultError && errorMessage.length > 0\">\r\n <div class=\"av-error-panel\">\r\n <ng-template [ngTemplateOutlet]=\"absError ?? absFbError\"[ngTemplateOutletContext]=\"errorContext\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #absFbLoader>\r\n <div class=\"av-loading\" >\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #absFbProgress>\r\n <div\r\n\t\tclass=\"av-progress-bar\"\r\n\t\trole=\"progressbar\"\r\n\t\taria-valuenow=\"40\"\r\n\t\taria-valuemin=\"0\"\r\n\t\taria-valuemax=\"100\"\r\n\t\t[style.background-color]=\"indicatorColor\"\r\n\t\t[style.width.%]=\"indicatorScore\">\r\n\t</div>\r\n</ng-template>\r\n\r\n<ng-template #absFbError>\r\n <ul class=\"av-errors-list\">\r\n <ng-container *ngFor=\"let error of errorMessage\">\r\n <li [innerText]=\"error.message\"></li>\r\n </ng-container>\r\n </ul>\r\n</ng-template>\r\n", styles: [".av-progress{display:flex}.av-progress-bar{margin-top:5px;float:left;width:0%;height:3px;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;box-shadow:inset 0 -1px #00000026;transition:width .6s ease}.av-progress-bar.active,.av-progress.active .av-progress-bar{animation:av-progress-bar-stripes 2s linear infinite}.av-progress-bar-striped,.av-progress-striped .av-progress-bar{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.av-progress-bar-success{background-color:#5cb85c}.av-progress-bar-info{background-color:#5bc0de}.av-progress-bar-warning{background-color:#f0ad4e}.av-progress-bar-danger{background-color:#d9534f}.av-errors-list{margin:2px 0 3px;padding:0;list-style-type:none;font-size:.9em;color:#dc3545;line-height:1.6em;opacity:1;transition:all .3s ease-in;-o-transition:all .3s ease-in;-moz-transition:all .3s ease-in;-webkit-transition:all .3s ease-in}@keyframes av-loading{0%{left:32px;transform:scale(0)}25%{left:32px;transform:scale(1)}50%{left:100px}75%{left:168px;transform:scale(1)}to{left:168px;transform:scale(0)}}.av-loading{position:relative;width:100%;height:100%}.av-loading>div{position:absolute;transform:translate(-50%,-50%);width:40px;height:40px}.av-loading div>div{width:40px;height:40px;border-radius:50%;background:#f00;position:absolute;top:100px;left:32px;animation:av-loading .8s cubic-bezier(0,.5,.5,1) infinite forwards}.av-loading div:nth-child(1) div{animation:av-loading-2 .8s cubic-bezier(0,.5,.5,1) infinite forwards;background:#dce4eb}.av-loading div:nth-child(2) div{animation-delay:-.4s;background:#bbcedd}.av-loading div:nth-child(3) div{animation-delay:-.2s;background:#85a2b6}.av-loading div:nth-child(4) div{animation-delay:0s;background:#fdfdfd}.av-loading div:nth-child(5) div{animation:av-loading-3 .8s cubic-bezier(0,.5,.5,1) infinite forwards;background:#dce4eb}.av-loading{width:32px!important;height:32px!important;transform:translate(-16px,-16px) scale(.16) translate(16px,16px)}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
319
330
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgAbsoluteValidatorComponent, decorators: [{
|
|
320
331
|
type: Component,
|
|
321
|
-
args: [{ selector: 'ng-absolute-validator', template: "<ng-container *ngIf=\"formInstance.pending && isLoaderOn\">\r\n <div class=\"av-loading-panel\">\r\n <ng-template [ngTemplateOutlet]=\"absLoader ?? absFbLoader\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"(formInstance.control?.ng_abs?.strength || formInstance?.ng_abs?.strength ) && isStrengthBarOn && indicatorScore > 0\">\r\n <div class=\"av-progress\">\r\n <ng-template [ngTemplateOutlet]=\"absProgress ?? absFbProgress\" [ngTemplateOutletContext]=\"progressContext\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"isDisplay && defaultError && errorMessage.length > 0\">\r\n <div class=\"av-error-panel\">\r\n <ng-template [ngTemplateOutlet]=\"absError ?? absFbError\"[ngTemplateOutletContext]=\"errorContext\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #absFbLoader>\r\n <div class=\"av-loading\" >\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #absFbProgress>\r\n <div\r\n\t\tclass=\"av-progress-bar\"\r\n\t\trole=\"progressbar\"\r\n\t\taria-valuenow=\"40\"\r\n\t\taria-valuemin=\"0\"\r\n\t\taria-valuemax=\"100\"\r\n\t\t[style.background-color]=\"indicatorColor\"\r\n\t\t[style.width.%]=\"indicatorScore\">\r\n\t</div>\r\n</ng-template>\r\n\r\n<ng-template #absFbError>\r\n <ul class=\"av-errors-list\">\r\n <ng-container *ngFor=\"let error of errorMessage\">\r\n <li [innerText]=\"error\"></li>\r\n </ng-container>\r\n </ul>\r\n</ng-template>\r\n", styles: [".av-progress{display:flex}.av-progress-bar{margin-top:5px;float:left;width:0%;height:3px;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;box-shadow:inset 0 -1px #00000026;transition:width .6s ease}.av-progress-bar.active,.av-progress.active .av-progress-bar{animation:av-progress-bar-stripes 2s linear infinite}.av-progress-bar-striped,.av-progress-striped .av-progress-bar{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.av-progress-bar-success{background-color:#5cb85c}.av-progress-bar-info{background-color:#5bc0de}.av-progress-bar-warning{background-color:#f0ad4e}.av-progress-bar-danger{background-color:#d9534f}.av-errors-list{margin:2px 0 3px;padding:0;list-style-type:none;font-size:.9em;color:#dc3545;line-height:1.6em;opacity:1;transition:all .3s ease-in;-o-transition:all .3s ease-in;-moz-transition:all .3s ease-in;-webkit-transition:all .3s ease-in}@keyframes av-loading{0%{left:32px;transform:scale(0)}25%{left:32px;transform:scale(1)}50%{left:100px}75%{left:168px;transform:scale(1)}to{left:168px;transform:scale(0)}}.av-loading{position:relative;width:100%;height:100%}.av-loading>div{position:absolute;transform:translate(-50%,-50%);width:40px;height:40px}.av-loading div>div{width:40px;height:40px;border-radius:50%;background:#f00;position:absolute;top:100px;left:32px;animation:av-loading .8s cubic-bezier(0,.5,.5,1) infinite forwards}.av-loading div:nth-child(1) div{animation:av-loading-2 .8s cubic-bezier(0,.5,.5,1) infinite forwards;background:#dce4eb}.av-loading div:nth-child(2) div{animation-delay:-.4s;background:#bbcedd}.av-loading div:nth-child(3) div{animation-delay:-.2s;background:#85a2b6}.av-loading div:nth-child(4) div{animation-delay:0s;background:#fdfdfd}.av-loading div:nth-child(5) div{animation:av-loading-3 .8s cubic-bezier(0,.5,.5,1) infinite forwards;background:#dce4eb}.av-loading{width:32px!important;height:32px!important;transform:translate(-16px,-16px) scale(.16) translate(16px,16px)}\n"] }]
|
|
332
|
+
args: [{ selector: 'ng-absolute-validator', template: "<ng-container *ngIf=\"formInstance.pending && isLoaderOn\">\r\n <div class=\"av-loading-panel\">\r\n <ng-template [ngTemplateOutlet]=\"absLoader ?? absFbLoader\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"(formInstance.control?.ng_abs?.strength || formInstance?.ng_abs?.strength ) && isStrengthBarOn && indicatorScore > 0\">\r\n <div class=\"av-progress\">\r\n <ng-template [ngTemplateOutlet]=\"absProgress ?? absFbProgress\" [ngTemplateOutletContext]=\"progressContext\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"isDisplay && defaultError && errorMessage.length > 0\">\r\n <div class=\"av-error-panel\">\r\n <ng-template [ngTemplateOutlet]=\"absError ?? absFbError\"[ngTemplateOutletContext]=\"errorContext\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #absFbLoader>\r\n <div class=\"av-loading\" >\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n <div><div></div></div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #absFbProgress>\r\n <div\r\n\t\tclass=\"av-progress-bar\"\r\n\t\trole=\"progressbar\"\r\n\t\taria-valuenow=\"40\"\r\n\t\taria-valuemin=\"0\"\r\n\t\taria-valuemax=\"100\"\r\n\t\t[style.background-color]=\"indicatorColor\"\r\n\t\t[style.width.%]=\"indicatorScore\">\r\n\t</div>\r\n</ng-template>\r\n\r\n<ng-template #absFbError>\r\n <ul class=\"av-errors-list\">\r\n <ng-container *ngFor=\"let error of errorMessage\">\r\n <li [innerText]=\"error.message\"></li>\r\n </ng-container>\r\n </ul>\r\n</ng-template>\r\n", styles: [".av-progress{display:flex}.av-progress-bar{margin-top:5px;float:left;width:0%;height:3px;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;box-shadow:inset 0 -1px #00000026;transition:width .6s ease}.av-progress-bar.active,.av-progress.active .av-progress-bar{animation:av-progress-bar-stripes 2s linear infinite}.av-progress-bar-striped,.av-progress-striped .av-progress-bar{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.av-progress-bar-success{background-color:#5cb85c}.av-progress-bar-info{background-color:#5bc0de}.av-progress-bar-warning{background-color:#f0ad4e}.av-progress-bar-danger{background-color:#d9534f}.av-errors-list{margin:2px 0 3px;padding:0;list-style-type:none;font-size:.9em;color:#dc3545;line-height:1.6em;opacity:1;transition:all .3s ease-in;-o-transition:all .3s ease-in;-moz-transition:all .3s ease-in;-webkit-transition:all .3s ease-in}@keyframes av-loading{0%{left:32px;transform:scale(0)}25%{left:32px;transform:scale(1)}50%{left:100px}75%{left:168px;transform:scale(1)}to{left:168px;transform:scale(0)}}.av-loading{position:relative;width:100%;height:100%}.av-loading>div{position:absolute;transform:translate(-50%,-50%);width:40px;height:40px}.av-loading div>div{width:40px;height:40px;border-radius:50%;background:#f00;position:absolute;top:100px;left:32px;animation:av-loading .8s cubic-bezier(0,.5,.5,1) infinite forwards}.av-loading div:nth-child(1) div{animation:av-loading-2 .8s cubic-bezier(0,.5,.5,1) infinite forwards;background:#dce4eb}.av-loading div:nth-child(2) div{animation-delay:-.4s;background:#bbcedd}.av-loading div:nth-child(3) div{animation-delay:-.2s;background:#85a2b6}.av-loading div:nth-child(4) div{animation-delay:0s;background:#fdfdfd}.av-loading div:nth-child(5) div{animation:av-loading-3 .8s cubic-bezier(0,.5,.5,1) infinite forwards;background:#dce4eb}.av-loading{width:32px!important;height:32px!important;transform:translate(-16px,-16px) scale(.16) translate(16px,16px)}\n"] }]
|
|
322
333
|
}], ctorParameters: function () {
|
|
323
334
|
return [{ type: NgAbsoluteValidatorService }, { type: i1.TranslateService }, { type: undefined, decorators: [{
|
|
324
335
|
type: Optional
|
|
@@ -403,48 +414,55 @@ function toCharClass(chars) {
|
|
|
403
414
|
}
|
|
404
415
|
function cloneDeep(data) {
|
|
405
416
|
return JSON.parse(JSON.stringify(data));
|
|
417
|
+
}
|
|
418
|
+
function formatMessage(template, data) {
|
|
419
|
+
const { attr, args } = data;
|
|
420
|
+
return template.replace(/:attribute|:arg(\d+)(:)?/g, (match, index, multi) => {
|
|
421
|
+
if (index === undefined)
|
|
422
|
+
return attr; // matched ":attribute"
|
|
423
|
+
const i = Number(index);
|
|
424
|
+
if (i >= args.length)
|
|
425
|
+
return match; // no such arg, leave placeholder as-is
|
|
426
|
+
return multi ? args.slice(i).join(',') : args[i];
|
|
427
|
+
});
|
|
406
428
|
}
|
|
407
429
|
|
|
408
430
|
class MessageBuilderService {
|
|
409
|
-
constructor(
|
|
410
|
-
this.
|
|
431
|
+
constructor(translate) {
|
|
432
|
+
this.translate = translate;
|
|
411
433
|
}
|
|
412
434
|
call(langAttr, attribute, ...args) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
|
|
435
|
+
const [lastElement] = args.slice(-1);
|
|
436
|
+
const inputArgs = args.filter((arg) => typeof arg !== 'object');
|
|
437
|
+
const i18nKey = `${I18N_LANG_PREFIX}.${langAttr}`;
|
|
438
|
+
const translate = this.translate;
|
|
439
|
+
if (typeof lastElement === 'object' && Object.keys(lastElement).length > 0) {
|
|
440
|
+
this.injectToTranslation(langAttr, lastElement);
|
|
441
|
+
this.translate.onLangChange.subscribe(() => this.injectToTranslation(langAttr, lastElement));
|
|
419
442
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
args.forEach((v, index) => {
|
|
430
|
-
let replaceWithOne = `:arg${index}`;
|
|
431
|
-
let replaceWithMulti = `:arg${index}:`;
|
|
432
|
-
if (message.includes(replaceWithMulti)) {
|
|
433
|
-
args = args.splice(index);
|
|
434
|
-
let argString = toArray(args) ? toArray(args).join(',') : args;
|
|
435
|
-
message = message.replace(replaceWithMulti, argString);
|
|
436
|
-
}
|
|
437
|
-
if (message.includes(replaceWithOne)) {
|
|
438
|
-
message = message.replace(replaceWithOne, v);
|
|
443
|
+
return {
|
|
444
|
+
args: inputArgs,
|
|
445
|
+
attr: attribute,
|
|
446
|
+
i18nKey: i18nKey,
|
|
447
|
+
get lang() {
|
|
448
|
+
return translate.currentLang;
|
|
449
|
+
},
|
|
450
|
+
get message() {
|
|
451
|
+
return formatMessage(translate.instant(i18nKey), { attr: attribute, args: inputArgs });
|
|
439
452
|
}
|
|
440
|
-
}
|
|
441
|
-
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
injectToTranslation(langAttr, translation = {}) {
|
|
456
|
+
for (let lang of Object.keys(translation)) {
|
|
457
|
+
this.translate.setTranslation(lang, { [I18N_LANG_PREFIX]: { [langAttr]: translation[lang] } }, true);
|
|
458
|
+
}
|
|
442
459
|
}
|
|
443
460
|
}
|
|
444
461
|
MessageBuilderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageBuilderService, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
445
|
-
MessageBuilderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageBuilderService });
|
|
462
|
+
MessageBuilderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageBuilderService, providedIn: 'root' });
|
|
446
463
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageBuilderService, decorators: [{
|
|
447
|
-
type: Injectable
|
|
464
|
+
type: Injectable,
|
|
465
|
+
args: [{ providedIn: 'root' }]
|
|
448
466
|
}], ctorParameters: function () { return [{ type: i1.TranslateService }]; } });
|
|
449
467
|
|
|
450
468
|
class HttpRequestService {
|
|
@@ -459,9 +477,10 @@ class HttpRequestService {
|
|
|
459
477
|
}
|
|
460
478
|
}
|
|
461
479
|
HttpRequestService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpRequestService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
462
|
-
HttpRequestService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpRequestService });
|
|
480
|
+
HttpRequestService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpRequestService, providedIn: 'root' });
|
|
463
481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpRequestService, decorators: [{
|
|
464
|
-
type: Injectable
|
|
482
|
+
type: Injectable,
|
|
483
|
+
args: [{ providedIn: 'root' }]
|
|
465
484
|
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
466
485
|
|
|
467
486
|
class UtilService {
|
|
@@ -926,19 +945,21 @@ class UtilService {
|
|
|
926
945
|
}
|
|
927
946
|
}
|
|
928
947
|
UtilService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UtilService, deps: [{ token: HttpRequestService }, { token: NgAbsoluteValidatorService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
929
|
-
UtilService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UtilService });
|
|
948
|
+
UtilService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UtilService, providedIn: 'root' });
|
|
930
949
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UtilService, decorators: [{
|
|
931
|
-
type: Injectable
|
|
950
|
+
type: Injectable,
|
|
951
|
+
args: [{ providedIn: 'root' }]
|
|
932
952
|
}], ctorParameters: function () { return [{ type: HttpRequestService }, { type: NgAbsoluteValidatorService }]; } });
|
|
933
953
|
|
|
934
954
|
class ValidateRuleService {
|
|
935
|
-
constructor(mb, utl) {
|
|
955
|
+
constructor(mb, abs, utl) {
|
|
936
956
|
this.mb = mb;
|
|
957
|
+
this.abs = abs;
|
|
937
958
|
this.utl = utl;
|
|
938
959
|
this.subMessageMethod = ['max', 'min'];
|
|
939
960
|
this.wiredRulesMap = new WeakMap();
|
|
940
961
|
}
|
|
941
|
-
gererateRuleAndValidate(fieldName, control, rule,
|
|
962
|
+
gererateRuleAndValidate(fieldName, control, rule, customMessage) {
|
|
942
963
|
let messages = {};
|
|
943
964
|
let generateRules = toArray(rule, '|');
|
|
944
965
|
let activeRules = generateRules.map(v => v.includes(':') ? v.split(':')[0] : v);
|
|
@@ -980,8 +1001,10 @@ class ValidateRuleService {
|
|
|
980
1001
|
}
|
|
981
1002
|
this.utl.setValidationRules(control, activeRules, emitData);
|
|
982
1003
|
if (!isValid) {
|
|
983
|
-
messages[messageKey] = this.mb.call(messageKey, fieldName, ...mulArg,
|
|
984
|
-
|
|
1004
|
+
messages[messageKey] = this.mb.call(messageKey, fieldName, ...mulArg, customMessage);
|
|
1005
|
+
if (!this.abs.showAllErrors) {
|
|
1006
|
+
break;
|
|
1007
|
+
}
|
|
985
1008
|
}
|
|
986
1009
|
}
|
|
987
1010
|
if (Object.keys(messages).length > 0) {
|
|
@@ -1021,11 +1044,21 @@ class ValidateRuleService {
|
|
|
1021
1044
|
}
|
|
1022
1045
|
}
|
|
1023
1046
|
}
|
|
1024
|
-
ValidateRuleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidateRuleService, deps: [{ token: MessageBuilderService }, { token: UtilService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1025
|
-
ValidateRuleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidateRuleService });
|
|
1047
|
+
ValidateRuleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidateRuleService, deps: [{ token: MessageBuilderService }, { token: NgAbsoluteValidatorService }, { token: UtilService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1048
|
+
ValidateRuleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidateRuleService, providedIn: 'root' });
|
|
1026
1049
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidateRuleService, decorators: [{
|
|
1027
|
-
type: Injectable
|
|
1028
|
-
|
|
1050
|
+
type: Injectable,
|
|
1051
|
+
args: [{ providedIn: 'root' }]
|
|
1052
|
+
}], ctorParameters: function () { return [{ type: MessageBuilderService }, { type: NgAbsoluteValidatorService }, { type: UtilService }]; } });
|
|
1053
|
+
|
|
1054
|
+
const warnedRules = new Set();
|
|
1055
|
+
function warnDeprecatedRule(ruleName, replacement, reason) {
|
|
1056
|
+
if (warnedRules.has(ruleName))
|
|
1057
|
+
return;
|
|
1058
|
+
warnedRules.add(ruleName);
|
|
1059
|
+
const reasonText = reason ? ` (${reason})` : '';
|
|
1060
|
+
console.warn(`[ng-absolute-validator] The "${ruleName}" rule is deprecated and will be removed in a future version. Use "${replacement}" instead${reasonText}.`);
|
|
1061
|
+
}
|
|
1029
1062
|
|
|
1030
1063
|
class Rule {
|
|
1031
1064
|
constructor(ruleValidate, el) {
|
|
@@ -1035,6 +1068,13 @@ class Rule {
|
|
|
1035
1068
|
this.fieldName = 'field';
|
|
1036
1069
|
this.fieldName = this.el.nativeElement.name;
|
|
1037
1070
|
}
|
|
1071
|
+
/**
|
|
1072
|
+
* @deprecated Use `rule` (lowercase) instead. Will be removed in 16.0.0.
|
|
1073
|
+
**/
|
|
1074
|
+
set legacyRule(value) {
|
|
1075
|
+
warnDeprecatedRule('rule-capital-r', '[Rule] (capital R) is deprecated and will be removed in 16.0.0. Use [rule] instead.');
|
|
1076
|
+
this.rule = value;
|
|
1077
|
+
}
|
|
1038
1078
|
set message(data) {
|
|
1039
1079
|
this.vmessage = data;
|
|
1040
1080
|
}
|
|
@@ -1043,14 +1083,17 @@ class Rule {
|
|
|
1043
1083
|
}
|
|
1044
1084
|
}
|
|
1045
1085
|
Rule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Rule, deps: [{ token: ValidateRuleService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1046
|
-
Rule.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: Rule, selector: "[
|
|
1086
|
+
Rule.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: Rule, selector: "[rule],[Rule]", inputs: { rule: "rule", legacyRule: ["Rule", "legacyRule"], message: "message" }, providers: [{ provide: NG_VALIDATORS, useExisting: Rule, multi: true }], ngImport: i0 });
|
|
1047
1087
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Rule, decorators: [{
|
|
1048
1088
|
type: Directive,
|
|
1049
1089
|
args: [{
|
|
1050
|
-
selector: '[
|
|
1090
|
+
selector: '[rule],[Rule]',
|
|
1051
1091
|
providers: [{ provide: NG_VALIDATORS, useExisting: Rule, multi: true }]
|
|
1052
1092
|
}]
|
|
1053
1093
|
}], ctorParameters: function () { return [{ type: ValidateRuleService }, { type: i0.ElementRef }]; }, propDecorators: { rule: [{
|
|
1094
|
+
type: Input,
|
|
1095
|
+
args: ['rule']
|
|
1096
|
+
}], legacyRule: [{
|
|
1054
1097
|
type: Input,
|
|
1055
1098
|
args: ['Rule']
|
|
1056
1099
|
}], message: [{
|
|
@@ -3578,9 +3621,10 @@ class ReactiveValidator {
|
|
|
3578
3621
|
}
|
|
3579
3622
|
}
|
|
3580
3623
|
ReactiveValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ReactiveValidator, deps: [{ token: ValidateRuleService }, { token: UtilService }, { token: MessageBuilderService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3581
|
-
ReactiveValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ReactiveValidator });
|
|
3624
|
+
ReactiveValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ReactiveValidator, providedIn: 'root' });
|
|
3582
3625
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ReactiveValidator, decorators: [{
|
|
3583
|
-
type: Injectable
|
|
3626
|
+
type: Injectable,
|
|
3627
|
+
args: [{ providedIn: 'root' }]
|
|
3584
3628
|
}], ctorParameters: function () { return [{ type: ValidateRuleService }, { type: UtilService }, { type: MessageBuilderService }]; } });
|
|
3585
3629
|
|
|
3586
3630
|
class NativeElementDirective {
|
|
@@ -3613,6 +3657,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
3613
3657
|
args: ['formControlName']
|
|
3614
3658
|
}] } });
|
|
3615
3659
|
|
|
3660
|
+
var ar = {
|
|
3661
|
+
above: 'يجب أن يكون :attribute أعلى من :arg0.',
|
|
3662
|
+
accepted: 'يجب قبول :attribute.',
|
|
3663
|
+
after: 'يجب أن يكون :attribute تاريخًا بعد :arg0.',
|
|
3664
|
+
alpha: 'يجب أن يحتوي :attribute على أحرف فقط.',
|
|
3665
|
+
alpha_dash: 'يجب أن يحتوي :attribute على أحرف وأرقام وشرطات وشرطات سفلية فقط.',
|
|
3666
|
+
alpha_numeric: 'يجب أن يحتوي :attribute على أحرف وأرقام فقط.',
|
|
3667
|
+
array: 'يجب أن يكون :attribute مصفوفة.',
|
|
3668
|
+
before: 'يجب أن يكون :attribute تاريخًا قبل :arg0.',
|
|
3669
|
+
boolean: 'يجب أن يكون حقل :attribute صحيحًا أو خاطئًا (true أو false).',
|
|
3670
|
+
confirmed: 'تأكيد :attribute غير مطابق.',
|
|
3671
|
+
credit_card: 'يجب أن يكون :attribute رقم بطاقة ائتمان صالحًا.',
|
|
3672
|
+
cvv: 'يجب أن يكون :attribute رقم CVV صالحًا.',
|
|
3673
|
+
date: ':attribute ليس تاريخًا صالحًا.',
|
|
3674
|
+
date_format: ':attribute لا يطابق الصيغة :arg0.',
|
|
3675
|
+
debit_card: 'يجب أن يكون :attribute رقم بطاقة خصم صالحًا.',
|
|
3676
|
+
different: 'يجب أن يكون :attribute و :arg0 مختلفين.',
|
|
3677
|
+
dimension: 'أبعاد صورة :attribute غير صالحة.',
|
|
3678
|
+
email: 'يجب أن يكون :attribute عنوان بريد إلكتروني صالحًا.',
|
|
3679
|
+
ends_with: 'يجب أن ينتهي :attribute بأحد القيم التالية: :arg0',
|
|
3680
|
+
equals: 'يجب أن يساوي :attribute القيمة :arg0',
|
|
3681
|
+
exists: ':attribute المحدد غير صالح.',
|
|
3682
|
+
image: 'يجب أن يكون :attribute صورة صالحة.',
|
|
3683
|
+
in: 'يجب أن يكون :attribute المحدد ضمن :arg0.',
|
|
3684
|
+
includes: 'يجب أن يحتوي :attribute على :arg0.',
|
|
3685
|
+
integer: 'يجب أن يكون :attribute عددًا صحيحًا.',
|
|
3686
|
+
ip: 'يجب أن يكون :attribute عنوان IP صالحًا.',
|
|
3687
|
+
ipv4: 'يجب أن يكون :attribute عنوان IPv4 صالحًا.',
|
|
3688
|
+
ipv6: 'يجب أن يكون :attribute عنوان IPv6 صالحًا.',
|
|
3689
|
+
json: 'يجب أن يكون :attribute نص JSON صالحًا.',
|
|
3690
|
+
max: {
|
|
3691
|
+
array: 'لا يجوز أن يحتوي :attribute على أكثر من :arg0 عنصرًا.',
|
|
3692
|
+
numeric: 'يجب ألا يكون :attribute أكبر من :arg0.',
|
|
3693
|
+
string: 'يجب ألا يتجاوز :attribute :arg0 حرفًا.'
|
|
3694
|
+
},
|
|
3695
|
+
min: {
|
|
3696
|
+
array: 'يجب أن يحتوي :attribute على :arg0 عناصر على الأقل.',
|
|
3697
|
+
numeric: 'يجب أن يكون :attribute :arg0 على الأقل.',
|
|
3698
|
+
string: 'يجب أن يحتوي :attribute على :arg0 أحرف على الأقل.'
|
|
3699
|
+
},
|
|
3700
|
+
mimes: 'يجب أن يكون :attribute ملفًا من نوع :arg0.',
|
|
3701
|
+
not_equals: 'يجب ألا يساوي :attribute القيمة :arg0',
|
|
3702
|
+
not_in: 'يجب ألا يكون :attribute المحدد ضمن :arg0.',
|
|
3703
|
+
not_regex: 'صيغة :attribute غير صالحة.',
|
|
3704
|
+
number: 'يجب أن يكون :attribute رقمًا.',
|
|
3705
|
+
phone_no: 'يجب أن يكون :attribute رقم هاتف صالحًا.',
|
|
3706
|
+
range: 'يجب أن يكون :attribute بين :arg0 و :arg1.',
|
|
3707
|
+
between: 'يجب أن يكون :attribute بين :arg0 و :arg1، دون تضمين الحدين.',
|
|
3708
|
+
regex: 'صيغة :attribute غير صالحة.',
|
|
3709
|
+
required: 'حقل :attribute مطلوب.',
|
|
3710
|
+
required_if: 'حقل :attribute مطلوب عندما يكون :arg0 هو :arg1.',
|
|
3711
|
+
required_unless: 'حقل :attribute مطلوب ما لم يكن :arg0 ضمن :arg1.',
|
|
3712
|
+
required_with: 'حقل :attribute مطلوب عند وجود أي من :arg0.',
|
|
3713
|
+
required_with_all: 'حقل :attribute مطلوب عند وجود :arg0.',
|
|
3714
|
+
required_without: 'حقل :attribute مطلوب عند عدم وجود :arg0.',
|
|
3715
|
+
required_without_all: 'حقل :attribute مطلوب عند عدم وجود أي من :arg0.',
|
|
3716
|
+
same: 'يجب أن يتطابق :attribute و :arg0.',
|
|
3717
|
+
size: 'يجب ألا يتجاوز :attribute :arg0 كيلوبايت.',
|
|
3718
|
+
starts_with: 'يجب أن يبدأ :attribute بأحد القيم التالية: :arg0',
|
|
3719
|
+
string: 'يجب أن يكون :attribute نصًا (string).',
|
|
3720
|
+
strength: ':attribute ليس قويًا بما فيه الكفاية.',
|
|
3721
|
+
under: 'يجب أن يكون :attribute أقل من :arg0.',
|
|
3722
|
+
url: 'صيغة :attribute غير صالحة.',
|
|
3723
|
+
uuid: 'يجب أن يكون :attribute UUID صالحًا.',
|
|
3724
|
+
unique: ':attribute مُستخدم بالفعل.',
|
|
3725
|
+
video: 'يجب أن يكون :attribute فيديو صالحًا.',
|
|
3726
|
+
};
|
|
3727
|
+
|
|
3616
3728
|
var en = {
|
|
3617
3729
|
"above": "The :attribute should be above :arg0.",
|
|
3618
3730
|
"accepted": "The :attribute must be accepted.",
|
|
@@ -4293,23 +4405,59 @@ var ru = {
|
|
|
4293
4405
|
video: 'Поле :attribute должно быть действительным видео.',
|
|
4294
4406
|
};
|
|
4295
4407
|
|
|
4296
|
-
const BUILT_IN_TRANSLATIONS = {
|
|
4408
|
+
const BUILT_IN_TRANSLATIONS = {
|
|
4409
|
+
ar: { [I18N_LANG_PREFIX]: ar },
|
|
4410
|
+
en: { [I18N_LANG_PREFIX]: en },
|
|
4411
|
+
de: { [I18N_LANG_PREFIX]: de },
|
|
4412
|
+
es: { [I18N_LANG_PREFIX]: es },
|
|
4413
|
+
fr: { [I18N_LANG_PREFIX]: fr },
|
|
4414
|
+
hi: { [I18N_LANG_PREFIX]: hi },
|
|
4415
|
+
bn: { [I18N_LANG_PREFIX]: bn },
|
|
4416
|
+
pt: { [I18N_LANG_PREFIX]: pt },
|
|
4417
|
+
ja: { [I18N_LANG_PREFIX]: ja },
|
|
4418
|
+
zh: { [I18N_LANG_PREFIX]: zh },
|
|
4419
|
+
ru: { [I18N_LANG_PREFIX]: ru }
|
|
4420
|
+
};
|
|
4421
|
+
|
|
4422
|
+
function TranslateLoaderFactory(config) {
|
|
4423
|
+
return new InlineTranslateLoader(config === null || config === void 0 ? void 0 : config.translations);
|
|
4424
|
+
}
|
|
4425
|
+
function appInitializerFactory(translate, config, activeLoader) {
|
|
4426
|
+
return () => {
|
|
4427
|
+
const languages = Object.keys(BUILT_IN_TRANSLATIONS);
|
|
4428
|
+
const browserLang = translate.getBrowserLang();
|
|
4429
|
+
const langToUse = browserLang && languages.includes(browserLang)
|
|
4430
|
+
? browserLang
|
|
4431
|
+
: ((config === null || config === void 0 ? void 0 : config.defaultLanguage) || DEFAULT_LOCALE_LANG);
|
|
4432
|
+
const consumerHasOwnLoader = !(activeLoader instanceof InlineTranslateLoader);
|
|
4433
|
+
if (consumerHasOwnLoader) {
|
|
4434
|
+
const loader = new InlineTranslateLoader(config === null || config === void 0 ? void 0 : config.translations);
|
|
4435
|
+
const translations = loader.translations;
|
|
4436
|
+
translate.onLangChange.subscribe(event => {
|
|
4437
|
+
if (translations[event.lang]) {
|
|
4438
|
+
translate.setTranslation(event.lang, translations[event.lang], true);
|
|
4439
|
+
}
|
|
4440
|
+
});
|
|
4441
|
+
}
|
|
4442
|
+
return firstValueFrom(translate.use(langToUse));
|
|
4443
|
+
};
|
|
4444
|
+
}
|
|
4297
4445
|
class InlineTranslateLoader {
|
|
4298
|
-
constructor(
|
|
4299
|
-
this.mergeTranslations = mergeTranslations;
|
|
4446
|
+
constructor(replaceTranslations = {}) {
|
|
4300
4447
|
this.replaceTranslations = replaceTranslations;
|
|
4301
4448
|
this.translations = {};
|
|
4302
4449
|
this.init();
|
|
4303
4450
|
}
|
|
4304
4451
|
init() {
|
|
4305
4452
|
this.translations = Object.assign({}, BUILT_IN_TRANSLATIONS);
|
|
4306
|
-
// Full replace happens first — wipes out all existing keys for that lang
|
|
4307
4453
|
for (const lang of Object.keys(this.replaceTranslations)) {
|
|
4308
|
-
this.translations[lang]
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4454
|
+
if (this.translations[lang]) {
|
|
4455
|
+
const translation = Object.assign(this.translations[lang][I18N_LANG_PREFIX], this.replaceTranslations[lang]);
|
|
4456
|
+
this.translations[lang] = { [I18N_LANG_PREFIX]: translation };
|
|
4457
|
+
}
|
|
4458
|
+
else {
|
|
4459
|
+
this.translations[lang] = { [I18N_LANG_PREFIX]: this.replaceTranslations[lang] };
|
|
4460
|
+
}
|
|
4313
4461
|
}
|
|
4314
4462
|
}
|
|
4315
4463
|
getTranslation(lang) {
|
|
@@ -4318,21 +4466,20 @@ class InlineTranslateLoader {
|
|
|
4318
4466
|
}
|
|
4319
4467
|
}
|
|
4320
4468
|
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
}
|
|
4324
|
-
|
|
4325
|
-
return () => {
|
|
4326
|
-
var _a;
|
|
4327
|
-
const builtIn = SUPPORTED_LOCALE_LANGS;
|
|
4328
|
-
const supported = ((_a = config === null || config === void 0 ? void 0 : config.supportedLanguages) === null || _a === void 0 ? void 0 : _a.length) ? config.supportedLanguages : builtIn;
|
|
4329
|
-
const browserLang = translate.getBrowserLang();
|
|
4330
|
-
const langToUse = browserLang && supported.includes(browserLang)
|
|
4331
|
-
? browserLang
|
|
4332
|
-
: ((config === null || config === void 0 ? void 0 : config.defaultLanguage) || DEFAULT_LOCALE_LANG);
|
|
4333
|
-
return firstValueFrom(translate.use(langToUse));
|
|
4334
|
-
};
|
|
4469
|
+
class ReplaceWithPipe {
|
|
4470
|
+
transform(value, data) {
|
|
4471
|
+
return formatMessage(value, { attr: data.attr, args: data.args });
|
|
4472
|
+
}
|
|
4335
4473
|
}
|
|
4474
|
+
ReplaceWithPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ReplaceWithPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4475
|
+
ReplaceWithPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ReplaceWithPipe, name: "replaceWith" });
|
|
4476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ReplaceWithPipe, decorators: [{
|
|
4477
|
+
type: Pipe,
|
|
4478
|
+
args: [{
|
|
4479
|
+
name: 'replaceWith'
|
|
4480
|
+
}]
|
|
4481
|
+
}] });
|
|
4482
|
+
|
|
4336
4483
|
class NgAbsoluteValidatorModule {
|
|
4337
4484
|
static forRoot(config = {}) {
|
|
4338
4485
|
return {
|
|
@@ -4348,7 +4495,8 @@ class NgAbsoluteValidatorModule {
|
|
|
4348
4495
|
NgAbsoluteValidatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgAbsoluteValidatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4349
4496
|
NgAbsoluteValidatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: NgAbsoluteValidatorModule, declarations: [NgAbsoluteValidatorComponent,
|
|
4350
4497
|
NativeElementDirective,
|
|
4351
|
-
ErrorTriggerOn
|
|
4498
|
+
ErrorTriggerOn,
|
|
4499
|
+
ReplaceWithPipe], imports: [CommonModule,
|
|
4352
4500
|
RuleModule,
|
|
4353
4501
|
HttpClientModule, i1.TranslateModule], exports: [RuleModule,
|
|
4354
4502
|
NgAbsoluteValidatorComponent,
|
|
@@ -4365,7 +4513,7 @@ NgAbsoluteValidatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0
|
|
|
4365
4513
|
{
|
|
4366
4514
|
provide: APP_INITIALIZER,
|
|
4367
4515
|
useFactory: appInitializerFactory,
|
|
4368
|
-
deps: [TranslateService, LIB_CONFIG],
|
|
4516
|
+
deps: [TranslateService, LIB_CONFIG, TranslateLoader],
|
|
4369
4517
|
multi: true
|
|
4370
4518
|
}
|
|
4371
4519
|
], imports: [CommonModule,
|
|
@@ -4386,7 +4534,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4386
4534
|
declarations: [
|
|
4387
4535
|
NgAbsoluteValidatorComponent,
|
|
4388
4536
|
NativeElementDirective,
|
|
4389
|
-
ErrorTriggerOn
|
|
4537
|
+
ErrorTriggerOn,
|
|
4538
|
+
ReplaceWithPipe
|
|
4390
4539
|
],
|
|
4391
4540
|
imports: [
|
|
4392
4541
|
CommonModule,
|
|
@@ -4412,7 +4561,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4412
4561
|
{
|
|
4413
4562
|
provide: APP_INITIALIZER,
|
|
4414
4563
|
useFactory: appInitializerFactory,
|
|
4415
|
-
deps: [TranslateService, LIB_CONFIG],
|
|
4564
|
+
deps: [TranslateService, LIB_CONFIG, TranslateLoader],
|
|
4416
4565
|
multi: true
|
|
4417
4566
|
}
|
|
4418
4567
|
],
|
|
@@ -4425,20 +4574,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4425
4574
|
}]
|
|
4426
4575
|
}] });
|
|
4427
4576
|
|
|
4428
|
-
const LOCALE_LANG_LABELS = {
|
|
4429
|
-
en: 'English',
|
|
4430
|
-
es: 'Español',
|
|
4431
|
-
fr: 'Français',
|
|
4432
|
-
de: 'Deutsch',
|
|
4433
|
-
hi: 'हिन्दी',
|
|
4434
|
-
bn: 'বাংলা',
|
|
4435
|
-
pt: 'Português',
|
|
4436
|
-
ar: 'العربية',
|
|
4437
|
-
ja: '日本語',
|
|
4438
|
-
zh: '中文',
|
|
4439
|
-
ru: 'Русский',
|
|
4440
|
-
};
|
|
4441
|
-
|
|
4442
4577
|
/*
|
|
4443
4578
|
* Public API Surface of ng-absolute-validator
|
|
4444
4579
|
*/
|
|
@@ -4447,5 +4582,5 @@ const LOCALE_LANG_LABELS = {
|
|
|
4447
4582
|
* Generated bundle index. Do not edit.
|
|
4448
4583
|
*/
|
|
4449
4584
|
|
|
4450
|
-
export { Above, Accepted, After, Alpha, AlphaDash, AlphaNumeric, Array$1 as Array, Before, Between, Boolean$1 as Boolean, Confirmed, CreditCard, Cvv, Date$1 as Date, DateFormat, DebitCard, Different, Dimension, Email, EndsWith, Equals, ErrorTriggerOn, Exists, Image$1 as Image, In, Includes, Integer, Ip, Ipv4, Ipv6, Json,
|
|
4585
|
+
export { Above, Accepted, After, Alpha, AlphaDash, AlphaNumeric, Array$1 as Array, Before, Between, Boolean$1 as Boolean, Confirmed, CreditCard, Cvv, Date$1 as Date, DateFormat, DebitCard, Different, Dimension, Email, EndsWith, Equals, ErrorTriggerOn, Exists, Image$1 as Image, In, Includes, Integer, Ip, Ipv4, Ipv6, Json, Max, Mimes, Min, NativeElementDirective, NgAbsoluteValidatorComponent, NgAbsoluteValidatorModule, NgAbsoluteValidatorService, NotEquals, NotIn, NotRegex, Number$1 as Number, PhoneNo, Range, ReactiveValidator, Regex, Required, RequiredIf, RequiredUnless, RequiredWith, RequiredWithAll, RequiredWithout, RequiredWithoutAll, Rule, RuleModule, Same, Size, StartsWith, Strength, String, Under, Unique, Url, Uuid, Video };
|
|
4451
4586
|
//# sourceMappingURL=sbcore-ng-absolute-validator.mjs.map
|