@indice/ng-components 0.2.139 → 0.2.141

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 (228) hide show
  1. package/README.md +4 -4
  2. package/{src/assets/styles/indice-ng-icons-inline.css → _styles.css} +3501 -2286
  3. package/esm2020/indice-ng-components.mjs +5 -0
  4. package/esm2020/lib/controls/avatar-initials/avatar-initials.component.mjs +48 -0
  5. package/esm2020/lib/controls/collapsible-panel/collapsible-panel.component.mjs +20 -0
  6. package/esm2020/lib/controls/date-picker/date-picker.component.mjs +260 -0
  7. package/esm2020/lib/controls/drop-down-menu/drop-down-menu.component.mjs +68 -0
  8. package/esm2020/lib/controls/kpi-tile/kpi-tile.component.mjs +36 -0
  9. package/esm2020/lib/controls/list-view/list-column.component.mjs +25 -0
  10. package/esm2020/lib/controls/list-view/list-details-section.component.mjs +17 -0
  11. package/esm2020/lib/controls/list-view/list-tile.component.mjs +17 -0
  12. package/esm2020/lib/controls/list-view/list-view-empty-state.component.mjs +29 -0
  13. package/esm2020/lib/controls/list-view/list-view.component.mjs +183 -0
  14. package/esm2020/lib/controls/nav-links-list/nav-links-list.component.mjs +37 -0
  15. package/esm2020/lib/controls/notifications-indicator/notifications-indicator.component.mjs +77 -0
  16. package/esm2020/lib/controls/pager/pager.component.mjs +130 -0
  17. package/esm2020/lib/controls/side-pane/side-pane.component.mjs +72 -0
  18. package/esm2020/lib/controls/skeleton-loader/skeleton-loader.component.mjs +25 -0
  19. package/esm2020/lib/controls/toaster/toaster-container.component.mjs +28 -0
  20. package/esm2020/lib/controls/toaster/toaster.component.mjs +31 -0
  21. package/esm2020/lib/controls/toggle/toggle.component.mjs +64 -0
  22. package/esm2020/lib/directives/click-outside.directive.mjs +189 -0
  23. package/esm2020/lib/directives/dynamic-component-host.directive.mjs +17 -0
  24. package/esm2020/lib/helpers/base-list.component.mjs +181 -0
  25. package/esm2020/lib/icons.mjs +32 -0
  26. package/esm2020/lib/layouts/shell/shell-footer/shell-footer.component.mjs +19 -0
  27. package/esm2020/lib/layouts/shell/shell-header/shell-header.component.mjs +135 -0
  28. package/esm2020/lib/layouts/shell/shell-layout/shell-layout.component.mjs +101 -0
  29. package/esm2020/lib/layouts/views/form-layout/form-layout.component.mjs +80 -0
  30. package/esm2020/lib/layouts/views/model-view-layout/model-view-layout.component.mjs +49 -0
  31. package/esm2020/lib/layouts/views/side-view-layout/side-view-layout.component.mjs +98 -0
  32. package/esm2020/lib/layouts/views/view-layout/view-layout.component.mjs +104 -0
  33. package/esm2020/lib/ng-components.module.mjs +221 -0
  34. package/esm2020/lib/pages/auth/auth-callback/auth-callback.component.mjs +30 -0
  35. package/esm2020/lib/pages/auth/auth-renew/auth-renew.component.mjs +31 -0
  36. package/esm2020/lib/pages/auth/logged-out/logged-out.component.mjs +28 -0
  37. package/esm2020/lib/pages/http-status/error/error.component.mjs +17 -0
  38. package/esm2020/lib/pages/http-status/page-not-found/page-not-found.component.mjs +15 -0
  39. package/esm2020/lib/pages/http-status/unauthorized/unauthorized.component.mjs +14 -0
  40. package/esm2020/lib/pipes/address.pipe.mjs +21 -0
  41. package/esm2020/lib/pipes/duration-format.pipe.mjs +64 -0
  42. package/esm2020/lib/services/component-loader/component-loader-options.class.mjs +8 -0
  43. package/esm2020/lib/services/component-loader/component-loader.class.mjs +188 -0
  44. package/esm2020/lib/services/component-loader/component-loader.factory.mjs +32 -0
  45. package/esm2020/lib/services/component-loader/content-ref.class.mjs +13 -0
  46. package/esm2020/lib/services/modal-service/modal-backdrop-component.mjs +44 -0
  47. package/esm2020/lib/services/modal-service/modal-container-component.mjs +126 -0
  48. package/esm2020/lib/services/modal-service/modal-options.class.mjs +35 -0
  49. package/esm2020/lib/services/modal-service/modal-service.mjs +219 -0
  50. package/esm2020/lib/services/modal-service/modal-styles.class.mjs +11 -0
  51. package/esm2020/lib/services/modal-service/modal.class.mjs +27 -0
  52. package/esm2020/lib/services/toaster.service.mjs +24 -0
  53. package/esm2020/lib/tokens.mjs +5 -0
  54. package/esm2020/lib/types.mjs +117 -0
  55. package/esm2020/public-api.mjs +53 -0
  56. package/fesm2015/indice-ng-components.mjs +3268 -0
  57. package/fesm2015/indice-ng-components.mjs.map +1 -0
  58. package/fesm2020/indice-ng-components.mjs +3225 -0
  59. package/fesm2020/indice-ng-components.mjs.map +1 -0
  60. package/indice-ng-components.d.ts +5 -0
  61. package/lib/controls/avatar-initials/avatar-initials.component.d.ts +14 -0
  62. package/lib/controls/collapsible-panel/collapsible-panel.component.d.ts +10 -0
  63. package/lib/controls/date-picker/date-picker.component.d.ts +48 -0
  64. package/lib/controls/drop-down-menu/drop-down-menu.component.d.ts +25 -0
  65. package/lib/controls/kpi-tile/kpi-tile.component.d.ts +13 -0
  66. package/lib/controls/list-view/list-column.component.d.ts +9 -0
  67. package/lib/controls/list-view/list-details-section.component.d.ts +7 -0
  68. package/lib/controls/list-view/list-tile.component.d.ts +7 -0
  69. package/lib/controls/list-view/list-view-empty-state.component.d.ts +11 -0
  70. package/lib/controls/list-view/list-view.component.d.ts +55 -0
  71. package/lib/controls/nav-links-list/nav-links-list.component.d.ts +15 -0
  72. package/lib/controls/notifications-indicator/notifications-indicator.component.d.ts +23 -0
  73. package/lib/controls/pager/pager.component.d.ts +36 -0
  74. package/lib/controls/side-pane/side-pane.component.d.ts +18 -0
  75. package/lib/controls/skeleton-loader/skeleton-loader.component.d.ts +11 -0
  76. package/lib/controls/toaster/toaster-container.component.d.ts +13 -0
  77. package/lib/controls/toaster/toaster.component.d.ts +15 -0
  78. package/lib/controls/toggle/toggle.component.d.ts +19 -0
  79. package/lib/directives/click-outside.directive.d.ts +40 -0
  80. package/lib/directives/dynamic-component-host.directive.d.ts +9 -0
  81. package/lib/helpers/base-list.component.d.ts +42 -0
  82. package/lib/icons.d.ts +30 -0
  83. package/lib/layouts/shell/shell-footer/shell-footer.component.d.ts +8 -0
  84. package/lib/layouts/shell/shell-header/shell-header.component.d.ts +41 -0
  85. package/lib/layouts/shell/shell-layout/shell-layout.component.d.ts +28 -0
  86. package/lib/layouts/views/form-layout/form-layout.component.d.ts +24 -0
  87. package/lib/layouts/views/model-view-layout/model-view-layout.component.d.ts +25 -0
  88. package/lib/layouts/views/side-view-layout/side-view-layout.component.d.ts +28 -0
  89. package/lib/layouts/views/view-layout/view-layout.component.d.ts +31 -0
  90. package/lib/ng-components.module.d.ts +49 -0
  91. package/lib/pages/auth/auth-callback/auth-callback.component.d.ts +13 -0
  92. package/lib/pages/auth/auth-renew/auth-renew.component.d.ts +12 -0
  93. package/lib/pages/auth/logged-out/logged-out.component.d.ts +12 -0
  94. package/lib/pages/http-status/error/error.component.d.ts +8 -0
  95. package/lib/pages/http-status/page-not-found/page-not-found.component.d.ts +8 -0
  96. package/lib/pages/http-status/unauthorized/unauthorized.component.d.ts +8 -0
  97. package/lib/pipes/address.pipe.d.ts +8 -0
  98. package/lib/pipes/duration-format.pipe.d.ts +8 -0
  99. package/lib/services/component-loader/component-loader-options.class.d.ts +30 -0
  100. package/lib/services/component-loader/component-loader.class.d.ts +92 -0
  101. package/lib/services/component-loader/component-loader.factory.d.ts +24 -0
  102. package/lib/services/component-loader/content-ref.class.d.ts +12 -0
  103. package/lib/services/modal-service/modal-backdrop-component.d.ts +20 -0
  104. package/lib/services/modal-service/modal-container-component.d.ts +33 -0
  105. package/lib/services/modal-service/modal-options.class.d.ts +81 -0
  106. package/lib/services/modal-service/modal-service.d.ts +58 -0
  107. package/lib/services/modal-service/modal-styles.class.d.ts +10 -0
  108. package/lib/services/modal-service/modal.class.d.ts +43 -0
  109. package/lib/services/toaster.service.d.ts +11 -0
  110. package/lib/tokens.d.ts +5 -0
  111. package/lib/types.d.ts +153 -0
  112. package/{src/assets/styles/modal.css → modal.css} +157 -157
  113. package/package.json +24 -20
  114. package/{src/public-api.ts → public-api.d.ts} +43 -60
  115. package/CHANGELOG.md +0 -1
  116. package/karma.conf.js +0 -44
  117. package/ng-package.json +0 -10
  118. package/scripts/css-bundle.ts +0 -33
  119. package/src/_styles.css +0 -36
  120. package/src/_tests/utilities.service.spec.ts +0 -16
  121. package/src/assets/styles/avatar-initials.css +0 -37
  122. package/src/assets/styles/base.css +0 -46
  123. package/src/assets/styles/cards.css +0 -71
  124. package/src/assets/styles/collapsible-panel.css +0 -25
  125. package/src/assets/styles/components.css +0 -34
  126. package/src/assets/styles/date-picker.component.css +0 -0
  127. package/src/assets/styles/drop-down-menu.css +0 -50
  128. package/src/assets/styles/form-layout.css +0 -49
  129. package/src/assets/styles/list-view-empty-state.css +0 -0
  130. package/src/assets/styles/list-view.css +0 -64
  131. package/src/assets/styles/model-view-layout.css +0 -45
  132. package/src/assets/styles/nav-links.css +0 -35
  133. package/src/assets/styles/notifications-indicator.component.css +0 -43
  134. package/src/assets/styles/pager.css +0 -29
  135. package/src/assets/styles/shell-layout.css +0 -232
  136. package/src/assets/styles/side-pane.css +0 -46
  137. package/src/assets/styles/side-view-layout.css +0 -58
  138. package/src/assets/styles/toast.css +0 -72
  139. package/src/assets/styles/toggle.css +0 -26
  140. package/src/assets/styles/view-layout.css +0 -58
  141. package/src/lib/controls/avatar-initials/avatar-initials.component.html +0 -3
  142. package/src/lib/controls/avatar-initials/avatar-initials.component.ts +0 -47
  143. package/src/lib/controls/collapsible-panel/collapsible-panel.component.html +0 -15
  144. package/src/lib/controls/collapsible-panel/collapsible-panel.component.ts +0 -16
  145. package/src/lib/controls/date-picker/date-picker.component.html +0 -133
  146. package/src/lib/controls/date-picker/date-picker.component.ts +0 -258
  147. package/src/lib/controls/drop-down-menu/drop-down-menu.component.html +0 -61
  148. package/src/lib/controls/drop-down-menu/drop-down-menu.component.ts +0 -59
  149. package/src/lib/controls/kpi-tile/kpi-tile.component.html +0 -18
  150. package/src/lib/controls/kpi-tile/kpi-tile.component.ts +0 -26
  151. package/src/lib/controls/list-view/list-column.component.ts +0 -10
  152. package/src/lib/controls/list-view/list-details-section.component.ts +0 -8
  153. package/src/lib/controls/list-view/list-tile.component.ts +0 -8
  154. package/src/lib/controls/list-view/list-view-empty-state.component.html +0 -20
  155. package/src/lib/controls/list-view/list-view-empty-state.component.ts +0 -19
  156. package/src/lib/controls/list-view/list-view.component.html +0 -151
  157. package/src/lib/controls/list-view/list-view.component.ts +0 -146
  158. package/src/lib/controls/nav-links-list/nav-links-list.component.html +0 -27
  159. package/src/lib/controls/nav-links-list/nav-links-list.component.ts +0 -25
  160. package/src/lib/controls/notifications-indicator/notifications-indicator.component.html +0 -78
  161. package/src/lib/controls/notifications-indicator/notifications-indicator.component.ts +0 -75
  162. package/src/lib/controls/pager/pager.component.html +0 -33
  163. package/src/lib/controls/pager/pager.component.ts +0 -106
  164. package/src/lib/controls/side-pane/side-pane.component.html +0 -10
  165. package/src/lib/controls/side-pane/side-pane.component.ts +0 -59
  166. package/src/lib/controls/skeleton-loader/skeleton-loader.component.html +0 -112
  167. package/src/lib/controls/skeleton-loader/skeleton-loader.component.ts +0 -20
  168. package/src/lib/controls/toaster/toaster-container.component.html +0 -1
  169. package/src/lib/controls/toaster/toaster-container.component.ts +0 -27
  170. package/src/lib/controls/toaster/toaster.component.html +0 -103
  171. package/src/lib/controls/toaster/toaster.component.ts +0 -26
  172. package/src/lib/controls/toggle/toggle.component.html +0 -15
  173. package/src/lib/controls/toggle/toggle.component.ts +0 -58
  174. package/src/lib/directives/click-outside.directive.ts +0 -196
  175. package/src/lib/directives/dynamic-component-host.directive.ts +0 -7
  176. package/src/lib/directives/screen-size.directive.ts +0 -67
  177. package/src/lib/helpers/base-list.component.ts +0 -204
  178. package/src/lib/icons.ts +0 -39
  179. package/src/lib/layouts/shell/shell-footer/shell-footer.component.html +0 -71
  180. package/src/lib/layouts/shell/shell-footer/shell-footer.component.ts +0 -14
  181. package/src/lib/layouts/shell/shell-header/shell-header.component.html +0 -199
  182. package/src/lib/layouts/shell/shell-header/shell-header.component.ts +0 -111
  183. package/src/lib/layouts/shell/shell-layout/shell-layout.component.html +0 -36
  184. package/src/lib/layouts/shell/shell-layout/shell-layout.component.ts +0 -91
  185. package/src/lib/layouts/views/form-layout/form-layout.component.html +0 -67
  186. package/src/lib/layouts/views/form-layout/form-layout.component.ts +0 -66
  187. package/src/lib/layouts/views/model-view-layout/model-view-layout.component.html +0 -43
  188. package/src/lib/layouts/views/model-view-layout/model-view-layout.component.ts +0 -37
  189. package/src/lib/layouts/views/side-view-layout/side-view-layout.component.html +0 -36
  190. package/src/lib/layouts/views/side-view-layout/side-view-layout.component.ts +0 -67
  191. package/src/lib/layouts/views/view-layout/view-layout.component.html +0 -68
  192. package/src/lib/layouts/views/view-layout/view-layout.component.ts +0 -82
  193. package/src/lib/ng-components.module.ts +0 -135
  194. package/src/lib/pages/auth/auth-callback/auth-callback.component.html +0 -1
  195. package/src/lib/pages/auth/auth-callback/auth-callback.component.ts +0 -22
  196. package/src/lib/pages/auth/auth-renew/auth-renew.component.ts +0 -20
  197. package/src/lib/pages/auth/logged-out/logged-out.component.html +0 -1
  198. package/src/lib/pages/auth/logged-out/logged-out.component.ts +0 -22
  199. package/src/lib/pages/http-status/error/error.component.html +0 -13
  200. package/src/lib/pages/http-status/error/error.component.ts +0 -13
  201. package/src/lib/pages/http-status/page-not-found/page-not-found.component.html +0 -14
  202. package/src/lib/pages/http-status/page-not-found/page-not-found.component.ts +0 -14
  203. package/src/lib/pages/http-status/unauthorized/unauthorized.component.html +0 -15
  204. package/src/lib/pages/http-status/unauthorized/unauthorized.component.ts +0 -11
  205. package/src/lib/pipes/address.pipe.ts +0 -17
  206. package/src/lib/pipes/duration-format.pipe.ts +0 -67
  207. package/src/lib/services/component-loader/component-loader-options.class.ts +0 -31
  208. package/src/lib/services/component-loader/component-loader.class.ts +0 -226
  209. package/src/lib/services/component-loader/component-loader.factory.ts +0 -27
  210. package/src/lib/services/component-loader/content-ref.class.ts +0 -10
  211. package/src/lib/services/interceptors/bad-request.interceptor.ts +0 -34
  212. package/src/lib/services/modal-service/modal-backdrop-component.ts +0 -40
  213. package/src/lib/services/modal-service/modal-container-component.ts +0 -125
  214. package/src/lib/services/modal-service/modal-options.class.ts +0 -92
  215. package/src/lib/services/modal-service/modal-service.ts +0 -237
  216. package/src/lib/services/modal-service/modal-styles.class.ts +0 -11
  217. package/src/lib/services/modal-service/modal.class.ts +0 -45
  218. package/src/lib/services/shell-state-service.service.ts +0 -10
  219. package/src/lib/services/toaster.service.ts +0 -23
  220. package/src/lib/services/utilities.service.ts +0 -40
  221. package/src/lib/tokens.ts +0 -6
  222. package/src/lib/types.ts +0 -210
  223. package/src/test.ts +0 -28
  224. package/tsconfig.lib.json +0 -26
  225. package/tsconfig.lib.prod.json +0 -10
  226. package/tsconfig.spec.json +0 -17
  227. package/tslint.json +0 -17
  228. package/webpack.config.js +0 -36
