@churchillliving/se-ui-toolkit 6.53.510 → 6.53.511
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -28
- package/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +19 -27
- package/src/assets/images/doc.png +0 -0
- package/src/assets/images/pdf-file.png +0 -0
- package/src/assets/images/xls.png +0 -0
- package/src/lib/components/base/alert-pop-up/alert-pop-up.component.css +1 -0
- package/src/lib/components/base/alert-pop-up/alert-pop-up.component.html +6 -0
- package/src/lib/components/base/alert-pop-up/alert-pop-up.component.ts +32 -0
- package/src/lib/components/base/caption/caption.component.html +10 -0
- package/src/lib/components/base/caption/caption.component.scss +50 -0
- package/src/lib/components/base/caption/caption.component.ts +78 -0
- package/src/lib/components/base/cards/card.component.html +62 -0
- package/src/lib/components/base/cards/card.component.scss +107 -0
- package/src/lib/components/base/cards/card.component.ts +152 -0
- package/src/lib/components/base/file/file.component.html +101 -0
- package/src/lib/components/base/file/file.component.scss +98 -0
- package/src/lib/components/base/file/file.component.ts +114 -0
- package/src/lib/components/base/file-upload/file-upload.component.html +11 -0
- package/src/lib/components/base/file-upload/file-upload.component.scss +1 -0
- package/src/lib/components/base/file-upload/file-upload.component.ts +66 -0
- package/src/lib/components/base/filter/filter.component.html +9 -0
- package/src/lib/components/base/filter/filter.component.ts +46 -0
- package/src/lib/components/base/form/form.component.html +663 -0
- package/src/lib/components/base/form/form.component.scss +276 -0
- package/src/lib/components/base/form/form.component.ts +1262 -0
- package/src/lib/components/base/grid/grid.component.html +833 -0
- package/src/lib/components/base/grid/grid.component.scss +194 -0
- package/src/lib/components/base/grid/grid.component.ts +2876 -0
- package/src/lib/components/base/grid/grid.constant.ts +26 -0
- package/src/lib/components/base/grid-row-actions/grid-row-actions.component.html +42 -0
- package/src/lib/components/base/grid-row-actions/grid-row-actions.component.scss +3 -0
- package/src/lib/components/base/grid-row-actions/grid-row-actions.component.ts +51 -0
- package/src/lib/components/base/header/header.component.html +176 -0
- package/src/lib/components/base/header/header.component.scss +65 -0
- package/src/lib/components/base/header/header.component.ts +96 -0
- package/src/lib/components/base/iframe/iframe.component.html +1 -0
- package/src/lib/components/base/iframe/iframe.component.scss +4 -0
- package/src/lib/components/base/iframe/iframe.component.ts +49 -0
- package/src/lib/components/base/image-gallery/image-gallery.component.css +21 -0
- package/src/lib/components/base/image-gallery/image-gallery.component.html +16 -0
- package/src/lib/components/base/image-gallery/image-gallery.component.ts +29 -0
- package/src/lib/components/base/loader/loader.component.html +11 -0
- package/src/lib/components/base/loader/loader.component.scss +26 -0
- package/src/lib/components/base/loader/loader.component.ts +35 -0
- package/src/lib/components/base/menu-bar/menu-bar.component.html +42 -0
- package/src/lib/components/base/menu-bar/menu-bar.component.scss +165 -0
- package/src/lib/components/base/menu-bar/menu-bar.component.ts +135 -0
- package/src/lib/components/base/report/report-Filter/report-filter/report-filter.component.html +7 -0
- package/src/lib/components/base/report/report-Filter/report-filter/report-filter.component.scss +0 -0
- package/src/lib/components/base/report/report-Filter/report-filter/report-filter.component.ts +124 -0
- package/src/lib/components/base/report/reportGenerateBtn/generate-report-btn/generate-report-btn.component.html +8 -0
- package/src/lib/components/base/report/reportGenerateBtn/generate-report-btn/generate-report-btn.component.scss +0 -0
- package/src/lib/components/base/report/reportGenerateBtn/generate-report-btn/generate-report-btn.component.ts +28 -0
- package/src/lib/components/base/sidebar/sidebar.component.html +25 -0
- package/src/lib/components/base/sidebar/sidebar.component.scss +178 -0
- package/src/lib/components/base/sidebar/sidebar.component.ts +348 -0
- package/src/lib/components/shared/dropdown/dropdown.component.html +5 -0
- package/src/lib/components/shared/dropdown/dropdown.component.scss +0 -0
- package/src/lib/components/shared/dropdown/dropdown.component.ts +38 -0
- package/src/lib/components/shared/filter-menu/filter-menu.component.html +6 -0
- package/src/lib/components/shared/filter-menu/filter-menu.component.scss +34 -0
- package/src/lib/components/shared/filter-menu/filter-menu.component.ts +29 -0
- package/src/lib/components/shared/global-filters/global-filters.component.html +393 -0
- package/src/lib/components/shared/global-filters/global-filters.component.scss +125 -0
- package/src/lib/components/shared/global-filters/global-filters.component.ts +556 -0
- package/src/lib/components/shared/notes/notes.component.html +36 -0
- package/src/lib/components/shared/notes/notes.component.scss +6 -0
- package/src/lib/components/shared/notes/notes.component.ts +30 -0
- package/src/lib/directive/add-row.directive.ts +32 -0
- package/{lib/models/common.model.d.ts → src/lib/models/common.model.ts} +10 -9
- package/src/lib/models/form.model.ts +382 -0
- package/src/lib/models/grid.model.ts +542 -0
- package/src/lib/models/header.model.ts +85 -0
- package/{lib/models/menu.model.d.ts → src/lib/models/menu.model.ts} +8 -7
- package/src/lib/models/request.model.ts +15 -0
- package/src/lib/models/response.model.ts +11 -0
- package/src/lib/models/sidebar.model.ts +48 -0
- package/{lib/models/user-info.model.d.ts → src/lib/models/user-info.model.ts} +29 -25
- package/src/lib/se-ui-toolkit.module.ts +156 -0
- package/src/lib/services/alert.service.ts +87 -0
- package/src/lib/services/authentication.service.ts +49 -0
- package/src/lib/services/card.service.ts +106 -0
- package/src/lib/services/dropdown.service.ts +73 -0
- package/src/lib/services/form.service.ts +532 -0
- package/src/lib/services/grid.service.ts +1597 -0
- package/src/lib/services/header.service.ts +64 -0
- package/src/lib/services/hyperlink.service.ts +167 -0
- package/src/lib/services/loader.service.ts +33 -0
- package/src/lib/services/page-logger.service.ts +22 -0
- package/src/lib/services/report.service.ts +167 -0
- package/src/lib/services/request.service.ts +48 -0
- package/src/lib/services/sidebar.service.ts +65 -0
- package/src/lib/services/utilities.service.ts +1281 -0
- package/src/lib/shared/style.scss +29 -0
- package/{public-api.d.ts → src/public-api.ts} +62 -54
- 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/churchillliving-se-ui-toolkit.umd.js +0 -10790
- package/bundles/churchillliving-se-ui-toolkit.umd.js.map +0 -1
- package/churchillliving-se-ui-toolkit.d.ts +0 -9
- package/churchillliving-se-ui-toolkit.metadata.json +0 -1
- package/esm2015/churchillliving-se-ui-toolkit.js +0 -10
- package/esm2015/lib/components/base/alert-pop-up/alert-pop-up.component.js +0 -36
- package/esm2015/lib/components/base/caption/caption.component.js +0 -75
- package/esm2015/lib/components/base/cards/card.component.js +0 -157
- package/esm2015/lib/components/base/file/file.component.js +0 -114
- package/esm2015/lib/components/base/file-upload/file-upload.component.js +0 -74
- package/esm2015/lib/components/base/filter/filter.component.js +0 -54
- package/esm2015/lib/components/base/form/form.component.js +0 -1142
- package/esm2015/lib/components/base/grid/grid.component.js +0 -2657
- package/esm2015/lib/components/base/grid/grid.constant.js +0 -26
- package/esm2015/lib/components/base/grid-row-actions/grid-row-actions.component.js +0 -48
- package/esm2015/lib/components/base/header/header.component.js +0 -99
- package/esm2015/lib/components/base/iframe/iframe.component.js +0 -46
- package/esm2015/lib/components/base/image-gallery/image-gallery.component.js +0 -33
- package/esm2015/lib/components/base/loader/loader.component.js +0 -39
- package/esm2015/lib/components/base/menu-bar/menu-bar.component.js +0 -120
- package/esm2015/lib/components/base/report/report-Filter/report-filter/report-filter.component.js +0 -132
- package/esm2015/lib/components/base/report/reportGenerateBtn/generate-report-btn/generate-report-btn.component.js +0 -31
- package/esm2015/lib/components/base/sidebar/sidebar.component.js +0 -346
- package/esm2015/lib/components/shared/dropdown/dropdown.component.js +0 -36
- package/esm2015/lib/components/shared/filter-menu/filter-menu.component.js +0 -31
- package/esm2015/lib/components/shared/global-filters/global-filters.component.js +0 -495
- package/esm2015/lib/components/shared/notes/notes.component.js +0 -34
- package/esm2015/lib/directive/add-row.directive.js +0 -25
- package/esm2015/lib/models/common.model.js +0 -2
- package/esm2015/lib/models/form.model.js +0 -97
- package/esm2015/lib/models/grid.model.js +0 -121
- package/esm2015/lib/models/header.model.js +0 -19
- package/esm2015/lib/models/menu.model.js +0 -2
- package/esm2015/lib/models/request.model.js +0 -2
- package/esm2015/lib/models/response.model.js +0 -2
- package/esm2015/lib/models/sidebar.model.js +0 -11
- package/esm2015/lib/models/user-info.model.js +0 -9
- package/esm2015/lib/se-ui-toolkit.module.js +0 -152
- package/esm2015/lib/services/alert.service.js +0 -80
- package/esm2015/lib/services/authentication.service.js +0 -50
- package/esm2015/lib/services/card.service.js +0 -106
- package/esm2015/lib/services/dropdown.service.js +0 -72
- package/esm2015/lib/services/form.service.js +0 -469
- package/esm2015/lib/services/grid.service.js +0 -1370
- package/esm2015/lib/services/header.service.js +0 -61
- package/esm2015/lib/services/hyperlink.service.js +0 -159
- package/esm2015/lib/services/loader.service.js +0 -36
- package/esm2015/lib/services/page-logger.service.js +0 -28
- package/esm2015/lib/services/report.service.js +0 -168
- package/esm2015/lib/services/request.service.js +0 -49
- package/esm2015/lib/services/sidebar.service.js +0 -64
- package/esm2015/lib/services/utilities.service.js +0 -1078
- package/esm2015/public-api.js +0 -58
- package/fesm2015/churchillliving-se-ui-toolkit.js +0 -9857
- package/fesm2015/churchillliving-se-ui-toolkit.js.map +0 -1
- package/lib/components/base/alert-pop-up/alert-pop-up.component.d.ts +0 -12
- package/lib/components/base/caption/caption.component.d.ts +0 -21
- package/lib/components/base/cards/card.component.d.ts +0 -28
- package/lib/components/base/file/file.component.d.ts +0 -26
- package/lib/components/base/file-upload/file-upload.component.d.ts +0 -16
- package/lib/components/base/filter/filter.component.d.ts +0 -21
- package/lib/components/base/form/form.component.d.ts +0 -170
- package/lib/components/base/grid/grid.component.d.ts +0 -390
- package/lib/components/base/grid/grid.constant.d.ts +0 -2
- package/lib/components/base/grid-row-actions/grid-row-actions.component.d.ts +0 -20
- package/lib/components/base/header/header.component.d.ts +0 -17
- package/lib/components/base/iframe/iframe.component.d.ts +0 -15
- package/lib/components/base/image-gallery/image-gallery.component.d.ts +0 -6
- package/lib/components/base/loader/loader.component.d.ts +0 -13
- package/lib/components/base/menu-bar/menu-bar.component.d.ts +0 -33
- package/lib/components/base/report/report-Filter/report-filter/report-filter.component.d.ts +0 -22
- package/lib/components/base/report/reportGenerateBtn/generate-report-btn/generate-report-btn.component.d.ts +0 -14
- package/lib/components/base/sidebar/sidebar.component.d.ts +0 -65
- package/lib/components/shared/dropdown/dropdown.component.d.ts +0 -13
- package/lib/components/shared/filter-menu/filter-menu.component.d.ts +0 -11
- package/lib/components/shared/global-filters/global-filters.component.d.ts +0 -85
- package/lib/components/shared/notes/notes.component.d.ts +0 -12
- package/lib/directive/add-row.directive.d.ts +0 -7
- package/lib/models/form.model.d.ts +0 -348
- package/lib/models/grid.model.d.ts +0 -491
- package/lib/models/header.model.d.ts +0 -72
- package/lib/models/request.model.d.ts +0 -13
- package/lib/models/response.model.d.ts +0 -10
- package/lib/models/sidebar.model.d.ts +0 -44
- package/lib/se-ui-toolkit.module.d.ts +0 -7
- package/lib/services/alert.service.d.ts +0 -22
- package/lib/services/authentication.service.d.ts +0 -8
- package/lib/services/card.service.d.ts +0 -17
- package/lib/services/dropdown.service.d.ts +0 -15
- package/lib/services/form.service.d.ts +0 -47
- package/lib/services/grid.service.d.ts +0 -119
- package/lib/services/header.service.d.ts +0 -11
- package/lib/services/hyperlink.service.d.ts +0 -16
- package/lib/services/loader.service.d.ts +0 -18
- package/lib/services/page-logger.service.d.ts +0 -6
- package/lib/services/report.service.d.ts +0 -18
- package/lib/services/request.service.d.ts +0 -16
- package/lib/services/sidebar.service.d.ts +0 -18
- package/lib/services/utilities.service.d.ts +0 -64
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<div class="p-d-flex cards-wrapper">
|
|
2
|
+
<div
|
|
3
|
+
class="example-box"
|
|
4
|
+
[class]="width && width.length > 0 ? 'p-col-' + width : 'p-col-12'"
|
|
5
|
+
>
|
|
6
|
+
<p-card class="custom-card">
|
|
7
|
+
<div class="image-wrapper">
|
|
8
|
+
<!-- Start image file type cases -->
|
|
9
|
+
<div [ngSwitch]="type">
|
|
10
|
+
<img
|
|
11
|
+
alt="ImageCard"
|
|
12
|
+
[src]="url"
|
|
13
|
+
[name]="name"
|
|
14
|
+
[id]="id"
|
|
15
|
+
*ngSwitchCase="'.image'"
|
|
16
|
+
[ngStyle]="{ height: height }"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<img
|
|
20
|
+
alt="ImageCard"
|
|
21
|
+
src="../../../../assets/images/pdf-file.png"
|
|
22
|
+
[name]="name"
|
|
23
|
+
[id]="id"
|
|
24
|
+
*ngSwitchCase="'.pdf'"
|
|
25
|
+
[ngStyle]="{ height: height }"
|
|
26
|
+
/>
|
|
27
|
+
<img
|
|
28
|
+
alt="ImageCard"
|
|
29
|
+
src="../../../../assets/images/xls.png"
|
|
30
|
+
[name]="name"
|
|
31
|
+
[id]="id"
|
|
32
|
+
*ngSwitchCase="'.excel'"
|
|
33
|
+
[ngStyle]="{ height: height }"
|
|
34
|
+
/>
|
|
35
|
+
<img
|
|
36
|
+
alt="ImageCard"
|
|
37
|
+
src="../../../../assets/images/doc.png"
|
|
38
|
+
[name]="name"
|
|
39
|
+
[id]="id"
|
|
40
|
+
*ngSwitchCase="'.document'"
|
|
41
|
+
[ngStyle]="{ height: height }"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
<!-- End image file type cases -->
|
|
45
|
+
|
|
46
|
+
<!-- start caption functionality-->
|
|
47
|
+
<div class="edit-caption">
|
|
48
|
+
<h4
|
|
49
|
+
class="example-box"
|
|
50
|
+
(click)="captionClickEvent()"
|
|
51
|
+
[title]="caption"
|
|
52
|
+
*ngIf="!editableCaption"
|
|
53
|
+
>
|
|
54
|
+
{{ caption }}
|
|
55
|
+
</h4>
|
|
56
|
+
<div
|
|
57
|
+
class="p-d-flex p-flex-column p-ai-end"
|
|
58
|
+
*ngIf="editableCaption && allowEditableCaption"
|
|
59
|
+
>
|
|
60
|
+
<input
|
|
61
|
+
type="text"
|
|
62
|
+
name="caption"
|
|
63
|
+
[(ngModel)]="caption"
|
|
64
|
+
pInputText
|
|
65
|
+
(blur)="captionSave(id, name, url, type, caption)"
|
|
66
|
+
/>
|
|
67
|
+
<div class="icons">
|
|
68
|
+
<i
|
|
69
|
+
class="pi pi-check"
|
|
70
|
+
(click)="captionSave(id, name, url, type, caption)"
|
|
71
|
+
></i>
|
|
72
|
+
<i class="pi pi-times" (click)="cancel()"></i>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<!-- End caption functionality-->
|
|
76
|
+
|
|
77
|
+
<!-- start header action button functionality -->
|
|
78
|
+
<div class="action-buttons">
|
|
79
|
+
<button
|
|
80
|
+
pButton
|
|
81
|
+
type="button"
|
|
82
|
+
icon="pi pi-arrow-circle-down"
|
|
83
|
+
(click)="downloadFile(url)"
|
|
84
|
+
class="p-button-rounded p-button-text"
|
|
85
|
+
*ngIf="allowDownloadFile"
|
|
86
|
+
></button>
|
|
87
|
+
<button
|
|
88
|
+
pButton
|
|
89
|
+
type="button"
|
|
90
|
+
icon="pi pi-trash"
|
|
91
|
+
(click)="onDeleteFile(id, name, url, type, caption)"
|
|
92
|
+
class="p-button-rounded p-button-text"
|
|
93
|
+
*ngIf="allowDeleteFile"
|
|
94
|
+
></button>
|
|
95
|
+
</div>
|
|
96
|
+
<!-- End header action button functionality -->
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</p-card>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* FOR FUNCTIONALITY USE ONLY! */
|
|
2
|
+
:host ::ng-deep {
|
|
3
|
+
.custom-card {
|
|
4
|
+
.action-buttons {
|
|
5
|
+
// display: flex;
|
|
6
|
+
// justify-content: flex-end;
|
|
7
|
+
// background-color: #eee;
|
|
8
|
+
// position: absolute;
|
|
9
|
+
// top: 0;
|
|
10
|
+
// left: 0;
|
|
11
|
+
// width: 100%;
|
|
12
|
+
visibility: hidden;
|
|
13
|
+
}
|
|
14
|
+
// .p-card-body {
|
|
15
|
+
// padding: 0;
|
|
16
|
+
// }
|
|
17
|
+
// .p-card-content {
|
|
18
|
+
// padding: 0;
|
|
19
|
+
// }
|
|
20
|
+
// .p-button.p-button-icon-only {
|
|
21
|
+
// padding: 5px;
|
|
22
|
+
// height: unset;
|
|
23
|
+
// }
|
|
24
|
+
.image-wrapper:hover .action-buttons {
|
|
25
|
+
visibility: visible;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// .cards-wrapper {
|
|
31
|
+
// width: 100%;
|
|
32
|
+
// overflow: auto;
|
|
33
|
+
// }
|
|
34
|
+
// .custom-card {
|
|
35
|
+
// width: 100%;
|
|
36
|
+
// height: 400px;
|
|
37
|
+
// .image-wrapper {
|
|
38
|
+
// position: relative;
|
|
39
|
+
// img {
|
|
40
|
+
// width: 100%;
|
|
41
|
+
// height: 300px;
|
|
42
|
+
// }
|
|
43
|
+
// }
|
|
44
|
+
// h4 {
|
|
45
|
+
// cursor: pointer;
|
|
46
|
+
// margin: auto;
|
|
47
|
+
// text-align: center;
|
|
48
|
+
// width: 90%;
|
|
49
|
+
// height: 27px;
|
|
50
|
+
// padding-bottom: 6px;
|
|
51
|
+
// overflow: hidden;
|
|
52
|
+
// white-space: nowrap;
|
|
53
|
+
// text-overflow: ellipsis;
|
|
54
|
+
// }
|
|
55
|
+
// .edit-caption {
|
|
56
|
+
// input {
|
|
57
|
+
// height: 27px;
|
|
58
|
+
// width: 100%;
|
|
59
|
+
// }
|
|
60
|
+
// .icons {
|
|
61
|
+
// position: absolute;
|
|
62
|
+
// right: 0;
|
|
63
|
+
// bottom: 2px;
|
|
64
|
+
// background-color: #fff;
|
|
65
|
+
// height: 24px;
|
|
66
|
+
// i {
|
|
67
|
+
// cursor: pointer;
|
|
68
|
+
// margin: 5px;
|
|
69
|
+
// }
|
|
70
|
+
// }
|
|
71
|
+
// }
|
|
72
|
+
//}
|
|
73
|
+
|
|
74
|
+
// .cdk-drag-preview {
|
|
75
|
+
// box-sizing: border-box;
|
|
76
|
+
// border-radius: 4px;
|
|
77
|
+
// box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
|
|
78
|
+
// 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
|
|
79
|
+
// }
|
|
80
|
+
|
|
81
|
+
.cdk-drag-placeholder {
|
|
82
|
+
opacity: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.cdk-drag-animating {
|
|
86
|
+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
|
|
87
|
+
}
|
|
88
|
+
// .example-box {
|
|
89
|
+
// padding: 0 0 1px 0;
|
|
90
|
+
// }
|
|
91
|
+
|
|
92
|
+
// .example-box:last-child {
|
|
93
|
+
// border: none;
|
|
94
|
+
// }
|
|
95
|
+
|
|
96
|
+
.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder) {
|
|
97
|
+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
|
|
98
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { ConfirmationService } from 'primeng/api';
|
|
3
|
+
import { ESelectFileType } from '../../../models/form.model';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'se-file',
|
|
7
|
+
templateUrl: './file.component.html',
|
|
8
|
+
styleUrls: ['./file.component.scss'],
|
|
9
|
+
})
|
|
10
|
+
export class fileComponent implements OnInit {
|
|
11
|
+
@Input() url: string = '';
|
|
12
|
+
@Input() caption: string = '';
|
|
13
|
+
@Input() width: string = '';
|
|
14
|
+
@Input() height: string = '200px';
|
|
15
|
+
@Output() onDeleteEvent: EventEmitter<any> = new EventEmitter();
|
|
16
|
+
@Output() onSaveEvent: EventEmitter<any> = new EventEmitter();
|
|
17
|
+
@Input() id: number;
|
|
18
|
+
@Input() name: string = '';
|
|
19
|
+
@Input() type: any;
|
|
20
|
+
@Input() allowDownloadFile: boolean = true;
|
|
21
|
+
@Input() allowEditableCaption: boolean = true;
|
|
22
|
+
@Input() allowDeleteFile: boolean = true;
|
|
23
|
+
editableCaption: boolean = false;
|
|
24
|
+
|
|
25
|
+
constructor(private confirmationService: ConfirmationService) {}
|
|
26
|
+
|
|
27
|
+
ngOnInit(): void {
|
|
28
|
+
this.checkFileExtension();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
checkFileExtension() {
|
|
32
|
+
switch (this.type) {
|
|
33
|
+
case 'png':
|
|
34
|
+
case 'jpeg':
|
|
35
|
+
case 'jfif':
|
|
36
|
+
case 'jpg': {
|
|
37
|
+
this.type = '.image';
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case 'xlsx':
|
|
41
|
+
case 'xls':
|
|
42
|
+
case 'xlsm':
|
|
43
|
+
case 'txt': {
|
|
44
|
+
this.type = ESelectFileType.EXCEL;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case 'pdf':
|
|
48
|
+
case 'html': {
|
|
49
|
+
this.type = ESelectFileType.PDF;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case 'doc':
|
|
53
|
+
case 'docx': {
|
|
54
|
+
this.type = ESelectFileType.DOCUMENT;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
downloadFile(url: string) {
|
|
61
|
+
const link: any = document.createElement('a');
|
|
62
|
+
link.href = url;
|
|
63
|
+
link.target = '_blank';
|
|
64
|
+
link.click();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
captionClickEvent() {
|
|
68
|
+
if (this.allowEditableCaption) {
|
|
69
|
+
this.editableCaption = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
captionSave(
|
|
74
|
+
id: number,
|
|
75
|
+
name: string,
|
|
76
|
+
url: string,
|
|
77
|
+
type: any,
|
|
78
|
+
caption: string
|
|
79
|
+
) {
|
|
80
|
+
let obj = {
|
|
81
|
+
id: id,
|
|
82
|
+
name: name,
|
|
83
|
+
blobfileurl: url,
|
|
84
|
+
type: type,
|
|
85
|
+
caption: caption,
|
|
86
|
+
};
|
|
87
|
+
if(caption !== null){
|
|
88
|
+
this.caption = caption;
|
|
89
|
+
this.editableCaption = false;
|
|
90
|
+
this.onSaveEvent.emit(obj);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
onDeleteFile(
|
|
95
|
+
id: number,
|
|
96
|
+
name: string,
|
|
97
|
+
url: string,
|
|
98
|
+
type: any,
|
|
99
|
+
caption: string
|
|
100
|
+
) {
|
|
101
|
+
let obj = {
|
|
102
|
+
id: id,
|
|
103
|
+
name: name,
|
|
104
|
+
blobfileurl: url,
|
|
105
|
+
type: type,
|
|
106
|
+
caption: caption,
|
|
107
|
+
};
|
|
108
|
+
this.onDeleteEvent.emit(obj);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
cancel() {
|
|
112
|
+
this.editableCaption = false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* FOR FUNCTIONALITY USE ONLY! */
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { ESelectFileType, IFormField } from '../../../models/form.model';
|
|
3
|
+
import { AlertService } from '../../../services/alert.service';
|
|
4
|
+
import { RequestService } from '../../../services/request.service';
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'se-file-upload',
|
|
7
|
+
templateUrl: './file-upload.component.html',
|
|
8
|
+
styleUrls: ['./file-upload.component.scss'],
|
|
9
|
+
})
|
|
10
|
+
export class FileUploadComponent implements OnInit {
|
|
11
|
+
@Input() acceptFileTypes: any;
|
|
12
|
+
@Input() allowMultiple: boolean = false;
|
|
13
|
+
@Input() fields: any;
|
|
14
|
+
@Output() fileUrl: EventEmitter<any> = new EventEmitter();
|
|
15
|
+
@Output() uploadFileOnReturn: EventEmitter<any> = new EventEmitter();
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
private requestService: RequestService,
|
|
19
|
+
private alertService: AlertService
|
|
20
|
+
) {}
|
|
21
|
+
|
|
22
|
+
ngOnInit(): void {}
|
|
23
|
+
|
|
24
|
+
uploadFile(files: any) {
|
|
25
|
+
let fileData = new FormData();
|
|
26
|
+
let chooseFile:boolean = false;
|
|
27
|
+
for (let i = 0; i < files.length; i++) {
|
|
28
|
+
if (files[i]) {
|
|
29
|
+
chooseFile = true;
|
|
30
|
+
fileData.append(files[i].name, files[i]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (fileData && chooseFile) {
|
|
35
|
+
if (this.fields && this.fields.uniqueKey?.length > 0) {
|
|
36
|
+
fileData.append('uniqueKey', this.fields?.uniqueKey);
|
|
37
|
+
}else if(this.fields && this.fields.pathSystemConfig?.length > 0){
|
|
38
|
+
fileData.append('azureContainer', this.fields.pathSystemConfig);
|
|
39
|
+
}
|
|
40
|
+
this.requestService.get<any[], any>('/Upload', fileData).subscribe(
|
|
41
|
+
(data: any) => {
|
|
42
|
+
if (data) {
|
|
43
|
+
this.alertService.success('File Upload Successfully.');
|
|
44
|
+
if (this.fields?.onReturn) {
|
|
45
|
+
this.fields.onReturn(data.results);
|
|
46
|
+
this.uploadFileOnReturn.emit();
|
|
47
|
+
}
|
|
48
|
+
this.fileUrl.emit(data.results);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
({ error }) => {
|
|
52
|
+
this.alertService.apiError(error);
|
|
53
|
+
if (this.fields.onReturn) {
|
|
54
|
+
this.fields.onReturn(error);
|
|
55
|
+
this.uploadFileOnReturn.emit();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
onClickEvent() {
|
|
62
|
+
if (this.fields && this.fields.onClick) {
|
|
63
|
+
this.fields.onClick();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<button *ngIf="showDialogFilter" class="align-btn p-mb-2" pButton type="button" icon="pi pi-search-plus" (click)="openFilters()"></button>
|
|
2
|
+
|
|
3
|
+
<se-global-filters
|
|
4
|
+
*ngIf="globalFilters && !showDialogFilter"
|
|
5
|
+
[globalFilters]="globalFilters"
|
|
6
|
+
(filtersApplied)="globalFiltersApplied($event)"
|
|
7
|
+
[searchGlobalFilterBtn]="searchGlobalFilterBtn"
|
|
8
|
+
[clearGlobalFilterBtn]="clearGlobalFilterBtn"
|
|
9
|
+
></se-global-filters>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
import { DialogService } from 'primeng/dynamicdialog';
|
|
3
|
+
import { SeGlobalFilterComponent } from '../../shared/global-filters/global-filters.component';
|
|
4
|
+
import { IGlobalFilter } from '../../../models/grid.model';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'se-filter',
|
|
8
|
+
templateUrl: './filter.component.html',
|
|
9
|
+
})
|
|
10
|
+
export class SeFilterComponent implements OnInit {
|
|
11
|
+
@Input() globalFilters: IGlobalFilter[];
|
|
12
|
+
@Input() showDialogFilter: boolean = false;
|
|
13
|
+
@Input() clearGlobalFilterBtn: boolean = false;
|
|
14
|
+
@Input() searchGlobalFilterBtn: boolean = false;
|
|
15
|
+
@Output() filtersApplied: EventEmitter<any> = new EventEmitter();
|
|
16
|
+
|
|
17
|
+
constructor(public dialogService: DialogService) { }
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Assignment of selected columns on page load
|
|
21
|
+
*/
|
|
22
|
+
ngOnInit(): void { }
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Opens the filter dialog
|
|
26
|
+
*/
|
|
27
|
+
openFilters() {
|
|
28
|
+
const ref = this.dialogService.open(SeGlobalFilterComponent, {
|
|
29
|
+
header: 'Choose Filters',
|
|
30
|
+
width: '70%',
|
|
31
|
+
styleClass: 'global-filter-visible',
|
|
32
|
+
data: { globalFilters: this.globalFilters, openDialog: true},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Modal response
|
|
36
|
+
ref.onClose.subscribe((res) => {
|
|
37
|
+
if (res) {
|
|
38
|
+
this.filtersApplied.emit(res);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
globalFiltersApplied(event: any){
|
|
44
|
+
this.filtersApplied.emit(event);
|
|
45
|
+
}
|
|
46
|
+
}
|