@cccteam/ccc-lib 0.0.14 → 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.
Files changed (202) hide show
  1. package/eslint.config.js +32 -0
  2. package/ng-package.json +11 -0
  3. package/package.json +4 -61
  4. package/src/auth-authentication-guard/authentication.guard.ts +40 -0
  5. package/src/auth-authentication-guard/index.ts +1 -0
  6. package/src/auth-authentication-guard/ng-package.json +6 -0
  7. package/src/auth-authorization-guard/authorization.guard.ts +17 -0
  8. package/src/auth-authorization-guard/index.ts +1 -0
  9. package/src/auth-authorization-guard/ng-package.json +6 -0
  10. package/src/auth-forms/ccc-field/ccc-field.component.html +1 -0
  11. package/src/auth-forms/ccc-field/ccc-field.component.scss +0 -0
  12. package/src/auth-forms/ccc-field/ccc-field.component.spec.ts +22 -0
  13. package/src/auth-forms/ccc-field/ccc-field.component.ts +74 -0
  14. package/src/auth-forms/form-helpers.ts +39 -0
  15. package/src/auth-forms/index.ts +3 -0
  16. package/src/auth-forms/ng-package.json +6 -0
  17. package/src/auth-has-permission/has-permission.directive.ts +34 -0
  18. package/src/auth-has-permission/index.ts +1 -0
  19. package/src/auth-has-permission/ng-package.json +6 -0
  20. package/src/auth-service/auth.service.ts +92 -0
  21. package/src/auth-service/index.ts +1 -0
  22. package/src/auth-service/ng-package.json +6 -0
  23. package/src/ccc-camel-case-to-title/camel-case-to-title.pipe.ts +23 -0
  24. package/src/ccc-camel-case-to-title/index.ts +1 -0
  25. package/src/ccc-camel-case-to-title/ng-package.json +6 -0
  26. package/src/ccc-grid/ccc-grid.component.ts +155 -0
  27. package/src/ccc-grid/index.ts +3 -0
  28. package/src/ccc-grid/ng-package.json +6 -0
  29. package/src/ccc-grid/table-button/table-button.component.html +16 -0
  30. package/src/ccc-grid/table-button/table-button.component.scss +5 -0
  31. package/src/ccc-grid/table-button/table-button.component.spec.ts +22 -0
  32. package/src/ccc-grid/table-button/table-button.component.ts +49 -0
  33. package/src/ccc-resource/can-deactivate.guard.ts +41 -0
  34. package/src/ccc-resource/compound-resource/compound-resource.component.html +57 -0
  35. package/src/ccc-resource/compound-resource/compound-resource.component.scss +86 -0
  36. package/src/ccc-resource/compound-resource/compound-resource.component.spec.ts +22 -0
  37. package/src/ccc-resource/compound-resource/compound-resource.component.ts +158 -0
  38. package/src/ccc-resource/concat-fns.ts +162 -0
  39. package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.html +12 -0
  40. package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.scss +0 -0
  41. package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.spec.ts +23 -0
  42. package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.ts +17 -0
  43. package/src/ccc-resource/form-state.service.ts +24 -0
  44. package/src/ccc-resource/format-fns.ts +49 -0
  45. package/src/ccc-resource/gui-constants.ts +88 -0
  46. package/src/ccc-resource/index.ts +23 -0
  47. package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.html +8 -0
  48. package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.scss +0 -0
  49. package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.spec.ts +22 -0
  50. package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.ts +12 -0
  51. package/src/ccc-resource/ng-package.json +6 -0
  52. package/src/ccc-resource/operation-types.ts +19 -0
  53. package/src/ccc-resource/padding-element/padding-element.component.html +1 -0
  54. package/src/ccc-resource/padding-element/padding-element.component.scss +3 -0
  55. package/src/ccc-resource/padding-element/padding-element.component.spec.ts +22 -0
  56. package/src/ccc-resource/padding-element/padding-element.component.ts +20 -0
  57. package/src/ccc-resource/resource-array-view/resource-array-view.component.html +81 -0
  58. package/src/ccc-resource/resource-array-view/resource-array-view.component.scss +21 -0
  59. package/src/ccc-resource/resource-array-view/resource-array-view.component.spec.ts +22 -0
  60. package/src/ccc-resource/resource-array-view/resource-array-view.component.ts +143 -0
  61. package/src/ccc-resource/resource-base/resource-base.component.spec.ts +22 -0
  62. package/src/ccc-resource/resource-base/resource-base.component.ts +11 -0
  63. package/src/ccc-resource/resource-cache.service.ts +232 -0
  64. package/src/ccc-resource/resource-create/resource-create.component.html +31 -0
  65. package/src/ccc-resource/resource-create/resource-create.component.scss +130 -0
  66. package/src/ccc-resource/resource-create/resource-create.component.spec.ts +22 -0
  67. package/src/ccc-resource/resource-create/resource-create.component.ts +303 -0
  68. package/src/ccc-resource/resource-field/base-field.directive.ts +102 -0
  69. package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.html +16 -0
  70. package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.scss +0 -0
  71. package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.spec.ts +22 -0
  72. package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.ts +15 -0
  73. package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.html +13 -0
  74. package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.scss +0 -0
  75. package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.spec.ts +23 -0
  76. package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.ts +50 -0
  77. package/src/ccc-resource/resource-field/fields/date-field/date-field.component.html +22 -0
  78. package/src/ccc-resource/resource-field/fields/date-field/date-field.component.scss +0 -0
  79. package/src/ccc-resource/resource-field/fields/date-field/date-field.component.spec.ts +22 -0
  80. package/src/ccc-resource/resource-field/fields/date-field/date-field.component.ts +14 -0
  81. package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.html +71 -0
  82. package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.scss +9 -0
  83. package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.spec.ts +22 -0
  84. package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.ts +207 -0
  85. package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.html +38 -0
  86. package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.scss +3 -0
  87. package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.spec.ts +22 -0
  88. package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.ts +87 -0
  89. package/src/ccc-resource/resource-field/fields/number-field/number-field.component.html +23 -0
  90. package/src/ccc-resource/resource-field/fields/number-field/number-field.component.scss +6 -0
  91. package/src/ccc-resource/resource-field/fields/number-field/number-field.component.spec.ts +22 -0
  92. package/src/ccc-resource/resource-field/fields/number-field/number-field.component.ts +14 -0
  93. package/src/ccc-resource/resource-field/fields/text-field/text-field.component.html +29 -0
  94. package/src/ccc-resource/resource-field/fields/text-field/text-field.component.scss +6 -0
  95. package/src/ccc-resource/resource-field/fields/text-field/text-field.component.spec.ts +22 -0
  96. package/src/ccc-resource/resource-field/fields/text-field/text-field.component.ts +23 -0
  97. package/src/ccc-resource/resource-field/resource-field.component.html +112 -0
  98. package/src/ccc-resource/resource-field/resource-field.component.scss +7 -0
  99. package/src/ccc-resource/resource-field/resource-field.component.spec.ts +22 -0
  100. package/src/ccc-resource/resource-field/resource-field.component.ts +214 -0
  101. package/src/ccc-resource/resource-layout/resource-layout.component.html +73 -0
  102. package/src/ccc-resource/resource-layout/resource-layout.component.scss +26 -0
  103. package/src/ccc-resource/resource-layout/resource-layout.component.spec.ts +22 -0
  104. package/src/ccc-resource/resource-layout/resource-layout.component.ts +176 -0
  105. package/src/ccc-resource/resource-list/ resource-list.component.spec.ts +22 -0
  106. package/src/ccc-resource/resource-list/resource-list.component.html +27 -0
  107. package/src/ccc-resource/resource-list/resource-list.component.scss +67 -0
  108. package/src/ccc-resource/resource-list/resource-list.component.ts +376 -0
  109. package/src/ccc-resource/resource-list-create/resource-list-create.component.html +71 -0
  110. package/src/ccc-resource/resource-list-create/resource-list-create.component.scss +9 -0
  111. package/src/ccc-resource/resource-list-create/resource-list-create.component.spec.ts +22 -0
  112. package/src/ccc-resource/resource-list-create/resource-list-create.component.ts +103 -0
  113. package/src/ccc-resource/resource-resolver/resource-resolver.component.html +1 -0
  114. package/src/ccc-resource/resource-resolver/resource-resolver.component.scss +0 -0
  115. package/src/ccc-resource/resource-resolver/resource-resolver.component.spec.ts +22 -0
  116. package/src/ccc-resource/resource-resolver/resource-resolver.component.ts +69 -0
  117. package/src/ccc-resource/resource-store.service.ts +93 -0
  118. package/src/ccc-resource/resource-view/resource-view.component.html +133 -0
  119. package/src/ccc-resource/resource-view/resource-view.component.scss +150 -0
  120. package/src/ccc-resource/resource-view/resource-view.component.spec.ts +22 -0
  121. package/src/ccc-resource/resource-view/resource-view.component.ts +354 -0
  122. package/src/ccc-resource/resources-helpers.ts +262 -0
  123. package/src/ccc-resource/utils/validator-utils.ts +6 -0
  124. package/{fesm2022/cccteam-ccc-lib.mjs → src/index.ts} +30 -8
  125. package/src/internal-types/index.ts +1 -0
  126. package/src/internal-types/ng-package.json +6 -0
  127. package/src/types/auth.actions.ts +46 -0
  128. package/src/types/configs.ts +952 -0
  129. package/src/types/constants.ts +1 -0
  130. package/src/types/core.actions.ts +33 -0
  131. package/src/types/index.ts +9 -0
  132. package/src/types/ng-package.json +6 -0
  133. package/src/types/notification-message.ts +20 -0
  134. package/src/types/permissions.ts +17 -0
  135. package/src/types/session-info.ts +10 -0
  136. package/src/types/tokens.ts +20 -0
  137. package/src/ui-alert/alert.component.html +13 -0
  138. package/src/ui-alert/alert.component.scss +48 -0
  139. package/src/ui-alert/alert.component.spec.ts +22 -0
  140. package/src/ui-alert/alert.component.ts +35 -0
  141. package/src/ui-alert/index.ts +1 -0
  142. package/src/ui-alert/ng-package.json +6 -0
  143. package/src/ui-core-service/index.ts +1 -0
  144. package/src/ui-core-service/ng-package.json +6 -0
  145. package/src/ui-core-service/ui-core.service.ts +34 -0
  146. package/src/ui-interceptor/api.interceptor.spec.ts +16 -0
  147. package/src/ui-interceptor/api.interceptor.ts +45 -0
  148. package/src/ui-interceptor/index.ts +1 -0
  149. package/src/ui-interceptor/ng-package.json +6 -0
  150. package/src/ui-notification-service/index.ts +1 -0
  151. package/src/ui-notification-service/ng-package.json +6 -0
  152. package/src/ui-notification-service/notification.service.ts +59 -0
  153. package/src/ui-sidenav/index.ts +1 -0
  154. package/src/ui-sidenav/ng-package.json +6 -0
  155. package/src/ui-sidenav/sidenav.component.html +60 -0
  156. package/src/ui-sidenav/sidenav.component.scss +99 -0
  157. package/src/ui-sidenav/sidenav.component.spec.ts +22 -0
  158. package/src/ui-sidenav/sidenav.component.ts +64 -0
  159. package/src/util-request-options/index.ts +1 -0
  160. package/src/util-request-options/ng-package.json +6 -0
  161. package/src/util-request-options/request-options.ts +17 -0
  162. package/tsconfig.lib.json +13 -0
  163. package/tsconfig.lib.prod.json +11 -0
  164. package/tsconfig.spec.json +15 -0
  165. package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs +0 -36
  166. package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs.map +0 -1
  167. package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs +0 -25
  168. package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs.map +0 -1
  169. package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs +0 -117
  170. package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs.map +0 -1
  171. package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs +0 -44
  172. package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs.map +0 -1
  173. package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs +0 -88
  174. package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs.map +0 -1
  175. package/fesm2022/cccteam-ccc-lib-src-types.mjs +0 -137
  176. package/fesm2022/cccteam-ccc-lib-src-types.mjs.map +0 -1
  177. package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs +0 -48
  178. package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs.map +0 -1
  179. package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs +0 -41
  180. package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs.map +0 -1
  181. package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs +0 -50
  182. package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs.map +0 -1
  183. package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs +0 -63
  184. package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs.map +0 -1
  185. package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs +0 -60
  186. package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs.map +0 -1
  187. package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs +0 -19
  188. package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs.map +0 -1
  189. package/fesm2022/cccteam-ccc-lib.mjs.map +0 -1
  190. package/index.d.ts +0 -12
  191. package/src/auth-authentication-guard/index.d.ts +0 -6
  192. package/src/auth-authorization-guard/index.d.ts +0 -6
  193. package/src/auth-forms/index.d.ts +0 -45
  194. package/src/auth-has-permission/index.d.ts +0 -15
  195. package/src/auth-service/index.d.ts +0 -36
  196. package/src/types/index.d.ts +0 -133
  197. package/src/ui-alert/index.d.ts +0 -16
  198. package/src/ui-core-service/index.d.ts +0 -20
  199. package/src/ui-interceptor/index.d.ts +0 -16
  200. package/src/ui-notification-service/index.d.ts +0 -33
  201. package/src/ui-sidenav/index.d.ts +0 -33
  202. package/src/util-request-options/index.d.ts +0 -12
