ng-ipa-library 0.7.6 → 0.7.7
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/bundles/ng-ipa-library.umd.js +2092 -0
- package/bundles/ng-ipa-library.umd.js.map +1 -0
- package/esm2015/lib/core/components/loading/loading.component.js +27 -0
- package/esm2015/lib/core/interceptors/error.interceptor.js +46 -0
- package/esm2015/lib/core/interceptors/loading.interceptor.js +58 -0
- package/esm2015/lib/core/interceptors/token.interceptor.js +69 -0
- package/esm2015/lib/core/services/auth.service.js +48 -0
- package/esm2015/lib/core/services/error.service.js +22 -0
- package/esm2015/lib/core/services/loader.service.js +24 -0
- package/esm2015/lib/generate-form/generate-form.component.js +120 -0
- package/esm2015/lib/ipa-form/datepicker/datepicker.component.js +70 -0
- package/esm2015/lib/ipa-form/datepicker/gregorian-datepicker/gregorian-datepicker.component.js +28 -0
- package/esm2015/lib/ipa-form/datepicker/gregorian-datepicker/gregorian18n.js +38 -0
- package/esm2015/lib/ipa-form/datepicker/hijri-datepicker/IslamicI18n.js +38 -0
- package/esm2015/lib/ipa-form/datepicker/hijri-datepicker/hijri-datepicker.component.js +28 -0
- package/esm2015/lib/ipa-form/dropdown-input/dropdown-input.component.js +81 -0
- package/esm2015/lib/ipa-form/file-upload/file-upload.component.js +128 -0
- package/esm2015/lib/ipa-form/ipa-form.service.js +251 -0
- package/esm2015/lib/ipa-form/recaptcha/recaptcha.component.js +59 -0
- package/esm2015/lib/ipa-form/text-input/text-input.component.js +76 -0
- package/esm2015/lib/ipa-form/textarea-input/textarea-input.component.js +73 -0
- package/esm2015/lib/models/apiException.js +2 -0
- package/esm2015/lib/models/apiResponse.js +2 -0
- package/esm2015/lib/models/breadcrumbs.model.js +2 -0
- package/esm2015/lib/models/decodedToken.model.js +2 -0
- package/esm2015/lib/models/exceptionUrl.model.js +2 -0
- package/esm2015/lib/models/generateForm.model.js +2 -0
- package/esm2015/lib/models/pagedResult.js +2 -0
- package/esm2015/lib/models/user.model.js +2 -0
- package/esm2015/lib/ng-ipa-library.module.js +109 -0
- package/esm2015/lib/pipes/hijri-date.pipe.js +18 -0
- package/esm2015/lib/pipes/pipes.module.js +16 -0
- package/esm2015/lib/services/breadcrumbs.service.js +151 -0
- package/esm2015/lib/services/common.service.js +66 -0
- package/esm2015/lib/share-button/share-button.component.js +37 -0
- package/esm2015/lib/share-button/share-button.module.js +52 -0
- package/esm2015/ng-ipa-library.js +5 -0
- package/esm2015/public-api.js +39 -0
- package/fesm2015/ng-ipa-library.js +1629 -0
- package/fesm2015/ng-ipa-library.js.map +1 -0
- package/lib/core/components/loading/loading.component.d.ts +12 -0
- package/lib/core/interceptors/error.interceptor.d.ts +14 -0
- package/lib/core/interceptors/loading.interceptor.d.ts +14 -0
- package/lib/core/interceptors/token.interceptor.d.ts +15 -0
- package/lib/core/services/auth.service.d.ts +15 -0
- package/lib/core/services/error.service.d.ts +10 -0
- package/lib/core/services/loader.service.d.ts +12 -0
- package/lib/generate-form/generate-form.component.d.ts +32 -0
- package/lib/ipa-form/datepicker/datepicker.component.d.ts +31 -0
- package/lib/ipa-form/datepicker/gregorian-datepicker/gregorian-datepicker.component.d.ts +6 -0
- package/lib/ipa-form/datepicker/gregorian-datepicker/gregorian18n.d.ts +11 -0
- package/lib/ipa-form/datepicker/hijri-datepicker/IslamicI18n.d.ts +11 -0
- package/lib/ipa-form/datepicker/hijri-datepicker/hijri-datepicker.component.d.ts +6 -0
- package/lib/ipa-form/dropdown-input/dropdown-input.component.d.ts +31 -0
- package/lib/ipa-form/file-upload/file-upload.component.d.ts +36 -0
- package/lib/ipa-form/ipa-form.service.d.ts +49 -0
- package/lib/ipa-form/recaptcha/recaptcha.component.d.ts +22 -0
- package/lib/ipa-form/text-input/text-input.component.d.ts +30 -0
- package/lib/ipa-form/textarea-input/textarea-input.component.d.ts +29 -0
- package/{src/lib/models/apiException.ts → lib/models/apiException.d.ts} +1 -2
- package/lib/models/apiResponse.d.ts +4 -0
- package/lib/models/breadcrumbs.model.d.ts +4 -0
- package/lib/models/decodedToken.model.d.ts +6 -0
- package/lib/models/exceptionUrl.model.d.ts +4 -0
- package/lib/models/generateForm.model.d.ts +27 -0
- package/lib/models/pagedResult.d.ts +4 -0
- package/lib/models/user.model.d.ts +7 -0
- package/lib/ng-ipa-library.module.d.ts +25 -0
- package/lib/pipes/hijri-date.pipe.d.ts +7 -0
- package/lib/pipes/pipes.module.d.ts +7 -0
- package/lib/services/breadcrumbs.service.d.ts +18 -0
- package/lib/services/common.service.d.ts +8 -0
- package/lib/share-button/share-button.component.d.ts +11 -0
- package/lib/share-button/share-button.module.d.ts +13 -0
- package/ng-ipa-library.d.ts +5 -0
- package/package.json +30 -24
- package/{src/public-api.ts → public-api.d.ts} +0 -16
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -43
- package/src/lib/core/components/loading/loading.component.html +0 -3
- package/src/lib/core/components/loading/loading.component.scss +0 -3
- package/src/lib/core/components/loading/loading.component.ts +0 -23
- package/src/lib/core/interceptors/error.interceptor.ts +0 -61
- package/src/lib/core/interceptors/loading.interceptor.ts +0 -69
- package/src/lib/core/interceptors/token.interceptor.ts +0 -77
- package/src/lib/core/services/auth.service.ts +0 -48
- package/src/lib/core/services/error.service.ts +0 -19
- package/src/lib/core/services/loader.service.ts +0 -21
- package/src/lib/generate-form/generate-form.component.html +0 -85
- package/src/lib/generate-form/generate-form.component.scss +0 -0
- package/src/lib/generate-form/generate-form.component.ts +0 -119
- package/src/lib/ipa-form/datepicker/datepicker.component.html +0 -21
- package/src/lib/ipa-form/datepicker/datepicker.component.scss +0 -13
- package/src/lib/ipa-form/datepicker/datepicker.component.ts +0 -67
- package/src/lib/ipa-form/datepicker/gregorian-datepicker/gregorian-datepicker.component.ts +0 -15
- package/src/lib/ipa-form/datepicker/gregorian-datepicker/gregorian18n.ts +0 -38
- package/src/lib/ipa-form/datepicker/hijri-datepicker/IslamicI18n.ts +0 -38
- package/src/lib/ipa-form/datepicker/hijri-datepicker/hijri-datepicker.component.ts +0 -14
- package/src/lib/ipa-form/dropdown-input/dropdown-input.component.html +0 -22
- package/src/lib/ipa-form/dropdown-input/dropdown-input.component.scss +0 -0
- package/src/lib/ipa-form/dropdown-input/dropdown-input.component.ts +0 -68
- package/src/lib/ipa-form/file-upload/file-upload.component.html +0 -37
- package/src/lib/ipa-form/file-upload/file-upload.component.scss +0 -45
- package/src/lib/ipa-form/file-upload/file-upload.component.ts +0 -109
- package/src/lib/ipa-form/ipa-form.service.ts +0 -294
- package/src/lib/ipa-form/recaptcha/recaptcha.component.html +0 -3
- package/src/lib/ipa-form/recaptcha/recaptcha.component.scss +0 -0
- package/src/lib/ipa-form/recaptcha/recaptcha.component.ts +0 -42
- package/src/lib/ipa-form/text-input/text-input.component.html +0 -10
- package/src/lib/ipa-form/text-input/text-input.component.scss +0 -0
- package/src/lib/ipa-form/text-input/text-input.component.ts +0 -69
- package/src/lib/ipa-form/textarea-input/textarea-input.component.html +0 -11
- package/src/lib/ipa-form/textarea-input/textarea-input.component.scss +0 -0
- package/src/lib/ipa-form/textarea-input/textarea-input.component.ts +0 -69
- package/src/lib/models/apiResponse.ts +0 -4
- package/src/lib/models/breadcrumbs.model.ts +0 -4
- package/src/lib/models/decodedToken.model.ts +0 -6
- package/src/lib/models/exceptionUrl.model.ts +0 -4
- package/src/lib/models/generateForm.model.ts +0 -29
- package/src/lib/models/pagedResult.ts +0 -4
- package/src/lib/models/user.model.ts +0 -7
- package/src/lib/ng-ipa-library.component.ts +0 -15
- package/src/lib/ng-ipa-library.module.ts +0 -63
- package/src/lib/pipes/hijri-date.pipe.ts +0 -15
- package/src/lib/pipes/pipes.module.ts +0 -8
- package/src/lib/services/breadcrumbs.service.ts +0 -189
- package/src/lib/services/common.service.ts +0 -63
- package/src/lib/share-button/share-button.component.html +0 -3
- package/src/lib/share-button/share-button.component.scss +0 -0
- package/src/lib/share-button/share-button.component.ts +0 -23
- package/src/lib/share-button/share-button.module.ts +0 -32
- package/src/test.ts +0 -26
- package/tsconfig.lib.json +0 -20
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl, NgControl } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class RecaptchaComponent implements OnInit {
|
|
5
|
+
controlDir: NgControl;
|
|
6
|
+
siteKey: string;
|
|
7
|
+
recaptchaSize: 'compact' | 'normal';
|
|
8
|
+
lang: string;
|
|
9
|
+
recaptchaType: 'image' | 'audio';
|
|
10
|
+
theme: 'light' | 'dark';
|
|
11
|
+
useGlobalDomain: boolean;
|
|
12
|
+
formControl: FormControl;
|
|
13
|
+
constructor(controlDir: NgControl);
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
onChange(event: any): void;
|
|
16
|
+
onTouched(): void;
|
|
17
|
+
writeValue(obj: any): void;
|
|
18
|
+
registerOnChange(fn: any): void;
|
|
19
|
+
registerOnTouched(fn: any): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RecaptchaComponent, [{ self: true; }]>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RecaptchaComponent, "ipa-recaptcha", never, { "siteKey": "siteKey"; "recaptchaSize": "recaptchaSize"; "lang": "lang"; "recaptchaType": "recaptchaType"; "theme": "theme"; "useGlobalDomain": "useGlobalDomain"; }, {}, never, never>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ElementRef, OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl, NgControl } from '@angular/forms';
|
|
3
|
+
import { IPAFormService } from '../ipa-form.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TextInputComponent implements OnInit {
|
|
6
|
+
private validationService;
|
|
7
|
+
controlDir: NgControl;
|
|
8
|
+
input: ElementRef;
|
|
9
|
+
id: string;
|
|
10
|
+
type: string;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
label: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
patternErrorMsg: string;
|
|
15
|
+
pattern: string;
|
|
16
|
+
classes: string;
|
|
17
|
+
containerClasses: string;
|
|
18
|
+
formControl: FormControl;
|
|
19
|
+
errorMsg: string | null;
|
|
20
|
+
constructor(validationService: IPAFormService, controlDir: NgControl);
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
onChange(event: any): void;
|
|
23
|
+
onTouched(): void;
|
|
24
|
+
writeValue(obj: any): void;
|
|
25
|
+
registerOnChange(fn: any): void;
|
|
26
|
+
registerOnTouched(fn: any): void;
|
|
27
|
+
get errorMessage(): string | null;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextInputComponent, [null, { self: true; }]>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextInputComponent, "ipa-text-input", never, { "id": "id"; "type": "type"; "placeholder": "placeholder"; "label": "label"; "required": "required"; "patternErrorMsg": "patternErrorMsg"; "pattern": "pattern"; "classes": "classes"; "containerClasses": "containerClasses"; }, {}, never, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ElementRef, OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl, NgControl } from '@angular/forms';
|
|
3
|
+
import { IPAFormService } from '../ipa-form.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TextareaInputComponent implements OnInit {
|
|
6
|
+
private validationService;
|
|
7
|
+
controlDir: NgControl;
|
|
8
|
+
input: ElementRef<any>;
|
|
9
|
+
id: string;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
label: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
patternErrorMsg: string;
|
|
14
|
+
pattern: string;
|
|
15
|
+
classes: string;
|
|
16
|
+
containerClasses: string;
|
|
17
|
+
formControl: FormControl;
|
|
18
|
+
errorMsg: string | null;
|
|
19
|
+
constructor(validationService: IPAFormService, controlDir: NgControl);
|
|
20
|
+
ngOnInit(): void;
|
|
21
|
+
onChange(event: any): void;
|
|
22
|
+
onTouched(): void;
|
|
23
|
+
writeValue(obj: any): void;
|
|
24
|
+
registerOnChange(fn: any): void;
|
|
25
|
+
registerOnTouched(fn: any): void;
|
|
26
|
+
get errorMessage(): string | null;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextareaInputComponent, [null, { self: true; }]>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextareaInputComponent, "ipa-textarea-input", never, { "id": "id"; "placeholder": "placeholder"; "label": "label"; "required": "required"; "patternErrorMsg": "patternErrorMsg"; "pattern": "pattern"; "classes": "classes"; "containerClasses": "containerClasses"; }, {}, never, never>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface GenerateForm {
|
|
2
|
+
columns: Column[];
|
|
3
|
+
}
|
|
4
|
+
export interface Column {
|
|
5
|
+
arabicLabel: string;
|
|
6
|
+
englishName: string;
|
|
7
|
+
validationPattern?: string;
|
|
8
|
+
inputClasses?: string;
|
|
9
|
+
containerClasses?: string;
|
|
10
|
+
valueField?: string;
|
|
11
|
+
textField?: string;
|
|
12
|
+
patternErrorMsg?: string;
|
|
13
|
+
type: string;
|
|
14
|
+
size?: number;
|
|
15
|
+
required: boolean;
|
|
16
|
+
data?: Data[] | any[];
|
|
17
|
+
acceptedFiles?: string;
|
|
18
|
+
multipleFile?: number;
|
|
19
|
+
apiUrl?: string;
|
|
20
|
+
autoUploadFile?: boolean;
|
|
21
|
+
apiURlMethod?: string;
|
|
22
|
+
authorization?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface Data {
|
|
25
|
+
id: number;
|
|
26
|
+
description: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./ipa-form/text-input/text-input.component";
|
|
3
|
+
import * as i2 from "./ipa-form/textarea-input/textarea-input.component";
|
|
4
|
+
import * as i3 from "./ipa-form/dropdown-input/dropdown-input.component";
|
|
5
|
+
import * as i4 from "./core/components/loading/loading.component";
|
|
6
|
+
import * as i5 from "./generate-form/generate-form.component";
|
|
7
|
+
import * as i6 from "./ipa-form/file-upload/file-upload.component";
|
|
8
|
+
import * as i7 from "./ipa-form/datepicker/datepicker.component";
|
|
9
|
+
import * as i8 from "./ipa-form/datepicker/hijri-datepicker/hijri-datepicker.component";
|
|
10
|
+
import * as i9 from "./ipa-form/datepicker/gregorian-datepicker/gregorian-datepicker.component";
|
|
11
|
+
import * as i10 from "./ipa-form/recaptcha/recaptcha.component";
|
|
12
|
+
import * as i11 from "@angular/common";
|
|
13
|
+
import * as i12 from "@angular/forms";
|
|
14
|
+
import * as i13 from "ngx-toastr";
|
|
15
|
+
import * as i14 from "ngx-dropzone-wrapper";
|
|
16
|
+
import * as i15 from "ngx-captcha";
|
|
17
|
+
import * as i16 from "./pipes/pipes.module";
|
|
18
|
+
import * as i17 from "@ng-bootstrap/ng-bootstrap";
|
|
19
|
+
import * as i18 from "./share-button/share-button.module";
|
|
20
|
+
import * as i19 from "@ng-select/ng-select";
|
|
21
|
+
export declare class NgIPALibraryModule {
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgIPALibraryModule, never>;
|
|
23
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgIPALibraryModule, [typeof i1.TextInputComponent, typeof i2.TextareaInputComponent, typeof i3.DropdownInputComponent, typeof i4.LoaderComponent, typeof i5.GenerateFormComponent, typeof i6.FileUploadComponent, typeof i7.DatepickerComponent, typeof i8.HijriDatepickerComponent, typeof i9.GregorianDatepickerComponent, typeof i10.RecaptchaComponent], [typeof i11.CommonModule, typeof i12.FormsModule, typeof i12.ReactiveFormsModule, typeof i13.ToastrModule, typeof i14.DropzoneModule, typeof i15.NgxCaptchaModule, typeof i16.PipesModule, typeof i17.NgbDatepickerModule, typeof i18.ShareButtonModule, typeof i19.NgSelectModule], [typeof i1.TextInputComponent, typeof i2.TextareaInputComponent, typeof i3.DropdownInputComponent, typeof i4.LoaderComponent, typeof i5.GenerateFormComponent, typeof i6.FileUploadComponent, typeof i16.PipesModule, typeof i8.HijriDatepickerComponent, typeof i9.GregorianDatepickerComponent, typeof i18.ShareButtonModule, typeof i10.RecaptchaComponent]>;
|
|
24
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgIPALibraryModule>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class HijriDatePipe implements PipeTransform {
|
|
4
|
+
transform(date: string, format?: string, lang?: 'ar' | 'en'): string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HijriDatePipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<HijriDatePipe, "hijriDate">;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./hijri-date.pipe";
|
|
3
|
+
export declare class PipesModule {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PipesModule, never>;
|
|
5
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PipesModule, [typeof i1.HijriDatePipe], never, [typeof i1.HijriDatePipe]>;
|
|
6
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PipesModule>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Breadcrumbs } from '../models/breadcrumbs.model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class BreadcrumbsService {
|
|
4
|
+
constructor();
|
|
5
|
+
setPageTitle(text: string): void;
|
|
6
|
+
setMainPageTitle(text: string, url: string): void;
|
|
7
|
+
addBreadcrumb(nodeName: string, spanClasses?: string, linkClasses?: string): void;
|
|
8
|
+
addBreadcrumbList(nodeList: Breadcrumbs[], spanClasses?: string, linkClasses?: string): void;
|
|
9
|
+
createBreadcrumbs(nodeList: Breadcrumbs[], spanClasses?: string, linkClasses?: string): void;
|
|
10
|
+
removeLastBreadcrumb(): void;
|
|
11
|
+
removeBreadcrumbByNodeName(nodeName: string): void;
|
|
12
|
+
removeLastBreadcrumbsByLength(length: number): void;
|
|
13
|
+
private createLink;
|
|
14
|
+
private createSpan;
|
|
15
|
+
private setCurrentNode;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BreadcrumbsService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BreadcrumbsService>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class CommonService {
|
|
3
|
+
constructor();
|
|
4
|
+
print(element: string, title: string, classes?: string): void;
|
|
5
|
+
private getElementTag;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommonService, never>;
|
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CommonService>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AfterViewInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ShareButtonComponent implements AfterViewInit {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
btnLabel: string;
|
|
7
|
+
constructor();
|
|
8
|
+
ngAfterViewInit(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShareButtonComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ShareButtonComponent, "ipa-share-button", never, { "title": "title"; "description": "description"; "btnLabel": "btnLabel"; }, {}, never, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FaIconLibrary } from '@fortawesome/angular-fontawesome';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "./share-button.component";
|
|
4
|
+
import * as i2 from "ngx-sharebuttons/icons";
|
|
5
|
+
import * as i3 from "ngx-sharebuttons/popup";
|
|
6
|
+
import * as i4 from "@angular/cdk/overlay";
|
|
7
|
+
import * as i5 from "@fortawesome/angular-fontawesome";
|
|
8
|
+
export declare class ShareButtonModule {
|
|
9
|
+
constructor(library: FaIconLibrary);
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShareButtonModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ShareButtonModule, [typeof i1.ShareButtonComponent], [typeof i2.ShareIconsModule, typeof i3.ShareButtonsPopupModule, typeof i4.OverlayModule, typeof i5.FontAwesomeModule], [typeof i1.ShareButtonComponent, typeof i2.ShareIconsModule, typeof i3.ShareButtonsPopupModule, typeof i4.OverlayModule, typeof i5.FontAwesomeModule]>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<ShareButtonModule>;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ng-ipa-library",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/common": "~12.2.9",
|
|
6
|
-
"@angular/core": "~12.2.9"
|
|
7
|
-
},
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"tslib": "^2.2.0",
|
|
10
|
-
"ngx-toastr": "^14.1.0",
|
|
11
|
-
"
|
|
12
|
-
"ngx-
|
|
13
|
-
"
|
|
14
|
-
"moment-hijri": "^2.1.
|
|
15
|
-
"@
|
|
16
|
-
"@
|
|
17
|
-
"@fortawesome/
|
|
18
|
-
"@fortawesome/
|
|
19
|
-
"@fortawesome/free-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "ng-ipa-library",
|
|
3
|
+
"version": "0.7.7",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "~12.2.9",
|
|
6
|
+
"@angular/core": "~12.2.9"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.2.0",
|
|
10
|
+
"ngx-toastr": "^14.1.0",
|
|
11
|
+
"ngx-captcha": "^10.0.0",
|
|
12
|
+
"ngx-dropzone-wrapper": "^10.0.1",
|
|
13
|
+
"moment-hijri": "^2.1.2",
|
|
14
|
+
"@types/moment-hijri": "^2.1.0",
|
|
15
|
+
"@ng-bootstrap/ng-bootstrap": "^11.0.0-beta.2",
|
|
16
|
+
"@fortawesome/angular-fontawesome": "^0.9.0",
|
|
17
|
+
"@fortawesome/fontawesome-svg-core": "^1.2.36",
|
|
18
|
+
"@fortawesome/free-brands-svg-icons": "^5.15.4",
|
|
19
|
+
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
|
20
|
+
"ngx-sharebuttons": "^9.0.0",
|
|
21
|
+
"@angular/cdk": "^12.2.9"
|
|
22
|
+
},
|
|
23
|
+
"main": "bundles/ng-ipa-library.umd.js",
|
|
24
|
+
"module": "fesm2015/ng-ipa-library.js",
|
|
25
|
+
"es2015": "fesm2015/ng-ipa-library.js",
|
|
26
|
+
"esm2015": "esm2015/ng-ipa-library.js",
|
|
27
|
+
"fesm2015": "fesm2015/ng-ipa-library.js",
|
|
28
|
+
"typings": "ng-ipa-library.d.ts",
|
|
29
|
+
"sideEffects": false
|
|
30
|
+
}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of ipa-library
|
|
3
|
-
*/
|
|
4
|
-
// module
|
|
5
1
|
export * from './lib/ng-ipa-library.module';
|
|
6
2
|
export * from 'ngx-toastr';
|
|
7
3
|
export * from './lib/pipes/pipes.module';
|
|
8
4
|
export * from './lib/share-button/share-button.module';
|
|
9
|
-
|
|
10
|
-
// core components
|
|
11
5
|
export * from './lib/core/components/loading/loading.component';
|
|
12
|
-
|
|
13
|
-
// form components
|
|
14
6
|
export * from './lib/ipa-form/text-input/text-input.component';
|
|
15
7
|
export * from './lib/ipa-form/textarea-input/textarea-input.component';
|
|
16
8
|
export * from './lib/ipa-form/dropdown-input/dropdown-input.component';
|
|
@@ -20,24 +12,16 @@ export * from './lib/ipa-form/datepicker/gregorian-datepicker/gregorian-datepick
|
|
|
20
12
|
export * from './lib/ipa-form/recaptcha/recaptcha.component';
|
|
21
13
|
export * from './lib/generate-form/generate-form.component';
|
|
22
14
|
export * from './lib/share-button/share-button.component';
|
|
23
|
-
|
|
24
|
-
// interceptors
|
|
25
15
|
export * from './lib/core/interceptors/loading.interceptor';
|
|
26
16
|
export * from './lib/core/interceptors/error.interceptor';
|
|
27
17
|
export * from './lib/core/interceptors/token.interceptor';
|
|
28
|
-
|
|
29
|
-
// services
|
|
30
18
|
export * from './lib/core/services/loader.service';
|
|
31
19
|
export * from './lib/core/services/auth.service';
|
|
32
20
|
export * from './lib/ipa-form/ipa-form.service';
|
|
33
21
|
export * from './lib/core/services/error.service';
|
|
34
22
|
export * from './lib/services/breadcrumbs.service';
|
|
35
23
|
export * from './lib/services/common.service';
|
|
36
|
-
|
|
37
|
-
//pipes
|
|
38
24
|
export * from './lib/pipes/hijri-date.pipe';
|
|
39
|
-
|
|
40
|
-
//models
|
|
41
25
|
export * from './lib/models/pagedResult';
|
|
42
26
|
export * from './lib/models/apiException';
|
|
43
27
|
export * from './lib/models/apiResponse';
|
package/karma.conf.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Karma configuration file, see link for more information
|
|
2
|
-
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
-
|
|
4
|
-
module.exports = function (config) {
|
|
5
|
-
config.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
-
plugins: [
|
|
9
|
-
require('karma-jasmine'),
|
|
10
|
-
require('karma-chrome-launcher'),
|
|
11
|
-
require('karma-jasmine-html-reporter'),
|
|
12
|
-
require('karma-coverage'),
|
|
13
|
-
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
-
],
|
|
15
|
-
client: {
|
|
16
|
-
jasmine: {
|
|
17
|
-
// you can add configuration options for Jasmine here
|
|
18
|
-
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
-
// for example, you can disable the random execution with `random: false`
|
|
20
|
-
// or set a specific seed with `seed: 4321`
|
|
21
|
-
},
|
|
22
|
-
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
23
|
-
},
|
|
24
|
-
jasmineHtmlReporter: {
|
|
25
|
-
suppressAll: true // removes the duplicated traces
|
|
26
|
-
},
|
|
27
|
-
coverageReporter: {
|
|
28
|
-
dir: require('path').join(__dirname, '../../coverage/ng-ipa-library'),
|
|
29
|
-
subdir: '.',
|
|
30
|
-
reporters: [
|
|
31
|
-
{ type: 'html' },
|
|
32
|
-
{ type: 'text-summary' }
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
reporters: ['progress', 'kjhtml'],
|
|
36
|
-
port: 9876,
|
|
37
|
-
colors: true,
|
|
38
|
-
logLevel: config.LOG_INFO,
|
|
39
|
-
autoWatch: true,
|
|
40
|
-
browsers: ['Chrome'],
|
|
41
|
-
singleRun: false,
|
|
42
|
-
restartOnFileChange: true
|
|
43
|
-
});
|
|
44
|
-
};
|
package/ng-package.json
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
-
"dest": "../../dist/ng-ipa-library",
|
|
4
|
-
"allowedNonPeerDependencies": [
|
|
5
|
-
"ngx-toastr",
|
|
6
|
-
"ngx-dropzone-wrapper",
|
|
7
|
-
"ngx-captcha",
|
|
8
|
-
"moment-hijri",
|
|
9
|
-
"@types/moment-hijri",
|
|
10
|
-
"@ng-bootstrap/ng-bootstrap",
|
|
11
|
-
"@ng-bootstrap/ng-bootstrap",
|
|
12
|
-
"@fortawesome/angular-fontawesome",
|
|
13
|
-
"@fortawesome/fontawesome-svg-core",
|
|
14
|
-
"@fortawesome/free-brands-svg-icons",
|
|
15
|
-
"@fortawesome/free-solid-svg-icons",
|
|
16
|
-
"ngx-sharebuttons",
|
|
17
|
-
"@angular/cdk",
|
|
18
|
-
"@ng-select/ng-select"
|
|
19
|
-
],
|
|
20
|
-
"lib": {
|
|
21
|
-
"entryFile": "src/public-api.ts",
|
|
22
|
-
"umdModuleIds": {
|
|
23
|
-
"ngx-toastr": "ngx-toastr",
|
|
24
|
-
"ngx-dropzone-wrapper": "ngx-dropzone-wrapper",
|
|
25
|
-
"ngx-captcha": "ngx-captcha",
|
|
26
|
-
"moment-hijri": "moment-hijri",
|
|
27
|
-
"@types/moment-hijri": "@types/moment-hijri",
|
|
28
|
-
"@ng-bootstrap/ng-bootstrap": "@ng-bootstrap/ng-bootstrap",
|
|
29
|
-
"@fortawesome/angular-fontawesome": "@fortawesome/angular-fontawesome",
|
|
30
|
-
"@fortawesome/fontawesome-svg-core": "@fortawesome/fontawesome-svg-core",
|
|
31
|
-
"@fortawesome/free-brands-svg-icons": "@fortawesome/free-brands-svg-icons",
|
|
32
|
-
"@fortawesome/free-solid-svg-icons": "@fortawesome/free-solid-svg-icons",
|
|
33
|
-
"ngx-sharebuttons": "ngx-sharebuttons",
|
|
34
|
-
"ngx-sharebuttons/icons": "ngx-sharebuttons/icons",
|
|
35
|
-
"ngx-sharebuttons/popup": "ngx-sharebuttons/popup",
|
|
36
|
-
"@angular/cdk": "@angular/cdk",
|
|
37
|
-
"@ng-select/ng-select": "@ng-select/ng-select"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"assets": [
|
|
41
|
-
"src/lib/assets/ngIPAStyle.scss"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AfterViewInit, ChangeDetectorRef, Component } from '@angular/core';
|
|
2
|
-
import { LoaderService } from '../../services/loader.service';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'ipa-loader',
|
|
6
|
-
templateUrl: './loading.component.html',
|
|
7
|
-
styleUrls: ['./loading.component.scss'],
|
|
8
|
-
})
|
|
9
|
-
export class LoaderComponent implements AfterViewInit {
|
|
10
|
-
loading!: boolean;
|
|
11
|
-
|
|
12
|
-
constructor(
|
|
13
|
-
private loaderService: LoaderService,
|
|
14
|
-
private cdr: ChangeDetectorRef
|
|
15
|
-
) {}
|
|
16
|
-
|
|
17
|
-
ngAfterViewInit(): void {
|
|
18
|
-
this.loaderService.isLoading.subscribe((v) => {
|
|
19
|
-
this.loading = v;
|
|
20
|
-
this.cdr.detectChanges();
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
HttpRequest,
|
|
4
|
-
HttpHandler,
|
|
5
|
-
HttpEvent,
|
|
6
|
-
HttpInterceptor,
|
|
7
|
-
} from '@angular/common/http';
|
|
8
|
-
import { Observable, throwError } from 'rxjs';
|
|
9
|
-
import { catchError } from 'rxjs/operators';
|
|
10
|
-
import { ErrorService } from '../services/error.service';
|
|
11
|
-
import { ApiException } from '../../models/apiException';
|
|
12
|
-
import { IndividualConfig, ToastrService } from 'ngx-toastr';
|
|
13
|
-
|
|
14
|
-
@Injectable()
|
|
15
|
-
export class ErrorInterceptor implements HttpInterceptor {
|
|
16
|
-
constructor(
|
|
17
|
-
private errorService: ErrorService,
|
|
18
|
-
private toastrService: ToastrService
|
|
19
|
-
) {}
|
|
20
|
-
|
|
21
|
-
intercept(
|
|
22
|
-
req: HttpRequest<unknown>,
|
|
23
|
-
next: HttpHandler
|
|
24
|
-
): Observable<HttpEvent<unknown>> {
|
|
25
|
-
if (this.isException(req)) {
|
|
26
|
-
return next.handle(req);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return next.handle(req).pipe(
|
|
30
|
-
catchError((error) => {
|
|
31
|
-
const response = error.error as ApiException;
|
|
32
|
-
const toastrConfig: Partial<IndividualConfig> = {
|
|
33
|
-
disableTimeOut: true,
|
|
34
|
-
};
|
|
35
|
-
switch (response.statusCode) {
|
|
36
|
-
case 500:
|
|
37
|
-
this.toastrService.error(
|
|
38
|
-
response?.innerException + ' ' + response?.stackTrace,
|
|
39
|
-
response.message,
|
|
40
|
-
toastrConfig
|
|
41
|
-
);
|
|
42
|
-
break;
|
|
43
|
-
|
|
44
|
-
default:
|
|
45
|
-
this.toastrService.error(response.message, '', toastrConfig);
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
return throwError(error);
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
isException(req: HttpRequest<any>): boolean {
|
|
54
|
-
for (const url of this.errorService.urls) {
|
|
55
|
-
if (req.url.includes(url.path) && req.method === url.method) {
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
HttpRequest,
|
|
4
|
-
HttpHandler,
|
|
5
|
-
HttpEvent,
|
|
6
|
-
HttpInterceptor,
|
|
7
|
-
HttpResponse,
|
|
8
|
-
} from '@angular/common/http';
|
|
9
|
-
import { Observable } from 'rxjs';
|
|
10
|
-
import { LoaderService } from '../services/loader.service';
|
|
11
|
-
|
|
12
|
-
@Injectable()
|
|
13
|
-
export class LoadingInterceptor implements HttpInterceptor {
|
|
14
|
-
private requests: HttpRequest<any>[] = [];
|
|
15
|
-
|
|
16
|
-
constructor(private loaderService: LoaderService) {}
|
|
17
|
-
|
|
18
|
-
removeRequest(req: HttpRequest<any>): void {
|
|
19
|
-
const i = this.requests.indexOf(req);
|
|
20
|
-
if (i >= 0) {
|
|
21
|
-
this.requests.splice(i, 1);
|
|
22
|
-
}
|
|
23
|
-
this.loaderService.isLoading.next(this.requests.length > 0);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
intercept(
|
|
27
|
-
req: HttpRequest<unknown>,
|
|
28
|
-
next: HttpHandler
|
|
29
|
-
): Observable<HttpEvent<unknown>> {
|
|
30
|
-
if (this.isException(req)) {
|
|
31
|
-
return next.handle(req);
|
|
32
|
-
}
|
|
33
|
-
this.requests.push(req);
|
|
34
|
-
|
|
35
|
-
this.loaderService.isLoading.next(true);
|
|
36
|
-
return new Observable((observer) => {
|
|
37
|
-
const subscription = next.handle(req).subscribe(
|
|
38
|
-
(event) => {
|
|
39
|
-
if (event instanceof HttpResponse) {
|
|
40
|
-
this.removeRequest(req);
|
|
41
|
-
observer.next(event);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
(err) => {
|
|
45
|
-
this.removeRequest(req);
|
|
46
|
-
observer.error(err);
|
|
47
|
-
},
|
|
48
|
-
() => {
|
|
49
|
-
this.removeRequest(req);
|
|
50
|
-
observer.complete();
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
// remove request from queue when cancelled
|
|
54
|
-
return () => {
|
|
55
|
-
this.removeRequest(req);
|
|
56
|
-
subscription.unsubscribe();
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
isException(req: HttpRequest<any>): boolean {
|
|
62
|
-
for (const url of this.loaderService.urls) {
|
|
63
|
-
if (req.url.includes(url.path) && req.method === url.method) {
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|