tin-spa 2.0.0 → 2.1.0
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 +2 -2
- package/{esm2015/lib/classes/Classes.js → esm2020/lib/classes/Classes.mjs} +15 -55
- package/esm2020/lib/classes/TinCore.mjs +148 -0
- package/esm2020/lib/components/activity/activity.component.mjs +24 -0
- package/esm2020/lib/components/attach/attach.component.mjs +105 -0
- package/esm2020/lib/components/change-password/change-password.component.mjs +92 -0
- package/esm2020/lib/components/check/check.component.mjs +56 -0
- package/esm2020/lib/components/chips/chips.component.mjs +58 -0
- package/esm2020/lib/components/create-account/create-account.component.mjs +72 -0
- package/esm2020/lib/components/date/date.component.mjs +64 -0
- package/esm2020/lib/components/datetime/datetime.component.mjs +39 -0
- package/esm2020/lib/components/filter/filter.component.mjs +46 -0
- package/esm2020/lib/components/form/form.component.mjs +63 -0
- package/esm2020/lib/components/label/label.component.mjs +25 -0
- package/esm2020/lib/components/loader/loader.component.mjs +24 -0
- package/esm2020/lib/components/login/login.component.mjs +113 -0
- package/esm2020/lib/components/logs/logs.component.mjs +37 -0
- package/esm2020/lib/components/message/messageDialog.component.mjs +32 -0
- package/esm2020/lib/components/money/currency-input-mask.directive.mjs +185 -0
- package/esm2020/lib/components/money/currency-input-mask.module.mjs +28 -0
- package/esm2020/lib/components/money/money.component.mjs +64 -0
- package/esm2020/lib/components/nav-menu/nav-menu.component.mjs +49 -0
- package/esm2020/lib/components/number/number.component.mjs +86 -0
- package/esm2020/lib/components/option/option.component.mjs +59 -0
- package/esm2020/lib/components/profile/profile.component.mjs +93 -0
- package/esm2020/lib/components/recover-account/recover-account.component.mjs +46 -0
- package/esm2020/lib/components/roles/addRoleDialog.component.mjs +61 -0
- package/esm2020/lib/components/roles/roles.component.mjs +91 -0
- package/esm2020/lib/components/select/select.component.mjs +71 -0
- package/esm2020/lib/components/settings/settings.component.mjs +63 -0
- package/esm2020/lib/components/signup/signup.component.mjs +50 -0
- package/esm2020/lib/components/steps/steps.component.mjs +90 -0
- package/esm2020/lib/components/table/detailsDialog.component.mjs +149 -0
- package/esm2020/lib/components/table/table.component.mjs +341 -0
- package/esm2020/lib/components/text/text.component.mjs +166 -0
- package/esm2020/lib/components/tiles/tiles.component.mjs +41 -0
- package/esm2020/lib/components/tin-spa.component.mjs +19 -0
- package/esm2020/lib/components/users/users.component.mjs +119 -0
- package/esm2020/lib/modules/admin/admin-routing.module.mjs +29 -0
- package/esm2020/lib/modules/admin/admin.module.mjs +26 -0
- package/esm2020/lib/modules/index/index-routing.module.mjs +27 -0
- package/esm2020/lib/modules/index/index.module.mjs +26 -0
- package/esm2020/lib/modules/spa-admin.module.mjs +73 -0
- package/esm2020/lib/modules/spa-index.module.mjs +52 -0
- package/esm2020/lib/modules/spa-mat.module.mjs +67 -0
- package/esm2020/lib/modules/spa-user.module.mjs +49 -0
- package/esm2020/lib/modules/user/user-routing.module.mjs +23 -0
- package/esm2020/lib/modules/user/user.module.mjs +26 -0
- package/esm2020/lib/pipes/camelToWords.pipe.mjs +23 -0
- package/esm2020/lib/services/auth.service.mjs +142 -0
- package/esm2020/lib/services/data.service.mjs +125 -0
- package/esm2020/lib/services/export.service.mjs +16 -0
- package/esm2020/lib/services/http.service.mjs +79 -0
- package/esm2020/lib/services/loader-interceptor.service.mjs +77 -0
- package/esm2020/lib/services/loader.service.mjs +17 -0
- package/esm2020/lib/services/log.service.mjs +77 -0
- package/esm2020/lib/services/message.service.mjs +52 -0
- package/esm2020/lib/services/storage.service.mjs +34 -0
- package/esm2020/lib/services/tin-spa.service.mjs +14 -0
- package/esm2020/lib/tin-spa.module.mjs +114 -0
- package/esm2020/public-api.mjs +62 -0
- package/esm2020/tin-spa.mjs +5 -0
- package/fesm2015/tin-spa.mjs +3846 -0
- package/fesm2015/tin-spa.mjs.map +1 -0
- package/fesm2020/tin-spa.mjs +3829 -0
- package/fesm2020/tin-spa.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/classes/Classes.d.ts +58 -63
- package/lib/classes/TinCore.d.ts +1 -0
- package/lib/components/activity/activity.component.d.ts +3 -0
- package/lib/components/attach/attach.component.d.ts +4 -1
- package/lib/components/change-password/change-password.component.d.ts +3 -0
- package/lib/components/check/check.component.d.ts +3 -0
- package/lib/components/chips/chips.component.d.ts +3 -0
- package/lib/components/create-account/create-account.component.d.ts +3 -0
- package/lib/components/date/date.component.d.ts +14 -6
- package/lib/components/datetime/datetime.component.d.ts +3 -0
- package/lib/components/filter/filter.component.d.ts +4 -0
- package/lib/components/form/form.component.d.ts +16 -0
- package/lib/components/label/label.component.d.ts +3 -0
- package/lib/components/loader/loader.component.d.ts +3 -0
- package/lib/components/login/login.component.d.ts +6 -0
- package/lib/components/logs/logs.component.d.ts +3 -0
- package/lib/components/message/messageDialog.component.d.ts +3 -0
- package/lib/components/money/currency-input-mask.directive.d.ts +41 -0
- package/lib/components/money/currency-input-mask.module.d.ts +9 -0
- package/lib/components/money/money.component.d.ts +9 -1
- package/lib/components/nav-menu/nav-menu.component.d.ts +3 -0
- package/lib/components/number/number.component.d.ts +29 -0
- package/lib/components/option/option.component.d.ts +3 -0
- package/lib/components/profile/profile.component.d.ts +6 -2
- package/lib/components/recover-account/recover-account.component.d.ts +3 -0
- package/lib/components/roles/addRoleDialog.component.d.ts +3 -0
- package/lib/components/roles/roles.component.d.ts +3 -0
- package/lib/components/select/select.component.d.ts +5 -1
- package/lib/components/settings/settings.component.d.ts +3 -0
- package/lib/components/signup/signup.component.d.ts +3 -0
- package/lib/components/steps/steps.component.d.ts +3 -0
- package/lib/components/table/detailsDialog.component.d.ts +28 -0
- package/lib/components/table/table.component.d.ts +57 -17
- package/lib/components/text/text.component.d.ts +13 -9
- package/lib/components/tiles/tiles.component.d.ts +3 -0
- package/lib/components/tin-spa.component.d.ts +4 -4
- package/lib/components/users/users.component.d.ts +4 -0
- package/lib/modules/admin/admin-routing.module.d.ts +7 -0
- package/lib/modules/admin/admin.module.d.ts +9 -0
- package/lib/modules/index/index-routing.module.d.ts +7 -0
- package/lib/modules/index/index.module.d.ts +9 -0
- package/lib/modules/spa-admin.module.d.ts +13 -0
- package/lib/modules/spa-index.module.d.ts +10 -0
- package/lib/modules/spa-mat.module.d.ts +31 -0
- package/lib/modules/spa-user.module.d.ts +9 -0
- package/lib/modules/user/user-routing.module.d.ts +7 -0
- package/lib/modules/user/user.module.d.ts +9 -0
- package/lib/pipes/camelToWords.pipe.d.ts +7 -0
- package/lib/services/auth.service.d.ts +3 -0
- package/lib/services/data.service.d.ts +5 -1
- package/lib/services/export.service.d.ts +3 -4
- package/lib/services/http.service.d.ts +3 -0
- package/lib/services/loader-interceptor.service.d.ts +3 -0
- package/lib/services/loader.service.d.ts +3 -0
- package/lib/services/log.service.d.ts +3 -0
- package/lib/services/message.service.d.ts +3 -0
- package/lib/services/storage.service.d.ts +3 -0
- package/lib/services/tin-spa.service.d.ts +3 -0
- package/lib/tin-spa.module.d.ts +30 -0
- package/package.json +24 -23
- package/public-api.d.ts +7 -2
- package/bundles/tin-spa.umd.js +0 -3672
- package/bundles/tin-spa.umd.js.map +0 -1
- package/bundles/tin-spa.umd.min.js +0 -16
- package/bundles/tin-spa.umd.min.js.map +0 -1
- package/esm2015/lib/classes/TinCore.js +0 -139
- package/esm2015/lib/components/activity/activity.component.js +0 -26
- package/esm2015/lib/components/attach/attach.component.js +0 -107
- package/esm2015/lib/components/change-password/change-password.component.js +0 -102
- package/esm2015/lib/components/check/check.component.js +0 -63
- package/esm2015/lib/components/chips/chips.component.js +0 -66
- package/esm2015/lib/components/create-account/create-account.component.js +0 -78
- package/esm2015/lib/components/date/date.component.js +0 -45
- package/esm2015/lib/components/datetime/datetime.component.js +0 -44
- package/esm2015/lib/components/filter/filter.component.js +0 -40
- package/esm2015/lib/components/label/label.component.js +0 -29
- package/esm2015/lib/components/loader/loader.component.js +0 -29
- package/esm2015/lib/components/login/login.component.js +0 -114
- package/esm2015/lib/components/logs/logs.component.js +0 -39
- package/esm2015/lib/components/message/messageDialog.component.js +0 -31
- package/esm2015/lib/components/money/money.component.js +0 -52
- package/esm2015/lib/components/nav-menu/nav-menu.component.js +0 -51
- package/esm2015/lib/components/option/option.component.js +0 -63
- package/esm2015/lib/components/profile/profile.component.js +0 -98
- package/esm2015/lib/components/recover-account/recover-account.component.js +0 -53
- package/esm2015/lib/components/roles/addRoleDialog.component.js +0 -61
- package/esm2015/lib/components/roles/roles.component.js +0 -94
- package/esm2015/lib/components/select/select.component.js +0 -77
- package/esm2015/lib/components/settings/settings.component.js +0 -63
- package/esm2015/lib/components/signup/signup.component.js +0 -57
- package/esm2015/lib/components/steps/steps.component.js +0 -93
- package/esm2015/lib/components/table/table.component.js +0 -107
- package/esm2015/lib/components/text/text.component.js +0 -165
- package/esm2015/lib/components/tiles/tiles.component.js +0 -41
- package/esm2015/lib/components/timeout/timeout.component.js +0 -90
- package/esm2015/lib/components/tin-spa.component.js +0 -19
- package/esm2015/lib/components/users/users.component.js +0 -120
- package/esm2015/lib/dnd.directive.js +0 -51
- package/esm2015/lib/modules/spa-admin.module.js +0 -50
- package/esm2015/lib/modules/spa-index.module.js +0 -35
- package/esm2015/lib/modules/spa-mat.module.js +0 -53
- package/esm2015/lib/modules/spa-user.module.js +0 -33
- package/esm2015/lib/services/auth.service.js +0 -155
- package/esm2015/lib/services/data.service.js +0 -115
- package/esm2015/lib/services/export.service.js +0 -29
- package/esm2015/lib/services/http.service.js +0 -84
- package/esm2015/lib/services/loader-interceptor.service.js +0 -83
- package/esm2015/lib/services/loader.service.js +0 -17
- package/esm2015/lib/services/log.service.js +0 -76
- package/esm2015/lib/services/message.service.js +0 -58
- package/esm2015/lib/services/storage.service.js +0 -42
- package/esm2015/lib/services/tin-spa.service.js +0 -14
- package/esm2015/lib/tin-spa.module.js +0 -91
- package/esm2015/public-api.js +0 -56
- package/esm2015/tin-spa.js +0 -8
- package/esm5/lib/classes/Classes.js +0 -313
- package/esm5/lib/classes/TinCore.js +0 -166
- package/esm5/lib/components/activity/activity.component.js +0 -27
- package/esm5/lib/components/attach/attach.component.js +0 -119
- package/esm5/lib/components/change-password/change-password.component.js +0 -104
- package/esm5/lib/components/check/check.component.js +0 -64
- package/esm5/lib/components/chips/chips.component.js +0 -68
- package/esm5/lib/components/create-account/create-account.component.js +0 -80
- package/esm5/lib/components/date/date.component.js +0 -46
- package/esm5/lib/components/datetime/datetime.component.js +0 -45
- package/esm5/lib/components/filter/filter.component.js +0 -41
- package/esm5/lib/components/label/label.component.js +0 -30
- package/esm5/lib/components/loader/loader.component.js +0 -31
- package/esm5/lib/components/login/login.component.js +0 -117
- package/esm5/lib/components/logs/logs.component.js +0 -41
- package/esm5/lib/components/message/messageDialog.component.js +0 -32
- package/esm5/lib/components/money/money.component.js +0 -53
- package/esm5/lib/components/nav-menu/nav-menu.component.js +0 -53
- package/esm5/lib/components/option/option.component.js +0 -64
- package/esm5/lib/components/profile/profile.component.js +0 -102
- package/esm5/lib/components/recover-account/recover-account.component.js +0 -55
- package/esm5/lib/components/roles/addRoleDialog.component.js +0 -63
- package/esm5/lib/components/roles/roles.component.js +0 -100
- package/esm5/lib/components/select/select.component.js +0 -79
- package/esm5/lib/components/settings/settings.component.js +0 -66
- package/esm5/lib/components/signup/signup.component.js +0 -59
- package/esm5/lib/components/steps/steps.component.js +0 -105
- package/esm5/lib/components/table/table.component.js +0 -109
- package/esm5/lib/components/text/text.component.js +0 -168
- package/esm5/lib/components/tiles/tiles.component.js +0 -42
- package/esm5/lib/components/timeout/timeout.component.js +0 -92
- package/esm5/lib/components/tin-spa.component.js +0 -17
- package/esm5/lib/components/users/users.component.js +0 -126
- package/esm5/lib/dnd.directive.js +0 -52
- package/esm5/lib/modules/spa-admin.module.js +0 -53
- package/esm5/lib/modules/spa-index.module.js +0 -38
- package/esm5/lib/modules/spa-mat.module.js +0 -56
- package/esm5/lib/modules/spa-user.module.js +0 -36
- package/esm5/lib/services/auth.service.js +0 -157
- package/esm5/lib/services/data.service.js +0 -116
- package/esm5/lib/services/export.service.js +0 -30
- package/esm5/lib/services/http.service.js +0 -85
- package/esm5/lib/services/loader-interceptor.service.js +0 -85
- package/esm5/lib/services/loader.service.js +0 -18
- package/esm5/lib/services/log.service.js +0 -112
- package/esm5/lib/services/message.service.js +0 -59
- package/esm5/lib/services/storage.service.js +0 -74
- package/esm5/lib/services/tin-spa.service.js +0 -16
- package/esm5/lib/tin-spa.module.js +0 -94
- package/esm5/public-api.js +0 -56
- package/esm5/tin-spa.js +0 -8
- package/fesm2015/tin-spa.js +0 -3184
- package/fesm2015/tin-spa.js.map +0 -1
- package/fesm5/tin-spa.js +0 -3422
- package/fesm5/tin-spa.js.map +0 -1
- package/lib/components/timeout/timeout.component.d.ts +0 -21
- package/lib/dnd.directive.d.ts +0 -8
- package/tin-spa.d.ts +0 -7
- package/tin-spa.metadata.json +0 -1
|
@@ -0,0 +1,3829 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Inject, NgModule, EventEmitter, Input, Output, forwardRef, Directive, HostListener, ViewChild, Pipe } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/material/dialog';
|
|
4
|
+
import { MAT_DIALOG_DATA, MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule, DecimalPipe, LocationStrategy, HashLocationStrategy, CurrencyPipe, DatePipe } from '@angular/common';
|
|
7
|
+
import * as i5 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
+
import * as i3 from '@angular/material/form-field';
|
|
10
|
+
import { MatFormFieldModule, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
|
11
|
+
import { of, BehaviorSubject, Observable } from 'rxjs';
|
|
12
|
+
import { mergeMap, startWith, map } from 'rxjs/operators';
|
|
13
|
+
import * as i1$1 from '@angular/material/snack-bar';
|
|
14
|
+
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
15
|
+
import * as i1$3 from '@angular/router';
|
|
16
|
+
import { RouterModule } from '@angular/router';
|
|
17
|
+
import * as i1$2 from '@angular/common/http';
|
|
18
|
+
import { HttpHeaders, HttpResponse, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
19
|
+
import * as i8 from '@angular/material/autocomplete';
|
|
20
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
21
|
+
import { MatBadgeModule } from '@angular/material/badge';
|
|
22
|
+
import * as i14 from '@angular/material/card';
|
|
23
|
+
import { MatCardModule } from '@angular/material/card';
|
|
24
|
+
import * as i2$1 from '@angular/material/checkbox';
|
|
25
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
26
|
+
import * as i4$2 from '@angular/material/chips';
|
|
27
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
28
|
+
import * as i7 from '@angular/material/core';
|
|
29
|
+
import { MatNativeDateModule, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
30
|
+
import * as i5$1 from '@angular/material/datepicker';
|
|
31
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
32
|
+
import * as i3$1 from '@angular/material/icon';
|
|
33
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
34
|
+
import * as i4$1 from '@angular/material/input';
|
|
35
|
+
import { MatInputModule } from '@angular/material/input';
|
|
36
|
+
import { MatListModule } from '@angular/material/list';
|
|
37
|
+
import * as i4$3 from '@angular/material/menu';
|
|
38
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
39
|
+
import * as i7$1 from '@angular/material/paginator';
|
|
40
|
+
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
41
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
42
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
43
|
+
import * as i3$2 from '@angular/material/select';
|
|
44
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
45
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
46
|
+
import { MatSortModule } from '@angular/material/sort';
|
|
47
|
+
import * as i2$2 from '@angular/material/stepper';
|
|
48
|
+
import { MatStepperModule } from '@angular/material/stepper';
|
|
49
|
+
import * as i6$1 from '@angular/material/table';
|
|
50
|
+
import { MatTableModule, MatTableDataSource } from '@angular/material/table';
|
|
51
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
52
|
+
import * as i6 from '@angular/material/tooltip';
|
|
53
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
54
|
+
import * as i2 from '@angular/forms';
|
|
55
|
+
import { FormsModule, ReactiveFormsModule, FormControl, Validators, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
56
|
+
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
|
|
57
|
+
import * as i3$3 from '@angular/cdk/layout';
|
|
58
|
+
|
|
59
|
+
class TinSpaService {
|
|
60
|
+
constructor() { }
|
|
61
|
+
}
|
|
62
|
+
TinSpaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
63
|
+
TinSpaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaService, providedIn: 'root' });
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaService, decorators: [{
|
|
65
|
+
type: Injectable,
|
|
66
|
+
args: [{
|
|
67
|
+
providedIn: 'root'
|
|
68
|
+
}]
|
|
69
|
+
}], ctorParameters: function () { return []; } });
|
|
70
|
+
|
|
71
|
+
class StorageService {
|
|
72
|
+
constructor() { }
|
|
73
|
+
// Store the value
|
|
74
|
+
async store(storageKey, value) {
|
|
75
|
+
const encryptedValue = btoa(escape(JSON.stringify(value)));
|
|
76
|
+
// const encryptedValue = JSON.stringify(value);
|
|
77
|
+
await localStorage.setItem(storageKey, encryptedValue);
|
|
78
|
+
}
|
|
79
|
+
// Get the value
|
|
80
|
+
async get(storageKey) {
|
|
81
|
+
const ret = await localStorage.getItem(storageKey);
|
|
82
|
+
return JSON.parse(unescape(atob(ret)));
|
|
83
|
+
// return JSON.parse(ret);
|
|
84
|
+
}
|
|
85
|
+
// Remove
|
|
86
|
+
async removeStorageItem(storageKey) {
|
|
87
|
+
await localStorage.removeItem(storageKey);
|
|
88
|
+
}
|
|
89
|
+
// Clear storage
|
|
90
|
+
async clear() {
|
|
91
|
+
await localStorage.clear();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
StorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
95
|
+
StorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StorageService, providedIn: 'root' });
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StorageService, decorators: [{
|
|
97
|
+
type: Injectable,
|
|
98
|
+
args: [{
|
|
99
|
+
providedIn: 'root'
|
|
100
|
+
}]
|
|
101
|
+
}], ctorParameters: function () { return []; } });
|
|
102
|
+
|
|
103
|
+
class messageDialog {
|
|
104
|
+
constructor(dialogRef, data) {
|
|
105
|
+
this.dialogRef = dialogRef;
|
|
106
|
+
this.data = data;
|
|
107
|
+
}
|
|
108
|
+
ngOnInit() {
|
|
109
|
+
this.messageType = this.data.type;
|
|
110
|
+
this._messageSubject = this.data.subject;
|
|
111
|
+
this._messageDetails = this.data.details;
|
|
112
|
+
}
|
|
113
|
+
response(resp) {
|
|
114
|
+
this.dialogRef.close(resp);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
messageDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: messageDialog, deps: [{ token: i4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
118
|
+
messageDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: messageDialog, selector: "lib-app-message", ngImport: i0, template: "\r\n <h2 mat-dialog-title>\r\n\r\n <mat-label *ngIf=\"messageType=='confirm'\">Confirm</mat-label>\r\n <mat-label *ngIf=\"messageType=='info'\">Information</mat-label>\r\n <mat-label *ngIf=\"messageType=='error'\">Error</mat-label>\r\n\r\n </h2>\r\n\r\n <mat-dialog-content class=\"mat-typography\">\r\n\r\n\r\n <!-- Confirm -->\r\n <p *ngIf=\"messageType=='confirm'\">{{_messageDetails}}</p>\r\n\r\n\r\n <!-- Information -->\r\n <div *ngIf=\"messageType=='info'\">\r\n\r\n <h3>{{_messageSubject}}</h3>\r\n <mat-label>{{_messageDetails}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div *ngIf=\"messageType=='error'\">\r\n\r\n <mat-label>{{_messageDetails}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n </mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n\r\n <button id=\"btnYes\" mat-stroked-button *ngIf=\"messageType=='confirm'\" (click)=\"response('yes')\" cdkFocusInitial>Yes</button>\r\n\r\n <button id=\"btnNo\" mat-stroked-button *ngIf=\"messageType=='confirm'\" (click)=\"response('no')\" >No</button>\r\n\r\n <button id=\"btnOK\" mat-stroked-button *ngIf=\"messageType=='info' || messageType=='error'\" (click)=\"response('ok')\" cdkFocusInitial>OK</button>\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }] });
|
|
119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: messageDialog, decorators: [{
|
|
120
|
+
type: Component,
|
|
121
|
+
args: [{ selector: 'lib-app-message', template: "\r\n <h2 mat-dialog-title>\r\n\r\n <mat-label *ngIf=\"messageType=='confirm'\">Confirm</mat-label>\r\n <mat-label *ngIf=\"messageType=='info'\">Information</mat-label>\r\n <mat-label *ngIf=\"messageType=='error'\">Error</mat-label>\r\n\r\n </h2>\r\n\r\n <mat-dialog-content class=\"mat-typography\">\r\n\r\n\r\n <!-- Confirm -->\r\n <p *ngIf=\"messageType=='confirm'\">{{_messageDetails}}</p>\r\n\r\n\r\n <!-- Information -->\r\n <div *ngIf=\"messageType=='info'\">\r\n\r\n <h3>{{_messageSubject}}</h3>\r\n <mat-label>{{_messageDetails}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div *ngIf=\"messageType=='error'\">\r\n\r\n <mat-label>{{_messageDetails}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n </mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n\r\n <button id=\"btnYes\" mat-stroked-button *ngIf=\"messageType=='confirm'\" (click)=\"response('yes')\" cdkFocusInitial>Yes</button>\r\n\r\n <button id=\"btnNo\" mat-stroked-button *ngIf=\"messageType=='confirm'\" (click)=\"response('no')\" >No</button>\r\n\r\n <button id=\"btnOK\" mat-stroked-button *ngIf=\"messageType=='info' || messageType=='error'\" (click)=\"response('ok')\" cdkFocusInitial>OK</button>\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n" }]
|
|
122
|
+
}], ctorParameters: function () { return [{ type: i4.MatDialogRef }, { type: undefined, decorators: [{
|
|
123
|
+
type: Inject,
|
|
124
|
+
args: [MAT_DIALOG_DATA]
|
|
125
|
+
}] }]; } });
|
|
126
|
+
;
|
|
127
|
+
|
|
128
|
+
class MessageService {
|
|
129
|
+
constructor(snackBar, dialog) {
|
|
130
|
+
this.snackBar = snackBar;
|
|
131
|
+
this.dialog = dialog;
|
|
132
|
+
}
|
|
133
|
+
toast(msg) {
|
|
134
|
+
this.snackBar.open(msg, "OK", { duration: 5000 });
|
|
135
|
+
}
|
|
136
|
+
info(subject, details) {
|
|
137
|
+
let type = "info";
|
|
138
|
+
const dialogRef = this.dialog.open(messageDialog, {
|
|
139
|
+
width: "600px",
|
|
140
|
+
data: { type, subject, details },
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
error(details) {
|
|
144
|
+
let type = "error";
|
|
145
|
+
let subject;
|
|
146
|
+
const dialogRef = this.dialog.open(messageDialog, {
|
|
147
|
+
width: "600px",
|
|
148
|
+
data: { type, subject, details },
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
confirm(msg) {
|
|
152
|
+
let type = "confirm";
|
|
153
|
+
let subject = "";
|
|
154
|
+
let details = msg;
|
|
155
|
+
const dialogRef = this.dialog.open(messageDialog, {
|
|
156
|
+
width: "400px",
|
|
157
|
+
data: { type, subject, details },
|
|
158
|
+
});
|
|
159
|
+
return dialogRef.afterClosed().pipe(mergeMap((result) => {
|
|
160
|
+
return of(result);
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, deps: [{ token: i1$1.MatSnackBar }, { token: i4.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
165
|
+
MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, providedIn: "root" });
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, decorators: [{
|
|
167
|
+
type: Injectable,
|
|
168
|
+
args: [{
|
|
169
|
+
providedIn: "root",
|
|
170
|
+
}]
|
|
171
|
+
}], ctorParameters: function () { return [{ type: i1$1.MatSnackBar }, { type: i4.MatDialog }]; } });
|
|
172
|
+
|
|
173
|
+
// import * as FileSaver from 'file-saver';
|
|
174
|
+
// import * as XLSX from 'xlsx';
|
|
175
|
+
class ExportService {
|
|
176
|
+
constructor() { }
|
|
177
|
+
}
|
|
178
|
+
ExportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ExportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
179
|
+
ExportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ExportService, providedIn: 'root' });
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ExportService, decorators: [{
|
|
181
|
+
type: Injectable,
|
|
182
|
+
args: [{
|
|
183
|
+
providedIn: 'root'
|
|
184
|
+
}]
|
|
185
|
+
}], ctorParameters: function () { return []; } });
|
|
186
|
+
|
|
187
|
+
class Core {
|
|
188
|
+
static getClone(x) {
|
|
189
|
+
return JSON.parse(JSON.stringify(x));
|
|
190
|
+
}
|
|
191
|
+
static getNumber(value) {
|
|
192
|
+
if (value == null || value == "") {
|
|
193
|
+
return 0;
|
|
194
|
+
}
|
|
195
|
+
const onlyNumbers = value.replace(/[^\d.-]/g, '');
|
|
196
|
+
return onlyNumbers;
|
|
197
|
+
}
|
|
198
|
+
static getFirstDayOfMonth() {
|
|
199
|
+
const date = new Date();
|
|
200
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
201
|
+
}
|
|
202
|
+
static emailIsValid(email) {
|
|
203
|
+
// return /\S+@\S+\.\S+/.test(email)
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
static isValidUNCPath(path) {
|
|
207
|
+
// return /\\\\([a-zA-Z0-9_.$●-]+)\\([a-zA-Z0-9_.$●-]+).*/.test(path)
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
static isValidDate(date) {
|
|
211
|
+
var parsedDate = Date.parse(date);
|
|
212
|
+
if (isNaN(date) && !isNaN(parsedDate)) {
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
static isValidEmailList(list) {
|
|
220
|
+
if (list.includes(";")) {
|
|
221
|
+
let emails = list.split(";");
|
|
222
|
+
for (var email of emails) {
|
|
223
|
+
if (this.emailIsValid(email) == false) {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
if (this.emailIsValid(list) == false) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
static isNumber(value) {
|
|
236
|
+
return ((value != null) &&
|
|
237
|
+
(value !== '') &&
|
|
238
|
+
!isNaN(Number(value.toString())));
|
|
239
|
+
}
|
|
240
|
+
static getDiff(startDate, endDate = Date()) {
|
|
241
|
+
var eventStartTime = new Date(startDate);
|
|
242
|
+
var eventEndTime = new Date(endDate);
|
|
243
|
+
var milliseconds = eventEndTime.valueOf() - eventStartTime.valueOf();
|
|
244
|
+
function numberEnding(number) {
|
|
245
|
+
if (number.toFixed() == '1') {
|
|
246
|
+
return '';
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
return 's';
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
var minutes = (milliseconds / (1000 * 60));
|
|
253
|
+
var hours = (milliseconds / (1000 * 60 * 60));
|
|
254
|
+
var days = (milliseconds / (1000 * 60 * 60 * 24));
|
|
255
|
+
var weeks = (milliseconds / (1000 * 60 * 60 * 24 * 7));
|
|
256
|
+
var months = (milliseconds / (1000 * 60 * 60 * 24 * 7 * 4));
|
|
257
|
+
var years = (milliseconds / (1000 * 60 * 60 * 24 * 365));
|
|
258
|
+
if (years >= 1) {
|
|
259
|
+
return years.toFixed() + ' year' + numberEnding(years);
|
|
260
|
+
}
|
|
261
|
+
else if (months >= 1) {
|
|
262
|
+
return months.toFixed() + ' month' + numberEnding(months);
|
|
263
|
+
}
|
|
264
|
+
else if (weeks >= 1) {
|
|
265
|
+
return weeks.toFixed() + ' week' + numberEnding(weeks);
|
|
266
|
+
}
|
|
267
|
+
else if (days >= 1) {
|
|
268
|
+
return days.toFixed() + ' day' + numberEnding(days);
|
|
269
|
+
}
|
|
270
|
+
else if (hours >= 1) {
|
|
271
|
+
return hours.toFixed() + ' hour' + numberEnding(hours);
|
|
272
|
+
}
|
|
273
|
+
else if (minutes >= 1) {
|
|
274
|
+
return minutes.toFixed() + ' minute' + numberEnding(minutes);
|
|
275
|
+
}
|
|
276
|
+
else if (milliseconds >= (-1000 * 60)) {
|
|
277
|
+
return 'a minute';
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
return 'N/A';
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
static nowDate(NoTime = false) {
|
|
284
|
+
if (NoTime) {
|
|
285
|
+
return this.getFormatedDate(Date(), true);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
return this.getFormatedDate(Date());
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
static getFormatedDate(dateString, NoTime = false) {
|
|
292
|
+
let d = new Date(dateString);
|
|
293
|
+
d.setHours(d.getHours() + 2);
|
|
294
|
+
if (NoTime == true) {
|
|
295
|
+
return d.toISOString().split('T')[0];
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
return d.toISOString().split('.')[0];
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
static getFormatedDate2(d, NoTime = false) {
|
|
302
|
+
d.setHours(d.getHours() + 2);
|
|
303
|
+
if (NoTime == true) {
|
|
304
|
+
return d.toISOString().split('T')[0];
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
return d.toISOString().split('.')[0];
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
static getBusinessDatesCount(startDate, endDate) {
|
|
311
|
+
var count = 0;
|
|
312
|
+
var _startDate = new Date(startDate);
|
|
313
|
+
var _endDate = new Date(endDate);
|
|
314
|
+
var curDate = _startDate;
|
|
315
|
+
while (curDate < _endDate) {
|
|
316
|
+
var dayOfWeek = curDate.getDay();
|
|
317
|
+
if (!(dayOfWeek == 6 || dayOfWeek == 0))
|
|
318
|
+
count++;
|
|
319
|
+
curDate.setDate(curDate.getDate() + 1);
|
|
320
|
+
}
|
|
321
|
+
return count;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
Core.nullDate = "01 Jan 1969";
|
|
325
|
+
class ApiResponse {
|
|
326
|
+
}
|
|
327
|
+
class Constants {
|
|
328
|
+
}
|
|
329
|
+
Constants.AUTH_USER = 'a';
|
|
330
|
+
Constants.AUTH_NAME = 'b';
|
|
331
|
+
Constants.AUTH_ROLES = 'c';
|
|
332
|
+
Constants.AUTH_TOKEN = 'd';
|
|
333
|
+
Constants.AUTH_TOKEN_EXPIRE = 'e';
|
|
334
|
+
|
|
335
|
+
class Action {
|
|
336
|
+
}
|
|
337
|
+
class FormConfig {
|
|
338
|
+
}
|
|
339
|
+
class TableConfig {
|
|
340
|
+
}
|
|
341
|
+
class Tile {
|
|
342
|
+
}
|
|
343
|
+
class Step {
|
|
344
|
+
}
|
|
345
|
+
class ActionResponse {
|
|
346
|
+
}
|
|
347
|
+
class loginConfig {
|
|
348
|
+
constructor() {
|
|
349
|
+
this.appName = "";
|
|
350
|
+
this.selfService = false;
|
|
351
|
+
this.logo = "";
|
|
352
|
+
this.logoSize = "normal";
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
class AppConfig {
|
|
356
|
+
constructor() {
|
|
357
|
+
this.appName = "App Name";
|
|
358
|
+
this.logo = "";
|
|
359
|
+
this.logoSize = "normal";
|
|
360
|
+
this.ADAuth = true;
|
|
361
|
+
this.localAuth = true;
|
|
362
|
+
this.selfService = false;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
class CapItem {
|
|
366
|
+
constructor() {
|
|
367
|
+
this.name = "";
|
|
368
|
+
this.display = "New Cap Item";
|
|
369
|
+
this.enabled = false;
|
|
370
|
+
this.type = "";
|
|
371
|
+
this.newLine = false;
|
|
372
|
+
this.showMenu = true;
|
|
373
|
+
this.ignoreSubsDisplay = false;
|
|
374
|
+
this.link = "";
|
|
375
|
+
this.icon = "navigate_next";
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
class Account {
|
|
379
|
+
}
|
|
380
|
+
class User {
|
|
381
|
+
constructor() {
|
|
382
|
+
this.userName = "";
|
|
383
|
+
this.password = "";
|
|
384
|
+
this.tries = "0";
|
|
385
|
+
this.locked = "0";
|
|
386
|
+
this.logged = "0";
|
|
387
|
+
this.disabled = "0";
|
|
388
|
+
this.changepassword = "0";
|
|
389
|
+
this.dateCreated = Core.nowDate();
|
|
390
|
+
this.dateUpdated = Core.nowDate();
|
|
391
|
+
this.token = "";
|
|
392
|
+
this.dateExpire = Core.nowDate();
|
|
393
|
+
this.tokenExpire = Core.nowDate();
|
|
394
|
+
this.authType = "";
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
class ChangeUserPassword {
|
|
398
|
+
constructor() {
|
|
399
|
+
this.userName = "";
|
|
400
|
+
this.currentPassword = "";
|
|
401
|
+
this.newPassword = "";
|
|
402
|
+
this.confirmPassword = "";
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
class Register {
|
|
406
|
+
constructor() {
|
|
407
|
+
this.userName = "";
|
|
408
|
+
this.roleID = 1;
|
|
409
|
+
this.firstName = "";
|
|
410
|
+
this.lastName = "";
|
|
411
|
+
this.email = "";
|
|
412
|
+
this.authType = "";
|
|
413
|
+
this.password = "";
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
class Profile {
|
|
417
|
+
constructor() {
|
|
418
|
+
this.profileID = "";
|
|
419
|
+
this.userName = "";
|
|
420
|
+
this.roleID = 1;
|
|
421
|
+
this.firstName = "";
|
|
422
|
+
this.lastName = "";
|
|
423
|
+
this.email = "";
|
|
424
|
+
this.empID = "";
|
|
425
|
+
this.arID = "0";
|
|
426
|
+
this.authType = "";
|
|
427
|
+
this.password = "";
|
|
428
|
+
this.role = new Role();
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
class Role {
|
|
432
|
+
constructor() {
|
|
433
|
+
this.roleID = 0;
|
|
434
|
+
this.roleName = "New Role";
|
|
435
|
+
this.cap1 = false;
|
|
436
|
+
this.cap2 = false;
|
|
437
|
+
this.cap3 = false;
|
|
438
|
+
this.cap4 = false;
|
|
439
|
+
this.cap5 = false;
|
|
440
|
+
this.cap6 = false;
|
|
441
|
+
this.cap7 = false;
|
|
442
|
+
this.cap8 = false;
|
|
443
|
+
this.cap9 = false;
|
|
444
|
+
this.cap10 = false;
|
|
445
|
+
this.cap11 = false;
|
|
446
|
+
this.cap12 = false;
|
|
447
|
+
this.cap13 = false;
|
|
448
|
+
this.cap14 = false;
|
|
449
|
+
this.cap15 = false;
|
|
450
|
+
this.cap16 = false;
|
|
451
|
+
this.cap17 = false;
|
|
452
|
+
this.cap18 = false;
|
|
453
|
+
this.cap19 = false;
|
|
454
|
+
this.cap20 = false;
|
|
455
|
+
this.cap21 = false;
|
|
456
|
+
this.cap22 = false;
|
|
457
|
+
this.cap23 = false;
|
|
458
|
+
this.cap24 = false;
|
|
459
|
+
this.cap25 = false;
|
|
460
|
+
this.cap26 = false;
|
|
461
|
+
this.cap27 = false;
|
|
462
|
+
this.cap28 = false;
|
|
463
|
+
this.cap29 = false;
|
|
464
|
+
this.cap30 = false;
|
|
465
|
+
this.cap31 = false;
|
|
466
|
+
this.cap32 = false;
|
|
467
|
+
this.cap33 = false;
|
|
468
|
+
this.cap34 = false;
|
|
469
|
+
this.cap35 = false;
|
|
470
|
+
this.cap36 = false;
|
|
471
|
+
this.cap37 = false;
|
|
472
|
+
this.cap38 = false;
|
|
473
|
+
this.cap39 = false;
|
|
474
|
+
this.cap40 = false;
|
|
475
|
+
this.cap41 = false;
|
|
476
|
+
this.cap42 = false;
|
|
477
|
+
this.cap43 = false;
|
|
478
|
+
this.cap44 = false;
|
|
479
|
+
this.cap45 = false;
|
|
480
|
+
this.cap46 = false;
|
|
481
|
+
this.cap47 = false;
|
|
482
|
+
this.cap48 = false;
|
|
483
|
+
this.cap49 = false;
|
|
484
|
+
this.cap50 = false;
|
|
485
|
+
this.cap51 = false;
|
|
486
|
+
this.cap52 = false;
|
|
487
|
+
this.cap53 = false;
|
|
488
|
+
this.cap54 = false;
|
|
489
|
+
this.cap55 = false;
|
|
490
|
+
this.cap56 = false;
|
|
491
|
+
this.cap57 = false;
|
|
492
|
+
this.cap58 = false;
|
|
493
|
+
this.cap59 = false;
|
|
494
|
+
this.cap60 = false;
|
|
495
|
+
this.cap61 = false;
|
|
496
|
+
this.cap62 = false;
|
|
497
|
+
this.cap63 = false;
|
|
498
|
+
this.cap64 = false;
|
|
499
|
+
this.cap65 = false;
|
|
500
|
+
this.cap66 = false;
|
|
501
|
+
this.cap67 = false;
|
|
502
|
+
this.cap68 = false;
|
|
503
|
+
this.cap69 = false;
|
|
504
|
+
this.cap70 = false;
|
|
505
|
+
this.cap71 = false;
|
|
506
|
+
this.cap72 = false;
|
|
507
|
+
this.cap73 = false;
|
|
508
|
+
this.cap74 = false;
|
|
509
|
+
this.cap75 = false;
|
|
510
|
+
this.cap76 = false;
|
|
511
|
+
this.cap77 = false;
|
|
512
|
+
this.cap78 = false;
|
|
513
|
+
this.cap79 = false;
|
|
514
|
+
this.cap80 = false;
|
|
515
|
+
this.cap81 = false;
|
|
516
|
+
this.cap82 = false;
|
|
517
|
+
this.cap83 = false;
|
|
518
|
+
this.cap84 = false;
|
|
519
|
+
this.cap85 = false;
|
|
520
|
+
this.cap86 = false;
|
|
521
|
+
this.cap87 = false;
|
|
522
|
+
this.cap88 = false;
|
|
523
|
+
this.cap89 = false;
|
|
524
|
+
this.cap90 = false;
|
|
525
|
+
this.cap91 = false;
|
|
526
|
+
this.cap92 = false;
|
|
527
|
+
this.cap93 = false;
|
|
528
|
+
this.cap94 = false;
|
|
529
|
+
this.cap95 = false;
|
|
530
|
+
this.cap96 = false;
|
|
531
|
+
this.cap97 = false;
|
|
532
|
+
this.cap98 = false;
|
|
533
|
+
this.cap99 = false;
|
|
534
|
+
this.cap100 = false;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
var LogLevel;
|
|
538
|
+
(function (LogLevel) {
|
|
539
|
+
LogLevel[LogLevel["All"] = 0] = "All";
|
|
540
|
+
LogLevel[LogLevel["Debug"] = 1] = "Debug";
|
|
541
|
+
LogLevel[LogLevel["Info"] = 2] = "Info";
|
|
542
|
+
LogLevel[LogLevel["Warn"] = 3] = "Warn";
|
|
543
|
+
LogLevel[LogLevel["Error"] = 4] = "Error";
|
|
544
|
+
LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
|
|
545
|
+
LogLevel[LogLevel["Off"] = 6] = "Off";
|
|
546
|
+
})(LogLevel || (LogLevel = {}));
|
|
547
|
+
|
|
548
|
+
class HttpService {
|
|
549
|
+
constructor(httpClient, router) {
|
|
550
|
+
this.httpClient = httpClient;
|
|
551
|
+
this.router = router;
|
|
552
|
+
//----Set apiUrl from the data service of the project---//
|
|
553
|
+
this.apiUrl = "https://api.solinc.co.zw/"; //default
|
|
554
|
+
this.httpOptions_Legacy = {
|
|
555
|
+
headers: new HttpHeaders({
|
|
556
|
+
Accept: "application/json",
|
|
557
|
+
"Content-Type": "application/json",
|
|
558
|
+
Authorization: "Basic " + btoa("emptyUser:emptyToken"),
|
|
559
|
+
}),
|
|
560
|
+
resposeType: "json",
|
|
561
|
+
};
|
|
562
|
+
this.httpOptions_Files = {
|
|
563
|
+
headers: new HttpHeaders({
|
|
564
|
+
Authorization: "Basic " + btoa("tnyagato:j5Toszfr@ys"),
|
|
565
|
+
}),
|
|
566
|
+
resposeType: "json",
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
//POST
|
|
570
|
+
Post(service, data) {
|
|
571
|
+
return this.httpClient.post(this.apiUrl + service, data, this.httpOptions_Legacy);
|
|
572
|
+
}
|
|
573
|
+
//PUT
|
|
574
|
+
Put(service, data) {
|
|
575
|
+
return this.httpClient.put(this.apiUrl + service, data, this.httpOptions_Legacy);
|
|
576
|
+
}
|
|
577
|
+
//POST RAW
|
|
578
|
+
Post_Raw(url, data) {
|
|
579
|
+
return this.httpClient.post(url, data, this.httpOptions_Legacy);
|
|
580
|
+
}
|
|
581
|
+
//POST with file
|
|
582
|
+
Post_WithFile(service, data, file) {
|
|
583
|
+
let formData = new FormData();
|
|
584
|
+
if (file) {
|
|
585
|
+
formData.append("uploadFile", file, file.name);
|
|
586
|
+
}
|
|
587
|
+
formData.append("data", JSON.stringify(data));
|
|
588
|
+
return this.httpClient.post(this.apiUrl + service, formData, this.httpOptions_Files);
|
|
589
|
+
}
|
|
590
|
+
// //POST with files
|
|
591
|
+
Post_FormData(service, formData) {
|
|
592
|
+
return this.httpClient.post(this.apiUrl + service, formData, this.httpOptions_Files);
|
|
593
|
+
}
|
|
594
|
+
//GET
|
|
595
|
+
Get(service) {
|
|
596
|
+
return this.httpClient.get(this.apiUrl + service, this.httpOptions_Legacy);
|
|
597
|
+
}
|
|
598
|
+
//Get RAW
|
|
599
|
+
Get_Raw(url) {
|
|
600
|
+
return this.httpClient.get(url, this.httpOptions_Legacy);
|
|
601
|
+
}
|
|
602
|
+
//ERROR
|
|
603
|
+
Error(error) {
|
|
604
|
+
if (error.statusText == "Unauthorized") {
|
|
605
|
+
this.router.navigate(["login"]);
|
|
606
|
+
return "Unauthorized";
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
return "Connection failed";
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
HttpService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, deps: [{ token: i1$2.HttpClient }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
614
|
+
HttpService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, providedIn: "root" });
|
|
615
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, decorators: [{
|
|
616
|
+
type: Injectable,
|
|
617
|
+
args: [{
|
|
618
|
+
providedIn: "root",
|
|
619
|
+
}]
|
|
620
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i1$3.Router }]; } });
|
|
621
|
+
|
|
622
|
+
// import { Core } from 'tin-core';
|
|
623
|
+
class LogService {
|
|
624
|
+
constructor() {
|
|
625
|
+
this.level = LogLevel.All;
|
|
626
|
+
this.logToConsole = true;
|
|
627
|
+
this.logToApi = false;
|
|
628
|
+
}
|
|
629
|
+
debug(msg, ...optionalParams) {
|
|
630
|
+
this.writeToLog(msg, LogLevel.Debug, optionalParams);
|
|
631
|
+
}
|
|
632
|
+
info(msg, ...optionalParams) {
|
|
633
|
+
this.writeToLog(msg, LogLevel.Info, optionalParams);
|
|
634
|
+
}
|
|
635
|
+
warn(msg, ...optionalParams) {
|
|
636
|
+
this.writeToLog(msg, LogLevel.Warn, optionalParams);
|
|
637
|
+
}
|
|
638
|
+
error(msg, ...optionalParams) {
|
|
639
|
+
this.writeToLog(msg, LogLevel.Error, optionalParams);
|
|
640
|
+
}
|
|
641
|
+
fatal(msg, ...optionalParams) {
|
|
642
|
+
this.writeToLog(msg, LogLevel.Fatal, optionalParams);
|
|
643
|
+
}
|
|
644
|
+
log(msg, ...optionalParams) {
|
|
645
|
+
this.writeToLog(msg, LogLevel.All, optionalParams);
|
|
646
|
+
}
|
|
647
|
+
writeToLog(msg, level, params) {
|
|
648
|
+
if (this.shouldLog(level)) {
|
|
649
|
+
// Build log string
|
|
650
|
+
let value = Core.getFormatedDate(Date(), false).replace("T", " ");
|
|
651
|
+
// value += " - Type: " + LogLevel[this.level];
|
|
652
|
+
value += " - Message: " + msg;
|
|
653
|
+
if (params.length) {
|
|
654
|
+
value += " - Extra Info: " + this.formatParams(params);
|
|
655
|
+
}
|
|
656
|
+
// Log the value
|
|
657
|
+
if (this.logToConsole) {
|
|
658
|
+
console.log(value);
|
|
659
|
+
}
|
|
660
|
+
if (this.logToApi) {
|
|
661
|
+
//Call API post
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
formatParams(params) {
|
|
666
|
+
let ret = params.join(",");
|
|
667
|
+
// Is there at least one object in the array?
|
|
668
|
+
if (params.some((p) => typeof p == "object")) {
|
|
669
|
+
ret = "";
|
|
670
|
+
// Build comma-delimited string
|
|
671
|
+
for (let item of params) {
|
|
672
|
+
ret += JSON.stringify(item) + ",";
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return ret;
|
|
676
|
+
}
|
|
677
|
+
shouldLog(level) {
|
|
678
|
+
let ret = false;
|
|
679
|
+
if ((level >= this.level && level !== LogLevel.Off) ||
|
|
680
|
+
this.level === LogLevel.All) {
|
|
681
|
+
ret = true;
|
|
682
|
+
}
|
|
683
|
+
return ret;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
LogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
687
|
+
LogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, providedIn: "root" });
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, decorators: [{
|
|
689
|
+
type: Injectable,
|
|
690
|
+
args: [{
|
|
691
|
+
providedIn: "root",
|
|
692
|
+
}]
|
|
693
|
+
}], ctorParameters: function () { return []; } });
|
|
694
|
+
|
|
695
|
+
class AuthService {
|
|
696
|
+
constructor(_route, storage, router, httpService, messageService, logService) {
|
|
697
|
+
this._route = _route;
|
|
698
|
+
this.storage = storage;
|
|
699
|
+
this.router = router;
|
|
700
|
+
this.httpService = httpService;
|
|
701
|
+
this.messageService = messageService;
|
|
702
|
+
this.logService = logService;
|
|
703
|
+
//Logged in
|
|
704
|
+
this.loggedin = false;
|
|
705
|
+
this.loggedinSource = new BehaviorSubject(this.loggedin);
|
|
706
|
+
this.loggedinObserv = this.loggedinSource.asObservable();
|
|
707
|
+
//Token
|
|
708
|
+
this.token = "";
|
|
709
|
+
this.tokenSource = new BehaviorSubject(this.token);
|
|
710
|
+
this.tokenObserv = this.tokenSource.asObservable();
|
|
711
|
+
//TokenExpire
|
|
712
|
+
this.tokenExpire = "";
|
|
713
|
+
this.tokenExpireSource = new BehaviorSubject(this.tokenExpire);
|
|
714
|
+
this.tokenExpireObserv = this.tokenExpireSource.asObservable();
|
|
715
|
+
//Current User
|
|
716
|
+
this.currentUser = "tnyagato";
|
|
717
|
+
this.currentUserSource = new BehaviorSubject(this.currentUser);
|
|
718
|
+
this.currentUserObserv = this.currentUserSource.asObservable();
|
|
719
|
+
//Line Manager
|
|
720
|
+
this.islineManager = false;
|
|
721
|
+
this.isLineManagerSource = new BehaviorSubject(this.islineManager);
|
|
722
|
+
this.isLineManagerObserv = this.isLineManagerSource.asObservable();
|
|
723
|
+
//Roles
|
|
724
|
+
this.currentRole = new Role;
|
|
725
|
+
this.currentRoleSource = new BehaviorSubject(this.currentRole);
|
|
726
|
+
this.myRoleObserv = this.currentRoleSource.asObservable();
|
|
727
|
+
//Logged in FirstName
|
|
728
|
+
this.loggedUserSource = new BehaviorSubject("tnyagato");
|
|
729
|
+
this.loggedUserFullName = this.loggedUserSource.asObservable();
|
|
730
|
+
}
|
|
731
|
+
Updateloggedin(loggedin) {
|
|
732
|
+
this.loggedinSource.next(loggedin);
|
|
733
|
+
this.loggedin = loggedin;
|
|
734
|
+
}
|
|
735
|
+
UpdateToken(newToken) {
|
|
736
|
+
this.tokenSource.next(newToken);
|
|
737
|
+
}
|
|
738
|
+
UpdateTokenExpire(newTokenExpire) {
|
|
739
|
+
this.tokenExpireSource.next(newTokenExpire);
|
|
740
|
+
}
|
|
741
|
+
UpdateCurrentUser(newUser) {
|
|
742
|
+
this.currentUserSource.next(newUser.toLocaleLowerCase());
|
|
743
|
+
this.currentUser = newUser.toLocaleLowerCase();
|
|
744
|
+
}
|
|
745
|
+
UpdateIsLineManager(manager) {
|
|
746
|
+
this.isLineManagerSource.next(manager);
|
|
747
|
+
}
|
|
748
|
+
UpdateRole(role) {
|
|
749
|
+
this.currentRoleSource.next(role);
|
|
750
|
+
}
|
|
751
|
+
updateLoggedUserFullName(userName) {
|
|
752
|
+
this.loggedUserSource.next(userName);
|
|
753
|
+
}
|
|
754
|
+
//Authorisation
|
|
755
|
+
isAuthorised(capName) {
|
|
756
|
+
if (!this.currentRoleSource.value[capName]) {
|
|
757
|
+
// this.logService.info(`authorise: ${this.currentRoleSource.value.roleName} not authorised for ${capName}`);
|
|
758
|
+
this.router.navigate(["home"]);
|
|
759
|
+
this.messageService.toast(`Unauthorised: ${capName}`);
|
|
760
|
+
return false;
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
return true;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
isValidToken() {
|
|
767
|
+
let tokenExpire = new Date(this.tokenExpireSource.value);
|
|
768
|
+
let nowDate = new Date();
|
|
769
|
+
let valid = tokenExpire > nowDate;
|
|
770
|
+
if (!valid) {
|
|
771
|
+
this.router.navigate(["login"]);
|
|
772
|
+
this.messageService.toast(`Expired Session`);
|
|
773
|
+
}
|
|
774
|
+
return valid;
|
|
775
|
+
}
|
|
776
|
+
canActivate() {
|
|
777
|
+
if (this.loggedin && this.isValidToken()) {
|
|
778
|
+
// this.logService.info("authentication: logged in");
|
|
779
|
+
return true;
|
|
780
|
+
}
|
|
781
|
+
if (localStorage.getItem(Constants.AUTH_USER) === null) {
|
|
782
|
+
// this.logService.info("authentication: not logged and no cache");
|
|
783
|
+
this.Updateloggedin(false);
|
|
784
|
+
let url = new URL(window.location.href);
|
|
785
|
+
let path = url.hash.replace("#/", "");
|
|
786
|
+
this.router.navigate(["login"], {
|
|
787
|
+
relativeTo: this._route,
|
|
788
|
+
queryParams: { redirectTo: path },
|
|
789
|
+
queryParamsHandling: 'merge',
|
|
790
|
+
skipLocationChange: false
|
|
791
|
+
});
|
|
792
|
+
return false;
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
// this.logService.info("authentication: not logged but allowed login");
|
|
796
|
+
this.Updateloggedin(true);
|
|
797
|
+
this.storage.get(Constants.AUTH_USER).then((resp) => {
|
|
798
|
+
this.UpdateCurrentUser(resp);
|
|
799
|
+
});
|
|
800
|
+
this.storage.get(Constants.AUTH_NAME).then((resp) => {
|
|
801
|
+
this.updateLoggedUserFullName(resp);
|
|
802
|
+
});
|
|
803
|
+
this.storage.get(Constants.AUTH_ROLES).then((resp) => {
|
|
804
|
+
let ret = JSON.parse(resp);
|
|
805
|
+
this.UpdateRole(ret);
|
|
806
|
+
});
|
|
807
|
+
this.storage.get(Constants.AUTH_TOKEN).then((resp) => {
|
|
808
|
+
this.UpdateToken(resp);
|
|
809
|
+
});
|
|
810
|
+
this.storage.get(Constants.AUTH_TOKEN_EXPIRE).then((resp) => {
|
|
811
|
+
this.UpdateTokenExpire(resp);
|
|
812
|
+
this.isValidToken();
|
|
813
|
+
});
|
|
814
|
+
return true;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthService, deps: [{ token: i1$3.ActivatedRoute }, { token: StorageService }, { token: i1$3.Router }, { token: HttpService }, { token: MessageService }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
819
|
+
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
820
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthService, decorators: [{
|
|
821
|
+
type: Injectable,
|
|
822
|
+
args: [{
|
|
823
|
+
providedIn: 'root'
|
|
824
|
+
}]
|
|
825
|
+
}], ctorParameters: function () { return [{ type: i1$3.ActivatedRoute }, { type: StorageService }, { type: i1$3.Router }, { type: HttpService }, { type: MessageService }, { type: LogService }]; } });
|
|
826
|
+
|
|
827
|
+
class DataServiceLib {
|
|
828
|
+
constructor(httpService) {
|
|
829
|
+
this.httpService = httpService;
|
|
830
|
+
this.appConfig = new AppConfig();
|
|
831
|
+
this.appConfigSource = new BehaviorSubject(this.appConfig);
|
|
832
|
+
this.appConfigObserv = this.appConfigSource.asObservable();
|
|
833
|
+
// caps: CapItem[];
|
|
834
|
+
this.capHome = new CapItem;
|
|
835
|
+
this.capAdmin = new CapItem;
|
|
836
|
+
this.capUsers = new CapItem;
|
|
837
|
+
this.capRoles = new CapItem;
|
|
838
|
+
this.capLogs = new CapItem;
|
|
839
|
+
this.capSettings = new CapItem;
|
|
840
|
+
this.tmpProfileuserName = "";
|
|
841
|
+
this.appConfig.appName = "App-Name";
|
|
842
|
+
this.appConfig.logo = "./assets/logo.png";
|
|
843
|
+
this.appConfig.ADAuth = true;
|
|
844
|
+
this.appConfig.capItems = [this.capAdmin, this.capHome];
|
|
845
|
+
this.capHome.name = "cap1";
|
|
846
|
+
this.capHome.display = "Home";
|
|
847
|
+
this.capHome.link = "home";
|
|
848
|
+
this.capAdmin.name = "cap2";
|
|
849
|
+
this.capAdmin.display = "Admin";
|
|
850
|
+
this.capAdmin.capSubItems = [this.capUsers, this.capRoles, this.capLogs, this.capSettings];
|
|
851
|
+
this.capUsers.name = "cap3";
|
|
852
|
+
this.capUsers.display = "Users";
|
|
853
|
+
this.capUsers.link = "home/admin/users";
|
|
854
|
+
this.capRoles.name = "cap4";
|
|
855
|
+
this.capRoles.display = "Roles";
|
|
856
|
+
this.capRoles.link = "home/admin/roles";
|
|
857
|
+
this.capLogs.name = "cap5";
|
|
858
|
+
this.capLogs.display = "Logs";
|
|
859
|
+
this.capLogs.link = "home/admin/logs";
|
|
860
|
+
this.capSettings.name = "cap6";
|
|
861
|
+
this.capSettings.display = "Settings";
|
|
862
|
+
this.capSettings.link = "home/admin/settings";
|
|
863
|
+
}
|
|
864
|
+
UpdateAppConfig(config) {
|
|
865
|
+
this.appConfigSource.next(config);
|
|
866
|
+
this.appConfig = config;
|
|
867
|
+
}
|
|
868
|
+
CallApi(action, data) {
|
|
869
|
+
if (!action.method) {
|
|
870
|
+
return this.httpService.Get(action.url);
|
|
871
|
+
}
|
|
872
|
+
if (action.method == 'get') {
|
|
873
|
+
return this.httpService.Get(action.url);
|
|
874
|
+
}
|
|
875
|
+
else if (action.method == 'post') {
|
|
876
|
+
return this.httpService.Post(action.url, data);
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
return this.httpService.Post(action.url, data);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
//Users
|
|
883
|
+
GetUser() {
|
|
884
|
+
return this.httpService.Get("User/all/x");
|
|
885
|
+
}
|
|
886
|
+
RegisterAccount(u) {
|
|
887
|
+
return this.httpService.Post("User/register", u);
|
|
888
|
+
}
|
|
889
|
+
GetUserByID(val) {
|
|
890
|
+
return this.httpService.Get(`User/id/${val}`);
|
|
891
|
+
}
|
|
892
|
+
UpdateUser(profile) {
|
|
893
|
+
return this.httpService.Post("User/edit", profile);
|
|
894
|
+
}
|
|
895
|
+
UnlockUser(user) {
|
|
896
|
+
return this.httpService.Post("User/unlock", user);
|
|
897
|
+
}
|
|
898
|
+
LockUser(user) {
|
|
899
|
+
return this.httpService.Post("User/lock", user);
|
|
900
|
+
}
|
|
901
|
+
DeleteUser(user) {
|
|
902
|
+
return this.httpService.Post("User/delete", user);
|
|
903
|
+
}
|
|
904
|
+
Login(u) {
|
|
905
|
+
return this.httpService.Post("User/login", u);
|
|
906
|
+
}
|
|
907
|
+
ChangePassword(u) {
|
|
908
|
+
return this.httpService.Post("User/changepassword-self", u);
|
|
909
|
+
}
|
|
910
|
+
ChangePasswordAdmin(u) {
|
|
911
|
+
return this.httpService.Post("User/changepassword-admin", u);
|
|
912
|
+
}
|
|
913
|
+
SelfReset(u) {
|
|
914
|
+
return this.httpService.Post("Basic/SelfReset", u);
|
|
915
|
+
}
|
|
916
|
+
//Roles
|
|
917
|
+
PostRole(role, action) {
|
|
918
|
+
return this.httpService.Post(`Role?action=${action}`, role);
|
|
919
|
+
}
|
|
920
|
+
PutRole(role) {
|
|
921
|
+
return this.httpService.Put("Role", role);
|
|
922
|
+
}
|
|
923
|
+
GetRole(by, val) {
|
|
924
|
+
return this.httpService.Get("Role/all/x");
|
|
925
|
+
}
|
|
926
|
+
//Logs
|
|
927
|
+
GetLog(by, val) {
|
|
928
|
+
return this.httpService.Get("Log/all/x");
|
|
929
|
+
}
|
|
930
|
+
//Settings
|
|
931
|
+
GetSetting(by, val) {
|
|
932
|
+
return this.httpService.Get("Setting/all/x");
|
|
933
|
+
}
|
|
934
|
+
UpdateSetting(setting, action) {
|
|
935
|
+
return this.httpService.Post(`Setting?action=${action}`, setting);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
DataServiceLib.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, deps: [{ token: HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
939
|
+
DataServiceLib.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, providedIn: 'root' });
|
|
940
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, decorators: [{
|
|
941
|
+
type: Injectable,
|
|
942
|
+
args: [{
|
|
943
|
+
providedIn: 'root'
|
|
944
|
+
}]
|
|
945
|
+
}], ctorParameters: function () { return [{ type: HttpService }]; } });
|
|
946
|
+
|
|
947
|
+
class TinSpaComponent {
|
|
948
|
+
}
|
|
949
|
+
TinSpaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
950
|
+
TinSpaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TinSpaComponent, selector: "spa-tin-spa", ngImport: i0, template: `
|
|
951
|
+
<p>
|
|
952
|
+
tin-spa works!
|
|
953
|
+
</p>
|
|
954
|
+
`, isInline: true });
|
|
955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaComponent, decorators: [{
|
|
956
|
+
type: Component,
|
|
957
|
+
args: [{ selector: 'spa-tin-spa', template: `
|
|
958
|
+
<p>
|
|
959
|
+
tin-spa works!
|
|
960
|
+
</p>
|
|
961
|
+
` }]
|
|
962
|
+
}] });
|
|
963
|
+
|
|
964
|
+
class SpaMatModule {
|
|
965
|
+
}
|
|
966
|
+
SpaMatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
967
|
+
SpaMatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, exports: [CommonModule, FormsModule, ReactiveFormsModule,
|
|
968
|
+
MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
|
|
969
|
+
MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
|
|
970
|
+
MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
|
|
971
|
+
MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
|
|
972
|
+
MatDatepickerModule, MatStepperModule, MatRadioModule] });
|
|
973
|
+
SpaMatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, providers: [
|
|
974
|
+
{ provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { disableClose: true, hasBackdrop: true } },
|
|
975
|
+
{ provide: MAT_DATE_LOCALE, useValue: "en-GB" },
|
|
976
|
+
], imports: [CommonModule, FormsModule, ReactiveFormsModule,
|
|
977
|
+
MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
|
|
978
|
+
MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
|
|
979
|
+
MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
|
|
980
|
+
MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
|
|
981
|
+
MatDatepickerModule, MatStepperModule, MatRadioModule] });
|
|
982
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, decorators: [{
|
|
983
|
+
type: NgModule,
|
|
984
|
+
args: [{
|
|
985
|
+
declarations: [],
|
|
986
|
+
imports: [],
|
|
987
|
+
exports: [
|
|
988
|
+
CommonModule, FormsModule, ReactiveFormsModule,
|
|
989
|
+
MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
|
|
990
|
+
MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
|
|
991
|
+
MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
|
|
992
|
+
MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
|
|
993
|
+
MatDatepickerModule, MatStepperModule, MatRadioModule,
|
|
994
|
+
],
|
|
995
|
+
providers: [
|
|
996
|
+
{ provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { disableClose: true, hasBackdrop: true } },
|
|
997
|
+
{ provide: MAT_DATE_LOCALE, useValue: "en-GB" },
|
|
998
|
+
]
|
|
999
|
+
}]
|
|
1000
|
+
}] });
|
|
1001
|
+
|
|
1002
|
+
class TextComponent {
|
|
1003
|
+
constructor() {
|
|
1004
|
+
this.multiDimension = false;
|
|
1005
|
+
// options: FormGroup;
|
|
1006
|
+
this.hideRequiredControl = new FormControl(true);
|
|
1007
|
+
this.hide = true; //for password only
|
|
1008
|
+
this.readonly = false;
|
|
1009
|
+
this.hint = "";
|
|
1010
|
+
this.display = "";
|
|
1011
|
+
this.placeholder = "";
|
|
1012
|
+
this.value = "";
|
|
1013
|
+
this.valueChange = new EventEmitter();
|
|
1014
|
+
this.format = "text";
|
|
1015
|
+
this.type = "";
|
|
1016
|
+
this.leave = new EventEmitter();
|
|
1017
|
+
this.enterPress = new EventEmitter();
|
|
1018
|
+
this.rows = "";
|
|
1019
|
+
this.width = "100%";
|
|
1020
|
+
//Autocomplete items
|
|
1021
|
+
this.options = [];
|
|
1022
|
+
this.optionValue = "";
|
|
1023
|
+
//validation input
|
|
1024
|
+
this.required = true;
|
|
1025
|
+
this.min = 0;
|
|
1026
|
+
this.max = 9000000000000000; //Math.max
|
|
1027
|
+
this.regex = ""; //"[a-zA-Z ]*" //"/\S+@\S+\.\S+/";
|
|
1028
|
+
//validation
|
|
1029
|
+
this.myControl = new FormControl('', [Validators.required, Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
|
|
1030
|
+
this.control = new FormControl(this.value, [Validators.required, Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
|
|
1031
|
+
}
|
|
1032
|
+
ngOnInit() {
|
|
1033
|
+
if (this.options.length > 0) {
|
|
1034
|
+
this.initFilter();
|
|
1035
|
+
}
|
|
1036
|
+
if (this.placeholder == "") {
|
|
1037
|
+
this.placeholder = "Enter " + this.display;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
ngAfterViewInit() {
|
|
1041
|
+
this.initControl(this.control);
|
|
1042
|
+
this.initControl(this.myControl);
|
|
1043
|
+
}
|
|
1044
|
+
initFilter() {
|
|
1045
|
+
const objKeyList = Object.keys(this.options[0]);
|
|
1046
|
+
const firstKey = objKeyList[0];
|
|
1047
|
+
this.multiDimension = !Core.isNumber(firstKey);
|
|
1048
|
+
this.filteredOptions = this.myControl.valueChanges.pipe(startWith(""), map((value) => this._filter(value)));
|
|
1049
|
+
}
|
|
1050
|
+
_filter(value) {
|
|
1051
|
+
if (this.multiDimension) {
|
|
1052
|
+
let filterValue = "";
|
|
1053
|
+
if (value != "" && value) {
|
|
1054
|
+
filterValue = value.toLowerCase();
|
|
1055
|
+
}
|
|
1056
|
+
return this.options.filter((option) => option[`${this.optionValue}`].toLowerCase().includes(filterValue));
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
const filterValue = value.toLowerCase();
|
|
1060
|
+
return this.options.filter(option => option.toLowerCase().includes(filterValue));
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
initControl(control) {
|
|
1064
|
+
if (this.readonly) {
|
|
1065
|
+
control.setValidators(null);
|
|
1066
|
+
control.updateValueAndValidity();
|
|
1067
|
+
}
|
|
1068
|
+
if (!this.required && !this.readonly) {
|
|
1069
|
+
control.setValidators([Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
|
|
1070
|
+
this.control.updateValueAndValidity();
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
//Events
|
|
1074
|
+
changed() {
|
|
1075
|
+
if (this.options.length > 0) {
|
|
1076
|
+
this.valueChange.emit(this.myControl.value);
|
|
1077
|
+
}
|
|
1078
|
+
else {
|
|
1079
|
+
this.valueChange.emit(this.value);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
leaved() {
|
|
1083
|
+
this.leave.emit();
|
|
1084
|
+
}
|
|
1085
|
+
enterPressed() {
|
|
1086
|
+
this.enterPress.emit();
|
|
1087
|
+
}
|
|
1088
|
+
validate(control) {
|
|
1089
|
+
if ((this.required || this.min > 0) && control.hasError('required')) {
|
|
1090
|
+
return `Required`;
|
|
1091
|
+
}
|
|
1092
|
+
if (control.hasError('minlength')) {
|
|
1093
|
+
return `Minimun length is ${this.min}`;
|
|
1094
|
+
}
|
|
1095
|
+
if (control.hasError('maxlength')) {
|
|
1096
|
+
return `Maximum length is ${this.max}`;
|
|
1097
|
+
}
|
|
1098
|
+
if (control.hasError('pattern')) {
|
|
1099
|
+
return `Invalid Input`;
|
|
1100
|
+
}
|
|
1101
|
+
// if (this.regex != ""){
|
|
1102
|
+
// let r = new RegExp(this.regex, "g");
|
|
1103
|
+
// if (!r.test(this.value)){
|
|
1104
|
+
// this.valid = false;
|
|
1105
|
+
// this.errorMessage = "Invalid input";
|
|
1106
|
+
// return this.errorMessage;
|
|
1107
|
+
// }
|
|
1108
|
+
// }
|
|
1109
|
+
return "";
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
TextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1113
|
+
TextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TextComponent, selector: "spa-text", inputs: { readonly: "readonly", hint: "hint", display: "display", placeholder: "placeholder", value: "value", format: "format", type: "type", rows: "rows", width: "width", options: "options", optionValue: "optionValue", required: "required", min: "min", max: "max", regex: "regex" }, outputs: { valueChange: "valueChange", leave: "leave", enterPress: "enterPress" }, ngImport: i0, template: "\r\n<!-- General Text -->\r\n<mat-form-field *ngIf=\"rows == '' && (format=='text' || format =='date') && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\" >\r\n<mat-label *ngIf=\"format=='text'\">{{display}}</mat-label>\r\n<mat-label *ngIf=\"format=='date'\">{{display | date:'dd/MM/yyyy'}}</mat-label>\r\n<input matInput autocomplete=\"off\" [(ngModel)]=\"value\" (change)=\"changed()\" (blur)=\"leaved()\" (keyup.enter)=\"enterPressed()\" [type]=\"type\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\"/>\r\n<mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n<!-- password -->\r\n<mat-form-field *ngIf=\"format=='password'\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input matInput [type]=\"hide ? 'password' : 'text'\" (keyup.enter)=\"enterPressed()\" (change)=\"changed()\" (blur)=\"leaved()\" [(ngModel)]=\"value\" autocomplete=\"off\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\">\r\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n <button mat-icon-button matSuffix (click)=\"hide = !hide\" [attr.aria-label]=\"'Hide password'\" [attr.aria-pressed]=\"hide\">\r\n <mat-icon style=\"font-size: 18px;\">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>\r\n </button>\r\n</mat-form-field>\r\n\r\n\r\n<!-- TextArea copy - Only change input to textarea and change ngif to not -->\r\n\r\n<mat-form-field *ngIf=\"rows != '' && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n<mat-label>{{display}}</mat-label>\r\n<textarea matInput autocomplete=\"off\" [rows]=\"rows\" [(ngModel)]=\"value\" (change)=\"changed()\" (keyup.enter)=\"enterPressed()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\"></textarea>\r\n<mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n\r\n<!-- Auto Complete-->\r\n\r\n <mat-form-field *ngIf=\"rows == '' && format=='text' && options.length>0 \" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input [type]=\"type\" [placeholder]=\"placeholder\" (change)=\"changed()\" matInput [formControl]=\"myControl\" [matAutocomplete]=\"auto\" [required]=\"required\" [readonly]=\"readonly\">\r\n <mat-error *ngIf=\"control.invalid\">{{validate(myControl)}}</mat-error>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"changed()\">\r\n\r\n <ng-container *ngIf=\"!multiDimension\">\r\n <mat-option *ngFor=\"let option of filteredOptions | async\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiDimension\">\r\n <mat-option *ngFor=\"let row of filteredOptions | async\" [value]=\"row[optionValue]\">\r\n {{row[optionValue]}}\r\n </mat-option>\r\n </ng-container>\r\n\r\n\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i8.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
1114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextComponent, decorators: [{
|
|
1115
|
+
type: Component,
|
|
1116
|
+
args: [{ selector: 'spa-text', template: "\r\n<!-- General Text -->\r\n<mat-form-field *ngIf=\"rows == '' && (format=='text' || format =='date') && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\" >\r\n<mat-label *ngIf=\"format=='text'\">{{display}}</mat-label>\r\n<mat-label *ngIf=\"format=='date'\">{{display | date:'dd/MM/yyyy'}}</mat-label>\r\n<input matInput autocomplete=\"off\" [(ngModel)]=\"value\" (change)=\"changed()\" (blur)=\"leaved()\" (keyup.enter)=\"enterPressed()\" [type]=\"type\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\"/>\r\n<mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n<!-- password -->\r\n<mat-form-field *ngIf=\"format=='password'\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input matInput [type]=\"hide ? 'password' : 'text'\" (keyup.enter)=\"enterPressed()\" (change)=\"changed()\" (blur)=\"leaved()\" [(ngModel)]=\"value\" autocomplete=\"off\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\">\r\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n <button mat-icon-button matSuffix (click)=\"hide = !hide\" [attr.aria-label]=\"'Hide password'\" [attr.aria-pressed]=\"hide\">\r\n <mat-icon style=\"font-size: 18px;\">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>\r\n </button>\r\n</mat-form-field>\r\n\r\n\r\n<!-- TextArea copy - Only change input to textarea and change ngif to not -->\r\n\r\n<mat-form-field *ngIf=\"rows != '' && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n<mat-label>{{display}}</mat-label>\r\n<textarea matInput autocomplete=\"off\" [rows]=\"rows\" [(ngModel)]=\"value\" (change)=\"changed()\" (keyup.enter)=\"enterPressed()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\"></textarea>\r\n<mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n\r\n<!-- Auto Complete-->\r\n\r\n <mat-form-field *ngIf=\"rows == '' && format=='text' && options.length>0 \" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input [type]=\"type\" [placeholder]=\"placeholder\" (change)=\"changed()\" matInput [formControl]=\"myControl\" [matAutocomplete]=\"auto\" [required]=\"required\" [readonly]=\"readonly\">\r\n <mat-error *ngIf=\"control.invalid\">{{validate(myControl)}}</mat-error>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"changed()\">\r\n\r\n <ng-container *ngIf=\"!multiDimension\">\r\n <mat-option *ngFor=\"let option of filteredOptions | async\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiDimension\">\r\n <mat-option *ngFor=\"let row of filteredOptions | async\" [value]=\"row[optionValue]\">\r\n {{row[optionValue]}}\r\n </mat-option>\r\n </ng-container>\r\n\r\n\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n\r\n" }]
|
|
1117
|
+
}], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
|
|
1118
|
+
type: Input
|
|
1119
|
+
}], hint: [{
|
|
1120
|
+
type: Input
|
|
1121
|
+
}], display: [{
|
|
1122
|
+
type: Input
|
|
1123
|
+
}], placeholder: [{
|
|
1124
|
+
type: Input
|
|
1125
|
+
}], value: [{
|
|
1126
|
+
type: Input
|
|
1127
|
+
}], valueChange: [{
|
|
1128
|
+
type: Output
|
|
1129
|
+
}], format: [{
|
|
1130
|
+
type: Input
|
|
1131
|
+
}], type: [{
|
|
1132
|
+
type: Input
|
|
1133
|
+
}], leave: [{
|
|
1134
|
+
type: Output
|
|
1135
|
+
}], enterPress: [{
|
|
1136
|
+
type: Output
|
|
1137
|
+
}], rows: [{
|
|
1138
|
+
type: Input
|
|
1139
|
+
}], width: [{
|
|
1140
|
+
type: Input
|
|
1141
|
+
}], options: [{
|
|
1142
|
+
type: Input
|
|
1143
|
+
}], optionValue: [{
|
|
1144
|
+
type: Input
|
|
1145
|
+
}], required: [{
|
|
1146
|
+
type: Input
|
|
1147
|
+
}], min: [{
|
|
1148
|
+
type: Input
|
|
1149
|
+
}], max: [{
|
|
1150
|
+
type: Input
|
|
1151
|
+
}], regex: [{
|
|
1152
|
+
type: Input
|
|
1153
|
+
}] } });
|
|
1154
|
+
|
|
1155
|
+
class CheckComponent {
|
|
1156
|
+
constructor() {
|
|
1157
|
+
this.readonly = false;
|
|
1158
|
+
this.display = "";
|
|
1159
|
+
this.value = false;
|
|
1160
|
+
this.valueChange = new EventEmitter();
|
|
1161
|
+
this.click = new EventEmitter();
|
|
1162
|
+
this.check = new EventEmitter();
|
|
1163
|
+
this.uncheck = new EventEmitter();
|
|
1164
|
+
}
|
|
1165
|
+
ngOnInit() {
|
|
1166
|
+
}
|
|
1167
|
+
changed() {
|
|
1168
|
+
this.valueChange.emit(this.value);
|
|
1169
|
+
}
|
|
1170
|
+
clicked() {
|
|
1171
|
+
this.click.emit();
|
|
1172
|
+
if (!this.value) {
|
|
1173
|
+
this.checked();
|
|
1174
|
+
}
|
|
1175
|
+
else {
|
|
1176
|
+
this.unchecked();
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
checked() {
|
|
1180
|
+
this.check.emit();
|
|
1181
|
+
}
|
|
1182
|
+
unchecked() {
|
|
1183
|
+
this.uncheck.emit();
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
CheckComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1187
|
+
CheckComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CheckComponent, selector: "spa-check", inputs: { readonly: "readonly", display: "display", value: "value" }, outputs: { valueChange: "valueChange", click: "click", check: "check", uncheck: "uncheck" }, ngImport: i0, template: " <mat-checkbox color=\"primary\" style=\"margin-right:50px; font-size:14px\" [(ngModel)]=\"value\" (change)=\"changed()\" (click)=\"clicked()\" [disabled]=\"readonly\">{{display}}</mat-checkbox>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }] });
|
|
1188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckComponent, decorators: [{
|
|
1189
|
+
type: Component,
|
|
1190
|
+
args: [{ selector: 'spa-check', template: " <mat-checkbox color=\"primary\" style=\"margin-right:50px; font-size:14px\" [(ngModel)]=\"value\" (change)=\"changed()\" (click)=\"clicked()\" [disabled]=\"readonly\">{{display}}</mat-checkbox>\r\n" }]
|
|
1191
|
+
}], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
|
|
1192
|
+
type: Input
|
|
1193
|
+
}], display: [{
|
|
1194
|
+
type: Input
|
|
1195
|
+
}], value: [{
|
|
1196
|
+
type: Input
|
|
1197
|
+
}], valueChange: [{
|
|
1198
|
+
type: Output
|
|
1199
|
+
}], click: [{
|
|
1200
|
+
type: Output
|
|
1201
|
+
}], check: [{
|
|
1202
|
+
type: Output
|
|
1203
|
+
}], uncheck: [{
|
|
1204
|
+
type: Output
|
|
1205
|
+
}] } });
|
|
1206
|
+
|
|
1207
|
+
class DateComponent {
|
|
1208
|
+
constructor() {
|
|
1209
|
+
this.date = new FormControl(new Date());
|
|
1210
|
+
this.value = Core.nowDate(true);
|
|
1211
|
+
this.display = "";
|
|
1212
|
+
this.readonly = false;
|
|
1213
|
+
this.width = "100%";
|
|
1214
|
+
this.min = "1900-01-01";
|
|
1215
|
+
this.max = "9999-01-01";
|
|
1216
|
+
this.valueChange = new EventEmitter();
|
|
1217
|
+
}
|
|
1218
|
+
ngOnInit() {
|
|
1219
|
+
this.minDate = new FormControl(new Date(this.min));
|
|
1220
|
+
this.maxDate = new FormControl(new Date(this.max));
|
|
1221
|
+
if (!this.value || this.value == "") {
|
|
1222
|
+
this.date = new FormControl(new Date());
|
|
1223
|
+
;
|
|
1224
|
+
}
|
|
1225
|
+
setTimeout(() => { this.onChangeEvent(); }, 5);
|
|
1226
|
+
if (this.readonly) {
|
|
1227
|
+
this.date.disable();
|
|
1228
|
+
}
|
|
1229
|
+
else {
|
|
1230
|
+
this.date.enable();
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
ngOnChanges() {
|
|
1234
|
+
this.date = new FormControl(new Date(this.value));
|
|
1235
|
+
}
|
|
1236
|
+
onChangeEvent() {
|
|
1237
|
+
let d = Core.getFormatedDate2(this.date.value, true);
|
|
1238
|
+
this.valueChange.emit(d);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
DateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1242
|
+
DateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DateComponent, selector: "spa-date", inputs: { value: "value", display: "display", readonly: "readonly", width: "width", min: "min", max: "max" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "\r\n<mat-form-field [ngStyle]=\"{'width':width}\">\r\n<input [formControl]=\"date\" [min]=\"minDate.value\" [max]=\"maxDate.value\" matInput [matDatepicker]=\"picker_date\" (dateInput)=\"onChangeEvent()\" [placeholder]=\"display\" [readonly]=\"true\" >\r\n<mat-datepicker-toggle matSuffix [for]=\"picker_date\"></mat-datepicker-toggle>\r\n<mat-datepicker #picker_date></mat-datepicker>\r\n</mat-form-field>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i5$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i5$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] });
|
|
1243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateComponent, decorators: [{
|
|
1244
|
+
type: Component,
|
|
1245
|
+
args: [{ selector: 'spa-date', template: "\r\n<mat-form-field [ngStyle]=\"{'width':width}\">\r\n<input [formControl]=\"date\" [min]=\"minDate.value\" [max]=\"maxDate.value\" matInput [matDatepicker]=\"picker_date\" (dateInput)=\"onChangeEvent()\" [placeholder]=\"display\" [readonly]=\"true\" >\r\n<mat-datepicker-toggle matSuffix [for]=\"picker_date\"></mat-datepicker-toggle>\r\n<mat-datepicker #picker_date></mat-datepicker>\r\n</mat-form-field>\r\n" }]
|
|
1246
|
+
}], ctorParameters: function () { return []; }, propDecorators: { value: [{
|
|
1247
|
+
type: Input
|
|
1248
|
+
}], display: [{
|
|
1249
|
+
type: Input
|
|
1250
|
+
}], readonly: [{
|
|
1251
|
+
type: Input
|
|
1252
|
+
}], width: [{
|
|
1253
|
+
type: Input
|
|
1254
|
+
}], min: [{
|
|
1255
|
+
type: Input
|
|
1256
|
+
}], max: [{
|
|
1257
|
+
type: Input
|
|
1258
|
+
}], valueChange: [{
|
|
1259
|
+
type: Output
|
|
1260
|
+
}] } });
|
|
1261
|
+
|
|
1262
|
+
class DatetimeComponent {
|
|
1263
|
+
constructor() {
|
|
1264
|
+
this.display = "";
|
|
1265
|
+
this.value = "";
|
|
1266
|
+
this.valueChange = new EventEmitter();
|
|
1267
|
+
this.readonly = false;
|
|
1268
|
+
this.min = "01 jan 1900";
|
|
1269
|
+
this.max = "31 dec 9999";
|
|
1270
|
+
}
|
|
1271
|
+
ngOnInit() {
|
|
1272
|
+
}
|
|
1273
|
+
changed() {
|
|
1274
|
+
this.valueChange.emit(this.value);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
DatetimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DatetimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1278
|
+
DatetimeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DatetimeComponent, selector: "spa-datetime", inputs: { display: "display", value: "value", readonly: "readonly", min: "min", max: "max" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<mat-form-field >\r\n<mat-label>{{display}}</mat-label>\r\n<input matInput autocomplete=\"off\" type=\"datetime-local\" [(ngModel)]=\"value\" [min]=\"min\" [max]=\"max\" (change)=\"changed()\" [placeholder]=\"display\" [readonly]=\"readonly\" />\r\n</mat-form-field>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }] });
|
|
1279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DatetimeComponent, decorators: [{
|
|
1280
|
+
type: Component,
|
|
1281
|
+
args: [{ selector: 'spa-datetime', template: "<mat-form-field >\r\n<mat-label>{{display}}</mat-label>\r\n<input matInput autocomplete=\"off\" type=\"datetime-local\" [(ngModel)]=\"value\" [min]=\"min\" [max]=\"max\" (change)=\"changed()\" [placeholder]=\"display\" [readonly]=\"readonly\" />\r\n</mat-form-field>\r\n" }]
|
|
1282
|
+
}], ctorParameters: function () { return []; }, propDecorators: { display: [{
|
|
1283
|
+
type: Input
|
|
1284
|
+
}], value: [{
|
|
1285
|
+
type: Input
|
|
1286
|
+
}], valueChange: [{
|
|
1287
|
+
type: Output
|
|
1288
|
+
}], readonly: [{
|
|
1289
|
+
type: Input
|
|
1290
|
+
}], min: [{
|
|
1291
|
+
type: Input
|
|
1292
|
+
}], max: [{
|
|
1293
|
+
type: Input
|
|
1294
|
+
}] } });
|
|
1295
|
+
|
|
1296
|
+
class LabelComponent {
|
|
1297
|
+
constructor() {
|
|
1298
|
+
this.display = "";
|
|
1299
|
+
this.value = "";
|
|
1300
|
+
this.format = "text";
|
|
1301
|
+
}
|
|
1302
|
+
ngOnInit() {
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1306
|
+
LabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LabelComponent, selector: "spa-label", inputs: { display: "display", value: "value", format: "format" }, ngImport: i0, template: "<div *ngIf=\"format=='text'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> <label>{{value}} </label> \r\n</div>\r\n\r\n<div *ngIf=\"format=='date'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> <label>{{value | date:'dd/MM/yyyy'}} </label> \r\n</div>\r\n\r\n<div *ngIf=\"format=='datetime'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> <label>{{value | date:'dd/MM/yyyy HH:mm'}} </label> \r\n</div>\r\n\r\n<div *ngIf=\"format=='money'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> <label>{{value | currency:'USD':''}} </label> \r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
1307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LabelComponent, decorators: [{
|
|
1308
|
+
type: Component,
|
|
1309
|
+
args: [{ selector: 'spa-label', template: "<div *ngIf=\"format=='text'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> <label>{{value}} </label> \r\n</div>\r\n\r\n<div *ngIf=\"format=='date'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> <label>{{value | date:'dd/MM/yyyy'}} </label> \r\n</div>\r\n\r\n<div *ngIf=\"format=='datetime'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> <label>{{value | date:'dd/MM/yyyy HH:mm'}} </label> \r\n</div>\r\n\r\n<div *ngIf=\"format=='money'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> <label>{{value | currency:'USD':''}} </label> \r\n</div>\r\n" }]
|
|
1310
|
+
}], ctorParameters: function () { return []; }, propDecorators: { display: [{
|
|
1311
|
+
type: Input
|
|
1312
|
+
}], value: [{
|
|
1313
|
+
type: Input
|
|
1314
|
+
}], format: [{
|
|
1315
|
+
type: Input
|
|
1316
|
+
}] } });
|
|
1317
|
+
|
|
1318
|
+
class SelectComponent {
|
|
1319
|
+
constructor() {
|
|
1320
|
+
this.width = "100%";
|
|
1321
|
+
this.readonly = false;
|
|
1322
|
+
this.readonlyMode = "";
|
|
1323
|
+
this.hint = "";
|
|
1324
|
+
this.placeholder = "";
|
|
1325
|
+
this.multiple = false;
|
|
1326
|
+
this.display = "";
|
|
1327
|
+
this.optionValue = "";
|
|
1328
|
+
this.optionDisplay = "";
|
|
1329
|
+
this.optionDisplayExtra = "";
|
|
1330
|
+
this.valueChange = new EventEmitter();
|
|
1331
|
+
}
|
|
1332
|
+
ngOnInit() {
|
|
1333
|
+
// this.displayValue = this.options.filter((m) => m.optionValue == this.value)
|
|
1334
|
+
// this.displayValue = this.value
|
|
1335
|
+
if (this.placeholder == "") {
|
|
1336
|
+
this.placeholder = "Select " + this.display;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
ngOnChanges() {
|
|
1340
|
+
if (this.readonlyMode != "" && this.options.length > 0) {
|
|
1341
|
+
this.displayValue = this.options.filter((m) => m[`${this.optionValue}`] == this.value)[0][`${this.optionDisplay}`];
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
changed() {
|
|
1345
|
+
// let v;
|
|
1346
|
+
// v = Core.isNumber(this.value) ? Number(this.value) : this.value;
|
|
1347
|
+
this.valueChange.emit(this.value);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1351
|
+
SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SelectComponent, selector: "spa-select", inputs: { width: "width", readonly: "readonly", readonlyMode: "readonlyMode", hint: "hint", placeholder: "placeholder", multiple: "multiple", display: "display", value: "value", options: "options", optionValue: "optionValue", optionDisplay: "optionDisplay", optionDisplayExtra: "optionDisplayExtra" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "\r\n<mat-form-field *ngIf=\"readonlyMode==''\" floatLabel=\"always\" [ngStyle]=\"{'width':width}\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [multiple]=\"multiple\" [disabled]=\"readonly\" [placeholder]=\"placeholder\" >\r\n <mat-option *ngFor=\"let row of options\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}} <label *ngIf=\"optionDisplayExtra!='' && row[optionDisplayExtra] && row[optionDisplayExtra] != ''\">({{row[optionDisplayExtra]}})</label>\r\n </mat-option>\r\n </mat-select>\r\n <mat-hint *ngIf=\"hint!=''\">{{hint}}</mat-hint>\r\n</mat-form-field>\r\n\r\n<!-- ReadOnlyModes original, text, label -->\r\n<!-- <spa-text *ngIf=\"readonlyMode=='text' && readonly\" [display]=\"display\" [(value)]=\"displayValue\" [readonly]=\"true\" ></spa-text> -->\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i3$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
|
|
1352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SelectComponent, decorators: [{
|
|
1353
|
+
type: Component,
|
|
1354
|
+
args: [{ selector: 'spa-select', template: "\r\n<mat-form-field *ngIf=\"readonlyMode==''\" floatLabel=\"always\" [ngStyle]=\"{'width':width}\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [multiple]=\"multiple\" [disabled]=\"readonly\" [placeholder]=\"placeholder\" >\r\n <mat-option *ngFor=\"let row of options\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}} <label *ngIf=\"optionDisplayExtra!='' && row[optionDisplayExtra] && row[optionDisplayExtra] != ''\">({{row[optionDisplayExtra]}})</label>\r\n </mat-option>\r\n </mat-select>\r\n <mat-hint *ngIf=\"hint!=''\">{{hint}}</mat-hint>\r\n</mat-form-field>\r\n\r\n<!-- ReadOnlyModes original, text, label -->\r\n<!-- <spa-text *ngIf=\"readonlyMode=='text' && readonly\" [display]=\"display\" [(value)]=\"displayValue\" [readonly]=\"true\" ></spa-text> -->\r\n" }]
|
|
1355
|
+
}], ctorParameters: function () { return []; }, propDecorators: { width: [{
|
|
1356
|
+
type: Input
|
|
1357
|
+
}], readonly: [{
|
|
1358
|
+
type: Input
|
|
1359
|
+
}], readonlyMode: [{
|
|
1360
|
+
type: Input
|
|
1361
|
+
}], hint: [{
|
|
1362
|
+
type: Input
|
|
1363
|
+
}], placeholder: [{
|
|
1364
|
+
type: Input
|
|
1365
|
+
}], multiple: [{
|
|
1366
|
+
type: Input
|
|
1367
|
+
}], display: [{
|
|
1368
|
+
type: Input
|
|
1369
|
+
}], value: [{
|
|
1370
|
+
type: Input
|
|
1371
|
+
}], options: [{
|
|
1372
|
+
type: Input
|
|
1373
|
+
}], optionValue: [{
|
|
1374
|
+
type: Input
|
|
1375
|
+
}], optionDisplay: [{
|
|
1376
|
+
type: Input
|
|
1377
|
+
}], optionDisplayExtra: [{
|
|
1378
|
+
type: Input
|
|
1379
|
+
}], valueChange: [{
|
|
1380
|
+
type: Output
|
|
1381
|
+
}] } });
|
|
1382
|
+
|
|
1383
|
+
class ActivityComponent {
|
|
1384
|
+
constructor() {
|
|
1385
|
+
this.notes = new Array();
|
|
1386
|
+
this.notesMessage = "Empty";
|
|
1387
|
+
this.title = "Notes";
|
|
1388
|
+
}
|
|
1389
|
+
ngOnInit() {
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
ActivityComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ActivityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1393
|
+
ActivityComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ActivityComponent, selector: "spa-activity", inputs: { notes: "notes", title: "title" }, ngImport: i0, template: "\r\n <div class=\"tin-input-row mt-3\" *ngIf=\"title != ''\">\r\n <mat-label style=\"font-size: 20px; font-weight: 300\" > {{title}}</mat-label >\r\n </div>\r\n\r\n <ul *ngIf=\"notes && notes.length>0\" class=\"list-group list-group-flush\" style=\"max-height:350px; margin-left:5px\">\r\n\r\n <li *ngFor=\"let note of notes\" class=\"list-group-item list-group-item-action flex-column align-items-start\">\r\n <div class=\"d-flex w-100 justify-content-between\">\r\n <div class=\"mb-0\">{{note.createdByName}}</div>\r\n <!-- <small class=\"text-muted\">{{note.expr1}} ago</small> -->\r\n </div>\r\n\r\n <small>{{note.details}} (<em>{{note.createdDate | date: 'dd MMM yyyy HH:mm'}}</em>) </small>\r\n </li>\r\n\r\n\r\n </ul>\r\n\r\n <div *ngIf=\"notes && notes.length==0\" class=\"d-flex justify-content-center row align-items-center\" style=\"max-height:200px\">\r\n\r\n No {{title.toLowerCase()}}\r\n\r\n </div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
1394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ActivityComponent, decorators: [{
|
|
1395
|
+
type: Component,
|
|
1396
|
+
args: [{ selector: 'spa-activity', template: "\r\n <div class=\"tin-input-row mt-3\" *ngIf=\"title != ''\">\r\n <mat-label style=\"font-size: 20px; font-weight: 300\" > {{title}}</mat-label >\r\n </div>\r\n\r\n <ul *ngIf=\"notes && notes.length>0\" class=\"list-group list-group-flush\" style=\"max-height:350px; margin-left:5px\">\r\n\r\n <li *ngFor=\"let note of notes\" class=\"list-group-item list-group-item-action flex-column align-items-start\">\r\n <div class=\"d-flex w-100 justify-content-between\">\r\n <div class=\"mb-0\">{{note.createdByName}}</div>\r\n <!-- <small class=\"text-muted\">{{note.expr1}} ago</small> -->\r\n </div>\r\n\r\n <small>{{note.details}} (<em>{{note.createdDate | date: 'dd MMM yyyy HH:mm'}}</em>) </small>\r\n </li>\r\n\r\n\r\n </ul>\r\n\r\n <div *ngIf=\"notes && notes.length==0\" class=\"d-flex justify-content-center row align-items-center\" style=\"max-height:200px\">\r\n\r\n No {{title.toLowerCase()}}\r\n\r\n </div>\r\n" }]
|
|
1397
|
+
}], ctorParameters: function () { return []; }, propDecorators: { notes: [{
|
|
1398
|
+
type: Input
|
|
1399
|
+
}], title: [{
|
|
1400
|
+
type: Input
|
|
1401
|
+
}] } });
|
|
1402
|
+
|
|
1403
|
+
class FilterComponent {
|
|
1404
|
+
constructor() {
|
|
1405
|
+
this.data = new MatTableDataSource();
|
|
1406
|
+
this.refreshClick = new EventEmitter();
|
|
1407
|
+
this._filterText = "";
|
|
1408
|
+
}
|
|
1409
|
+
ngOnInit() {
|
|
1410
|
+
}
|
|
1411
|
+
ngOnChanges() {
|
|
1412
|
+
// console.log("OnChange")
|
|
1413
|
+
this.applyFilter(this._filterText);
|
|
1414
|
+
}
|
|
1415
|
+
;
|
|
1416
|
+
keyUp(event) {
|
|
1417
|
+
let text = event.target['value'];
|
|
1418
|
+
this.applyFilter(text);
|
|
1419
|
+
}
|
|
1420
|
+
applyFilter(filterValue) {
|
|
1421
|
+
if (this.data) {
|
|
1422
|
+
this.data.filter = filterValue.trim().toLowerCase();
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
refreshClicked() {
|
|
1426
|
+
this.refreshClick.emit();
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1430
|
+
FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FilterComponent, selector: "spa-filter", inputs: { data: "data" }, outputs: { refreshClick: "refreshClick" }, usesOnChanges: true, ngImport: i0, template: "<mat-form-field >\r\n <mat-label>Filter</mat-label>\r\n <input id=\"txtFilter\" matInput [(ngModel)]=\"_filterText\" (keyup)=\"keyUp($event)\" placeholder=\"Enter Filter text\" autocomplete=\"off\">\r\n</mat-form-field>\r\n\r\n<button id=\"btnFilter\" mat-mini-fab color=\"primary\" matTooltip=\"Refresh Data\" matTooltipPosition=\"above\" (click)=\"refreshClicked()\" style=\"margin-right:1em;margin-top:5px\">\r\n <mat-icon class=\"refreshIcon\">cached</mat-icon>\r\n</button>\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
1431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilterComponent, decorators: [{
|
|
1432
|
+
type: Component,
|
|
1433
|
+
args: [{ selector: 'spa-filter', template: "<mat-form-field >\r\n <mat-label>Filter</mat-label>\r\n <input id=\"txtFilter\" matInput [(ngModel)]=\"_filterText\" (keyup)=\"keyUp($event)\" placeholder=\"Enter Filter text\" autocomplete=\"off\">\r\n</mat-form-field>\r\n\r\n<button id=\"btnFilter\" mat-mini-fab color=\"primary\" matTooltip=\"Refresh Data\" matTooltipPosition=\"above\" (click)=\"refreshClicked()\" style=\"margin-right:1em;margin-top:5px\">\r\n <mat-icon class=\"refreshIcon\">cached</mat-icon>\r\n</button>\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
|
|
1434
|
+
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
1435
|
+
type: Input
|
|
1436
|
+
}], refreshClick: [{
|
|
1437
|
+
type: Output
|
|
1438
|
+
}] } });
|
|
1439
|
+
|
|
1440
|
+
const CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR = {
|
|
1441
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1442
|
+
useExisting: forwardRef(() => CurrencyInputMaskDirective),
|
|
1443
|
+
multi: true
|
|
1444
|
+
};
|
|
1445
|
+
class CurrencyInputMaskDirective {
|
|
1446
|
+
constructor(elementRef, decimalPipe) {
|
|
1447
|
+
this.elementRef = elementRef;
|
|
1448
|
+
this.decimalPipe = decimalPipe;
|
|
1449
|
+
this.DECIMAL_MARK = '.';
|
|
1450
|
+
}
|
|
1451
|
+
ngOnInit() {
|
|
1452
|
+
this.el = this.elementRef.nativeElement;
|
|
1453
|
+
}
|
|
1454
|
+
handleFocus(event) {
|
|
1455
|
+
const strVal = this.getInputValue();
|
|
1456
|
+
const unmaskedStr = this.getUnmaskedValue(strVal);
|
|
1457
|
+
this.updateInputValue(unmaskedStr);
|
|
1458
|
+
}
|
|
1459
|
+
handleCut(event) {
|
|
1460
|
+
setTimeout(() => {
|
|
1461
|
+
this.inputUpdated();
|
|
1462
|
+
}, 0);
|
|
1463
|
+
}
|
|
1464
|
+
handleKeypress(event) {
|
|
1465
|
+
// Restrict characters
|
|
1466
|
+
const newChar = String.fromCharCode(event.which);
|
|
1467
|
+
const allowedChars = /^[\d.]+$/;
|
|
1468
|
+
if (!allowedChars.test(newChar)) {
|
|
1469
|
+
event.preventDefault();
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
// Handle decimal mark input
|
|
1473
|
+
const currentValue = event.target.value;
|
|
1474
|
+
const separatorIdx = currentValue.indexOf(this.DECIMAL_MARK);
|
|
1475
|
+
const hasFractionalPart = (separatorIdx >= 0);
|
|
1476
|
+
if (!hasFractionalPart || newChar !== this.DECIMAL_MARK) {
|
|
1477
|
+
return;
|
|
1478
|
+
}
|
|
1479
|
+
const isOutsideSelection = !this.isIdxBetweenSelection(separatorIdx);
|
|
1480
|
+
if (isOutsideSelection) {
|
|
1481
|
+
const positionAfterMark = separatorIdx + 1;
|
|
1482
|
+
this.setCursorPosition(positionAfterMark);
|
|
1483
|
+
event.preventDefault();
|
|
1484
|
+
return;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
handleInput(event) {
|
|
1488
|
+
this.inputUpdated();
|
|
1489
|
+
}
|
|
1490
|
+
handlePaste(event) {
|
|
1491
|
+
setTimeout(() => {
|
|
1492
|
+
this.inputUpdated();
|
|
1493
|
+
}, 1);
|
|
1494
|
+
}
|
|
1495
|
+
handleBlur(event) {
|
|
1496
|
+
const strVal = this.getInputValue();
|
|
1497
|
+
const numVal = this.convertStrToDecimal(strVal);
|
|
1498
|
+
this.maskInput(numVal);
|
|
1499
|
+
this.onModelTouched.apply(event);
|
|
1500
|
+
}
|
|
1501
|
+
registerOnChange(callbackFunction) {
|
|
1502
|
+
this.onModelChange = callbackFunction;
|
|
1503
|
+
}
|
|
1504
|
+
registerOnTouched(callbackFunction) {
|
|
1505
|
+
this.onModelTouched = callbackFunction;
|
|
1506
|
+
}
|
|
1507
|
+
setDisabledState(value) {
|
|
1508
|
+
this.el.disabled = value;
|
|
1509
|
+
}
|
|
1510
|
+
writeValue(numValue) {
|
|
1511
|
+
this.maskInput(numValue);
|
|
1512
|
+
}
|
|
1513
|
+
maskInput(numVal) {
|
|
1514
|
+
if (!this.isNumeric(numVal)) {
|
|
1515
|
+
this.updateInputValue('');
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1518
|
+
const strVal = this.convertDecimalToStr(numVal);
|
|
1519
|
+
const newVal = this.transformWithPipe(strVal);
|
|
1520
|
+
this.updateInputValue(newVal);
|
|
1521
|
+
}
|
|
1522
|
+
inputUpdated() {
|
|
1523
|
+
this.restrictDecimalValue();
|
|
1524
|
+
const strVal = this.getInputValue();
|
|
1525
|
+
const unmaskedVal = this.getUnmaskedValue(strVal);
|
|
1526
|
+
const numVal = this.convertStrToDecimal(unmaskedVal);
|
|
1527
|
+
if (numVal !== this.lastNumVal) {
|
|
1528
|
+
this.lastNumVal = numVal;
|
|
1529
|
+
this.onModelChange(numVal);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
restrictDecimalValue() {
|
|
1533
|
+
const strVal = this.getInputValue();
|
|
1534
|
+
const dotIdx = strVal.indexOf(this.DECIMAL_MARK);
|
|
1535
|
+
const hasFractionalPart = (dotIdx >= 0);
|
|
1536
|
+
if (hasFractionalPart) {
|
|
1537
|
+
const fractionalPart = strVal.substring(dotIdx + 1);
|
|
1538
|
+
if (fractionalPart.length > 2) {
|
|
1539
|
+
const choppedVal = strVal.substring(0, dotIdx + 3);
|
|
1540
|
+
this.updateInputValue(choppedVal, true);
|
|
1541
|
+
return;
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
transformWithPipe(str) {
|
|
1546
|
+
return this.decimalPipe.transform(str, '1.2-2');
|
|
1547
|
+
}
|
|
1548
|
+
getUnmaskedValue(value) {
|
|
1549
|
+
return value.replace(/[^-\d\\.]/g, '');
|
|
1550
|
+
}
|
|
1551
|
+
updateInputValue(value, savePosition = false) {
|
|
1552
|
+
if (savePosition) {
|
|
1553
|
+
this.saveCursorPosition();
|
|
1554
|
+
}
|
|
1555
|
+
this.el.value = value;
|
|
1556
|
+
}
|
|
1557
|
+
getInputValue() {
|
|
1558
|
+
return this.el.value;
|
|
1559
|
+
}
|
|
1560
|
+
convertStrToDecimal(str) {
|
|
1561
|
+
return (this.isNumeric(str)) ? parseFloat(str) : null;
|
|
1562
|
+
}
|
|
1563
|
+
convertDecimalToStr(n) {
|
|
1564
|
+
return (this.isNumeric(n)) ? n + '' : '';
|
|
1565
|
+
}
|
|
1566
|
+
isNumeric(n) {
|
|
1567
|
+
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
1568
|
+
}
|
|
1569
|
+
saveCursorPosition() {
|
|
1570
|
+
const position = this.el.selectionStart;
|
|
1571
|
+
setTimeout(() => {
|
|
1572
|
+
this.setCursorPosition(position);
|
|
1573
|
+
}, 1);
|
|
1574
|
+
}
|
|
1575
|
+
setCursorPosition(position) {
|
|
1576
|
+
this.el.selectionStart = position;
|
|
1577
|
+
this.el.selectionEnd = position;
|
|
1578
|
+
}
|
|
1579
|
+
isIdxBetweenSelection(idx) {
|
|
1580
|
+
if (this.el.selectionStart === this.el.selectionEnd) {
|
|
1581
|
+
return false;
|
|
1582
|
+
}
|
|
1583
|
+
return (idx >= this.el.selectionStart && idx < this.el.selectionEnd);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
CurrencyInputMaskDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputMaskDirective, deps: [{ token: i0.ElementRef }, { token: i1.DecimalPipe }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1587
|
+
CurrencyInputMaskDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: CurrencyInputMaskDirective, selector: "[appCurrencyInputMask]", host: { listeners: { "focus": "handleFocus($event)", "cut": "handleCut($event)", "keypress": "handleKeypress($event)", "input": "handleInput($event)", "paste": "handlePaste($event)", "blur": "handleBlur($event)" } }, providers: [
|
|
1588
|
+
CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR,
|
|
1589
|
+
DecimalPipe
|
|
1590
|
+
], ngImport: i0 });
|
|
1591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputMaskDirective, decorators: [{
|
|
1592
|
+
type: Directive,
|
|
1593
|
+
args: [{
|
|
1594
|
+
selector: '[appCurrencyInputMask]',
|
|
1595
|
+
providers: [
|
|
1596
|
+
CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR,
|
|
1597
|
+
DecimalPipe
|
|
1598
|
+
]
|
|
1599
|
+
}]
|
|
1600
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DecimalPipe }]; }, propDecorators: { handleFocus: [{
|
|
1601
|
+
type: HostListener,
|
|
1602
|
+
args: ['focus', ['$event']]
|
|
1603
|
+
}], handleCut: [{
|
|
1604
|
+
type: HostListener,
|
|
1605
|
+
args: ['cut', ['$event']]
|
|
1606
|
+
}], handleKeypress: [{
|
|
1607
|
+
type: HostListener,
|
|
1608
|
+
args: ['keypress', ['$event']]
|
|
1609
|
+
}], handleInput: [{
|
|
1610
|
+
type: HostListener,
|
|
1611
|
+
args: ['input', ['$event']]
|
|
1612
|
+
}], handlePaste: [{
|
|
1613
|
+
type: HostListener,
|
|
1614
|
+
args: ['paste', ['$event']]
|
|
1615
|
+
}], handleBlur: [{
|
|
1616
|
+
type: HostListener,
|
|
1617
|
+
args: ['blur', ['$event']]
|
|
1618
|
+
}] } });
|
|
1619
|
+
|
|
1620
|
+
class MoneyComponent {
|
|
1621
|
+
constructor() {
|
|
1622
|
+
this.readonly = false;
|
|
1623
|
+
this.display = "";
|
|
1624
|
+
this.value = "";
|
|
1625
|
+
this.placeholder = "";
|
|
1626
|
+
this.valueChange = new EventEmitter();
|
|
1627
|
+
this.enterPress = new EventEmitter();
|
|
1628
|
+
this.leave = new EventEmitter();
|
|
1629
|
+
this.width = "100%";
|
|
1630
|
+
this.hint = "";
|
|
1631
|
+
this.currency = "";
|
|
1632
|
+
}
|
|
1633
|
+
ngOnInit() {
|
|
1634
|
+
if (this.placeholder == "") {
|
|
1635
|
+
this.placeholder = "Enter " + this.display;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
ngOnChanges() {
|
|
1639
|
+
}
|
|
1640
|
+
changed(x) {
|
|
1641
|
+
this.valueChange.emit(x);
|
|
1642
|
+
}
|
|
1643
|
+
enterPressed() {
|
|
1644
|
+
this.enterPress.emit();
|
|
1645
|
+
}
|
|
1646
|
+
leaved() {
|
|
1647
|
+
this.leave.emit();
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
MoneyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MoneyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1651
|
+
MoneyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MoneyComponent, selector: "spa-money", inputs: { readonly: "readonly", display: "display", value: "value", placeholder: "placeholder", width: "width", hint: "hint", currency: "currency" }, outputs: { valueChange: "valueChange", enterPress: "enterPress", leave: "leave" }, usesOnChanges: true, ngImport: i0, template: "\r\n\r\n<mat-form-field [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" hideRequiredMarker=\"true\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input matInput appCurrencyInputMask autocomplete=\"off\" style=\"text-align: right;\"\r\n\r\n [ngModel]=\"value\" (ngModelChange)=\"changed($event)\" (keyup.enter)=\"enterPressed()\" (blur)=\"leaved()\" [placeholder]=\"placeholder\" [readonly]=\"readonly\" />\r\n <span *ngIf=\"currency!=''\" matPrefix>{{currency}} </span>\r\n</mat-form-field>\r\n\r\n", styles: ["input.example-right-align{-moz-appearance:textfield}.example-right-align{text-align:right}input.example-right-align::-webkit-outer-spin-button,input.example-right-align::-webkit-inner-spin-button{display:none}.curr{background-color:red}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: CurrencyInputMaskDirective, selector: "[appCurrencyInputMask]" }] });
|
|
1652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MoneyComponent, decorators: [{
|
|
1653
|
+
type: Component,
|
|
1654
|
+
args: [{ selector: 'spa-money', template: "\r\n\r\n<mat-form-field [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" hideRequiredMarker=\"true\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input matInput appCurrencyInputMask autocomplete=\"off\" style=\"text-align: right;\"\r\n\r\n [ngModel]=\"value\" (ngModelChange)=\"changed($event)\" (keyup.enter)=\"enterPressed()\" (blur)=\"leaved()\" [placeholder]=\"placeholder\" [readonly]=\"readonly\" />\r\n <span *ngIf=\"currency!=''\" matPrefix>{{currency}} </span>\r\n</mat-form-field>\r\n\r\n", styles: ["input.example-right-align{-moz-appearance:textfield}.example-right-align{text-align:right}input.example-right-align::-webkit-outer-spin-button,input.example-right-align::-webkit-inner-spin-button{display:none}.curr{background-color:red}\n"] }]
|
|
1655
|
+
}], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
|
|
1656
|
+
type: Input
|
|
1657
|
+
}], display: [{
|
|
1658
|
+
type: Input
|
|
1659
|
+
}], value: [{
|
|
1660
|
+
type: Input
|
|
1661
|
+
}], placeholder: [{
|
|
1662
|
+
type: Input
|
|
1663
|
+
}], valueChange: [{
|
|
1664
|
+
type: Output
|
|
1665
|
+
}], enterPress: [{
|
|
1666
|
+
type: Output
|
|
1667
|
+
}], leave: [{
|
|
1668
|
+
type: Output
|
|
1669
|
+
}], width: [{
|
|
1670
|
+
type: Input
|
|
1671
|
+
}], hint: [{
|
|
1672
|
+
type: Input
|
|
1673
|
+
}], currency: [{
|
|
1674
|
+
type: Input
|
|
1675
|
+
}] } });
|
|
1676
|
+
|
|
1677
|
+
class OptionComponent {
|
|
1678
|
+
constructor() {
|
|
1679
|
+
this.optionValue = "";
|
|
1680
|
+
this.optionDisplay = "";
|
|
1681
|
+
this.readonly = false;
|
|
1682
|
+
this.value = "";
|
|
1683
|
+
this.display = "";
|
|
1684
|
+
this.show = false;
|
|
1685
|
+
this.valueChange = new EventEmitter();
|
|
1686
|
+
this.enterPress = new EventEmitter();
|
|
1687
|
+
}
|
|
1688
|
+
ngOnInit() {
|
|
1689
|
+
this.OGValue = this.value;
|
|
1690
|
+
}
|
|
1691
|
+
changed() {
|
|
1692
|
+
this.valueChange.emit(this.value);
|
|
1693
|
+
}
|
|
1694
|
+
enterPressed() {
|
|
1695
|
+
this.valueChange.emit();
|
|
1696
|
+
}
|
|
1697
|
+
resetValue() {
|
|
1698
|
+
this.value = this.OGValue;
|
|
1699
|
+
this.changed();
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1703
|
+
OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: OptionComponent, selector: "spa-option", inputs: { options: "options", optionValue: "optionValue", optionDisplay: "optionDisplay", readonly: "readonly", value: "value", display: "display", show: "show" }, outputs: { valueChange: "valueChange", enterPress: "enterPress" }, ngImport: i0, template: "\r\n<mat-checkbox color=\"primary\" style=\"margin-right:5px\" [(ngModel)]=\"show\" (change)=\"resetValue()\" labelPosition=\"after\">{{display}}</mat-checkbox>\r\n\r\n\r\n<mat-form-field style=\"margin-right:10px;width: 0px;\" >\r\n<input matInput />\r\n</mat-form-field>\r\n\r\n\r\n<mat-form-field style=\"margin-right:30px\" *ngIf=\"show && !options\">\r\n<mat-label>{{display}}</mat-label>\r\n<input matInput [(ngModel)]=\"value\" width=\"100\" (change)=\"changed()\" (keyup.enter)=\"changed()\" [placeholder]=\"'Enter ' + display\" autocomplete=\"off\" />\r\n</mat-form-field>\r\n\r\n\r\n<mat-form-field style=\"margin-right: 20px;\" floatLabel=\"always\" width=\"100\" *ngIf=\"show && options\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [placeholder]=\"'Select ' + display\" [disabled]=\"readonly\" >\r\n <mat-option *ngFor=\"let row of options\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}}\r\n </mat-option>\r\n </mat-select>\r\n</mat-form-field>\r\n\r\n<!-- <spa-text *ngIf=\"show\" style=\"margin-right:30px\" [display]=\"'Enter ' + display\" (enterPress)=\"enterPressed()\" (valueChange)=\"changed($event.target.value)\" width=\"100\" [required]=\"false\" [(value)]=\"value\" ></spa-text> -->\r\n\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
|
|
1704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: OptionComponent, decorators: [{
|
|
1705
|
+
type: Component,
|
|
1706
|
+
args: [{ selector: 'spa-option', template: "\r\n<mat-checkbox color=\"primary\" style=\"margin-right:5px\" [(ngModel)]=\"show\" (change)=\"resetValue()\" labelPosition=\"after\">{{display}}</mat-checkbox>\r\n\r\n\r\n<mat-form-field style=\"margin-right:10px;width: 0px;\" >\r\n<input matInput />\r\n</mat-form-field>\r\n\r\n\r\n<mat-form-field style=\"margin-right:30px\" *ngIf=\"show && !options\">\r\n<mat-label>{{display}}</mat-label>\r\n<input matInput [(ngModel)]=\"value\" width=\"100\" (change)=\"changed()\" (keyup.enter)=\"changed()\" [placeholder]=\"'Enter ' + display\" autocomplete=\"off\" />\r\n</mat-form-field>\r\n\r\n\r\n<mat-form-field style=\"margin-right: 20px;\" floatLabel=\"always\" width=\"100\" *ngIf=\"show && options\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [placeholder]=\"'Select ' + display\" [disabled]=\"readonly\" >\r\n <mat-option *ngFor=\"let row of options\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}}\r\n </mat-option>\r\n </mat-select>\r\n</mat-form-field>\r\n\r\n<!-- <spa-text *ngIf=\"show\" style=\"margin-right:30px\" [display]=\"'Enter ' + display\" (enterPress)=\"enterPressed()\" (valueChange)=\"changed($event.target.value)\" width=\"100\" [required]=\"false\" [(value)]=\"value\" ></spa-text> -->\r\n\r\n" }]
|
|
1707
|
+
}], ctorParameters: function () { return []; }, propDecorators: { options: [{
|
|
1708
|
+
type: Input
|
|
1709
|
+
}], optionValue: [{
|
|
1710
|
+
type: Input
|
|
1711
|
+
}], optionDisplay: [{
|
|
1712
|
+
type: Input
|
|
1713
|
+
}], readonly: [{
|
|
1714
|
+
type: Input
|
|
1715
|
+
}], value: [{
|
|
1716
|
+
type: Input
|
|
1717
|
+
}], display: [{
|
|
1718
|
+
type: Input
|
|
1719
|
+
}], show: [{
|
|
1720
|
+
type: Input
|
|
1721
|
+
}], valueChange: [{
|
|
1722
|
+
type: Output
|
|
1723
|
+
}], enterPress: [{
|
|
1724
|
+
type: Output
|
|
1725
|
+
}] } });
|
|
1726
|
+
|
|
1727
|
+
class TilesComponent {
|
|
1728
|
+
constructor() {
|
|
1729
|
+
this.clickable = false;
|
|
1730
|
+
this.tileClick = new EventEmitter();
|
|
1731
|
+
this.selected = "";
|
|
1732
|
+
}
|
|
1733
|
+
ngOnInit() {
|
|
1734
|
+
}
|
|
1735
|
+
clicked(v) {
|
|
1736
|
+
if (!this.clickable)
|
|
1737
|
+
return;
|
|
1738
|
+
if (this.selected == v.tileName) {
|
|
1739
|
+
this.tileClick.emit("");
|
|
1740
|
+
this.selected = "";
|
|
1741
|
+
}
|
|
1742
|
+
else {
|
|
1743
|
+
this.tileClick.emit(v.tileName);
|
|
1744
|
+
this.selected = v.tileName;
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
TilesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1749
|
+
TilesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TilesComponent, selector: "spa-tiles", inputs: { tiles: "tiles", clickable: "clickable" }, outputs: { tileClick: "tileClick" }, ngImport: i0, template: " <div class=\"row align-items-center\">\r\n\r\n <!-- <div class=\"col\" *ngFor=\"let row of tiles\" >\r\n\r\n <mat-card *ngIf=\"row.visible\">\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label style=\"font-size:30px;font-weight:bold\" [ngStyle]=\"{'color':row.tileColor}\">{{row.tileValue}}</mat-label>\r\n\r\n </div>\r\n\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label [ngStyle]=\"{'color':row.selected == true ? 'darkorange' : 'black' }\" style=\"font-size:12px;padding-left:5px;padding-right:5px\">{{row.tileName}}</mat-label>\r\n <mat-icon style=\"font-size: 17px; color:steelblue;\">info</mat-icon>\r\n\r\n </div>\r\n </mat-card>\r\n\r\n </div> -->\r\n\r\n <ng-container *ngFor=\"let row of tiles\">\r\n\r\n <mat-card class=\"col\" style=\"margin-left: 10px;margin-right: 10px\" *ngIf=\"row.visible\" (click)=\"clicked(row)\">\r\n\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label style=\"font-weight:bold\" [ngStyle]=\"{'color':row.tileColor,'font-size':row.tileName == selected ? '35px' : '30px' }\">{{row.tileValue}}</mat-label>\r\n\r\n </div>\r\n\r\n <div class=\"row d-flex justify-content-center row align-items-center\">\r\n\r\n <mat-label [ngStyle]=\"{'font-size':row.tileName == selected ? '18px' : '12px' }\" style=\"padding-left:5px;padding-right:5px\">{{row.tileName}}</mat-label>\r\n <mat-icon [matTooltip]=\"row.info\" matTooltipPosition=\"above\" [ngStyle]=\"{'font-size':row.tileName == selected ? '20px' : '17px' }\" style=\" color:steelblue;\">info</mat-icon>\r\n\r\n </div>\r\n\r\n </mat-card>\r\n\r\n\r\n </ng-container>\r\n\r\n </div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i14.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
1750
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TilesComponent, decorators: [{
|
|
1751
|
+
type: Component,
|
|
1752
|
+
args: [{ selector: 'spa-tiles', template: " <div class=\"row align-items-center\">\r\n\r\n <!-- <div class=\"col\" *ngFor=\"let row of tiles\" >\r\n\r\n <mat-card *ngIf=\"row.visible\">\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label style=\"font-size:30px;font-weight:bold\" [ngStyle]=\"{'color':row.tileColor}\">{{row.tileValue}}</mat-label>\r\n\r\n </div>\r\n\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label [ngStyle]=\"{'color':row.selected == true ? 'darkorange' : 'black' }\" style=\"font-size:12px;padding-left:5px;padding-right:5px\">{{row.tileName}}</mat-label>\r\n <mat-icon style=\"font-size: 17px; color:steelblue;\">info</mat-icon>\r\n\r\n </div>\r\n </mat-card>\r\n\r\n </div> -->\r\n\r\n <ng-container *ngFor=\"let row of tiles\">\r\n\r\n <mat-card class=\"col\" style=\"margin-left: 10px;margin-right: 10px\" *ngIf=\"row.visible\" (click)=\"clicked(row)\">\r\n\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label style=\"font-weight:bold\" [ngStyle]=\"{'color':row.tileColor,'font-size':row.tileName == selected ? '35px' : '30px' }\">{{row.tileValue}}</mat-label>\r\n\r\n </div>\r\n\r\n <div class=\"row d-flex justify-content-center row align-items-center\">\r\n\r\n <mat-label [ngStyle]=\"{'font-size':row.tileName == selected ? '18px' : '12px' }\" style=\"padding-left:5px;padding-right:5px\">{{row.tileName}}</mat-label>\r\n <mat-icon [matTooltip]=\"row.info\" matTooltipPosition=\"above\" [ngStyle]=\"{'font-size':row.tileName == selected ? '20px' : '17px' }\" style=\" color:steelblue;\">info</mat-icon>\r\n\r\n </div>\r\n\r\n </mat-card>\r\n\r\n\r\n </ng-container>\r\n\r\n </div>\r\n" }]
|
|
1753
|
+
}], ctorParameters: function () { return []; }, propDecorators: { tiles: [{
|
|
1754
|
+
type: Input
|
|
1755
|
+
}], clickable: [{
|
|
1756
|
+
type: Input
|
|
1757
|
+
}], tileClick: [{
|
|
1758
|
+
type: Output
|
|
1759
|
+
}] } });
|
|
1760
|
+
|
|
1761
|
+
class StepsComponent {
|
|
1762
|
+
constructor() {
|
|
1763
|
+
this.value = "";
|
|
1764
|
+
}
|
|
1765
|
+
ngOnInit() {
|
|
1766
|
+
}
|
|
1767
|
+
ngAfterViewInit() {
|
|
1768
|
+
}
|
|
1769
|
+
ngOnChanges() {
|
|
1770
|
+
this.pushSteps();
|
|
1771
|
+
}
|
|
1772
|
+
setStepper() {
|
|
1773
|
+
if (this.value == "")
|
|
1774
|
+
return;
|
|
1775
|
+
this.stepper.selectedIndex = 0;
|
|
1776
|
+
switch (this.value) {
|
|
1777
|
+
case "Draft":
|
|
1778
|
+
this.stepper.selectedIndex = 0;
|
|
1779
|
+
break;
|
|
1780
|
+
case "Head Approval":
|
|
1781
|
+
this.pushStepper(1);
|
|
1782
|
+
break;
|
|
1783
|
+
case "CE Approval":
|
|
1784
|
+
this.pushStepper(2);
|
|
1785
|
+
break;
|
|
1786
|
+
case "Booking":
|
|
1787
|
+
this.pushStepper(3);
|
|
1788
|
+
break;
|
|
1789
|
+
case "BTA Approval":
|
|
1790
|
+
this.pushStepper(4);
|
|
1791
|
+
break;
|
|
1792
|
+
case "Travel":
|
|
1793
|
+
this.pushStepper(5);
|
|
1794
|
+
break;
|
|
1795
|
+
case "BTR Approval":
|
|
1796
|
+
this.pushStepper(6);
|
|
1797
|
+
break;
|
|
1798
|
+
case "Travel Closure":
|
|
1799
|
+
this.pushStepper(7);
|
|
1800
|
+
break;
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
pushStepper(count) {
|
|
1804
|
+
for (let index = 0; index < count + 1; index++) {
|
|
1805
|
+
// const element = array[index];
|
|
1806
|
+
this.stepper.selectedIndex = index;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
pushSteps() {
|
|
1810
|
+
if (this.steps.length == 0)
|
|
1811
|
+
return;
|
|
1812
|
+
if (this.value == "")
|
|
1813
|
+
return;
|
|
1814
|
+
this.stepper.selectedIndex = 0;
|
|
1815
|
+
let i = 0;
|
|
1816
|
+
for (let step of this.steps) {
|
|
1817
|
+
if (step.name != this.value) {
|
|
1818
|
+
this.stepper.selectedIndex = i;
|
|
1819
|
+
i++;
|
|
1820
|
+
}
|
|
1821
|
+
else {
|
|
1822
|
+
this.stepper.selectedIndex = i;
|
|
1823
|
+
break;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
StepsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StepsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1829
|
+
StepsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: StepsComponent, selector: "spa-steps", inputs: { value: "value", steps: "steps" }, providers: [{
|
|
1830
|
+
provide: STEPPER_GLOBAL_OPTIONS, useValue: { displayDefaultIndicatorType: false }
|
|
1831
|
+
}], viewQueries: [{ propertyName: "stepper", first: true, predicate: ["stepper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\r\n\r\n\r\n<!-- <mat-horizontal-stepper class=\"test\" labelPosition=\"bottom\" #stepper>\r\n <mat-step [editable]=\"false\" label=\"Draft\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Head Approval\" > </mat-step>\r\n <mat-step [editable]=\"false\" label=\"CE Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Booking\" state=\"booking\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"BTA Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Travel\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"BTR Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Closure\"> </mat-step>\r\n <ng-template matStepperIcon=\"booking\"> <mat-icon>forum</mat-icon> </ng-template>\r\n</mat-horizontal-stepper> -->\r\n\r\n<mat-horizontal-stepper class=\"transparent\" labelPosition=\"bottom\" #stepper>\r\n\r\n <mat-step *ngFor=\"let row of steps\"\r\n [editable]=\"false\" [label]=\"row.name\">\r\n </mat-step>\r\n\r\n <!-- <ng-template *ngFor=\"let row of steps\"\r\n [matStepperIcon]=\"row.name\"> <mat-icon>{{row.icon}}</mat-icon>\r\n </ng-template> -->\r\n\r\n <!-- <ng-template matStepperIcon=\"booking\">\r\n <mat-icon>call_end</mat-icon>\r\n </ng-template> -->\r\n\r\n <!-- <ng-template ngFor let-xb [ngForOf]=\"steps\" matStepperIcon=\"Booking\"> <mat-icon>forum</mat-icon>\r\n\r\n </ng-template> -->\r\n\r\n</mat-horizontal-stepper>\r\n", styles: [".transparent{background-color:#0000}:host ::ng-deep .mat-step-header{padding:5px!important}:host ::ng-deep .mat-stepper-horizontal-line{min-width:5px!important}:host ::ng-deep .mat-horizontal-content-container{padding:0!important}:host ::ng-deep .mat-horizontal-stepper-header{pointer-events:none!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2$2.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "component", type: i2$2.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }] });
|
|
1832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StepsComponent, decorators: [{
|
|
1833
|
+
type: Component,
|
|
1834
|
+
args: [{ selector: 'spa-steps', providers: [{
|
|
1835
|
+
provide: STEPPER_GLOBAL_OPTIONS, useValue: { displayDefaultIndicatorType: false }
|
|
1836
|
+
}], template: "\r\n\r\n\r\n<!-- <mat-horizontal-stepper class=\"test\" labelPosition=\"bottom\" #stepper>\r\n <mat-step [editable]=\"false\" label=\"Draft\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Head Approval\" > </mat-step>\r\n <mat-step [editable]=\"false\" label=\"CE Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Booking\" state=\"booking\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"BTA Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Travel\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"BTR Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Closure\"> </mat-step>\r\n <ng-template matStepperIcon=\"booking\"> <mat-icon>forum</mat-icon> </ng-template>\r\n</mat-horizontal-stepper> -->\r\n\r\n<mat-horizontal-stepper class=\"transparent\" labelPosition=\"bottom\" #stepper>\r\n\r\n <mat-step *ngFor=\"let row of steps\"\r\n [editable]=\"false\" [label]=\"row.name\">\r\n </mat-step>\r\n\r\n <!-- <ng-template *ngFor=\"let row of steps\"\r\n [matStepperIcon]=\"row.name\"> <mat-icon>{{row.icon}}</mat-icon>\r\n </ng-template> -->\r\n\r\n <!-- <ng-template matStepperIcon=\"booking\">\r\n <mat-icon>call_end</mat-icon>\r\n </ng-template> -->\r\n\r\n <!-- <ng-template ngFor let-xb [ngForOf]=\"steps\" matStepperIcon=\"Booking\"> <mat-icon>forum</mat-icon>\r\n\r\n </ng-template> -->\r\n\r\n</mat-horizontal-stepper>\r\n", styles: [".transparent{background-color:#0000}:host ::ng-deep .mat-step-header{padding:5px!important}:host ::ng-deep .mat-stepper-horizontal-line{min-width:5px!important}:host ::ng-deep .mat-horizontal-content-container{padding:0!important}:host ::ng-deep .mat-horizontal-stepper-header{pointer-events:none!important}\n"] }]
|
|
1837
|
+
}], ctorParameters: function () { return []; }, propDecorators: { stepper: [{
|
|
1838
|
+
type: ViewChild,
|
|
1839
|
+
args: ['stepper']
|
|
1840
|
+
}], value: [{
|
|
1841
|
+
type: Input
|
|
1842
|
+
}], steps: [{
|
|
1843
|
+
type: Input
|
|
1844
|
+
}] } });
|
|
1845
|
+
|
|
1846
|
+
class AttachComponent {
|
|
1847
|
+
constructor() {
|
|
1848
|
+
this.message = "Drag and drop files here";
|
|
1849
|
+
this.files = [];
|
|
1850
|
+
this.filesChange = new EventEmitter();
|
|
1851
|
+
this.upload = new EventEmitter();
|
|
1852
|
+
this.enableUpload = false;
|
|
1853
|
+
}
|
|
1854
|
+
ngOnInit() {
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* on file drop handler
|
|
1858
|
+
*/
|
|
1859
|
+
onFileDropped($event) {
|
|
1860
|
+
this.prepareFilesList($event);
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* handle file from browsing
|
|
1864
|
+
*/
|
|
1865
|
+
fileBrowseHandler(event) {
|
|
1866
|
+
let files = event.target.files;
|
|
1867
|
+
this.prepareFilesList(files);
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* Delete file from files list
|
|
1871
|
+
* @param index (File index)
|
|
1872
|
+
*/
|
|
1873
|
+
deleteFile(index) {
|
|
1874
|
+
this.files.splice(index, 1);
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* Simulate the upload process
|
|
1878
|
+
*/
|
|
1879
|
+
// uploadFilesSimulator(index: number) {
|
|
1880
|
+
// setTimeout(() => {
|
|
1881
|
+
// if (index === this.files.length) {
|
|
1882
|
+
// return;
|
|
1883
|
+
// } else {
|
|
1884
|
+
// const progressInterval = setInterval(() => {
|
|
1885
|
+
// if (this.files[index].progress === 100) {
|
|
1886
|
+
// clearInterval(progressInterval);
|
|
1887
|
+
// this.uploadFilesSimulator(index + 1);
|
|
1888
|
+
// } else {
|
|
1889
|
+
// this.files[index].progress += 5;
|
|
1890
|
+
// }
|
|
1891
|
+
// }, 200);
|
|
1892
|
+
// }
|
|
1893
|
+
// }, 1000);
|
|
1894
|
+
// }
|
|
1895
|
+
/**
|
|
1896
|
+
* Convert Files list to normal array list
|
|
1897
|
+
* @param files (Files List)
|
|
1898
|
+
*/
|
|
1899
|
+
prepareFilesList(files) {
|
|
1900
|
+
for (const item of files) {
|
|
1901
|
+
item.progress = 0;
|
|
1902
|
+
this.files.push(item);
|
|
1903
|
+
}
|
|
1904
|
+
// this.uploadFilesSimulator(0);
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* format bytes
|
|
1908
|
+
* @param bytes (File size in bytes)
|
|
1909
|
+
* @param decimals (Decimals point)
|
|
1910
|
+
*/
|
|
1911
|
+
formatBytes(bytes, decimals) {
|
|
1912
|
+
if (bytes === 0) {
|
|
1913
|
+
return '0 Bytes';
|
|
1914
|
+
}
|
|
1915
|
+
const k = 1024;
|
|
1916
|
+
const dm = decimals <= 0 ? 0 : decimals || 2;
|
|
1917
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
1918
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
1919
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
1920
|
+
}
|
|
1921
|
+
uploaded() {
|
|
1922
|
+
this.upload.emit();
|
|
1923
|
+
}
|
|
1924
|
+
filesChanged() {
|
|
1925
|
+
this.filesChange.emit(this.files);
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
AttachComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AttachComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1929
|
+
AttachComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AttachComponent, selector: "spa-attach", inputs: { message: "message", files: "files", enableUpload: "enableUpload" }, outputs: { filesChange: "filesChange", upload: "upload" }, ngImport: i0, template: "<div class=\"tin-input-row\" style=\"width: 100%;\">\r\n\r\n <div class=\"col\">\r\n <div class=\"container\" appDnd (fileDropped)=\"onFileDropped($event)\">\r\n <input type=\"file\" #fileDropRef id=\"fileDropRef\" multiple (change)=\"fileBrowseHandler($event)\" />\r\n <h4>{{message}}</h4>\r\n <h4>or</h4>\r\n <label for=\"fileDropRef\">Click to Browse</label>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <div class=\"files-list \">\r\n <div class=\"single-file \" style=\"width: 100%;\" *ngFor=\"let file of files; let i = index\">\r\n\r\n <div class=\"tin-input-row info\" >\r\n <h4 class=\"name\">\r\n {{ file?.name }}\r\n </h4>\r\n <p class=\"size\">\r\n {{ formatBytes(file?.size, 2) }}\r\n </p>\r\n </div>\r\n\r\n <div class=\"delete\" (click)=\"deleteFile(i)\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"18\" viewBox=\"0 0 14 18\">\r\n <path fill=\"#B1B1B1\" fill-rule=\"nonzero\"\r\n d=\"M1 16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v10zm3.17-7.83a.996.996 0 0 1 1.41 0L7 9.59l1.42-1.42a.996.996 0 1 1 1.41 1.41L8.41 11l1.42 1.42a.996.996 0 1 1-1.41 1.41L7 12.41l-1.42 1.42a.996.996 0 1 1-1.41-1.41L5.59 11 4.17 9.58a.996.996 0 0 1 0-1.41zM10.5 1L9.79.29C9.61.11 9.35 0 9.09 0H4.91c-.26 0-.52.11-.7.29L3.5 1H1c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1h-2.5z\" />\r\n </svg>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"files.length > 0 && enableUpload\" class=\"tin-input-row d-flex justify-content-center\" style=\"width: 100%;\" >\r\n <button mat-button color=\"primary\" (click)=\"uploaded()\" matTooltip=\"Upload New Documents\" matTooltipPosition=\"above\" ><mat-icon>file_upload</mat-icon> Upload</button>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".container{width:100%;height:200px;padding:2rem;text-align:center;border:dashed 2px #2a7b94;position:relative;margin:0 auto}.container input{opacity:0;position:absolute;z-index:2;width:100%;height:100%;top:0;left:0}.container label{color:#fff;width:183px;height:44px;border-radius:21.5px;background-color:#db202f;padding:8px 16px}.container h3{font-size:20px;font-weight:600;color:#38424c}.fileover{animation:shake 1s;animation-iteration-count:infinite}.files-list{margin-top:1.5rem}.files-list .single-file{padding:.5rem;justify-content:space-between;align-items:center;border:dashed 1px #1c824d;margin-bottom:1rem;margin-right:1rem;display:flex;flex-grow:1}.files-list .single-file .delete{display:flex;margin-left:.5rem;cursor:pointer;align-self:flex-end}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0;margin-left:1rem}.files-list .single-file .info{width:100%}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
1930
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AttachComponent, decorators: [{
|
|
1931
|
+
type: Component,
|
|
1932
|
+
args: [{ selector: 'spa-attach', template: "<div class=\"tin-input-row\" style=\"width: 100%;\">\r\n\r\n <div class=\"col\">\r\n <div class=\"container\" appDnd (fileDropped)=\"onFileDropped($event)\">\r\n <input type=\"file\" #fileDropRef id=\"fileDropRef\" multiple (change)=\"fileBrowseHandler($event)\" />\r\n <h4>{{message}}</h4>\r\n <h4>or</h4>\r\n <label for=\"fileDropRef\">Click to Browse</label>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <div class=\"files-list \">\r\n <div class=\"single-file \" style=\"width: 100%;\" *ngFor=\"let file of files; let i = index\">\r\n\r\n <div class=\"tin-input-row info\" >\r\n <h4 class=\"name\">\r\n {{ file?.name }}\r\n </h4>\r\n <p class=\"size\">\r\n {{ formatBytes(file?.size, 2) }}\r\n </p>\r\n </div>\r\n\r\n <div class=\"delete\" (click)=\"deleteFile(i)\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"18\" viewBox=\"0 0 14 18\">\r\n <path fill=\"#B1B1B1\" fill-rule=\"nonzero\"\r\n d=\"M1 16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v10zm3.17-7.83a.996.996 0 0 1 1.41 0L7 9.59l1.42-1.42a.996.996 0 1 1 1.41 1.41L8.41 11l1.42 1.42a.996.996 0 1 1-1.41 1.41L7 12.41l-1.42 1.42a.996.996 0 1 1-1.41-1.41L5.59 11 4.17 9.58a.996.996 0 0 1 0-1.41zM10.5 1L9.79.29C9.61.11 9.35 0 9.09 0H4.91c-.26 0-.52.11-.7.29L3.5 1H1c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1h-2.5z\" />\r\n </svg>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"files.length > 0 && enableUpload\" class=\"tin-input-row d-flex justify-content-center\" style=\"width: 100%;\" >\r\n <button mat-button color=\"primary\" (click)=\"uploaded()\" matTooltip=\"Upload New Documents\" matTooltipPosition=\"above\" ><mat-icon>file_upload</mat-icon> Upload</button>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".container{width:100%;height:200px;padding:2rem;text-align:center;border:dashed 2px #2a7b94;position:relative;margin:0 auto}.container input{opacity:0;position:absolute;z-index:2;width:100%;height:100%;top:0;left:0}.container label{color:#fff;width:183px;height:44px;border-radius:21.5px;background-color:#db202f;padding:8px 16px}.container h3{font-size:20px;font-weight:600;color:#38424c}.fileover{animation:shake 1s;animation-iteration-count:infinite}.files-list{margin-top:1.5rem}.files-list .single-file{padding:.5rem;justify-content:space-between;align-items:center;border:dashed 1px #1c824d;margin-bottom:1rem;margin-right:1rem;display:flex;flex-grow:1}.files-list .single-file .delete{display:flex;margin-left:.5rem;cursor:pointer;align-self:flex-end}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0;margin-left:1rem}.files-list .single-file .info{width:100%}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}\n"] }]
|
|
1933
|
+
}], ctorParameters: function () { return []; }, propDecorators: { message: [{
|
|
1934
|
+
type: Input
|
|
1935
|
+
}], files: [{
|
|
1936
|
+
type: Input
|
|
1937
|
+
}], filesChange: [{
|
|
1938
|
+
type: Output
|
|
1939
|
+
}], upload: [{
|
|
1940
|
+
type: Output
|
|
1941
|
+
}], enableUpload: [{
|
|
1942
|
+
type: Input
|
|
1943
|
+
}] } });
|
|
1944
|
+
|
|
1945
|
+
class ChipsComponent {
|
|
1946
|
+
constructor(messageService) {
|
|
1947
|
+
this.messageService = messageService;
|
|
1948
|
+
this.icon = "";
|
|
1949
|
+
this.removable = false;
|
|
1950
|
+
this.addable = false;
|
|
1951
|
+
// @Output() chipClick = new EventEmitter();
|
|
1952
|
+
this.click = new EventEmitter();
|
|
1953
|
+
this.remove = new EventEmitter();
|
|
1954
|
+
}
|
|
1955
|
+
ngOnInit() {
|
|
1956
|
+
}
|
|
1957
|
+
clicked(chip) {
|
|
1958
|
+
if (typeof chip != 'string') {
|
|
1959
|
+
return;
|
|
1960
|
+
}
|
|
1961
|
+
if (chip) {
|
|
1962
|
+
this.click.emit(chip);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
removed(chip) {
|
|
1966
|
+
// const index = this.chips.indexOf(chip);
|
|
1967
|
+
// if (index >= 0) {
|
|
1968
|
+
// this.chips.splice(index, 1);
|
|
1969
|
+
// }
|
|
1970
|
+
this.messageService.confirm(`Remove ${chip} ?`).subscribe((result) => {
|
|
1971
|
+
if (result == "yes") {
|
|
1972
|
+
this.remove.emit(chip);
|
|
1973
|
+
}
|
|
1974
|
+
;
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
ChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChipsComponent, deps: [{ token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1979
|
+
ChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChipsComponent, selector: "spa-chips", inputs: { icon: "icon", removable: "removable", addable: "addable", chips: "chips" }, outputs: { click: "click", remove: "remove" }, ngImport: i0, template: "\r\n\r\n\r\n<div class=\"row mt-1\" style=\"margin-left: 1em;\">\r\n <mat-chip-list #chipList>\r\n <mat-chip *ngFor=\"let chip of chips let i = index\" selectable [removable]=\"removable\" style=\"font-size: 12px;\" [ngStyle]=\"{'padding-right': removable ? '5px':'12px'}\" (click)=\"clicked(chip)\">\r\n <mat-icon *ngIf=\"icon != ''\" color=\"primary\" style=\"font-size: 22px;\">{{icon}}</mat-icon>\r\n\r\n {{chip}}\r\n\r\n <mat-icon *ngIf=\"removable\" style=\"font-size: 20px; margin-left: 5px;margin-top: 3px;margin-right: 0px; color: grey;\" (click)=\"removed(chip)\">cancel</mat-icon>\r\n </mat-chip>\r\n </mat-chip-list>\r\n</div>\r\n\r\n\r\n\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$2.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i4$2.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }] });
|
|
1980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChipsComponent, decorators: [{
|
|
1981
|
+
type: Component,
|
|
1982
|
+
args: [{ selector: 'spa-chips', template: "\r\n\r\n\r\n<div class=\"row mt-1\" style=\"margin-left: 1em;\">\r\n <mat-chip-list #chipList>\r\n <mat-chip *ngFor=\"let chip of chips let i = index\" selectable [removable]=\"removable\" style=\"font-size: 12px;\" [ngStyle]=\"{'padding-right': removable ? '5px':'12px'}\" (click)=\"clicked(chip)\">\r\n <mat-icon *ngIf=\"icon != ''\" color=\"primary\" style=\"font-size: 22px;\">{{icon}}</mat-icon>\r\n\r\n {{chip}}\r\n\r\n <mat-icon *ngIf=\"removable\" style=\"font-size: 20px; margin-left: 5px;margin-top: 3px;margin-right: 0px; color: grey;\" (click)=\"removed(chip)\">cancel</mat-icon>\r\n </mat-chip>\r\n </mat-chip-list>\r\n</div>\r\n\r\n\r\n\r\n" }]
|
|
1983
|
+
}], ctorParameters: function () { return [{ type: MessageService }]; }, propDecorators: { icon: [{
|
|
1984
|
+
type: Input
|
|
1985
|
+
}], removable: [{
|
|
1986
|
+
type: Input
|
|
1987
|
+
}], addable: [{
|
|
1988
|
+
type: Input
|
|
1989
|
+
}], chips: [{
|
|
1990
|
+
type: Input
|
|
1991
|
+
}], click: [{
|
|
1992
|
+
type: Output
|
|
1993
|
+
}], remove: [{
|
|
1994
|
+
type: Output
|
|
1995
|
+
}] } });
|
|
1996
|
+
|
|
1997
|
+
class LoaderService {
|
|
1998
|
+
constructor() {
|
|
1999
|
+
this.isLoading = new BehaviorSubject(false);
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
LoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2003
|
+
LoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, providedIn: 'root' });
|
|
2004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, decorators: [{
|
|
2005
|
+
type: Injectable,
|
|
2006
|
+
args: [{
|
|
2007
|
+
providedIn: 'root'
|
|
2008
|
+
}]
|
|
2009
|
+
}], ctorParameters: function () { return []; } });
|
|
2010
|
+
|
|
2011
|
+
class LoaderComponent {
|
|
2012
|
+
constructor(loaderService) {
|
|
2013
|
+
this.loaderService = loaderService;
|
|
2014
|
+
this.logo = "";
|
|
2015
|
+
this.loaderService.isLoading.subscribe((v) => {
|
|
2016
|
+
this.loading = v;
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
ngOnInit() {
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
LoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderComponent, deps: [{ token: LoaderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2023
|
+
LoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LoaderComponent, selector: "spa-loader", inputs: { logo: "logo" }, ngImport: i0, template: "<div class=\"progress-loader\" style=\"z-index: 9999;\" [hidden]=\"!loading\">\r\n <div class=\"loading-spinner\">\r\n\r\n <img *ngIf=\"logo==''\" style=\"width: 100px;\"\r\n src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==\"\r\n\r\n >\r\n\r\n <img *ngIf=\"logo!=''\" [src]=\"logo\" style=\"width: 100px;\" />\r\n\r\n\r\n <span id=\"loadingMessage\" class=\"loading-message\">Please wait...</span>\r\n </div>\r\n</div>\r\n", styles: [".loading-spinner{background-color:#0000001f;position:absolute;width:100%;top:0;left:0;height:100vh;align-items:center;justify-content:center;display:grid}.loading-spinner img{align-self:end}.loading-message{text-align:center;align-self:start}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2024
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
2025
|
+
type: Component,
|
|
2026
|
+
args: [{ selector: 'spa-loader', template: "<div class=\"progress-loader\" style=\"z-index: 9999;\" [hidden]=\"!loading\">\r\n <div class=\"loading-spinner\">\r\n\r\n <img *ngIf=\"logo==''\" style=\"width: 100px;\"\r\n src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==\"\r\n\r\n >\r\n\r\n <img *ngIf=\"logo!=''\" [src]=\"logo\" style=\"width: 100px;\" />\r\n\r\n\r\n <span id=\"loadingMessage\" class=\"loading-message\">Please wait...</span>\r\n </div>\r\n</div>\r\n", styles: [".loading-spinner{background-color:#0000001f;position:absolute;width:100%;top:0;left:0;height:100vh;align-items:center;justify-content:center;display:grid}.loading-spinner img{align-self:end}.loading-message{text-align:center;align-self:start}\n"] }]
|
|
2027
|
+
}], ctorParameters: function () { return [{ type: LoaderService }]; }, propDecorators: { logo: [{
|
|
2028
|
+
type: Input
|
|
2029
|
+
}] } });
|
|
2030
|
+
|
|
2031
|
+
class NavMenuComponent {
|
|
2032
|
+
constructor(router, authService) {
|
|
2033
|
+
this.router = router;
|
|
2034
|
+
this.authService = authService;
|
|
2035
|
+
this.isExpanded = false;
|
|
2036
|
+
this.appConfig = new AppConfig();
|
|
2037
|
+
}
|
|
2038
|
+
ngOnInit() {
|
|
2039
|
+
this.authService.loggedUserFullName.subscribe(user => this.loggedUserFullName = user);
|
|
2040
|
+
this.authService.myRoleObserv.subscribe(rol => this.myRole = rol);
|
|
2041
|
+
this.authService.loggedinObserv.subscribe(obj => this.loggedin = obj);
|
|
2042
|
+
}
|
|
2043
|
+
collapse() {
|
|
2044
|
+
this.isExpanded = false;
|
|
2045
|
+
}
|
|
2046
|
+
toggle() {
|
|
2047
|
+
this.isExpanded = !this.isExpanded;
|
|
2048
|
+
}
|
|
2049
|
+
// logoff() {
|
|
2050
|
+
// // this.authService.updateloggedin(false);
|
|
2051
|
+
// // this.authService.updateRole(new Role());
|
|
2052
|
+
// this.router.navigate(["login"]);
|
|
2053
|
+
// // this.storageService.clear();
|
|
2054
|
+
// }
|
|
2055
|
+
redirectTo(link) {
|
|
2056
|
+
this.collapse();
|
|
2057
|
+
if (link != "") {
|
|
2058
|
+
this.router.navigate([link]);
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
NavMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NavMenuComponent, deps: [{ token: i1$3.Router }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2063
|
+
NavMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NavMenuComponent, selector: "spa-nav-menu", inputs: { appConfig: "appConfig" }, ngImport: i0, template: "<header *ngIf=\"loggedin\">\r\n\r\n <nav class=\"toolbar navbar navbar-expand-sm navbar-toggleable-sm navbar-light border-bottom box-shadow mb-3 \" style=\"padding-right: 10px;\">\r\n\r\n <div class=\"container-fluid\" style=\"padding-right: 0px;\">\r\n <!--<a class=\"navbar-brand\" [routerLink]=\"['/']\">Orbit</a>-->\r\n\r\n <img *ngIf=\"appConfig.logo!=''\" [src]=\"appConfig.logo\" style=\"height: 50px; margin-right: 2em\" />\r\n\r\n\r\n <div style=\"font-size: 20px;\">\r\n {{appConfig.appName}}\r\n </div>\r\n\r\n\r\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\".navbar-collapse\" aria-label=\"Toggle navigation\" [attr.aria-expanded]=\"isExpanded\" (click)=\"toggle()\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n\r\n <div *ngIf=\"myRole\" class=\"navitems navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse stack-top\" style=\"margin-right: 0px;\" [ngClass]=\"{ show: isExpanded }\" >\r\n\r\n <button mat-icon-button (click)=\"redirectTo('login')\" class=\"d-none d-sm-block\" style=\"margin-right:2em\"> <mat-icon>logout</mat-icon> </button>\r\n\r\n <button id=\"btnUser\" mat-button [matMenuTriggerFor]=\"profileMenu\" ><mat-icon>account_circle</mat-icon> {{loggedUserFullName}}</button>\r\n\r\n <mat-menu #profileMenu=\"matMenu\">\r\n <button id=\"btnProfile\" mat-menu-item (click)=\"redirectTo('home/user/profile')\" >Profile</button>\r\n <button id=\"btnLogOff\" mat-menu-item (click)=\"redirectTo('login')\">Log Off</button>\r\n </mat-menu>\r\n\r\n <div *ngFor=\"let item of appConfig.capItems\">\r\n\r\n <!-- Menu Item -->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && !item.capSubItems && item.showMenu\" mat-button (click)=\"redirectTo(item.link)\">{{item.display}}</button>\r\n\r\n <!-- Menu Item with Sub items ignored -->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && item.capSubItems && item.showMenu && item.ignoreSubsDisplay\" mat-button (click)=\"redirectTo(item.link)\">{{item.display}}</button>\r\n\r\n <!-- Menu Item with Sub items to display-->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && item.capSubItems && item.showMenu && !item.ignoreSubsDisplay\" mat-button [matMenuTriggerFor]=\"adminMenu\">{{item.display}}</button>\r\n\r\n\r\n <!-- Sub Menu Items -->\r\n <mat-menu #adminMenu=\"matMenu\">\r\n\r\n <div *ngFor=\"let subItem of item.capSubItems\">\r\n\r\n <button *ngIf=\"myRole[subItem.name] && subItem.showMenu\" mat-menu-item (click)=\"redirectTo(subItem.link)\">{{subItem.display}}</button>\r\n\r\n </div>\r\n\r\n </mat-menu>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n </nav>\r\n\r\n</header>\r\n", styles: ["a.navbar-brand{white-space:normal;text-align:center;word-break:break-all}html{font-size:14px}.box-shadow{box-shadow:0 .25rem .75rem #0000000d}.toolbar{height:60px;display:flex;align-items:center;background-color:#03a;color:#fff;font-weight:600}.stack-top{z-index:9;margin:20px}.navitems{background-color:#03a}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$3.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4$3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
2064
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NavMenuComponent, decorators: [{
|
|
2065
|
+
type: Component,
|
|
2066
|
+
args: [{ selector: 'spa-nav-menu', template: "<header *ngIf=\"loggedin\">\r\n\r\n <nav class=\"toolbar navbar navbar-expand-sm navbar-toggleable-sm navbar-light border-bottom box-shadow mb-3 \" style=\"padding-right: 10px;\">\r\n\r\n <div class=\"container-fluid\" style=\"padding-right: 0px;\">\r\n <!--<a class=\"navbar-brand\" [routerLink]=\"['/']\">Orbit</a>-->\r\n\r\n <img *ngIf=\"appConfig.logo!=''\" [src]=\"appConfig.logo\" style=\"height: 50px; margin-right: 2em\" />\r\n\r\n\r\n <div style=\"font-size: 20px;\">\r\n {{appConfig.appName}}\r\n </div>\r\n\r\n\r\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\".navbar-collapse\" aria-label=\"Toggle navigation\" [attr.aria-expanded]=\"isExpanded\" (click)=\"toggle()\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n\r\n <div *ngIf=\"myRole\" class=\"navitems navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse stack-top\" style=\"margin-right: 0px;\" [ngClass]=\"{ show: isExpanded }\" >\r\n\r\n <button mat-icon-button (click)=\"redirectTo('login')\" class=\"d-none d-sm-block\" style=\"margin-right:2em\"> <mat-icon>logout</mat-icon> </button>\r\n\r\n <button id=\"btnUser\" mat-button [matMenuTriggerFor]=\"profileMenu\" ><mat-icon>account_circle</mat-icon> {{loggedUserFullName}}</button>\r\n\r\n <mat-menu #profileMenu=\"matMenu\">\r\n <button id=\"btnProfile\" mat-menu-item (click)=\"redirectTo('home/user/profile')\" >Profile</button>\r\n <button id=\"btnLogOff\" mat-menu-item (click)=\"redirectTo('login')\">Log Off</button>\r\n </mat-menu>\r\n\r\n <div *ngFor=\"let item of appConfig.capItems\">\r\n\r\n <!-- Menu Item -->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && !item.capSubItems && item.showMenu\" mat-button (click)=\"redirectTo(item.link)\">{{item.display}}</button>\r\n\r\n <!-- Menu Item with Sub items ignored -->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && item.capSubItems && item.showMenu && item.ignoreSubsDisplay\" mat-button (click)=\"redirectTo(item.link)\">{{item.display}}</button>\r\n\r\n <!-- Menu Item with Sub items to display-->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && item.capSubItems && item.showMenu && !item.ignoreSubsDisplay\" mat-button [matMenuTriggerFor]=\"adminMenu\">{{item.display}}</button>\r\n\r\n\r\n <!-- Sub Menu Items -->\r\n <mat-menu #adminMenu=\"matMenu\">\r\n\r\n <div *ngFor=\"let subItem of item.capSubItems\">\r\n\r\n <button *ngIf=\"myRole[subItem.name] && subItem.showMenu\" mat-menu-item (click)=\"redirectTo(subItem.link)\">{{subItem.display}}</button>\r\n\r\n </div>\r\n\r\n </mat-menu>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n </nav>\r\n\r\n</header>\r\n", styles: ["a.navbar-brand{white-space:normal;text-align:center;word-break:break-all}html{font-size:14px}.box-shadow{box-shadow:0 .25rem .75rem #0000000d}.toolbar{height:60px;display:flex;align-items:center;background-color:#03a;color:#fff;font-weight:600}.stack-top{z-index:9;margin:20px}.navitems{background-color:#03a}\n"] }]
|
|
2067
|
+
}], ctorParameters: function () { return [{ type: i1$3.Router }, { type: AuthService }]; }, propDecorators: { appConfig: [{
|
|
2068
|
+
type: Input
|
|
2069
|
+
}] } });
|
|
2070
|
+
|
|
2071
|
+
class LoaderInterceptor {
|
|
2072
|
+
constructor(loaderService, messageService, authService, router, logService) {
|
|
2073
|
+
this.loaderService = loaderService;
|
|
2074
|
+
this.messageService = messageService;
|
|
2075
|
+
this.authService = authService;
|
|
2076
|
+
this.router = router;
|
|
2077
|
+
this.logService = logService;
|
|
2078
|
+
this.requests = [];
|
|
2079
|
+
}
|
|
2080
|
+
removeRequest(req) {
|
|
2081
|
+
const i = this.requests.indexOf(req);
|
|
2082
|
+
if (i >= 0) {
|
|
2083
|
+
this.requests.splice(i, 1);
|
|
2084
|
+
}
|
|
2085
|
+
this.loaderService.isLoading.next(this.requests.length > 0);
|
|
2086
|
+
}
|
|
2087
|
+
intercept(request, next) {
|
|
2088
|
+
let requestClone = request.clone({
|
|
2089
|
+
setHeaders: {
|
|
2090
|
+
Authorization: "Bearer " + this.authService.tokenSource.value
|
|
2091
|
+
}
|
|
2092
|
+
});
|
|
2093
|
+
this.requests.push(requestClone);
|
|
2094
|
+
if (this.requests.length > 1) {
|
|
2095
|
+
this.logService.info("Multiple connections detected >= " + this.requests.length);
|
|
2096
|
+
}
|
|
2097
|
+
this.loaderService.isLoading.next(true);
|
|
2098
|
+
return Observable.create(observer => {
|
|
2099
|
+
const subscription = next.handle(requestClone).subscribe(event => {
|
|
2100
|
+
if (event instanceof HttpResponse) {
|
|
2101
|
+
this.removeRequest(requestClone);
|
|
2102
|
+
observer.next(event);
|
|
2103
|
+
}
|
|
2104
|
+
}, (error) => {
|
|
2105
|
+
this.removeRequest(requestClone);
|
|
2106
|
+
observer.error(error);
|
|
2107
|
+
if (error.status === 401) {
|
|
2108
|
+
this.router.navigate(["login"]);
|
|
2109
|
+
this.messageService.toast('Unauthorised: Please login again');
|
|
2110
|
+
}
|
|
2111
|
+
else if (error.status === 500) {
|
|
2112
|
+
console.log(error.error);
|
|
2113
|
+
this.messageService.toast('System Error');
|
|
2114
|
+
}
|
|
2115
|
+
else if (error.statusText == 'Unknown Error') {
|
|
2116
|
+
this.messageService.toast('Connection Error');
|
|
2117
|
+
}
|
|
2118
|
+
else {
|
|
2119
|
+
this.messageService.toast('Error: ' + error.statusText);
|
|
2120
|
+
}
|
|
2121
|
+
}, () => {
|
|
2122
|
+
this.removeRequest(requestClone);
|
|
2123
|
+
observer.complete();
|
|
2124
|
+
});
|
|
2125
|
+
// remove request from queue when cancelled
|
|
2126
|
+
return () => {
|
|
2127
|
+
this.removeRequest(requestClone);
|
|
2128
|
+
subscription.unsubscribe();
|
|
2129
|
+
};
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
LoaderInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderInterceptor, deps: [{ token: LoaderService }, { token: MessageService }, { token: AuthService }, { token: i1$3.Router }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2134
|
+
LoaderInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderInterceptor });
|
|
2135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderInterceptor, decorators: [{
|
|
2136
|
+
type: Injectable
|
|
2137
|
+
}], ctorParameters: function () { return [{ type: LoaderService }, { type: MessageService }, { type: AuthService }, { type: i1$3.Router }, { type: LogService }]; } });
|
|
2138
|
+
|
|
2139
|
+
class CurrencyInputModule {
|
|
2140
|
+
}
|
|
2141
|
+
CurrencyInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2142
|
+
CurrencyInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, declarations: [CurrencyInputMaskDirective], imports: [CommonModule,
|
|
2143
|
+
FormsModule], exports: [CurrencyInputMaskDirective] });
|
|
2144
|
+
CurrencyInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, imports: [CommonModule,
|
|
2145
|
+
FormsModule] });
|
|
2146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, decorators: [{
|
|
2147
|
+
type: NgModule,
|
|
2148
|
+
args: [{
|
|
2149
|
+
imports: [
|
|
2150
|
+
CommonModule,
|
|
2151
|
+
FormsModule
|
|
2152
|
+
],
|
|
2153
|
+
declarations: [
|
|
2154
|
+
CurrencyInputMaskDirective
|
|
2155
|
+
],
|
|
2156
|
+
exports: [
|
|
2157
|
+
CurrencyInputMaskDirective
|
|
2158
|
+
]
|
|
2159
|
+
}]
|
|
2160
|
+
}] });
|
|
2161
|
+
|
|
2162
|
+
class NumberComponent {
|
|
2163
|
+
constructor() {
|
|
2164
|
+
// options: FormGroup;
|
|
2165
|
+
this.hideRequiredControl = new FormControl(true);
|
|
2166
|
+
this.hide = true; //for password only
|
|
2167
|
+
this.readonly = false;
|
|
2168
|
+
this.hint = "";
|
|
2169
|
+
this.display = "";
|
|
2170
|
+
this.placeholder = "";
|
|
2171
|
+
this.value = 0;
|
|
2172
|
+
this.valueChange = new EventEmitter();
|
|
2173
|
+
this.leave = new EventEmitter();
|
|
2174
|
+
this.enterPress = new EventEmitter();
|
|
2175
|
+
this.width = "100%";
|
|
2176
|
+
//validation input
|
|
2177
|
+
this.required = true;
|
|
2178
|
+
this.min = 0;
|
|
2179
|
+
this.max = 9000000000000000; //Math.max
|
|
2180
|
+
this.step = 1;
|
|
2181
|
+
//validation
|
|
2182
|
+
this.control = new FormControl(this.value, [Validators.required, Validators.min(this.min), Validators.max(this.max)]);
|
|
2183
|
+
}
|
|
2184
|
+
ngOnInit() {
|
|
2185
|
+
}
|
|
2186
|
+
changed() {
|
|
2187
|
+
this.valueChange.emit(this.value);
|
|
2188
|
+
}
|
|
2189
|
+
leaved() {
|
|
2190
|
+
this.leave.emit();
|
|
2191
|
+
}
|
|
2192
|
+
enterPressed() {
|
|
2193
|
+
this.enterPress.emit();
|
|
2194
|
+
}
|
|
2195
|
+
validate(control) {
|
|
2196
|
+
if (this.required && control.hasError('required')) {
|
|
2197
|
+
return `Required`;
|
|
2198
|
+
}
|
|
2199
|
+
if (control.hasError('min')) {
|
|
2200
|
+
return `Minimun length is ${this.min}`;
|
|
2201
|
+
}
|
|
2202
|
+
if (control.hasError('max')) {
|
|
2203
|
+
return `Maximum length is ${this.max}`;
|
|
2204
|
+
}
|
|
2205
|
+
return "";
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
NumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2209
|
+
NumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NumberComponent, selector: "spa-number", inputs: { readonly: "readonly", hint: "hint", display: "display", placeholder: "placeholder", value: "value", width: "width", required: "required", min: "min", max: "max", step: "step" }, outputs: { valueChange: "valueChange", leave: "leave", enterPress: "enterPress" }, ngImport: i0, template: "<!-- <mat-form-field style=\"width:300px\">\n <mat-label>Nostro Balance</mat-label>\n <input matInput autocomplete=\"off\" type=\"number\" min=\"0.00\" step=\"0.01\" [(ngModel)]=\"bid.balance\" placeholder=\"Nostro Balance\" />\n</mat-form-field> -->\n\n\n<mat-form-field hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\n <mat-label>{{display}}</mat-label>\n <input matInput autocomplete=\"off\" type=\"number\" [min]=\"min\" [max]=\"max\" [step]=\"step\" [(ngModel)]=\"value\" (change)=\"changed()\" (blur)=\"leaved()\" (keyup.enter)=\"enterPressed()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\" />\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\n</mat-form-field>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }] });
|
|
2210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NumberComponent, decorators: [{
|
|
2211
|
+
type: Component,
|
|
2212
|
+
args: [{ selector: 'spa-number', template: "<!-- <mat-form-field style=\"width:300px\">\n <mat-label>Nostro Balance</mat-label>\n <input matInput autocomplete=\"off\" type=\"number\" min=\"0.00\" step=\"0.01\" [(ngModel)]=\"bid.balance\" placeholder=\"Nostro Balance\" />\n</mat-form-field> -->\n\n\n<mat-form-field hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\n <mat-label>{{display}}</mat-label>\n <input matInput autocomplete=\"off\" type=\"number\" [min]=\"min\" [max]=\"max\" [step]=\"step\" [(ngModel)]=\"value\" (change)=\"changed()\" (blur)=\"leaved()\" (keyup.enter)=\"enterPressed()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\" />\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\n</mat-form-field>\n" }]
|
|
2213
|
+
}], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
|
|
2214
|
+
type: Input
|
|
2215
|
+
}], hint: [{
|
|
2216
|
+
type: Input
|
|
2217
|
+
}], display: [{
|
|
2218
|
+
type: Input
|
|
2219
|
+
}], placeholder: [{
|
|
2220
|
+
type: Input
|
|
2221
|
+
}], value: [{
|
|
2222
|
+
type: Input
|
|
2223
|
+
}], valueChange: [{
|
|
2224
|
+
type: Output
|
|
2225
|
+
}], leave: [{
|
|
2226
|
+
type: Output
|
|
2227
|
+
}], enterPress: [{
|
|
2228
|
+
type: Output
|
|
2229
|
+
}], width: [{
|
|
2230
|
+
type: Input
|
|
2231
|
+
}], required: [{
|
|
2232
|
+
type: Input
|
|
2233
|
+
}], min: [{
|
|
2234
|
+
type: Input
|
|
2235
|
+
}], max: [{
|
|
2236
|
+
type: Input
|
|
2237
|
+
}], step: [{
|
|
2238
|
+
type: Input
|
|
2239
|
+
}] } });
|
|
2240
|
+
|
|
2241
|
+
class CamelToWordsPipe {
|
|
2242
|
+
transform(value) {
|
|
2243
|
+
if (!value)
|
|
2244
|
+
return value;
|
|
2245
|
+
if (typeof value !== 'string')
|
|
2246
|
+
return value;
|
|
2247
|
+
if (value.length == 0)
|
|
2248
|
+
return value;
|
|
2249
|
+
let v = value.charAt(0).toUpperCase() + value.substring(1);
|
|
2250
|
+
return v.replace(/([A-Z]+)*([A-Z][a-z])/g, "$1 $2");
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
CamelToWordsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2254
|
+
CamelToWordsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, name: "camelToWords" });
|
|
2255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, decorators: [{
|
|
2256
|
+
type: Pipe,
|
|
2257
|
+
args: [{
|
|
2258
|
+
name: 'camelToWords'
|
|
2259
|
+
}]
|
|
2260
|
+
}] });
|
|
2261
|
+
|
|
2262
|
+
class FormComponent {
|
|
2263
|
+
constructor() { }
|
|
2264
|
+
ngOnInit() {
|
|
2265
|
+
if (!this.fields) {
|
|
2266
|
+
this.fields = this.config.fields;
|
|
2267
|
+
}
|
|
2268
|
+
if (this.config.mode == "create" && !this.data) {
|
|
2269
|
+
this.generateObject();
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
ngOnChanges() {
|
|
2273
|
+
console.log("changed");
|
|
2274
|
+
}
|
|
2275
|
+
generateObject() {
|
|
2276
|
+
this.data = {};
|
|
2277
|
+
this.fields.forEach(field => {
|
|
2278
|
+
this.data[field.name] = this.getInitialValue(field.type);
|
|
2279
|
+
});
|
|
2280
|
+
}
|
|
2281
|
+
getInitialValue(type) {
|
|
2282
|
+
switch (type) {
|
|
2283
|
+
case 'text':
|
|
2284
|
+
return '';
|
|
2285
|
+
case 'money':
|
|
2286
|
+
return 0;
|
|
2287
|
+
case 'number':
|
|
2288
|
+
return 0;
|
|
2289
|
+
case 'date':
|
|
2290
|
+
return '';
|
|
2291
|
+
case 'checkbox':
|
|
2292
|
+
return false;
|
|
2293
|
+
case 'select':
|
|
2294
|
+
return null;
|
|
2295
|
+
default:
|
|
2296
|
+
return null;
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
createClicked() {
|
|
2300
|
+
console.log(this.data);
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2304
|
+
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormComponent, selector: "spa-form", inputs: { data: "data", config: "config" }, usesOnChanges: true, ngImport: i0, template: "\n<div class=\"tin-grid\">\n\n <div *ngFor=\"let field of fields\" >\n\n <ng-container [ngSwitch]=\"field.type\">\n\n <spa-text *ngSwitchCase=\"'text'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-text>\n\n <spa-number *ngSwitchCase=\"'number'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-number>\n\n <spa-money *ngSwitchCase=\"'money'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-money>\n\n <spa-check *ngSwitchCase=\"'checkbox'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-check>\n\n <spa-date *ngSwitchCase=\"'date'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" ></spa-date>\n\n <spa-select *ngSwitchCase=\"'select'\"\n [display]=\"field.name | camelToWords\"\n [options]=\"field.options\" [optionDisplay]=\"field.optionDisplay\" [optionValue]=\"field.optionValue\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" >\n </spa-select>\n\n <spa-text *ngSwitchDefault [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-text>\n\n </ng-container>\n\n </div>\n\n\n\n\n <div class=\"span-col-center\" *ngIf=\"config.button\">\n <button mat-raised-button color=\"primary\" (click)=\"createClicked()\" cdkFocusInitial>{{config.button.name}}</button>\n </div>\n\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }, { kind: "component", type: CheckComponent, selector: "spa-check", inputs: ["readonly", "display", "value"], outputs: ["valueChange", "click", "check", "uncheck"] }, { kind: "component", type: DateComponent, selector: "spa-date", inputs: ["value", "display", "readonly", "width", "min", "max"], outputs: ["valueChange"] }, { kind: "component", type: SelectComponent, selector: "spa-select", inputs: ["width", "readonly", "readonlyMode", "hint", "placeholder", "multiple", "display", "value", "options", "optionValue", "optionDisplay", "optionDisplayExtra"], outputs: ["valueChange"] }, { kind: "component", type: MoneyComponent, selector: "spa-money", inputs: ["readonly", "display", "value", "placeholder", "width", "hint", "currency"], outputs: ["valueChange", "enterPress", "leave"] }, { kind: "component", type: NumberComponent, selector: "spa-number", inputs: ["readonly", "hint", "display", "placeholder", "value", "width", "required", "min", "max", "step"], outputs: ["valueChange", "leave", "enterPress"] }, { kind: "pipe", type: CamelToWordsPipe, name: "camelToWords" }] });
|
|
2305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormComponent, decorators: [{
|
|
2306
|
+
type: Component,
|
|
2307
|
+
args: [{ selector: 'spa-form', template: "\n<div class=\"tin-grid\">\n\n <div *ngFor=\"let field of fields\" >\n\n <ng-container [ngSwitch]=\"field.type\">\n\n <spa-text *ngSwitchCase=\"'text'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-text>\n\n <spa-number *ngSwitchCase=\"'number'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-number>\n\n <spa-money *ngSwitchCase=\"'money'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-money>\n\n <spa-check *ngSwitchCase=\"'checkbox'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-check>\n\n <spa-date *ngSwitchCase=\"'date'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" ></spa-date>\n\n <spa-select *ngSwitchCase=\"'select'\"\n [display]=\"field.name | camelToWords\"\n [options]=\"field.options\" [optionDisplay]=\"field.optionDisplay\" [optionValue]=\"field.optionValue\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" >\n </spa-select>\n\n <spa-text *ngSwitchDefault [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-text>\n\n </ng-container>\n\n </div>\n\n\n\n\n <div class=\"span-col-center\" *ngIf=\"config.button\">\n <button mat-raised-button color=\"primary\" (click)=\"createClicked()\" cdkFocusInitial>{{config.button.name}}</button>\n </div>\n\n\n</div>\n" }]
|
|
2308
|
+
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
2309
|
+
type: Input
|
|
2310
|
+
}], config: [{
|
|
2311
|
+
type: Input
|
|
2312
|
+
}] } });
|
|
2313
|
+
|
|
2314
|
+
class detailsDialog {
|
|
2315
|
+
constructor(dataService, messageService, dialogRef, data) {
|
|
2316
|
+
this.dataService = dataService;
|
|
2317
|
+
this.messageService = messageService;
|
|
2318
|
+
this.dialogRef = dialogRef;
|
|
2319
|
+
this.data = data;
|
|
2320
|
+
this.smallScreen = false;
|
|
2321
|
+
this.isLoadComplete = false;
|
|
2322
|
+
this.isProcessing = false;
|
|
2323
|
+
}
|
|
2324
|
+
ngOnInit() {
|
|
2325
|
+
this.tableConfig = this.data.config;
|
|
2326
|
+
this.formConfig = this.tableConfig.formConfig;
|
|
2327
|
+
this.formConfig.mode = this.data.mode;
|
|
2328
|
+
this.smallScreen = this.data.smallScreen;
|
|
2329
|
+
if (this.formConfig.mode == "create") {
|
|
2330
|
+
this.details = this.generateObject();
|
|
2331
|
+
}
|
|
2332
|
+
else {
|
|
2333
|
+
this.details = this.data.details;
|
|
2334
|
+
}
|
|
2335
|
+
this.isLoadComplete = true;
|
|
2336
|
+
}
|
|
2337
|
+
generateObject() {
|
|
2338
|
+
let d = {};
|
|
2339
|
+
this.formConfig.fields.forEach(property => {
|
|
2340
|
+
d[property.name] = this.getInitialValue(property.type);
|
|
2341
|
+
});
|
|
2342
|
+
return d;
|
|
2343
|
+
}
|
|
2344
|
+
setMode(newMode) {
|
|
2345
|
+
this.formConfig.mode = newMode;
|
|
2346
|
+
}
|
|
2347
|
+
getInitialValue(type) {
|
|
2348
|
+
switch (type) {
|
|
2349
|
+
case 'text':
|
|
2350
|
+
return '';
|
|
2351
|
+
case 'money':
|
|
2352
|
+
return 0;
|
|
2353
|
+
case 'number':
|
|
2354
|
+
return 0;
|
|
2355
|
+
case 'date':
|
|
2356
|
+
return '';
|
|
2357
|
+
case 'checkbox':
|
|
2358
|
+
return false;
|
|
2359
|
+
case 'select':
|
|
2360
|
+
return null;
|
|
2361
|
+
default:
|
|
2362
|
+
return null;
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
create() {
|
|
2366
|
+
console.log(this.details);
|
|
2367
|
+
let b = this.tableConfig.buttons.find(x => x.name == "create");
|
|
2368
|
+
if (!b) {
|
|
2369
|
+
this.dialogRef.close({ message: 'success', data: this.details });
|
|
2370
|
+
return;
|
|
2371
|
+
}
|
|
2372
|
+
this.isProcessing = true;
|
|
2373
|
+
this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
|
|
2374
|
+
this.isProcessing = false;
|
|
2375
|
+
if (apiResponse.success) {
|
|
2376
|
+
if (b.action.successMessage) {
|
|
2377
|
+
this.messageService.toast(b.action.successMessage);
|
|
2378
|
+
}
|
|
2379
|
+
else {
|
|
2380
|
+
this.messageService.toast("Created");
|
|
2381
|
+
}
|
|
2382
|
+
this.dialogRef.close({ message: 'success', data: this.details });
|
|
2383
|
+
}
|
|
2384
|
+
else {
|
|
2385
|
+
this.messageService.toast("Error: " + apiResponse);
|
|
2386
|
+
}
|
|
2387
|
+
});
|
|
2388
|
+
}
|
|
2389
|
+
edit() {
|
|
2390
|
+
console.log("Edit");
|
|
2391
|
+
let b = this.tableConfig.buttons.find(x => x.name == "edit");
|
|
2392
|
+
if (!b) {
|
|
2393
|
+
this.dialogRef.close({ message: 'success', data: this.details });
|
|
2394
|
+
return;
|
|
2395
|
+
}
|
|
2396
|
+
this.isProcessing = true;
|
|
2397
|
+
this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
|
|
2398
|
+
this.isProcessing = false;
|
|
2399
|
+
if (apiResponse.success) {
|
|
2400
|
+
if (b.action.successMessage) {
|
|
2401
|
+
this.messageService.toast(b.action.successMessage);
|
|
2402
|
+
}
|
|
2403
|
+
else {
|
|
2404
|
+
this.messageService.toast("Updated");
|
|
2405
|
+
}
|
|
2406
|
+
this.dialogRef.close({ message: 'success', data: this.details });
|
|
2407
|
+
}
|
|
2408
|
+
else {
|
|
2409
|
+
this.messageService.toast("Error: " + apiResponse);
|
|
2410
|
+
}
|
|
2411
|
+
});
|
|
2412
|
+
}
|
|
2413
|
+
delete() {
|
|
2414
|
+
this.messageService.confirm(`DELETE ?`).subscribe((result) => {
|
|
2415
|
+
if (result == "yes") {
|
|
2416
|
+
console.log("Delete");
|
|
2417
|
+
let b = this.tableConfig.buttons.find(x => x.name == "delete");
|
|
2418
|
+
if (!b) {
|
|
2419
|
+
this.dialogRef.close({ message: 'success', data: this.details });
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
2422
|
+
this.isProcessing = true;
|
|
2423
|
+
this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
|
|
2424
|
+
this.isProcessing = false;
|
|
2425
|
+
if (apiResponse.success) {
|
|
2426
|
+
if (b.action.successMessage) {
|
|
2427
|
+
this.messageService.toast(b.action.successMessage);
|
|
2428
|
+
}
|
|
2429
|
+
else {
|
|
2430
|
+
this.messageService.toast("Deleted");
|
|
2431
|
+
}
|
|
2432
|
+
this.dialogRef.close({ message: 'success', data: this.details });
|
|
2433
|
+
}
|
|
2434
|
+
else {
|
|
2435
|
+
this.messageService.toast("Error: " + apiResponse);
|
|
2436
|
+
}
|
|
2437
|
+
});
|
|
2438
|
+
}
|
|
2439
|
+
});
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
detailsDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: detailsDialog, deps: [{ token: DataServiceLib }, { token: MessageService }, { token: i4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
2443
|
+
detailsDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: detailsDialog, selector: "app-viewModel", ngImport: i0, template: "\r\n<div class=\"row d-flex align-items-center mt-0\">\r\n\r\n <div class=\"col\">\r\n <h2 mat-dialog-title>{{formConfig.mode | titlecase}}</h2>\r\n </div>\r\n\r\n <div *ngIf=\"smallScreen && formConfig.mode=='view'\" class=\"col d-flex justify-content-end\">\r\n <button mat-mini-fab color=\"primary\" (click)=\"setMode('edit')\"><mat-icon>edit</mat-icon></button>\r\n </div>\r\n\r\n <div *ngIf=\"smallScreen && formConfig.mode=='edit'\" class=\"col d-flex justify-content-end\">\r\n <button mat-icon-button (click)=\"setMode('view')\"><mat-icon>done</mat-icon></button>\r\n </div>\r\n\r\n</div>\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n<div class=\"tin-input\" style=\"font-size:14px\">\r\n\r\n\r\n<spa-form [data]=\"details\" [config]=\"formConfig\"></spa-form>\r\n\r\n</div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n<div>\r\n<button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='create'\" (click)=\"create()\" cdkFocusInitial>Submit</button>\r\n<button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='edit'\" (click)=\"edit()\" cdkFocusInitial>Submit</button>\r\n<button mat-stroked-button color=\"primary\" mat-dialog-close>Cancel</button>\r\n</div>\r\n<div class=\"col d-flex justify-content-end\">\r\n<button mat-icon-button [disabled]=\"isProcessing\" style=\"color: red;\" (click)=\"delete()\" *ngIf=\"formConfig.mode!='create'\"><mat-icon>delete</mat-icon></button>\r\n</div>\r\n\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: FormComponent, selector: "spa-form", inputs: ["data", "config"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }] });
|
|
2444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: detailsDialog, decorators: [{
|
|
2445
|
+
type: Component,
|
|
2446
|
+
args: [{ selector: 'app-viewModel', template: "\r\n<div class=\"row d-flex align-items-center mt-0\">\r\n\r\n <div class=\"col\">\r\n <h2 mat-dialog-title>{{formConfig.mode | titlecase}}</h2>\r\n </div>\r\n\r\n <div *ngIf=\"smallScreen && formConfig.mode=='view'\" class=\"col d-flex justify-content-end\">\r\n <button mat-mini-fab color=\"primary\" (click)=\"setMode('edit')\"><mat-icon>edit</mat-icon></button>\r\n </div>\r\n\r\n <div *ngIf=\"smallScreen && formConfig.mode=='edit'\" class=\"col d-flex justify-content-end\">\r\n <button mat-icon-button (click)=\"setMode('view')\"><mat-icon>done</mat-icon></button>\r\n </div>\r\n\r\n</div>\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n<div class=\"tin-input\" style=\"font-size:14px\">\r\n\r\n\r\n<spa-form [data]=\"details\" [config]=\"formConfig\"></spa-form>\r\n\r\n</div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n<div>\r\n<button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='create'\" (click)=\"create()\" cdkFocusInitial>Submit</button>\r\n<button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='edit'\" (click)=\"edit()\" cdkFocusInitial>Submit</button>\r\n<button mat-stroked-button color=\"primary\" mat-dialog-close>Cancel</button>\r\n</div>\r\n<div class=\"col d-flex justify-content-end\">\r\n<button mat-icon-button [disabled]=\"isProcessing\" style=\"color: red;\" (click)=\"delete()\" *ngIf=\"formConfig.mode!='create'\"><mat-icon>delete</mat-icon></button>\r\n</div>\r\n\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"] }]
|
|
2447
|
+
}], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }, { type: i4.MatDialogRef }, { type: undefined, decorators: [{
|
|
2448
|
+
type: Inject,
|
|
2449
|
+
args: [MAT_DIALOG_DATA]
|
|
2450
|
+
}] }]; } });
|
|
2451
|
+
;
|
|
2452
|
+
|
|
2453
|
+
class TableComponent {
|
|
2454
|
+
constructor(dataService, messageService, breakpointObserver, dialog) {
|
|
2455
|
+
this.dataService = dataService;
|
|
2456
|
+
this.messageService = messageService;
|
|
2457
|
+
this.breakpointObserver = breakpointObserver;
|
|
2458
|
+
this.dialog = dialog;
|
|
2459
|
+
this.actionsWidth = "50px";
|
|
2460
|
+
this.data = [];
|
|
2461
|
+
this.refreshClick = new EventEmitter();
|
|
2462
|
+
this.createClick = new EventEmitter();
|
|
2463
|
+
this.viewClick = new EventEmitter();
|
|
2464
|
+
this.editClick = new EventEmitter();
|
|
2465
|
+
this.deleteClick = new EventEmitter();
|
|
2466
|
+
this.custom1Click = new EventEmitter();
|
|
2467
|
+
this.custom2Click = new EventEmitter();
|
|
2468
|
+
this.custom3Click = new EventEmitter();
|
|
2469
|
+
this.smallScreen = false;
|
|
2470
|
+
this.options = [];
|
|
2471
|
+
this.displayedColumns = [];
|
|
2472
|
+
// detect screen size changes
|
|
2473
|
+
this.breakpointObserver.observe(["(max-width: 600px)"]).subscribe((result) => {
|
|
2474
|
+
if (result.matches) {
|
|
2475
|
+
this.smallScreen = true;
|
|
2476
|
+
this.setColumns();
|
|
2477
|
+
}
|
|
2478
|
+
else {
|
|
2479
|
+
this.smallScreen = false;
|
|
2480
|
+
this.setColumns();
|
|
2481
|
+
}
|
|
2482
|
+
});
|
|
2483
|
+
}
|
|
2484
|
+
ngOnInit() {
|
|
2485
|
+
this.options = this.config.columns;
|
|
2486
|
+
this.setColumns();
|
|
2487
|
+
this.createButton = this.getButton('create');
|
|
2488
|
+
this.viewButton = this.getButton('view');
|
|
2489
|
+
this.editButton = this.getButton('edit');
|
|
2490
|
+
this.deleteButton = this.getButton('delete');
|
|
2491
|
+
this.custom1Button = this.getButton('custom1');
|
|
2492
|
+
this.custom2Button = this.getButton('custom2');
|
|
2493
|
+
this.custom3Button = this.getButton('custom3');
|
|
2494
|
+
if (this.config.loadAction) {
|
|
2495
|
+
this.loadData();
|
|
2496
|
+
}
|
|
2497
|
+
this.formDefaults();
|
|
2498
|
+
}
|
|
2499
|
+
ngOnChanges() {
|
|
2500
|
+
if (!this.config.loadAction) {
|
|
2501
|
+
console.log("Table data Changed");
|
|
2502
|
+
this.dataSource = this.data;
|
|
2503
|
+
this.tableDataSource = new MatTableDataSource(this.dataSource);
|
|
2504
|
+
setTimeout(() => { this.tableDataSource.paginator = this.tablePaginator; }, 5);
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
getButton(name) {
|
|
2508
|
+
if (!this.config.buttons)
|
|
2509
|
+
return null;
|
|
2510
|
+
return this.config.buttons.find(x => x.name == name);
|
|
2511
|
+
}
|
|
2512
|
+
getIcon(buttonName) {
|
|
2513
|
+
let b = this.getButton(buttonName);
|
|
2514
|
+
if (b.icon) {
|
|
2515
|
+
return b.icon.name;
|
|
2516
|
+
}
|
|
2517
|
+
let i = 'pageview';
|
|
2518
|
+
switch (buttonName) {
|
|
2519
|
+
case 'view':
|
|
2520
|
+
i = 'pageview';
|
|
2521
|
+
break;
|
|
2522
|
+
case 'edit':
|
|
2523
|
+
i = 'edit';
|
|
2524
|
+
break;
|
|
2525
|
+
case 'delete':
|
|
2526
|
+
i = 'delete';
|
|
2527
|
+
break;
|
|
2528
|
+
default:
|
|
2529
|
+
break;
|
|
2530
|
+
}
|
|
2531
|
+
return i;
|
|
2532
|
+
}
|
|
2533
|
+
setColumns() {
|
|
2534
|
+
if (!this.config?.columns) {
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
if (this.smallScreen) {
|
|
2538
|
+
this.displayedColumns = this.config.minColumns;
|
|
2539
|
+
}
|
|
2540
|
+
else {
|
|
2541
|
+
this.displayedColumns = this.config.columns.map(({ name }) => name);
|
|
2542
|
+
}
|
|
2543
|
+
let buttonsCount = this.config.buttons.filter(x => x.name != 'create').length ?? 0;
|
|
2544
|
+
if (buttonsCount > 0) {
|
|
2545
|
+
if (!this.displayedColumns.find(x => x == 'action') && this.config.buttons) {
|
|
2546
|
+
this.displayedColumns.push("action");
|
|
2547
|
+
}
|
|
2548
|
+
this.actionsWidth = `${buttonsCount * 40 + 20}px`;
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
getOptions(column) {
|
|
2552
|
+
let x = this.options.find(opt => opt.name === column);
|
|
2553
|
+
return x;
|
|
2554
|
+
}
|
|
2555
|
+
testIconCondition(column, row) {
|
|
2556
|
+
const option = this.getOptions(column);
|
|
2557
|
+
if (option && option.icon && !option.icon.condition) {
|
|
2558
|
+
return true;
|
|
2559
|
+
}
|
|
2560
|
+
if (option && option.icon && option.icon.condition) {
|
|
2561
|
+
return option.icon.condition(row[column]);
|
|
2562
|
+
}
|
|
2563
|
+
return false;
|
|
2564
|
+
}
|
|
2565
|
+
testDisabled(row, buttonName) {
|
|
2566
|
+
let button = this.getButton(buttonName);
|
|
2567
|
+
if (button.disabled) {
|
|
2568
|
+
return button.disabled(row);
|
|
2569
|
+
}
|
|
2570
|
+
return false;
|
|
2571
|
+
}
|
|
2572
|
+
testVisible(row, buttonName) {
|
|
2573
|
+
let button = this.getButton(buttonName);
|
|
2574
|
+
if (button.visible) {
|
|
2575
|
+
return button.visible(row);
|
|
2576
|
+
}
|
|
2577
|
+
return true;
|
|
2578
|
+
}
|
|
2579
|
+
//Actions
|
|
2580
|
+
refreshClicked() {
|
|
2581
|
+
console.log("Refresh");
|
|
2582
|
+
this.refreshClick.emit();
|
|
2583
|
+
if (this.config.loadAction) {
|
|
2584
|
+
this.loadData();
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
view(x) {
|
|
2588
|
+
console.log("View");
|
|
2589
|
+
this.viewClick.emit(x);
|
|
2590
|
+
// this.doAction('view', x);
|
|
2591
|
+
}
|
|
2592
|
+
create(x) {
|
|
2593
|
+
console.log("Create");
|
|
2594
|
+
this.createClick.emit(x);
|
|
2595
|
+
this.doAction('create', x);
|
|
2596
|
+
}
|
|
2597
|
+
edit(x) {
|
|
2598
|
+
console.log("Edit");
|
|
2599
|
+
this.editClick.emit(x);
|
|
2600
|
+
this.doAction('edit', x);
|
|
2601
|
+
}
|
|
2602
|
+
delete(x) {
|
|
2603
|
+
console.log("Delete");
|
|
2604
|
+
this.deleteClick.emit(x);
|
|
2605
|
+
this.doAction('delete', x);
|
|
2606
|
+
}
|
|
2607
|
+
custom1(x) {
|
|
2608
|
+
console.log("Custom 1");
|
|
2609
|
+
this.custom1Click.emit(x);
|
|
2610
|
+
this.doAction('custom1', x);
|
|
2611
|
+
}
|
|
2612
|
+
custom2(x) {
|
|
2613
|
+
console.log("Custom 2");
|
|
2614
|
+
this.custom2Click.emit(x);
|
|
2615
|
+
this.doAction('custom2', x);
|
|
2616
|
+
}
|
|
2617
|
+
custom3(x) {
|
|
2618
|
+
console.log("Custom 3");
|
|
2619
|
+
this.custom3Click.emit(x);
|
|
2620
|
+
this.doAction('custom3', x);
|
|
2621
|
+
}
|
|
2622
|
+
viewModel(row) {
|
|
2623
|
+
let button = this.getButton('view');
|
|
2624
|
+
if (button && !button.dialog) {
|
|
2625
|
+
this.view(row);
|
|
2626
|
+
return;
|
|
2627
|
+
}
|
|
2628
|
+
if (!this.config.formConfig) {
|
|
2629
|
+
this.messageService.toast("Please configure form");
|
|
2630
|
+
return;
|
|
2631
|
+
}
|
|
2632
|
+
const dialogRef = this.dialog.open(detailsDialog, {
|
|
2633
|
+
width: "900px",
|
|
2634
|
+
data: { mode: "view", config: this.config, details: row, smallScreen: this.smallScreen },
|
|
2635
|
+
});
|
|
2636
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
2637
|
+
if (result.message) {
|
|
2638
|
+
this.refreshClicked();
|
|
2639
|
+
}
|
|
2640
|
+
});
|
|
2641
|
+
}
|
|
2642
|
+
newModel() {
|
|
2643
|
+
let button = this.getButton('create');
|
|
2644
|
+
if (button && !button.dialog) {
|
|
2645
|
+
this.create('');
|
|
2646
|
+
return;
|
|
2647
|
+
}
|
|
2648
|
+
if (!this.config.formConfig) {
|
|
2649
|
+
this.messageService.toast("Please configure form");
|
|
2650
|
+
return;
|
|
2651
|
+
}
|
|
2652
|
+
const dialogRef = this.dialog.open(detailsDialog, {
|
|
2653
|
+
width: "900px",
|
|
2654
|
+
data: { mode: "create", config: this.config, smallScreen: this.smallScreen }
|
|
2655
|
+
});
|
|
2656
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
2657
|
+
if (result.message) {
|
|
2658
|
+
this.create(result.data);
|
|
2659
|
+
this.refreshClicked();
|
|
2660
|
+
}
|
|
2661
|
+
});
|
|
2662
|
+
}
|
|
2663
|
+
editModel(row) {
|
|
2664
|
+
let button = this.getButton('edit');
|
|
2665
|
+
if (button && !button.dialog) {
|
|
2666
|
+
this.edit(row);
|
|
2667
|
+
return;
|
|
2668
|
+
}
|
|
2669
|
+
if (!this.config.formConfig) {
|
|
2670
|
+
this.messageService.toast("Please configure form");
|
|
2671
|
+
return;
|
|
2672
|
+
}
|
|
2673
|
+
const dialogRef = this.dialog.open(detailsDialog, {
|
|
2674
|
+
width: "900px",
|
|
2675
|
+
data: { mode: "edit", config: this.config, details: row, smallScreen: this.smallScreen },
|
|
2676
|
+
});
|
|
2677
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
2678
|
+
if (result.message) {
|
|
2679
|
+
this.edit(result.data);
|
|
2680
|
+
this.refreshClicked();
|
|
2681
|
+
}
|
|
2682
|
+
});
|
|
2683
|
+
}
|
|
2684
|
+
deleteModel(row) {
|
|
2685
|
+
let button = this.getButton('delete');
|
|
2686
|
+
if (button && !button.dialog) {
|
|
2687
|
+
this.delete(row);
|
|
2688
|
+
return;
|
|
2689
|
+
}
|
|
2690
|
+
this.messageService.confirm(`DELETE ?`).subscribe((result) => {
|
|
2691
|
+
if (result == "yes") {
|
|
2692
|
+
this.delete(row);
|
|
2693
|
+
this.refreshClicked();
|
|
2694
|
+
}
|
|
2695
|
+
});
|
|
2696
|
+
}
|
|
2697
|
+
doAction(buttonName, row) {
|
|
2698
|
+
let b = this.getButton(buttonName);
|
|
2699
|
+
if (!b)
|
|
2700
|
+
return;
|
|
2701
|
+
if (b.action && buttonName != 'delete')
|
|
2702
|
+
return;
|
|
2703
|
+
this.dataService.CallApi(b.action, row).subscribe((apiResponse) => {
|
|
2704
|
+
if (apiResponse.success) {
|
|
2705
|
+
if (b.action.successMessage) {
|
|
2706
|
+
this.messageService.toast(b.action.successMessage);
|
|
2707
|
+
}
|
|
2708
|
+
else {
|
|
2709
|
+
this.messageService.toast("Updated");
|
|
2710
|
+
}
|
|
2711
|
+
this.refreshClicked();
|
|
2712
|
+
}
|
|
2713
|
+
else {
|
|
2714
|
+
this.messageService.toast("Error: " + apiResponse);
|
|
2715
|
+
}
|
|
2716
|
+
});
|
|
2717
|
+
}
|
|
2718
|
+
loadData() {
|
|
2719
|
+
console.log("loading");
|
|
2720
|
+
if (this.config.loadAction) {
|
|
2721
|
+
this.dataService.CallApi(this.config.loadAction, "").subscribe((apiResponse) => {
|
|
2722
|
+
this.dataSource = apiResponse.data;
|
|
2723
|
+
this.tableDataSource = new MatTableDataSource(apiResponse.data);
|
|
2724
|
+
this.tableDataSource.paginator = this.tablePaginator;
|
|
2725
|
+
// if (apiResponse.success){
|
|
2726
|
+
// this.tableDataSource = new MatTableDataSource(apiResponse.data);
|
|
2727
|
+
// this.tableDataSource.paginator = this.tablePaginator;
|
|
2728
|
+
// }else{
|
|
2729
|
+
// this.messageService.toast("Error: " + JSON.stringify(apiResponse));
|
|
2730
|
+
// }
|
|
2731
|
+
});
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
formDefaults() {
|
|
2735
|
+
if (!this.config.formConfig) {
|
|
2736
|
+
let config = new FormConfig;
|
|
2737
|
+
config.fields = [];
|
|
2738
|
+
this.config.columns.forEach(column => {
|
|
2739
|
+
let field = { name: column.name, type: column.type };
|
|
2740
|
+
config.fields.push(field);
|
|
2741
|
+
});
|
|
2742
|
+
this.config.formConfig = config;
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TableComponent, deps: [{ token: DataServiceLib }, { token: MessageService }, { token: i3$3.BreakpointObserver }, { token: i4.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
2747
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TableComponent, selector: "spa-table", inputs: { data: "data", config: "config" }, outputs: { refreshClick: "refreshClick", createClick: "createClick", viewClick: "viewClick", editClick: "editClick", deleteClick: "deleteClick", custom1Click: "custom1Click", custom2Click: "custom2Click", custom3Click: "custom3Click" }, viewQueries: [{ propertyName: "tablePaginator", first: true, predicate: ["tablePaginator"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n<div class=\"top\">\n\n <div >\n <!-- <button *ngIf=\"config.newText\" id=\"btnNew\" mat-raised-button color=\"primary\" (click)=\"newModel()\">{{config.newText}}</button> -->\n <button *ngIf=\"createButton\" id=\"btnNew\" mat-raised-button color=\"primary\" (click)=\"newModel()\">{{createButton.display}}</button>\n </div>\n\n <div *ngIf=\"config.showFilter\" class=\"d-flex justify-content-end\">\n <spa-filter [data]=\"tableDataSource\" (refreshClick)=\"refreshClicked()\"></spa-filter>\n </div>\n\n</div>\n\n<div>\n\n <p *ngIf=\"!config\"><em>Configure Table</em></p>\n <p *ngIf=\"!dataSource\"><em>Loading...</em></p>\n\n\n\n <div *ngIf=\"dataSource\">\n\n\n <table mat-table [dataSource]=\"tableDataSource\" class=\"mat-elevation-z8\">\n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.name\">\n <th mat-header-cell *matHeaderCellDef>{{ column.name | camelToWords }}</th>\n <td mat-cell *matCellDef=\"let row;\" >\n\n <ng-container [ngSwitch]=\"column.type\">\n\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <spa-check [value]=\"row[column.name]\" [readonly]=\"true\"></spa-check>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'date'\">\n {{row[column.name] | date : 'dd/MM/yyyy'}}\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'money'\">\n {{row[column.name] | currency:'':''}}\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <label>{{row[column.name]}}</label>\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n </ng-container>\n\n\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"action\">\n <th mat-header-cell *matHeaderCellDef> Action </th>\n <td mat-cell *matCellDef=\"let row\" [ngStyle]=\"{width:smallScreen ? '50px' : actionsWidth}\">\n\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"viewButton.tip ?? 'view' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':viewButton.color}\" [disabled]=\"testDisabled(row,'view')\" *ngIf=\"viewButton && testVisible(row,'view')\" (click)=\"viewModel(row)\">\n <mat-icon>{{getIcon('view')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom1Button.tip ?? 'custom1' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom1Button.color}\" [disabled]=\"testDisabled(row,'custom1')\" *ngIf=\"!smallScreen && custom1Button && testVisible(row,'custom1')\" (click)=\"custom1(row)\">\n <mat-icon>{{getIcon('custom1')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom2Button.tip ?? 'custom2' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom2Button.color}\" [disabled]=\"testDisabled(row,'custom2')\" *ngIf=\"!smallScreen && custom2Button && testVisible(row,'custom2')\" (click)=\"custom2(row)\">\n <mat-icon>{{getIcon('custom2')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom3Button.tip ?? 'custom3' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom3Button.color}\" [disabled]=\"testDisabled(row,'custom3')\" *ngIf=\"!smallScreen && custom3Button && testVisible(row,'custom3')\" (click)=\"custom3(row)\">\n <mat-icon>{{getIcon('custom3')}}</mat-icon>\n </button>\n\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"editButton.tip ?? 'edit' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':editButton.color}\" [disabled]=\"testDisabled(row,'edit')\" *ngIf=\"!smallScreen && editButton && testVisible(row,'edit')\" (click)=\"editModel(row)\">\n <mat-icon>{{getIcon('edit')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"warn\" [matTooltip]=\"deleteButton.tip ?? 'delete' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':deleteButton.color}\" [disabled]=\"testDisabled(row,'delete')\" *ngIf=\"!smallScreen && deleteButton && testVisible(row,'delete')\" (click)=\"deleteModel(row)\">\n <mat-icon>{{getIcon('delete')}}</mat-icon>\n </button>\n\n </td>\n </ng-container>\n\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n\n </div>\n\n <mat-paginator #tablePaginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n\n</div>\n\n<p *ngIf=\"dataSource?.length == 0\"><em>No Data</em></p>\n\n\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i6$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i7$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: CheckComponent, selector: "spa-check", inputs: ["readonly", "display", "value"], outputs: ["valueChange", "click", "check", "uncheck"] }, { kind: "component", type: FilterComponent, selector: "spa-filter", inputs: ["data"], outputs: ["refreshClick"] }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: CamelToWordsPipe, name: "camelToWords" }] });
|
|
2748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TableComponent, decorators: [{
|
|
2749
|
+
type: Component,
|
|
2750
|
+
args: [{ selector: 'spa-table', template: "\n<div class=\"top\">\n\n <div >\n <!-- <button *ngIf=\"config.newText\" id=\"btnNew\" mat-raised-button color=\"primary\" (click)=\"newModel()\">{{config.newText}}</button> -->\n <button *ngIf=\"createButton\" id=\"btnNew\" mat-raised-button color=\"primary\" (click)=\"newModel()\">{{createButton.display}}</button>\n </div>\n\n <div *ngIf=\"config.showFilter\" class=\"d-flex justify-content-end\">\n <spa-filter [data]=\"tableDataSource\" (refreshClick)=\"refreshClicked()\"></spa-filter>\n </div>\n\n</div>\n\n<div>\n\n <p *ngIf=\"!config\"><em>Configure Table</em></p>\n <p *ngIf=\"!dataSource\"><em>Loading...</em></p>\n\n\n\n <div *ngIf=\"dataSource\">\n\n\n <table mat-table [dataSource]=\"tableDataSource\" class=\"mat-elevation-z8\">\n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.name\">\n <th mat-header-cell *matHeaderCellDef>{{ column.name | camelToWords }}</th>\n <td mat-cell *matCellDef=\"let row;\" >\n\n <ng-container [ngSwitch]=\"column.type\">\n\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <spa-check [value]=\"row[column.name]\" [readonly]=\"true\"></spa-check>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'date'\">\n {{row[column.name] | date : 'dd/MM/yyyy'}}\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'money'\">\n {{row[column.name] | currency:'':''}}\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <label>{{row[column.name]}}</label>\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n </ng-container>\n\n\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"action\">\n <th mat-header-cell *matHeaderCellDef> Action </th>\n <td mat-cell *matCellDef=\"let row\" [ngStyle]=\"{width:smallScreen ? '50px' : actionsWidth}\">\n\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"viewButton.tip ?? 'view' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':viewButton.color}\" [disabled]=\"testDisabled(row,'view')\" *ngIf=\"viewButton && testVisible(row,'view')\" (click)=\"viewModel(row)\">\n <mat-icon>{{getIcon('view')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom1Button.tip ?? 'custom1' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom1Button.color}\" [disabled]=\"testDisabled(row,'custom1')\" *ngIf=\"!smallScreen && custom1Button && testVisible(row,'custom1')\" (click)=\"custom1(row)\">\n <mat-icon>{{getIcon('custom1')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom2Button.tip ?? 'custom2' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom2Button.color}\" [disabled]=\"testDisabled(row,'custom2')\" *ngIf=\"!smallScreen && custom2Button && testVisible(row,'custom2')\" (click)=\"custom2(row)\">\n <mat-icon>{{getIcon('custom2')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom3Button.tip ?? 'custom3' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom3Button.color}\" [disabled]=\"testDisabled(row,'custom3')\" *ngIf=\"!smallScreen && custom3Button && testVisible(row,'custom3')\" (click)=\"custom3(row)\">\n <mat-icon>{{getIcon('custom3')}}</mat-icon>\n </button>\n\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"editButton.tip ?? 'edit' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':editButton.color}\" [disabled]=\"testDisabled(row,'edit')\" *ngIf=\"!smallScreen && editButton && testVisible(row,'edit')\" (click)=\"editModel(row)\">\n <mat-icon>{{getIcon('edit')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"warn\" [matTooltip]=\"deleteButton.tip ?? 'delete' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':deleteButton.color}\" [disabled]=\"testDisabled(row,'delete')\" *ngIf=\"!smallScreen && deleteButton && testVisible(row,'delete')\" (click)=\"deleteModel(row)\">\n <mat-icon>{{getIcon('delete')}}</mat-icon>\n </button>\n\n </td>\n </ng-container>\n\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n\n </div>\n\n <mat-paginator #tablePaginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n\n</div>\n\n<p *ngIf=\"dataSource?.length == 0\"><em>No Data</em></p>\n\n\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"] }]
|
|
2751
|
+
}], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }, { type: i3$3.BreakpointObserver }, { type: i4.MatDialog }]; }, propDecorators: { tablePaginator: [{
|
|
2752
|
+
type: ViewChild,
|
|
2753
|
+
args: ['tablePaginator']
|
|
2754
|
+
}], data: [{
|
|
2755
|
+
type: Input
|
|
2756
|
+
}], config: [{
|
|
2757
|
+
type: Input
|
|
2758
|
+
}], refreshClick: [{
|
|
2759
|
+
type: Output
|
|
2760
|
+
}], createClick: [{
|
|
2761
|
+
type: Output
|
|
2762
|
+
}], viewClick: [{
|
|
2763
|
+
type: Output
|
|
2764
|
+
}], editClick: [{
|
|
2765
|
+
type: Output
|
|
2766
|
+
}], deleteClick: [{
|
|
2767
|
+
type: Output
|
|
2768
|
+
}], custom1Click: [{
|
|
2769
|
+
type: Output
|
|
2770
|
+
}], custom2Click: [{
|
|
2771
|
+
type: Output
|
|
2772
|
+
}], custom3Click: [{
|
|
2773
|
+
type: Output
|
|
2774
|
+
}] } });
|
|
2775
|
+
|
|
2776
|
+
class TinSpaModule {
|
|
2777
|
+
}
|
|
2778
|
+
TinSpaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2779
|
+
TinSpaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, declarations: [TinSpaComponent, TextComponent, CheckComponent, DateComponent, DatetimeComponent, LabelComponent, SelectComponent,
|
|
2780
|
+
ActivityComponent, FilterComponent, messageDialog, MoneyComponent, OptionComponent, TilesComponent, StepsComponent,
|
|
2781
|
+
AttachComponent, ChipsComponent, LoaderComponent, NavMenuComponent, TableComponent, detailsDialog, FormComponent, CamelToWordsPipe, NumberComponent], imports: [SpaMatModule,
|
|
2782
|
+
HttpClientModule,
|
|
2783
|
+
CurrencyInputModule], exports: [TinSpaComponent,
|
|
2784
|
+
SpaMatModule,
|
|
2785
|
+
TextComponent,
|
|
2786
|
+
messageDialog,
|
|
2787
|
+
NavMenuComponent,
|
|
2788
|
+
LoaderComponent,
|
|
2789
|
+
TilesComponent,
|
|
2790
|
+
DateComponent,
|
|
2791
|
+
SelectComponent,
|
|
2792
|
+
DatetimeComponent,
|
|
2793
|
+
CheckComponent,
|
|
2794
|
+
AttachComponent,
|
|
2795
|
+
MoneyComponent,
|
|
2796
|
+
ChipsComponent,
|
|
2797
|
+
ActivityComponent,
|
|
2798
|
+
OptionComponent,
|
|
2799
|
+
LabelComponent,
|
|
2800
|
+
StepsComponent,
|
|
2801
|
+
FilterComponent,
|
|
2802
|
+
TableComponent, detailsDialog,
|
|
2803
|
+
FormComponent,
|
|
2804
|
+
NumberComponent] });
|
|
2805
|
+
TinSpaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, providers: [
|
|
2806
|
+
{ provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true },
|
|
2807
|
+
{ provide: LocationStrategy, useClass: HashLocationStrategy },
|
|
2808
|
+
{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'legacy' } },
|
|
2809
|
+
CurrencyPipe, DatePipe
|
|
2810
|
+
], imports: [SpaMatModule,
|
|
2811
|
+
HttpClientModule,
|
|
2812
|
+
CurrencyInputModule, SpaMatModule] });
|
|
2813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, decorators: [{
|
|
2814
|
+
type: NgModule,
|
|
2815
|
+
args: [{
|
|
2816
|
+
declarations: [
|
|
2817
|
+
TinSpaComponent, TextComponent, CheckComponent, DateComponent, DatetimeComponent, LabelComponent, SelectComponent,
|
|
2818
|
+
ActivityComponent, FilterComponent, messageDialog, MoneyComponent, OptionComponent, TilesComponent, StepsComponent,
|
|
2819
|
+
AttachComponent, ChipsComponent, LoaderComponent, NavMenuComponent, TableComponent, detailsDialog, FormComponent, CamelToWordsPipe, NumberComponent
|
|
2820
|
+
],
|
|
2821
|
+
imports: [
|
|
2822
|
+
SpaMatModule,
|
|
2823
|
+
HttpClientModule,
|
|
2824
|
+
CurrencyInputModule
|
|
2825
|
+
],
|
|
2826
|
+
exports: [
|
|
2827
|
+
TinSpaComponent,
|
|
2828
|
+
SpaMatModule,
|
|
2829
|
+
TextComponent,
|
|
2830
|
+
messageDialog,
|
|
2831
|
+
NavMenuComponent,
|
|
2832
|
+
LoaderComponent,
|
|
2833
|
+
TilesComponent,
|
|
2834
|
+
DateComponent,
|
|
2835
|
+
SelectComponent,
|
|
2836
|
+
DatetimeComponent,
|
|
2837
|
+
CheckComponent,
|
|
2838
|
+
AttachComponent,
|
|
2839
|
+
MoneyComponent,
|
|
2840
|
+
ChipsComponent,
|
|
2841
|
+
ActivityComponent,
|
|
2842
|
+
OptionComponent,
|
|
2843
|
+
LabelComponent,
|
|
2844
|
+
StepsComponent,
|
|
2845
|
+
FilterComponent,
|
|
2846
|
+
TableComponent, detailsDialog,
|
|
2847
|
+
FormComponent,
|
|
2848
|
+
NumberComponent
|
|
2849
|
+
],
|
|
2850
|
+
providers: [
|
|
2851
|
+
{ provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true },
|
|
2852
|
+
{ provide: LocationStrategy, useClass: HashLocationStrategy },
|
|
2853
|
+
{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'legacy' } },
|
|
2854
|
+
CurrencyPipe, DatePipe
|
|
2855
|
+
],
|
|
2856
|
+
}]
|
|
2857
|
+
}] });
|
|
2858
|
+
|
|
2859
|
+
class LoginComponent {
|
|
2860
|
+
constructor(httpService, storageService, router, messageService, dataService, authService, logService, route) {
|
|
2861
|
+
this.httpService = httpService;
|
|
2862
|
+
this.storageService = storageService;
|
|
2863
|
+
this.router = router;
|
|
2864
|
+
this.messageService = messageService;
|
|
2865
|
+
this.dataService = dataService;
|
|
2866
|
+
this.authService = authService;
|
|
2867
|
+
this.logService = logService;
|
|
2868
|
+
this.route = route;
|
|
2869
|
+
this.style = "default";
|
|
2870
|
+
this.email = "";
|
|
2871
|
+
this.password = "";
|
|
2872
|
+
this.user = new User();
|
|
2873
|
+
this.hide = true;
|
|
2874
|
+
this.isProcessing = false;
|
|
2875
|
+
this.appConfig = new AppConfig();
|
|
2876
|
+
}
|
|
2877
|
+
ngOnInit() {
|
|
2878
|
+
this.authService.Updateloggedin(false);
|
|
2879
|
+
this.authService.UpdateRole(null);
|
|
2880
|
+
this.storageService.clear();
|
|
2881
|
+
this.dataService.appConfigObserv.subscribe(x => this.appConfig = x);
|
|
2882
|
+
if (this.route.snapshot.queryParams["redirectTo"] != undefined) {
|
|
2883
|
+
this.redirectPath = this.route.snapshot.queryParams["redirectTo"];
|
|
2884
|
+
}
|
|
2885
|
+
else {
|
|
2886
|
+
this.redirectPath = "home";
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2889
|
+
signup() {
|
|
2890
|
+
this.router.navigate(["signup"]);
|
|
2891
|
+
}
|
|
2892
|
+
recoverAccount() {
|
|
2893
|
+
this.router.navigate(["recover-account"]);
|
|
2894
|
+
}
|
|
2895
|
+
login() {
|
|
2896
|
+
if (this.user.userName == "" || this.user.password == "") {
|
|
2897
|
+
this.messageService.toast("Please enter your credentials");
|
|
2898
|
+
return;
|
|
2899
|
+
}
|
|
2900
|
+
this.logService.info("logging in");
|
|
2901
|
+
this.isProcessing = true;
|
|
2902
|
+
this.user.userName = this.user.userName;
|
|
2903
|
+
this.dataService.Login(this.user).subscribe((apiResponse) => {
|
|
2904
|
+
this.isProcessing = false;
|
|
2905
|
+
if (apiResponse.success) {
|
|
2906
|
+
if (apiResponse.data.authType == 'local' && !this.appConfig.localAuth) {
|
|
2907
|
+
this.messageService.toast("Contact Admin: Authentication Type error");
|
|
2908
|
+
return;
|
|
2909
|
+
}
|
|
2910
|
+
if (apiResponse.data.authType == 'AD' && !this.appConfig.ADAuth) {
|
|
2911
|
+
this.messageService.toast("Contact Admin: Authentication Type error");
|
|
2912
|
+
return;
|
|
2913
|
+
}
|
|
2914
|
+
this.authService.Updateloggedin(true);
|
|
2915
|
+
this.authService.UpdateToken(apiResponse.data.token);
|
|
2916
|
+
this.storageService.store(Constants.AUTH_TOKEN, apiResponse.data.token);
|
|
2917
|
+
this.authService.UpdateTokenExpire(apiResponse.data.expiration);
|
|
2918
|
+
this.storageService.store(Constants.AUTH_TOKEN_EXPIRE, apiResponse.data.expiration);
|
|
2919
|
+
this.authService.UpdateCurrentUser(this.user.userName);
|
|
2920
|
+
this.storageService.store(Constants.AUTH_USER, this.user.userName);
|
|
2921
|
+
this.authService.updateLoggedUserFullName(apiResponse.data.firstName);
|
|
2922
|
+
this.storageService.store(Constants.AUTH_NAME, apiResponse.data.firstName);
|
|
2923
|
+
this.authService.UpdateRole(apiResponse.data.role);
|
|
2924
|
+
this.storageService.store(Constants.AUTH_ROLES, JSON.stringify(apiResponse.data.role));
|
|
2925
|
+
this.logService.info("logged in");
|
|
2926
|
+
if (apiResponse.data.changePassword == true && apiResponse.data.authType == 'local') {
|
|
2927
|
+
this.router.navigate(["home/user/change-password"], {
|
|
2928
|
+
queryParams: { redirectTo: this.redirectPath },
|
|
2929
|
+
queryParamsHandling: 'merge',
|
|
2930
|
+
skipLocationChange: false
|
|
2931
|
+
});
|
|
2932
|
+
return;
|
|
2933
|
+
}
|
|
2934
|
+
this.router.navigate([this.redirectPath]);
|
|
2935
|
+
}
|
|
2936
|
+
else {
|
|
2937
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
2938
|
+
this.user.password = "";
|
|
2939
|
+
}
|
|
2940
|
+
}, (error) => {
|
|
2941
|
+
this.isProcessing = false;
|
|
2942
|
+
this.messageService.toast(this.httpService.Error(error));
|
|
2943
|
+
});
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoginComponent, deps: [{ token: HttpService }, { token: StorageService }, { token: i1$3.Router }, { token: MessageService }, { token: DataServiceLib }, { token: AuthService }, { token: LogService }, { token: i1$3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
2947
|
+
LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LoginComponent, selector: "spa-login", ngImport: i0, template: "\r\n <div *ngIf=\"style=='old'\" class=\"tin-bg-login login-page\">\r\n\r\n <div *ngIf=\"appConfig.logo!=''\" class=\"d-flex justify-content-center row align-items-center\" style=\"margin-top:3em;margin-bottom:1em\">\r\n\r\n <img *ngIf=\"appConfig.logoSize=='normal'\" [src]=\"appConfig.logo\" style=\"width: 100px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"width: 150px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"width: 250px; margin-right:3em;margin-left:3em\" />\r\n\r\n </div>\r\n\r\n\r\n <div *ngIf=\"appConfig.logo ==''\" style=\"margin-top:2em\">\r\n <!-- Add margin top when there is no logo -->\r\n </div>\r\n\r\n\r\n <div class=\"d-flex justify-content-center row align-items-center\" style=\"margin-top:3em;\">\r\n\r\n <div class=\"d-none d-sm-block\">\r\n </div>\r\n\r\n <div style=\"margin-left:1em\">\r\n\r\n <mat-card class=\"mat-elevation-z3 login-card\" style=\"width:400px; \">\r\n\r\n <mat-card-header>\r\n <mat-card-title>{{appConfig.appName}}</mat-card-title>\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <div class=\"tin-input mt-2\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"user.userName\" ></spa-text>\r\n\r\n <mat-form-field >\r\n <mat-label>Password</mat-label>\r\n <input id=\"txtPassword\" matInput [type]=\"hide ? 'password' : 'text'\" (keyup.enter)=\"login()\" [(ngModel)]=\"user.password\" autocomplete=\"off\" >\r\n <button mat-icon-button matSuffix (click)=\"hide = !hide\" [attr.aria-label]=\"'Hide password'\" [attr.aria-pressed]=\"hide\">\r\n <mat-icon style=\"font-size: 18px;\">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"row \">\r\n\r\n <div class=\"col d-flex justify-content-center\">\r\n <button id=\"btnLogin\" mat-raised-button [disabled]=\"isProcessing\" style=\"width: 100px;\" (click)=\"login()\" color=\"primary\">Login</button>\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-center\" *ngIf=\"appConfig.selfService\">\r\n <button id=\"btnSignup\" mat-stroked-button color=\"primary\" style=\"width: 100px;\" (click)=\"signup()\">Signup</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n <div *ngIf=\"appConfig.selfService\">\r\n <br />\r\n <a mat-button id=\"lnkRecover\" style=\"margin-left: 1em\" (click)=\"recoverAccount()\">Forgot your password ?</a>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div *ngIf=\"style=='default'\" class=\"login-page background tin-bg-login\">\r\n\r\n <div class=\"container\" >\r\n\r\n <div class=\"logo\">\r\n <img *ngIf=\"appConfig.logoSize=='normal'\" [src]=\"appConfig.logo\" style=\"width: 100px\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"width: 150px\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"width: 250px\" />\r\n </div>\r\n\r\n <mat-card class=\"mat-elevation-z3 \" style=\"width:400px; \">\r\n\r\n <mat-card-header>\r\n <mat-card-title>{{appConfig.appName}}</mat-card-title>\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <div class=\"tin-input mt-2\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"user.userName\"></spa-text>\r\n\r\n <spa-text id=\"txtPassword\" display=\"Password\" format=\"password\" [(value)]=\"user.password\" (enterPress)=\"login()\"></spa-text>\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"buttons\">\r\n\r\n <button id=\"btnLogin\" mat-raised-button [disabled]=\"isProcessing\" style=\"width: 100px;\" (click)=\"login()\" color=\"primary\">Login</button>\r\n\r\n <button *ngIf=\"appConfig.selfService\" id=\"btnSignup\" mat-stroked-button color=\"primary\" style=\"width: 100px;\" (click)=\"signup()\">Signup</button>\r\n\r\n </div>\r\n\r\n\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n <a *ngIf=\"appConfig.selfService\" mat-button id=\"lnkRecover\" style=\"margin-top: 1em\" (click)=\"recoverAccount()\">Forgot your password ?</a>\r\n\r\n\r\n\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"style=='bs'\">\r\n\r\n <div class=\"container\">\r\n\r\n <div class=\"image\">\r\n <img class=\"mb-4\" src=\"c:\\Tinashe\\Code\\Angular\\Junk\\bs-examples\\assets\\brand\\bootstrap-logo.svg\" alt=\"\" width=\"72\" height=\"57\">\r\n </div>\r\n\r\n <div class=\"details\">\r\n <h1 class=\"h3 mb-3 fw-normal\" >Please sign in</h1>\r\n\r\n <div class=\"form-floating\">\r\n <input class=\"form-control\" id=\"floatingInput\" placeholder=\"name@example.com\" [(ngModel)]=\"user.userName\">\r\n <label for=\"floatingInput\">Username</label>\r\n </div>\r\n\r\n <div class=\"form-floating\">\r\n <input type=\"password\" class=\"form-control\" id=\"floatingPassword\" placeholder=\"Password\" [(ngModel)]=\"user.password\">\r\n <label for=\"floatingPassword\">Password</label>\r\n </div>\r\n\r\n <div class=\"form-check text-start my-3\">\r\n <input class=\"form-check-input\" type=\"checkbox\" value=\"remember-me\" id=\"flexCheckDefault\" >\r\n <label class=\"form-check-label\" for=\"flexCheckDefault\">\r\n Remember me\r\n </label>\r\n </div>\r\n\r\n <button class=\"btn btn-primary w-100 py-2\" (click)=\"login()\">Sign in</button>\r\n\r\n </div>\r\n\r\n <p class=\"mt-5 mb-3 text-body-secondary\">© 2017\u20132023</p>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n", styles: [".login-page{position:absolute;inset:0;overflow:auto}.background{min-height:100%}.container{display:flex;flex-direction:column;align-items:center;height:100vh}.logo{margin-top:3em;margin-bottom:1em}.buttons{display:flex;flex-direction:row;justify-content:space-evenly}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i14.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i14.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i14.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "directive", type: i14.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: i14.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }] });
|
|
2948
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoginComponent, decorators: [{
|
|
2949
|
+
type: Component,
|
|
2950
|
+
args: [{ selector: "spa-login", template: "\r\n <div *ngIf=\"style=='old'\" class=\"tin-bg-login login-page\">\r\n\r\n <div *ngIf=\"appConfig.logo!=''\" class=\"d-flex justify-content-center row align-items-center\" style=\"margin-top:3em;margin-bottom:1em\">\r\n\r\n <img *ngIf=\"appConfig.logoSize=='normal'\" [src]=\"appConfig.logo\" style=\"width: 100px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"width: 150px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"width: 250px; margin-right:3em;margin-left:3em\" />\r\n\r\n </div>\r\n\r\n\r\n <div *ngIf=\"appConfig.logo ==''\" style=\"margin-top:2em\">\r\n <!-- Add margin top when there is no logo -->\r\n </div>\r\n\r\n\r\n <div class=\"d-flex justify-content-center row align-items-center\" style=\"margin-top:3em;\">\r\n\r\n <div class=\"d-none d-sm-block\">\r\n </div>\r\n\r\n <div style=\"margin-left:1em\">\r\n\r\n <mat-card class=\"mat-elevation-z3 login-card\" style=\"width:400px; \">\r\n\r\n <mat-card-header>\r\n <mat-card-title>{{appConfig.appName}}</mat-card-title>\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <div class=\"tin-input mt-2\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"user.userName\" ></spa-text>\r\n\r\n <mat-form-field >\r\n <mat-label>Password</mat-label>\r\n <input id=\"txtPassword\" matInput [type]=\"hide ? 'password' : 'text'\" (keyup.enter)=\"login()\" [(ngModel)]=\"user.password\" autocomplete=\"off\" >\r\n <button mat-icon-button matSuffix (click)=\"hide = !hide\" [attr.aria-label]=\"'Hide password'\" [attr.aria-pressed]=\"hide\">\r\n <mat-icon style=\"font-size: 18px;\">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"row \">\r\n\r\n <div class=\"col d-flex justify-content-center\">\r\n <button id=\"btnLogin\" mat-raised-button [disabled]=\"isProcessing\" style=\"width: 100px;\" (click)=\"login()\" color=\"primary\">Login</button>\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-center\" *ngIf=\"appConfig.selfService\">\r\n <button id=\"btnSignup\" mat-stroked-button color=\"primary\" style=\"width: 100px;\" (click)=\"signup()\">Signup</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n <div *ngIf=\"appConfig.selfService\">\r\n <br />\r\n <a mat-button id=\"lnkRecover\" style=\"margin-left: 1em\" (click)=\"recoverAccount()\">Forgot your password ?</a>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div *ngIf=\"style=='default'\" class=\"login-page background tin-bg-login\">\r\n\r\n <div class=\"container\" >\r\n\r\n <div class=\"logo\">\r\n <img *ngIf=\"appConfig.logoSize=='normal'\" [src]=\"appConfig.logo\" style=\"width: 100px\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"width: 150px\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"width: 250px\" />\r\n </div>\r\n\r\n <mat-card class=\"mat-elevation-z3 \" style=\"width:400px; \">\r\n\r\n <mat-card-header>\r\n <mat-card-title>{{appConfig.appName}}</mat-card-title>\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <div class=\"tin-input mt-2\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"user.userName\"></spa-text>\r\n\r\n <spa-text id=\"txtPassword\" display=\"Password\" format=\"password\" [(value)]=\"user.password\" (enterPress)=\"login()\"></spa-text>\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"buttons\">\r\n\r\n <button id=\"btnLogin\" mat-raised-button [disabled]=\"isProcessing\" style=\"width: 100px;\" (click)=\"login()\" color=\"primary\">Login</button>\r\n\r\n <button *ngIf=\"appConfig.selfService\" id=\"btnSignup\" mat-stroked-button color=\"primary\" style=\"width: 100px;\" (click)=\"signup()\">Signup</button>\r\n\r\n </div>\r\n\r\n\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n <a *ngIf=\"appConfig.selfService\" mat-button id=\"lnkRecover\" style=\"margin-top: 1em\" (click)=\"recoverAccount()\">Forgot your password ?</a>\r\n\r\n\r\n\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"style=='bs'\">\r\n\r\n <div class=\"container\">\r\n\r\n <div class=\"image\">\r\n <img class=\"mb-4\" src=\"c:\\Tinashe\\Code\\Angular\\Junk\\bs-examples\\assets\\brand\\bootstrap-logo.svg\" alt=\"\" width=\"72\" height=\"57\">\r\n </div>\r\n\r\n <div class=\"details\">\r\n <h1 class=\"h3 mb-3 fw-normal\" >Please sign in</h1>\r\n\r\n <div class=\"form-floating\">\r\n <input class=\"form-control\" id=\"floatingInput\" placeholder=\"name@example.com\" [(ngModel)]=\"user.userName\">\r\n <label for=\"floatingInput\">Username</label>\r\n </div>\r\n\r\n <div class=\"form-floating\">\r\n <input type=\"password\" class=\"form-control\" id=\"floatingPassword\" placeholder=\"Password\" [(ngModel)]=\"user.password\">\r\n <label for=\"floatingPassword\">Password</label>\r\n </div>\r\n\r\n <div class=\"form-check text-start my-3\">\r\n <input class=\"form-check-input\" type=\"checkbox\" value=\"remember-me\" id=\"flexCheckDefault\" >\r\n <label class=\"form-check-label\" for=\"flexCheckDefault\">\r\n Remember me\r\n </label>\r\n </div>\r\n\r\n <button class=\"btn btn-primary w-100 py-2\" (click)=\"login()\">Sign in</button>\r\n\r\n </div>\r\n\r\n <p class=\"mt-5 mb-3 text-body-secondary\">© 2017\u20132023</p>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n", styles: [".login-page{position:absolute;inset:0;overflow:auto}.background{min-height:100%}.container{display:flex;flex-direction:column;align-items:center;height:100vh}.logo{margin-top:3em;margin-bottom:1em}.buttons{display:flex;flex-direction:row;justify-content:space-evenly}\n"] }]
|
|
2951
|
+
}], ctorParameters: function () { return [{ type: HttpService }, { type: StorageService }, { type: i1$3.Router }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: LogService }, { type: i1$3.ActivatedRoute }]; } });
|
|
2952
|
+
|
|
2953
|
+
class SignupComponent {
|
|
2954
|
+
constructor(httpService, messageService, dataService, authService) {
|
|
2955
|
+
this.httpService = httpService;
|
|
2956
|
+
this.messageService = messageService;
|
|
2957
|
+
this.dataService = dataService;
|
|
2958
|
+
this.authService = authService;
|
|
2959
|
+
this.isProcessing = false;
|
|
2960
|
+
this.user = new User();
|
|
2961
|
+
this.profile = new Profile();
|
|
2962
|
+
this.account = new Account();
|
|
2963
|
+
}
|
|
2964
|
+
ngOnInit() {
|
|
2965
|
+
this.account.user = this.user;
|
|
2966
|
+
this.account.profile = this.profile;
|
|
2967
|
+
}
|
|
2968
|
+
create() {
|
|
2969
|
+
this.profile.userName = this.user.userName;
|
|
2970
|
+
this.isProcessing = true;
|
|
2971
|
+
this.dataService.RegisterAccount(this.account).subscribe((apiResponse) => {
|
|
2972
|
+
this.isProcessing = false;
|
|
2973
|
+
if (apiResponse.message == "success") {
|
|
2974
|
+
this.messageService.toast("Account Created");
|
|
2975
|
+
this.user = new User();
|
|
2976
|
+
this.profile = new Profile();
|
|
2977
|
+
}
|
|
2978
|
+
else {
|
|
2979
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
2980
|
+
}
|
|
2981
|
+
}, (error) => {
|
|
2982
|
+
this.isProcessing = false;
|
|
2983
|
+
this.messageService.toast(this.httpService.Error(error));
|
|
2984
|
+
});
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
SignupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SignupComponent, deps: [{ token: HttpService }, { token: MessageService }, { token: DataServiceLib }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2988
|
+
SignupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SignupComponent, selector: "spa-signup", ngImport: i0, template: "\r\n<h4 style=\"padding-top: 30px;\">Signup</h4>\r\n\r\n<hr/>\r\nComplete the form below.\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <spa-text display=\"FirstName\" [(value)]=\"account.profile.firstName\" ></spa-text>\r\n\r\n <spa-text display=\"LastName\" [(value)]=\"account.profile.lastName\" ></spa-text>\r\n\r\n <spa-text display=\"Username\" [(value)]=\"account.profile.userName\"></spa-text>\r\n\r\n \r\n\r\n <spa-text display=\"Password\" [(value)]=\"account.profile.password\" format=\"password\" ></spa-text>\r\n\r\n <spa-text display=\"Confirm Password\" [(value)]=\"confirmPassword\" format=\"password\" ></spa-text>\r\n\r\n <div class=\"span-col-center\">\r\n <button mat-raised-button color=\"primary\" (click)=\"create()\" cdkFocusInitial>Create</button>\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }] });
|
|
2989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SignupComponent, decorators: [{
|
|
2990
|
+
type: Component,
|
|
2991
|
+
args: [{ selector: 'spa-signup', template: "\r\n<h4 style=\"padding-top: 30px;\">Signup</h4>\r\n\r\n<hr/>\r\nComplete the form below.\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <spa-text display=\"FirstName\" [(value)]=\"account.profile.firstName\" ></spa-text>\r\n\r\n <spa-text display=\"LastName\" [(value)]=\"account.profile.lastName\" ></spa-text>\r\n\r\n <spa-text display=\"Username\" [(value)]=\"account.profile.userName\"></spa-text>\r\n\r\n \r\n\r\n <spa-text display=\"Password\" [(value)]=\"account.profile.password\" format=\"password\" ></spa-text>\r\n\r\n <spa-text display=\"Confirm Password\" [(value)]=\"confirmPassword\" format=\"password\" ></spa-text>\r\n\r\n <div class=\"span-col-center\">\r\n <button mat-raised-button color=\"primary\" (click)=\"create()\" cdkFocusInitial>Create</button>\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n" }]
|
|
2992
|
+
}], ctorParameters: function () { return [{ type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }]; } });
|
|
2993
|
+
|
|
2994
|
+
class RecoverAccountComponent {
|
|
2995
|
+
constructor(location, dataService, authService, messageService) {
|
|
2996
|
+
this.location = location;
|
|
2997
|
+
this.dataService = dataService;
|
|
2998
|
+
this.authService = authService;
|
|
2999
|
+
this.messageService = messageService;
|
|
3000
|
+
this.userName = "";
|
|
3001
|
+
}
|
|
3002
|
+
ngOnInit() {
|
|
3003
|
+
}
|
|
3004
|
+
recover() {
|
|
3005
|
+
if (this.userName == "") {
|
|
3006
|
+
this.messageService.toast("Please enter your userName");
|
|
3007
|
+
return;
|
|
3008
|
+
}
|
|
3009
|
+
else {
|
|
3010
|
+
let u = new User();
|
|
3011
|
+
u.userName = this.userName;
|
|
3012
|
+
this.dataService.SelfReset(u).subscribe((apiResponse) => {
|
|
3013
|
+
if (apiResponse.message == "success") {
|
|
3014
|
+
this.messageService.toast("The password has been sent to your email");
|
|
3015
|
+
this.location.back();
|
|
3016
|
+
}
|
|
3017
|
+
else {
|
|
3018
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3019
|
+
}
|
|
3020
|
+
});
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
RecoverAccountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RecoverAccountComponent, deps: [{ token: i1.Location }, { token: DataServiceLib }, { token: AuthService }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3025
|
+
RecoverAccountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: RecoverAccountComponent, selector: "spa-recover-account", ngImport: i0, template: "\r\n<div class=\"container\" style=\"padding-top: 30px;\">\r\n<h4>Recover Account</h4>\r\n\r\n<hr />\r\n\r\nSubmit your Username and we will send you details to your registered email address.\r\n\r\n<div style=\"font-size: 14px;\">\r\n <spa-text class=\"mt-3\" display=\"Username\" [(value)]=\"userName\"></spa-text>\r\n\r\n <div class=\"tin-center\">\r\n <button class=\"mt-3 w-50\" mat-raised-button color=\"primary\" (click)=\"recover()\" cdkFocusInitial>Submit</button>\r\n </div>\r\n\r\n</div>\r\n\r\n</div>\r\n\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }] });
|
|
3026
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RecoverAccountComponent, decorators: [{
|
|
3027
|
+
type: Component,
|
|
3028
|
+
args: [{ selector: 'spa-recover-account', template: "\r\n<div class=\"container\" style=\"padding-top: 30px;\">\r\n<h4>Recover Account</h4>\r\n\r\n<hr />\r\n\r\nSubmit your Username and we will send you details to your registered email address.\r\n\r\n<div style=\"font-size: 14px;\">\r\n <spa-text class=\"mt-3\" display=\"Username\" [(value)]=\"userName\"></spa-text>\r\n\r\n <div class=\"tin-center\">\r\n <button class=\"mt-3 w-50\" mat-raised-button color=\"primary\" (click)=\"recover()\" cdkFocusInitial>Submit</button>\r\n </div>\r\n\r\n</div>\r\n\r\n</div>\r\n\r\n" }]
|
|
3029
|
+
}], ctorParameters: function () { return [{ type: i1.Location }, { type: DataServiceLib }, { type: AuthService }, { type: MessageService }]; } });
|
|
3030
|
+
|
|
3031
|
+
class SpaIndexModule {
|
|
3032
|
+
}
|
|
3033
|
+
SpaIndexModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3034
|
+
SpaIndexModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, declarations: [LoginComponent, SignupComponent, RecoverAccountComponent], imports: [i2.ReactiveFormsModule, CommonModule,
|
|
3035
|
+
FormsModule,
|
|
3036
|
+
ReactiveFormsModule,
|
|
3037
|
+
// SpaMatModule,
|
|
3038
|
+
TinSpaModule], exports: [CommonModule,
|
|
3039
|
+
FormsModule,
|
|
3040
|
+
// SpaMatModule,
|
|
3041
|
+
LoginComponent,
|
|
3042
|
+
SignupComponent,
|
|
3043
|
+
RecoverAccountComponent] });
|
|
3044
|
+
SpaIndexModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
|
|
3045
|
+
CommonModule,
|
|
3046
|
+
FormsModule,
|
|
3047
|
+
ReactiveFormsModule,
|
|
3048
|
+
// SpaMatModule,
|
|
3049
|
+
TinSpaModule, CommonModule,
|
|
3050
|
+
FormsModule] });
|
|
3051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, decorators: [{
|
|
3052
|
+
type: NgModule,
|
|
3053
|
+
args: [{
|
|
3054
|
+
declarations: [LoginComponent, SignupComponent, RecoverAccountComponent],
|
|
3055
|
+
imports: [
|
|
3056
|
+
ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
|
|
3057
|
+
CommonModule,
|
|
3058
|
+
FormsModule,
|
|
3059
|
+
ReactiveFormsModule,
|
|
3060
|
+
// SpaMatModule,
|
|
3061
|
+
TinSpaModule
|
|
3062
|
+
],
|
|
3063
|
+
exports: [
|
|
3064
|
+
CommonModule,
|
|
3065
|
+
FormsModule,
|
|
3066
|
+
// SpaMatModule,
|
|
3067
|
+
LoginComponent,
|
|
3068
|
+
SignupComponent,
|
|
3069
|
+
RecoverAccountComponent,
|
|
3070
|
+
],
|
|
3071
|
+
}]
|
|
3072
|
+
}] });
|
|
3073
|
+
|
|
3074
|
+
class ChangePasswordComponent {
|
|
3075
|
+
constructor(router, location, httpService, messageService, dataService, authService, route) {
|
|
3076
|
+
this.router = router;
|
|
3077
|
+
this.location = location;
|
|
3078
|
+
this.httpService = httpService;
|
|
3079
|
+
this.messageService = messageService;
|
|
3080
|
+
this.dataService = dataService;
|
|
3081
|
+
this.authService = authService;
|
|
3082
|
+
this.route = route;
|
|
3083
|
+
this.isProcessing = false;
|
|
3084
|
+
this.changePassword = new ChangeUserPassword();
|
|
3085
|
+
}
|
|
3086
|
+
ngOnInit() {
|
|
3087
|
+
this.myRole = this.authService.currentRoleSource.value;
|
|
3088
|
+
if (this.dataService.tmpProfileuserName == "") {
|
|
3089
|
+
this.changePassword.userName = this.authService.currentUser;
|
|
3090
|
+
}
|
|
3091
|
+
else {
|
|
3092
|
+
this.changePassword.userName = this.dataService.tmpProfileuserName;
|
|
3093
|
+
this.dataService.tmpProfileuserName = "";
|
|
3094
|
+
}
|
|
3095
|
+
if (this.route.snapshot.queryParams["redirectTo"] != undefined) {
|
|
3096
|
+
this.redirectPath = this.route.snapshot.queryParams["redirectTo"];
|
|
3097
|
+
}
|
|
3098
|
+
else {
|
|
3099
|
+
this.redirectPath = "home";
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
change() {
|
|
3103
|
+
if (!this.myRole[this.dataService.capUsers.name]) {
|
|
3104
|
+
if (this.changePassword.currentPassword == "") {
|
|
3105
|
+
this.messageService.toast("Please enter current Password");
|
|
3106
|
+
return;
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
if (this.changePassword.newPassword == "") {
|
|
3110
|
+
this.messageService.toast("Please enter new Password");
|
|
3111
|
+
return;
|
|
3112
|
+
}
|
|
3113
|
+
if (this.changePassword.confirmPassword == "") {
|
|
3114
|
+
this.messageService.toast("Please confirm new Password");
|
|
3115
|
+
return;
|
|
3116
|
+
}
|
|
3117
|
+
if (this.changePassword.confirmPassword != this.changePassword.newPassword) {
|
|
3118
|
+
this.messageService.toast("Passwords do not match");
|
|
3119
|
+
return;
|
|
3120
|
+
}
|
|
3121
|
+
this.isProcessing = true;
|
|
3122
|
+
if (this.myRole[this.dataService.capUsers.name]) {
|
|
3123
|
+
this.dataService.ChangePasswordAdmin(this.changePassword).subscribe((apiResponse) => {
|
|
3124
|
+
this.isProcessing = false;
|
|
3125
|
+
if (apiResponse.message == "success") {
|
|
3126
|
+
this.messageService.toast("Password Changed");
|
|
3127
|
+
this.router.navigate([this.redirectPath]);
|
|
3128
|
+
}
|
|
3129
|
+
else {
|
|
3130
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3131
|
+
}
|
|
3132
|
+
});
|
|
3133
|
+
}
|
|
3134
|
+
else {
|
|
3135
|
+
this.dataService.ChangePassword(this.changePassword).subscribe((apiResponse) => {
|
|
3136
|
+
this.isProcessing = false;
|
|
3137
|
+
if (apiResponse.message == "success") {
|
|
3138
|
+
this.messageService.toast("Password Changed");
|
|
3139
|
+
this.router.navigate([this.redirectPath]);
|
|
3140
|
+
}
|
|
3141
|
+
else {
|
|
3142
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3143
|
+
}
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3147
|
+
}
|
|
3148
|
+
ChangePasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChangePasswordComponent, deps: [{ token: i1$3.Router }, { token: i1.Location }, { token: HttpService }, { token: MessageService }, { token: DataServiceLib }, { token: AuthService }, { token: i1$3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
3149
|
+
ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChangePasswordComponent, selector: "spa-change-password", ngImport: i0, template: "<h4>Change Password</h4>\r\n<hr>\r\n\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <div class=\"fill\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"changePassword.userName\" [readonly]=\"true\"></spa-text>\r\n <spa-text id=\"txtPassword\" display=\"Current Password\" [(value)]=\"changePassword.currentPassword\" type=\"password\"></spa-text>\r\n <spa-text id=\"txtNewPassword\" display=\"New Password\" [(value)]=\"changePassword.newPassword\" type=\"password\"></spa-text>\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"changePassword.confirmPassword\" type=\"password\"></spa-text>\r\n <button id=\"btnChange\" mat-raised-button color=\"primary\" (click)=\"change()\" cdkFocusInitial>Change</button>\r\n\r\n </div>\r\n\r\n <div class=\"alert alert-info\" style=\"font-size: 14px;\" role=\"alert\">\r\n <b>*Please consider these requirements for your new password.</b> <br><br>\r\n\r\n At least 8 characters<br>\r\n At least 1 uppercase letter (A-Z)<br>\r\n At least 2 lowercase letters (a-z)<br>\r\n At least 1 digit (0-9)<br>\r\n At least 1 special character (~`! \u2026)<br>\r\n\r\n </div>\r\n\r\n</div>\r\n\r\n\r\n<!-- <div class=\"container\">\r\n\r\n <div class=\"d-flex justify-content-center row align-items-center\" >\r\n\r\n <div class=\"col\">\r\n\r\n <div class=\"tin-input \" style=\"font-size:14px;\">\r\n\r\n <div class=\"col\" *ngIf=\"changePassword.userName!=''\">\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"changePassword.userName\" width=\"300px\" [readonly]=\"true\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\" *ngIf=\"!myRole[dataService.capUsers.name]\">\r\n <spa-text id=\"txtPassword\" display=\"Current Password\" [(value)]=\"changePassword.currentPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtNewPassword\" display=\"New Password\" [(value)]=\"changePassword.newPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"changePassword.confirmPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col mt-3\">\r\n <button id=\"btnChange\" mat-raised-button color=\"primary\" (click)=\"change()\" cdkFocusInitial>Change</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"col\">\r\n\r\n <div class=\"alert alert-info\" style=\"font-size: 14px;\" role=\"alert\">\r\n <b>*Please consider these requirements for your new password.</b> <br><br>\r\n\r\n At least 8 characters<br>\r\n At least 1 uppercase letter (A-Z)<br>\r\n At least 2 lowercase letters (a-z)<br>\r\n At least 1 digit (0-9)<br>\r\n At least 1 special character (~`! \u2026)<br>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div> -->\r\n\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }] });
|
|
3150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChangePasswordComponent, decorators: [{
|
|
3151
|
+
type: Component,
|
|
3152
|
+
args: [{ selector: 'spa-change-password', template: "<h4>Change Password</h4>\r\n<hr>\r\n\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <div class=\"fill\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"changePassword.userName\" [readonly]=\"true\"></spa-text>\r\n <spa-text id=\"txtPassword\" display=\"Current Password\" [(value)]=\"changePassword.currentPassword\" type=\"password\"></spa-text>\r\n <spa-text id=\"txtNewPassword\" display=\"New Password\" [(value)]=\"changePassword.newPassword\" type=\"password\"></spa-text>\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"changePassword.confirmPassword\" type=\"password\"></spa-text>\r\n <button id=\"btnChange\" mat-raised-button color=\"primary\" (click)=\"change()\" cdkFocusInitial>Change</button>\r\n\r\n </div>\r\n\r\n <div class=\"alert alert-info\" style=\"font-size: 14px;\" role=\"alert\">\r\n <b>*Please consider these requirements for your new password.</b> <br><br>\r\n\r\n At least 8 characters<br>\r\n At least 1 uppercase letter (A-Z)<br>\r\n At least 2 lowercase letters (a-z)<br>\r\n At least 1 digit (0-9)<br>\r\n At least 1 special character (~`! \u2026)<br>\r\n\r\n </div>\r\n\r\n</div>\r\n\r\n\r\n<!-- <div class=\"container\">\r\n\r\n <div class=\"d-flex justify-content-center row align-items-center\" >\r\n\r\n <div class=\"col\">\r\n\r\n <div class=\"tin-input \" style=\"font-size:14px;\">\r\n\r\n <div class=\"col\" *ngIf=\"changePassword.userName!=''\">\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"changePassword.userName\" width=\"300px\" [readonly]=\"true\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\" *ngIf=\"!myRole[dataService.capUsers.name]\">\r\n <spa-text id=\"txtPassword\" display=\"Current Password\" [(value)]=\"changePassword.currentPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtNewPassword\" display=\"New Password\" [(value)]=\"changePassword.newPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"changePassword.confirmPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col mt-3\">\r\n <button id=\"btnChange\" mat-raised-button color=\"primary\" (click)=\"change()\" cdkFocusInitial>Change</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"col\">\r\n\r\n <div class=\"alert alert-info\" style=\"font-size: 14px;\" role=\"alert\">\r\n <b>*Please consider these requirements for your new password.</b> <br><br>\r\n\r\n At least 8 characters<br>\r\n At least 1 uppercase letter (A-Z)<br>\r\n At least 2 lowercase letters (a-z)<br>\r\n At least 1 digit (0-9)<br>\r\n At least 1 special character (~`! \u2026)<br>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div> -->\r\n\r\n" }]
|
|
3153
|
+
}], ctorParameters: function () { return [{ type: i1$3.Router }, { type: i1.Location }, { type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i1$3.ActivatedRoute }]; } });
|
|
3154
|
+
|
|
3155
|
+
class ProfileComponent {
|
|
3156
|
+
constructor(dataService, messageService, httpService, router, authService) {
|
|
3157
|
+
this.dataService = dataService;
|
|
3158
|
+
this.messageService = messageService;
|
|
3159
|
+
this.httpService = httpService;
|
|
3160
|
+
this.router = router;
|
|
3161
|
+
this.authService = authService;
|
|
3162
|
+
this.initials = "";
|
|
3163
|
+
this.appConfig = new AppConfig();
|
|
3164
|
+
this.selfProfile = false;
|
|
3165
|
+
}
|
|
3166
|
+
ngOnInit() {
|
|
3167
|
+
this.myRole = this.authService.currentRoleSource.value;
|
|
3168
|
+
if (this.dataService.tmpProfileuserName == "") {
|
|
3169
|
+
this.loadProfile(this.authService.currentUser);
|
|
3170
|
+
}
|
|
3171
|
+
else {
|
|
3172
|
+
this.loadProfile(this.dataService.tmpProfileuserName);
|
|
3173
|
+
this.dataService.tmpProfileuserName = "";
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
loadProfile(userName) {
|
|
3177
|
+
let action = "all";
|
|
3178
|
+
this.dataService.GetUserByID(userName).subscribe((apiResponse) => {
|
|
3179
|
+
this.profile = apiResponse[0];
|
|
3180
|
+
if (this.profile.userName.toLocaleLowerCase() == this.authService.currentUser.toLocaleLowerCase()) {
|
|
3181
|
+
this.selfProfile = true;
|
|
3182
|
+
}
|
|
3183
|
+
this.loadRoles();
|
|
3184
|
+
this.initials = `${this.profile.firstName?.toUpperCase().charAt(0)}${this.profile.lastName?.toUpperCase().charAt(0)}`;
|
|
3185
|
+
}, (error) => {
|
|
3186
|
+
this.isProcessing = false;
|
|
3187
|
+
this.messageService.toast(this.httpService.Error(error));
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3190
|
+
loadRoles() {
|
|
3191
|
+
this.dataService.GetRole("all", "").subscribe((apiResponse) => {
|
|
3192
|
+
this.roles = apiResponse;
|
|
3193
|
+
console.log(this.roles);
|
|
3194
|
+
}, (error) => {
|
|
3195
|
+
this.isProcessing = false;
|
|
3196
|
+
this.messageService.toast(this.httpService.Error(error));
|
|
3197
|
+
});
|
|
3198
|
+
}
|
|
3199
|
+
changePassword() {
|
|
3200
|
+
this.dataService.tmpProfileuserName = this.profile.userName;
|
|
3201
|
+
this.router.navigate(["home/user/change-password"]);
|
|
3202
|
+
}
|
|
3203
|
+
gotoUsers() {
|
|
3204
|
+
this.router.navigate(["home/admin/users"]);
|
|
3205
|
+
}
|
|
3206
|
+
update() {
|
|
3207
|
+
}
|
|
3208
|
+
updateProfile() {
|
|
3209
|
+
this.isProcessing = true;
|
|
3210
|
+
// console.log(this.profile)
|
|
3211
|
+
// return
|
|
3212
|
+
this.dataService.UpdateUser(this.profile).subscribe((apiResponse) => {
|
|
3213
|
+
this.isProcessing = false;
|
|
3214
|
+
if (apiResponse.success) {
|
|
3215
|
+
this.messageService.toast("Profile Updated");
|
|
3216
|
+
}
|
|
3217
|
+
else {
|
|
3218
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3219
|
+
}
|
|
3220
|
+
}, (error) => {
|
|
3221
|
+
this.messageService.toast("Connection failed ");
|
|
3222
|
+
this.isProcessing = false;
|
|
3223
|
+
});
|
|
3224
|
+
}
|
|
3225
|
+
}
|
|
3226
|
+
ProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileComponent, deps: [{ token: DataServiceLib }, { token: MessageService }, { token: HttpService }, { token: i1$3.Router }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3227
|
+
ProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ProfileComponent, selector: "spa-profile", inputs: { appConfig: "appConfig" }, ngImport: i0, template: "\r\n<h4>Profile</h4>\r\n<hr>\r\n\r\n<div class=\"container tin-grid-auto\" style=\"font-size:14px;\">\r\n\r\n <div class=\"tin-center centa\">\r\n <div class=\"profileImage\">{{initials}}</div>\r\n <mat-label id=\"lbluserName\" >{{profile?.userName}}</mat-label>\r\n </div>\r\n\r\n <div>\r\n\r\n <spa-text id=\"txtFirstName\" display=\"First Name\" [(value)]=\"profile.firstName\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-text id=\"txtLastName\" display=\"Last Name\" [(value)]=\"profile.lastName\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-text id=\"txtAuth\" display=\"Authentication\" [(value)]=\"profile.authType\" [readonly]=\"true\"></spa-text>\r\n <spa-text id=\"txtEmail\" display=\"Email\" [(value)]=\"profile.email\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-select id=\"cboRole\" display=\"Role\" [options]=\"roles\" optionDisplay=\"roleName\" optionValue=\"roleID\" [(value)]=\"profile.roleID\" [readonly]=\"selfProfile\"></spa-select>\r\n\r\n <button id=\"btnUpdate\" class=\"w-100\" mat-raised-button color=\"primary\" *ngIf=\"!selfProfile\" [disabled]=\"isProcessing\" (click)=\"updateProfile()\">Update Profile</button>\r\n </div>\r\n\r\n\r\n <div class=\"tin-center centa\">\r\n <a mat-button id=\"lnkUserManager\" style=\"margin-left: 1em\" *ngIf=\"!selfProfile\" (click)=\"gotoUsers()\">User Manager</a>\r\n <a mat-button id=\"lnkChangePassword\" style=\"margin-left: 1em\" *ngIf=\"(selfProfile || myRole[dataService.capUsers.name]) && profile.authType=='local'\" (click)=\"changePassword()\">Change Password</a>\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n", styles: [".centa{display:flex;flex-direction:column}.profileImage{width:150px;height:150px;border-radius:50%;background:#512DA8;font-size:50px;color:#fff;text-align:center;line-height:150px;margin:20px 0 0}#lbluserName{font-size:20px;font-style:italic}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }, { kind: "component", type: SelectComponent, selector: "spa-select", inputs: ["width", "readonly", "readonlyMode", "hint", "placeholder", "multiple", "display", "value", "options", "optionValue", "optionDisplay", "optionDisplayExtra"], outputs: ["valueChange"] }] });
|
|
3228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileComponent, decorators: [{
|
|
3229
|
+
type: Component,
|
|
3230
|
+
args: [{ selector: 'spa-profile', template: "\r\n<h4>Profile</h4>\r\n<hr>\r\n\r\n<div class=\"container tin-grid-auto\" style=\"font-size:14px;\">\r\n\r\n <div class=\"tin-center centa\">\r\n <div class=\"profileImage\">{{initials}}</div>\r\n <mat-label id=\"lbluserName\" >{{profile?.userName}}</mat-label>\r\n </div>\r\n\r\n <div>\r\n\r\n <spa-text id=\"txtFirstName\" display=\"First Name\" [(value)]=\"profile.firstName\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-text id=\"txtLastName\" display=\"Last Name\" [(value)]=\"profile.lastName\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-text id=\"txtAuth\" display=\"Authentication\" [(value)]=\"profile.authType\" [readonly]=\"true\"></spa-text>\r\n <spa-text id=\"txtEmail\" display=\"Email\" [(value)]=\"profile.email\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-select id=\"cboRole\" display=\"Role\" [options]=\"roles\" optionDisplay=\"roleName\" optionValue=\"roleID\" [(value)]=\"profile.roleID\" [readonly]=\"selfProfile\"></spa-select>\r\n\r\n <button id=\"btnUpdate\" class=\"w-100\" mat-raised-button color=\"primary\" *ngIf=\"!selfProfile\" [disabled]=\"isProcessing\" (click)=\"updateProfile()\">Update Profile</button>\r\n </div>\r\n\r\n\r\n <div class=\"tin-center centa\">\r\n <a mat-button id=\"lnkUserManager\" style=\"margin-left: 1em\" *ngIf=\"!selfProfile\" (click)=\"gotoUsers()\">User Manager</a>\r\n <a mat-button id=\"lnkChangePassword\" style=\"margin-left: 1em\" *ngIf=\"(selfProfile || myRole[dataService.capUsers.name]) && profile.authType=='local'\" (click)=\"changePassword()\">Change Password</a>\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n", styles: [".centa{display:flex;flex-direction:column}.profileImage{width:150px;height:150px;border-radius:50%;background:#512DA8;font-size:50px;color:#fff;text-align:center;line-height:150px;margin:20px 0 0}#lbluserName{font-size:20px;font-style:italic}\n"] }]
|
|
3231
|
+
}], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }, { type: HttpService }, { type: i1$3.Router }, { type: AuthService }]; }, propDecorators: { appConfig: [{
|
|
3232
|
+
type: Input
|
|
3233
|
+
}] } });
|
|
3234
|
+
|
|
3235
|
+
class SpaUserModule {
|
|
3236
|
+
}
|
|
3237
|
+
SpaUserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3238
|
+
SpaUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, declarations: [ChangePasswordComponent, ProfileComponent], imports: [i2.ReactiveFormsModule, CommonModule,
|
|
3239
|
+
FormsModule,
|
|
3240
|
+
ReactiveFormsModule,
|
|
3241
|
+
// SpaMatModule,
|
|
3242
|
+
TinSpaModule], exports: [CommonModule,
|
|
3243
|
+
FormsModule,
|
|
3244
|
+
// SpaMatModule,
|
|
3245
|
+
ChangePasswordComponent,
|
|
3246
|
+
ProfileComponent] });
|
|
3247
|
+
SpaUserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
|
|
3248
|
+
CommonModule,
|
|
3249
|
+
FormsModule,
|
|
3250
|
+
ReactiveFormsModule,
|
|
3251
|
+
// SpaMatModule,
|
|
3252
|
+
TinSpaModule, CommonModule,
|
|
3253
|
+
FormsModule] });
|
|
3254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, decorators: [{
|
|
3255
|
+
type: NgModule,
|
|
3256
|
+
args: [{
|
|
3257
|
+
declarations: [ChangePasswordComponent, ProfileComponent],
|
|
3258
|
+
imports: [
|
|
3259
|
+
ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
|
|
3260
|
+
CommonModule,
|
|
3261
|
+
FormsModule,
|
|
3262
|
+
ReactiveFormsModule,
|
|
3263
|
+
// SpaMatModule,
|
|
3264
|
+
TinSpaModule
|
|
3265
|
+
],
|
|
3266
|
+
exports: [
|
|
3267
|
+
CommonModule,
|
|
3268
|
+
FormsModule,
|
|
3269
|
+
// SpaMatModule,
|
|
3270
|
+
ChangePasswordComponent,
|
|
3271
|
+
ProfileComponent,
|
|
3272
|
+
],
|
|
3273
|
+
}]
|
|
3274
|
+
}] });
|
|
3275
|
+
|
|
3276
|
+
// import { ApiResponse } from 'tin-core';
|
|
3277
|
+
class SettingsComponent {
|
|
3278
|
+
constructor(dataService, messageService) {
|
|
3279
|
+
this.dataService = dataService;
|
|
3280
|
+
this.messageService = messageService;
|
|
3281
|
+
this._filterText = "";
|
|
3282
|
+
this.isProcessing = false;
|
|
3283
|
+
}
|
|
3284
|
+
ngOnInit() {
|
|
3285
|
+
this.loadSettings();
|
|
3286
|
+
}
|
|
3287
|
+
applyFilter(filterValue) {
|
|
3288
|
+
this.settings.filter = filterValue.trim().toLowerCase();
|
|
3289
|
+
}
|
|
3290
|
+
loadSettings() {
|
|
3291
|
+
this.dataService.GetSetting("all", "").subscribe((apiResponse) => {
|
|
3292
|
+
this.settings = apiResponse;
|
|
3293
|
+
});
|
|
3294
|
+
}
|
|
3295
|
+
updateSetting(setting) {
|
|
3296
|
+
this.isProcessing = true;
|
|
3297
|
+
this.dataService.UpdateSetting(setting, "edit").subscribe((apiResponse) => {
|
|
3298
|
+
this.isProcessing = false;
|
|
3299
|
+
if (apiResponse.success) {
|
|
3300
|
+
this.messageService.toast(`Setting ${setting.sName} Updated`);
|
|
3301
|
+
this.loadSettings();
|
|
3302
|
+
}
|
|
3303
|
+
else {
|
|
3304
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3305
|
+
}
|
|
3306
|
+
});
|
|
3307
|
+
}
|
|
3308
|
+
;
|
|
3309
|
+
addSetting() {
|
|
3310
|
+
// const dialogRef = this.dialog.open(addRoleDialog, {
|
|
3311
|
+
// width: "1100px",
|
|
3312
|
+
// data: "",
|
|
3313
|
+
// });
|
|
3314
|
+
// dialogRef.afterClosed().subscribe((result) => {
|
|
3315
|
+
// if (result == "success") {
|
|
3316
|
+
// this.loadRoles();
|
|
3317
|
+
// }
|
|
3318
|
+
// });
|
|
3319
|
+
this.messageService.toast("Feature not Available");
|
|
3320
|
+
}
|
|
3321
|
+
}
|
|
3322
|
+
SettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SettingsComponent, deps: [{ token: DataServiceLib }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3323
|
+
SettingsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SettingsComponent, selector: "spa-settings", ngImport: i0, template: "<h4>Settings</h4>\r\n<hr>\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n\r\n <div class=\"col-2\">\r\n <!-- <button mat-raised-button (click)=\"addSetting()\">New Setting</button> -->\r\n </div>\r\n <div class=\"col-2\">\r\n <button mat-raised-button (click)=\"loadSettings()\">Refresh</button>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-1 mb-1\" style=\"margin-left:10px\" *ngFor=\"let setting of settings\">\r\n\r\n <mat-form-field style=\"width: 500px; font-size: 14px;\">\r\n <mat-label>{{setting.sName}}</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"setting.sValue\" >\r\n </mat-form-field>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateSetting(setting)\" style=\"margin-right:150px;\"><mat-icon>done_all</mat-icon></button>\r\n\r\n <mat-label style=\"font-size: small;\">Last Updated by {{setting.updatedBy}} on {{setting.updatedDate | date: 'dd MMM yy HH:mm'}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
3324
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SettingsComponent, decorators: [{
|
|
3325
|
+
type: Component,
|
|
3326
|
+
args: [{ selector: 'spa-settings', template: "<h4>Settings</h4>\r\n<hr>\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n\r\n <div class=\"col-2\">\r\n <!-- <button mat-raised-button (click)=\"addSetting()\">New Setting</button> -->\r\n </div>\r\n <div class=\"col-2\">\r\n <button mat-raised-button (click)=\"loadSettings()\">Refresh</button>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-1 mb-1\" style=\"margin-left:10px\" *ngFor=\"let setting of settings\">\r\n\r\n <mat-form-field style=\"width: 500px; font-size: 14px;\">\r\n <mat-label>{{setting.sName}}</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"setting.sValue\" >\r\n </mat-form-field>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateSetting(setting)\" style=\"margin-right:150px;\"><mat-icon>done_all</mat-icon></button>\r\n\r\n <mat-label style=\"font-size: small;\">Last Updated by {{setting.updatedBy}} on {{setting.updatedDate | date: 'dd MMM yy HH:mm'}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"] }]
|
|
3327
|
+
}], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }]; } });
|
|
3328
|
+
|
|
3329
|
+
class LogsComponent {
|
|
3330
|
+
constructor(authService, dataService) {
|
|
3331
|
+
this.authService = authService;
|
|
3332
|
+
this.dataService = dataService;
|
|
3333
|
+
this.isProcessing = false;
|
|
3334
|
+
this.displayedColumns = ["dateLogged", "userName", "fullName", "source", "details"];
|
|
3335
|
+
}
|
|
3336
|
+
ngOnInit() {
|
|
3337
|
+
this.authService.isAuthorised(this.dataService.capLogs.name);
|
|
3338
|
+
this.loadLogs();
|
|
3339
|
+
}
|
|
3340
|
+
loadLogs() {
|
|
3341
|
+
this.dataService.GetLog("all", "").subscribe((apiResponse) => {
|
|
3342
|
+
this.logs = new MatTableDataSource(apiResponse);
|
|
3343
|
+
this.logs.paginator = this.logsPaginator;
|
|
3344
|
+
});
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3347
|
+
LogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogsComponent, deps: [{ token: AuthService }, { token: DataServiceLib }], target: i0.ɵɵFactoryTarget.Component });
|
|
3348
|
+
LogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LogsComponent, selector: "spa-logs", viewQueries: [{ propertyName: "logsPaginator", first: true, predicate: ["logsPaginator"], descendants: true }], ngImport: i0, template: "<h4>Logs</h4>\r\n<hr />\r\n\r\n<div class=\"container-fluid\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n\r\n <div class=\"col-2\">\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <spa-filter [data]=\"logs\" (refreshClick)=\"loadLogs()\"></spa-filter>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n <p *ngIf=\"!logs\"><em>Loading...</em></p>\r\n\r\n\r\n <div class=\"mat-elevation-z8\" *ngIf=\"logs\">\r\n\r\n <table id=\"tblTable\" mat-table [dataSource]=\"logs\">\r\n\r\n\r\n <ng-container matColumnDef=\"userName\">\r\n <th mat-header-cell *matHeaderCellDef> User </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.userName}} </td>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"dateLogged\">\r\n <th mat-header-cell *matHeaderCellDef class=\"datetime\"> Date Logged </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.dateLogged | date: 'dd MMM yy HH:mm:ss'}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"source\">\r\n <th mat-header-cell *matHeaderCellDef> Source </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.source}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef> Details </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.details}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"fullName\">\r\n <th mat-header-cell *matHeaderCellDef> Name </th>\r\n <td mat-cell *matCellDef=\"let log\">{{log.user.firstName}} {{log.user.lastName}}</td>\r\n </ng-container>\r\n\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n\r\n\r\n </table>\r\n\r\n </div>\r\n\r\n <mat-paginator #logsPaginator [pageSizeOptions]=\"[50, 100, 200]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i6$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i7$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: FilterComponent, selector: "spa-filter", inputs: ["data"], outputs: ["refreshClick"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
3349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogsComponent, decorators: [{
|
|
3350
|
+
type: Component,
|
|
3351
|
+
args: [{ selector: 'spa-logs', template: "<h4>Logs</h4>\r\n<hr />\r\n\r\n<div class=\"container-fluid\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n\r\n <div class=\"col-2\">\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <spa-filter [data]=\"logs\" (refreshClick)=\"loadLogs()\"></spa-filter>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n <p *ngIf=\"!logs\"><em>Loading...</em></p>\r\n\r\n\r\n <div class=\"mat-elevation-z8\" *ngIf=\"logs\">\r\n\r\n <table id=\"tblTable\" mat-table [dataSource]=\"logs\">\r\n\r\n\r\n <ng-container matColumnDef=\"userName\">\r\n <th mat-header-cell *matHeaderCellDef> User </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.userName}} </td>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"dateLogged\">\r\n <th mat-header-cell *matHeaderCellDef class=\"datetime\"> Date Logged </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.dateLogged | date: 'dd MMM yy HH:mm:ss'}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"source\">\r\n <th mat-header-cell *matHeaderCellDef> Source </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.source}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef> Details </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.details}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"fullName\">\r\n <th mat-header-cell *matHeaderCellDef> Name </th>\r\n <td mat-cell *matCellDef=\"let log\">{{log.user.firstName}} {{log.user.lastName}}</td>\r\n </ng-container>\r\n\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n\r\n\r\n </table>\r\n\r\n </div>\r\n\r\n <mat-paginator #logsPaginator [pageSizeOptions]=\"[50, 100, 200]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
|
|
3352
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: DataServiceLib }]; }, propDecorators: { logsPaginator: [{
|
|
3353
|
+
type: ViewChild,
|
|
3354
|
+
args: ["logsPaginator"]
|
|
3355
|
+
}] } });
|
|
3356
|
+
|
|
3357
|
+
class UsersComponent {
|
|
3358
|
+
constructor(httpService, router, authService, dataService, dialog, messageService) {
|
|
3359
|
+
this.httpService = httpService;
|
|
3360
|
+
this.router = router;
|
|
3361
|
+
this.authService = authService;
|
|
3362
|
+
this.dataService = dataService;
|
|
3363
|
+
this.dialog = dialog;
|
|
3364
|
+
this.messageService = messageService;
|
|
3365
|
+
this.isProcessing = false;
|
|
3366
|
+
this._filterText = "";
|
|
3367
|
+
this.displayedColumns = ["userName", "fullName", "roleName", "locked", "dateCreated", "Action"];
|
|
3368
|
+
}
|
|
3369
|
+
ngOnInit() {
|
|
3370
|
+
this.authService.isAuthorised(this.dataService.capUsers.name);
|
|
3371
|
+
this.UpdateData();
|
|
3372
|
+
}
|
|
3373
|
+
UpdateData() {
|
|
3374
|
+
this.dataService.GetUser().subscribe((apiResponse) => {
|
|
3375
|
+
console.log(apiResponse);
|
|
3376
|
+
this.usersRaw = apiResponse;
|
|
3377
|
+
this.users = new MatTableDataSource(apiResponse);
|
|
3378
|
+
this.users.paginator = this.usersPaginator;
|
|
3379
|
+
this.applyFilter(this._filterText);
|
|
3380
|
+
}, (error) => {
|
|
3381
|
+
this.isProcessing = false;
|
|
3382
|
+
this.messageService.toast(this.httpService.Error(error));
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
applyFilter(filterValue) {
|
|
3386
|
+
this.users.filter = filterValue.trim().toLowerCase();
|
|
3387
|
+
}
|
|
3388
|
+
createAccount() {
|
|
3389
|
+
this.router.navigate(["home/admin/create-account"]);
|
|
3390
|
+
}
|
|
3391
|
+
viewProfile(user) {
|
|
3392
|
+
this.dataService.tmpProfileuserName = user.userName;
|
|
3393
|
+
this.router.navigate(["home/user/profile"]);
|
|
3394
|
+
}
|
|
3395
|
+
lock(u) {
|
|
3396
|
+
let login = { userName: u.userName, password: "Abcdef@123" };
|
|
3397
|
+
this.dataService.LockUser(login).subscribe((apiResponse) => {
|
|
3398
|
+
if (apiResponse.success) {
|
|
3399
|
+
this.messageService.toast("User Locked");
|
|
3400
|
+
this.UpdateData();
|
|
3401
|
+
}
|
|
3402
|
+
else {
|
|
3403
|
+
this.messageService.toast("Error: " + apiResponse);
|
|
3404
|
+
}
|
|
3405
|
+
});
|
|
3406
|
+
}
|
|
3407
|
+
unlock(u) {
|
|
3408
|
+
let login = { userName: u.userName, password: "Abcdef@123" };
|
|
3409
|
+
this.dataService.UnlockUser(login).subscribe((apiResponse) => {
|
|
3410
|
+
if (apiResponse.success) {
|
|
3411
|
+
this.messageService.toast("User Unlocked");
|
|
3412
|
+
this.UpdateData();
|
|
3413
|
+
}
|
|
3414
|
+
else {
|
|
3415
|
+
this.messageService.toast("Error: " + apiResponse);
|
|
3416
|
+
}
|
|
3417
|
+
});
|
|
3418
|
+
}
|
|
3419
|
+
recover(u) {
|
|
3420
|
+
this.dataService.SelfReset(u).subscribe((apiResponse) => {
|
|
3421
|
+
if (apiResponse.message == "success") {
|
|
3422
|
+
this.messageService.toast("The password has been sent on email");
|
|
3423
|
+
}
|
|
3424
|
+
else {
|
|
3425
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3426
|
+
}
|
|
3427
|
+
});
|
|
3428
|
+
}
|
|
3429
|
+
deleteUser(user) {
|
|
3430
|
+
this.messageService.confirm(`Delete ${user.userName} ?`).subscribe((result) => {
|
|
3431
|
+
if (result == "yes") {
|
|
3432
|
+
this.isProcessing = true;
|
|
3433
|
+
this.dataService.DeleteUser(user).subscribe((apiResponse) => {
|
|
3434
|
+
this.isProcessing = false;
|
|
3435
|
+
if (apiResponse.message == "success") {
|
|
3436
|
+
this.messageService.toast("User Deleted");
|
|
3437
|
+
this.UpdateData();
|
|
3438
|
+
}
|
|
3439
|
+
else {
|
|
3440
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3441
|
+
}
|
|
3442
|
+
}, (error) => {
|
|
3443
|
+
this.messageService.toast("Connection failed ");
|
|
3444
|
+
this.isProcessing = false;
|
|
3445
|
+
});
|
|
3446
|
+
}
|
|
3447
|
+
});
|
|
3448
|
+
}
|
|
3449
|
+
}
|
|
3450
|
+
UsersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UsersComponent, deps: [{ token: HttpService }, { token: i1$3.Router }, { token: AuthService }, { token: DataServiceLib }, { token: i4.MatDialog }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3451
|
+
UsersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: UsersComponent, selector: "spa-users", viewQueries: [{ propertyName: "usersPaginator", first: true, predicate: ["usersPaginator"], descendants: true }], ngImport: i0, template: "\r\n<h4>Users</h4>\r\n<hr />\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n <div class=\"col-2\">\r\n <button id=\"btnCreateAccount\" mat-raised-button color=\"primary\" (click)=\"createAccount()\">Create Account</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <spa-filter [data]=\"users\" (refreshClick)=\"UpdateData()\"></spa-filter>\r\n </div>\r\n </div>\r\n\r\n\r\n <p *ngIf=\"!users\"><em>Loading...</em></p>\r\n\r\n\r\n <div class=\"mat-elevation-z8\" *ngIf=\"users\">\r\n\r\n <table id=\"tblTable\" mat-table [dataSource]=\"users\">\r\n\r\n <ng-container matColumnDef=\"userName\">\r\n <th mat-header-cell *matHeaderCellDef> userName </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.userName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"locked\">\r\n <th mat-header-cell *matHeaderCellDef> Locked </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.locked}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"fullName\">\r\n <th mat-header-cell *matHeaderCellDef> Name </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.firstName}} {{user.lastName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"roleName\">\r\n <th mat-header-cell *matHeaderCellDef> Role </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.role.roleName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"disabled\">\r\n <th mat-header-cell *matHeaderCellDef> Disabled </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.disabled}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"dateCreated\">\r\n <th mat-header-cell *matHeaderCellDef> Created </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.createdDate | date: 'dd/MM/yyyy'}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"dateUpdated\">\r\n <th mat-header-cell *matHeaderCellDef> Updated </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.updatedDate | date: 'dd/MM/yyyy'}} </td>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"Action\">\r\n <th mat-header-cell *matHeaderCellDef> Action </th>\r\n <td mat-cell *matCellDef=\"let user\" style=\"width: 250px;\">\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"viewProfile(user)\" style=\"margin-right:30px\" matTooltip=\"View Profile\" matTooltipPosition=\"above\"> <mat-icon>account_circle</mat-icon></button>\r\n\r\n <button *ngIf=\"user.locked=='0'\" mat-mini-fab color=\"warn\" (click)=\"lock(user)\" style=\"margin-right:10px\" matTooltip=\"Lock\" matTooltipPosition=\"above\"> <mat-icon>lock</mat-icon></button>\r\n <button *ngIf=\"user.locked=='1'\" mat-mini-fab (click)=\"unlock(user)\" style=\"margin-right:10px; background-color: green;\" matTooltip=\"Unlock\" matTooltipPosition=\"above\"> <mat-icon >lock_open</mat-icon></button>\r\n\r\n <!-- <button *ngIf=\"user.disabled=='0'\" mat-mini-fab color=\"warn\" (click)=\"disable(user)\" style=\"margin-right:10px\" matTooltip=\"Disable\" matTooltipPosition=\"above\"> <mat-icon>block</mat-icon></button>\r\n <button *ngIf=\"user.disabled=='1'\" mat-mini-fab (click)=\"enable(user)\" style=\"margin-right:10px; background-color: green\" matTooltip=\"Enable\" matTooltipPosition=\"above\"> <mat-icon>done</mat-icon></button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteUser(user)\" style=\"margin-right:10px\" matTooltip=\"Delete\" matTooltipPosition=\"above\"> <mat-icon>delete</mat-icon></button>\r\n <!-- <button mat-mini-fab color=\"primary\" (click)=\"recover(user)\" style=\"margin-right:10px\" matTooltip=\"Reset Password\" matTooltipPosition=\"above\"> <mat-icon>vpn_key</mat-icon></button> -->\r\n\r\n\r\n\r\n </td>\r\n </ng-container>\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\" [ngClass]=\"{'make-gray': row.disabled =='1'}\"></tr>\r\n\r\n </table>\r\n\r\n </div>\r\n\r\n <mat-paginator #usersPaginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n<!-- ------------------ -->\r\n\r\n<!-- <div class=\"container mt-5\" style=\" font-size: 14px;\">\r\n<spa-table [data]=\"usersRaw\" [config]=\"config\" (refreshClick)=\"UpdateData()\" (viewClick)=\"viewProfile($event)\" (createClick)=\"createAccount()\" (deleteClick)=\"deleteUser($event)\"></spa-table>\r\n</div> -->\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}.make-gray{background-color:#d3d3d3}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i6$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i7$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: FilterComponent, selector: "spa-filter", inputs: ["data"], outputs: ["refreshClick"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
3452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UsersComponent, decorators: [{
|
|
3453
|
+
type: Component,
|
|
3454
|
+
args: [{ selector: "spa-users", template: "\r\n<h4>Users</h4>\r\n<hr />\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n <div class=\"col-2\">\r\n <button id=\"btnCreateAccount\" mat-raised-button color=\"primary\" (click)=\"createAccount()\">Create Account</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <spa-filter [data]=\"users\" (refreshClick)=\"UpdateData()\"></spa-filter>\r\n </div>\r\n </div>\r\n\r\n\r\n <p *ngIf=\"!users\"><em>Loading...</em></p>\r\n\r\n\r\n <div class=\"mat-elevation-z8\" *ngIf=\"users\">\r\n\r\n <table id=\"tblTable\" mat-table [dataSource]=\"users\">\r\n\r\n <ng-container matColumnDef=\"userName\">\r\n <th mat-header-cell *matHeaderCellDef> userName </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.userName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"locked\">\r\n <th mat-header-cell *matHeaderCellDef> Locked </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.locked}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"fullName\">\r\n <th mat-header-cell *matHeaderCellDef> Name </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.firstName}} {{user.lastName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"roleName\">\r\n <th mat-header-cell *matHeaderCellDef> Role </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.role.roleName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"disabled\">\r\n <th mat-header-cell *matHeaderCellDef> Disabled </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.disabled}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"dateCreated\">\r\n <th mat-header-cell *matHeaderCellDef> Created </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.createdDate | date: 'dd/MM/yyyy'}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"dateUpdated\">\r\n <th mat-header-cell *matHeaderCellDef> Updated </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.updatedDate | date: 'dd/MM/yyyy'}} </td>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"Action\">\r\n <th mat-header-cell *matHeaderCellDef> Action </th>\r\n <td mat-cell *matCellDef=\"let user\" style=\"width: 250px;\">\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"viewProfile(user)\" style=\"margin-right:30px\" matTooltip=\"View Profile\" matTooltipPosition=\"above\"> <mat-icon>account_circle</mat-icon></button>\r\n\r\n <button *ngIf=\"user.locked=='0'\" mat-mini-fab color=\"warn\" (click)=\"lock(user)\" style=\"margin-right:10px\" matTooltip=\"Lock\" matTooltipPosition=\"above\"> <mat-icon>lock</mat-icon></button>\r\n <button *ngIf=\"user.locked=='1'\" mat-mini-fab (click)=\"unlock(user)\" style=\"margin-right:10px; background-color: green;\" matTooltip=\"Unlock\" matTooltipPosition=\"above\"> <mat-icon >lock_open</mat-icon></button>\r\n\r\n <!-- <button *ngIf=\"user.disabled=='0'\" mat-mini-fab color=\"warn\" (click)=\"disable(user)\" style=\"margin-right:10px\" matTooltip=\"Disable\" matTooltipPosition=\"above\"> <mat-icon>block</mat-icon></button>\r\n <button *ngIf=\"user.disabled=='1'\" mat-mini-fab (click)=\"enable(user)\" style=\"margin-right:10px; background-color: green\" matTooltip=\"Enable\" matTooltipPosition=\"above\"> <mat-icon>done</mat-icon></button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteUser(user)\" style=\"margin-right:10px\" matTooltip=\"Delete\" matTooltipPosition=\"above\"> <mat-icon>delete</mat-icon></button>\r\n <!-- <button mat-mini-fab color=\"primary\" (click)=\"recover(user)\" style=\"margin-right:10px\" matTooltip=\"Reset Password\" matTooltipPosition=\"above\"> <mat-icon>vpn_key</mat-icon></button> -->\r\n\r\n\r\n\r\n </td>\r\n </ng-container>\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\" [ngClass]=\"{'make-gray': row.disabled =='1'}\"></tr>\r\n\r\n </table>\r\n\r\n </div>\r\n\r\n <mat-paginator #usersPaginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n<!-- ------------------ -->\r\n\r\n<!-- <div class=\"container mt-5\" style=\" font-size: 14px;\">\r\n<spa-table [data]=\"usersRaw\" [config]=\"config\" (refreshClick)=\"UpdateData()\" (viewClick)=\"viewProfile($event)\" (createClick)=\"createAccount()\" (deleteClick)=\"deleteUser($event)\"></spa-table>\r\n</div> -->\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}.make-gray{background-color:#d3d3d3}\n"] }]
|
|
3455
|
+
}], ctorParameters: function () { return [{ type: HttpService }, { type: i1$3.Router }, { type: AuthService }, { type: DataServiceLib }, { type: i4.MatDialog }, { type: MessageService }]; }, propDecorators: { usersPaginator: [{
|
|
3456
|
+
type: ViewChild,
|
|
3457
|
+
args: ["usersPaginator"]
|
|
3458
|
+
}] } });
|
|
3459
|
+
|
|
3460
|
+
class addRoleDialog {
|
|
3461
|
+
constructor(messageService, dataService, authService, dialogRef, data) {
|
|
3462
|
+
this.messageService = messageService;
|
|
3463
|
+
this.dataService = dataService;
|
|
3464
|
+
this.authService = authService;
|
|
3465
|
+
this.dialogRef = dialogRef;
|
|
3466
|
+
this.data = data;
|
|
3467
|
+
this.role = new Role();
|
|
3468
|
+
}
|
|
3469
|
+
ngOnInit() {
|
|
3470
|
+
this.capItems = this.data;
|
|
3471
|
+
}
|
|
3472
|
+
submit() {
|
|
3473
|
+
if (this.role.roleName == "New Role" || this.role.roleName == "") {
|
|
3474
|
+
this.messageService.toast("Please enter Role Name");
|
|
3475
|
+
return;
|
|
3476
|
+
}
|
|
3477
|
+
this.isProcessing = true;
|
|
3478
|
+
this.dataService.PostRole(this.role, "add").subscribe((apiResponse) => {
|
|
3479
|
+
this.isProcessing = false;
|
|
3480
|
+
if (apiResponse.success) {
|
|
3481
|
+
this.messageService.toast("Role Added");
|
|
3482
|
+
this.dialogRef.close("success");
|
|
3483
|
+
}
|
|
3484
|
+
else {
|
|
3485
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3486
|
+
}
|
|
3487
|
+
}, error => {
|
|
3488
|
+
this.messageService.toast("Connection failed");
|
|
3489
|
+
this.isProcessing = false;
|
|
3490
|
+
});
|
|
3491
|
+
}
|
|
3492
|
+
;
|
|
3493
|
+
}
|
|
3494
|
+
addRoleDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: addRoleDialog, deps: [{ token: MessageService }, { token: DataServiceLib }, { token: AuthService }, { token: i4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
3495
|
+
addRoleDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: addRoleDialog, selector: "app-addRole", ngImport: i0, template: "<mat-form-field>\r\n <mat-label>Role Name</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"role.roleName\" placeholder=\"Enter Role Name\" />\r\n</mat-form-field>\r\n\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n <div class=\"row\" >\r\n\r\n <!-- <div class=\" col-4\">\r\n\r\n <div class=\"row\">\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:14px\" [(ngModel)]=\"role.cap1\">Admin</mat-checkbox>\r\n </div>\r\n\r\n </div> -->\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;margin-right: 2em;\">\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\" *ngFor=\"let capItem of capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-button [disabled]=\"isProcessing\" (click)=\"submit()\" cdkFocusInitial>Submit</button>\r\n <button mat-button mat-dialog-close=\"success\">Cancel</button>\r\n</mat-dialog-actions>\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }] });
|
|
3496
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: addRoleDialog, decorators: [{
|
|
3497
|
+
type: Component,
|
|
3498
|
+
args: [{ selector: 'app-addRole', template: "<mat-form-field>\r\n <mat-label>Role Name</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"role.roleName\" placeholder=\"Enter Role Name\" />\r\n</mat-form-field>\r\n\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n <div class=\"row\" >\r\n\r\n <!-- <div class=\" col-4\">\r\n\r\n <div class=\"row\">\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:14px\" [(ngModel)]=\"role.cap1\">Admin</mat-checkbox>\r\n </div>\r\n\r\n </div> -->\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;margin-right: 2em;\">\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\" *ngFor=\"let capItem of capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-button [disabled]=\"isProcessing\" (click)=\"submit()\" cdkFocusInitial>Submit</button>\r\n <button mat-button mat-dialog-close=\"success\">Cancel</button>\r\n</mat-dialog-actions>\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
|
|
3499
|
+
}], ctorParameters: function () { return [{ type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i4.MatDialogRef }, { type: undefined, decorators: [{
|
|
3500
|
+
type: Inject,
|
|
3501
|
+
args: [MAT_DIALOG_DATA]
|
|
3502
|
+
}] }]; } });
|
|
3503
|
+
;
|
|
3504
|
+
|
|
3505
|
+
class RolesComponent {
|
|
3506
|
+
constructor(httpService, router, authService, dataService, dialog, messageService) {
|
|
3507
|
+
this.httpService = httpService;
|
|
3508
|
+
this.router = router;
|
|
3509
|
+
this.authService = authService;
|
|
3510
|
+
this.dataService = dataService;
|
|
3511
|
+
this.dialog = dialog;
|
|
3512
|
+
this.messageService = messageService;
|
|
3513
|
+
this.isProcessing = false;
|
|
3514
|
+
this.appConfig = new AppConfig();
|
|
3515
|
+
}
|
|
3516
|
+
ngOnInit() {
|
|
3517
|
+
this.authService.isAuthorised(this.dataService.capRoles.name);
|
|
3518
|
+
this.loadRoles();
|
|
3519
|
+
this.dataService.appConfigObserv.subscribe(x => this.appConfig = x);
|
|
3520
|
+
}
|
|
3521
|
+
loadRoles() {
|
|
3522
|
+
this.dataService.GetRole("all", "").subscribe((apiResponse) => {
|
|
3523
|
+
this.roles = apiResponse;
|
|
3524
|
+
});
|
|
3525
|
+
}
|
|
3526
|
+
refresh() {
|
|
3527
|
+
this.loadRoles();
|
|
3528
|
+
}
|
|
3529
|
+
addRole() {
|
|
3530
|
+
const dialogRef = this.dialog.open(addRoleDialog, {
|
|
3531
|
+
width: "1100px",
|
|
3532
|
+
data: this.appConfig.capItems,
|
|
3533
|
+
});
|
|
3534
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
3535
|
+
if (result == "success") {
|
|
3536
|
+
this.loadRoles();
|
|
3537
|
+
}
|
|
3538
|
+
});
|
|
3539
|
+
}
|
|
3540
|
+
updateRole(role) {
|
|
3541
|
+
this.messageService.confirm(`UPDATE ${role.roleName} ?`).subscribe((result) => {
|
|
3542
|
+
if (result == "yes") {
|
|
3543
|
+
this.dataService.PostRole(role, "edit").subscribe((apiResponse) => {
|
|
3544
|
+
if (apiResponse.success) {
|
|
3545
|
+
this.messageService.toast("Role Updated");
|
|
3546
|
+
this.loadRoles();
|
|
3547
|
+
}
|
|
3548
|
+
else {
|
|
3549
|
+
this.messageService.toast("Error: " + apiResponse);
|
|
3550
|
+
}
|
|
3551
|
+
});
|
|
3552
|
+
}
|
|
3553
|
+
});
|
|
3554
|
+
}
|
|
3555
|
+
;
|
|
3556
|
+
deleteRole(role) {
|
|
3557
|
+
this.messageService.confirm(`DELETE ${role.roleName} ?`).subscribe((result) => {
|
|
3558
|
+
if (result == "yes") {
|
|
3559
|
+
this.dataService.PostRole(role, "delete").subscribe((apiResponse) => {
|
|
3560
|
+
if (apiResponse.success) {
|
|
3561
|
+
this.messageService.toast("Role Deleted");
|
|
3562
|
+
this.loadRoles();
|
|
3563
|
+
}
|
|
3564
|
+
else {
|
|
3565
|
+
this.messageService.toast("Error: " + apiResponse);
|
|
3566
|
+
}
|
|
3567
|
+
});
|
|
3568
|
+
}
|
|
3569
|
+
});
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
RolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RolesComponent, deps: [{ token: HttpService }, { token: i1$3.Router }, { token: AuthService }, { token: DataServiceLib }, { token: i4.MatDialog }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3573
|
+
RolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: RolesComponent, selector: "spa-roles", ngImport: i0, template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container mb-5\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n <div class=\"col-2\">\r\n\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n <div class=\"col-1\">\r\n\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" style=\"margin-right:1em;margin-top:5px\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" style=\"margin-left:10px\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%;padding-left:2em\">\r\n\r\n <h4>{{role.roleName}}</h4>\r\n <hr />\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\">\r\n\r\n\r\n <div class=\"row\" style=\"margin-right:20px;\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px; \" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px;\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubSubItem.name]\">{{capSubSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateRole(role)\" style=\"margin-right:10px;\">\r\n <mat-icon>done_all</mat-icon>\r\n </button>\r\n\r\n <!-- <button mat-mini-fab color=\"warn\" (click)=\"editRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>edit</mat-icon>\r\n </button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i14.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i14.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
3574
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RolesComponent, decorators: [{
|
|
3575
|
+
type: Component,
|
|
3576
|
+
args: [{ selector: "spa-roles", template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container mb-5\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n <div class=\"col-2\">\r\n\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n <div class=\"col-1\">\r\n\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" style=\"margin-right:1em;margin-top:5px\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" style=\"margin-left:10px\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%;padding-left:2em\">\r\n\r\n <h4>{{role.roleName}}</h4>\r\n <hr />\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\">\r\n\r\n\r\n <div class=\"row\" style=\"margin-right:20px;\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px; \" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px;\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubSubItem.name]\">{{capSubSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateRole(role)\" style=\"margin-right:10px;\">\r\n <mat-icon>done_all</mat-icon>\r\n </button>\r\n\r\n <!-- <button mat-mini-fab color=\"warn\" (click)=\"editRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>edit</mat-icon>\r\n </button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
|
|
3577
|
+
}], ctorParameters: function () { return [{ type: HttpService }, { type: i1$3.Router }, { type: AuthService }, { type: DataServiceLib }, { type: i4.MatDialog }, { type: MessageService }]; } });
|
|
3578
|
+
|
|
3579
|
+
class CreateAccountComponent {
|
|
3580
|
+
constructor(httpService, messageService, dataService, authService, router) {
|
|
3581
|
+
this.httpService = httpService;
|
|
3582
|
+
this.messageService = messageService;
|
|
3583
|
+
this.dataService = dataService;
|
|
3584
|
+
this.authService = authService;
|
|
3585
|
+
this.router = router;
|
|
3586
|
+
this.appConfig = new AppConfig();
|
|
3587
|
+
this.isProcessing = false;
|
|
3588
|
+
this.register = new Register();
|
|
3589
|
+
this.openProfile = true;
|
|
3590
|
+
this.authTypes = [
|
|
3591
|
+
{ name: "Local Authentication", value: "local" },
|
|
3592
|
+
{ name: "AD Authentication", value: "AD" }
|
|
3593
|
+
];
|
|
3594
|
+
}
|
|
3595
|
+
ngOnInit() {
|
|
3596
|
+
this.appConfig = this.dataService.appConfig;
|
|
3597
|
+
}
|
|
3598
|
+
create() {
|
|
3599
|
+
if (this.register.authType == "") {
|
|
3600
|
+
this.messageService.toast("Choose Authentication Type");
|
|
3601
|
+
return;
|
|
3602
|
+
}
|
|
3603
|
+
this.isProcessing = true;
|
|
3604
|
+
this.dataService.RegisterAccount(this.register).subscribe((apiResponse) => {
|
|
3605
|
+
this.isProcessing = false;
|
|
3606
|
+
if (apiResponse.success) {
|
|
3607
|
+
this.messageService.toast("Account Created");
|
|
3608
|
+
if (this.openProfile) {
|
|
3609
|
+
this.viewProfile(this.register.userName);
|
|
3610
|
+
}
|
|
3611
|
+
else {
|
|
3612
|
+
// this.user = new User();
|
|
3613
|
+
this.register = new Register();
|
|
3614
|
+
this.confirmPassword = "";
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
else {
|
|
3618
|
+
this.messageService.toast("Error: " + apiResponse.message);
|
|
3619
|
+
}
|
|
3620
|
+
}, (error) => {
|
|
3621
|
+
this.isProcessing = false;
|
|
3622
|
+
this.messageService.toast(this.httpService.Error(error));
|
|
3623
|
+
});
|
|
3624
|
+
}
|
|
3625
|
+
viewProfile(userName) {
|
|
3626
|
+
this.dataService.tmpProfileuserName = userName;
|
|
3627
|
+
this.router.navigate(["home/user/profile"]);
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
CreateAccountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateAccountComponent, deps: [{ token: HttpService }, { token: MessageService }, { token: DataServiceLib }, { token: AuthService }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
3631
|
+
CreateAccountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CreateAccountComponent, selector: "spa-create-account", inputs: { appConfig: "appConfig" }, ngImport: i0, template: "<h4>Create Account</h4>\r\n\r\n<hr/>\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <spa-text id=\"txtFirstName\" display=\"FirstName\" [(value)]=\"register.firstName\"></spa-text>\r\n <spa-text id=\"txtLastName\" display=\"LastName\" [(value)]=\"register.lastName\"></spa-text>\r\n\r\n\r\n\r\n <spa-text id=\"txtUserName\" display=\"Username\" [(value)]=\"register.userName\"></spa-text>\r\n\r\n <spa-select id=\"cboAuth\" display=\"Authentication Type\" [options]=\"authTypes\" optionDisplay=\"name\" optionValue=\"value\" [(value)]=\"register.authType\"></spa-select>\r\n\r\n <spa-text id=\"txtPassword\" display=\"Password\" format=\"password\" [(value)]=\"register.password\" ></spa-text>\r\n\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" format=\"password\" [(value)]=\"confirmPassword\" ></spa-text>\r\n\r\n <spa-check display=\"Open profile after creation\" [(value)]=\"openProfile\"></spa-check>\r\n\r\n <div class=\"span-col-center\">\r\n <button id=\"btnCreate\" [disabled]=\"register.authType ==''\" mat-raised-button color=\"primary\" (click)=\"create()\" cdkFocusInitial>Create</button>\r\n </div>\r\n\r\n\r\n\r\n</div>\r\n\r\n\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }, { kind: "component", type: SelectComponent, selector: "spa-select", inputs: ["width", "readonly", "readonlyMode", "hint", "placeholder", "multiple", "display", "value", "options", "optionValue", "optionDisplay", "optionDisplayExtra"], outputs: ["valueChange"] }, { kind: "component", type: CheckComponent, selector: "spa-check", inputs: ["readonly", "display", "value"], outputs: ["valueChange", "click", "check", "uncheck"] }] });
|
|
3632
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateAccountComponent, decorators: [{
|
|
3633
|
+
type: Component,
|
|
3634
|
+
args: [{ selector: 'spa-create-account', template: "<h4>Create Account</h4>\r\n\r\n<hr/>\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <spa-text id=\"txtFirstName\" display=\"FirstName\" [(value)]=\"register.firstName\"></spa-text>\r\n <spa-text id=\"txtLastName\" display=\"LastName\" [(value)]=\"register.lastName\"></spa-text>\r\n\r\n\r\n\r\n <spa-text id=\"txtUserName\" display=\"Username\" [(value)]=\"register.userName\"></spa-text>\r\n\r\n <spa-select id=\"cboAuth\" display=\"Authentication Type\" [options]=\"authTypes\" optionDisplay=\"name\" optionValue=\"value\" [(value)]=\"register.authType\"></spa-select>\r\n\r\n <spa-text id=\"txtPassword\" display=\"Password\" format=\"password\" [(value)]=\"register.password\" ></spa-text>\r\n\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" format=\"password\" [(value)]=\"confirmPassword\" ></spa-text>\r\n\r\n <spa-check display=\"Open profile after creation\" [(value)]=\"openProfile\"></spa-check>\r\n\r\n <div class=\"span-col-center\">\r\n <button id=\"btnCreate\" [disabled]=\"register.authType ==''\" mat-raised-button color=\"primary\" (click)=\"create()\" cdkFocusInitial>Create</button>\r\n </div>\r\n\r\n\r\n\r\n</div>\r\n\r\n\r\n" }]
|
|
3635
|
+
}], ctorParameters: function () { return [{ type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i1$3.Router }]; }, propDecorators: { appConfig: [{
|
|
3636
|
+
type: Input
|
|
3637
|
+
}] } });
|
|
3638
|
+
|
|
3639
|
+
class SpaAdminModule {
|
|
3640
|
+
}
|
|
3641
|
+
SpaAdminModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3642
|
+
SpaAdminModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, declarations: [UsersComponent,
|
|
3643
|
+
RolesComponent,
|
|
3644
|
+
addRoleDialog,
|
|
3645
|
+
CreateAccountComponent,
|
|
3646
|
+
LogsComponent,
|
|
3647
|
+
SettingsComponent], imports: [i2.ReactiveFormsModule, CommonModule,
|
|
3648
|
+
FormsModule,
|
|
3649
|
+
ReactiveFormsModule,
|
|
3650
|
+
// SpaMatModule,
|
|
3651
|
+
TinSpaModule], exports: [CommonModule,
|
|
3652
|
+
FormsModule,
|
|
3653
|
+
// SpaMatModule,
|
|
3654
|
+
UsersComponent,
|
|
3655
|
+
RolesComponent,
|
|
3656
|
+
addRoleDialog,
|
|
3657
|
+
CreateAccountComponent,
|
|
3658
|
+
LogsComponent,
|
|
3659
|
+
SettingsComponent] });
|
|
3660
|
+
SpaAdminModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
|
|
3661
|
+
CommonModule,
|
|
3662
|
+
FormsModule,
|
|
3663
|
+
ReactiveFormsModule,
|
|
3664
|
+
// SpaMatModule,
|
|
3665
|
+
TinSpaModule, CommonModule,
|
|
3666
|
+
FormsModule] });
|
|
3667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, decorators: [{
|
|
3668
|
+
type: NgModule,
|
|
3669
|
+
args: [{
|
|
3670
|
+
declarations: [
|
|
3671
|
+
UsersComponent,
|
|
3672
|
+
RolesComponent,
|
|
3673
|
+
addRoleDialog,
|
|
3674
|
+
CreateAccountComponent,
|
|
3675
|
+
LogsComponent,
|
|
3676
|
+
SettingsComponent
|
|
3677
|
+
],
|
|
3678
|
+
imports: [
|
|
3679
|
+
ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
|
|
3680
|
+
CommonModule,
|
|
3681
|
+
FormsModule,
|
|
3682
|
+
ReactiveFormsModule,
|
|
3683
|
+
// SpaMatModule,
|
|
3684
|
+
TinSpaModule
|
|
3685
|
+
],
|
|
3686
|
+
exports: [
|
|
3687
|
+
CommonModule,
|
|
3688
|
+
FormsModule,
|
|
3689
|
+
// SpaMatModule,
|
|
3690
|
+
UsersComponent,
|
|
3691
|
+
RolesComponent,
|
|
3692
|
+
addRoleDialog,
|
|
3693
|
+
CreateAccountComponent,
|
|
3694
|
+
LogsComponent,
|
|
3695
|
+
SettingsComponent
|
|
3696
|
+
],
|
|
3697
|
+
}]
|
|
3698
|
+
}] });
|
|
3699
|
+
|
|
3700
|
+
const routes$2 = [
|
|
3701
|
+
{ path: "signup", component: SignupComponent },
|
|
3702
|
+
{ path: 'recover-account', component: RecoverAccountComponent },
|
|
3703
|
+
{ path: 'login', component: LoginComponent },
|
|
3704
|
+
{ path: '', redirectTo: 'login', pathMatch: 'full' },
|
|
3705
|
+
{ path: '**', redirectTo: '' },
|
|
3706
|
+
];
|
|
3707
|
+
class IndexRoutingModule {
|
|
3708
|
+
}
|
|
3709
|
+
IndexRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3710
|
+
IndexRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
|
|
3711
|
+
IndexRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, imports: [RouterModule.forChild(routes$2), RouterModule] });
|
|
3712
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, decorators: [{
|
|
3713
|
+
type: NgModule,
|
|
3714
|
+
args: [{
|
|
3715
|
+
imports: [RouterModule.forChild(routes$2)],
|
|
3716
|
+
exports: [RouterModule]
|
|
3717
|
+
}]
|
|
3718
|
+
}] });
|
|
3719
|
+
|
|
3720
|
+
class IndexModule {
|
|
3721
|
+
}
|
|
3722
|
+
IndexModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3723
|
+
IndexModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, imports: [CommonModule,
|
|
3724
|
+
IndexRoutingModule,
|
|
3725
|
+
SpaIndexModule] });
|
|
3726
|
+
IndexModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, imports: [CommonModule,
|
|
3727
|
+
IndexRoutingModule,
|
|
3728
|
+
SpaIndexModule] });
|
|
3729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, decorators: [{
|
|
3730
|
+
type: NgModule,
|
|
3731
|
+
args: [{
|
|
3732
|
+
declarations: [],
|
|
3733
|
+
imports: [
|
|
3734
|
+
CommonModule,
|
|
3735
|
+
IndexRoutingModule,
|
|
3736
|
+
SpaIndexModule
|
|
3737
|
+
]
|
|
3738
|
+
}]
|
|
3739
|
+
}] });
|
|
3740
|
+
|
|
3741
|
+
const routes$1 = [
|
|
3742
|
+
{ path: "users", component: UsersComponent },
|
|
3743
|
+
{ path: "roles", component: RolesComponent },
|
|
3744
|
+
{ path: "create-account", component: CreateAccountComponent },
|
|
3745
|
+
{ path: "logs", component: LogsComponent },
|
|
3746
|
+
{ path: "settings", component: SettingsComponent },
|
|
3747
|
+
];
|
|
3748
|
+
class AdminRoutingModule {
|
|
3749
|
+
}
|
|
3750
|
+
AdminRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3751
|
+
AdminRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
|
|
3752
|
+
AdminRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, imports: [RouterModule.forChild(routes$1), RouterModule] });
|
|
3753
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, decorators: [{
|
|
3754
|
+
type: NgModule,
|
|
3755
|
+
args: [{
|
|
3756
|
+
imports: [RouterModule.forChild(routes$1)],
|
|
3757
|
+
exports: [RouterModule]
|
|
3758
|
+
}]
|
|
3759
|
+
}] });
|
|
3760
|
+
|
|
3761
|
+
class AdminModule {
|
|
3762
|
+
}
|
|
3763
|
+
AdminModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3764
|
+
AdminModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, imports: [CommonModule,
|
|
3765
|
+
AdminRoutingModule,
|
|
3766
|
+
SpaAdminModule] });
|
|
3767
|
+
AdminModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, imports: [CommonModule,
|
|
3768
|
+
AdminRoutingModule,
|
|
3769
|
+
SpaAdminModule] });
|
|
3770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, decorators: [{
|
|
3771
|
+
type: NgModule,
|
|
3772
|
+
args: [{
|
|
3773
|
+
declarations: [],
|
|
3774
|
+
imports: [
|
|
3775
|
+
CommonModule,
|
|
3776
|
+
AdminRoutingModule,
|
|
3777
|
+
SpaAdminModule
|
|
3778
|
+
]
|
|
3779
|
+
}]
|
|
3780
|
+
}] });
|
|
3781
|
+
|
|
3782
|
+
const routes = [
|
|
3783
|
+
{ path: "change-password", component: ChangePasswordComponent },
|
|
3784
|
+
{ path: "profile", component: ProfileComponent },
|
|
3785
|
+
];
|
|
3786
|
+
class UserRoutingModule {
|
|
3787
|
+
}
|
|
3788
|
+
UserRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3789
|
+
UserRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
|
|
3790
|
+
UserRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
|
|
3791
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, decorators: [{
|
|
3792
|
+
type: NgModule,
|
|
3793
|
+
args: [{
|
|
3794
|
+
imports: [RouterModule.forChild(routes)],
|
|
3795
|
+
exports: [RouterModule]
|
|
3796
|
+
}]
|
|
3797
|
+
}] });
|
|
3798
|
+
|
|
3799
|
+
class UserModule {
|
|
3800
|
+
}
|
|
3801
|
+
UserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3802
|
+
UserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: UserModule, imports: [CommonModule,
|
|
3803
|
+
UserRoutingModule,
|
|
3804
|
+
SpaUserModule] });
|
|
3805
|
+
UserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, imports: [CommonModule,
|
|
3806
|
+
UserRoutingModule,
|
|
3807
|
+
SpaUserModule] });
|
|
3808
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, decorators: [{
|
|
3809
|
+
type: NgModule,
|
|
3810
|
+
args: [{
|
|
3811
|
+
declarations: [],
|
|
3812
|
+
imports: [
|
|
3813
|
+
CommonModule,
|
|
3814
|
+
UserRoutingModule,
|
|
3815
|
+
SpaUserModule
|
|
3816
|
+
]
|
|
3817
|
+
}]
|
|
3818
|
+
}] });
|
|
3819
|
+
|
|
3820
|
+
/*
|
|
3821
|
+
* Public API Surface of tin-spa
|
|
3822
|
+
*/
|
|
3823
|
+
|
|
3824
|
+
/**
|
|
3825
|
+
* Generated bundle index. Do not edit.
|
|
3826
|
+
*/
|
|
3827
|
+
|
|
3828
|
+
export { Account, Action, ActionResponse, ActivityComponent, AdminModule, ApiResponse, AppConfig, AttachComponent, AuthService, CapItem, ChangePasswordComponent, ChangeUserPassword, CheckComponent, ChipsComponent, Constants, Core, CreateAccountComponent, DataServiceLib, DateComponent, DatetimeComponent, ExportService, FilterComponent, FormComponent, FormConfig, HttpService, IndexModule, LabelComponent, LoaderComponent, LogLevel, LogService, LoginComponent, LogsComponent, MessageService, MoneyComponent, NavMenuComponent, NumberComponent, OptionComponent, Profile, ProfileComponent, RecoverAccountComponent, Register, Role, RolesComponent, SelectComponent, SettingsComponent, SignupComponent, SpaAdminModule, SpaIndexModule, SpaMatModule, SpaUserModule, Step, StepsComponent, StorageService, TableComponent, TableConfig, TextComponent, Tile, TilesComponent, TinSpaComponent, TinSpaModule, TinSpaService, User, UserModule, UsersComponent, addRoleDialog, detailsDialog, loginConfig, messageDialog };
|
|
3829
|
+
//# sourceMappingURL=tin-spa.mjs.map
|