@@ -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;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OAAgB,IAAI,GAAG,sBAAsB;;AADlC,IAAA,YAAA,CAAA,MAAM,SAElB;AACH,CAAC,EARgB,YAAY,KAAZ,YAAY,GAQ5B,EAAA,CAAA,CAAA;;IChCW;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,MAAc;AACd,IAAA,UAAA,CAAA,MAAA,CAAA,GAAA,QAAe;AACf,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAJW,UAAU,KAAV,UAAU,GAIrB,EAAA,CAAA,CAAA;;ACWM,MAAM,cAAc,GAAG;AACvB,MAAM,gBAAgB,GAAG;;MCbnB,QAAQ,GAAG,IAAI,cAAc,CAAS,UAAU;MAChD,OAAO,GAAG,IAAI,cAAc,CAAS,SAAS;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, Output, Input, Component } 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: "20.0.0", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
31
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", 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], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { 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: "20.0.0", 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,SAA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AAA,CAAA;kBAN1B,SAAS;+BACE,WAAW,EAAA,OAAA,EAGZ,CAAC,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,CAAC,EAAA,QAAA,EAAA,mZAAA,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,41 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, signal, computed, Injectable } from '@angular/core';
3
- import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
4
-
5
- class UiCoreService {
6
- notifications = inject(NotificationService);
7
- loadingSignal = signal([]);
8
- sidenavOpened = signal(true);
9
- currentSidenavIdentifier = signal('');
10
- loading = this.loadingSignal.asReadonly();
11
- isLoading = computed(() => this.loading().length > 0);
12
- publishError(message) {
13
- this.notifications.addGlobalNotification(message);
14
- }
15
- beginActivity(process) {
16
- if (!this.loading().includes(process)) {
17
- this.loadingSignal.update((current) => [...current, process]);
18
- }
19
- }
20
- endActivity(process) {
21
- this.loadingSignal.update((current) => current.filter((p) => p !== process));
22
- }
23
- toggleSidenav() {
24
- this.sidenavOpened.update((opened) => !opened);
25
- }
26
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: UiCoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: UiCoreService, providedIn: 'root' });
28
- }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: UiCoreService, decorators: [{
30
- type: Injectable,
31
- args: [{
32
- providedIn: 'root',
33
- }]
34
- }] });
35
-
36
- /**
37
- * Generated bundle index. Do not edit.
38
- */
39
-
40
- export { UiCoreService };
41
- //# sourceMappingURL=cccteam-ccc-lib-src-ui-core-service.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cccteam-ccc-lib-src-ui-core-service.mjs","sources":["../../../projects/ccc-lib/src/ui-core-service/ui-core.service.ts","../../../projects/ccc-lib/src/ui-core-service/cccteam-ccc-lib-src-ui-core-service.ts"],"sourcesContent":["import { computed, inject, Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage } from '@cccteam/ccc-lib/src/types';\nimport { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UiCoreService {\n notifications = inject(NotificationService);\n loadingSignal = signal([] as string[]);\n sidenavOpened = signal(true);\n currentSidenavIdentifier = signal('');\n\n private loading = this.loadingSignal.asReadonly();\n isLoading = computed(() => this.loading().length > 0);\n\n publishError(message: CreateNotificationMessage): void {\n this.notifications.addGlobalNotification(message);\n }\n\n beginActivity(process: string): void {\n if (!this.loading().includes(process)) {\n this.loadingSignal.update((current) => [...current, process]);\n }\n }\n\n endActivity(process: string): void {\n this.loadingSignal.update((current) => current.filter((p) => p !== process));\n }\n\n toggleSidenav(): void {\n this.sidenavOpened.update((opened) => !opened);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,aAAa,CAAA;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAC3C,IAAA,aAAa,GAAG,MAAM,CAAC,EAAc,CAAC;AACtC,IAAA,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC;AAC5B,IAAA,wBAAwB,GAAG,MAAM,CAAC,EAAE,CAAC;AAE7B,IAAA,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;AACjD,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAErD,IAAA,YAAY,CAAC,OAAkC,EAAA;AAC7C,QAAA,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,OAAO,CAAC;;AAGnD,IAAA,aAAa,CAAC,OAAe,EAAA;QAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AACrC,YAAA,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC;;;AAIjE,IAAA,WAAW,CAAC,OAAe,EAAA;QACzB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,CAAC;;IAG9E,aAAa,GAAA;AACX,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC;;uGAxBrC,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
@@ -1,50 +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 { AuthService } from '@cccteam/ccc-lib/src/auth-service';
5
- import { BASE_URL, AlertLevel } from '@cccteam/ccc-lib/src/types';
6
- import { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';
7
- import { CUSTOM_HTTP_REQUEST_OPTIONS } from '@cccteam/ccc-lib/src/util-request-options';
8
- import { catchError, throwError, finalize } from 'rxjs';
9
-
10
- class ApiInterceptor {
11
- ui = inject(UiCoreService);
12
- auth = inject(AuthService);
13
- router = inject(Router);
14
- ngZone = inject(NgZone);
15
- baseUrl = inject(BASE_URL);
16
- intercept(request, next) {
17
- this.ui.beginActivity(request.method + ' ' + request.url);
18
- return next.handle(request).pipe(catchError((error) => {
19
- if (error.status === 401) {
20
- this.ngZone.run(() => {
21
- this.auth.redirectUrl.set(this.baseUrl + this.router.url);
22
- this.router.navigate(['/login']);
23
- });
24
- }
25
- if (!request.context.get(CUSTOM_HTTP_REQUEST_OPTIONS).suppressGlobalError) {
26
- const message = error.error?.message ?? error.message ?? error.error;
27
- this.ui.publishError({
28
- message: message,
29
- level: AlertLevel.ERROR,
30
- link: '',
31
- });
32
- }
33
- return throwError(() => error);
34
- }), finalize(() => {
35
- this.ui.endActivity(request.method + ' ' + request.url);
36
- }));
37
- }
38
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ApiInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
39
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ApiInterceptor });
40
- }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ApiInterceptor, decorators: [{
42
- type: Injectable
43
- }] });
44
-
45
- /**
46
- * Generated bundle index. Do not edit.
47
- */
48
-
49
- export { ApiInterceptor };
50
- //# 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 { AuthService } from '@cccteam/ccc-lib/src/auth-service';\nimport { AlertLevel, BASE_URL } from '@cccteam/ccc-lib/src/types';\nimport { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';\nimport { CUSTOM_HTTP_REQUEST_OPTIONS } from '@cccteam/ccc-lib/src/util-request-options';\nimport { catchError, finalize, Observable, throwError } from 'rxjs';\n\n@Injectable()\nexport class ApiInterceptor implements HttpInterceptor {\n private ui = inject(UiCoreService);\n private auth = inject(AuthService);\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.ui.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.auth.redirectUrl.set(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.ui.publishError({\n message: message,\n level: AlertLevel.ERROR,\n link: '',\n });\n }\n\n return throwError(() => error);\n }),\n finalize(() => {\n this.ui.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":";;;;;;;;;MAUa,cAAc,CAAA;AACjB,IAAA,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC;AAC1B,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,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IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAd,cAAc,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACTD;;AAEG;;;;"}
@@ -1,63 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { signal, Injectable } from '@angular/core';
3
-
4
- class NotificationService {
5
- notificationId = signal(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
- this.notificationId.update((id) => id + 1);
15
- const newNotification = {
16
- ...notification,
17
- id: this.notificationId(),
18
- };
19
- const existingNotification = this._notifications().find((n) => n.message === newNotification.message);
20
- if (existingNotification) {
21
- this.updateNotification({ ...existingNotification, ...newNotification });
22
- return existingNotification.id;
23
- }
24
- this._notifications.update((current) => [...current, newNotification]);
25
- return newNotification.id;
26
- }
27
- /**
28
- * Dismisses a global notification by its ID.
29
- * @param notificationId The ID of the notification to dismiss.
30
- */
31
- dismissGlobalNotificationById(notificationId) {
32
- this._notifications.update((current) => current.filter((notification) => notification.id !== notificationId));
33
- }
34
- /**
35
- * Dismisses a specific global notification.
36
- * @param notification The notification to dismiss.
37
- */
38
- dismissGlobalNotification(notification) {
39
- this.dismissGlobalNotificationById(notification.id);
40
- }
41
- /**
42
- * Updates an existing notification.
43
- * @param updatedNotification The notification with updated information.
44
- */
45
- updateNotification(updatedNotification) {
46
- this._notifications.update((current) => current.map((notification) => notification.id === updatedNotification.id ? { ...notification, ...updatedNotification } : notification));
47
- }
48
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
49
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationService, providedIn: 'root' });
50
- }
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationService, decorators: [{
52
- type: Injectable,
53
- args: [{
54
- providedIn: 'root',
55
- }]
56
- }] });
57
-
58
- /**
59
- * Generated bundle index. Do not edit.
60
- */
61
-
62
- export { NotificationService };
63
- //# 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 = signal(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 this.notificationId.update((id) => id + 1);\n const newNotification: NotificationMessage = {\n ...notification,\n id: this.notificationId(),\n };\n const existingNotification = this._notifications().find((n) => n.message === newNotification.message);\n if (existingNotification) {\n this.updateNotification({ ...existingNotification, ...newNotification });\n return existingNotification.id;\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;AACtB,IAAA,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC;AAC1B,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,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAC1C,QAAA,MAAM,eAAe,GAAwB;AAC3C,YAAA,GAAG,YAAY;AACf,YAAA,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE;SAC1B;QACD,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,KAAK,eAAe,CAAC,OAAO,CAAC;QACrG,IAAI,oBAAoB,EAAE;YACxB,IAAI,CAAC,kBAAkB,CAAC,EAAE,GAAG,oBAAoB,EAAE,GAAG,eAAe,EAAE,CAAC;YACxE,OAAO,oBAAoB,CAAC,EAAE;;AAEhC,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;;uGAlDQ,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,60 +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, computed, Input, Component } from '@angular/core';
5
- import { MatButtonModule } from '@angular/material/button';
6
- import { MatExpansionModule } from '@angular/material/expansion';
7
- import * as i1 from '@angular/material/icon';
8
- import { MatIconModule } from '@angular/material/icon';
9
- import { MatSidenavModule } from '@angular/material/sidenav';
10
- import * as i2 from '@angular/router';
11
- import { RouterModule } from '@angular/router';
12
- import { HasPermissionDirective } from '@cccteam/ccc-lib/src/auth-has-permission';
13
- import { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';
14
-
15
- class SidenavComponent {
16
- ui = inject(UiCoreService);
17
- navGroups;
18
- currentNav = computed(() => {
19
- return this.updateNavItems(this.ui.currentSidenavIdentifier());
20
- });
21
- /**
22
- * Updates the currentNav based on the identifier
23
- * @param identifier
24
- * @returns NavItem[]
25
- * @memberof SidenavComponent
26
- */
27
- updateNavItems(identifier) {
28
- if (!this.navGroups) {
29
- return [];
30
- }
31
- if (!this.navGroups[identifier]) {
32
- // pick the first one if the identifier is not found so we don't break the UI
33
- identifier = Object.keys(this.navGroups)[0];
34
- }
35
- return this.navGroups[identifier];
36
- }
37
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
38
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", 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) {\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"] }] });
39
- }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SidenavComponent, decorators: [{
41
- type: Component,
42
- args: [{ selector: 'ccc-sidenav', imports: [
43
- MatIconModule,
44
- RouterModule,
45
- CommonModule,
46
- MatExpansionModule,
47
- MatButtonModule,
48
- MatSidenavModule,
49
- HasPermissionDirective,
50
- ], template: "<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav(); track navItem) {\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"] }]
51
- }], propDecorators: { navGroups: [{
52
- type: Input
53
- }] } });
54
-
55
- /**
56
- * Generated bundle index. Do not edit.
57
- */
58
-
59
- export { SidenavComponent };
60
- //# 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, computed, inject, Input, Signal } from '@angular/core';\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';\n\nimport { HasPermissionDirective } from '@cccteam/ccc-lib/src/auth-has-permission';\nimport { PermissionScope } from '@cccteam/ccc-lib/src/types';\nimport { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';\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?: Signal<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 {\n ui = inject(UiCoreService);\n\n @Input() navGroups?: NavGroups;\n currentNav = computed(() => {\n return this.updateNavItems(this.ui.currentSidenavIdentifier());\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) {\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":";;;;;;;;;;;;;;MAuCa,gBAAgB,CAAA;AAC3B,IAAA,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC;AAEjB,IAAA,SAAS;AAClB,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,wBAAwB,EAAE,CAAC;AAChE,KAAC,CAAC;AAEF;;;;;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;;uGAtBxB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA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A,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,wuEAAA,EAAA,MAAA,EAAA,CAAA,slCAAA,CAAA,EAAA;8BAKQ,SAAS,EAAA,CAAA;sBAAjB;;;AE1CH;;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 service\nexport * from '@cccteam/ccc-lib/src/auth-service';\n\n// UI Core service\nexport * from '@cccteam/ccc-lib/src/ui-core-service';\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// Util\nexport * from '@cccteam/ccc-lib/src/util-request-options';\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 * 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
@@ -1,12 +0,0 @@
1
- export * from '@cccteam/ccc-lib/src/auth-service';
2
- export * from '@cccteam/ccc-lib/src/ui-core-service';
3
- export * from '@cccteam/ccc-lib/src/auth-has-permission';
4
- export * from '@cccteam/ccc-lib/src/auth-forms';
5
- export * from '@cccteam/ccc-lib/src/auth-authentication-guard';
6
- export * from '@cccteam/ccc-lib/src/auth-authorization-guard';
7
- export * from '@cccteam/ccc-lib/src/util-request-options';
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';
@@ -1,6 +0,0 @@
1
- import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2
- import { Observable } from 'rxjs';
3
-
4
- declare const AuthenticationGuard: (route: ActivatedRouteSnapshot, routerState: RouterStateSnapshot) => Observable<boolean>;
5
-
6
- export { AuthenticationGuard };
@@ -1,6 +0,0 @@
1
- import { Signal } from '@angular/core';
2
- import { ActivatedRouteSnapshot } from '@angular/router';
3
-
4
- declare const AuthorizationGuard: (route: ActivatedRouteSnapshot) => Signal<boolean>;
5
-
6
- export { AuthorizationGuard };
@@ -1,45 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { OnInit, Signal } from '@angular/core';
3
- import { AuthService } from '@cccteam/ccc-lib/src/auth-service';
4
- import { Resource, Domain } from '@cccteam/ccc-lib/src/types';
5
- import { FormGroup, FormArray } from '@angular/forms';
6
-
7
- declare enum InputMode {
8
- Read = "read",
9
- Edit = "edit"
10
- }
11
- declare class CccInputFieldComponent implements OnInit {
12
- auth: AuthService;
13
- className: _angular_core.InputSignal<unknown>;
14
- mode: _angular_core.InputSignal<InputMode>;
15
- resource: _angular_core.InputSignal<Resource>;
16
- domain: _angular_core.InputSignal<Domain>;
17
- value: _angular_core.InputSignal<unknown>;
18
- name: _angular_core.InputSignal<string>;
19
- inputMode: typeof InputMode;
20
- canEdit: Signal<boolean>;
21
- canEditSelector: boolean;
22
- canRead: Signal<boolean>;
23
- canReadSelector: boolean;
24
- ngOnInit(): void;
25
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<CccInputFieldComponent, never>;
26
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CccInputFieldComponent, "ccc-input-field", never, { "className": { "alias": "className"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": true; "isSignal": true; }; "resource": { "alias": "resource"; "required": true; "isSignal": true; }; "domain": { "alias": "domain"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "name": { "alias": "name"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
27
- }
28
-
29
- /**
30
- * Accepts a FormGroup and compares it to an object to return the dirty form values
31
- * as a sparse object
32
- * @param form - FormGroup
33
- * @param compareData - object to compare form values against
34
- * @returns Partial<T>
35
- * @example sparseFormData<UserCreate>(this.userForm, initUser)
36
- */
37
- declare function sparseFormData<T>(form: FormGroup, compareData: T): T;
38
- /**
39
- * Accepts a FormArray and removes empty strings
40
- * @param formArray - FormArray
41
- * @returns FormArray
42
- */
43
- declare function cleanStringFormArray(formArray: FormArray): FormArray;
44
-
45
- export { CccInputFieldComponent, InputMode, cleanStringFormArray, sparseFormData };
@@ -1,15 +0,0 @@
1
- import { PermissionScope } from '@cccteam/ccc-lib/src/types';
2
- import * as i0 from '@angular/core';
3
-
4
- declare class HasPermissionDirective {
5
- private auth;
6
- private templateRef;
7
- private viewContainer;
8
- private scope;
9
- set cccHasPermission(scope: PermissionScope);
10
- constructor();
11
- static ɵfac: i0.ɵɵFactoryDeclaration<HasPermissionDirective, never>;
12
- static ɵdir: i0.ɵɵDirectiveDeclaration<HasPermissionDirective, "[cccHasPermission]", never, { "cccHasPermission": { "alias": "cccHasPermission"; "required": false; }; }, {}, never, never, true, never>;
13
- }
14
-
15
- export { HasPermissionDirective };
@@ -1,36 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { SessionInfo, PermissionScope, Resource, Permission } from '@cccteam/ccc-lib/src/types';
4
- import { Observable } from 'rxjs';
5
-
6
- declare class AuthService {
7
- private apiUrl;
8
- http: HttpClient;
9
- private authenticatedSignal;
10
- private sessionInfoSignal;
11
- redirectUrl: _angular_core.WritableSignal<string>;
12
- authenticated: _angular_core.Signal<boolean>;
13
- sessionInfo: _angular_core.Signal<SessionInfo>;
14
- constructor(apiUrl: string);
15
- private static permissionFn;
16
- hasPermission(scope?: PermissionScope): boolean;
17
- static requiresPermission(resource: Resource, permission: Permission): boolean;
18
- private initializePermissionFn;
19
- /**
20
- * Logs a user out.
21
- *
22
- * @returns Observable with a boolean indicating whether they were logged out.
23
- */
24
- logout(): Observable<boolean>;
25
- /**
26
- * Checks a user's session with the server.
27
- *
28
- * @returns Observable with the user session info
29
- */
30
- checkUserSession(): Observable<SessionInfo>;
31
- loginRoute(): string;
32
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuthService, never>;
33
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<AuthService>;
34
- }
35
-
36
- export { AuthService };