ng-ipa-library 0.7.5 → 0.7.6
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/karma.conf.js +44 -0
- package/ng-package.json +43 -0
- package/package.json +24 -31
- package/src/lib/core/components/loading/loading.component.html +3 -0
- package/src/lib/core/components/loading/loading.component.scss +3 -0
- package/src/lib/core/components/loading/loading.component.ts +23 -0
- package/src/lib/core/interceptors/error.interceptor.ts +61 -0
- package/src/lib/core/interceptors/loading.interceptor.ts +69 -0
- package/src/lib/core/interceptors/token.interceptor.ts +77 -0
- package/src/lib/core/services/auth.service.ts +48 -0
- package/src/lib/core/services/error.service.ts +19 -0
- package/src/lib/core/services/loader.service.ts +21 -0
- package/src/lib/generate-form/generate-form.component.html +85 -0
- package/src/lib/generate-form/generate-form.component.scss +0 -0
- package/src/lib/generate-form/generate-form.component.ts +119 -0
- package/src/lib/ipa-form/datepicker/datepicker.component.html +21 -0
- package/src/lib/ipa-form/datepicker/datepicker.component.scss +13 -0
- package/src/lib/ipa-form/datepicker/datepicker.component.ts +67 -0
- package/src/lib/ipa-form/datepicker/gregorian-datepicker/gregorian-datepicker.component.ts +15 -0
- package/src/lib/ipa-form/datepicker/gregorian-datepicker/gregorian18n.ts +38 -0
- package/src/lib/ipa-form/datepicker/hijri-datepicker/IslamicI18n.ts +38 -0
- package/src/lib/ipa-form/datepicker/hijri-datepicker/hijri-datepicker.component.ts +14 -0
- package/src/lib/ipa-form/dropdown-input/dropdown-input.component.html +22 -0
- package/src/lib/ipa-form/dropdown-input/dropdown-input.component.scss +0 -0
- package/src/lib/ipa-form/dropdown-input/dropdown-input.component.ts +68 -0
- package/src/lib/ipa-form/file-upload/file-upload.component.html +37 -0
- package/src/lib/ipa-form/file-upload/file-upload.component.scss +45 -0
- package/src/lib/ipa-form/file-upload/file-upload.component.ts +109 -0
- package/src/lib/ipa-form/ipa-form.service.ts +294 -0
- package/src/lib/ipa-form/recaptcha/recaptcha.component.html +3 -0
- package/src/lib/ipa-form/recaptcha/recaptcha.component.scss +0 -0
- package/src/lib/ipa-form/recaptcha/recaptcha.component.ts +42 -0
- package/src/lib/ipa-form/text-input/text-input.component.html +10 -0
- package/src/lib/ipa-form/text-input/text-input.component.scss +0 -0
- package/src/lib/ipa-form/text-input/text-input.component.ts +69 -0
- package/src/lib/ipa-form/textarea-input/textarea-input.component.html +11 -0
- package/src/lib/ipa-form/textarea-input/textarea-input.component.scss +0 -0
- package/src/lib/ipa-form/textarea-input/textarea-input.component.ts +69 -0
- package/{lib/models/apiException.d.ts → src/lib/models/apiException.ts} +2 -1
- package/src/lib/models/apiResponse.ts +4 -0
- package/src/lib/models/breadcrumbs.model.ts +4 -0
- package/src/lib/models/decodedToken.model.ts +6 -0
- package/src/lib/models/exceptionUrl.model.ts +4 -0
- package/src/lib/models/generateForm.model.ts +29 -0
- package/src/lib/models/pagedResult.ts +4 -0
- package/src/lib/models/user.model.ts +7 -0
- package/src/lib/ng-ipa-library.component.ts +15 -0
- package/src/lib/ng-ipa-library.module.ts +63 -0
- package/src/lib/pipes/hijri-date.pipe.ts +15 -0
- package/src/lib/pipes/pipes.module.ts +8 -0
- package/src/lib/services/breadcrumbs.service.ts +189 -0
- package/src/lib/services/common.service.ts +63 -0
- package/src/lib/share-button/share-button.component.html +3 -0
- package/src/lib/share-button/share-button.component.scss +0 -0
- package/src/lib/share-button/share-button.component.ts +23 -0
- package/src/lib/share-button/share-button.module.ts +32 -0
- package/{public-api.d.ts → src/public-api.ts} +16 -1
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +20 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/bundles/ng-ipa-library.umd.js +0 -2098
- package/bundles/ng-ipa-library.umd.js.map +0 -1
- package/esm2015/lib/core/components/loading/loading.component.js +0 -27
- package/esm2015/lib/core/interceptors/error.interceptor.js +0 -46
- package/esm2015/lib/core/interceptors/loading.interceptor.js +0 -58
- package/esm2015/lib/core/interceptors/token.interceptor.js +0 -69
- package/esm2015/lib/core/services/auth.service.js +0 -48
- package/esm2015/lib/core/services/error.service.js +0 -22
- package/esm2015/lib/core/services/loader.service.js +0 -24
- package/esm2015/lib/generate-form/generate-form.component.js +0 -120
- package/esm2015/lib/ipa-form/datepicker/datepicker.component.js +0 -70
- package/esm2015/lib/ipa-form/datepicker/gregorian-datepicker/gregorian-datepicker.component.js +0 -28
- package/esm2015/lib/ipa-form/datepicker/gregorian-datepicker/gregorian18n.js +0 -38
- package/esm2015/lib/ipa-form/datepicker/hijri-datepicker/IslamicI18n.js +0 -38
- package/esm2015/lib/ipa-form/datepicker/hijri-datepicker/hijri-datepicker.component.js +0 -28
- package/esm2015/lib/ipa-form/dropdown-input/dropdown-input.component.js +0 -81
- package/esm2015/lib/ipa-form/file-upload/file-upload.component.js +0 -128
- package/esm2015/lib/ipa-form/ipa-form.service.js +0 -251
- package/esm2015/lib/ipa-form/recaptcha/recaptcha.component.js +0 -59
- package/esm2015/lib/ipa-form/text-input/text-input.component.js +0 -76
- package/esm2015/lib/ipa-form/textarea-input/textarea-input.component.js +0 -73
- package/esm2015/lib/models/apiException.js +0 -2
- package/esm2015/lib/models/apiResponse.js +0 -2
- package/esm2015/lib/models/breadcrumbs.model.js +0 -2
- package/esm2015/lib/models/decodedToken.model.js +0 -2
- package/esm2015/lib/models/exceptionUrl.model.js +0 -2
- package/esm2015/lib/models/generateForm.model.js +0 -2
- package/esm2015/lib/models/pagedResult.js +0 -2
- package/esm2015/lib/models/user.model.js +0 -2
- package/esm2015/lib/ng-ipa-library.module.js +0 -109
- package/esm2015/lib/pipes/hijri-date.pipe.js +0 -18
- package/esm2015/lib/pipes/pipes.module.js +0 -16
- package/esm2015/lib/services/breadcrumbs.service.js +0 -151
- package/esm2015/lib/services/common.service.js +0 -66
- package/esm2015/lib/share-button/share-button.component.js +0 -37
- package/esm2015/lib/share-button/share-button.module.js +0 -52
- package/esm2015/ng-ipa-library.js +0 -5
- package/esm2015/public-api.js +0 -40
- package/fesm2015/ng-ipa-library.js +0 -1630
- package/fesm2015/ng-ipa-library.js.map +0 -1
- package/lib/core/components/loading/loading.component.d.ts +0 -12
- package/lib/core/interceptors/error.interceptor.d.ts +0 -14
- package/lib/core/interceptors/loading.interceptor.d.ts +0 -14
- package/lib/core/interceptors/token.interceptor.d.ts +0 -15
- package/lib/core/services/auth.service.d.ts +0 -15
- package/lib/core/services/error.service.d.ts +0 -10
- package/lib/core/services/loader.service.d.ts +0 -12
- package/lib/generate-form/generate-form.component.d.ts +0 -32
- package/lib/ipa-form/datepicker/datepicker.component.d.ts +0 -31
- package/lib/ipa-form/datepicker/gregorian-datepicker/gregorian-datepicker.component.d.ts +0 -6
- package/lib/ipa-form/datepicker/gregorian-datepicker/gregorian18n.d.ts +0 -11
- package/lib/ipa-form/datepicker/hijri-datepicker/IslamicI18n.d.ts +0 -11
- package/lib/ipa-form/datepicker/hijri-datepicker/hijri-datepicker.component.d.ts +0 -6
- package/lib/ipa-form/dropdown-input/dropdown-input.component.d.ts +0 -31
- package/lib/ipa-form/file-upload/file-upload.component.d.ts +0 -36
- package/lib/ipa-form/ipa-form.service.d.ts +0 -49
- package/lib/ipa-form/recaptcha/recaptcha.component.d.ts +0 -22
- package/lib/ipa-form/text-input/text-input.component.d.ts +0 -30
- package/lib/ipa-form/textarea-input/textarea-input.component.d.ts +0 -29
- package/lib/models/apiResponse.d.ts +0 -4
- package/lib/models/breadcrumbs.model.d.ts +0 -4
- package/lib/models/decodedToken.model.d.ts +0 -6
- package/lib/models/exceptionUrl.model.d.ts +0 -4
- package/lib/models/generateForm.model.d.ts +0 -27
- package/lib/models/pagedResult.d.ts +0 -4
- package/lib/models/user.model.d.ts +0 -7
- package/lib/ng-ipa-library.module.d.ts +0 -25
- package/lib/pipes/hijri-date.pipe.d.ts +0 -7
- package/lib/pipes/pipes.module.d.ts +0 -7
- package/lib/services/breadcrumbs.service.d.ts +0 -18
- package/lib/services/common.service.d.ts +0 -8
- package/lib/share-button/share-button.component.d.ts +0 -11
- package/lib/share-button/share-button.module.d.ts +0 -13
- package/ng-ipa-library.d.ts +0 -5
|
@@ -1,1630 +0,0 @@
|
|
|
1
|
-
import * as i3$1 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { Pipe, NgModule, Injectable, Component, Self, ViewChild, Input, ElementRef, EventEmitter, Output } from '@angular/core';
|
|
5
|
-
import * as i2$1 from '@angular/forms';
|
|
6
|
-
import { FormControl, Validators, FormArray, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import * as i1 from 'ngx-toastr';
|
|
8
|
-
import { ToastrModule } from 'ngx-toastr';
|
|
9
|
-
export * from 'ngx-toastr';
|
|
10
|
-
import * as i2$2 from 'ngx-dropzone-wrapper';
|
|
11
|
-
import { DropzoneDirective, DropzoneModule } from 'ngx-dropzone-wrapper';
|
|
12
|
-
import * as i2$3 from 'ngx-captcha';
|
|
13
|
-
import { NgxCaptchaModule } from 'ngx-captcha';
|
|
14
|
-
import momentHijri from 'moment-hijri';
|
|
15
|
-
import * as i2 from '@ng-bootstrap/ng-bootstrap';
|
|
16
|
-
import { NgbDatepickerI18n, NgbCalendar, NgbCalendarIslamicUmalqura, NgbCalendarGregorian, NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap';
|
|
17
|
-
import * as i3 from '@ng-select/ng-select';
|
|
18
|
-
import { NgSelectModule } from '@ng-select/ng-select';
|
|
19
|
-
export * from '@ng-select/ng-select';
|
|
20
|
-
import * as i5 from '@angular/cdk/bidi';
|
|
21
|
-
import { BehaviorSubject, Observable, throwError } from 'rxjs';
|
|
22
|
-
import { OverlayModule } from '@angular/cdk/overlay';
|
|
23
|
-
import * as i1$2 from '@fortawesome/angular-fontawesome';
|
|
24
|
-
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
25
|
-
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
26
|
-
import { ShareIconsModule } from 'ngx-sharebuttons/icons';
|
|
27
|
-
import * as i1$1 from 'ngx-sharebuttons/popup';
|
|
28
|
-
import { ShareButtonsPopupModule } from 'ngx-sharebuttons/popup';
|
|
29
|
-
import * as i2$4 from '@angular/common/http';
|
|
30
|
-
import { HttpResponse } from '@angular/common/http';
|
|
31
|
-
import { catchError } from 'rxjs/operators';
|
|
32
|
-
|
|
33
|
-
class HijriDatePipe {
|
|
34
|
-
transform(date, format = 'iYYYY-iMM-iDD', lang = 'en') {
|
|
35
|
-
momentHijri.locale(lang);
|
|
36
|
-
return momentHijri(date).format(format);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
HijriDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: HijriDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
40
|
-
HijriDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: HijriDatePipe, name: "hijriDate" });
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: HijriDatePipe, decorators: [{
|
|
42
|
-
type: Pipe,
|
|
43
|
-
args: [{
|
|
44
|
-
name: 'hijriDate',
|
|
45
|
-
}]
|
|
46
|
-
}] });
|
|
47
|
-
|
|
48
|
-
class PipesModule {
|
|
49
|
-
}
|
|
50
|
-
PipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
51
|
-
PipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: PipesModule, declarations: [HijriDatePipe], exports: [HijriDatePipe] });
|
|
52
|
-
PipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: PipesModule });
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: PipesModule, decorators: [{
|
|
54
|
-
type: NgModule,
|
|
55
|
-
args: [{
|
|
56
|
-
declarations: [HijriDatePipe],
|
|
57
|
-
exports: [HijriDatePipe],
|
|
58
|
-
}]
|
|
59
|
-
}] });
|
|
60
|
-
|
|
61
|
-
class IPAFormService {
|
|
62
|
-
constructor(parserFormatter) {
|
|
63
|
-
this.parserFormatter = parserFormatter;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* check link is valid.
|
|
67
|
-
*/
|
|
68
|
-
static linkValidation(control) {
|
|
69
|
-
const isValidLink = /^((https?:\/\/)[\w-]+(\.[a-z-]+)+\.?(:\d+)?(\/\S*)?)$/.test(control.value);
|
|
70
|
-
return isValidLink || !control.value ? null : { link: true };
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* check mp4 link is valid.
|
|
74
|
-
*/
|
|
75
|
-
static mp4LinkValidation(control) {
|
|
76
|
-
const isValidLink = /^((https?:\/\/)[\w-]+(\.[a-z-]+)+\.?(:\d+)?(\/\S*)?(\/[\w\u0600-\u06FF]+\.mp4))$/.test(control.value);
|
|
77
|
-
return isValidLink || !control.value ? null : { linkMP4: true };
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* check mobile number is valid.
|
|
81
|
-
*/
|
|
82
|
-
static mobileNo(control) {
|
|
83
|
-
const isValidLink = /^05\d{8}$/.test(control.value);
|
|
84
|
-
return isValidLink || !control.value ? null : { mobileNo: true };
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* check email is valid.
|
|
88
|
-
*/
|
|
89
|
-
static email(control) {
|
|
90
|
-
const isValidLink = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/.test(control.value);
|
|
91
|
-
return isValidLink || !control.value ? null : { Email: true };
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* check national ID or iqama ID is valid.
|
|
95
|
-
*/
|
|
96
|
-
static checkID(control) {
|
|
97
|
-
let isValid = false;
|
|
98
|
-
const value = control.value;
|
|
99
|
-
if (IPAFormService.nationalIdValidate(value) ||
|
|
100
|
-
IPAFormService.iqamaIdValidate(value)) {
|
|
101
|
-
isValid = true;
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
isValid = false;
|
|
105
|
-
}
|
|
106
|
-
return isValid || !value ? null : { checkId: true };
|
|
107
|
-
}
|
|
108
|
-
getErrorMessage(control, patternErrorMsg = '') {
|
|
109
|
-
for (const propertyName in control === null || control === void 0 ? void 0 : control.errors) {
|
|
110
|
-
if ((control === null || control === void 0 ? void 0 : control.errors.hasOwnProperty(propertyName)) &&
|
|
111
|
-
(control.touched || control.dirty)) {
|
|
112
|
-
return this.getValidatorErrorMessage(propertyName, control.errors[propertyName], patternErrorMsg);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* convert gregorian date to hijri date (Based on Umm al-Qura calculations).
|
|
119
|
-
* @param date: gregorian date
|
|
120
|
-
* @param format: iDD => day: ١٥, iMM => month: ٠٤, iMMM => month: ربيع ٢,
|
|
121
|
-
* iMMMM => ربيع الثاني, iYY => year: ٤٢, iYYYY => year: ١٤٤٢,
|
|
122
|
-
* dd => ن, ddd => إثنين, dddd => الإثنين
|
|
123
|
-
* @example 'iYYYY/iM/iDهـ الموافق YYYY/M/Dم'
|
|
124
|
-
* '١٤٤٢/٠٤/١٥هـ الموافق ٢٠٢٠/١١/٣٠'
|
|
125
|
-
*/
|
|
126
|
-
convertToHijriDate(date, format = 'iYYYY-iMM-iDD', lang = 'ar-SA') {
|
|
127
|
-
momentHijri.locale(lang);
|
|
128
|
-
return momentHijri(date).format(format);
|
|
129
|
-
}
|
|
130
|
-
convertToGregorianDate(date, format = 'YYYY-MM-DD', lang = 'en') {
|
|
131
|
-
momentHijri.locale(lang);
|
|
132
|
-
const m = momentHijri.iConvert.toGregorian(date.year(), date.month(), date.date());
|
|
133
|
-
return momentHijri(new Date(m.gy, m.gm, m.gd)).format(format);
|
|
134
|
-
}
|
|
135
|
-
getCurrentHijriDate() {
|
|
136
|
-
momentHijri.locale('en');
|
|
137
|
-
return momentHijri().format('iYYYY/iMM/iDD');
|
|
138
|
-
}
|
|
139
|
-
getValidatorErrorMessage(validatorName, validatorValue, patternErrorMsg) {
|
|
140
|
-
if (validatorName === 'pattern') {
|
|
141
|
-
validatorValue = this.addPatternMsg(validatorValue, patternErrorMsg);
|
|
142
|
-
}
|
|
143
|
-
const config = {
|
|
144
|
-
required: 'هذا الحقل مطلوب',
|
|
145
|
-
pattern: `${validatorValue.message}`,
|
|
146
|
-
Email: 'خطأ في البريد الالكتروني (example@ipa.edu.sa)',
|
|
147
|
-
maxlength: `تجاوز عدد الحقل المسموح بها (${validatorValue.requiredLength}) حرف`,
|
|
148
|
-
minlength: `على الأقل عدد ${validatorValue.requiredLength} حرف.`,
|
|
149
|
-
min: `رقم اكبر من أو يساوي ${validatorValue.min}`,
|
|
150
|
-
max: `رقم اصغر من أو يساوي ${validatorValue.max}`,
|
|
151
|
-
ngbDate: this.getNgbDatepickerErrorMsg(validatorValue),
|
|
152
|
-
checkId: 'رقم الهوية أو الاقامة غير صحيح',
|
|
153
|
-
link: 'الرابط غير صحيح (http://google.com)',
|
|
154
|
-
linkMP4: 'الرابط غير صحيح (http://example.com/a.mp4)',
|
|
155
|
-
mobileNo: 'خطأ في رقم الجوال (05xxxxxxxx)',
|
|
156
|
-
};
|
|
157
|
-
return config[validatorName];
|
|
158
|
-
}
|
|
159
|
-
addPatternMsg(validatorValue, patternErrorMsg) {
|
|
160
|
-
let pattern = Object.assign(Object.assign({}, validatorValue), { message: patternErrorMsg });
|
|
161
|
-
return pattern;
|
|
162
|
-
}
|
|
163
|
-
getNgbDatepickerErrorMsg(validatorValue) {
|
|
164
|
-
let msg = '';
|
|
165
|
-
if (validatorValue.maxDate) {
|
|
166
|
-
msg = `التاريخ المدخل "${this.parserFormatter.format(validatorValue.maxDate.actual)}" اكبر من تاريخ اليوم "${this.parserFormatter.format(validatorValue.maxDate.maxDate)}"`;
|
|
167
|
-
}
|
|
168
|
-
else if (validatorValue.minDate) {
|
|
169
|
-
msg = `التاريخ المدخل "${this.parserFormatter.format(validatorValue.minDate.actual)}" يجب ان يكون اكبر من أو يساوي تاريخ البداية "${this.parserFormatter.format(validatorValue.minDate.minDate)}"`;
|
|
170
|
-
}
|
|
171
|
-
else if (validatorValue.invalid) {
|
|
172
|
-
msg = `التاريخ المدخل غير صحيح ${validatorValue.invalid}.`;
|
|
173
|
-
}
|
|
174
|
-
return msg;
|
|
175
|
-
}
|
|
176
|
-
static convertToEn(value) {
|
|
177
|
-
let newValue = '';
|
|
178
|
-
for (let i = 0; i < value.length; i++) {
|
|
179
|
-
let ch = value.charCodeAt(i);
|
|
180
|
-
if (ch >= 1584 && ch <= 1650) {
|
|
181
|
-
let newChar = ch - 1584;
|
|
182
|
-
newValue = newValue + String.fromCharCode(newChar);
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
newValue = newValue + String.fromCharCode(ch);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return newValue;
|
|
189
|
-
}
|
|
190
|
-
static nationalIdValidate(civilId) {
|
|
191
|
-
if (civilId) {
|
|
192
|
-
let strID = this.convertToEn(civilId);
|
|
193
|
-
let digits = '';
|
|
194
|
-
let counter = 0;
|
|
195
|
-
while (counter < 9) {
|
|
196
|
-
if ((counter + 1) % 2 == 0) {
|
|
197
|
-
digits = digits + strID.substring(counter, counter + 1);
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
digits =
|
|
201
|
-
digits + (+strID.substring(counter, counter + 1) * 2).toString();
|
|
202
|
-
}
|
|
203
|
-
counter++;
|
|
204
|
-
}
|
|
205
|
-
let intSum = 0;
|
|
206
|
-
let intSumTemp = 0;
|
|
207
|
-
let strSum;
|
|
208
|
-
let intOddSumDigit;
|
|
209
|
-
let CheckDigit;
|
|
210
|
-
counter = 0;
|
|
211
|
-
while (counter < digits.length) {
|
|
212
|
-
intSumTemp = +digits.charAt(counter) * 1;
|
|
213
|
-
intSum += intSumTemp;
|
|
214
|
-
counter++;
|
|
215
|
-
}
|
|
216
|
-
strSum = intSum.toString();
|
|
217
|
-
if (strSum.length == 1) {
|
|
218
|
-
intOddSumDigit = intSum;
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
intOddSumDigit = strSum.substring(strSum.length, strSum.length - 1);
|
|
222
|
-
}
|
|
223
|
-
if (intOddSumDigit == 0) {
|
|
224
|
-
CheckDigit = 0;
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
CheckDigit = (10 - +intOddSumDigit).toString();
|
|
228
|
-
}
|
|
229
|
-
let PublicID = this.convertToEn(civilId);
|
|
230
|
-
if (CheckDigit ==
|
|
231
|
-
PublicID.substring(PublicID.length - 1, PublicID.length) &&
|
|
232
|
-
strID.length == 10 &&
|
|
233
|
-
strID.substring(0, 1) == '1') {
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
return false;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
static iqamaIdValidate(civilId) {
|
|
245
|
-
if (civilId) {
|
|
246
|
-
let strID = this.convertToEn(civilId);
|
|
247
|
-
let digits = '';
|
|
248
|
-
let counter = 0;
|
|
249
|
-
while (counter < 9) {
|
|
250
|
-
if ((counter + 1) % 2 == 0) {
|
|
251
|
-
digits = digits + strID.substring(counter, counter + 1);
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
digits =
|
|
255
|
-
digits + (+strID.substring(counter, counter + 1) * 2).toString();
|
|
256
|
-
}
|
|
257
|
-
counter++;
|
|
258
|
-
}
|
|
259
|
-
let intSum = 0;
|
|
260
|
-
let intSumTemp = 0;
|
|
261
|
-
let strSum;
|
|
262
|
-
let intOddSumDigit;
|
|
263
|
-
let CheckDigit;
|
|
264
|
-
counter = 0;
|
|
265
|
-
while (counter < digits.length) {
|
|
266
|
-
intSumTemp = +digits.charAt(counter) * 1;
|
|
267
|
-
intSum += intSumTemp;
|
|
268
|
-
counter++;
|
|
269
|
-
}
|
|
270
|
-
strSum = intSum.toString();
|
|
271
|
-
if (strSum.length == 1) {
|
|
272
|
-
intOddSumDigit = intSum;
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
intOddSumDigit = strSum.substring(strSum.length, strSum.length - 1);
|
|
276
|
-
}
|
|
277
|
-
if (intOddSumDigit == 0) {
|
|
278
|
-
CheckDigit = 0;
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
CheckDigit = (10 - +intOddSumDigit).toString();
|
|
282
|
-
}
|
|
283
|
-
let PublicID = this.convertToEn(civilId);
|
|
284
|
-
if (CheckDigit ==
|
|
285
|
-
PublicID.substring(PublicID.length - 1, PublicID.length) &&
|
|
286
|
-
strID.length == 10 &&
|
|
287
|
-
strID.substring(0, 1) == '2') {
|
|
288
|
-
return true;
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
return false;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
return false;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
IPAFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: IPAFormService, deps: [{ token: i2.NgbDateParserFormatter }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
300
|
-
IPAFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: IPAFormService, providedIn: 'root' });
|
|
301
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: IPAFormService, decorators: [{
|
|
302
|
-
type: Injectable,
|
|
303
|
-
args: [{
|
|
304
|
-
providedIn: 'root',
|
|
305
|
-
}]
|
|
306
|
-
}], ctorParameters: function () { return [{ type: i2.NgbDateParserFormatter }]; } });
|
|
307
|
-
|
|
308
|
-
class TextInputComponent {
|
|
309
|
-
constructor(validationService, controlDir) {
|
|
310
|
-
this.validationService = validationService;
|
|
311
|
-
this.controlDir = controlDir;
|
|
312
|
-
this.type = 'text';
|
|
313
|
-
this.placeholder = 'please enter text';
|
|
314
|
-
this.label = 'text input';
|
|
315
|
-
this.required = false;
|
|
316
|
-
this.patternErrorMsg = 'invalid pattern';
|
|
317
|
-
this.pattern = '';
|
|
318
|
-
this.formControl = new FormControl('');
|
|
319
|
-
this.controlDir.valueAccessor = this;
|
|
320
|
-
}
|
|
321
|
-
ngOnInit() {
|
|
322
|
-
const control = this.controlDir.control;
|
|
323
|
-
const validators = (control === null || control === void 0 ? void 0 : control.validator) ? [control.validator] : [];
|
|
324
|
-
control === null || control === void 0 ? void 0 : control.setValidators(validators);
|
|
325
|
-
control === null || control === void 0 ? void 0 : control.updateValueAndValidity();
|
|
326
|
-
this.formControl = control;
|
|
327
|
-
}
|
|
328
|
-
onChange(event) { }
|
|
329
|
-
onTouched() { }
|
|
330
|
-
writeValue(obj) {
|
|
331
|
-
this.input.nativeElement.value = obj || '';
|
|
332
|
-
}
|
|
333
|
-
registerOnChange(fn) {
|
|
334
|
-
this.onChange = fn;
|
|
335
|
-
}
|
|
336
|
-
registerOnTouched(fn) {
|
|
337
|
-
this.onTouched = fn;
|
|
338
|
-
}
|
|
339
|
-
get errorMessage() {
|
|
340
|
-
this.errorMsg = this.validationService.getErrorMessage(this.formControl, this.patternErrorMsg);
|
|
341
|
-
return this.errorMsg;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
TextInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: TextInputComponent, deps: [{ token: IPAFormService }, { token: i2$1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
345
|
-
TextInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: TextInputComponent, selector: "ipa-text-input", inputs: { id: "id", type: "type", placeholder: "placeholder", label: "label", required: "required", patternErrorMsg: "patternErrorMsg", pattern: "pattern", classes: "classes", containerClasses: "containerClasses" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"form-floating {{containerClasses}}\">\r\n <input #input id=\"{{id}}\" class=\"form-control {{classes}}\" [type]=\"type\" [required]=\"required\" pattern=\"{{pattern}}\"\r\n placeholder=\"{{placeholder}}\" [formControl]=\"formControl\" (input)=\"onChange(controlDir.control?.value)\"\r\n (blur)=\"onTouched()\"\r\n [ngClass]=\"{'is-invalid is-invalid:focus': (controlDir.control?.invalid && (controlDir.control?.dirty || controlDir.control?.touched)) && errorMsg,'is-valid is-valid:focus': (controlDir.control?.valid && (controlDir.control?.dirty || controlDir.control?.touched) && (errorMsg || controlDir.value))}\">\r\n <label for=\"{{id}}\">{{label}}</label>\r\n <div class=\"invalid-feedback\" *ngIf=\"errorMessage !== null\">\r\n {{errorMsg}}\r\n </div>\r\n</div>", styles: [""], directives: [{ type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: TextInputComponent, decorators: [{
|
|
347
|
-
type: Component,
|
|
348
|
-
args: [{
|
|
349
|
-
selector: 'ipa-text-input',
|
|
350
|
-
templateUrl: './text-input.component.html',
|
|
351
|
-
styleUrls: ['./text-input.component.scss'],
|
|
352
|
-
}]
|
|
353
|
-
}], ctorParameters: function () { return [{ type: IPAFormService }, { type: i2$1.NgControl, decorators: [{
|
|
354
|
-
type: Self
|
|
355
|
-
}] }]; }, propDecorators: { input: [{
|
|
356
|
-
type: ViewChild,
|
|
357
|
-
args: ['input', { static: true }]
|
|
358
|
-
}], id: [{
|
|
359
|
-
type: Input
|
|
360
|
-
}], type: [{
|
|
361
|
-
type: Input
|
|
362
|
-
}], placeholder: [{
|
|
363
|
-
type: Input
|
|
364
|
-
}], label: [{
|
|
365
|
-
type: Input
|
|
366
|
-
}], required: [{
|
|
367
|
-
type: Input
|
|
368
|
-
}], patternErrorMsg: [{
|
|
369
|
-
type: Input
|
|
370
|
-
}], pattern: [{
|
|
371
|
-
type: Input
|
|
372
|
-
}], classes: [{
|
|
373
|
-
type: Input
|
|
374
|
-
}], containerClasses: [{
|
|
375
|
-
type: Input
|
|
376
|
-
}] } });
|
|
377
|
-
|
|
378
|
-
class TextareaInputComponent {
|
|
379
|
-
constructor(validationService, controlDir) {
|
|
380
|
-
this.validationService = validationService;
|
|
381
|
-
this.controlDir = controlDir;
|
|
382
|
-
this.input = new ElementRef(null);
|
|
383
|
-
this.placeholder = 'please enter text';
|
|
384
|
-
this.label = 'textarea input';
|
|
385
|
-
this.required = false;
|
|
386
|
-
this.patternErrorMsg = 'invalid pattern';
|
|
387
|
-
this.formControl = new FormControl('');
|
|
388
|
-
this.controlDir.valueAccessor = this;
|
|
389
|
-
}
|
|
390
|
-
ngOnInit() {
|
|
391
|
-
const control = this.controlDir.control;
|
|
392
|
-
const validators = (control === null || control === void 0 ? void 0 : control.validator) ? [control.validator] : [];
|
|
393
|
-
control === null || control === void 0 ? void 0 : control.setValidators(validators);
|
|
394
|
-
control === null || control === void 0 ? void 0 : control.updateValueAndValidity();
|
|
395
|
-
this.formControl = control;
|
|
396
|
-
}
|
|
397
|
-
onChange(event) { }
|
|
398
|
-
onTouched() { }
|
|
399
|
-
writeValue(obj) {
|
|
400
|
-
this.input.nativeElement.value = obj || '';
|
|
401
|
-
}
|
|
402
|
-
registerOnChange(fn) {
|
|
403
|
-
this.onChange = fn;
|
|
404
|
-
}
|
|
405
|
-
registerOnTouched(fn) {
|
|
406
|
-
this.onTouched = fn;
|
|
407
|
-
}
|
|
408
|
-
get errorMessage() {
|
|
409
|
-
this.errorMsg = this.validationService.getErrorMessage(this.formControl, this.patternErrorMsg);
|
|
410
|
-
return this.errorMsg;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
TextareaInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: TextareaInputComponent, deps: [{ token: IPAFormService }, { token: i2$1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
414
|
-
TextareaInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: TextareaInputComponent, selector: "ipa-textarea-input", inputs: { id: "id", placeholder: "placeholder", label: "label", required: "required", patternErrorMsg: "patternErrorMsg", pattern: "pattern", classes: "classes", containerClasses: "containerClasses" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"form-floating {{containerClasses}}\">\r\n <textarea #input id=\"{{id}}\" class=\"form-control {{classes}}\" [required]=\"required\" pattern=\"{{pattern}}\"\r\n placeholder=\"{{placeholder}}\" [formControl]=\"formControl\" (input)=\"onChange(controlDir.control?.value)\"\r\n (blur)=\"onTouched()\"\r\n [ngClass]=\"{'is-invalid is-invalid:focus': (controlDir.control?.invalid && (controlDir.control?.dirty || controlDir.control?.touched)) && errorMsg,'is-valid is-valid:focus': (controlDir.control?.valid && (controlDir.control?.dirty || controlDir.control?.touched) && (errorMsg || controlDir.value))}\">\r\n </textarea>\r\n <label for=\"{{id}}\">{{label}}</label>\r\n <div class=\"invalid-feedback\" *ngIf=\"errorMessage !== null\">\r\n {{errorMsg}}\r\n </div>\r\n</div>", styles: [""], directives: [{ type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: TextareaInputComponent, decorators: [{
|
|
416
|
-
type: Component,
|
|
417
|
-
args: [{
|
|
418
|
-
selector: 'ipa-textarea-input',
|
|
419
|
-
templateUrl: './textarea-input.component.html',
|
|
420
|
-
styleUrls: ['./textarea-input.component.scss'],
|
|
421
|
-
}]
|
|
422
|
-
}], ctorParameters: function () { return [{ type: IPAFormService }, { type: i2$1.NgControl, decorators: [{
|
|
423
|
-
type: Self
|
|
424
|
-
}] }]; }, propDecorators: { input: [{
|
|
425
|
-
type: ViewChild,
|
|
426
|
-
args: ['input', { static: true }]
|
|
427
|
-
}], id: [{
|
|
428
|
-
type: Input
|
|
429
|
-
}], placeholder: [{
|
|
430
|
-
type: Input
|
|
431
|
-
}], label: [{
|
|
432
|
-
type: Input
|
|
433
|
-
}], required: [{
|
|
434
|
-
type: Input
|
|
435
|
-
}], patternErrorMsg: [{
|
|
436
|
-
type: Input
|
|
437
|
-
}], pattern: [{
|
|
438
|
-
type: Input
|
|
439
|
-
}], classes: [{
|
|
440
|
-
type: Input
|
|
441
|
-
}], containerClasses: [{
|
|
442
|
-
type: Input
|
|
443
|
-
}] } });
|
|
444
|
-
|
|
445
|
-
class DropdownInputComponent {
|
|
446
|
-
constructor(validationService, controlDir) {
|
|
447
|
-
this.validationService = validationService;
|
|
448
|
-
this.controlDir = controlDir;
|
|
449
|
-
this.label = 'text input';
|
|
450
|
-
this.items = [];
|
|
451
|
-
this.required = false;
|
|
452
|
-
this.searchable = false;
|
|
453
|
-
this.notFoundText = 'لا يوجد بيانات';
|
|
454
|
-
this.formControl = new FormControl('');
|
|
455
|
-
this.controlDir.valueAccessor = this;
|
|
456
|
-
}
|
|
457
|
-
ngOnInit() {
|
|
458
|
-
const control = this.controlDir.control;
|
|
459
|
-
const validators = (control === null || control === void 0 ? void 0 : control.validator) ? [control.validator] : [];
|
|
460
|
-
control === null || control === void 0 ? void 0 : control.setValidators(validators);
|
|
461
|
-
control === null || control === void 0 ? void 0 : control.updateValueAndValidity();
|
|
462
|
-
this.formControl = control;
|
|
463
|
-
this.formControl.patchValue(null);
|
|
464
|
-
}
|
|
465
|
-
onChange(event) { }
|
|
466
|
-
onTouched() { }
|
|
467
|
-
writeValue(obj) {
|
|
468
|
-
if (this.input)
|
|
469
|
-
this.input.value = obj || '';
|
|
470
|
-
}
|
|
471
|
-
registerOnChange(fn) {
|
|
472
|
-
this.onChange = fn;
|
|
473
|
-
}
|
|
474
|
-
registerOnTouched(fn) {
|
|
475
|
-
this.onTouched = fn;
|
|
476
|
-
}
|
|
477
|
-
get errorMessage() {
|
|
478
|
-
this.errorMsg = this.validationService.getErrorMessage(this.formControl);
|
|
479
|
-
return this.errorMsg;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
DropdownInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: DropdownInputComponent, deps: [{ token: IPAFormService }, { token: i2$1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
483
|
-
DropdownInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: DropdownInputComponent, selector: "ipa-dropdown-input", inputs: { id: "id", label: "label", items: "items", textField: "textField", valueField: "valueField", required: "required", searchable: "searchable", notFoundText: "notFoundText", classes: "classes", containerClasses: "containerClasses" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["select"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"form-floating {{containerClasses}}\"\r\n [ngClass]=\"{'was-validated': (controlDir.control?.dirty || controlDir.control?.touched) && required}\">\r\n\r\n <!-- searchable is false -->\r\n <ng-container *ngIf=\"!searchable\">\r\n <select #select id=\"{{id}}\" class=\"form-select {{classes}}\" [required]=\"required\" [formControl]=\"formControl\">\r\n <option *ngFor=\"let item of items\" [value]=\"valueField ? item[valueField] : item\">\r\n {{textField ? item[textField] : item}}</option>\r\n </select>\r\n <label for=\"{{id}}\">{{label}}</label>\r\n </ng-container>\r\n\r\n <!-- searchable is true -->\r\n <ng-select *ngIf=\"searchable\" #select dir=\"rtl\" class=\"{{classes}}\" [formControl]=\"formControl\" [items]=\"items\"\r\n [placeholder]=\"label\" [notFoundText]=\"notFoundText\" [required]=\"required\" [bindValue]=\"valueField\"\r\n [bindLabel]=\"textField\"\r\n [ngClass]=\"{'is-invalid is-invalid:focus': (controlDir.control?.invalid && (controlDir.control?.dirty || controlDir.control?.touched)) && errorMsg,'is-valid is-valid:focus': (controlDir.control?.valid && (controlDir.control?.dirty || controlDir.control?.touched) && (errorMsg || controlDir.value))}\">\r\n </ng-select>\r\n <div class=\"invalid-feedback\" *ngIf=\"errorMessage !== null\">\r\n {{errorMsg}}\r\n </div>\r\n</div>", styles: [""], components: [{ type: i3.NgSelectComponent, selector: "ng-select", inputs: ["markFirst", "dropdownPosition", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "bufferAmount", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "bindLabel", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "virtualScroll", "openOnEnter", "appendTo", "bindValue", "appearance", "maxSelectedItems", "groupBy", "groupValue", "tabIndex", "typeahead"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i5.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }] });
|
|
484
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: DropdownInputComponent, decorators: [{
|
|
485
|
-
type: Component,
|
|
486
|
-
args: [{
|
|
487
|
-
selector: 'ipa-dropdown-input',
|
|
488
|
-
templateUrl: './dropdown-input.component.html',
|
|
489
|
-
styleUrls: ['./dropdown-input.component.scss'],
|
|
490
|
-
}]
|
|
491
|
-
}], ctorParameters: function () { return [{ type: IPAFormService }, { type: i2$1.NgControl, decorators: [{
|
|
492
|
-
type: Self
|
|
493
|
-
}] }]; }, propDecorators: { input: [{
|
|
494
|
-
type: ViewChild,
|
|
495
|
-
args: ['select', { static: true }]
|
|
496
|
-
}], id: [{
|
|
497
|
-
type: Input
|
|
498
|
-
}], label: [{
|
|
499
|
-
type: Input
|
|
500
|
-
}], items: [{
|
|
501
|
-
type: Input
|
|
502
|
-
}], textField: [{
|
|
503
|
-
type: Input
|
|
504
|
-
}], valueField: [{
|
|
505
|
-
type: Input
|
|
506
|
-
}], required: [{
|
|
507
|
-
type: Input
|
|
508
|
-
}], searchable: [{
|
|
509
|
-
type: Input
|
|
510
|
-
}], notFoundText: [{
|
|
511
|
-
type: Input
|
|
512
|
-
}], classes: [{
|
|
513
|
-
type: Input
|
|
514
|
-
}], containerClasses: [{
|
|
515
|
-
type: Input
|
|
516
|
-
}] } });
|
|
517
|
-
|
|
518
|
-
class LoaderService {
|
|
519
|
-
constructor() {
|
|
520
|
-
this.isLoading = new BehaviorSubject(false);
|
|
521
|
-
this.urls = [];
|
|
522
|
-
}
|
|
523
|
-
setExceptionUrls(urls) {
|
|
524
|
-
this.urls = urls;
|
|
525
|
-
}
|
|
526
|
-
addExceptionUrl(url) {
|
|
527
|
-
this.urls.push(url);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
LoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
531
|
-
LoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LoaderService, providedIn: 'root' });
|
|
532
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LoaderService, decorators: [{
|
|
533
|
-
type: Injectable,
|
|
534
|
-
args: [{
|
|
535
|
-
providedIn: 'root',
|
|
536
|
-
}]
|
|
537
|
-
}], ctorParameters: function () { return []; } });
|
|
538
|
-
|
|
539
|
-
class LoaderComponent {
|
|
540
|
-
constructor(loaderService, cdr) {
|
|
541
|
-
this.loaderService = loaderService;
|
|
542
|
-
this.cdr = cdr;
|
|
543
|
-
}
|
|
544
|
-
ngAfterViewInit() {
|
|
545
|
-
this.loaderService.isLoading.subscribe((v) => {
|
|
546
|
-
this.loading = v;
|
|
547
|
-
this.cdr.detectChanges();
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
LoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LoaderComponent, deps: [{ token: LoaderService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
552
|
-
LoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: LoaderComponent, selector: "ipa-loader", ngImport: i0, template: "<div id=\"cover-spin\" *ngIf=\"loading\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n", styles: ["#cover-spin{display:flex}\n"], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
553
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
554
|
-
type: Component,
|
|
555
|
-
args: [{
|
|
556
|
-
selector: 'ipa-loader',
|
|
557
|
-
templateUrl: './loading.component.html',
|
|
558
|
-
styleUrls: ['./loading.component.scss'],
|
|
559
|
-
}]
|
|
560
|
-
}], ctorParameters: function () { return [{ type: LoaderService }, { type: i0.ChangeDetectorRef }]; } });
|
|
561
|
-
|
|
562
|
-
class FileUploadComponent {
|
|
563
|
-
constructor(
|
|
564
|
-
// private authService: AuthService,
|
|
565
|
-
toastrService) {
|
|
566
|
-
this.toastrService = toastrService;
|
|
567
|
-
this.label = '';
|
|
568
|
-
this.required = false;
|
|
569
|
-
this.acceptedFiles = '';
|
|
570
|
-
this.multiple = 1; // set maxFiles (NOT uploadMultiple)in the config object,
|
|
571
|
-
this.maxFileSize = 2;
|
|
572
|
-
this.method = 'POST';
|
|
573
|
-
this.autoUpload = false;
|
|
574
|
-
this.apiUrl = 'apiUrl';
|
|
575
|
-
this.successUpload = new EventEmitter();
|
|
576
|
-
this.fileAdded = new EventEmitter();
|
|
577
|
-
this.fileDeleted = new EventEmitter();
|
|
578
|
-
this.dragEnter = false;
|
|
579
|
-
this.errors = [];
|
|
580
|
-
this.filesAdded = [];
|
|
581
|
-
this.currentFiles = [];
|
|
582
|
-
}
|
|
583
|
-
ngOnInit() {
|
|
584
|
-
this.label = 'رفع ' + this.label;
|
|
585
|
-
this.config = {
|
|
586
|
-
url: this.apiUrl,
|
|
587
|
-
method: this.method,
|
|
588
|
-
headers: {
|
|
589
|
-
Authorization: 'Bearer ' + this.authorization,
|
|
590
|
-
},
|
|
591
|
-
maxFilesize: this.maxFileSize,
|
|
592
|
-
maxFiles: this.multiple,
|
|
593
|
-
uploadMultiple: this.multiple > 1,
|
|
594
|
-
dictInvalidFileType: 'صيغة الملف غير مسموح بها',
|
|
595
|
-
dictFileTooBig: 'الحجم تجاوز الحد المسموح',
|
|
596
|
-
dictMaxFilesExceeded: 'الرجاء حذف الملفات الموجودة حاليا لتتمكن من رفع هذا الملف',
|
|
597
|
-
acceptedFiles: this.acceptedFiles,
|
|
598
|
-
autoProcessQueue: this.autoUpload,
|
|
599
|
-
previewTemplate: '<span></span>',
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
operationCompleted(e) {
|
|
603
|
-
if (this.filesAdded.length > 0) {
|
|
604
|
-
this.successUpload.emit(this.filesAdded);
|
|
605
|
-
this.filesAdded = [];
|
|
606
|
-
}
|
|
607
|
-
this.dropzoneDir.reset();
|
|
608
|
-
}
|
|
609
|
-
onUploadSuccess(e) {
|
|
610
|
-
const file = e[0];
|
|
611
|
-
if (file.status === 'success') {
|
|
612
|
-
this.filesAdded.push(file);
|
|
613
|
-
}
|
|
614
|
-
this.toastrService.success('تم تحميل المرفقات بنجاح');
|
|
615
|
-
}
|
|
616
|
-
onUploadError(e) {
|
|
617
|
-
if (e[1]) {
|
|
618
|
-
this.errors = [];
|
|
619
|
-
this.errors.push(`${e[1]} (${e[0].name})`);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
fileWasAdded(e) {
|
|
623
|
-
const myDropzone = this.dropzoneDir.dropzone();
|
|
624
|
-
if (this.multiple === 1) {
|
|
625
|
-
this.currentFiles = [];
|
|
626
|
-
this.filesAdded = [];
|
|
627
|
-
this.errors = [];
|
|
628
|
-
const files = myDropzone.files;
|
|
629
|
-
if (files.length > 1) {
|
|
630
|
-
myDropzone.removeFile(files[0]);
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
this.currentFiles.push(e);
|
|
634
|
-
this.fileAdded.emit(e);
|
|
635
|
-
}
|
|
636
|
-
sending(e) {
|
|
637
|
-
this.errors = [];
|
|
638
|
-
}
|
|
639
|
-
reset(e) { }
|
|
640
|
-
deleteFile(file) {
|
|
641
|
-
this.currentFiles = this.currentFiles.filter((x) => x.name !== file.name && x.size !== file.size);
|
|
642
|
-
this.errors = [];
|
|
643
|
-
this.fileDeleted.emit();
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
FileUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: FileUploadComponent, deps: [{ token: i1.ToastrService }], target: i0.ɵɵFactoryTarget.Component });
|
|
647
|
-
FileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: FileUploadComponent, selector: "ipa-file-upload", inputs: { label: "label", required: "required", acceptedFiles: "acceptedFiles", multiple: "multiple", maxFileSize: "maxFileSize", method: "method", autoUpload: "autoUpload", apiUrl: "apiUrl", authorization: "authorization" }, outputs: { successUpload: "successUpload", fileAdded: "fileAdded", fileDeleted: "fileDeleted" }, viewQueries: [{ propertyName: "dropzoneDir", first: true, predicate: DropzoneDirective, descendants: true }], ngImport: i0, template: "<div class=\"file-upload\">\r\n <div class=\"upload-overlay\" [dropzone]=\"config\" (error)=\"onUploadError($event)\"\r\n (queueComplete)=\"operationCompleted($event)\" (success)=\"onUploadSuccess($event)\" (dragenter)=\"dragEnter = true\"\r\n (dragLeave)=\"dragEnter = false\" (drop)=\"dragEnter = false\" (dragEnd)=\"dragEnter = false\"\r\n [class.active-border]=\"dragEnter\" (sending)=\"sending($event)\" (reset)=\"reset($event)\"\r\n (addedFile)=\"fileWasAdded($event)\">\r\n </div>\r\n <div class=\"upload-btn-wrapper\">\r\n <div>\r\n <div class=\"subtitle mb-2\">\r\n {{label}}\r\n <span *ngIf=\"required\" class=\"required\">*</span>\r\n </div>\r\n <hr>\r\n <span style=\"font-size: 12px;\">\u0642\u0645 \u0628\u0633\u062D\u0628 \u0627\u0644\u0645\u0644\u0641 \u0623\u0648 \u0627\u0636\u063A\u0637 \u0647\u0646\u0627</span>\r\n <i class=\"fas fa-upload upload-icon mr-2\"></i>\r\n </div>\r\n <div *ngIf=\"acceptedFiles.length > 0\" class=\"allowed-extensions\">\r\n \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0633\u0645\u0648\u062D \u0628\u0647\u0627:\r\n <span class=\"extensions\">{{ acceptedFiles }}</span>\r\n </div>\r\n <div class=\"allowed-extensions\">\r\n \u0627\u0642\u0635\u0649 \u062D\u062C\u0645 \u0644\u0644\u0645\u0631\u0641\u0642:\r\n <span class=\"extensions\">{{ maxFileSize }} MB</span>\r\n </div>\r\n </div>\r\n</div>\r\n<div id=\"attachment-status\" style=\"text-align: center; margin-top:10px;\">\r\n <span style=\"font-size: 14px; margin: auto; font-weight:bold;\" *ngFor=\"let file of currentFiles\">\r\n {{ file.name }} <i (click)=\"deleteFile(file)\" class=\"fas fa-trash\"\r\n style=\"color:firebrick; cursor: pointer;\"></i>\r\n <br>\r\n </span>\r\n <ul class=\"list-unstyled\">\r\n <li class=\"text-danger\" style=\"font-size: 12px;\" *ngFor=\"let error of errors\">{{error}}</li>\r\n </ul>\r\n</div>", styles: [".subtitle{border-bottom:none;display:block;line-height:2}.file-upload{border:dashed 1px #ccc;display:block;min-height:150px;border-radius:15px;width:350px;cursor:pointer;position:relative;margin:auto}.upload-overlay{position:absolute;width:100%;height:100%}.upload-btn-wrapper{text-align:center}.upload-icon{margin-right:5px}.list-unstyled{margin:10px!important;padding:14px!important;list-style:none}.allowed-extensions{color:#4d7297}.required{color:#dc3545;font-size:20px}\n"], directives: [{ type: i2$2.DropzoneDirective, selector: "[dropzone]", inputs: ["disabled", "dropzone"], outputs: ["init", "error", "success", "sending", "canceled", "complete", "processing", "drop", "dragStart", "dragEnd", "dragEnter", "dragOver", "dragLeave", "thumbnail", "addedFile", "addedFiles", "removedFile", "uploadProgress", "maxFilesReached", "maxFilesExceeded", "errorMultiple", "successMultiple", "sendingMultiple", "canceledMultiple", "completeMultiple", "processingMultiple", "reset", "queueComplete", "totalUploadProgress"], exportAs: ["ngxDropzone"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
648
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
649
|
-
type: Component,
|
|
650
|
-
args: [{
|
|
651
|
-
selector: 'ipa-file-upload',
|
|
652
|
-
templateUrl: './file-upload.component.html',
|
|
653
|
-
styleUrls: ['./file-upload.component.scss']
|
|
654
|
-
}]
|
|
655
|
-
}], ctorParameters: function () { return [{ type: i1.ToastrService }]; }, propDecorators: { dropzoneDir: [{
|
|
656
|
-
type: ViewChild,
|
|
657
|
-
args: [DropzoneDirective, { static: false }]
|
|
658
|
-
}], label: [{
|
|
659
|
-
type: Input
|
|
660
|
-
}], required: [{
|
|
661
|
-
type: Input
|
|
662
|
-
}], acceptedFiles: [{
|
|
663
|
-
type: Input
|
|
664
|
-
}], multiple: [{
|
|
665
|
-
type: Input
|
|
666
|
-
}], maxFileSize: [{
|
|
667
|
-
type: Input
|
|
668
|
-
}], method: [{
|
|
669
|
-
type: Input
|
|
670
|
-
}], autoUpload: [{
|
|
671
|
-
type: Input
|
|
672
|
-
}], apiUrl: [{
|
|
673
|
-
type: Input
|
|
674
|
-
}], authorization: [{
|
|
675
|
-
type: Input
|
|
676
|
-
}], successUpload: [{
|
|
677
|
-
type: Output
|
|
678
|
-
}], fileAdded: [{
|
|
679
|
-
type: Output
|
|
680
|
-
}], fileDeleted: [{
|
|
681
|
-
type: Output
|
|
682
|
-
}] } });
|
|
683
|
-
|
|
684
|
-
class RecaptchaComponent {
|
|
685
|
-
constructor(controlDir) {
|
|
686
|
-
this.controlDir = controlDir;
|
|
687
|
-
this.siteKey = '6LefJQYdAAAAAIlxmfkjNlWidMk8VukIZcs6lO5e';
|
|
688
|
-
this.recaptchaSize = 'normal';
|
|
689
|
-
this.lang = 'ar';
|
|
690
|
-
this.recaptchaType = 'image';
|
|
691
|
-
this.theme = 'light';
|
|
692
|
-
this.useGlobalDomain = true;
|
|
693
|
-
this.formControl = new FormControl('');
|
|
694
|
-
this.controlDir.valueAccessor = this;
|
|
695
|
-
}
|
|
696
|
-
ngOnInit() {
|
|
697
|
-
const control = this.controlDir.control;
|
|
698
|
-
const validators = (control === null || control === void 0 ? void 0 : control.validator) ? [control.validator] : [];
|
|
699
|
-
control === null || control === void 0 ? void 0 : control.setValidators(validators);
|
|
700
|
-
control === null || control === void 0 ? void 0 : control.updateValueAndValidity();
|
|
701
|
-
this.formControl = control;
|
|
702
|
-
}
|
|
703
|
-
onChange(event) { }
|
|
704
|
-
onTouched() { }
|
|
705
|
-
writeValue(obj) { }
|
|
706
|
-
registerOnChange(fn) {
|
|
707
|
-
this.onChange = fn;
|
|
708
|
-
}
|
|
709
|
-
registerOnTouched(fn) {
|
|
710
|
-
this.onTouched = fn;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
RecaptchaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: RecaptchaComponent, deps: [{ token: i2$1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
714
|
-
RecaptchaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: RecaptchaComponent, selector: "ipa-recaptcha", inputs: { siteKey: "siteKey", recaptchaSize: "recaptchaSize", lang: "lang", recaptchaType: "recaptchaType", theme: "theme", useGlobalDomain: "useGlobalDomain" }, ngImport: i0, template: "<ngx-recaptcha2 [siteKey]=\"siteKey\" [size]=\"recaptchaSize\" [hl]=\"lang\" [theme]=\"theme\" [type]=\"recaptchaType\"\n [useGlobalDomain]=\"useGlobalDomain\" [formControl]=\"formControl\">\n</ngx-recaptcha2>", styles: [""], components: [{ type: i2$3.ReCaptcha2Component, selector: "ngx-recaptcha2", inputs: ["theme", "size", "hl"] }], directives: [{ type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
|
|
715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: RecaptchaComponent, decorators: [{
|
|
716
|
-
type: Component,
|
|
717
|
-
args: [{
|
|
718
|
-
selector: 'ipa-recaptcha',
|
|
719
|
-
templateUrl: './recaptcha.component.html',
|
|
720
|
-
styleUrls: ['./recaptcha.component.scss'],
|
|
721
|
-
}]
|
|
722
|
-
}], ctorParameters: function () { return [{ type: i2$1.NgControl, decorators: [{
|
|
723
|
-
type: Self
|
|
724
|
-
}] }]; }, propDecorators: { siteKey: [{
|
|
725
|
-
type: Input
|
|
726
|
-
}], recaptchaSize: [{
|
|
727
|
-
type: Input
|
|
728
|
-
}], lang: [{
|
|
729
|
-
type: Input
|
|
730
|
-
}], recaptchaType: [{
|
|
731
|
-
type: Input
|
|
732
|
-
}], theme: [{
|
|
733
|
-
type: Input
|
|
734
|
-
}], useGlobalDomain: [{
|
|
735
|
-
type: Input
|
|
736
|
-
}] } });
|
|
737
|
-
|
|
738
|
-
class GenerateFormComponent {
|
|
739
|
-
constructor(validationService) {
|
|
740
|
-
this.validationService = validationService;
|
|
741
|
-
this.recaptchaSize = 'normal';
|
|
742
|
-
this.lang = 'ar';
|
|
743
|
-
this.recaptchaType = 'image';
|
|
744
|
-
this.theme = 'light';
|
|
745
|
-
this.useGlobalDomain = true;
|
|
746
|
-
// file upload outputs
|
|
747
|
-
this.successUpload = new EventEmitter();
|
|
748
|
-
this.fileAdded = new EventEmitter();
|
|
749
|
-
this.fileDeleted = new EventEmitter();
|
|
750
|
-
}
|
|
751
|
-
ngOnInit() {
|
|
752
|
-
this.createForm();
|
|
753
|
-
}
|
|
754
|
-
get formControls() {
|
|
755
|
-
return this.generateForm.get('items');
|
|
756
|
-
}
|
|
757
|
-
getErrorMessage(formControlName) {
|
|
758
|
-
const formControl = this.generateForm.controls[formControlName];
|
|
759
|
-
this.errorMsg = this.validationService.getErrorMessage(formControl);
|
|
760
|
-
return this.errorMsg;
|
|
761
|
-
}
|
|
762
|
-
SuccessUpload(event) {
|
|
763
|
-
this.successUpload.emit(event);
|
|
764
|
-
}
|
|
765
|
-
FileAdded(file, formControlName) {
|
|
766
|
-
this.generateForm.controls[formControlName].patchValue(file);
|
|
767
|
-
this.fileAdded.emit(file);
|
|
768
|
-
}
|
|
769
|
-
FileDeleted(event, formControlName) {
|
|
770
|
-
this.generateForm.controls[formControlName].patchValue(null);
|
|
771
|
-
this.fileDeleted.emit(event);
|
|
772
|
-
}
|
|
773
|
-
createForm() {
|
|
774
|
-
this.form.columns.forEach((column) => {
|
|
775
|
-
if (column.type === 'checkbox') {
|
|
776
|
-
this.addCheckboxControl(column);
|
|
777
|
-
}
|
|
778
|
-
else {
|
|
779
|
-
this.generateForm.addControl(column.englishName, new FormControl(null, [
|
|
780
|
-
column.required ? Validators.required : Validators.nullValidator,
|
|
781
|
-
Validators.maxLength(column.size),
|
|
782
|
-
column.type === 'number'
|
|
783
|
-
? Validators.min(1)
|
|
784
|
-
: Validators.nullValidator,
|
|
785
|
-
]));
|
|
786
|
-
}
|
|
787
|
-
});
|
|
788
|
-
}
|
|
789
|
-
addCheckboxControl(column) {
|
|
790
|
-
let checkboxGroup = new FormArray(column.data.map((item) => {
|
|
791
|
-
return new FormGroup({
|
|
792
|
-
[column.valueField]: new FormControl(item[column.valueField]),
|
|
793
|
-
[column.textField]: new FormControl(item[column.textField]),
|
|
794
|
-
checkbox: new FormControl(false, Validators.required),
|
|
795
|
-
});
|
|
796
|
-
}));
|
|
797
|
-
this.generateForm.addControl(column.englishName, new FormControl(null, column.required ? Validators.required : Validators.nullValidator));
|
|
798
|
-
this.generateForm.addControl('items', checkboxGroup);
|
|
799
|
-
checkboxGroup.valueChanges.subscribe((value) => {
|
|
800
|
-
if (this.getCheckboxSelectedValues(value)) {
|
|
801
|
-
this.generateForm.controls[column.englishName].patchValue(value);
|
|
802
|
-
}
|
|
803
|
-
else {
|
|
804
|
-
this.generateForm.controls[column.englishName].patchValue(null);
|
|
805
|
-
this.generateForm.controls[column.englishName].markAsTouched();
|
|
806
|
-
}
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
getCheckboxSelectedValues(items) {
|
|
810
|
-
let selectedItems = items.filter((item) => item.checkbox);
|
|
811
|
-
return selectedItems.length > 0 ? selectedItems : null;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
GenerateFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: GenerateFormComponent, deps: [{ token: IPAFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
815
|
-
GenerateFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: GenerateFormComponent, selector: "ipa-generate-form", inputs: { generateForm: "generateForm", form: "form", siteKey: "siteKey", recaptchaSize: "recaptchaSize", lang: "lang", recaptchaType: "recaptchaType", theme: "theme", useGlobalDomain: "useGlobalDomain" }, outputs: { successUpload: "successUpload", fileAdded: "fileAdded", fileDeleted: "fileDeleted" }, ngImport: i0, template: "<form [formGroup]=\"generateForm\">\r\n <ng-container *ngFor=\"let column of form.columns\">\r\n <div [ngSwitch]=\"column.type\">\r\n <!-- TEXTAREA -->\r\n <div *ngSwitchCase=\"'textArea'\">\r\n <ipa-textarea-input [formControlName]=\"column.englishName\" [id]=\"column.englishName\"\r\n [label]=\"column.arabicLabel\" [required]=\"column.required\" [pattern]=\"column.validationPattern!\"\r\n [patternErrorMsg]=\"column.patternErrorMsg!\" [classes]=\"column.inputClasses!\"\r\n [containerClasses]=\"column.containerClasses!\"></ipa-textarea-input>\r\n </div>\r\n\r\n <!-- DROP DOWN LIST -->\r\n <div *ngSwitchCase=\"'select'\">\r\n <ipa-dropdown-input [formControlName]=\"column.englishName\" [id]=\"column.englishName\"\r\n [label]=\"column.arabicLabel\" [items]=\"column.data!\" [valueField]=\"column.valueField!\"\r\n [textField]=\"column.textField!\" [required]=\"column.required\" [classes]=\"column.inputClasses!\"\r\n [containerClasses]=\"column.containerClasses!\">\r\n </ipa-dropdown-input>\r\n </div>\r\n\r\n <!-- CHECKBOX -->\r\n <div *ngSwitchCase=\"'checkbox'\">\r\n <label [for]=\"column.englishName\">{{column.arabicLabel}}</label>\r\n <div [formArrayName]=\"'items'\" *ngFor=\"let control of formControls.controls; let i = index\">\r\n <div [formGroupName]=\"i\" [id]=\"column.englishName\">\r\n <div class=\"form-check\">\r\n <input [id]=\"column.englishName+control.value[column.valueField!]\" class=\"form-check-input\" type=\"checkbox\"\r\n formControlName=\"checkbox\">\r\n <label class=\"form-check-label\" [for]=\"column.englishName+control.value[column.valueField!]\">\r\n {{control.value[column.textField!]}}\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"invalid-feedback\" style=\"display: block !important;\"\r\n *ngIf=\"getErrorMessage(column.englishName) !== null\">\r\n {{errorMsg}}\r\n </div>\r\n </div>\r\n\r\n <!-- RADIO -->\r\n <div *ngSwitchCase=\"'radio'\">\r\n <label [for]=\"column.englishName\">{{column.arabicLabel}}</label>\r\n <div *ngFor=\"let item of column.data; let i = index\" [id]=\"column.englishName\">\r\n <div class=\"form-check\">\r\n <input [id]=\"column.englishName+item[column.valueField!]\" class=\"form-check-input\" type=\"radio\"\r\n [formControlName]=\"column.englishName\" [value]=\"item[column.valueField!]\">\r\n <label class=\"form-check-label\" [for]=\"column.englishName+item[column.valueField!]\">\r\n {{item[column.textField!]}}\r\n </label>\r\n </div>\r\n </div>\r\n <div class=\"invalid-feedback\" style=\"display: block !important;\"\r\n *ngIf=\"getErrorMessage(column.englishName) !== null\">\r\n {{errorMsg}}\r\n </div>\r\n </div>\r\n\r\n <!-- FILE UPLOAD -->\r\n <div *ngSwitchCase=\"'file'\">\r\n <ipa-file-upload [label]=\"column.arabicLabel\" [acceptedFiles]=\"column.acceptedFiles!\"\r\n [multiple]=\"column.multipleFile!\" [maxFileSize]=\"column.size!\" [method]=\"column.apiURlMethod!\"\r\n [autoUpload]=\"column.autoUploadFile!\" [apiUrl]=\"column.apiUrl?? 'apiUrl' \" [authorization]=\"column.authorization!\"\r\n ngDefaultControl [formControlName]=\"column.englishName\" (successUpload)=\"SuccessUpload($event)\"\r\n (fileAdded)=\"FileAdded($event, column.englishName)\"\r\n (fileDeleted)=\"FileDeleted($event, column.englishName)\"></ipa-file-upload>\r\n </div>\r\n\r\n <!-- recaptcha -->\r\n <div *ngSwitchCase=\"'recaptcha'\">\r\n <ipa-recaptcha [recaptchaSize]=\"recaptchaSize\" [lang]=\"lang\" [theme]=\"theme\"\r\n [recaptchaType]=\"recaptchaType\" [useGlobalDomain]=\"useGlobalDomain\"\r\n formControlName=\"{{column.englishName}}\"></ipa-recaptcha>\r\n </div>\r\n\r\n <!-- DEFAULT -->\r\n <div *ngSwitchDefault>\r\n <ipa-text-input [formControlName]=\"column.englishName\" [id]=\"column.englishName\" [type]=\"column.type\"\r\n [label]=\"column.arabicLabel\" [required]=\"column.required\" [pattern]=\"column.validationPattern!\"\r\n [patternErrorMsg]=\"column.patternErrorMsg!\" [classes]=\"column.inputClasses!\"\r\n [containerClasses]=\"column.containerClasses!\"></ipa-text-input>\r\n </div>\r\n </div>\r\n </ng-container>\r\n</form>", styles: [""], components: [{ type: TextareaInputComponent, selector: "ipa-textarea-input", inputs: ["id", "placeholder", "label", "required", "patternErrorMsg", "pattern", "classes", "containerClasses"] }, { type: DropdownInputComponent, selector: "ipa-dropdown-input", inputs: ["id", "label", "items", "textField", "valueField", "required", "searchable", "notFoundText", "classes", "containerClasses"] }, { type: FileUploadComponent, selector: "ipa-file-upload", inputs: ["label", "required", "acceptedFiles", "multiple", "maxFileSize", "method", "autoUpload", "apiUrl", "authorization"], outputs: ["successUpload", "fileAdded", "fileDeleted"] }, { type: RecaptchaComponent, selector: "ipa-recaptcha", inputs: ["siteKey", "recaptchaSize", "lang", "recaptchaType", "theme", "useGlobalDomain"] }, { type: TextInputComponent, selector: "ipa-text-input", inputs: ["id", "type", "placeholder", "label", "required", "patternErrorMsg", "pattern", "classes", "containerClasses"] }], directives: [{ type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i2$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i2$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
|
|
816
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: GenerateFormComponent, decorators: [{
|
|
817
|
-
type: Component,
|
|
818
|
-
args: [{
|
|
819
|
-
selector: 'ipa-generate-form',
|
|
820
|
-
templateUrl: './generate-form.component.html',
|
|
821
|
-
styleUrls: ['./generate-form.component.scss'],
|
|
822
|
-
}]
|
|
823
|
-
}], ctorParameters: function () { return [{ type: IPAFormService }]; }, propDecorators: { generateForm: [{
|
|
824
|
-
type: Input
|
|
825
|
-
}], form: [{
|
|
826
|
-
type: Input
|
|
827
|
-
}], siteKey: [{
|
|
828
|
-
type: Input
|
|
829
|
-
}], recaptchaSize: [{
|
|
830
|
-
type: Input
|
|
831
|
-
}], lang: [{
|
|
832
|
-
type: Input
|
|
833
|
-
}], recaptchaType: [{
|
|
834
|
-
type: Input
|
|
835
|
-
}], theme: [{
|
|
836
|
-
type: Input
|
|
837
|
-
}], useGlobalDomain: [{
|
|
838
|
-
type: Input
|
|
839
|
-
}], successUpload: [{
|
|
840
|
-
type: Output
|
|
841
|
-
}], fileAdded: [{
|
|
842
|
-
type: Output
|
|
843
|
-
}], fileDeleted: [{
|
|
844
|
-
type: Output
|
|
845
|
-
}] } });
|
|
846
|
-
|
|
847
|
-
class DatepickerComponent {
|
|
848
|
-
constructor(ipaFormService, calendar, controlDir, config) {
|
|
849
|
-
this.ipaFormService = ipaFormService;
|
|
850
|
-
this.calendar = calendar;
|
|
851
|
-
this.controlDir = controlDir;
|
|
852
|
-
this.label = 'datepicker';
|
|
853
|
-
this.patternErrorMsg = 'invalid pattern';
|
|
854
|
-
this.required = false;
|
|
855
|
-
this.today = this.calendar.getToday();
|
|
856
|
-
this.formControl = new FormControl('');
|
|
857
|
-
this.controlDir.valueAccessor = this;
|
|
858
|
-
config.container = 'body';
|
|
859
|
-
}
|
|
860
|
-
ngOnInit() {
|
|
861
|
-
const control = this.controlDir.control;
|
|
862
|
-
const validators = (control === null || control === void 0 ? void 0 : control.validator) ? [control.validator] : [];
|
|
863
|
-
control === null || control === void 0 ? void 0 : control.setValidators(validators);
|
|
864
|
-
control === null || control === void 0 ? void 0 : control.updateValueAndValidity();
|
|
865
|
-
this.formControl = control;
|
|
866
|
-
}
|
|
867
|
-
onChange(event) { }
|
|
868
|
-
onTouched() { }
|
|
869
|
-
writeValue(obj) { }
|
|
870
|
-
registerOnChange(fn) {
|
|
871
|
-
this.onChange = fn;
|
|
872
|
-
}
|
|
873
|
-
registerOnTouched(fn) {
|
|
874
|
-
this.onTouched = fn;
|
|
875
|
-
}
|
|
876
|
-
get errorMessage() {
|
|
877
|
-
this.errorMsg = this.ipaFormService.getErrorMessage(this.formControl, this.patternErrorMsg);
|
|
878
|
-
return this.errorMsg;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
DatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: DatepickerComponent, deps: [{ token: IPAFormService }, { token: i2.NgbCalendar }, { token: i2$1.NgControl, self: true }, { token: i2.NgbInputDatepickerConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
882
|
-
DatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: DatepickerComponent, selector: "ipa-datepicker", inputs: { id: "id", label: "label", patternErrorMsg: "patternErrorMsg", required: "required", maxDate: "maxDate", minDate: "minDate", classes: "classes", containerClasses: "containerClasses" }, ngImport: i0, template: "<div class=\"form-floating input-group {{containerClasses}}\">\r\n <input id=\"{{id}}\"\r\n [ngClass]=\"{'is-invalid is-invalid:focus': (controlDir.control?.invalid && (controlDir.control?.dirty || controlDir.control?.touched)) && errorMsg,'is-valid is-valid:focus': (controlDir.control?.valid && (controlDir.control?.dirty || controlDir.control?.touched) && (errorMsg || controlDir.value))}\"\r\n class=\"form-control {{classes}}\" [formControl]=\"formControl\" [firstDayOfWeek]=\"7\" ngbDatepicker\r\n #d=\"ngbDatepicker\" [maxDate]=\"maxDate\" [minDate]=\"minDate\" [footerTemplate]=\"footerTemplate\"\r\n [required]=\"required\" style=\"outline: unset; z-index: unset !important;\" autocomplete=\"off\" (blur)=\"onTouched()\" title=\"{{label}}\">\r\n <label for=\"{{id}}\">{{label}}</label>\r\n <span class=\"input-group-text calenderBtn\" (click)=\"d.toggle()\">\r\n <i class=\"far fa-calendar-alt fa-lg\"></i>\r\n </span>\r\n <div class=\"invalid-feedback\" *ngIf=\"errorMessage !== null\">\r\n {{errorMsg}}\r\n </div>\r\n <ng-template #footerTemplate style=\"text-align: center;\">\r\n <hr>\r\n <button type=\"button\" class=\"btn btn-primary btn-sm m-2 \" style=\"width: auto; float: right;\"\r\n (click)=\"formControl.patchValue(today);d.navigateTo(today);\">\u0627\u0644\u064A\u0648\u0645</button>\r\n <button type=\"button\" class=\"btn btn-secondary btn-sm m-2\" style=\"width: auto; float: left;\"\r\n (click)=\"formControl.patchValue(null);d.close()\">\u0645\u0633\u062D</button>\r\n </ng-template>\r\n</div>", styles: [".calenderBtn{cursor:pointer;background-color:transparent;color:#6c757d;border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.calenderBtn:hover{color:#fff;background-color:#6c757d;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}\n"], directives: [{ type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["disabled", "autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
883
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
884
|
-
type: Component,
|
|
885
|
-
args: [{
|
|
886
|
-
selector: 'ipa-datepicker',
|
|
887
|
-
templateUrl: './datepicker.component.html',
|
|
888
|
-
styleUrls: ['./datepicker.component.scss'],
|
|
889
|
-
}]
|
|
890
|
-
}], ctorParameters: function () { return [{ type: IPAFormService }, { type: i2.NgbCalendar }, { type: i2$1.NgControl, decorators: [{
|
|
891
|
-
type: Self
|
|
892
|
-
}] }, { type: i2.NgbInputDatepickerConfig }]; }, propDecorators: { id: [{
|
|
893
|
-
type: Input
|
|
894
|
-
}], label: [{
|
|
895
|
-
type: Input
|
|
896
|
-
}], patternErrorMsg: [{
|
|
897
|
-
type: Input
|
|
898
|
-
}], required: [{
|
|
899
|
-
type: Input
|
|
900
|
-
}], maxDate: [{
|
|
901
|
-
type: Input
|
|
902
|
-
}], minDate: [{
|
|
903
|
-
type: Input
|
|
904
|
-
}], classes: [{
|
|
905
|
-
type: Input
|
|
906
|
-
}], containerClasses: [{
|
|
907
|
-
type: Input
|
|
908
|
-
}] } });
|
|
909
|
-
|
|
910
|
-
const WEEKDAYS$1 = ['ن', 'ث', 'ر', 'خ', 'ج', 'س', 'ح'];
|
|
911
|
-
const MONTHS$1 = [
|
|
912
|
-
'محرم',
|
|
913
|
-
'صفر',
|
|
914
|
-
'ربيع الأول',
|
|
915
|
-
'ربيع الآخر',
|
|
916
|
-
'جمادى الأولى',
|
|
917
|
-
'جمادى الآخرة',
|
|
918
|
-
'رجب',
|
|
919
|
-
'شعبان',
|
|
920
|
-
'رمضان',
|
|
921
|
-
'شوال',
|
|
922
|
-
'ذو القعدة',
|
|
923
|
-
'ذو الحجة',
|
|
924
|
-
];
|
|
925
|
-
class IslamicI18n extends NgbDatepickerI18n {
|
|
926
|
-
getMonthShortName(month) {
|
|
927
|
-
return MONTHS$1[month - 1];
|
|
928
|
-
}
|
|
929
|
-
getMonthFullName(month) {
|
|
930
|
-
return MONTHS$1[month - 1];
|
|
931
|
-
}
|
|
932
|
-
getWeekdayLabel(weekday, width) {
|
|
933
|
-
return WEEKDAYS$1[weekday - 1];
|
|
934
|
-
}
|
|
935
|
-
getDayAriaLabel(date) {
|
|
936
|
-
return `${date.day}-${date.month}-${date.year}`;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
IslamicI18n.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: IslamicI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
940
|
-
IslamicI18n.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: IslamicI18n });
|
|
941
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: IslamicI18n, decorators: [{
|
|
942
|
-
type: Injectable
|
|
943
|
-
}] });
|
|
944
|
-
|
|
945
|
-
class HijriDatepickerComponent extends DatepickerComponent {
|
|
946
|
-
}
|
|
947
|
-
HijriDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: HijriDatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
948
|
-
HijriDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: HijriDatepickerComponent, selector: "ipa-hijri-datepicker", providers: [
|
|
949
|
-
{ provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura },
|
|
950
|
-
{ provide: NgbDatepickerI18n, useClass: IslamicI18n },
|
|
951
|
-
], usesInheritance: true, ngImport: i0, template: "<div class=\"form-floating input-group {{containerClasses}}\">\r\n <input id=\"{{id}}\"\r\n [ngClass]=\"{'is-invalid is-invalid:focus': (controlDir.control?.invalid && (controlDir.control?.dirty || controlDir.control?.touched)) && errorMsg,'is-valid is-valid:focus': (controlDir.control?.valid && (controlDir.control?.dirty || controlDir.control?.touched) && (errorMsg || controlDir.value))}\"\r\n class=\"form-control {{classes}}\" [formControl]=\"formControl\" [firstDayOfWeek]=\"7\" ngbDatepicker\r\n #d=\"ngbDatepicker\" [maxDate]=\"maxDate\" [minDate]=\"minDate\" [footerTemplate]=\"footerTemplate\"\r\n [required]=\"required\" style=\"outline: unset; z-index: unset !important;\" autocomplete=\"off\" (blur)=\"onTouched()\" title=\"{{label}}\">\r\n <label for=\"{{id}}\">{{label}}</label>\r\n <span class=\"input-group-text calenderBtn\" (click)=\"d.toggle()\">\r\n <i class=\"far fa-calendar-alt fa-lg\"></i>\r\n </span>\r\n <div class=\"invalid-feedback\" *ngIf=\"errorMessage !== null\">\r\n {{errorMsg}}\r\n </div>\r\n <ng-template #footerTemplate style=\"text-align: center;\">\r\n <hr>\r\n <button type=\"button\" class=\"btn btn-primary btn-sm m-2 \" style=\"width: auto; float: right;\"\r\n (click)=\"formControl.patchValue(today);d.navigateTo(today);\">\u0627\u0644\u064A\u0648\u0645</button>\r\n <button type=\"button\" class=\"btn btn-secondary btn-sm m-2\" style=\"width: auto; float: left;\"\r\n (click)=\"formControl.patchValue(null);d.close()\">\u0645\u0633\u062D</button>\r\n </ng-template>\r\n</div>", styles: [".calenderBtn{cursor:pointer;background-color:transparent;color:#6c757d;border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.calenderBtn:hover{color:#fff;background-color:#6c757d;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}\n"], directives: [{ type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["disabled", "autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
952
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: HijriDatepickerComponent, decorators: [{
|
|
953
|
-
type: Component,
|
|
954
|
-
args: [{
|
|
955
|
-
selector: 'ipa-hijri-datepicker',
|
|
956
|
-
templateUrl: '../datepicker.component.html',
|
|
957
|
-
styleUrls: ['../datepicker.component.scss'],
|
|
958
|
-
providers: [
|
|
959
|
-
{ provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura },
|
|
960
|
-
{ provide: NgbDatepickerI18n, useClass: IslamicI18n },
|
|
961
|
-
],
|
|
962
|
-
}]
|
|
963
|
-
}] });
|
|
964
|
-
|
|
965
|
-
const WEEKDAYS = ['ن', 'ث', 'ر', 'خ', 'ج', 'س', 'ح'];
|
|
966
|
-
const MONTHS = [
|
|
967
|
-
'يناير',
|
|
968
|
-
'فبراير',
|
|
969
|
-
'مارس',
|
|
970
|
-
'أبريل',
|
|
971
|
-
'مايو',
|
|
972
|
-
'يونيو',
|
|
973
|
-
'يوليو',
|
|
974
|
-
'اغسطس',
|
|
975
|
-
'سبتمبر',
|
|
976
|
-
'أكتوبر',
|
|
977
|
-
'نوفمبر',
|
|
978
|
-
'ديسمبر',
|
|
979
|
-
];
|
|
980
|
-
class Gregorian18n extends NgbDatepickerI18n {
|
|
981
|
-
getMonthShortName(month) {
|
|
982
|
-
return MONTHS[month - 1];
|
|
983
|
-
}
|
|
984
|
-
getMonthFullName(month) {
|
|
985
|
-
return MONTHS[month - 1];
|
|
986
|
-
}
|
|
987
|
-
getWeekdayLabel(weekday, width) {
|
|
988
|
-
return WEEKDAYS[weekday - 1];
|
|
989
|
-
}
|
|
990
|
-
getDayAriaLabel(date) {
|
|
991
|
-
return `${date.day}-${date.month}-${date.year}`;
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
Gregorian18n.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: Gregorian18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
995
|
-
Gregorian18n.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: Gregorian18n });
|
|
996
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: Gregorian18n, decorators: [{
|
|
997
|
-
type: Injectable
|
|
998
|
-
}] });
|
|
999
|
-
|
|
1000
|
-
class GregorianDatepickerComponent extends DatepickerComponent {
|
|
1001
|
-
}
|
|
1002
|
-
GregorianDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: GregorianDatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1003
|
-
GregorianDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: GregorianDatepickerComponent, selector: "ipa-gregorian-datepicker", providers: [
|
|
1004
|
-
{ provide: NgbCalendar, useClass: NgbCalendarGregorian },
|
|
1005
|
-
{ provide: NgbDatepickerI18n, useClass: Gregorian18n },
|
|
1006
|
-
], usesInheritance: true, ngImport: i0, template: "<div class=\"form-floating input-group {{containerClasses}}\">\r\n <input id=\"{{id}}\"\r\n [ngClass]=\"{'is-invalid is-invalid:focus': (controlDir.control?.invalid && (controlDir.control?.dirty || controlDir.control?.touched)) && errorMsg,'is-valid is-valid:focus': (controlDir.control?.valid && (controlDir.control?.dirty || controlDir.control?.touched) && (errorMsg || controlDir.value))}\"\r\n class=\"form-control {{classes}}\" [formControl]=\"formControl\" [firstDayOfWeek]=\"7\" ngbDatepicker\r\n #d=\"ngbDatepicker\" [maxDate]=\"maxDate\" [minDate]=\"minDate\" [footerTemplate]=\"footerTemplate\"\r\n [required]=\"required\" style=\"outline: unset; z-index: unset !important;\" autocomplete=\"off\" (blur)=\"onTouched()\" title=\"{{label}}\">\r\n <label for=\"{{id}}\">{{label}}</label>\r\n <span class=\"input-group-text calenderBtn\" (click)=\"d.toggle()\">\r\n <i class=\"far fa-calendar-alt fa-lg\"></i>\r\n </span>\r\n <div class=\"invalid-feedback\" *ngIf=\"errorMessage !== null\">\r\n {{errorMsg}}\r\n </div>\r\n <ng-template #footerTemplate style=\"text-align: center;\">\r\n <hr>\r\n <button type=\"button\" class=\"btn btn-primary btn-sm m-2 \" style=\"width: auto; float: right;\"\r\n (click)=\"formControl.patchValue(today);d.navigateTo(today);\">\u0627\u0644\u064A\u0648\u0645</button>\r\n <button type=\"button\" class=\"btn btn-secondary btn-sm m-2\" style=\"width: auto; float: left;\"\r\n (click)=\"formControl.patchValue(null);d.close()\">\u0645\u0633\u062D</button>\r\n </ng-template>\r\n</div>", styles: [".calenderBtn{cursor:pointer;background-color:transparent;color:#6c757d;border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.calenderBtn:hover{color:#fff;background-color:#6c757d;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}\n"], directives: [{ type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["disabled", "autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1007
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: GregorianDatepickerComponent, decorators: [{
|
|
1008
|
-
type: Component,
|
|
1009
|
-
args: [{
|
|
1010
|
-
selector: 'ipa-gregorian-datepicker',
|
|
1011
|
-
templateUrl: '../datepicker.component.html',
|
|
1012
|
-
styleUrls: ['../datepicker.component.scss'],
|
|
1013
|
-
providers: [
|
|
1014
|
-
{ provide: NgbCalendar, useClass: NgbCalendarGregorian },
|
|
1015
|
-
{ provide: NgbDatepickerI18n, useClass: Gregorian18n },
|
|
1016
|
-
],
|
|
1017
|
-
}]
|
|
1018
|
-
}] });
|
|
1019
|
-
|
|
1020
|
-
class ShareButtonComponent {
|
|
1021
|
-
constructor() {
|
|
1022
|
-
this.title = '';
|
|
1023
|
-
this.description = '';
|
|
1024
|
-
this.btnLabel = '';
|
|
1025
|
-
}
|
|
1026
|
-
ngAfterViewInit() {
|
|
1027
|
-
const elements = document.getElementsByClassName('sb-show-icon');
|
|
1028
|
-
elements[0].setAttribute('type', 'button');
|
|
1029
|
-
elements[0].setAttribute('id', 'IPAShareBtn');
|
|
1030
|
-
const label = document.createElement('label');
|
|
1031
|
-
label.innerHTML = this.btnLabel;
|
|
1032
|
-
label.classList.add('sm-share-title');
|
|
1033
|
-
label.classList.add('me-1');
|
|
1034
|
-
elements[0].before(label);
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
ShareButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ShareButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1038
|
-
ShareButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: ShareButtonComponent, selector: "ipa-share-button", inputs: { title: "title", description: "description", btnLabel: "btnLabel" }, ngImport: i0, template: "<share-popup-button [title]=\"title\" [description]=\"description\" [icon]=\"'share-alt'\"\r\n [include]=\"['facebook','twitter','linkedin','telegram','whatsapp','email','copy']\">\r\n</share-popup-button>", styles: [""], components: [{ type: i1$1.SharePopupComponent, selector: "share-popup-button", inputs: ["theme", "icon", "text", "include", "exclude", "closeIcon", "url", "title", "description", "image", "tags", "autoSetMeta", "show", "showIcon", "showText", "disabled", "hasBackdrop", "backdropClass"], outputs: ["opened", "closed", "popupClosed"] }] });
|
|
1039
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ShareButtonComponent, decorators: [{
|
|
1040
|
-
type: Component,
|
|
1041
|
-
args: [{
|
|
1042
|
-
selector: 'ipa-share-button',
|
|
1043
|
-
templateUrl: './share-button.component.html',
|
|
1044
|
-
styleUrls: ['./share-button.component.scss'],
|
|
1045
|
-
}]
|
|
1046
|
-
}], ctorParameters: function () { return []; }, propDecorators: { title: [{
|
|
1047
|
-
type: Input
|
|
1048
|
-
}], description: [{
|
|
1049
|
-
type: Input
|
|
1050
|
-
}], btnLabel: [{
|
|
1051
|
-
type: Input
|
|
1052
|
-
}] } });
|
|
1053
|
-
|
|
1054
|
-
class ShareButtonModule {
|
|
1055
|
-
constructor(library) {
|
|
1056
|
-
library.addIconPacks(fas);
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
ShareButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ShareButtonModule, deps: [{ token: i1$2.FaIconLibrary }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1060
|
-
ShareButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ShareButtonModule, declarations: [ShareButtonComponent], imports: [ShareIconsModule,
|
|
1061
|
-
ShareButtonsPopupModule,
|
|
1062
|
-
OverlayModule,
|
|
1063
|
-
FontAwesomeModule], exports: [ShareButtonComponent,
|
|
1064
|
-
ShareIconsModule,
|
|
1065
|
-
ShareButtonsPopupModule,
|
|
1066
|
-
OverlayModule,
|
|
1067
|
-
FontAwesomeModule] });
|
|
1068
|
-
ShareButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ShareButtonModule, imports: [[
|
|
1069
|
-
ShareIconsModule,
|
|
1070
|
-
ShareButtonsPopupModule,
|
|
1071
|
-
OverlayModule,
|
|
1072
|
-
FontAwesomeModule,
|
|
1073
|
-
], ShareIconsModule,
|
|
1074
|
-
ShareButtonsPopupModule,
|
|
1075
|
-
OverlayModule,
|
|
1076
|
-
FontAwesomeModule] });
|
|
1077
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ShareButtonModule, decorators: [{
|
|
1078
|
-
type: NgModule,
|
|
1079
|
-
args: [{
|
|
1080
|
-
declarations: [ShareButtonComponent],
|
|
1081
|
-
imports: [
|
|
1082
|
-
ShareIconsModule,
|
|
1083
|
-
ShareButtonsPopupModule,
|
|
1084
|
-
OverlayModule,
|
|
1085
|
-
FontAwesomeModule,
|
|
1086
|
-
],
|
|
1087
|
-
exports: [
|
|
1088
|
-
ShareButtonComponent,
|
|
1089
|
-
ShareIconsModule,
|
|
1090
|
-
ShareButtonsPopupModule,
|
|
1091
|
-
OverlayModule,
|
|
1092
|
-
FontAwesomeModule,
|
|
1093
|
-
]
|
|
1094
|
-
}]
|
|
1095
|
-
}], ctorParameters: function () { return [{ type: i1$2.FaIconLibrary }]; } });
|
|
1096
|
-
|
|
1097
|
-
class NgIPALibraryModule {
|
|
1098
|
-
}
|
|
1099
|
-
NgIPALibraryModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NgIPALibraryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1100
|
-
NgIPALibraryModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NgIPALibraryModule, declarations: [TextInputComponent,
|
|
1101
|
-
TextareaInputComponent,
|
|
1102
|
-
DropdownInputComponent,
|
|
1103
|
-
LoaderComponent,
|
|
1104
|
-
GenerateFormComponent,
|
|
1105
|
-
FileUploadComponent,
|
|
1106
|
-
DatepickerComponent,
|
|
1107
|
-
HijriDatepickerComponent,
|
|
1108
|
-
GregorianDatepickerComponent,
|
|
1109
|
-
RecaptchaComponent], imports: [CommonModule,
|
|
1110
|
-
FormsModule,
|
|
1111
|
-
ReactiveFormsModule,
|
|
1112
|
-
ToastrModule,
|
|
1113
|
-
DropzoneModule,
|
|
1114
|
-
NgxCaptchaModule,
|
|
1115
|
-
PipesModule,
|
|
1116
|
-
NgbDatepickerModule,
|
|
1117
|
-
ShareButtonModule,
|
|
1118
|
-
NgSelectModule], exports: [TextInputComponent,
|
|
1119
|
-
TextareaInputComponent,
|
|
1120
|
-
DropdownInputComponent,
|
|
1121
|
-
LoaderComponent,
|
|
1122
|
-
GenerateFormComponent,
|
|
1123
|
-
FileUploadComponent,
|
|
1124
|
-
PipesModule,
|
|
1125
|
-
HijriDatepickerComponent,
|
|
1126
|
-
GregorianDatepickerComponent,
|
|
1127
|
-
ShareButtonModule,
|
|
1128
|
-
RecaptchaComponent] });
|
|
1129
|
-
NgIPALibraryModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NgIPALibraryModule, imports: [[
|
|
1130
|
-
CommonModule,
|
|
1131
|
-
FormsModule,
|
|
1132
|
-
ReactiveFormsModule,
|
|
1133
|
-
ToastrModule,
|
|
1134
|
-
DropzoneModule,
|
|
1135
|
-
NgxCaptchaModule,
|
|
1136
|
-
PipesModule,
|
|
1137
|
-
NgbDatepickerModule,
|
|
1138
|
-
ShareButtonModule,
|
|
1139
|
-
NgSelectModule,
|
|
1140
|
-
], PipesModule,
|
|
1141
|
-
ShareButtonModule] });
|
|
1142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NgIPALibraryModule, decorators: [{
|
|
1143
|
-
type: NgModule,
|
|
1144
|
-
args: [{
|
|
1145
|
-
declarations: [
|
|
1146
|
-
TextInputComponent,
|
|
1147
|
-
TextareaInputComponent,
|
|
1148
|
-
DropdownInputComponent,
|
|
1149
|
-
LoaderComponent,
|
|
1150
|
-
GenerateFormComponent,
|
|
1151
|
-
FileUploadComponent,
|
|
1152
|
-
DatepickerComponent,
|
|
1153
|
-
HijriDatepickerComponent,
|
|
1154
|
-
GregorianDatepickerComponent,
|
|
1155
|
-
RecaptchaComponent,
|
|
1156
|
-
],
|
|
1157
|
-
imports: [
|
|
1158
|
-
CommonModule,
|
|
1159
|
-
FormsModule,
|
|
1160
|
-
ReactiveFormsModule,
|
|
1161
|
-
ToastrModule,
|
|
1162
|
-
DropzoneModule,
|
|
1163
|
-
NgxCaptchaModule,
|
|
1164
|
-
PipesModule,
|
|
1165
|
-
NgbDatepickerModule,
|
|
1166
|
-
ShareButtonModule,
|
|
1167
|
-
NgSelectModule,
|
|
1168
|
-
],
|
|
1169
|
-
exports: [
|
|
1170
|
-
TextInputComponent,
|
|
1171
|
-
TextareaInputComponent,
|
|
1172
|
-
DropdownInputComponent,
|
|
1173
|
-
LoaderComponent,
|
|
1174
|
-
GenerateFormComponent,
|
|
1175
|
-
FileUploadComponent,
|
|
1176
|
-
PipesModule,
|
|
1177
|
-
HijriDatepickerComponent,
|
|
1178
|
-
GregorianDatepickerComponent,
|
|
1179
|
-
ShareButtonModule,
|
|
1180
|
-
RecaptchaComponent,
|
|
1181
|
-
],
|
|
1182
|
-
}]
|
|
1183
|
-
}] });
|
|
1184
|
-
|
|
1185
|
-
class LoadingInterceptor {
|
|
1186
|
-
constructor(loaderService) {
|
|
1187
|
-
this.loaderService = loaderService;
|
|
1188
|
-
this.requests = [];
|
|
1189
|
-
}
|
|
1190
|
-
removeRequest(req) {
|
|
1191
|
-
const i = this.requests.indexOf(req);
|
|
1192
|
-
if (i >= 0) {
|
|
1193
|
-
this.requests.splice(i, 1);
|
|
1194
|
-
}
|
|
1195
|
-
this.loaderService.isLoading.next(this.requests.length > 0);
|
|
1196
|
-
}
|
|
1197
|
-
intercept(req, next) {
|
|
1198
|
-
if (this.isException(req)) {
|
|
1199
|
-
return next.handle(req);
|
|
1200
|
-
}
|
|
1201
|
-
this.requests.push(req);
|
|
1202
|
-
this.loaderService.isLoading.next(true);
|
|
1203
|
-
return new Observable((observer) => {
|
|
1204
|
-
const subscription = next.handle(req).subscribe((event) => {
|
|
1205
|
-
if (event instanceof HttpResponse) {
|
|
1206
|
-
this.removeRequest(req);
|
|
1207
|
-
observer.next(event);
|
|
1208
|
-
}
|
|
1209
|
-
}, (err) => {
|
|
1210
|
-
this.removeRequest(req);
|
|
1211
|
-
observer.error(err);
|
|
1212
|
-
}, () => {
|
|
1213
|
-
this.removeRequest(req);
|
|
1214
|
-
observer.complete();
|
|
1215
|
-
});
|
|
1216
|
-
// remove request from queue when cancelled
|
|
1217
|
-
return () => {
|
|
1218
|
-
this.removeRequest(req);
|
|
1219
|
-
subscription.unsubscribe();
|
|
1220
|
-
};
|
|
1221
|
-
});
|
|
1222
|
-
}
|
|
1223
|
-
isException(req) {
|
|
1224
|
-
for (const url of this.loaderService.urls) {
|
|
1225
|
-
if (req.url.includes(url.path) && req.method === url.method) {
|
|
1226
|
-
return true;
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
return false;
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
LoadingInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LoadingInterceptor, deps: [{ token: LoaderService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1233
|
-
LoadingInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LoadingInterceptor });
|
|
1234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LoadingInterceptor, decorators: [{
|
|
1235
|
-
type: Injectable
|
|
1236
|
-
}], ctorParameters: function () { return [{ type: LoaderService }]; } });
|
|
1237
|
-
|
|
1238
|
-
class ErrorService {
|
|
1239
|
-
constructor() {
|
|
1240
|
-
this.urls = [];
|
|
1241
|
-
}
|
|
1242
|
-
setExceptionUrls(urls) {
|
|
1243
|
-
this.urls = urls;
|
|
1244
|
-
}
|
|
1245
|
-
addExceptionUrl(url) {
|
|
1246
|
-
this.urls.push(url);
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
ErrorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1250
|
-
ErrorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ErrorService, providedIn: 'root' });
|
|
1251
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ErrorService, decorators: [{
|
|
1252
|
-
type: Injectable,
|
|
1253
|
-
args: [{
|
|
1254
|
-
providedIn: 'root'
|
|
1255
|
-
}]
|
|
1256
|
-
}], ctorParameters: function () { return []; } });
|
|
1257
|
-
|
|
1258
|
-
class ErrorInterceptor {
|
|
1259
|
-
constructor(errorService, toastrService) {
|
|
1260
|
-
this.errorService = errorService;
|
|
1261
|
-
this.toastrService = toastrService;
|
|
1262
|
-
}
|
|
1263
|
-
intercept(req, next) {
|
|
1264
|
-
if (this.isException(req)) {
|
|
1265
|
-
return next.handle(req);
|
|
1266
|
-
}
|
|
1267
|
-
return next.handle(req).pipe(catchError((error) => {
|
|
1268
|
-
const response = error.error;
|
|
1269
|
-
const toastrConfig = {
|
|
1270
|
-
disableTimeOut: true,
|
|
1271
|
-
};
|
|
1272
|
-
switch (response.statusCode) {
|
|
1273
|
-
case 500:
|
|
1274
|
-
this.toastrService.error((response === null || response === void 0 ? void 0 : response.innerException) + ' ' + (response === null || response === void 0 ? void 0 : response.stackTrace), response.message, toastrConfig);
|
|
1275
|
-
break;
|
|
1276
|
-
default:
|
|
1277
|
-
this.toastrService.error(response.message, '', toastrConfig);
|
|
1278
|
-
break;
|
|
1279
|
-
}
|
|
1280
|
-
return throwError(error);
|
|
1281
|
-
}));
|
|
1282
|
-
}
|
|
1283
|
-
isException(req) {
|
|
1284
|
-
for (const url of this.errorService.urls) {
|
|
1285
|
-
if (req.url.includes(url.path) && req.method === url.method) {
|
|
1286
|
-
return true;
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
return false;
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
ErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ErrorInterceptor, deps: [{ token: ErrorService }, { token: i1.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1293
|
-
ErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ErrorInterceptor });
|
|
1294
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ErrorInterceptor, decorators: [{
|
|
1295
|
-
type: Injectable
|
|
1296
|
-
}], ctorParameters: function () { return [{ type: ErrorService }, { type: i1.ToastrService }]; } });
|
|
1297
|
-
|
|
1298
|
-
class AuthService {
|
|
1299
|
-
constructor() {
|
|
1300
|
-
this.currentUser = new BehaviorSubject({ exp: 0 });
|
|
1301
|
-
this.currentUserUrl = '';
|
|
1302
|
-
}
|
|
1303
|
-
getToken() {
|
|
1304
|
-
var _a;
|
|
1305
|
-
return (_a = localStorage.getItem('token')) !== null && _a !== void 0 ? _a : '';
|
|
1306
|
-
}
|
|
1307
|
-
getDecodedToken() {
|
|
1308
|
-
return this.decodeJwt(this.getToken());
|
|
1309
|
-
}
|
|
1310
|
-
setCurrentUser() {
|
|
1311
|
-
const decodedToken = this.getDecodedToken();
|
|
1312
|
-
this.currentUser.next({
|
|
1313
|
-
nameid: decodedToken.nameid,
|
|
1314
|
-
email: decodedToken.email,
|
|
1315
|
-
given_name: decodedToken.given_name,
|
|
1316
|
-
exp: decodedToken.exp,
|
|
1317
|
-
});
|
|
1318
|
-
}
|
|
1319
|
-
setCurrentUserUrl(url) {
|
|
1320
|
-
this.currentUserUrl = url;
|
|
1321
|
-
}
|
|
1322
|
-
decodeJwt(token) {
|
|
1323
|
-
const base64Url = token.split('.')[1];
|
|
1324
|
-
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
1325
|
-
const jsonPayload = decodeURIComponent(atob(base64)
|
|
1326
|
-
.split('')
|
|
1327
|
-
.map((c) => {
|
|
1328
|
-
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
|
1329
|
-
})
|
|
1330
|
-
.join(''));
|
|
1331
|
-
return JSON.parse(jsonPayload);
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1335
|
-
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
1336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: AuthService, decorators: [{
|
|
1337
|
-
type: Injectable,
|
|
1338
|
-
args: [{
|
|
1339
|
-
providedIn: 'root',
|
|
1340
|
-
}]
|
|
1341
|
-
}], ctorParameters: function () { return []; } });
|
|
1342
|
-
|
|
1343
|
-
class TokenInterceptor {
|
|
1344
|
-
constructor(authService, http) {
|
|
1345
|
-
this.authService = authService;
|
|
1346
|
-
this.http = http;
|
|
1347
|
-
this.refresh = true;
|
|
1348
|
-
}
|
|
1349
|
-
intercept(request, next) {
|
|
1350
|
-
if (this.isException(request)) {
|
|
1351
|
-
return next.handle(request);
|
|
1352
|
-
}
|
|
1353
|
-
const token = this.authService.getToken();
|
|
1354
|
-
if (token) {
|
|
1355
|
-
this.isTokenExpired(token);
|
|
1356
|
-
request = request.clone({
|
|
1357
|
-
setHeaders: {
|
|
1358
|
-
Authorization: `Bearer ${token}`,
|
|
1359
|
-
},
|
|
1360
|
-
});
|
|
1361
|
-
}
|
|
1362
|
-
return next.handle(request);
|
|
1363
|
-
}
|
|
1364
|
-
isTokenExpired(token) {
|
|
1365
|
-
var _a;
|
|
1366
|
-
const redirectPath = location.pathname;
|
|
1367
|
-
const decodedToken = this.authService.getDecodedToken();
|
|
1368
|
-
const expDate = new Date(((_a = decodedToken.exp) !== null && _a !== void 0 ? _a : 0) * 1000);
|
|
1369
|
-
if (expDate < new Date()) {
|
|
1370
|
-
location.replace('/ar/login?redirect=' + redirectPath);
|
|
1371
|
-
return;
|
|
1372
|
-
}
|
|
1373
|
-
else {
|
|
1374
|
-
if (this.authService.currentUserUrl) {
|
|
1375
|
-
if (this.refresh) {
|
|
1376
|
-
this.http
|
|
1377
|
-
.get(this.authService.currentUserUrl + `/api/users?refresh`, {
|
|
1378
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
1379
|
-
})
|
|
1380
|
-
.subscribe((user) => {
|
|
1381
|
-
localStorage.setItem('token', user.token);
|
|
1382
|
-
this.refresh = false;
|
|
1383
|
-
setTimeout(() => {
|
|
1384
|
-
this.refresh = true;
|
|
1385
|
-
}, 60 * 1000);
|
|
1386
|
-
});
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
else {
|
|
1390
|
-
throw new Error("provide current base user api url using this function authService.setCurrentUserUrl('https://...')");
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
isException(request) {
|
|
1395
|
-
if (request.url.includes('/api/users?refresh') &&
|
|
1396
|
-
request.method === 'GET') {
|
|
1397
|
-
return true;
|
|
1398
|
-
}
|
|
1399
|
-
return false;
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
TokenInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: TokenInterceptor, deps: [{ token: AuthService }, { token: i2$4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1403
|
-
TokenInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: TokenInterceptor });
|
|
1404
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: TokenInterceptor, decorators: [{
|
|
1405
|
-
type: Injectable
|
|
1406
|
-
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2$4.HttpClient }]; } });
|
|
1407
|
-
|
|
1408
|
-
class BreadcrumbsService {
|
|
1409
|
-
constructor() { }
|
|
1410
|
-
setPageTitle(text) {
|
|
1411
|
-
const titleEl = document.querySelector('.sub-section-title');
|
|
1412
|
-
if (titleEl) {
|
|
1413
|
-
titleEl.textContent = text;
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
setMainPageTitle(text, url) {
|
|
1417
|
-
const div = document.getElementsByClassName('main-section-title');
|
|
1418
|
-
if (div && div.length > 0) {
|
|
1419
|
-
div[0].innerHTML = `<a id="site-url" href="${url}">${text}</a>`;
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
addBreadcrumb(nodeName, spanClasses = 'bc-current', linkClasses = 'bc-node') {
|
|
1423
|
-
var _a;
|
|
1424
|
-
const spans = (_a = document.getElementById('ctl00_path')) === null || _a === void 0 ? void 0 : _a.children;
|
|
1425
|
-
//get last child
|
|
1426
|
-
const lastIndex = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1);
|
|
1427
|
-
const innerHTML = lastIndex.innerHTML;
|
|
1428
|
-
lastIndex.innerHTML = '';
|
|
1429
|
-
lastIndex.classList.remove(...['bc-current']);
|
|
1430
|
-
//add new link
|
|
1431
|
-
lastIndex.appendChild(this.createLink(innerHTML, location.pathname, linkClasses));
|
|
1432
|
-
//add new span and empty span
|
|
1433
|
-
const newSpan = this.createSpan(nodeName, spanClasses);
|
|
1434
|
-
const emptySpan = document.createElement('span');
|
|
1435
|
-
lastIndex.after(...[emptySpan, newSpan]);
|
|
1436
|
-
}
|
|
1437
|
-
addBreadcrumbList(nodeList, spanClasses = 'bc-current', linkClasses = 'bc-node') {
|
|
1438
|
-
var _a;
|
|
1439
|
-
const spans = (_a = document.getElementById('ctl00_path')) === null || _a === void 0 ? void 0 : _a.childNodes;
|
|
1440
|
-
//get last child
|
|
1441
|
-
const lastSpan = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1);
|
|
1442
|
-
const innerHTML = lastSpan.innerHTML;
|
|
1443
|
-
lastSpan.classList.remove(...[spanClasses]);
|
|
1444
|
-
lastSpan.innerHTML = '';
|
|
1445
|
-
//add new link
|
|
1446
|
-
lastSpan.appendChild(this.createLink(innerHTML, location.pathname, linkClasses));
|
|
1447
|
-
for (let i = 0; i < nodeList.length; i++) {
|
|
1448
|
-
const lastIndex = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1);
|
|
1449
|
-
if (nodeList[i].nodeUrl) {
|
|
1450
|
-
const newSpan = document.createElement('span');
|
|
1451
|
-
newSpan.appendChild(this.createLink(nodeList[i].nodeName, nodeList[i].nodeUrl, linkClasses));
|
|
1452
|
-
const emptySpan = document.createElement('span');
|
|
1453
|
-
lastIndex.after(...[emptySpan, newSpan]);
|
|
1454
|
-
}
|
|
1455
|
-
else {
|
|
1456
|
-
const newSpan = this.createSpan(nodeList[i].nodeName, spanClasses);
|
|
1457
|
-
const emptySpan = document.createElement('span');
|
|
1458
|
-
lastIndex.after(...[emptySpan, newSpan]);
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
createBreadcrumbs(nodeList, spanClasses = 'bc-current', linkClasses = 'bc-node') {
|
|
1463
|
-
const currentSpan = document.getElementById('ctl00_path');
|
|
1464
|
-
currentSpan.innerHTML = '';
|
|
1465
|
-
const newSpan = document.createElement('span');
|
|
1466
|
-
currentSpan === null || currentSpan === void 0 ? void 0 : currentSpan.appendChild(newSpan);
|
|
1467
|
-
newSpan.appendChild(this.createLink(nodeList[0].nodeName, nodeList[0].nodeUrl, linkClasses));
|
|
1468
|
-
const spans = currentSpan === null || currentSpan === void 0 ? void 0 : currentSpan.children;
|
|
1469
|
-
for (let i = 1; i < nodeList.length; i++) {
|
|
1470
|
-
const lastIndex = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1);
|
|
1471
|
-
if (nodeList[i].nodeUrl) {
|
|
1472
|
-
const newSpan = document.createElement('span');
|
|
1473
|
-
newSpan.appendChild(this.createLink(nodeList[i].nodeName, nodeList[i].nodeUrl, linkClasses));
|
|
1474
|
-
const emptySpan = document.createElement('span');
|
|
1475
|
-
lastIndex === null || lastIndex === void 0 ? void 0 : lastIndex.after(...[emptySpan, newSpan]);
|
|
1476
|
-
}
|
|
1477
|
-
else {
|
|
1478
|
-
const newSpan = this.createSpan(nodeList[i].nodeName, spanClasses);
|
|
1479
|
-
const emptySpan = document.createElement('span');
|
|
1480
|
-
lastIndex.after(...[emptySpan, newSpan]);
|
|
1481
|
-
}
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
removeLastBreadcrumb() {
|
|
1485
|
-
var _a, _b, _c;
|
|
1486
|
-
const spans = (_a = document.getElementById('ctl00_path')) === null || _a === void 0 ? void 0 : _a.children;
|
|
1487
|
-
(_b = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1)) === null || _b === void 0 ? void 0 : _b.remove();
|
|
1488
|
-
(_c = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1)) === null || _c === void 0 ? void 0 : _c.remove();
|
|
1489
|
-
this.setCurrentNode(spans);
|
|
1490
|
-
}
|
|
1491
|
-
removeBreadcrumbByNodeName(nodeName) {
|
|
1492
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1493
|
-
const spans = (_a = document.getElementById('ctl00_path')) === null || _a === void 0 ? void 0 : _a.children;
|
|
1494
|
-
let index = -1;
|
|
1495
|
-
for (let i = 0; i < spans.length; i++) {
|
|
1496
|
-
const span = spans.item(i);
|
|
1497
|
-
if (((_b = span === null || span === void 0 ? void 0 : span.textContent) === null || _b === void 0 ? void 0 : _b.trim()) === nodeName) {
|
|
1498
|
-
index = i;
|
|
1499
|
-
break;
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
const lastNode = spans.length - 1 === index;
|
|
1503
|
-
if (index !== -1 && !lastNode) {
|
|
1504
|
-
(_c = spans === null || spans === void 0 ? void 0 : spans.item(index)) === null || _c === void 0 ? void 0 : _c.remove();
|
|
1505
|
-
(_d = spans === null || spans === void 0 ? void 0 : spans.item(index)) === null || _d === void 0 ? void 0 : _d.remove();
|
|
1506
|
-
}
|
|
1507
|
-
else {
|
|
1508
|
-
(_e = spans === null || spans === void 0 ? void 0 : spans.item(index)) === null || _e === void 0 ? void 0 : _e.remove();
|
|
1509
|
-
(_f = spans === null || spans === void 0 ? void 0 : spans.item(index - 1)) === null || _f === void 0 ? void 0 : _f.remove();
|
|
1510
|
-
}
|
|
1511
|
-
if (lastNode) {
|
|
1512
|
-
this.setCurrentNode(spans);
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
removeLastBreadcrumbsByLength(length) {
|
|
1516
|
-
var _a, _b, _c;
|
|
1517
|
-
const spans = (_a = document.getElementById('ctl00_path')) === null || _a === void 0 ? void 0 : _a.children;
|
|
1518
|
-
while (length > 0) {
|
|
1519
|
-
(_b = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1)) === null || _b === void 0 ? void 0 : _b.remove();
|
|
1520
|
-
(_c = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1)) === null || _c === void 0 ? void 0 : _c.remove();
|
|
1521
|
-
length--;
|
|
1522
|
-
}
|
|
1523
|
-
if (spans.length > 0) {
|
|
1524
|
-
this.setCurrentNode(spans);
|
|
1525
|
-
}
|
|
1526
|
-
}
|
|
1527
|
-
createLink(innerHTML, href, classes) {
|
|
1528
|
-
const link = document.createElement('a');
|
|
1529
|
-
link.innerHTML = ' ' + innerHTML;
|
|
1530
|
-
link.href = href !== null && href !== void 0 ? href : '';
|
|
1531
|
-
link.classList.add(...[classes]);
|
|
1532
|
-
return link;
|
|
1533
|
-
}
|
|
1534
|
-
createSpan(innerHTML, classes) {
|
|
1535
|
-
const span = document.createElement('span');
|
|
1536
|
-
span.classList.add(...[classes]);
|
|
1537
|
-
span.innerHTML = ' ' + innerHTML;
|
|
1538
|
-
return span;
|
|
1539
|
-
}
|
|
1540
|
-
setCurrentNode(spans) {
|
|
1541
|
-
var _a;
|
|
1542
|
-
const lastSpan = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1);
|
|
1543
|
-
const lastSpanLink = (_a = spans === null || spans === void 0 ? void 0 : spans.item(spans.length - 1)) === null || _a === void 0 ? void 0 : _a.children.item(0);
|
|
1544
|
-
lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.classList.add(...['bc-current']);
|
|
1545
|
-
lastSpan.innerHTML = lastSpanLink.innerHTML;
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
BreadcrumbsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: BreadcrumbsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1549
|
-
BreadcrumbsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: BreadcrumbsService, providedIn: 'root' });
|
|
1550
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: BreadcrumbsService, decorators: [{
|
|
1551
|
-
type: Injectable,
|
|
1552
|
-
args: [{
|
|
1553
|
-
providedIn: 'root',
|
|
1554
|
-
}]
|
|
1555
|
-
}], ctorParameters: function () { return []; } });
|
|
1556
|
-
|
|
1557
|
-
class CommonService {
|
|
1558
|
-
constructor() { }
|
|
1559
|
-
print(element, title, classes) {
|
|
1560
|
-
var _a;
|
|
1561
|
-
const styles = this.getElementTag('style');
|
|
1562
|
-
const linkes = this.getElementTag('link');
|
|
1563
|
-
const scripts = this.getElementTag('script');
|
|
1564
|
-
const printContents = (_a = document.getElementById(element)) === null || _a === void 0 ? void 0 : _a.innerHTML;
|
|
1565
|
-
const popupWin = window.open('', '', 'top=0,left=0,height=100%,width=auto');
|
|
1566
|
-
const data = `
|
|
1567
|
-
<!DOCTYPE html>
|
|
1568
|
-
<head>
|
|
1569
|
-
<title> ${title} </title>
|
|
1570
|
-
<meta charset="utf-8">
|
|
1571
|
-
${linkes}
|
|
1572
|
-
${styles}
|
|
1573
|
-
<style>
|
|
1574
|
-
@media print {
|
|
1575
|
-
.noPrint{
|
|
1576
|
-
display: none !important;
|
|
1577
|
-
}
|
|
1578
|
-
body {
|
|
1579
|
-
direction: rtl;
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
</style>
|
|
1583
|
-
</head>
|
|
1584
|
-
<body class="${classes}">
|
|
1585
|
-
${printContents}
|
|
1586
|
-
${scripts}
|
|
1587
|
-
</body>
|
|
1588
|
-
|
|
1589
|
-
</html>`;
|
|
1590
|
-
popupWin === null || popupWin === void 0 ? void 0 : popupWin.document.open();
|
|
1591
|
-
popupWin === null || popupWin === void 0 ? void 0 : popupWin.document.write(data);
|
|
1592
|
-
popupWin === null || popupWin === void 0 ? void 0 : popupWin.document.close();
|
|
1593
|
-
popupWin === null || popupWin === void 0 ? void 0 : popupWin.focus();
|
|
1594
|
-
popupWin === null || popupWin === void 0 ? void 0 : popupWin.addEventListener('focus', () => {
|
|
1595
|
-
setTimeout(() => {
|
|
1596
|
-
if (popupWin.document.hasFocus()) {
|
|
1597
|
-
popupWin.print();
|
|
1598
|
-
popupWin.close();
|
|
1599
|
-
}
|
|
1600
|
-
}, 1000);
|
|
1601
|
-
});
|
|
1602
|
-
}
|
|
1603
|
-
getElementTag(tag) {
|
|
1604
|
-
const html = [];
|
|
1605
|
-
const elements = document.getElementsByTagName(tag);
|
|
1606
|
-
for (let index = 0; index < elements.length; index++) {
|
|
1607
|
-
html.push(elements[index].outerHTML);
|
|
1608
|
-
}
|
|
1609
|
-
return html.join('\r\n');
|
|
1610
|
-
}
|
|
1611
|
-
}
|
|
1612
|
-
CommonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: CommonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1613
|
-
CommonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: CommonService, providedIn: 'root' });
|
|
1614
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: CommonService, decorators: [{
|
|
1615
|
-
type: Injectable,
|
|
1616
|
-
args: [{
|
|
1617
|
-
providedIn: 'root',
|
|
1618
|
-
}]
|
|
1619
|
-
}], ctorParameters: function () { return []; } });
|
|
1620
|
-
|
|
1621
|
-
/*
|
|
1622
|
-
* Public API Surface of ipa-library
|
|
1623
|
-
*/
|
|
1624
|
-
|
|
1625
|
-
/**
|
|
1626
|
-
* Generated bundle index. Do not edit.
|
|
1627
|
-
*/
|
|
1628
|
-
|
|
1629
|
-
export { AuthService, BreadcrumbsService, CommonService, DropdownInputComponent, ErrorInterceptor, ErrorService, FileUploadComponent, GenerateFormComponent, GregorianDatepickerComponent, HijriDatePipe, HijriDatepickerComponent, IPAFormService, LoaderComponent, LoaderService, LoadingInterceptor, NgIPALibraryModule, PipesModule, RecaptchaComponent, ShareButtonComponent, ShareButtonModule, TextInputComponent, TextareaInputComponent, TokenInterceptor };
|
|
1630
|
-
//# sourceMappingURL=ng-ipa-library.js.map
|