@cccteam/ccc-lib 0.0.13 → 0.0.15
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/eslint.config.js +32 -0
- package/ng-package.json +11 -0
- package/package.json +7 -68
- package/src/auth-authentication-guard/authentication.guard.ts +40 -0
- package/src/auth-authentication-guard/ng-package.json +6 -0
- package/src/auth-authorization-guard/authorization.guard.ts +17 -0
- package/src/auth-authorization-guard/ng-package.json +6 -0
- package/src/auth-forms/ccc-field/ccc-field.component.html +1 -0
- package/src/auth-forms/ccc-field/ccc-field.component.scss +0 -0
- package/src/auth-forms/ccc-field/ccc-field.component.spec.ts +22 -0
- package/src/auth-forms/ccc-field/ccc-field.component.ts +74 -0
- package/src/auth-forms/form-helpers.ts +39 -0
- package/src/auth-forms/{public-api.d.ts → index.ts} +1 -0
- package/src/auth-forms/ng-package.json +6 -0
- package/src/auth-has-permission/has-permission.directive.ts +34 -0
- package/src/auth-has-permission/ng-package.json +6 -0
- package/src/auth-service/auth.service.ts +92 -0
- package/src/auth-service/ng-package.json +6 -0
- package/src/ccc-camel-case-to-title/camel-case-to-title.pipe.ts +23 -0
- package/src/ccc-camel-case-to-title/index.ts +1 -0
- package/src/ccc-camel-case-to-title/ng-package.json +6 -0
- package/src/ccc-grid/ccc-grid.component.ts +155 -0
- package/src/ccc-grid/index.ts +3 -0
- package/src/ccc-grid/ng-package.json +6 -0
- package/src/ccc-grid/table-button/table-button.component.html +16 -0
- package/src/ccc-grid/table-button/table-button.component.scss +5 -0
- package/src/ccc-grid/table-button/table-button.component.spec.ts +22 -0
- package/src/ccc-grid/table-button/table-button.component.ts +49 -0
- package/src/ccc-resource/can-deactivate.guard.ts +41 -0
- package/src/ccc-resource/compound-resource/compound-resource.component.html +57 -0
- package/src/ccc-resource/compound-resource/compound-resource.component.scss +86 -0
- package/src/ccc-resource/compound-resource/compound-resource.component.spec.ts +22 -0
- package/src/ccc-resource/compound-resource/compound-resource.component.ts +158 -0
- package/src/ccc-resource/concat-fns.ts +162 -0
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.html +12 -0
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.scss +0 -0
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.spec.ts +23 -0
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.ts +17 -0
- package/src/ccc-resource/form-state.service.ts +24 -0
- package/src/ccc-resource/format-fns.ts +49 -0
- package/src/ccc-resource/gui-constants.ts +88 -0
- package/src/ccc-resource/index.ts +23 -0
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.html +8 -0
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.scss +0 -0
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.spec.ts +22 -0
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.ts +12 -0
- package/src/ccc-resource/ng-package.json +6 -0
- package/src/ccc-resource/operation-types.ts +19 -0
- package/src/ccc-resource/padding-element/padding-element.component.html +1 -0
- package/src/ccc-resource/padding-element/padding-element.component.scss +3 -0
- package/src/ccc-resource/padding-element/padding-element.component.spec.ts +22 -0
- package/src/ccc-resource/padding-element/padding-element.component.ts +20 -0
- package/src/ccc-resource/resource-array-view/resource-array-view.component.html +81 -0
- package/src/ccc-resource/resource-array-view/resource-array-view.component.scss +21 -0
- package/src/ccc-resource/resource-array-view/resource-array-view.component.spec.ts +22 -0
- package/src/ccc-resource/resource-array-view/resource-array-view.component.ts +143 -0
- package/src/ccc-resource/resource-base/resource-base.component.spec.ts +22 -0
- package/src/ccc-resource/resource-base/resource-base.component.ts +11 -0
- package/src/ccc-resource/resource-cache.service.ts +232 -0
- package/src/ccc-resource/resource-create/resource-create.component.html +31 -0
- package/src/ccc-resource/resource-create/resource-create.component.scss +130 -0
- package/src/ccc-resource/resource-create/resource-create.component.spec.ts +22 -0
- package/src/ccc-resource/resource-create/resource-create.component.ts +303 -0
- package/src/ccc-resource/resource-field/base-field.directive.ts +102 -0
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.html +16 -0
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.spec.ts +22 -0
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.ts +15 -0
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.html +13 -0
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.spec.ts +23 -0
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.ts +50 -0
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.html +22 -0
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.spec.ts +22 -0
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.ts +14 -0
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.html +71 -0
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.scss +9 -0
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.spec.ts +22 -0
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.ts +207 -0
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.html +38 -0
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.scss +3 -0
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.spec.ts +22 -0
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.ts +87 -0
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.html +23 -0
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.scss +6 -0
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.spec.ts +22 -0
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.ts +14 -0
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.html +29 -0
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.scss +6 -0
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.spec.ts +22 -0
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.ts +23 -0
- package/src/ccc-resource/resource-field/resource-field.component.html +112 -0
- package/src/ccc-resource/resource-field/resource-field.component.scss +7 -0
- package/src/ccc-resource/resource-field/resource-field.component.spec.ts +22 -0
- package/src/ccc-resource/resource-field/resource-field.component.ts +214 -0
- package/src/ccc-resource/resource-layout/resource-layout.component.html +73 -0
- package/src/ccc-resource/resource-layout/resource-layout.component.scss +26 -0
- package/src/ccc-resource/resource-layout/resource-layout.component.spec.ts +22 -0
- package/src/ccc-resource/resource-layout/resource-layout.component.ts +176 -0
- package/src/ccc-resource/resource-list/ resource-list.component.spec.ts +22 -0
- package/src/ccc-resource/resource-list/resource-list.component.html +27 -0
- package/src/ccc-resource/resource-list/resource-list.component.scss +67 -0
- package/src/ccc-resource/resource-list/resource-list.component.ts +376 -0
- package/src/ccc-resource/resource-list-create/resource-list-create.component.html +71 -0
- package/src/ccc-resource/resource-list-create/resource-list-create.component.scss +9 -0
- package/src/ccc-resource/resource-list-create/resource-list-create.component.spec.ts +22 -0
- package/src/ccc-resource/resource-list-create/resource-list-create.component.ts +103 -0
- package/src/ccc-resource/resource-resolver/resource-resolver.component.html +1 -0
- package/src/ccc-resource/resource-resolver/resource-resolver.component.scss +0 -0
- package/src/ccc-resource/resource-resolver/resource-resolver.component.spec.ts +22 -0
- package/src/ccc-resource/resource-resolver/resource-resolver.component.ts +69 -0
- package/src/ccc-resource/resource-store.service.ts +93 -0
- package/src/ccc-resource/resource-view/resource-view.component.html +133 -0
- package/src/ccc-resource/resource-view/resource-view.component.scss +150 -0
- package/src/ccc-resource/resource-view/resource-view.component.spec.ts +22 -0
- package/src/ccc-resource/resource-view/resource-view.component.ts +354 -0
- package/src/ccc-resource/resources-helpers.ts +262 -0
- package/src/ccc-resource/utils/validator-utils.ts +6 -0
- package/{fesm2022/cccteam-ccc-lib.mjs → src/index.ts} +32 -11
- package/src/internal-types/index.ts +1 -0
- package/src/internal-types/ng-package.json +6 -0
- package/src/types/auth.actions.ts +46 -0
- package/src/types/configs.ts +952 -0
- package/src/types/constants.ts +1 -0
- package/src/types/core.actions.ts +33 -0
- package/src/types/{public-api.d.ts → index.ts} +3 -0
- package/src/types/ng-package.json +6 -0
- package/src/types/notification-message.ts +20 -0
- package/src/types/{permissions.d.ts → permissions.ts} +9 -9
- package/src/types/{session-info.d.ts → session-info.ts} +4 -3
- package/src/types/tokens.ts +20 -0
- package/src/ui-alert/alert.component.html +13 -0
- package/src/ui-alert/alert.component.scss +48 -0
- package/src/ui-alert/alert.component.spec.ts +22 -0
- package/src/ui-alert/alert.component.ts +35 -0
- package/src/ui-alert/ng-package.json +6 -0
- package/src/ui-core-service/index.ts +1 -0
- package/src/ui-core-service/ng-package.json +6 -0
- package/src/ui-core-service/ui-core.service.ts +34 -0
- package/src/ui-interceptor/api.interceptor.spec.ts +16 -0
- package/src/ui-interceptor/api.interceptor.ts +45 -0
- package/src/ui-interceptor/ng-package.json +6 -0
- package/src/ui-notification-service/ng-package.json +6 -0
- package/src/ui-notification-service/notification.service.ts +59 -0
- package/src/ui-sidenav/ng-package.json +6 -0
- package/src/ui-sidenav/sidenav.component.html +60 -0
- package/src/ui-sidenav/sidenav.component.scss +99 -0
- package/src/ui-sidenav/sidenav.component.spec.ts +22 -0
- package/src/ui-sidenav/sidenav.component.ts +64 -0
- package/src/util-request-options/ng-package.json +6 -0
- package/src/util-request-options/request-options.ts +17 -0
- package/tsconfig.lib.json +13 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/cccteam-ccc-lib-0.0.13.tgz +0 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs +0 -44
- package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs +0 -24
- package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs +0 -118
- package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs +0 -51
- package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs +0 -56
- package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-auth-state.mjs +0 -109
- package/fesm2022/cccteam-ccc-lib-src-auth-state.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-types.mjs +0 -137
- package/fesm2022/cccteam-ccc-lib-src-types.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs +0 -48
- package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-ui-core-state.mjs +0 -100
- package/fesm2022/cccteam-ccc-lib-src-ui-core-state.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs +0 -48
- package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs +0 -57
- package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs +0 -70
- package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs +0 -19
- package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs.map +0 -1
- package/fesm2022/cccteam-ccc-lib.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/public-api.d.ts +0 -13
- package/src/auth-authentication-guard/authentication.guard.d.ts +0 -3
- package/src/auth-authentication-guard/index.d.ts +0 -5
- package/src/auth-authorization-guard/authorization.guard.d.ts +0 -3
- package/src/auth-authorization-guard/index.d.ts +0 -5
- package/src/auth-forms/ccc-field/ccc-field.component.d.ts +0 -25
- package/src/auth-forms/form-helpers.d.ts +0 -16
- package/src/auth-forms/index.d.ts +0 -5
- package/src/auth-has-permission/has-permission.directive.d.ts +0 -12
- package/src/auth-has-permission/index.d.ts +0 -5
- package/src/auth-service/auth.service.d.ts +0 -24
- package/src/auth-service/index.d.ts +0 -5
- package/src/auth-state/auth.state.d.ts +0 -27
- package/src/auth-state/index.d.ts +0 -5
- package/src/auth-state/public-api.d.ts +0 -1
- package/src/types/auth.actions.d.ts +0 -41
- package/src/types/core.actions.d.ts +0 -31
- package/src/types/index.d.ts +0 -5
- package/src/types/notification-message.d.ts +0 -18
- package/src/types/tokens.d.ts +0 -13
- package/src/ui-alert/alert.component.d.ts +0 -13
- package/src/ui-alert/index.d.ts +0 -5
- package/src/ui-core-state/core.state.d.ts +0 -28
- package/src/ui-core-state/index.d.ts +0 -5
- package/src/ui-core-state/public-api.d.ts +0 -1
- package/src/ui-interceptor/api.interceptor.d.ts +0 -12
- package/src/ui-interceptor/index.d.ts +0 -5
- package/src/ui-notification-service/index.d.ts +0 -5
- package/src/ui-notification-service/notification.service.d.ts +0 -30
- package/src/ui-sidenav/index.d.ts +0 -5
- package/src/ui-sidenav/sidenav.component.d.ts +0 -31
- package/src/util-request-options/index.d.ts +0 -5
- package/src/util-request-options/request-options.d.ts +0 -8
- /package/src/auth-authentication-guard/{public-api.d.ts → index.ts} +0 -0
- /package/src/auth-authorization-guard/{public-api.d.ts → index.ts} +0 -0
- /package/src/auth-has-permission/{public-api.d.ts → index.ts} +0 -0
- /package/src/auth-service/{public-api.d.ts → index.ts} +0 -0
- /package/src/ui-alert/{public-api.d.ts → index.ts} +0 -0
- /package/src/ui-interceptor/{public-api.d.ts → index.ts} +0 -0
- /package/src/ui-notification-service/{public-api.d.ts → index.ts} +0 -0
- /package/src/ui-sidenav/{public-api.d.ts → index.ts} +0 -0
- /package/src/util-request-options/{public-api.d.ts → index.ts} +0 -0
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-namespace */
|
|
4
|
-
// no-namespace rule is disabled because action hygiene prevents import pollution
|
|
5
|
-
var AuthenticationGuardAction;
|
|
6
|
-
(function (AuthenticationGuardAction) {
|
|
7
|
-
class SetRedirectUrl {
|
|
8
|
-
redirectUrl;
|
|
9
|
-
static type = '[AuthenticationGuard] Set Redirect Url And Navigate To Login Page';
|
|
10
|
-
constructor(redirectUrl) {
|
|
11
|
-
this.redirectUrl = redirectUrl;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
AuthenticationGuardAction.SetRedirectUrl = SetRedirectUrl;
|
|
15
|
-
class CheckUserSession {
|
|
16
|
-
static type = '[AuthenticationGuard] Check User Session';
|
|
17
|
-
}
|
|
18
|
-
AuthenticationGuardAction.CheckUserSession = CheckUserSession;
|
|
19
|
-
})(AuthenticationGuardAction || (AuthenticationGuardAction = {}));
|
|
20
|
-
var LoginAction;
|
|
21
|
-
(function (LoginAction) {
|
|
22
|
-
class Logout {
|
|
23
|
-
static type = '[Login] Auto Logout';
|
|
24
|
-
}
|
|
25
|
-
LoginAction.Logout = Logout;
|
|
26
|
-
class SetRedirectUrl {
|
|
27
|
-
redirectUrl;
|
|
28
|
-
static type = '[Login] Set Redirect Url';
|
|
29
|
-
constructor(redirectUrl) {
|
|
30
|
-
this.redirectUrl = redirectUrl;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
LoginAction.SetRedirectUrl = SetRedirectUrl;
|
|
34
|
-
class PublishError {
|
|
35
|
-
message;
|
|
36
|
-
static type = '[Login] Publish Error';
|
|
37
|
-
constructor(message) {
|
|
38
|
-
this.message = message;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
LoginAction.PublishError = PublishError;
|
|
42
|
-
})(LoginAction || (LoginAction = {}));
|
|
43
|
-
var AppAction;
|
|
44
|
-
(function (AppAction) {
|
|
45
|
-
class CheckUserSession {
|
|
46
|
-
static type = '[App] Check User Session';
|
|
47
|
-
}
|
|
48
|
-
AppAction.CheckUserSession = CheckUserSession;
|
|
49
|
-
class SetRedirectUrl {
|
|
50
|
-
redirectUrl;
|
|
51
|
-
static type = '[App] Set Redirect Url';
|
|
52
|
-
constructor(redirectUrl) {
|
|
53
|
-
this.redirectUrl = redirectUrl;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
AppAction.SetRedirectUrl = SetRedirectUrl;
|
|
57
|
-
class SetNavIdentifier {
|
|
58
|
-
identifier;
|
|
59
|
-
static type = '[App] Set Nav Identifier';
|
|
60
|
-
constructor(identifier) {
|
|
61
|
-
this.identifier = identifier;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
AppAction.SetNavIdentifier = SetNavIdentifier;
|
|
65
|
-
})(AppAction || (AppAction = {}));
|
|
66
|
-
|
|
67
|
-
/* eslint-disable @typescript-eslint/no-namespace */
|
|
68
|
-
// no-namespace rule is disabled because action hygiene prevents import pollution
|
|
69
|
-
var ApiInterceptorAction;
|
|
70
|
-
(function (ApiInterceptorAction) {
|
|
71
|
-
class BeginActivity {
|
|
72
|
-
process;
|
|
73
|
-
static type = '[ApiInterceptor] Add Loading Activity';
|
|
74
|
-
constructor(process) {
|
|
75
|
-
this.process = process;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
ApiInterceptorAction.BeginActivity = BeginActivity;
|
|
79
|
-
class EndActivity {
|
|
80
|
-
process;
|
|
81
|
-
static type = '[ApiInterceptor] Remove Loading Activity';
|
|
82
|
-
constructor(process) {
|
|
83
|
-
this.process = process;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
ApiInterceptorAction.EndActivity = EndActivity;
|
|
87
|
-
class PublishError {
|
|
88
|
-
message;
|
|
89
|
-
static type = '[ApiInterceptor] Publish Error';
|
|
90
|
-
constructor(message) {
|
|
91
|
-
this.message = message;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
ApiInterceptorAction.PublishError = PublishError;
|
|
95
|
-
class SetRedirectUrl {
|
|
96
|
-
redirectUrl;
|
|
97
|
-
static type = '[ApiInterceptor] Set Redirect Url';
|
|
98
|
-
constructor(redirectUrl) {
|
|
99
|
-
this.redirectUrl = redirectUrl;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
ApiInterceptorAction.SetRedirectUrl = SetRedirectUrl;
|
|
103
|
-
})(ApiInterceptorAction || (ApiInterceptorAction = {}));
|
|
104
|
-
var HeaderAction;
|
|
105
|
-
(function (HeaderAction) {
|
|
106
|
-
class ToggleSidenav {
|
|
107
|
-
static type = '[Header] Toggle Sidenav';
|
|
108
|
-
}
|
|
109
|
-
HeaderAction.ToggleSidenav = ToggleSidenav;
|
|
110
|
-
class Logout {
|
|
111
|
-
static type = '[Header] User Logout';
|
|
112
|
-
}
|
|
113
|
-
HeaderAction.Logout = Logout;
|
|
114
|
-
})(HeaderAction || (HeaderAction = {}));
|
|
115
|
-
|
|
116
|
-
var AlertLevel;
|
|
117
|
-
(function (AlertLevel) {
|
|
118
|
-
AlertLevel["ERROR"] = "warn";
|
|
119
|
-
AlertLevel["INFO"] = "accent";
|
|
120
|
-
AlertLevel["SUCCESS"] = "success";
|
|
121
|
-
})(AlertLevel || (AlertLevel = {}));
|
|
122
|
-
|
|
123
|
-
const ReadPermission = 'Read';
|
|
124
|
-
const UpdatePermission = 'Update';
|
|
125
|
-
|
|
126
|
-
const BASE_URL = new InjectionToken('BASE_URL');
|
|
127
|
-
const API_URL = new InjectionToken('API_URL');
|
|
128
|
-
const PERMISSION_REQUIRED = new InjectionToken('PERMISSION_REQUIRED');
|
|
129
|
-
const AVAILABLE_PERMISSIONS = new InjectionToken('AVAILABLE_PERMISSIONS');
|
|
130
|
-
const AVAILABLE_DOMAINS = new InjectionToken('AVAILABLE_DOMAINS');
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Generated bundle index. Do not edit.
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
export { API_URL, AVAILABLE_DOMAINS, AVAILABLE_PERMISSIONS, AlertLevel, ApiInterceptorAction, AppAction, AuthenticationGuardAction, BASE_URL, HeaderAction, LoginAction, PERMISSION_REQUIRED, ReadPermission, UpdatePermission };
|
|
137
|
-
//# sourceMappingURL=cccteam-ccc-lib-src-types.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib-src-types.mjs","sources":["../../../projects/ccc-lib/src/types/auth.actions.ts","../../../projects/ccc-lib/src/types/core.actions.ts","../../../projects/ccc-lib/src/types/notification-message.ts","../../../projects/ccc-lib/src/types/permissions.ts","../../../projects/ccc-lib/src/types/tokens.ts","../../../projects/ccc-lib/src/types/cccteam-ccc-lib-src-types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\n// no-namespace rule is disabled because action hygiene prevents import pollution\n\nimport { CreateNotificationMessage } from './notification-message';\nexport namespace AuthenticationGuardAction {\n export class SetRedirectUrl {\n static readonly type = '[AuthenticationGuard] Set Redirect Url And Navigate To Login Page';\n constructor(public redirectUrl: string) {}\n }\n\n export class CheckUserSession {\n static readonly type = '[AuthenticationGuard] Check User Session';\n }\n}\n\nexport namespace LoginAction {\n export class Logout {\n static readonly type = '[Login] Auto Logout';\n }\n\n export class SetRedirectUrl {\n static readonly type = '[Login] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n\n export class PublishError {\n static readonly type = '[Login] Publish Error';\n constructor(public message: CreateNotificationMessage) {}\n }\n}\n\nexport namespace AppAction {\n export class CheckUserSession {\n static readonly type = '[App] Check User Session';\n }\n\n export class SetRedirectUrl {\n static readonly type = '[App] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n\n export class SetNavIdentifier {\n static readonly type = '[App] Set Nav Identifier';\n constructor(public identifier: string) {}\n }\n}\n","/* eslint-disable @typescript-eslint/no-namespace */\n// no-namespace rule is disabled because action hygiene prevents import pollution\n\nimport { CreateNotificationMessage } from './notification-message';\n\nexport namespace ApiInterceptorAction {\n export class BeginActivity {\n static readonly type = '[ApiInterceptor] Add Loading Activity';\n constructor(public process: string) {}\n }\n export class EndActivity {\n static readonly type = '[ApiInterceptor] Remove Loading Activity';\n constructor(public process: string) {}\n }\n export class PublishError {\n static readonly type = '[ApiInterceptor] Publish Error';\n constructor(public message: CreateNotificationMessage) {}\n }\n export class SetRedirectUrl {\n static readonly type = '[ApiInterceptor] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n}\n\nexport namespace HeaderAction {\n export class ToggleSidenav {\n static readonly type = '[Header] Toggle Sidenav';\n }\n\n export class Logout {\n static readonly type = '[Header] User Logout';\n }\n}\n","export enum AlertLevel {\n ERROR = 'warn',\n INFO = 'accent',\n SUCCESS = 'success',\n}\n\nexport interface CreateNotificationMessage {\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n\nexport interface NotificationMessage {\n id: number;\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n","type Brand<K, T> = K & { __brand: T };\n\nexport type Permission = Brand<string, 'Permission'>;\nexport type Resource = Brand<string, 'Resource'>;\nexport type Domain = Brand<string, 'Domain'>;\nexport type FieldName = Brand<string, 'FieldName'>;\nexport type Method = Brand<string, 'Method'>;\nexport type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;\n\nexport interface PermissionScope {\n resource: Resource;\n permission: Permission;\n domain: Domain;\n}\n\nexport const ReadPermission = 'Read' as Permission;\nexport const UpdatePermission = 'Update' as Permission;\n","import { InjectionToken } from '@angular/core';\nimport { Domain, Permission, Resource } from './permissions';\n\nexport const BASE_URL = new InjectionToken<string>('BASE_URL');\nexport const API_URL = new InjectionToken<string>('API_URL');\nexport const PERMISSION_REQUIRED = new InjectionToken<(resource: Resource, permission: Permission) => boolean>(\n 'PERMISSION_REQUIRED',\n);\n\nexport const AVAILABLE_PERMISSIONS = new InjectionToken<{\n Create: Permission;\n Delete: Permission;\n List: Permission;\n Read: Permission;\n Update: Permission;\n}>('AVAILABLE_PERMISSIONS');\nexport const AVAILABLE_DOMAINS = new InjectionToken<Record<string, Domain>[]>('AVAILABLE_DOMAINS');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AACA;AAGM,IAAW;AAAjB,CAAA,UAAiB,yBAAyB,EAAA;AACxC,IAAA,MAAa,cAAc,CAAA;AAEN,QAAA,WAAA;AADnB,QAAA,OAAgB,IAAI,GAAG,mEAAmE;AAC1F,QAAA,WAAA,CAAmB,WAAmB,EAAA;YAAnB,IAAW,CAAA,WAAA,GAAX,WAAW;;;AAFnB,IAAA,yBAAA,CAAA,cAAc,iBAG1B;AAED,IAAA,MAAa,gBAAgB,CAAA;AAC3B,QAAA,OAAgB,IAAI,GAAG,0CAA0C;;AADtD,IAAA,yBAAA,CAAA,gBAAgB,mBAE5B;AACH,CAAC,EATgB,yBAAyB,KAAzB,yBAAyB,GASzC,EAAA,CAAA,CAAA;AAEK,IAAW;AAAjB,CAAA,UAAiB,WAAW,EAAA;AAC1B,IAAA,MAAa,MAAM,CAAA;AACjB,QAAA,OAAgB,IAAI,GAAG,qBAAqB;;AADjC,IAAA,WAAA,CAAA,MAAM,SAElB;AAED,IAAA,MAAa,cAAc,CAAA;AAEN,QAAA,WAAA;AADnB,QAAA,OAAgB,IAAI,GAAG,0BAA0B;AACjD,QAAA,WAAA,CAAmB,WAAmB,EAAA;YAAnB,IAAW,CAAA,WAAA,GAAX,WAAW;;;AAFnB,IAAA,WAAA,CAAA,cAAc,iBAG1B;AAED,IAAA,MAAa,YAAY,CAAA;AAEJ,QAAA,OAAA;AADnB,QAAA,OAAgB,IAAI,GAAG,uBAAuB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;MAC9C,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;MAGV,qBAAqB,GAAG,IAAI,cAAc,CAMpD,uBAAuB;MACb,iBAAiB,GAAG,IAAI,cAAc,CAA2B,mBAAmB;;AChBjG;;AAEG;;;;"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as i3 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { EventEmitter, inject, Component, Input, Output } from '@angular/core';
|
|
5
|
-
import * as i2 from '@angular/material/button';
|
|
6
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
-
import * as i1 from '@angular/material/icon';
|
|
8
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
-
import * as i4 from '@angular/router';
|
|
10
|
-
import { RouterModule } from '@angular/router';
|
|
11
|
-
import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
|
|
12
|
-
|
|
13
|
-
class AlertComponent {
|
|
14
|
-
error;
|
|
15
|
-
dismiss = new EventEmitter();
|
|
16
|
-
errors = inject(NotificationService);
|
|
17
|
-
ngOnInit() {
|
|
18
|
-
if (this.error.duration === undefined) {
|
|
19
|
-
this.error.duration = 30000;
|
|
20
|
-
}
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
this.dismissAlert();
|
|
23
|
-
}, this.error.duration);
|
|
24
|
-
}
|
|
25
|
-
dismissAlert() {
|
|
26
|
-
if (this.error.id !== undefined) {
|
|
27
|
-
this.errors.dismissGlobalNotification(this.error);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.3", type: AlertComponent, isStandalone: true, selector: "ccc-alert", inputs: { error: "error" }, outputs: { dismiss: "dismiss" }, ngImport: i0, template: "<div class=\"alert\" [ngClass]=\"error.level\">\n <div class=\"message\">\n <span>{{ error.message }}</span>\n </div>\n <div class=\"alert-end\">\n @if (error.link) {\n <span [routerLink]=\"error.link\" class=\"link\">View</span>\n }\n <button (click)=\"dismissAlert()\" mat-icon-button aria-label=\"Close Alert\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".alert{margin:auto;border:1px solid;max-width:450px;border-radius:5px;background-color:#d3d3d3;display:flex;flex-direction:row;align-items:center;justify-content:space-between}.message{padding-left:15px;max-width:400px;display:flex;justify-content:space-between}.alert-end{display:flex;flex-direction:row;align-items:center;gap:5px}.link{cursor:pointer}.link:hover{text-decoration:underline}.warn{border-color:red;background-color:#fff5f4}.accent{border-color:#dfb51d;background-color:#fff8e0}.success{border-color:#4caf50;background-color:#f0fff0}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
32
|
-
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: AlertComponent, decorators: [{
|
|
34
|
-
type: Component,
|
|
35
|
-
args: [{ selector: 'ccc-alert', imports: [MatIconModule, MatButtonModule, CommonModule, RouterModule], template: "<div class=\"alert\" [ngClass]=\"error.level\">\n <div class=\"message\">\n <span>{{ error.message }}</span>\n </div>\n <div class=\"alert-end\">\n @if (error.link) {\n <span [routerLink]=\"error.link\" class=\"link\">View</span>\n }\n <button (click)=\"dismissAlert()\" mat-icon-button aria-label=\"Close Alert\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".alert{margin:auto;border:1px solid;max-width:450px;border-radius:5px;background-color:#d3d3d3;display:flex;flex-direction:row;align-items:center;justify-content:space-between}.message{padding-left:15px;max-width:400px;display:flex;justify-content:space-between}.alert-end{display:flex;flex-direction:row;align-items:center;gap:5px}.link{cursor:pointer}.link:hover{text-decoration:underline}.warn{border-color:red;background-color:#fff5f4}.accent{border-color:#dfb51d;background-color:#fff8e0}.success{border-color:#4caf50;background-color:#f0fff0}\n"] }]
|
|
36
|
-
}], propDecorators: { error: [{
|
|
37
|
-
type: Input,
|
|
38
|
-
args: [{ required: true }]
|
|
39
|
-
}], dismiss: [{
|
|
40
|
-
type: Output
|
|
41
|
-
}] } });
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Generated bundle index. Do not edit.
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
export { AlertComponent };
|
|
48
|
-
//# sourceMappingURL=cccteam-ccc-lib-src-ui-alert.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib-src-ui-alert.mjs","sources":["../../../projects/ccc-lib/src/ui-alert/alert.component.ts","../../../projects/ccc-lib/src/ui-alert/alert.component.html","../../../projects/ccc-lib/src/ui-alert/cccteam-ccc-lib-src-ui-alert.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { RouterModule } from '@angular/router';\nimport { NotificationMessage } from '@cccteam/ccc-lib/src/types';\nimport { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';\n\n@Component({\n selector: 'ccc-alert',\n templateUrl: './alert.component.html',\n styleUrls: ['./alert.component.scss'],\n imports: [MatIconModule, MatButtonModule, CommonModule, RouterModule],\n})\nexport class AlertComponent implements OnInit {\n @Input({ required: true }) error!: NotificationMessage;\n @Output() dismiss = new EventEmitter();\n\n errors = inject(NotificationService);\n ngOnInit(): void {\n if (this.error.duration === undefined) {\n this.error.duration = 30000;\n }\n\n setTimeout(() => {\n this.dismissAlert();\n }, this.error.duration);\n }\n\n dismissAlert(): void {\n if (this.error.id !== undefined) {\n this.errors.dismissGlobalNotification(this.error);\n }\n }\n}\n","<div class=\"alert\" [ngClass]=\"error.level\">\n <div class=\"message\">\n <span>{{ error.message }}</span>\n </div>\n <div class=\"alert-end\">\n @if (error.link) {\n <span [routerLink]=\"error.link\" class=\"link\">View</span>\n }\n <button (click)=\"dismissAlert()\" mat-icon-button aria-label=\"Close Alert\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAca,cAAc,CAAA;AACE,IAAA,KAAK;AACtB,IAAA,OAAO,GAAG,IAAI,YAAY,EAAE;AAEtC,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;IACpC,QAAQ,GAAA;QACN,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE;AACrC,YAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK;;QAG7B,UAAU,CAAC,MAAK;YACd,IAAI,CAAC,YAAY,EAAE;AACrB,SAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;;IAGzB,YAAY,GAAA;QACV,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC;;;uGAjB1C,cAAc,EAAA,IAAA,EAAA,EAAA,EAA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EAAA,MAAA,EAAA,CAAA,wiBAAA,CAAA,EAAA;8BAG1C,KAAK,EAAA,CAAA;sBAA/B,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACf,OAAO,EAAA,CAAA;sBAAhB;;;AEhBH;;AAEG;;;;"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, Injectable } from '@angular/core';
|
|
4
|
-
import { AppAction, ApiInterceptorAction, LoginAction, HeaderAction } from '@cccteam/ccc-lib/src/types';
|
|
5
|
-
import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
|
|
6
|
-
import { Action, Selector, State } from '@ngxs/store';
|
|
7
|
-
import { patch } from '@ngxs/store/operators';
|
|
8
|
-
|
|
9
|
-
const initState = {
|
|
10
|
-
loading: [],
|
|
11
|
-
sidenavOpened: true,
|
|
12
|
-
currentSidenavIdentifier: '',
|
|
13
|
-
};
|
|
14
|
-
let CoreState = class CoreState {
|
|
15
|
-
notifications = inject(NotificationService);
|
|
16
|
-
static sidenavOpened(state) {
|
|
17
|
-
return state?.sidenavOpened;
|
|
18
|
-
}
|
|
19
|
-
static isLoading(state) {
|
|
20
|
-
return state.loading.length > 0;
|
|
21
|
-
}
|
|
22
|
-
static currentSidenavIdentifier(state) {
|
|
23
|
-
return state.currentSidenavIdentifier;
|
|
24
|
-
}
|
|
25
|
-
setNavIdentifier(ctx, action) {
|
|
26
|
-
ctx.setState(patch({
|
|
27
|
-
currentSidenavIdentifier: action.identifier,
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
publishError(ctx, action) {
|
|
31
|
-
this.notifications.addGlobalNotification(action.message);
|
|
32
|
-
}
|
|
33
|
-
beginActivity(ctx, action) {
|
|
34
|
-
const state = ctx.getState();
|
|
35
|
-
ctx.patchState({
|
|
36
|
-
loading: [action.process, ...state.loading],
|
|
37
|
-
});
|
|
38
|
-
return ctx.getState();
|
|
39
|
-
}
|
|
40
|
-
endActivity(ctx, action) {
|
|
41
|
-
const loading = ctx.getState().loading;
|
|
42
|
-
// There can be multiple activities running with the same process signature
|
|
43
|
-
const index = loading.findIndex((activity) => activity === action.process);
|
|
44
|
-
if (index !== -1) {
|
|
45
|
-
const newLoading = [...loading.slice(0, index), ...loading.slice(index + 1)];
|
|
46
|
-
ctx.patchState({
|
|
47
|
-
loading: newLoading,
|
|
48
|
-
});
|
|
49
|
-
return ctx.getState();
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
toggleSidenav(ctx) {
|
|
54
|
-
ctx.setState(patch({
|
|
55
|
-
sidenavOpened: !ctx.getState().sidenavOpened,
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CoreState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
59
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CoreState });
|
|
60
|
-
};
|
|
61
|
-
__decorate([
|
|
62
|
-
Action([AppAction.SetNavIdentifier])
|
|
63
|
-
], CoreState.prototype, "setNavIdentifier", null);
|
|
64
|
-
__decorate([
|
|
65
|
-
Action([ApiInterceptorAction.PublishError, LoginAction.PublishError])
|
|
66
|
-
], CoreState.prototype, "publishError", null);
|
|
67
|
-
__decorate([
|
|
68
|
-
Action([ApiInterceptorAction.BeginActivity])
|
|
69
|
-
], CoreState.prototype, "beginActivity", null);
|
|
70
|
-
__decorate([
|
|
71
|
-
Action([ApiInterceptorAction.EndActivity])
|
|
72
|
-
], CoreState.prototype, "endActivity", null);
|
|
73
|
-
__decorate([
|
|
74
|
-
Action([HeaderAction.ToggleSidenav])
|
|
75
|
-
], CoreState.prototype, "toggleSidenav", null);
|
|
76
|
-
__decorate([
|
|
77
|
-
Selector()
|
|
78
|
-
], CoreState, "sidenavOpened", null);
|
|
79
|
-
__decorate([
|
|
80
|
-
Selector()
|
|
81
|
-
], CoreState, "isLoading", null);
|
|
82
|
-
__decorate([
|
|
83
|
-
Selector()
|
|
84
|
-
], CoreState, "currentSidenavIdentifier", null);
|
|
85
|
-
CoreState = __decorate([
|
|
86
|
-
State({
|
|
87
|
-
name: 'coreState',
|
|
88
|
-
defaults: initState,
|
|
89
|
-
})
|
|
90
|
-
], CoreState);
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CoreState, decorators: [{
|
|
92
|
-
type: Injectable
|
|
93
|
-
}], propDecorators: { setNavIdentifier: [], publishError: [], beginActivity: [], endActivity: [], toggleSidenav: [] } });
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Generated bundle index. Do not edit.
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
export { CoreState };
|
|
100
|
-
//# sourceMappingURL=cccteam-ccc-lib-src-ui-core-state.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib-src-ui-core-state.mjs","sources":["../../../projects/ccc-lib/src/ui-core-state/core.state.ts","../../../projects/ccc-lib/src/ui-core-state/cccteam-ccc-lib-src-ui-core-state.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport {\n ApiInterceptorAction,\n AppAction,\n CreateNotificationMessage,\n HeaderAction,\n LoginAction,\n} from '@cccteam/ccc-lib/src/types';\nimport { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\nimport { patch } from '@ngxs/store/operators';\n\ninterface CoreStateModel {\n loading: string[];\n sidenavOpened: boolean;\n currentSidenavIdentifier: string;\n}\n\nconst initState: CoreStateModel = {\n loading: [],\n sidenavOpened: true,\n currentSidenavIdentifier: '',\n};\n\n@State<CoreStateModel>({\n name: 'coreState',\n defaults: initState,\n})\n@Injectable()\nexport class CoreState {\n private notifications = inject(NotificationService);\n\n @Selector()\n static sidenavOpened(state: CoreStateModel): boolean {\n return state?.sidenavOpened;\n }\n\n @Selector()\n static isLoading(state: CoreStateModel): boolean {\n return state.loading.length > 0;\n }\n\n @Selector()\n static currentSidenavIdentifier(state: CoreStateModel): string {\n return state.currentSidenavIdentifier;\n }\n\n @Action([AppAction.SetNavIdentifier])\n setNavIdentifier(ctx: StateContext<CoreStateModel>, action: AppAction.SetNavIdentifier): void {\n ctx.setState(\n patch({\n currentSidenavIdentifier: action.identifier,\n }),\n );\n }\n\n @Action([ApiInterceptorAction.PublishError, LoginAction.PublishError])\n publishError(ctx: StateContext<CoreStateModel>, action: { message: CreateNotificationMessage }): void {\n this.notifications.addGlobalNotification(action.message);\n }\n\n @Action([ApiInterceptorAction.BeginActivity])\n beginActivity(ctx: StateContext<CoreStateModel>, action: { process: string }): CoreStateModel {\n const state = ctx.getState();\n ctx.patchState({\n loading: [action.process, ...state.loading],\n });\n return ctx.getState();\n }\n\n @Action([ApiInterceptorAction.EndActivity])\n endActivity(ctx: StateContext<CoreStateModel>, action: { process: string }): CoreStateModel | null {\n const loading = ctx.getState().loading;\n // There can be multiple activities running with the same process signature\n const index = loading.findIndex((activity) => activity === action.process);\n if (index !== -1) {\n const newLoading = [...loading.slice(0, index), ...loading.slice(index + 1)];\n ctx.patchState({\n loading: newLoading,\n });\n return ctx.getState();\n }\n return null;\n }\n\n @Action([HeaderAction.ToggleSidenav])\n toggleSidenav(ctx: StateContext<CoreStateModel>): void {\n ctx.setState(\n patch({\n sidenavOpened: !ctx.getState().sidenavOpened,\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAkBA,MAAM,SAAS,GAAmB;AAChC,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,wBAAwB,EAAE,EAAE;CAC7B;AAOY,IAAA,SAAS,GAAf,MAA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,CAAA;AA3DM,UAAA,CAAA;AADN,IAAA,QAAQ;AAGR,CAAA,EAAA,SAAA,EAAA,eAAA,EAAA,IAAA,CAAA;AAGM,UAAA,CAAA;AADN,IAAA,QAAQ;AAGR,CAAA,EAAA,SAAA,EAAA,WAAA,EAAA,IAAA,CAAA;AAGM,UAAA,CAAA;AADN,IAAA,QAAQ;AAGR,CAAA,EAAA,SAAA,EAAA,0BAAA,EAAA,IAAA,CAAA;AAhBU,SAAS,GAAA,UAAA,CAAA;AALrB,IAAA,KAAK,CAAiB;AACrB,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,QAAQ,EAAE,SAAS;KACpB;AAEY,CAAA,EAAA,SAAS,CAgErB;2FAhEY,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB;AAoBC,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,gBAAgB,MAShB,YAAY,EAAA,EAAA,EAKZ,aAAa,EASb,EAAA,EAAA,WAAW,MAeX,aAAa,EAAA,EAAA,EAAA,EAAA,CAAA;;ACtFf;;AAEG;;;;"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, NgZone, Injectable } from '@angular/core';
|
|
3
|
-
import { Router } from '@angular/router';
|
|
4
|
-
import { BASE_URL, ApiInterceptorAction, AlertLevel } from '@cccteam/ccc-lib/src/types';
|
|
5
|
-
import { CUSTOM_HTTP_REQUEST_OPTIONS } from '@cccteam/ccc-lib/src/util-request-options';
|
|
6
|
-
import { Store } from '@ngxs/store';
|
|
7
|
-
import { catchError, throwError, finalize } from 'rxjs';
|
|
8
|
-
|
|
9
|
-
class ApiInterceptor {
|
|
10
|
-
store = inject(Store);
|
|
11
|
-
router = inject(Router);
|
|
12
|
-
ngZone = inject(NgZone);
|
|
13
|
-
baseUrl = inject(BASE_URL);
|
|
14
|
-
intercept(request, next) {
|
|
15
|
-
this.store.dispatch(new ApiInterceptorAction.BeginActivity(request.method + ' ' + request.url));
|
|
16
|
-
return next.handle(request).pipe(catchError((error) => {
|
|
17
|
-
if (error.status === 401) {
|
|
18
|
-
this.ngZone.run(() => {
|
|
19
|
-
this.store.dispatch(new ApiInterceptorAction.SetRedirectUrl(this.baseUrl + this.router.url));
|
|
20
|
-
this.router.navigate(['/login']);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
if (!request.context.get(CUSTOM_HTTP_REQUEST_OPTIONS).suppressGlobalError) {
|
|
24
|
-
const message = error.error?.message ?? error.message ?? error.error;
|
|
25
|
-
this.store.dispatch(new ApiInterceptorAction.PublishError({
|
|
26
|
-
message: message,
|
|
27
|
-
level: AlertLevel.ERROR,
|
|
28
|
-
link: '',
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
return throwError(() => error);
|
|
32
|
-
}), finalize(() => {
|
|
33
|
-
this.store.dispatch(new ApiInterceptorAction.EndActivity(request.method + ' ' + request.url));
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ApiInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ApiInterceptor });
|
|
38
|
-
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: ApiInterceptor, decorators: [{
|
|
40
|
-
type: Injectable
|
|
41
|
-
}] });
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Generated bundle index. Do not edit.
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
export { ApiInterceptor };
|
|
48
|
-
//# sourceMappingURL=cccteam-ccc-lib-src-ui-interceptor.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib-src-ui-interceptor.mjs","sources":["../../../projects/ccc-lib/src/ui-interceptor/api.interceptor.ts","../../../projects/ccc-lib/src/ui-interceptor/cccteam-ccc-lib-src-ui-interceptor.ts"],"sourcesContent":["import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { inject, Injectable, NgZone } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { AlertLevel, ApiInterceptorAction, BASE_URL } from '@cccteam/ccc-lib/src/types';\nimport { CUSTOM_HTTP_REQUEST_OPTIONS } from '@cccteam/ccc-lib/src/util-request-options';\nimport { Store } from '@ngxs/store';\nimport { catchError, finalize, Observable, throwError } from 'rxjs';\n\n@Injectable()\nexport class ApiInterceptor implements HttpInterceptor {\n private store = inject(Store);\n private router = inject(Router);\n private ngZone = inject(NgZone);\n private baseUrl = inject(BASE_URL);\n\n intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n this.store.dispatch(new ApiInterceptorAction.BeginActivity(request.method + ' ' + request.url));\n\n return next.handle(request).pipe(\n catchError((error: HttpErrorResponse): Observable<HttpEvent<unknown>> => {\n if (error.status === 401) {\n this.ngZone.run(() => {\n this.store.dispatch(new ApiInterceptorAction.SetRedirectUrl(this.baseUrl + this.router.url));\n this.router.navigate(['/login']);\n });\n }\n if (!request.context.get(CUSTOM_HTTP_REQUEST_OPTIONS).suppressGlobalError) {\n const message = error.error?.message ?? error.message ?? error.error;\n this.store.dispatch(\n new ApiInterceptorAction.PublishError({\n message: message,\n level: AlertLevel.ERROR,\n link: '',\n }),\n );\n }\n\n return throwError(() => error);\n }),\n finalize(() => {\n this.store.dispatch(new ApiInterceptorAction.EndActivity(request.method + ' ' + request.url));\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MASa,cAAc,CAAA;AACjB,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;A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ACZ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;SAC9F,CAAC,CACH;;uGAjCQ,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAd,cAAc,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACRD;;AAEG;;;;"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, Injectable } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
class NotificationService {
|
|
5
|
-
notificationId = 0;
|
|
6
|
-
_notifications = signal([]);
|
|
7
|
-
notifications = this._notifications.asReadonly();
|
|
8
|
-
/**
|
|
9
|
-
* Adds a new global notification.
|
|
10
|
-
* @param notification The notification message to add.
|
|
11
|
-
* @returns The unique ID assigned to the notification.
|
|
12
|
-
*/
|
|
13
|
-
addGlobalNotification(notification) {
|
|
14
|
-
const newNotification = {
|
|
15
|
-
...notification,
|
|
16
|
-
id: this.notificationId++,
|
|
17
|
-
};
|
|
18
|
-
this._notifications.update((current) => [...current, newNotification]);
|
|
19
|
-
return newNotification.id;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Dismisses a global notification by its ID.
|
|
23
|
-
* @param notificationId The ID of the notification to dismiss.
|
|
24
|
-
*/
|
|
25
|
-
dismissGlobalNotificationById(notificationId) {
|
|
26
|
-
this._notifications.update((current) => current.filter((notification) => notification.id !== notificationId));
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Dismisses a specific global notification.
|
|
30
|
-
* @param notification The notification to dismiss.
|
|
31
|
-
*/
|
|
32
|
-
dismissGlobalNotification(notification) {
|
|
33
|
-
this.dismissGlobalNotificationById(notification.id);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Updates an existing notification.
|
|
37
|
-
* @param updatedNotification The notification with updated information.
|
|
38
|
-
*/
|
|
39
|
-
updateNotification(updatedNotification) {
|
|
40
|
-
this._notifications.update((current) => current.map((notification) => notification.id === updatedNotification.id ? { ...notification, ...updatedNotification } : notification));
|
|
41
|
-
}
|
|
42
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
43
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: NotificationService, providedIn: 'root' });
|
|
44
|
-
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: NotificationService, decorators: [{
|
|
46
|
-
type: Injectable,
|
|
47
|
-
args: [{
|
|
48
|
-
providedIn: 'root',
|
|
49
|
-
}]
|
|
50
|
-
}] });
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Generated bundle index. Do not edit.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
export { NotificationService };
|
|
57
|
-
//# sourceMappingURL=cccteam-ccc-lib-src-ui-notification-service.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib-src-ui-notification-service.mjs","sources":["../../../projects/ccc-lib/src/ui-notification-service/notification.service.ts","../../../projects/ccc-lib/src/ui-notification-service/cccteam-ccc-lib-src-ui-notification-service.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage, NotificationMessage } from '@cccteam/ccc-lib/src/types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationService {\n private notificationId = 0;\n private _notifications = signal<NotificationMessage[]>([]);\n notifications = this._notifications.asReadonly();\n\n /**\n * Adds a new global notification.\n * @param notification The notification message to add.\n * @returns The unique ID assigned to the notification.\n */\n addGlobalNotification(notification: CreateNotificationMessage): number {\n const newNotification: NotificationMessage = {\n ...notification,\n id: this.notificationId++,\n };\n this._notifications.update((current) => [...current, newNotification]);\n return newNotification.id;\n }\n\n /**\n * Dismisses a global notification by its ID.\n * @param notificationId The ID of the notification to dismiss.\n */\n dismissGlobalNotificationById(notificationId: number): void {\n this._notifications.update((current) => current.filter((notification) => notification.id !== notificationId));\n }\n\n /**\n * Dismisses a specific global notification.\n * @param notification The notification to dismiss.\n */\n dismissGlobalNotification(notification: NotificationMessage): void {\n this.dismissGlobalNotificationById(notification.id);\n }\n\n /**\n * Updates an existing notification.\n * @param updatedNotification The notification with updated information.\n */\n updateNotification(updatedNotification: NotificationMessage): void {\n this._notifications.update((current) =>\n current.map((notification) =>\n notification.id === updatedNotification.id ? { ...notification, ...updatedNotification } : notification,\n ),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,mBAAmB,CAAA;IACtB,cAAc,GAAG,CAAC;AAClB,IAAA,cAAc,GAAG,MAAM,CAAwB,EAAE,CAAC;AAC1D,IAAA,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;AAEhD;;;;AAIG;AACH,IAAA,qBAAqB,CAAC,YAAuC,EAAA;AAC3D,QAAA,MAAM,eAAe,GAAwB;AAC3C,YAAA,GAAG,YAAY;AACf,YAAA,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE;SAC1B;AACD,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,GAAG,OAAO,EAAE,eAAe,CAAC,CAAC;QACtE,OAAO,eAAe,CAAC,EAAE;;AAG3B;;;AAGG;AACH,IAAA,6BAA6B,CAAC,cAAsB,EAAA;QAClD,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,EAAE,KAAK,cAAc,CAAC,CAAC;;AAG/G;;;AAGG;AACH,IAAA,yBAAyB,CAAC,YAAiC,EAAA;AACzD,QAAA,IAAI,CAAC,6BAA6B,CAAC,YAAY,CAAC,EAAE,CAAC;;AAGrD;;;AAGG;AACH,IAAA,kBAAkB,CAAC,mBAAwC,EAAA;AACzD,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KACjC,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,KACvB,YAAY,CAAC,EAAE,KAAK,mBAAmB,CAAC,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,GAAG,mBAAmB,EAAE,GAAG,YAAY,CACxG,CACF;;uGA5CQ,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA;;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import * as i3 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, DestroyRef, Component, Input } from '@angular/core';
|
|
5
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
-
import { MatExpansionModule } from '@angular/material/expansion';
|
|
8
|
-
import * as i1 from '@angular/material/icon';
|
|
9
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
10
|
-
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
11
|
-
import * as i2 from '@angular/router';
|
|
12
|
-
import { RouterModule } from '@angular/router';
|
|
13
|
-
import { Store } from '@ngxs/store';
|
|
14
|
-
import { HasPermissionDirective } from '@cccteam/ccc-lib/src/auth-has-permission';
|
|
15
|
-
import { CoreState } from '@cccteam/ccc-lib/src/ui-core-state';
|
|
16
|
-
import { tap } from 'rxjs';
|
|
17
|
-
|
|
18
|
-
class SidenavComponent {
|
|
19
|
-
store = inject(Store);
|
|
20
|
-
destroyRef = inject(DestroyRef);
|
|
21
|
-
navGroups;
|
|
22
|
-
currentNav = [];
|
|
23
|
-
ngOnInit() {
|
|
24
|
-
this.store
|
|
25
|
-
.select(CoreState.currentSidenavIdentifier)
|
|
26
|
-
.pipe(tap((identifier) => {
|
|
27
|
-
this.currentNav = this.updateNavItems(identifier);
|
|
28
|
-
}), takeUntilDestroyed(this.destroyRef))
|
|
29
|
-
.subscribe();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Updates the currentNav based on the identifier
|
|
33
|
-
* @param identifier
|
|
34
|
-
* @returns NavItem[]
|
|
35
|
-
* @memberof SidenavComponent
|
|
36
|
-
*/
|
|
37
|
-
updateNavItems(identifier) {
|
|
38
|
-
if (!this.navGroups) {
|
|
39
|
-
return [];
|
|
40
|
-
}
|
|
41
|
-
if (!this.navGroups[identifier]) {
|
|
42
|
-
// pick the first one if the identifier is not found so we don't break the UI
|
|
43
|
-
identifier = Object.keys(this.navGroups)[0];
|
|
44
|
-
}
|
|
45
|
-
return this.navGroups[identifier];
|
|
46
|
-
}
|
|
47
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.3", type: SidenavComponent, isStandalone: true, selector: "ccc-sidenav", inputs: { navGroups: "navGroups" }, ngImport: i0, template: "<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav; track navItem.label) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n", styles: [".nav-container{padding:0;height:100%}nav{max-width:100%;margin:0 10px}.nav-item{width:100%;height:48px;font-size:18px;display:flex;flex-direction:column;justify-content:center;color:#003b49;padding:0 15px;position:relative}.nav-item:hover{background-color:#0000000a;transition:background-color .1s ease}.nav-item:active{background-color:#0000001a;transition:background-color .1s ease}.link-header{color:#003b49;text-transform:uppercase;font-weight:700;font-size:12px;margin:20px 0 0 5px}.link-button{display:flex;flex-direction:row;width:100%}.link-button .icon{min-width:20px;margin-right:10px;display:flex;flex-direction:column;justify-content:center}.link-button .text{margin-right:10px;text-align:left;display:flex;flex-direction:row;justify-content:left;text-decoration:capitalize}.expandable-links{display:flex;flex-direction:column;width:100%;padding-left:30px}a:active,a:link,a:visited{color:#003b49!important}a{text-decoration:none}.active-link:before{content:\"\";position:absolute;left:3px;width:5px;height:38px;background-color:#003b49}.active-link{background-color:#0000000a;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatSidenavModule }, { kind: "directive", type: HasPermissionDirective, selector: "[cccHasPermission]", inputs: ["cccHasPermission"] }] });
|
|
49
|
-
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SidenavComponent, decorators: [{
|
|
51
|
-
type: Component,
|
|
52
|
-
args: [{ selector: 'ccc-sidenav', imports: [
|
|
53
|
-
MatIconModule,
|
|
54
|
-
RouterModule,
|
|
55
|
-
CommonModule,
|
|
56
|
-
MatExpansionModule,
|
|
57
|
-
MatButtonModule,
|
|
58
|
-
MatSidenavModule,
|
|
59
|
-
HasPermissionDirective,
|
|
60
|
-
], template: "<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav; track navItem.label) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n", styles: [".nav-container{padding:0;height:100%}nav{max-width:100%;margin:0 10px}.nav-item{width:100%;height:48px;font-size:18px;display:flex;flex-direction:column;justify-content:center;color:#003b49;padding:0 15px;position:relative}.nav-item:hover{background-color:#0000000a;transition:background-color .1s ease}.nav-item:active{background-color:#0000001a;transition:background-color .1s ease}.link-header{color:#003b49;text-transform:uppercase;font-weight:700;font-size:12px;margin:20px 0 0 5px}.link-button{display:flex;flex-direction:row;width:100%}.link-button .icon{min-width:20px;margin-right:10px;display:flex;flex-direction:column;justify-content:center}.link-button .text{margin-right:10px;text-align:left;display:flex;flex-direction:row;justify-content:left;text-decoration:capitalize}.expandable-links{display:flex;flex-direction:column;width:100%;padding-left:30px}a:active,a:link,a:visited{color:#003b49!important}a{text-decoration:none}.active-link:before{content:\"\";position:absolute;left:3px;width:5px;height:38px;background-color:#003b49}.active-link{background-color:#0000000a;position:relative}\n"] }]
|
|
61
|
-
}], propDecorators: { navGroups: [{
|
|
62
|
-
type: Input
|
|
63
|
-
}] } });
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Generated bundle index. Do not edit.
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
export { SidenavComponent };
|
|
70
|
-
//# sourceMappingURL=cccteam-ccc-lib-src-ui-sidenav.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib-src-ui-sidenav.mjs","sources":["../../../projects/ccc-lib/src/ui-sidenav/sidenav.component.ts","../../../projects/ccc-lib/src/ui-sidenav/sidenav.component.html","../../../projects/ccc-lib/src/ui-sidenav/cccteam-ccc-lib-src-ui-sidenav.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, DestroyRef, inject, Input, OnInit } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatSidenavModule } from '@angular/material/sidenav';\nimport { RouterModule } from '@angular/router';\nimport { Store } from '@ngxs/store';\n\nimport { HasPermissionDirective } from '@cccteam/ccc-lib/src/auth-has-permission';\nimport { PermissionScope } from '@cccteam/ccc-lib/src/types';\nimport { CoreState } from '@cccteam/ccc-lib/src/ui-core-state';\nimport { Observable, tap } from 'rxjs';\n\nexport interface NavItem {\n type: 'link' | 'header' | 'expandable';\n routerLink?: string[];\n label: string;\n icon?: string;\n permission?: PermissionScope;\n children?: NavItem[];\n isExpanded?: boolean;\n attentionCount?: Observable<number>;\n}\n\nexport type NavGroups = Record<string, NavItem[]>;\n\n@Component({\n selector: 'ccc-sidenav',\n templateUrl: './sidenav.component.html',\n styleUrls: ['./sidenav.component.scss'],\n imports: [\n MatIconModule,\n RouterModule,\n CommonModule,\n MatExpansionModule,\n MatButtonModule,\n MatSidenavModule,\n HasPermissionDirective,\n ],\n})\nexport class SidenavComponent implements OnInit {\n private store = inject(Store);\n private destroyRef = inject(DestroyRef);\n\n @Input() navGroups?: NavGroups;\n currentNav: NavItem[] = [];\n\n ngOnInit(): void {\n this.store\n .select(CoreState.currentSidenavIdentifier)\n .pipe(\n tap((identifier) => {\n this.currentNav = this.updateNavItems(identifier);\n }),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe();\n }\n\n /**\n * Updates the currentNav based on the identifier\n * @param identifier\n * @returns NavItem[]\n * @memberof SidenavComponent\n */\n updateNavItems(identifier: string): NavItem[] {\n if (!this.navGroups) {\n return [];\n }\n if (!this.navGroups[identifier]) {\n // pick the first one if the identifier is not found so we don't break the UI\n identifier = Object.keys(this.navGroups)[0];\n }\n return this.navGroups[identifier];\n }\n}\n","<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav; track navItem.label) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MA0Ca,gBAAgB,CAAA;AACnB,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAE9B,IAAA,SAAS;IAClB,UAAU,GAAc,EAAE;IAE1B,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC;AACF,aAAA,MAAM,CAAC,SAAS,CAAC,wBAAwB;AACzC,aAAA,IAAI,CACH,GAAG,CAAC,CAAC,UAAU,KAAI;YACjB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC;SAClD,CAAC,EACF,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC;AAEpC,aAAA,SAAS,EAAE;;AAGhB;;;;;AAKG;AACH,IAAA,cAAc,CAAC,UAAkB,EAAA;AAC/B,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACnB,YAAA,OAAO,EAAE;;QAEX,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;;AAE/B,YAAA,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAE7C,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;;uGAjCxB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,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A,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACZ,kBAAkB,EAClB,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,eAAe,EACf,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,gBAAgB,+BAChB,sBAAsB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAGb,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAd5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAGd,OAAA,EAAA;wBACP,aAAa;wBACb,YAAY;wBACZ,YAAY;wBACZ,kBAAkB;wBAClB,eAAe;wBACf,gBAAgB;wBAChB,sBAAsB;AACvB,qBAAA,EAAA,QAAA,EAAA,4uEAAA,EAAA,MAAA,EAAA,CAAA,slCAAA,CAAA,EAAA;8BAMQ,SAAS,EAAA,CAAA;sBAAjB;;;AE9CH;;AAEG;;;;"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HttpContextToken, HttpContext } from '@angular/common/http';
|
|
2
|
-
|
|
3
|
-
const CUSTOM_HTTP_REQUEST_OPTIONS = new HttpContextToken(() => ({
|
|
4
|
-
suppressGlobalError: false,
|
|
5
|
-
}));
|
|
6
|
-
function errorOptions(suppressGlobalError) {
|
|
7
|
-
return {
|
|
8
|
-
context: new HttpContext().set(CUSTOM_HTTP_REQUEST_OPTIONS, {
|
|
9
|
-
suppressGlobalError: suppressGlobalError ?? false,
|
|
10
|
-
}),
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Generated bundle index. Do not edit.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
export { CUSTOM_HTTP_REQUEST_OPTIONS, errorOptions };
|
|
19
|
-
//# sourceMappingURL=cccteam-ccc-lib-src-util-request-options.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib-src-util-request-options.mjs","sources":["../../../projects/ccc-lib/src/util-request-options/request-options.ts","../../../projects/ccc-lib/src/util-request-options/cccteam-ccc-lib-src-util-request-options.ts"],"sourcesContent":["import { HttpContext, HttpContextToken } from '@angular/common/http';\n\nexport interface CustomHttpRequestOptions {\n suppressGlobalError: boolean;\n}\n\nexport const CUSTOM_HTTP_REQUEST_OPTIONS = new HttpContextToken<CustomHttpRequestOptions>(() => ({\n suppressGlobalError: false,\n}));\n\nexport function errorOptions(suppressGlobalError: boolean | undefined): { context: HttpContext } {\n return {\n context: new HttpContext().set(CUSTOM_HTTP_REQUEST_OPTIONS, {\n suppressGlobalError: suppressGlobalError ?? false,\n }),\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAMa,MAAA,2BAA2B,GAAG,IAAI,gBAAgB,CAA2B,OAAO;AAC/F,IAAA,mBAAmB,EAAE,KAAK;AAC3B,CAAA,CAAC;AAEI,SAAU,YAAY,CAAC,mBAAwC,EAAA;IACnE,OAAO;QACL,OAAO,EAAE,IAAI,WAAW,EAAE,CAAC,GAAG,CAAC,2BAA2B,EAAE;YAC1D,mBAAmB,EAAE,mBAAmB,IAAI,KAAK;SAClD,CAAC;KACH;AACH;;AChBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib.mjs","sources":["../../../projects/ccc-lib/src/public-api.ts","../../../projects/ccc-lib/src/cccteam-ccc-lib.ts"],"sourcesContent":["/*\n * Public API Surface of ccc-lib\n */\n\n// Auth directives\nexport * from '@cccteam/ccc-lib/src/auth-has-permission';\n\n// Auth forms\nexport * from '@cccteam/ccc-lib/src/auth-forms';\n\n// Auth guards\nexport * from '@cccteam/ccc-lib/src/auth-authentication-guard';\nexport * from '@cccteam/ccc-lib/src/auth-authorization-guard';\n\n// Auth services\nexport * from '@cccteam/ccc-lib/src/auth-service';\n\n// Util\nexport * from '@cccteam/ccc-lib/src/util-request-options';\n\n// Auth state\nexport * from '@cccteam/ccc-lib/src/auth-state';\n\n// Types\nexport * from '@cccteam/ccc-lib/src/types';\n\n// Ui components\nexport * from '@cccteam/ccc-lib/src/ui-alert';\nexport * from '@cccteam/ccc-lib/src/ui-sidenav';\n\n// Ui interceptor\nexport * from '@cccteam/ccc-lib/src/ui-interceptor';\n\n// Ui services\nexport * from '@cccteam/ccc-lib/src/ui-notification-service';\n\n// Ui state\nexport * from '@cccteam/ccc-lib/src/ui-core-state';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;AAEG;AAEH;;ACJA;;AAEG"}
|
package/index.d.ts
DELETED
package/public-api.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from '@cccteam/ccc-lib/src/auth-has-permission';
|
|
2
|
-
export * from '@cccteam/ccc-lib/src/auth-forms';
|
|
3
|
-
export * from '@cccteam/ccc-lib/src/auth-authentication-guard';
|
|
4
|
-
export * from '@cccteam/ccc-lib/src/auth-authorization-guard';
|
|
5
|
-
export * from '@cccteam/ccc-lib/src/auth-service';
|
|
6
|
-
export * from '@cccteam/ccc-lib/src/util-request-options';
|
|
7
|
-
export * from '@cccteam/ccc-lib/src/auth-state';
|
|
8
|
-
export * from '@cccteam/ccc-lib/src/types';
|
|
9
|
-
export * from '@cccteam/ccc-lib/src/ui-alert';
|
|
10
|
-
export * from '@cccteam/ccc-lib/src/ui-sidenav';
|
|
11
|
-
export * from '@cccteam/ccc-lib/src/ui-interceptor';
|
|
12
|
-
export * from '@cccteam/ccc-lib/src/ui-notification-service';
|
|
13
|
-
export * from '@cccteam/ccc-lib/src/ui-core-state';
|