@@ -1,111 +0,0 @@
1
- import { AuthService } from '@indice/ng-auth';
2
- import { Component, OnInit, OnDestroy, Inject, Input } from '@angular/core';
3
- import { User } from 'oidc-client';
4
- import { ActivatedRoute, Event, NavigationStart, Router } from '@angular/router';
5
- import { filter, share } from 'rxjs/operators';
6
- import { NavLink } from '../../../types';
7
- import { APP_LINKS, SHELL_CONFIG } from '../../../tokens';
8
- import { BehaviorSubject, isObservable, observable, Observable, of } from 'rxjs';
9
- import { Subscription } from 'rxjs';
10
-
11
- @Component({
12
- // tslint:disable-next-line:component-selector
13
- selector: 'lib-shell-header',
14
- templateUrl: './shell-header.component.html',
15
- })
16
- export class ShellHeaderComponent implements OnInit, OnDestroy {
17
- // tslint:disable-next-line:no-input-rename
18
- @Input('section-links') sectionLinksPath = 'main';
19
- // tslint:disable-next-line:no-input-rename
20
- @Input('profile-menu') profileMenuVisible = true;
21
- // tslint:disable-next-line:no-input-rename
22
- @Input('show-userName') showUserNameOnHeader: boolean | undefined = false;
23
- // tslint:disable-next-line:no-input-rename
24
- @Input('show-alerts') showAlerts: boolean | undefined = false;
25
- @Input() langs: string[] | undefined;
26
- // tslint:disable-next-line:no-input-rename
27
- @Input('current-lang') currentLang: string | undefined;
28
- @Input() border = true;
29
- public sectionLinks: Observable<NavLink[]> = of([]);
30
- public mobileMenuExpanded = false;
31
- public userMenuExpanded = false;
32
- protected routeSubject: Observable<Event>;
33
- protected routerSub$: Subscription | null = null;
34
- protected userSub$: Subscription | null = null;
35
- protected statusSub$: Subscription | null = null;
36
- public user: User | null = null;
37
- public avatarName: string | null = null;
38
- public activeFragment: any | null = null;
39
-
40
- constructor(
41
- @Inject(AuthService) protected authService: AuthService,
42
- @Inject(Router) protected router: Router,
43
- @Inject(ActivatedRoute) protected route: ActivatedRoute,
44
- @Inject(SHELL_CONFIG) public config: any,
45
- @Inject(APP_LINKS) public links: any) {
46
- this.routeSubject = this.router.events.pipe(filter((event) => event instanceof NavigationStart));
47
- }
48
-
49
- ngOnInit(): void {
50
- this.activeFragment = this.route.fragment.pipe(share());
51
- this.sectionLinks = this.links[this.sectionLinksPath] as Observable<NavLink[]>;
52
- this.routerSub$ = this.routeSubject.subscribe((event) => {
53
- this.mobileMenuExpanded = false;
54
- this.userMenuExpanded = false;
55
- });
56
- this.authService.loadUser().subscribe((user) => {
57
- this.setCurrentUser(user);
58
- }, error => {
59
- console.error(error);
60
- });
61
- // Detect user changes and display / or not user info accordingly...
62
- this.userSub$ = this.authService.user$.subscribe((user: any) => {
63
- // console.log('ShellHeaderComponent user subscription');
64
- this.setCurrentUser(user);
65
- });
66
- // set current lang if no current value from langs if any
67
- if (!this.currentLang && this.langs && this.langs.length > 0) {
68
- this.setCurrentLang(this.langs[0]);
69
- }
70
- }
71
-
72
- ngOnDestroy(): void {
73
-
74
- if (this.routerSub$) {
75
- this.routerSub$.unsubscribe();
76
- }
77
- // TODO: check authenticated user here before we start polling server status
78
- if (this.statusSub$) {
79
- this.statusSub$.unsubscribe();
80
- }
81
- if (this.userSub$) {
82
- this.userSub$.unsubscribe();
83
- }
84
- }
85
-
86
-
87
-
88
- // tslint:disable-next-line:typedef
89
- public onClickOutside($event: any) {
90
- this.userMenuExpanded = false;
91
- }
92
-
93
- public signin(event: any | null | undefined): void {
94
- if (event) {
95
- event.preventDefault();
96
- }
97
- this.authService.signinRedirect();
98
- }
99
-
100
- private setCurrentUser(user: any): void {
101
- this.user = user;
102
- if (this.user && this.user.profile) {
103
- this.avatarName = `${this.user.profile.given_name?.charAt(0)}${this.user.profile.family_name?.charAt(0)}`.toUpperCase();
104
- }
105
- }
106
-
107
- public setCurrentLang(lang: any): void {
108
- this.currentLang = lang;
109
- }
110
- }
111
-
@@ -1,36 +0,0 @@
1
- <div *ngIf="loaded" [style.display]="!loaded ? 'none':'block'" class="shell-container active-side-pane">
2
-
3
- <div class="shell-header-container" *ngIf="activeConfig.showHeader">
4
- <div [class]="activeConfig.fluid ? 'shell-header-container-inner-fluid' : 'shell-header-container-inner'">
5
- <ng-container *ngIf="activeConfig.customHeaderComponent">
6
- <div appDynamicComponentHost ="Header"></div>
7
- </ng-container>
8
- <lib-shell-header *ngIf="!activeConfig.customHeaderComponent"
9
- [langs]="activeConfig.langs"
10
- [show-userName]="activeConfig.showUserNameOnHeader"
11
- [show-alerts]="activeConfig.showAlertsOnHeader"></lib-shell-header>
12
- </div>
13
- </div>
14
-
15
- <main [class]="activeConfig.showHeader ? 'shell-content-container' : 'shell-content-container-no-header'">
16
- <div [class]="activeConfig.fluid ? 'shell-content-container-inner-fluid' : 'shell-content-container-inner'">
17
- <router-outlet></router-outlet>
18
- </div>
19
- </main>
20
-
21
- <div class="shell-footer-container" *ngIf="activeConfig.showFooter">
22
- <div [class]="activeConfig.fluid ? 'shell-footer-container-inner-fluid' : 'shell-footer-container-inner'">
23
- <ng-container *ngIf="activeConfig.customFooterComponent">
24
- <div appDynamicComponentHost hostName="Footer"></div>
25
- </ng-container>
26
- <lib-shell-footer *ngIf="!activeConfig.customFooterComponent"></lib-shell-footer>
27
- </div>
28
- </div>
29
-
30
- <lib-side-pane #rightPane>
31
- <router-outlet name="rightpane" (activate)="rightPane.onSidePaneActivated($event)" (deactivate)="rightPane.onSidePaneDeactivated($event)"></router-outlet>
32
- </lib-side-pane>
33
-
34
- <lib-toaster-container></lib-toaster-container>
35
-
36
- </div>
@@ -1,91 +0,0 @@
1
- import { SHELL_CONFIG } from './../../../tokens';
2
- import { IShellConfig, DefaultShellConfig } from './../../../types';
3
- import { AfterViewInit, Component, OnInit, OnDestroy, Inject, ViewChildren, QueryList, AfterViewChecked } from '@angular/core';
4
- import { DOCUMENT, Location } from '@angular/common';
5
- import { ActivationStart, Router } from '@angular/router';
6
- import { filter } from 'rxjs/operators';
7
- import { Subscription, timer } from 'rxjs';
8
- import { DynamicComponentHostDirective } from '../../../directives/dynamic-component-host.directive';
9
- import { ComponentLoaderFactory } from '../../../services/component-loader/component-loader.factory';
10
-
11
- @Component({
12
- // tslint:disable-next-line:component-selector
13
- selector: 'lib-shell-layout',
14
- templateUrl: './shell-layout.component.html',
15
- })
16
- export class ShellLayoutComponent implements OnInit, OnDestroy, AfterViewInit, AfterViewChecked {
17
- @ViewChildren(DynamicComponentHostDirective)
18
- dynamicComponentHosts: QueryList<DynamicComponentHostDirective> | null = null;
19
- public showRightPaneSM = false;
20
- private routerSub$: Subscription | null = null;
21
- public activeConfig: IShellConfig = new DefaultShellConfig();
22
- public loaded = false;
23
- constructor(
24
- @Inject(DOCUMENT) private document: any,
25
- private router: Router,
26
- private location: Location,
27
- @Inject(SHELL_CONFIG) private config: IShellConfig | null,
28
- private componentLoaderFactory: ComponentLoaderFactory
29
- ) {
30
- if (!config) {
31
- config = new DefaultShellConfig();
32
- }
33
- this.activeConfig = config;
34
- }
35
-
36
- ngAfterViewChecked(): void {
37
- setTimeout(() => { this.loaded = true; }, 200);
38
- }
39
-
40
- ngOnInit(): void {
41
- this.routerSub$ = this.router.events.pipe(filter((event) => event instanceof ActivationStart)).subscribe((e) => {
42
- // console.log('ShellLayoutComponent ActivationStart', e);
43
- if ((e as ActivationStart)?.snapshot) {
44
- // console.log('ShellLayoutComponent ActivationStart snapshot', (e as ActivationStart)?.snapshot);
45
- if ((e as ActivationStart)?.snapshot?.data) {
46
- // console.log('ShellLayoutComponent ActivationStart snapshot data', (e as ActivationStart)?.snapshot.data);
47
- if ((e as ActivationStart)?.snapshot?.data.shell) {
48
- // console.log('ShellLayoutComponent ActivationStart snapshot data shell params',
49
- // (e as ActivationStart)?.snapshot.data.shell);
50
- this.activeConfig = (e as ActivationStart)?.snapshot.data.shell as IShellConfig;
51
- // console.log('ShellLayoutComponent activeConfig from route: ', this.activeConfig);
52
- if (this.activeConfig.customHeaderComponent) {
53
- this.initCustomComponents();
54
- }
55
- } else {
56
- this.activeConfig = this.config ? this.config : new DefaultShellConfig();
57
- // console.log('ShellLayoutComponent default activeConfig: ', this.activeConfig);
58
- }
59
- }
60
- }
61
- });
62
- }
63
-
64
- ngAfterViewInit(): void {
65
- this.initCustomComponents();
66
- }
67
-
68
- private initCustomComponents(): void {
69
- if (this.dynamicComponentHosts && this.dynamicComponentHosts.length > 0) {
70
- this.loadCustomComponent(this.dynamicComponentHosts.find((_) => _.hostName === 'Header'));
71
- // since you're not using it...
72
- // this.loadCustomComponent(this.dynamicComponentHosts.find(_ => _.hostName === 'Footer'));
73
- }
74
- }
75
-
76
- ngOnDestroy(): void {
77
- if (this.routerSub$) {
78
- this.routerSub$.unsubscribe();
79
- }
80
- }
81
-
82
- private loadCustomComponent(host: DynamicComponentHostDirective | undefined): void {
83
- if (host) {
84
- const viewContainerRef = host.viewContainerRef;
85
- if (viewContainerRef && this.activeConfig.customHeaderComponent) {
86
- const clf = this.componentLoaderFactory.createLoader(viewContainerRef);
87
- const headerCompRef = clf.attach(this.activeConfig.customHeaderComponent).to(viewContainerRef.element).show();
88
- }
89
- }
90
- }
91
- }
@@ -1,67 +0,0 @@
1
- <div class="form-layout-container">
2
- <div class="form-header" *ngIf="title || subTitle || actions">
3
- <div class="form-header-inner">
4
- <h3 class="form-title">
5
- {{ title }}
6
- </h3>
7
- <p class="form-subtitle">
8
- {{ subTitle }}
9
- </p>
10
- </div>
11
- <div class="form-header-actions">
12
- <ng-container *ngFor="let action of actions" [ngSwitch]="action.type">
13
- <ng-container *ngSwitchCase="'search'">
14
- <label for="search" class="sr-only">Search</label>
15
- <div class="search-container">
16
- <div class="pointer-events-none absolute inset-y-0 left-0 pl-3 flex items-center">
17
- <!--<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
18
- <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
19
- </svg>-->
20
- </div>
21
- <input id="search"
22
- #search
23
- class="form-search-input"
24
- [placeholder]="searchPlaceholder"
25
- type="search"
26
- name="search"
27
- (input)="searchActionType(search.value)">
28
- </div>
29
- <button type="button"
30
- href="#"
31
- class="btn-form-view-header-search"
32
- [title]="action.tooltip"
33
- (click)="searchActionClick(action, search.value)">
34
- <i [class]="action.icon"></i>
35
- </button>
36
- </ng-container>
37
- <ng-container *ngSwitchCase="'router-link'">
38
- <button type="button"
39
- href="#"
40
- class="ml-1 btn-form-view-header"
41
- [title]="action.tooltip"
42
- (click)="routerLinkActionClick(action)">
43
- <i [class]="action.icon"></i>
44
- </button>
45
- </ng-container>
46
- <ng-container *ngSwitchDefault>
47
- <button type="button"
48
- class="ml-1 btn-form-view-header"
49
- [title]="action.tooltip"
50
- (click)="emitActionClick(action)">
51
- <i [class]="action.icon"></i>
52
- </button>
53
- </ng-container>
54
- </ng-container>
55
- </div>
56
- </div>
57
- <div class="form-content-container">
58
- <div [ngClass]="{'form-content-container-inner': actions}">
59
- <ng-content></ng-content>
60
- </div>
61
- </div>
62
- <lib-side-pane #formPane (onComplete)="onSidePaneDeactivated($event)">
63
- <router-outlet name="formRightPane"
64
- (activate)="formPane.onSidePaneActivated($event)"
65
- (deactivate)="formPane.onSidePaneDeactivated($event)"></router-outlet>
66
- </lib-side-pane>
67
- </div>
@@ -1,66 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
2
- import { Router } from '@angular/router';
3
- import { fromEvent } from 'rxjs';
4
- import { map, filter, debounceTime, distinctUntilChanged } from 'rxjs/operators';
5
- import { RouterViewAction, ViewAction } from '../../../types';
6
-
7
- @Component({
8
- selector: 'lib-form-layout',
9
- templateUrl: './form-layout.component.html'
10
- })
11
- export class FormLayoutComponent implements OnInit {
12
- // tslint:disable-next-line:no-input-rename
13
- @ViewChild('search') private searchInput$?: ElementRef;
14
- @Input() title: string | null = null;
15
- // tslint:disable-next-line:no-input-rename
16
- @Input('search-placeholder') searchPlaceholder: string | null = 'αναζήτηση'
17
- @Input() actions: ViewAction[] | null = null;
18
- // tslint:disable-next-line:no-input-rename
19
- @Input('sub-title') subTitle: string | null = null;
20
- // tslint:disable-next-line:no-output-on-prefix
21
- @Output() onAction: EventEmitter<ViewAction> = new EventEmitter<ViewAction>();
22
- // tslint:disable-next-line:no-output-on-prefix
23
- @Output() onSearch: EventEmitter<string> = new EventEmitter<string>();
24
- @Output() onComplete: EventEmitter<boolean> = new EventEmitter<boolean>();
25
-
26
- constructor(private router$: Router) { }
27
-
28
- ngOnInit(): void {
29
- if (this.searchInput$?.nativeElement){
30
- fromEvent(this.searchInput$.nativeElement, 'keyup').pipe(
31
- map((event: any) => {
32
- return event.target.value; // Get input value.
33
- }),
34
- filter(inputValue => inputValue.length >= 3 || inputValue.length === 0),
35
- // If character length greater than minimumSearchCharacters setting.
36
- debounceTime(1000), // Time in milliseconds between key events.
37
- distinctUntilChanged() // If previous query is different from current.
38
- ).subscribe();
39
- }
40
- }
41
-
42
- public onSidePaneDeactivated($event: any): void {
43
- this.onComplete.emit(true);
44
- }
45
-
46
- public emitActionClick(action: ViewAction): void {
47
- this.onAction.emit(action);
48
- }
49
-
50
- searchActionClick(action: ViewAction, text: string): void {
51
- this.onSearch.emit(text);
52
- }
53
-
54
- searchActionType(text: string): void {
55
- this.onSearch.emit(this.searchInput$?.nativeElement.value);
56
- }
57
-
58
- public routerLinkActionClick(action: RouterViewAction | any, relative: boolean = false): void {
59
- if (action.outlet) {
60
- this.router$.navigate(['', { outlets: { formRightPane: action.link } }]);
61
- } else {
62
- this.router$.navigate([action.link]);
63
- }
64
- }
65
-
66
- }
@@ -1,43 +0,0 @@
1
- <lib-view-layout [title]="title" [meta-items]="metaItems">
2
- <main class="model-view-container">
3
- <div class="model-view-container-inner">
4
- <aside class="model-view-aside">
5
- <section aria-labelledby="menu" class="details-view-aside-header-section">
6
- <div class="model-view-aside-header-container">
7
- <div class="model-view-aside-header-container-inner">
8
- <ng-content></ng-content>
9
- </div>
10
- <!-- menu items -->
11
- <div class="model-view-menu-container">
12
- <nav class="model-view-menu-nav">
13
- <div class="model-view-menu-item">
14
- <ng-container *ngFor="let section of primary">
15
- <a href="#"
16
- [routerLinkActive]="['view-nav-link-active']"
17
- [routerLink]="section.link"
18
- class="view-nav-link">
19
- {{section.text}}
20
- </a>
21
- </ng-container>
22
- </div>
23
- <div class="model-view-menu-item-far">
24
- <ng-container *ngFor="let section of secondary">
25
- <a href="#"
26
- [routerLinkActive]="['view-nav-link-active']"
27
- [routerLinkActiveOptions]="{ exact: true }"
28
- [routerLink]="section.link"
29
- class="view-nav-link">
30
- {{section.text}}
31
- </a>
32
- </ng-container>
33
- </div>
34
- </nav>
35
- </div>
36
- </div>
37
- </section>
38
- </aside>
39
- <div class="model-view-details-container">
40
- <router-outlet></router-outlet>
41
- </div>
42
- </div>
43
- </main>
@@ -1,37 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
- import { Location } from '@angular/common';
3
- import { HeaderMetaItem } from '../../../types';
4
-
5
- @Component({
6
- // tslint:disable-next-line:component-selector
7
- selector: 'lib-model-view-layout',
8
- templateUrl: './model-view-layout.component.html'
9
- })
10
- export class ModelViewLayoutComponent implements OnInit {
11
- public showRightPaneSM = false;
12
- @Input() title = 'no title';
13
- // tslint:disable-next-line:no-input-rename
14
- @Input('primary-links') primary: { text: string, link: string }[] | null = null;
15
- // tslint:disable-next-line:no-input-rename
16
- @Input('secondary-links') secondary: { text: string, link: string }[] | null = null;
17
- // tslint:disable-next-line:no-input-rename
18
- @Input('meta-items') metaItems: HeaderMetaItem[] | null = [
19
- // { key: 'test', icon: Icons.Badges, text: 'βρέθηκαν 200 αποτελέσματα' }
20
- ];
21
- constructor( private location: Location) { }
22
-
23
- ngOnInit(): void {
24
- }
25
-
26
- public onSidePaneActivated($event: any): void {
27
- this.showRightPaneSM = true;
28
- }
29
-
30
- public onSidePaneDeactivated($event: any): void {
31
- this.showRightPaneSM = false;
32
- }
33
-
34
- public closeSidePane(): void {
35
- this.location.back();
36
- }
37
- }
@@ -1,36 +0,0 @@
1
- <div class="side-view-layout-size-box">
2
- <div class="side-view-layout-container">
3
- <div class="side-view-layout-container-inner">
4
- <div class="side-view-layout-header-margins">
5
- <div class="side-view-layout-header-container">
6
- <h2 class="side-view-layout-header-title" id="slide-over-title">
7
- {{title}}
8
- </h2>
9
- <div class="side-view-layout-close-button-container">
10
- <button (click)="emitClose()" class="side-view-layout-close-button">
11
- <span class="sr-only">Close panel</span>
12
- <!-- Heroicon name: outline/x -->
13
- <svg class="side-view-layout-close-button-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
14
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
15
- </svg>
16
- </button>
17
- </div>
18
- </div>
19
- </div>
20
- <div class="side-view-layout-content-container">
21
- <!-- Replace with your content -->
22
- <ng-content></ng-content>
23
- <!-- /End replace -->
24
- </div>
25
- </div>
26
- <div *ngIf="showActions" class="side-view-layout-actions-container">
27
- <button *ngIf="cancelShow" (click)="emitCancel()" type="button" class="side-view-layout-action-button-cancel">
28
- {{cancelLabel}}
29
- </button>
30
- <button *ngIf="okShow" (click)="emitOK()" class="side-view-layout-action-button-submit" [disabled]="disabled">
31
- {{okLabel}}
32
- </button>
33
- </div>
34
- </div>
35
- </div>
36
-
@@ -1,67 +0,0 @@
1
- import { Router } from '@angular/router';
2
- import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
3
- import { Location } from '@angular/common';
4
-
5
- @Component({
6
- selector: 'lib-side-view-layout',
7
- templateUrl: './side-view-layout.component.html'
8
- })
9
- export class SideViewLayoutComponent implements OnInit {
10
- @Input() title: string | null = 'Πληροφορίες';
11
- @Input() showActions = true;
12
- @Input() disabled = false;
13
- // tslint:disable-next-line:no-input-rename
14
- @Input('return-path') returnPath: string | undefined;
15
- // tslint:disable-next-line:no-input-rename
16
- @Input('ok-label') okLabel = 'Αποθήκευση';
17
- // tslint:disable-next-line:no-input-rename
18
- @Input('ok-show') okShow = true;
19
- // tslint:disable-next-line:no-input-rename
20
- @Input('ok-close-dialog') closeOnOk = true;
21
- // tslint:disable-next-line:no-input-rename
22
- @Input('cancel-label') cancelLabel = 'Ακύρωση';
23
- // tslint:disable-next-line:no-input-rename
24
- @Input('cancel-show') cancelShow = true;
25
- // tslint:disable-next-line:no-input-rename
26
- @Input('force-location-back') forceLocationBack = false;
27
- // @Output() close = new EventEmitter<any>();
28
- @Output() cancel: EventEmitter<boolean> = new EventEmitter();
29
- @Output() ok: EventEmitter<boolean> = new EventEmitter();
30
-
31
- constructor(private location: Location, private router: Router) { }
32
-
33
- ngOnInit(): void {
34
- }
35
-
36
- public closeSidePane(): void {
37
- if (this.returnPath) {
38
- this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => this.router.navigateByUrl(this.returnPath || '/'));
39
- } else {
40
- if ((this.router.url.split('/(')[0] !== this.router.url) && !this.forceLocationBack) {
41
- this.router.navigateByUrl(this.router.url.split('/(')[0]);
42
- } else if ((this.router.url.split('(')[0] !== this.router.url) && !this.forceLocationBack) {
43
- this.router.navigateByUrl(this.router.url.split('(')[0]);
44
- } else {
45
- this.location.back();
46
- }
47
- }
48
- }
49
-
50
- public emitClose(): void {
51
- this.cancel.emit(false);
52
- this.closeSidePane();
53
- }
54
-
55
- public emitCancel(): void {
56
- this.cancel.emit(false);
57
- this.closeSidePane();
58
- }
59
-
60
- public emitOK(): void {
61
- this.ok.emit(true);
62
- if (this.closeOnOk) {
63
- this.closeSidePane();
64
- }
65
- }
66
-
67
- }
@@ -1,68 +0,0 @@
1
- <header *ngIf="header" class="view-layout-paddings">
2
-
3
- <div class="view-layout-title-container">
4
-
5
- <div class="view-layout-title-container-inner">
6
- <div class="flex items-center">
7
- <i *ngIf="icon" [class]="icon + ' title-icon'" aria-hidden="true"></i>
8
- <h1 [class]="busy ? 'view-layout-title-busy' : 'view-layout-title'">{{title}}</h1>
9
- </div>
10
- <div *ngIf="metaItems && metaItems.length > 0" class="meta-container">
11
- <ng-container *ngFor="let meta of metaItems">
12
- <div class="meta-item-container">
13
- <i *ngIf="meta.icon" [class]="meta.icon + ' meta-icon'" aria-hidden="true"></i>
14
- <span class="meta-text">{{meta.text}}</span>
15
- </div>
16
- </ng-container>
17
- </div>
18
- </div>
19
-
20
- <div class="flex items-center justify-end">
21
- <ng-container *ngFor="let action of actions" [ngSwitch]="action.type">
22
-
23
- <ng-container *ngSwitchCase="'switch-view'">
24
- <button [disabled]="view === action.param" type="button" href="#" class="ml-1 disabled:opacity-50 btn-view-header" (click)="switchViewActionClick(action)">
25
- <span class="inline-block relative">
26
- <i [class]="action.icon"></i>
27
- <span *ngIf="view === action.param" class="selected-view-indicator"></span>
28
- </span>
29
- </button>
30
- </ng-container>
31
-
32
- <ng-container *ngSwitchCase="'search'">
33
- <label for="search" class="sr-only">Search</label>
34
- <div class="search-container">
35
- <div class="pointer-events-none absolute inset-y-0 left-0 pl-3 flex items-center">
36
- <!--<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
37
- <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
38
- </svg>-->
39
- </div>
40
- <input id="search" #search class="search-input" [placeholder]="searchPlaceholder"
41
- type="search" name="search" (input)="searchActionType(search.value)" (onsearch)="handleClear($event)">
42
- </div>
43
- <button type="button" href="#" class="btn-view-header rounded-l-none" [title]="action.tooltip" (click)="searchActionClick(action, search.value)">
44
- <i [class]="action.icon"></i>
45
- </button>
46
- </ng-container>
47
-
48
- <ng-container *ngSwitchCase="'router-link'">
49
- <button type="button" href="#" class="ml-1 btn-view-header" [title]="action.tooltip" (click)="routerLinkActionClick(action)">
50
- <i [class]="action.icon"></i>
51
- </button>
52
- </ng-container>
53
-
54
-
55
- <ng-container *ngSwitchDefault>
56
- <button type="button" class="ml-1 btn-view-header" [title]="action.tooltip" (click)="emitActionClick(action)">
57
- <i [class]="action.icon"></i>
58
- </button>
59
- </ng-container>
60
- </ng-container>
61
- </div>
62
- </div>
63
- </header>
64
-
65
- <!-- component -->
66
- <div [class]="fluid ? 'view-container-fluid' : 'view-container'">
67
- <ng-content></ng-content>
68
- </div>