@eqproject/eqp-dynamic-module 0.0.5 → 0.0.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/karma.conf.js +32 -0
- package/ng-package.json +18 -0
- package/package.json +31 -41
- package/src/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.html +10 -0
- package/src/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.scss +3 -0
- package/src/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.ts +228 -0
- package/src/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.html +212 -0
- package/src/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.scss +30 -0
- package/src/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.ts +692 -0
- package/src/lib/components/private/add-form-field/add-form-field.component.html +417 -0
- package/src/lib/components/private/add-form-field/add-form-field.component.scss +38 -0
- package/src/lib/components/private/add-form-field/add-form-field.component.ts +599 -0
- package/src/lib/components/private/dynamic-module-field/dynamic-module-field.component.html +42 -0
- package/src/lib/components/private/dynamic-module-field/dynamic-module-field.component.scss +0 -0
- package/src/lib/components/private/dynamic-module-field/dynamic-module-field.component.ts +125 -0
- package/src/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.html +25 -0
- package/src/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.ts +172 -0
- package/src/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.html +32 -0
- package/src/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.ts +53 -0
- package/src/lib/components/private/field-templates/date-field-template/date-field-template.component.html +6 -0
- package/src/lib/components/private/field-templates/date-field-template/date-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/date-field-template/date-field-template.component.ts +70 -0
- package/src/lib/components/private/field-templates/image-field-template/image-field-template.component.html +57 -0
- package/src/lib/components/private/field-templates/image-field-template/image-field-template.component.scss +4 -0
- package/src/lib/components/private/field-templates/image-field-template/image-field-template.component.ts +203 -0
- package/src/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.html +46 -0
- package/src/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.scss +13 -0
- package/src/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.ts +114 -0
- package/src/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.html +6 -0
- package/src/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.ts +70 -0
- package/src/lib/components/private/field-templates/text-field-template/text-field-template.component.html +5 -0
- package/src/lib/components/private/field-templates/text-field-template/text-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/text-field-template/text-field-template.component.ts +65 -0
- package/src/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.html +5 -0
- package/src/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.scss +0 -0
- package/src/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.ts +48 -0
- package/src/lib/components/private/form-records/add-form-record/add-form-record.component.html +74 -0
- package/src/lib/components/private/form-records/add-form-record/add-form-record.component.scss +0 -0
- package/src/lib/components/private/form-records/add-form-record/add-form-record.component.ts +117 -0
- package/src/lib/components/private/form-records/list-form-record/list-form-record.component.html +14 -0
- package/src/lib/components/private/form-records/list-form-record/list-form-record.component.scss +7 -0
- package/src/lib/components/private/form-records/list-form-record/list-form-record.component.ts +213 -0
- package/src/lib/components/private/spinner/spinner.component.html +3 -0
- package/src/lib/components/private/spinner/spinner.component.scss +100 -0
- package/src/lib/components/private/spinner/spinner.component.ts +19 -0
- package/src/lib/eqp-dynamic-module.module.ts +65 -0
- package/{lib/interfaces/iBaseFieldComponent.interface.d.ts → src/lib/interfaces/iBaseFieldComponent.interface.ts} +1 -1
- package/{lib/interfaces/iRootObject.interface.d.ts → src/lib/interfaces/iRootObject.interface.ts} +1 -1
- package/{lib/models/baseField.model.d.ts → src/lib/models/baseField.model.ts} +14 -5
- package/{lib/models/baseObj.model.d.ts → src/lib/models/baseObj.model.ts} +3 -3
- package/src/lib/models/context.model.ts +10 -0
- package/{lib/models/endPointConfiguration.model.d.ts → src/lib/models/endPointConfiguration.model.ts} +16 -12
- package/{lib/models/entity.model.d.ts → src/lib/models/entity.model.ts} +2 -1
- package/src/lib/models/fields/attachmentField.model.ts +32 -0
- package/{lib/models/fields/booleanField.model.d.ts → src/lib/models/fields/booleanField.model.ts} +8 -4
- package/{lib/models/fields/dateField.model.d.ts → src/lib/models/fields/dateField.model.ts} +5 -3
- package/{lib/models/fields/imageField.model.d.ts → src/lib/models/fields/imageField.model.ts} +8 -3
- package/{lib/models/fields/listValueField.model.d.ts → src/lib/models/fields/listValueField.model.ts} +13 -8
- package/{lib/models/fields/lookupField.model.d.ts → src/lib/models/fields/lookupField.model.ts} +5 -2
- package/{lib/models/fields/numericField.model.d.ts → src/lib/models/fields/numericField.model.ts} +3 -2
- package/{lib/models/fields/testareaField.model.d.ts → src/lib/models/fields/testareaField.model.ts} +3 -2
- package/src/lib/models/fields/textField.model.ts +18 -0
- package/{lib/models/form.model.d.ts → src/lib/models/form.model.ts} +25 -12
- package/{lib/models/record.model.d.ts → src/lib/models/record.model.ts} +4 -5
- package/src/lib/modules/material.module.ts +104 -0
- package/src/lib/services/custom-form-validators.service.ts +21 -0
- package/src/lib/services/eqp-dynamic-module-dialog.service.ts +114 -0
- package/src/lib/services/spinner.service.ts +40 -0
- package/src/lib/services/utilityHelper.services.ts +413 -0
- package/{public-api.d.ts → src/public-api.ts} +3 -0
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +23 -0
- package/tsconfig.lib.prod.json +6 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
- package/bundles/eqproject-eqp-dynamic-module.umd.js +0 -3992
- package/bundles/eqproject-eqp-dynamic-module.umd.js.map +0 -1
- package/bundles/eqproject-eqp-dynamic-module.umd.min.js +0 -17
- package/bundles/eqproject-eqp-dynamic-module.umd.min.js.map +0 -1
- package/eqproject-eqp-dynamic-module.d.ts +0 -6
- package/eqproject-eqp-dynamic-module.metadata.json +0 -1
- package/esm2015/eqproject-eqp-dynamic-module.js +0 -7
- package/esm2015/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +0 -262
- package/esm2015/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +0 -649
- package/esm2015/lib/components/private/add-form-field/add-form-field.component.js +0 -577
- package/esm2015/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +0 -127
- package/esm2015/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +0 -170
- package/esm2015/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +0 -56
- package/esm2015/lib/components/private/field-templates/date-field-template/date-field-template.component.js +0 -71
- package/esm2015/lib/components/private/field-templates/image-field-template/image-field-template.component.js +0 -196
- package/esm2015/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +0 -115
- package/esm2015/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +0 -71
- package/esm2015/lib/components/private/field-templates/text-field-template/text-field-template.component.js +0 -67
- package/esm2015/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +0 -51
- package/esm2015/lib/components/private/form-records/add-form-record/add-form-record.component.js +0 -130
- package/esm2015/lib/components/private/form-records/list-form-record/list-form-record.component.js +0 -216
- package/esm2015/lib/components/private/spinner/spinner.component.js +0 -23
- package/esm2015/lib/eqp-dynamic-module.module.js +0 -71
- package/esm2015/lib/interfaces/iBaseFieldComponent.interface.js +0 -1
- package/esm2015/lib/interfaces/iRootObject.interface.js +0 -1
- package/esm2015/lib/models/baseField.model.js +0 -36
- package/esm2015/lib/models/baseObj.model.js +0 -9
- package/esm2015/lib/models/context.model.js +0 -8
- package/esm2015/lib/models/endPointConfiguration.model.js +0 -23
- package/esm2015/lib/models/entity.model.js +0 -7
- package/esm2015/lib/models/fields/attachmentField.model.js +0 -22
- package/esm2015/lib/models/fields/booleanField.model.js +0 -12
- package/esm2015/lib/models/fields/dateField.model.js +0 -11
- package/esm2015/lib/models/fields/imageField.model.js +0 -8
- package/esm2015/lib/models/fields/listValueField.model.js +0 -14
- package/esm2015/lib/models/fields/lookupField.model.js +0 -5
- package/esm2015/lib/models/fields/numericField.model.js +0 -5
- package/esm2015/lib/models/fields/testareaField.model.js +0 -4
- package/esm2015/lib/models/fields/textField.model.js +0 -14
- package/esm2015/lib/models/form.model.js +0 -24
- package/esm2015/lib/models/record.model.js +0 -8
- package/esm2015/lib/modules/material.module.js +0 -108
- package/esm2015/lib/services/custom-form-validators.service.js +0 -19
- package/esm2015/lib/services/eqp-dynamic-module-dialog.service.js +0 -113
- package/esm2015/lib/services/spinner.service.js +0 -43
- package/esm2015/lib/services/utilityHelper.services.js +0 -387
- package/esm2015/public-api.js +0 -39
- package/esm5/eqproject-eqp-dynamic-module.js +0 -7
- package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +0 -269
- package/esm5/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +0 -664
- package/esm5/lib/components/private/add-form-field/add-form-field.component.js +0 -588
- package/esm5/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +0 -128
- package/esm5/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +0 -173
- package/esm5/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +0 -57
- package/esm5/lib/components/private/field-templates/date-field-template/date-field-template.component.js +0 -72
- package/esm5/lib/components/private/field-templates/image-field-template/image-field-template.component.js +0 -206
- package/esm5/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +0 -119
- package/esm5/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +0 -72
- package/esm5/lib/components/private/field-templates/text-field-template/text-field-template.component.js +0 -68
- package/esm5/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +0 -52
- package/esm5/lib/components/private/form-records/add-form-record/add-form-record.component.js +0 -133
- package/esm5/lib/components/private/form-records/list-form-record/list-form-record.component.js +0 -220
- package/esm5/lib/components/private/spinner/spinner.component.js +0 -24
- package/esm5/lib/eqp-dynamic-module.module.js +0 -74
- package/esm5/lib/interfaces/iBaseFieldComponent.interface.js +0 -1
- package/esm5/lib/interfaces/iRootObject.interface.js +0 -1
- package/esm5/lib/models/baseField.model.js +0 -43
- package/esm5/lib/models/baseObj.model.js +0 -13
- package/esm5/lib/models/context.model.js +0 -14
- package/esm5/lib/models/endPointConfiguration.model.js +0 -33
- package/esm5/lib/models/entity.model.js +0 -14
- package/esm5/lib/models/fields/attachmentField.model.js +0 -29
- package/esm5/lib/models/fields/booleanField.model.js +0 -19
- package/esm5/lib/models/fields/dateField.model.js +0 -18
- package/esm5/lib/models/fields/imageField.model.js +0 -19
- package/esm5/lib/models/fields/listValueField.model.js +0 -25
- package/esm5/lib/models/fields/lookupField.model.js +0 -12
- package/esm5/lib/models/fields/numericField.model.js +0 -12
- package/esm5/lib/models/fields/testareaField.model.js +0 -11
- package/esm5/lib/models/fields/textField.model.js +0 -21
- package/esm5/lib/models/form.model.js +0 -39
- package/esm5/lib/models/record.model.js +0 -14
- package/esm5/lib/modules/material.module.js +0 -111
- package/esm5/lib/services/custom-form-validators.service.js +0 -23
- package/esm5/lib/services/eqp-dynamic-module-dialog.service.js +0 -123
- package/esm5/lib/services/spinner.service.js +0 -46
- package/esm5/lib/services/utilityHelper.services.js +0 -396
- package/esm5/public-api.js +0 -39
- package/fesm2015/eqproject-eqp-dynamic-module.js +0 -3582
- package/fesm2015/eqproject-eqp-dynamic-module.js.map +0 -1
- package/fesm5/eqproject-eqp-dynamic-module.js +0 -3768
- package/fesm5/eqproject-eqp-dynamic-module.js.map +0 -1
- package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +0 -101
- package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +0 -235
- package/lib/components/private/add-form-field/add-form-field.component.d.ts +0 -199
- package/lib/components/private/dynamic-module-field/dynamic-module-field.component.d.ts +0 -55
- package/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.d.ts +0 -68
- package/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.d.ts +0 -21
- package/lib/components/private/field-templates/date-field-template/date-field-template.component.d.ts +0 -27
- package/lib/components/private/field-templates/image-field-template/image-field-template.component.d.ts +0 -65
- package/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.d.ts +0 -51
- package/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.d.ts +0 -26
- package/lib/components/private/field-templates/text-field-template/text-field-template.component.d.ts +0 -22
- package/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.d.ts +0 -20
- package/lib/components/private/form-records/add-form-record/add-form-record.component.d.ts +0 -52
- package/lib/components/private/form-records/list-form-record/list-form-record.component.d.ts +0 -64
- package/lib/components/private/spinner/spinner.component.d.ts +0 -9
- package/lib/eqp-dynamic-module.module.d.ts +0 -2
- package/lib/models/context.model.d.ts +0 -9
- package/lib/models/fields/attachmentField.model.d.ts +0 -17
- package/lib/models/fields/textField.model.d.ts +0 -15
- package/lib/modules/material.module.d.ts +0 -2
- package/lib/services/custom-form-validators.service.d.ts +0 -5
- package/lib/services/eqp-dynamic-module-dialog.service.d.ts +0 -34
- package/lib/services/spinner.service.d.ts +0 -15
- package/lib/services/utilityHelper.services.d.ts +0 -77
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export class EndPointConfiguration {
|
|
2
2
|
Records: {
|
|
3
3
|
GetByFormIDEndPoint?: EndPointData;
|
|
4
4
|
GetByIDEndPoint?: EndPointData;
|
|
@@ -9,27 +9,31 @@ export declare class EndPointConfiguration {
|
|
|
9
9
|
Forms: {
|
|
10
10
|
GetByIDEndPoint: EndPointData;
|
|
11
11
|
SaveEndPoint: EndPointData;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
export class EndPointData {
|
|
15
16
|
Url: string;
|
|
16
17
|
Token?: string;
|
|
17
18
|
RequestMethod: RequestMethodEnum;
|
|
18
19
|
Params?: EndPointDataParams[];
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
export class EndPointDataParams {
|
|
21
23
|
ParamName: string;
|
|
22
|
-
ParamValue: any;
|
|
24
|
+
ParamValue: any = null;
|
|
23
25
|
ParamType: ParamTypeEnum;
|
|
24
26
|
}
|
|
25
|
-
|
|
27
|
+
|
|
28
|
+
export enum ParamTypeEnum {
|
|
26
29
|
"Query param" = 1,
|
|
27
30
|
"In route" = 2,
|
|
28
31
|
"In Body" = 3
|
|
29
32
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
|
|
34
|
+
export enum RequestMethodEnum {
|
|
35
|
+
GET = 'GET',
|
|
36
|
+
POST = 'POST',
|
|
37
|
+
PUT = 'PUT',
|
|
38
|
+
DELETE = 'DELETE'
|
|
39
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IRootObject } from "../interfaces/iRootObject.interface";
|
|
2
2
|
import { BaseField } from "./baseField.model";
|
|
3
3
|
import { BaseObj } from "./baseObj.model";
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* Rappresenta l'entità su cui vengono eseguite le operazioni di salvataggio.
|
|
6
7
|
*/
|
|
7
|
-
export
|
|
8
|
+
export class Entity extends BaseObj implements IRootObject {
|
|
8
9
|
Name: string;
|
|
9
10
|
Fields: Array<BaseField>;
|
|
10
11
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BaseField } from "../baseField.model";
|
|
2
|
+
|
|
3
|
+
export class AttachmentField extends BaseField {
|
|
4
|
+
/**Elenco delle estensioni consentite. Se vuoto usa il default (pdf) */
|
|
5
|
+
AllowedExtensions: Array<string>;
|
|
6
|
+
|
|
7
|
+
/**Se true permette l'inserimento di più allegati. In questo caso i metadati vengono rappresentati come una detail */
|
|
8
|
+
IsMultiAttach: boolean;
|
|
9
|
+
|
|
10
|
+
/**Elenco campi che possono rappresentare i metadati dell'allegato, ad esempio nome, ecc... */
|
|
11
|
+
MetadataFields: Array<BaseField>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const AvailableFileExtensions: Array<{ key: string, value: string }> = [
|
|
15
|
+
{ value: '.pdf', key: 'application/pdf' },
|
|
16
|
+
{ value: '.doc', key: 'application/msword' },
|
|
17
|
+
{ value: '.xls', key: 'application/vnd.ms-excel' },
|
|
18
|
+
{ value: '.ppt', key: 'application/vnd.ms-powerpoint' },
|
|
19
|
+
{ value: '.docx', key: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' },
|
|
20
|
+
{ value: '.xlsx', key: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' },
|
|
21
|
+
{ value: '.pptx', key: 'application/vnd.openxmlformats-officedocument.presentationml.presentation' },
|
|
22
|
+
{ value: '.csv', key: 'text/csv' },
|
|
23
|
+
{ value: '.txt', key: 'text/plain' },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export const AvailableImageExtensions: Array<{ key: string, value: string }> = [
|
|
27
|
+
{ value: '.jpg/.jpeg', key: 'image/jpeg' },
|
|
28
|
+
{ value: '.png', key: 'image/png' },
|
|
29
|
+
{ value: '.bmp', key: 'image/bmp' },
|
|
30
|
+
{ value: '.svg', key: 'image/svg+xml' },
|
|
31
|
+
{ value: '.ico', key: 'image/x-icon' },
|
|
32
|
+
];
|
package/{lib/models/fields/booleanField.model.d.ts → src/lib/models/fields/booleanField.model.ts}
RENAMED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { BaseField } from "../baseField.model";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
export class BooleanField extends BaseField {
|
|
3
4
|
/**Se true il boolean accetta anche il valore N/A (non assegnato) */
|
|
4
5
|
IsTristate: boolean;
|
|
5
6
|
PresetationType: BoolPresentantioEnum;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export enum BoolPresentantioEnum {
|
|
8
10
|
"Checkbox" = 1,
|
|
9
11
|
"Toggle" = 2,
|
|
10
|
-
"Radio button" = 3
|
|
11
|
-
|
|
12
|
+
"Radio button" = 3,
|
|
13
|
+
// "Stringa true o false" = 3,
|
|
14
|
+
// "Numerico 0 o 1" = 4
|
|
15
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { BaseField } from "../baseField.model";
|
|
2
|
+
|
|
2
3
|
/**Rappresenta la configurazione di un campo Data o Data e ora, o solo ora */
|
|
3
|
-
export
|
|
4
|
+
export class DateField extends BaseField {
|
|
4
5
|
IsOnlyDate: DateTimeTypeEnum;
|
|
5
6
|
MinDate: Date;
|
|
6
7
|
MaxDate: Date;
|
|
7
8
|
DateFormat: string;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
export enum DateTimeTypeEnum {
|
|
10
12
|
"Solo data" = 1,
|
|
11
13
|
"Solo orario" = 2,
|
|
12
14
|
"Data e ora" = 3
|
|
13
|
-
}
|
|
15
|
+
}
|
package/{lib/models/fields/imageField.model.d.ts → src/lib/models/fields/imageField.model.ts}
RENAMED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { IAttachmentDTO } from "@eqproject/eqp-attachments";
|
|
2
2
|
import { BaseField } from "../baseField.model";
|
|
3
3
|
import { AttachmentField } from "./attachmentField.model";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
export class ImageField extends BaseField {
|
|
5
6
|
/**Se true il medico può disegnare sull'immagine */
|
|
6
7
|
EnableDrawing: boolean;
|
|
8
|
+
|
|
7
9
|
/**Se true l'immagine non è fissa, ma viene caricata come un allegato; */
|
|
8
10
|
ImageIsContextualAttachment: boolean;
|
|
9
11
|
/**Contiene l'allegato caricato nel campo (se ImageIsContextualAttachment == true) */
|
|
10
12
|
ContextualAttachment: IAttachmentDTO;
|
|
11
13
|
/**Proprietà per recuperare l'allegato caricato come array per eqp-attachments (se ImageIsContextualAttachment == true) */
|
|
12
|
-
get _contextualAttachments()
|
|
14
|
+
get _contextualAttachments() {
|
|
15
|
+
return this.ContextualAttachment ? [this.ContextualAttachment] : [];
|
|
16
|
+
}
|
|
13
17
|
/**Nome dell'immagine caricata (se ImageIsContextualAttachment == true) */
|
|
14
18
|
ImgName: string;
|
|
19
|
+
|
|
15
20
|
AttachDefinition: AttachmentField;
|
|
16
|
-
}
|
|
21
|
+
}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { AttachmentType, IAttachmentDTO } from "@eqproject/eqp-attachments";
|
|
2
2
|
import { BaseField } from "../baseField.model";
|
|
3
|
+
|
|
3
4
|
/**Lista di valori */
|
|
4
|
-
export
|
|
5
|
+
export class ListValueField extends BaseField {
|
|
5
6
|
/**
|
|
6
|
-
* Lista di valori ordinata. La parte "Value", viene utilizzata in modi diversi a seconda del tipo di presentazione, e/o
|
|
7
|
+
* Lista di valori ordinata. La parte "Value", viene utilizzata in modi diversi a seconda del tipo di presentazione, e/o
|
|
7
8
|
* come valore relazionato nelle formule
|
|
8
9
|
*/
|
|
9
|
-
ValuePairs: {
|
|
10
|
-
|
|
11
|
-
};
|
|
10
|
+
ValuePairs: { [key: string]: any };
|
|
11
|
+
|
|
12
12
|
/**Se true è l'utente può scegliere più di un valore */
|
|
13
13
|
IsMultiChoiche: boolean;
|
|
14
|
+
|
|
14
15
|
/**Modalità di presentazione */
|
|
15
16
|
PresentationMode: ListPresentationEnum;
|
|
17
|
+
|
|
16
18
|
/**Elenco delle immagini per la visualizzazione a immagini (ListPresentationEnum.Immagini) */
|
|
17
19
|
ButtonImageList: Array<ButtonImage>;
|
|
18
20
|
}
|
|
19
|
-
|
|
21
|
+
|
|
22
|
+
export class ButtonImage implements IAttachmentDTO {
|
|
20
23
|
ButtonKey: string;
|
|
21
24
|
ButtonValue: string;
|
|
25
|
+
|
|
22
26
|
ID: string | number;
|
|
23
27
|
FileName?: string;
|
|
24
28
|
FileContentType?: string;
|
|
@@ -30,9 +34,10 @@ export declare class ButtonImage implements IAttachmentDTO {
|
|
|
30
34
|
FileThumbnailBase64?: string;
|
|
31
35
|
TrustedUrl?: any;
|
|
32
36
|
}
|
|
33
|
-
|
|
37
|
+
|
|
38
|
+
export enum ListPresentationEnum {
|
|
34
39
|
"Combo box" = 1,
|
|
35
40
|
"Radio button" = 2,
|
|
36
41
|
"Pulsante con testo" = 3,
|
|
37
42
|
"Immagini" = 4
|
|
38
|
-
}
|
|
43
|
+
}
|
package/{lib/models/fields/lookupField.model.d.ts → src/lib/models/fields/lookupField.model.ts}
RENAMED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { BaseField } from "../baseField.model";
|
|
2
|
+
|
|
2
3
|
/**Questo tipo di campo rappresenta una lookup ad altri valori */
|
|
3
|
-
export
|
|
4
|
+
export class LookupField extends BaseField {
|
|
4
5
|
/**Entità relazionata (il padre) */
|
|
5
6
|
EntitySourceName: string;
|
|
7
|
+
|
|
6
8
|
/**Elenco di campi ordinato che verrà visualizzato nella lookup */
|
|
7
9
|
FieldNames: string[];
|
|
10
|
+
|
|
8
11
|
/**Se true la lookup viene visualizzata in una modale per lo scegli scarta */
|
|
9
12
|
UseAsGetOrDiscard: boolean;
|
|
10
|
-
}
|
|
13
|
+
}
|
package/{lib/models/fields/numericField.model.d.ts → src/lib/models/fields/numericField.model.ts}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseField } from "../baseField.model";
|
|
2
|
+
|
|
2
3
|
/**Classe contiene la configurazione dei campi numerici */
|
|
3
|
-
export
|
|
4
|
+
export class NumericField extends BaseField {
|
|
4
5
|
IsInteger: boolean;
|
|
5
6
|
MinValue: number;
|
|
6
7
|
MaxValue: number;
|
|
@@ -8,4 +9,4 @@ export declare class NumericField extends BaseField {
|
|
|
8
9
|
DecimalPrecision: number;
|
|
9
10
|
ThousandsSeparator: string;
|
|
10
11
|
CurrencySymbol: string;
|
|
11
|
-
}
|
|
12
|
+
}
|
package/{lib/models/fields/testareaField.model.d.ts → src/lib/models/fields/testareaField.model.ts}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseField } from "../baseField.model";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
export class TextareaField extends BaseField {
|
|
3
4
|
/**Numero di righe in altezza con cui viene rappresentata la text area */
|
|
4
5
|
Rows: number;
|
|
5
6
|
MaxLenght: number;
|
|
6
7
|
MinLenght: number;
|
|
7
|
-
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseField } from "../baseField.model";
|
|
2
|
+
|
|
3
|
+
/**Campo di testo */
|
|
4
|
+
export class TextField extends BaseField {
|
|
5
|
+
TextMask: TextMaskEnum;
|
|
6
|
+
MaxLenght: number;
|
|
7
|
+
MinLenght: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum TextMaskEnum {
|
|
11
|
+
'Password' = 1,
|
|
12
|
+
'Email' = 2,
|
|
13
|
+
'Telefono' = 3,
|
|
14
|
+
'Url' = 4
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const UrlRegex = '(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?';
|
|
18
|
+
export const TelRegex = '([+]?[0-9]{10,14})';
|
|
@@ -1,46 +1,59 @@
|
|
|
1
1
|
import { BaseObj } from "./baseObj.model";
|
|
2
2
|
import { IRootObject } from "../interfaces/iRootObject.interface";
|
|
3
3
|
import { BaseField } from "./baseField.model";
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* Classe che rappresenta una Form completa.
|
|
6
7
|
* Si tratta dell'oggetto che viene rappresentato a video e con cui l'utente interagisce.
|
|
7
8
|
*/
|
|
8
|
-
export
|
|
9
|
+
export class Form extends BaseObj implements IRootObject {
|
|
9
10
|
Name: string;
|
|
10
11
|
OrgaID: string;
|
|
12
|
+
// FormType: FormTypeEnum;
|
|
11
13
|
FormScalarType: FormScalarTypeEnum;
|
|
12
14
|
FormFieldsGroups: Array<FormFieldGroup>;
|
|
15
|
+
|
|
13
16
|
/**
|
|
14
17
|
* Elenco dei campi rappresentati nella form
|
|
15
18
|
* possono appartenere ad una sola entità
|
|
16
19
|
*/
|
|
17
20
|
Fields: Array<BaseField>;
|
|
21
|
+
|
|
18
22
|
ActionsOnRecord: Array<ActionOnRecord>;
|
|
23
|
+
|
|
19
24
|
/**
|
|
20
25
|
* Elenco delle form contenute nella form base, ad esempio possono essere le varie form di
|
|
21
26
|
* dettaglio
|
|
22
27
|
*/
|
|
23
28
|
InnerForms: Array<Form>;
|
|
29
|
+
|
|
24
30
|
RootEntityID: string;
|
|
31
|
+
|
|
32
|
+
// Proprietà client
|
|
25
33
|
OldName?: string;
|
|
26
34
|
}
|
|
27
|
-
|
|
35
|
+
|
|
36
|
+
export class FormFieldGroup {
|
|
28
37
|
Name: string;
|
|
29
38
|
OrdinalPosition?: number;
|
|
30
39
|
}
|
|
31
|
-
|
|
40
|
+
|
|
41
|
+
export class ActionOnRecord {
|
|
32
42
|
Name: string;
|
|
33
43
|
Icon: string;
|
|
34
|
-
Action: string;
|
|
44
|
+
Action: string; //Codice js
|
|
35
45
|
OrdinalPosition: number;
|
|
36
46
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
|
|
48
|
+
export enum FormTypeEnum {
|
|
49
|
+
SCALAR = 1, /* form di tipo scalare */
|
|
50
|
+
LIST = 2 /* form di tipo lista che viene rappresentata con molti record */
|
|
40
51
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"In
|
|
52
|
+
|
|
53
|
+
export enum FormScalarTypeEnum {
|
|
54
|
+
"Semplice" = 1, //FLAT
|
|
55
|
+
"A step" = 2, //STEPPER
|
|
56
|
+
"In tab" = 3, //GROUPED_BY_TAB
|
|
57
|
+
"In accordion" = 4 //GROUPED_BY_ACCORDION
|
|
46
58
|
}
|
|
59
|
+
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export class Record {
|
|
2
2
|
ID: string;
|
|
3
3
|
EntID: string;
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
export class DynRecord {
|
|
7
8
|
ID: string;
|
|
8
9
|
EntID: string;
|
|
9
|
-
Values: {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
};
|
|
10
|
+
Values: { [key: string]: any; } = {};
|
|
12
11
|
SerializedValues: string;
|
|
13
12
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
//Angular Material Components
|
|
4
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import { MatInputModule } from '@angular/material/input';
|
|
7
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
8
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
9
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
10
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
11
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
12
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
13
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
14
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
15
|
+
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
16
|
+
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
17
|
+
import { MatListModule } from '@angular/material/list';
|
|
18
|
+
import { MatGridListModule } from '@angular/material/grid-list';
|
|
19
|
+
import { MatCardModule } from '@angular/material/card';
|
|
20
|
+
import { MatStepperModule } from '@angular/material/stepper';
|
|
21
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
22
|
+
import { MatExpansionModule } from '@angular/material/expansion';
|
|
23
|
+
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
24
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
25
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
26
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
27
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
28
|
+
import { MatDialogModule } from '@angular/material/dialog';
|
|
29
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
30
|
+
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
31
|
+
import { MatTableModule } from '@angular/material/table';
|
|
32
|
+
import { MatSortModule } from '@angular/material/sort';
|
|
33
|
+
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
34
|
+
import { MatNativeDateModule } from '@angular/material/core';
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@NgModule({
|
|
38
|
+
imports: [
|
|
39
|
+
MatCheckboxModule,
|
|
40
|
+
MatButtonModule,
|
|
41
|
+
MatInputModule,
|
|
42
|
+
MatAutocompleteModule,
|
|
43
|
+
MatDatepickerModule,
|
|
44
|
+
MatFormFieldModule,
|
|
45
|
+
MatRadioModule,
|
|
46
|
+
MatSelectModule,
|
|
47
|
+
MatSliderModule,
|
|
48
|
+
MatSlideToggleModule,
|
|
49
|
+
MatMenuModule,
|
|
50
|
+
MatSidenavModule,
|
|
51
|
+
MatToolbarModule,
|
|
52
|
+
MatListModule,
|
|
53
|
+
MatGridListModule,
|
|
54
|
+
MatCardModule,
|
|
55
|
+
MatStepperModule,
|
|
56
|
+
MatTabsModule,
|
|
57
|
+
MatExpansionModule,
|
|
58
|
+
MatButtonToggleModule,
|
|
59
|
+
MatChipsModule,
|
|
60
|
+
MatIconModule,
|
|
61
|
+
MatProgressSpinnerModule,
|
|
62
|
+
MatProgressBarModule,
|
|
63
|
+
MatDialogModule,
|
|
64
|
+
MatTooltipModule,
|
|
65
|
+
MatSnackBarModule,
|
|
66
|
+
MatTableModule,
|
|
67
|
+
MatSortModule,
|
|
68
|
+
MatPaginatorModule,
|
|
69
|
+
MatDatepickerModule,
|
|
70
|
+
MatNativeDateModule
|
|
71
|
+
],
|
|
72
|
+
exports: [
|
|
73
|
+
MatCheckboxModule,
|
|
74
|
+
MatButtonModule,
|
|
75
|
+
MatInputModule,
|
|
76
|
+
MatAutocompleteModule,
|
|
77
|
+
MatDatepickerModule,
|
|
78
|
+
MatFormFieldModule,
|
|
79
|
+
MatRadioModule,
|
|
80
|
+
MatSelectModule,
|
|
81
|
+
MatSliderModule,
|
|
82
|
+
MatSlideToggleModule,
|
|
83
|
+
MatMenuModule,
|
|
84
|
+
MatSidenavModule,
|
|
85
|
+
MatToolbarModule,
|
|
86
|
+
MatListModule,
|
|
87
|
+
MatGridListModule,
|
|
88
|
+
MatCardModule,
|
|
89
|
+
MatStepperModule,
|
|
90
|
+
MatTabsModule,
|
|
91
|
+
MatExpansionModule,
|
|
92
|
+
MatButtonToggleModule,
|
|
93
|
+
MatChipsModule,
|
|
94
|
+
MatIconModule,
|
|
95
|
+
MatProgressSpinnerModule,
|
|
96
|
+
MatProgressBarModule,
|
|
97
|
+
MatDialogModule,
|
|
98
|
+
MatTooltipModule,
|
|
99
|
+
MatSnackBarModule,
|
|
100
|
+
MatTableModule,
|
|
101
|
+
MatSortModule,
|
|
102
|
+
MatPaginatorModule],
|
|
103
|
+
})
|
|
104
|
+
export class MaterialModule { }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AbstractControl, ValidationErrors } from "@angular/forms";
|
|
2
|
+
|
|
3
|
+
export class ArrayValidators {
|
|
4
|
+
public static minLenght(minLenght: number): (AbstractControl) => ValidationErrors | null {
|
|
5
|
+
var validationFunction = (control: AbstractControl): ValidationErrors | null => {
|
|
6
|
+
return !!control && !!control.value && Array.isArray(control.value) && control.value.length >= minLenght
|
|
7
|
+
? null
|
|
8
|
+
: { hasMinLenght: false };
|
|
9
|
+
};
|
|
10
|
+
return validationFunction;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public static maxLenght(maxLenght: number): (AbstractControl) => ValidationErrors | null {
|
|
14
|
+
var validationFunction = (control: AbstractControl): ValidationErrors | null => {
|
|
15
|
+
return !!control && !!control.value && Array.isArray(control.value) && control.value.length <= maxLenght
|
|
16
|
+
? null
|
|
17
|
+
: { hasMinLenght: false };
|
|
18
|
+
};
|
|
19
|
+
return validationFunction;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Injectable } from "@angular/core";
|
|
2
|
+
import Swal from 'sweetalert2';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root'
|
|
6
|
+
})
|
|
7
|
+
export class EqpDynamicModuleDialogService {
|
|
8
|
+
|
|
9
|
+
constructor() { }
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Mostra uno sweet alert di tipo SUCCESS con il messaggio passato come parametro.
|
|
13
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
14
|
+
* @param title Titolo dello sweetalert (di default mostra 'Operazione completata')
|
|
15
|
+
*/
|
|
16
|
+
static Success(message: string, title: string = null) {
|
|
17
|
+
let currentTitle = title != null ? title : 'Operazione completata con successo.';
|
|
18
|
+
Swal.fire(currentTitle, message, 'success');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
|
|
23
|
+
* @param message Messaggio d'errore da mostrare nello sweetalert
|
|
24
|
+
* @param title Titolo dello sweetalert (di default mostra 'Errore')
|
|
25
|
+
*/
|
|
26
|
+
static Error(message: string | string[], title: string = null) {
|
|
27
|
+
let currentTitle = title != null ? title : 'Errore';
|
|
28
|
+
if (Array.isArray(message)) {
|
|
29
|
+
currentTitle = title != null ? title : 'Errore';
|
|
30
|
+
let htmlErrors: string = message.join("<br>");
|
|
31
|
+
Swal.fire({
|
|
32
|
+
title: currentTitle,
|
|
33
|
+
html: htmlErrors,
|
|
34
|
+
icon: 'error'
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
Swal.fire(currentTitle, message, 'error');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
|
|
45
|
+
* CONFERMA lancia la funzione di callback passata come parametro
|
|
46
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
47
|
+
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
48
|
+
*/
|
|
49
|
+
static Confirm(message: string | string[], confirmCallback: any, isWarning: boolean = false, title: string = null, customWidth: string = null) {
|
|
50
|
+
|
|
51
|
+
let currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
|
|
52
|
+
if (Array.isArray(message)) {
|
|
53
|
+
let htmlErrors: string = message.join("<br>");
|
|
54
|
+
Swal.fire({
|
|
55
|
+
title: currentTitle,
|
|
56
|
+
html: htmlErrors,
|
|
57
|
+
width: customWidth ? customWidth : '32rem',
|
|
58
|
+
icon: !isWarning ? 'question' : 'warning',
|
|
59
|
+
showCancelButton: true,
|
|
60
|
+
allowOutsideClick: false,
|
|
61
|
+
allowEscapeKey: false
|
|
62
|
+
}).then((result) => {
|
|
63
|
+
if (result.value && confirmCallback) {
|
|
64
|
+
confirmCallback();
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
Swal.fire({
|
|
70
|
+
title: currentTitle,
|
|
71
|
+
text: message,
|
|
72
|
+
width: customWidth ? customWidth : '32rem',
|
|
73
|
+
icon: !isWarning ? 'question' : 'warning',
|
|
74
|
+
showCancelButton: true,
|
|
75
|
+
allowOutsideClick: false,
|
|
76
|
+
allowEscapeKey: false
|
|
77
|
+
}).then((result) => {
|
|
78
|
+
if (result.value && confirmCallback) {
|
|
79
|
+
confirmCallback();
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
|
|
87
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
88
|
+
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
89
|
+
*/
|
|
90
|
+
static Info(message: string, title: string = null, isToast: boolean = null) {
|
|
91
|
+
let currentTitle = title != null ? title : "Informazione:";
|
|
92
|
+
Swal.fire(currentTitle, message, 'info');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
|
|
97
|
+
* @param message Messaggio da mostrare nello sweetalert
|
|
98
|
+
* @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
|
|
99
|
+
*/
|
|
100
|
+
static Warning(message: string | string[], title: string = null, isToast: boolean = null) {
|
|
101
|
+
let currentTitle = title != null ? title : "Attenzione!";
|
|
102
|
+
|
|
103
|
+
if (Array.isArray(message)) {
|
|
104
|
+
let htmlWarnings: string = message.join("<br>");
|
|
105
|
+
Swal.fire({
|
|
106
|
+
title: currentTitle,
|
|
107
|
+
html: htmlWarnings,
|
|
108
|
+
icon: 'warning'
|
|
109
|
+
});
|
|
110
|
+
} else {
|
|
111
|
+
Swal.fire(currentTitle, message, 'warning');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Injectable } from "@angular/core";
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root'
|
|
6
|
+
})
|
|
7
|
+
export class SpinnerService {
|
|
8
|
+
isLoading = new Subject<boolean>();
|
|
9
|
+
|
|
10
|
+
private requestsCount: number = 0;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Mostra lo spinner
|
|
14
|
+
*/
|
|
15
|
+
show() {
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
this.isLoading.next(true);
|
|
18
|
+
}, 100);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Nasconde lo spinner
|
|
23
|
+
*/
|
|
24
|
+
hide() {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
this.isLoading.next(false);
|
|
27
|
+
}, 100);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
addRequestCounter() {
|
|
31
|
+
this.requestsCount++;
|
|
32
|
+
this.show();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
removeRequestCounter() {
|
|
36
|
+
this.requestsCount--;
|
|
37
|
+
if (this.requestsCount == 0)
|
|
38
|
+
this.hide();
|
|
39
|
+
}
|
|
40
|
+
}
|