@indice/ng-components 0.2.160-beta.0 → 0.2.161

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 (169) hide show
  1. package/README.md +4 -4
  2. package/_styles.css +3643 -3643
  3. package/{esm2015/indice-ng-components.js → esm2020/indice-ng-components.mjs} +0 -0
  4. package/{esm2015/lib/controls/avatar-initials/avatar-initials.component.js → esm2020/lib/controls/avatar-initials/avatar-initials.component.mjs} +5 -8
  5. package/esm2020/lib/controls/collapsible-panel/collapsible-panel.component.mjs +20 -0
  6. package/esm2020/lib/controls/combobox/combobox.component.mjs +96 -0
  7. package/esm2020/lib/controls/date-picker/date-picker.component.mjs +292 -0
  8. package/esm2020/lib/controls/drop-down-menu/drop-down-menu.component.mjs +68 -0
  9. package/esm2020/lib/controls/kpi-tile/kpi-tile.component.mjs +36 -0
  10. package/esm2020/lib/controls/language-selection/language-selection.component.mjs +31 -0
  11. package/{esm2015/lib/controls/list-view/list-column.component.js → esm2020/lib/controls/list-view/list-column.component.mjs} +4 -4
  12. package/{esm2015/lib/controls/list-view/list-details-section.component.js → esm2020/lib/controls/list-view/list-details-section.component.mjs} +4 -4
  13. package/{esm2015/lib/controls/list-view/list-tile.component.js → esm2020/lib/controls/list-view/list-tile.component.mjs} +4 -4
  14. package/esm2020/lib/controls/list-view/list-view-empty-state.component.mjs +29 -0
  15. package/esm2020/lib/controls/list-view/list-view.component.mjs +192 -0
  16. package/esm2020/lib/controls/nav-links-list/nav-links-list.component.mjs +42 -0
  17. package/esm2020/lib/controls/notifications-indicator/notifications-indicator.component.mjs +73 -0
  18. package/esm2020/lib/controls/pager/pager.component.mjs +130 -0
  19. package/esm2020/lib/controls/side-pane/side-pane.component.mjs +72 -0
  20. package/esm2020/lib/controls/skeleton-loader/skeleton-loader.component.mjs +25 -0
  21. package/{esm2015/lib/controls/stepper/lib-step-info.directive.js → esm2020/lib/controls/stepper/lib-step-info.directive.mjs} +4 -4
  22. package/{esm2015/lib/controls/stepper/lib-step-label.directive.js → esm2020/lib/controls/stepper/lib-step-label.directive.mjs} +4 -4
  23. package/esm2020/lib/controls/stepper/lib-step.component.mjs +81 -0
  24. package/esm2020/lib/controls/stepper/lib-stepper.component.mjs +85 -0
  25. package/esm2020/lib/controls/stepper/types/step-selected-event.mjs +4 -0
  26. package/{esm2015/lib/controls/stepper/types/stepper-type.js → esm2020/lib/controls/stepper/types/stepper-type.mjs} +1 -1
  27. package/esm2020/lib/controls/tabs/lib-tab-group.component.mjs +59 -0
  28. package/esm2020/lib/controls/tabs/lib-tab.component.mjs +57 -0
  29. package/esm2020/lib/controls/toaster/toaster-container.component.mjs +28 -0
  30. package/esm2020/lib/controls/toaster/toaster.component.mjs +31 -0
  31. package/esm2020/lib/controls/toggle/toggle.component.mjs +64 -0
  32. package/esm2020/lib/controls/user-profile-menu/user-profile-menu.component.mjs +71 -0
  33. package/{esm2015/lib/directives/click-outside.directive.js → esm2020/lib/directives/click-outside.directive.mjs} +4 -4
  34. package/{esm2015/lib/directives/dynamic-component-host.directive.js → esm2020/lib/directives/dynamic-component-host.directive.mjs} +4 -4
  35. package/esm2020/lib/helpers/base-list.component.mjs +182 -0
  36. package/{esm2015/lib/icons.js → esm2020/lib/icons.mjs} +1 -1
  37. package/esm2020/lib/layouts/shell/shell-footer/shell-footer.component.mjs +19 -0
  38. package/esm2020/lib/layouts/shell/shell-header/shell-header.component.mjs +131 -0
  39. package/esm2020/lib/layouts/shell/shell-layout/shell-layout.component.mjs +103 -0
  40. package/esm2020/lib/layouts/shell/shell-sidebar/shell-sidebar.component.mjs +47 -0
  41. package/esm2020/lib/layouts/views/form-layout/form-layout.component.mjs +80 -0
  42. package/esm2020/lib/layouts/views/model-view-layout/model-view-layout.component.mjs +49 -0
  43. package/esm2020/lib/layouts/views/side-view-layout/side-view-layout.component.mjs +98 -0
  44. package/esm2020/lib/layouts/views/view-layout/view-layout.component.mjs +104 -0
  45. package/{esm2015/lib/ng-components.module.js → esm2020/lib/ng-components.module.mjs} +7 -9
  46. package/esm2020/lib/pages/auth/auth-callback/auth-callback.component.mjs +31 -0
  47. package/{esm2015/lib/pages/auth/auth-renew/auth-renew.component.js → esm2020/lib/pages/auth/auth-renew/auth-renew.component.mjs} +4 -4
  48. package/esm2020/lib/pages/auth/logged-out/logged-out.component.mjs +28 -0
  49. package/esm2020/lib/pages/http-status/error/error.component.mjs +17 -0
  50. package/esm2020/lib/pages/http-status/page-not-found/page-not-found.component.mjs +15 -0
  51. package/esm2020/lib/pages/http-status/unauthorized/unauthorized.component.mjs +14 -0
  52. package/{esm2015/lib/pipes/address.pipe.js → esm2020/lib/pipes/address.pipe.mjs} +4 -4
  53. package/{esm2015/lib/pipes/duration-format.pipe.js → esm2020/lib/pipes/duration-format.pipe.mjs} +4 -4
  54. package/esm2020/lib/services/component-loader/component-loader-options.class.mjs +8 -0
  55. package/esm2020/lib/services/component-loader/component-loader.class.mjs +188 -0
  56. package/{esm2015/lib/services/component-loader/component-loader.factory.js → esm2020/lib/services/component-loader/component-loader.factory.mjs} +4 -4
  57. package/{esm2015/lib/services/component-loader/content-ref.class.js → esm2020/lib/services/component-loader/content-ref.class.mjs} +1 -1
  58. package/esm2020/lib/services/modal-service/modal-backdrop-component.mjs +44 -0
  59. package/esm2020/lib/services/modal-service/modal-container-component.mjs +126 -0
  60. package/esm2020/lib/services/modal-service/modal-options.class.mjs +35 -0
  61. package/esm2020/lib/services/modal-service/modal-service.mjs +219 -0
  62. package/{esm2015/lib/services/modal-service/modal-styles.class.js → esm2020/lib/services/modal-service/modal-styles.class.mjs} +1 -1
  63. package/esm2020/lib/services/modal-service/modal.class.mjs +27 -0
  64. package/{esm2015/lib/services/toaster.service.js → esm2020/lib/services/toaster.service.mjs} +4 -4
  65. package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +1 -1
  66. package/{esm2015/lib/types.js → esm2020/lib/types.mjs} +1 -1
  67. package/{esm2015/public-api.js → esm2020/public-api.mjs} +1 -1
  68. package/fesm2015/indice-ng-components.mjs +3899 -0
  69. package/fesm2015/indice-ng-components.mjs.map +1 -0
  70. package/fesm2020/indice-ng-components.mjs +3834 -0
  71. package/fesm2020/indice-ng-components.mjs.map +1 -0
  72. package/{indice-ng-components.d.ts → index.d.ts} +0 -0
  73. package/lib/controls/avatar-initials/avatar-initials.component.d.ts +1 -1
  74. package/lib/controls/collapsible-panel/collapsible-panel.component.d.ts +1 -1
  75. package/lib/controls/combobox/combobox.component.d.ts +1 -1
  76. package/lib/controls/date-picker/date-picker.component.d.ts +1 -1
  77. package/lib/controls/drop-down-menu/drop-down-menu.component.d.ts +1 -1
  78. package/lib/controls/kpi-tile/kpi-tile.component.d.ts +1 -1
  79. package/lib/controls/language-selection/language-selection.component.d.ts +1 -1
  80. package/lib/controls/list-view/list-column.component.d.ts +1 -1
  81. package/lib/controls/list-view/list-details-section.component.d.ts +1 -1
  82. package/lib/controls/list-view/list-tile.component.d.ts +1 -1
  83. package/lib/controls/list-view/list-view-empty-state.component.d.ts +1 -1
  84. package/lib/controls/list-view/list-view.component.d.ts +1 -1
  85. package/lib/controls/nav-links-list/nav-links-list.component.d.ts +1 -1
  86. package/lib/controls/notifications-indicator/notifications-indicator.component.d.ts +1 -1
  87. package/lib/controls/pager/pager.component.d.ts +1 -1
  88. package/lib/controls/side-pane/side-pane.component.d.ts +1 -1
  89. package/lib/controls/skeleton-loader/skeleton-loader.component.d.ts +1 -1
  90. package/lib/controls/stepper/lib-step-info.directive.d.ts +1 -1
  91. package/lib/controls/stepper/lib-step-label.directive.d.ts +1 -1
  92. package/lib/controls/stepper/lib-step.component.d.ts +1 -1
  93. package/lib/controls/stepper/lib-stepper.component.d.ts +1 -1
  94. package/lib/controls/tabs/lib-tab-group.component.d.ts +1 -1
  95. package/lib/controls/tabs/lib-tab.component.d.ts +1 -1
  96. package/lib/controls/toaster/toaster-container.component.d.ts +1 -1
  97. package/lib/controls/toaster/toaster.component.d.ts +1 -1
  98. package/lib/controls/toggle/toggle.component.d.ts +1 -1
  99. package/lib/controls/user-profile-menu/user-profile-menu.component.d.ts +1 -1
  100. package/lib/directives/click-outside.directive.d.ts +1 -1
  101. package/lib/directives/dynamic-component-host.directive.d.ts +1 -1
  102. package/lib/helpers/base-list.component.d.ts +1 -1
  103. package/lib/layouts/shell/shell-footer/shell-footer.component.d.ts +1 -1
  104. package/lib/layouts/shell/shell-header/shell-header.component.d.ts +1 -1
  105. package/lib/layouts/shell/shell-layout/shell-layout.component.d.ts +1 -1
  106. package/lib/layouts/shell/shell-sidebar/shell-sidebar.component.d.ts +1 -1
  107. package/lib/layouts/views/form-layout/form-layout.component.d.ts +1 -1
  108. package/lib/layouts/views/model-view-layout/model-view-layout.component.d.ts +1 -1
  109. package/lib/layouts/views/side-view-layout/side-view-layout.component.d.ts +1 -1
  110. package/lib/layouts/views/view-layout/view-layout.component.d.ts +1 -1
  111. package/lib/pages/auth/auth-callback/auth-callback.component.d.ts +1 -1
  112. package/lib/pages/auth/auth-renew/auth-renew.component.d.ts +1 -1
  113. package/lib/pages/auth/logged-out/logged-out.component.d.ts +1 -1
  114. package/lib/pages/http-status/error/error.component.d.ts +1 -1
  115. package/lib/pages/http-status/page-not-found/page-not-found.component.d.ts +1 -1
  116. package/lib/pages/http-status/unauthorized/unauthorized.component.d.ts +1 -1
  117. package/lib/pipes/address.pipe.d.ts +1 -1
  118. package/lib/pipes/duration-format.pipe.d.ts +1 -1
  119. package/lib/services/modal-service/modal-backdrop-component.d.ts +1 -1
  120. package/lib/services/modal-service/modal-container-component.d.ts +1 -1
  121. package/modal.css +157 -157
  122. package/package.json +21 -8
  123. package/bundles/indice-ng-components.umd.js +0 -4597
  124. package/bundles/indice-ng-components.umd.js.map +0 -1
  125. package/esm2015/lib/controls/collapsible-panel/collapsible-panel.component.js +0 -23
  126. package/esm2015/lib/controls/combobox/combobox.component.js +0 -99
  127. package/esm2015/lib/controls/date-picker/date-picker.component.js +0 -301
  128. package/esm2015/lib/controls/drop-down-menu/drop-down-menu.component.js +0 -72
  129. package/esm2015/lib/controls/kpi-tile/kpi-tile.component.js +0 -39
  130. package/esm2015/lib/controls/language-selection/language-selection.component.js +0 -35
  131. package/esm2015/lib/controls/list-view/list-view-empty-state.component.js +0 -32
  132. package/esm2015/lib/controls/list-view/list-view.component.js +0 -195
  133. package/esm2015/lib/controls/nav-links-list/nav-links-list.component.js +0 -45
  134. package/esm2015/lib/controls/notifications-indicator/notifications-indicator.component.js +0 -76
  135. package/esm2015/lib/controls/pager/pager.component.js +0 -133
  136. package/esm2015/lib/controls/side-pane/side-pane.component.js +0 -76
  137. package/esm2015/lib/controls/skeleton-loader/skeleton-loader.component.js +0 -29
  138. package/esm2015/lib/controls/stepper/lib-step.component.js +0 -84
  139. package/esm2015/lib/controls/stepper/lib-stepper.component.js +0 -90
  140. package/esm2015/lib/controls/stepper/types/step-selected-event.js +0 -4
  141. package/esm2015/lib/controls/tabs/lib-tab-group.component.js +0 -66
  142. package/esm2015/lib/controls/tabs/lib-tab.component.js +0 -58
  143. package/esm2015/lib/controls/toaster/toaster-container.component.js +0 -31
  144. package/esm2015/lib/controls/toaster/toaster.component.js +0 -34
  145. package/esm2015/lib/controls/toggle/toggle.component.js +0 -68
  146. package/esm2015/lib/controls/user-profile-menu/user-profile-menu.component.js +0 -75
  147. package/esm2015/lib/helpers/base-list.component.js +0 -183
  148. package/esm2015/lib/layouts/shell/shell-footer/shell-footer.component.js +0 -22
  149. package/esm2015/lib/layouts/shell/shell-header/shell-header.component.js +0 -136
  150. package/esm2015/lib/layouts/shell/shell-layout/shell-layout.component.js +0 -108
  151. package/esm2015/lib/layouts/shell/shell-sidebar/shell-sidebar.component.js +0 -50
  152. package/esm2015/lib/layouts/views/form-layout/form-layout.component.js +0 -85
  153. package/esm2015/lib/layouts/views/model-view-layout/model-view-layout.component.js +0 -53
  154. package/esm2015/lib/layouts/views/side-view-layout/side-view-layout.component.js +0 -101
  155. package/esm2015/lib/layouts/views/view-layout/view-layout.component.js +0 -110
  156. package/esm2015/lib/pages/auth/auth-callback/auth-callback.component.js +0 -35
  157. package/esm2015/lib/pages/auth/logged-out/logged-out.component.js +0 -32
  158. package/esm2015/lib/pages/http-status/error/error.component.js +0 -20
  159. package/esm2015/lib/pages/http-status/page-not-found/page-not-found.component.js +0 -18
  160. package/esm2015/lib/pages/http-status/unauthorized/unauthorized.component.js +0 -17
  161. package/esm2015/lib/services/component-loader/component-loader-options.class.js +0 -8
  162. package/esm2015/lib/services/component-loader/component-loader.class.js +0 -192
  163. package/esm2015/lib/services/modal-service/modal-backdrop-component.js +0 -44
  164. package/esm2015/lib/services/modal-service/modal-container-component.js +0 -128
  165. package/esm2015/lib/services/modal-service/modal-options.class.js +0 -35
  166. package/esm2015/lib/services/modal-service/modal-service.js +0 -220
  167. package/esm2015/lib/services/modal-service/modal.class.js +0 -27
  168. package/fesm2015/indice-ng-components.js +0 -3977
  169. package/fesm2015/indice-ng-components.js.map +0 -1
@@ -1,3977 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, PLATFORM_ID, Directive, Inject, Input, Output, Component, TemplateRef, ContentChild, ContentChildren, LOCALE_ID, forwardRef, ViewChild, Injectable, InjectionToken, ViewEncapsulation, ChangeDetectionStrategy, Optional, Injector, ElementRef, ViewChildren, Pipe, HostListener, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { isPlatformBrowser, getLocaleMonthNames, FormStyle, TranslationWidth, getLocaleDayNames, DOCUMENT, CommonModule } from '@angular/common';
5
- import * as i1$1 from '@angular/router';
6
- import { Router, NavigationStart, ActivatedRoute, ActivationStart, RouterModule } from '@angular/router';
7
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import { BehaviorSubject, Subject, of, fromEvent } from 'rxjs';
9
- import { filter, debounceTime, distinctUntilChanged, share, map } from 'rxjs/operators';
10
- import * as uuid from 'uuid';
11
- import * as i2 from '@indice/ng-auth';
12
- import { AuthService, IndiceAuthModule } from '@indice/ng-auth';
13
-
14
- //
15
- // tslint:disable-next-line:directive-selector
16
- class ClickOutsideDirective {
17
- constructor(
18
- // tslint:disable-next-line:variable-name
19
- _el,
20
- // tslint:disable-next-line:variable-name
21
- _ngZone, platformId) {
22
- this._el = _el;
23
- this._ngZone = _ngZone;
24
- this.platformId = platformId;
25
- this.clickOutsideEnabled = true;
26
- this.attachOutsideOnClick = false;
27
- this.delayClickOutsideInit = false;
28
- this.emitOnBlur = false;
29
- this.exclude = '';
30
- this.excludeBeforeClick = false;
31
- this.clickOutsideEvents = '';
32
- this.clickOutside = new EventEmitter();
33
- // tslint:disable-next-line:variable-name
34
- this._nodesExcluded = [];
35
- // tslint:disable-next-line:variable-name
36
- this._events = ['click'];
37
- this._initOnClickBody = this._initOnClickBody.bind(this);
38
- this._onClickBody = this._onClickBody.bind(this);
39
- this._onWindowBlur = this._onWindowBlur.bind(this);
40
- }
41
- ngOnInit() {
42
- if (!isPlatformBrowser(this.platformId)) {
43
- return;
44
- }
45
- this._init();
46
- }
47
- ngOnDestroy() {
48
- if (!isPlatformBrowser(this.platformId)) {
49
- return;
50
- }
51
- this._removeClickOutsideListener();
52
- this._removeAttachOutsideOnClickListener();
53
- this._removeWindowBlurListener();
54
- }
55
- ngOnChanges(changes) {
56
- if (!isPlatformBrowser(this.platformId)) {
57
- return;
58
- }
59
- // tslint:disable-next-line:no-string-literal
60
- if (changes['attachOutsideOnClick'] || changes['exclude'] || changes['emitOnBlur']) {
61
- this._init();
62
- }
63
- }
64
- _init() {
65
- if (this.clickOutsideEvents !== '') {
66
- this._events = this.clickOutsideEvents.split(',').map(e => e.trim());
67
- }
68
- this._excludeCheck();
69
- if (this.attachOutsideOnClick) {
70
- this._initAttachOutsideOnClickListener();
71
- }
72
- else {
73
- this._initOnClickBody();
74
- }
75
- if (this.emitOnBlur) {
76
- this._initWindowBlurListener();
77
- }
78
- }
79
- _initOnClickBody() {
80
- if (this.delayClickOutsideInit) {
81
- setTimeout(this._initClickOutsideListener.bind(this));
82
- }
83
- else {
84
- this._initClickOutsideListener();
85
- }
86
- }
87
- _excludeCheck() {
88
- if (this.exclude) {
89
- try {
90
- const nodes = Array.from(document.querySelectorAll(this.exclude));
91
- if (nodes) {
92
- this._nodesExcluded = nodes;
93
- }
94
- }
95
- catch (err) {
96
- console.error('[ng-click-outside] Check your exclude selector syntax.', err);
97
- }
98
- }
99
- }
100
- _onClickBody(ev) {
101
- if (!this.clickOutsideEnabled) {
102
- return;
103
- }
104
- if (this.excludeBeforeClick) {
105
- this._excludeCheck();
106
- }
107
- if (!this._el.nativeElement.contains(ev.target) && !this._shouldExclude(ev.target)) {
108
- this._emit(ev);
109
- if (this.attachOutsideOnClick) {
110
- this._removeClickOutsideListener();
111
- }
112
- }
113
- }
114
- /**
115
- * Resolves problem with outside click on iframe
116
- * @see https://github.com/arkon/ng-click-outside/issues/32
117
- */
118
- _onWindowBlur(ev) {
119
- setTimeout(() => {
120
- if (!document.hidden) {
121
- this._emit(ev);
122
- }
123
- });
124
- }
125
- _emit(ev) {
126
- if (!this.clickOutsideEnabled) {
127
- return;
128
- }
129
- this._ngZone.run(() => this.clickOutside.emit(ev));
130
- }
131
- _shouldExclude(target) {
132
- // tslint:disable-next-line:prefer-const
133
- for (let excludedNode of this._nodesExcluded) {
134
- if (excludedNode.contains(target)) {
135
- return true;
136
- }
137
- }
138
- return false;
139
- }
140
- _initClickOutsideListener() {
141
- this._ngZone.runOutsideAngular(() => {
142
- this._events.forEach(e => document.addEventListener(e, this._onClickBody));
143
- });
144
- }
145
- _removeClickOutsideListener() {
146
- this._ngZone.runOutsideAngular(() => {
147
- this._events.forEach(e => document.removeEventListener(e, this._onClickBody));
148
- });
149
- }
150
- _initAttachOutsideOnClickListener() {
151
- this._ngZone.runOutsideAngular(() => {
152
- this._events.forEach(e => this._el.nativeElement.addEventListener(e, this._initOnClickBody));
153
- });
154
- }
155
- _removeAttachOutsideOnClickListener() {
156
- this._ngZone.runOutsideAngular(() => {
157
- this._events.forEach(e => this._el.nativeElement.removeEventListener(e, this._initOnClickBody));
158
- });
159
- }
160
- _initWindowBlurListener() {
161
- this._ngZone.runOutsideAngular(() => {
162
- window.addEventListener('blur', this._onWindowBlur);
163
- });
164
- }
165
- _removeWindowBlurListener() {
166
- this._ngZone.runOutsideAngular(() => {
167
- window.removeEventListener('blur', this._onWindowBlur);
168
- });
169
- }
170
- }
171
- ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Directive });
172
- ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ClickOutsideDirective, selector: "[clickOutside]", inputs: { clickOutsideEnabled: "clickOutsideEnabled", attachOutsideOnClick: "attachOutsideOnClick", delayClickOutsideInit: "delayClickOutsideInit", emitOnBlur: "emitOnBlur", exclude: "exclude", excludeBeforeClick: "excludeBeforeClick", clickOutsideEvents: "clickOutsideEvents" }, outputs: { clickOutside: "clickOutside" }, usesOnChanges: true, ngImport: i0 });
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ClickOutsideDirective, decorators: [{
174
- type: Directive,
175
- args: [{ selector: '[clickOutside]' }]
176
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
177
- type: Inject,
178
- args: [PLATFORM_ID]
179
- }] }]; }, propDecorators: { clickOutsideEnabled: [{
180
- type: Input
181
- }], attachOutsideOnClick: [{
182
- type: Input
183
- }], delayClickOutsideInit: [{
184
- type: Input
185
- }], emitOnBlur: [{
186
- type: Input
187
- }], exclude: [{
188
- type: Input
189
- }], excludeBeforeClick: [{
190
- type: Input
191
- }], clickOutsideEvents: [{
192
- type: Input
193
- }], clickOutside: [{
194
- type: Output
195
- }] } });
196
-
197
- class DropDownMenuComponent {
198
- constructor() {
199
- this.options = [];
200
- // tslint:disable-next-line:no-input-rename
201
- this.selectedValue = null;
202
- this.multiple = false;
203
- this.placeholder = 'Παρακαλώ επιλέξτε...';
204
- this.selectedOption$ = null;
205
- this.selectedChange = new EventEmitter();
206
- this.selectedChanged = new EventEmitter();
207
- this.expanded$ = false;
208
- }
209
- get selectedOption() {
210
- return this.selectedOption$;
211
- }
212
- set selectedOption(option) {
213
- this.selectedOption$ = option;
214
- this.selectedValue = option ? option.value : null;
215
- this.expanded = false;
216
- }
217
- get expanded() {
218
- return this.expanded$;
219
- }
220
- set expanded(value) {
221
- this.expanded$ = value;
222
- }
223
- ngOnChanges(changes) {
224
- if (this.options && this.options.length > 0 && this.selectedValue !== null && this.selectedValue !== undefined) {
225
- this.selectedOption$ = this.options.filter((o) => o.value === this.selectedValue)[0];
226
- }
227
- }
228
- ngOnInit() { }
229
- isSelected(option) {
230
- return option != null && this.selectedValue != null && option.value === this.selectedValue;
231
- }
232
- onClickOutside($event) {
233
- this.expanded = false;
234
- }
235
- selectOption(option) {
236
- this.selectedOption = option;
237
- this.selectedChange.emit(option.value);
238
- this.selectedChanged.emit(option.value);
239
- }
240
- }
241
- DropDownMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropDownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
242
- DropDownMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DropDownMenuComponent, selector: "lib-drop-down-menu", inputs: { options: "options", selectedValue: ["selected", "selectedValue"], multiple: "multiple", placeholder: "placeholder" }, outputs: { selectedChange: "selectedChange", selectedChanged: "selectedChanged" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"dropdown-container\" (clickOutside)=\"onClickOutside($event)\">\r\n <button\r\n type=\"button\"\r\n (click)=\"expanded = !expanded\"\r\n class=\"dropdown-button\"\r\n aria-haspopup=\"listbox\"\r\n aria-expanded=\"true\"\r\n aria-labelledby=\"listbox-label\"\r\n >\r\n <span class=\"dropdown-selected-text\">\r\n {{ selectedOption?.text || placeholder }}\r\n </span>\r\n <span class=\"dropdown-button-icon\">\r\n <!-- Heroicon name: solid/selector -->\r\n <svg class=\"dropdown-arrow\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n </span>\r\n </button>\r\n <ul\r\n *ngIf=\"expanded && options && options.length > 0\"\r\n class=\"dropdown-ul\"\r\n tabindex=\"-1\"\r\n role=\"listbox\"\r\n aria-labelledby=\"listbox-label\"\r\n aria-activedescendant=\"listbox-option-3\"\r\n >\r\n <ng-container *ngFor=\"let option of options\">\r\n <li\r\n [class]=\"isSelected(option) ? 'dropdown-li-selected' : 'dropdown-li'\"\r\n (click)=\"selectOption(option)\"\r\n id=\"listbox-option-0\"\r\n role=\"option\"\r\n >\r\n <span [class]=\"isSelected(option) ? 'dropdown-li-selected-text' : 'dropdown-li-text'\">\r\n {{ option.text }}\r\n </span>\r\n <span *ngIf=\"isSelected(option)\" class=\"dropdown-li-selected-indicator-container\">\r\n <!-- Heroicon name: solid/check -->\r\n <svg\r\n class=\"dropdown-li-selected-indicator\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n aria-hidden=\"true\"\r\n >\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n </span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n</div>\r\n", directives: [{ type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideEnabled", "attachOutsideOnClick", "delayClickOutsideInit", "emitOnBlur", "exclude", "excludeBeforeClick", "clickOutsideEvents"], outputs: ["clickOutside"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
243
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropDownMenuComponent, decorators: [{
244
- type: Component,
245
- args: [{
246
- // tslint:disable-next-line:component-selector
247
- selector: 'lib-drop-down-menu',
248
- templateUrl: './drop-down-menu.component.html',
249
- }]
250
- }], ctorParameters: function () { return []; }, propDecorators: { options: [{
251
- type: Input
252
- }], selectedValue: [{
253
- type: Input,
254
- args: ['selected']
255
- }], multiple: [{
256
- type: Input
257
- }], placeholder: [{
258
- type: Input
259
- }], selectedChange: [{
260
- type: Output
261
- }], selectedChanged: [{
262
- type: Output
263
- }] } });
264
-
265
- class Icons {
266
- }
267
- // https://uifabricicons.azurewebsites.net/
268
- Icons.Dashboard = `ms-Icon ms-Icon--HomeGroup `;
269
- Icons.Locations = `ms-Icon ms-Icon--MapPin `;
270
- Icons.ChargePoints = `ms-Icon ms-Icon--ChatBot `;
271
- Icons.Transations = `ms-Icon ms-Icon--PaymentCard `;
272
- Icons.Badges = `ms-Icon ms-Icon--IDBadge `;
273
- Icons.Information = `ms-Icon ms-Icon--Info`;
274
- Icons.Refresh = `ms-Icon ms-Icon--Refresh`;
275
- Icons.Search = `ms-Icon ms-Icon--Search`;
276
- Icons.Add = `ms-Icon ms-Icon--Add`;
277
- Icons.Delete = `ms-Icon ms-Icon--Delete`;
278
- Icons.SendEmail = `ms-Icon ms-Icon--NewMail`;
279
- Icons.Filter = `ms-Icon ms-Icon--Filter`;
280
- Icons.Export = `ms-Icon ms-Icon--ExcelDocument`;
281
- Icons.Import = `ms-Icon ms-Icon--PeopleAdd`;
282
- Icons.TilesView = `ms-Icon ms-Icon--AppIconDefault`;
283
- Icons.TableView = `ms-Icon ms-Icon--Table`;
284
- Icons.MapView = `ms-Icon ms-Icon--MapPin`;
285
- Icons.EntryView = `ms-Icon ms-Icon--EntryView`;
286
- Icons.Separator = `ms-Icon ms-Icon--Separator text-white`;
287
- Icons.ItemsCount = 'ms-Icon ms-Icon--Boards';
288
- Icons.Heart = 'ms-Icon ms-Icon--Heart';
289
- Icons.HeartBroken = 'ms-Icon ms-Icon--HeartBroken';
290
- Icons.DateTime = 'ms-Icon ms-Icon--ReminderTime';
291
- Icons.Expand = 'ms-Icon ms-Icon--ChevronDown';
292
- Icons.Collapse = 'ms-Icon ms-Icon--ChevronUp';
293
- Icons.SortAsc = 'ms-Icon ms-Icon--Ascending';
294
- Icons.SortDesc = 'ms-Icon ms-Icon--Descending';
295
- Icons.Details = ' ms-Icon ms-Icon--AccountActivity';
296
- Icons.Messages = ' ms-Icon ms-Icon--Message';
297
- Icons.MessagesUnread = ' ms-Icon ms-Icon--MessageFill';
298
-
299
- class NavLink {
300
- constructor(text, path, exact = false, external = false, icon, data) {
301
- this.type = 'router';
302
- this.text = text;
303
- this.path = path;
304
- this.exact = exact;
305
- this.external = external;
306
- this.icon = icon;
307
- this.data = data;
308
- }
309
- }
310
- class ExternalNavLink extends NavLink {
311
- constructor(text, path, openInNewTab, icon) {
312
- super(text, path, true, openInNewTab, icon);
313
- this.type = 'external';
314
- }
315
- }
316
- class FragmentNavLink extends NavLink {
317
- constructor(text, path, icon) {
318
- super(text, path, true, true, icon);
319
- this.type = 'fragment';
320
- }
321
- }
322
- class NotificationNavLink extends NavLink {
323
- constructor(text, path, isRead, creationDate) {
324
- super(text, path, true, false, undefined);
325
- this.isRead = isRead;
326
- this.creationDate = creationDate;
327
- }
328
- }
329
- class ViewAction {
330
- constructor(type, key, param, icon, tooltip) {
331
- this.type = type;
332
- this.key = key;
333
- this.param = param;
334
- this.icon = icon;
335
- this.tooltip = tooltip;
336
- }
337
- }
338
- class ListViewType {
339
- }
340
- ListViewType.Tiles = 'tiles';
341
- ListViewType.Table = 'table';
342
- ListViewType.Map = 'map';
343
- ListViewType.Gallery = 'gallery';
344
- class RouterViewAction extends ViewAction {
345
- constructor(icon, link, outlet, tooltip) {
346
- super('router-link', null, null, icon, tooltip);
347
- this.outlet = null;
348
- this.link = null;
349
- this.outlet = outlet;
350
- this.link = link;
351
- }
352
- }
353
- class SwitchViewAction extends ViewAction {
354
- constructor(view, icon, tooltip) {
355
- super('switch-view', null, view, icon, tooltip);
356
- }
357
- }
358
- class HeaderMetaItem {
359
- constructor() {
360
- this.key = null;
361
- this.icon = null;
362
- this.text = null;
363
- }
364
- }
365
- class MenuOption {
366
- constructor(text, value, description, data, icon) {
367
- this.text = text;
368
- this.value = value;
369
- this.description = description;
370
- this.data = data;
371
- this.icon = icon;
372
- }
373
- }
374
- var PagerPosition;
375
- (function (PagerPosition) {
376
- PagerPosition["Top"] = "top";
377
- PagerPosition["Bottom"] = "bottom";
378
- PagerPosition["Both"] = "both";
379
- })(PagerPosition || (PagerPosition = {}));
380
- var ShellLayoutType;
381
- (function (ShellLayoutType) {
382
- ShellLayoutType["Stacked"] = "Stacked";
383
- ShellLayoutType["Sidebar"] = "Sidebar";
384
- })(ShellLayoutType || (ShellLayoutType = {}));
385
- class DefaultShellConfig {
386
- constructor() {
387
- this.layout = ShellLayoutType.Stacked;
388
- this.appLogo = 'https://tailwindui.com/img/logos/workflow-mark.svg?color=white';
389
- this.appLogoAlt = 'your app name here';
390
- this.showHeader = true;
391
- this.showUserNameOnHeader = false;
392
- this.showAlertsOnHeader = false;
393
- this.showFooter = true;
394
- this.fluid = false;
395
- }
396
- }
397
- var SCREEN_SIZE;
398
- (function (SCREEN_SIZE) {
399
- SCREEN_SIZE[SCREEN_SIZE["XS"] = 0] = "XS";
400
- SCREEN_SIZE[SCREEN_SIZE["SM"] = 1] = "SM";
401
- SCREEN_SIZE[SCREEN_SIZE["MD"] = 2] = "MD";
402
- SCREEN_SIZE[SCREEN_SIZE["LG"] = 3] = "LG";
403
- SCREEN_SIZE[SCREEN_SIZE["XL"] = 4] = "XL";
404
- })(SCREEN_SIZE || (SCREEN_SIZE = {}));
405
- var ToastType;
406
- (function (ToastType) {
407
- ToastType["Info"] = "info";
408
- ToastType["Success"] = "success";
409
- ToastType["Error"] = "error";
410
- ToastType["Warning"] = "warning";
411
- })(ToastType || (ToastType = {}));
412
- const NULL_TOAST = { title: '_____NULL_____' };
413
- var SidePaneSize;
414
- (function (SidePaneSize) {
415
- SidePaneSize["Default"] = "";
416
- SidePaneSize["Small25"] = "25%";
417
- SidePaneSize["Medium50"] = "50%";
418
- SidePaneSize["Large75"] = "75%";
419
- })(SidePaneSize || (SidePaneSize = {}));
420
- var SidePaneOverlayType;
421
- (function (SidePaneOverlayType) {
422
- SidePaneOverlayType["Default"] = "";
423
- SidePaneOverlayType["None"] = "-opacity-0";
424
- SidePaneOverlayType["Light"] = "";
425
- SidePaneOverlayType["Dark"] = "-opacity-50";
426
- })(SidePaneOverlayType || (SidePaneOverlayType = {}));
427
-
428
- class PagerComponent {
429
- constructor(router) {
430
- this.router = router;
431
- // BUSY STATE
432
- this.busy = false;
433
- // PAGING
434
- this.count = null;
435
- this.page = 1;
436
- // tslint:disable-next-line:no-input-rename
437
- this.pageSize = 20;
438
- // tslint:disable-next-line:no-input-rename
439
- this.pageSizeOptions = [
440
- new MenuOption('10', 10),
441
- new MenuOption('20', 20),
442
- new MenuOption('30', 30),
443
- new MenuOption('50', 50),
444
- new MenuOption('100', 100)
445
- ];
446
- this.pages = [];
447
- this.pageChanged = new EventEmitter();
448
- this.pageSizeChanged = new EventEmitter();
449
- this.canPreviousPage = false;
450
- this.canNextPage = false;
451
- // SORTING
452
- // tslint:disable-next-line:no-input-rename
453
- this.sortOptions = [];
454
- // tslint:disable-next-line:no-input-rename
455
- this.sort = null;
456
- // tslint:disable-next-line:no-input-rename
457
- this.sortdir = 'desc';
458
- this.sortChanged = new EventEmitter();
459
- this.sortdirChanged = new EventEmitter();
460
- this.sortdirIcon = Icons.SortDesc;
461
- }
462
- ngOnChanges(changes) {
463
- this.calcPages();
464
- }
465
- ngOnInit() {
466
- }
467
- calcPages() {
468
- this.pages = [];
469
- if (this.count && this.count > 0) {
470
- const pageCount = this.count / this.pageSize;
471
- for (let i = 0; i < pageCount; i++) {
472
- this.pages.push(new MenuOption(i + 1 + '', i + 1));
473
- }
474
- }
475
- this.canPreviousPage = this.page > 1;
476
- this.canNextPage = this.page < this.pages.length;
477
- }
478
- nextPage() {
479
- const next = this.page + 1;
480
- this.gotoPage(next);
481
- }
482
- previousPage() {
483
- const previous = this.page - 1;
484
- this.gotoPage(previous);
485
- }
486
- gotoPage(page) {
487
- this.page = page;
488
- this.pageChanged.emit(page);
489
- this.calcPages();
490
- }
491
- pageSizeOptionChanged(pageSize) {
492
- this.pageSizeChanged.emit(pageSize);
493
- this.calcPages();
494
- }
495
- pageOptionChanged(page) {
496
- this.pageChanged.emit(page);
497
- this.calcPages();
498
- }
499
- sortOptionChanged(sort) {
500
- this.sortChanged.emit(sort);
501
- }
502
- toggleSortdir() {
503
- let sortdir = 'desc';
504
- if (this.sortdir === 'desc') {
505
- sortdir = 'asc';
506
- this.sortdirIcon = Icons.SortAsc;
507
- }
508
- else {
509
- sortdir = 'desc';
510
- this.sortdirIcon = Icons.SortDesc;
511
- }
512
- this.sortdirChanged.emit(sortdir);
513
- }
514
- }
515
- PagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PagerComponent, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component });
516
- PagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PagerComponent, selector: "lib-pager", inputs: { busy: "busy", count: "count", page: "page", pageSize: ["page-size", "pageSize"], pageSizeOptions: ["page-size-options", "pageSizeOptions"], sortOptions: ["sort-options", "sortOptions"], sort: "sort", sortdir: ["sort-dir", "sortdir"] }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged", sortChanged: "sortChanged", sortdirChanged: "sortdirChanged" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"pager-container\">\r\n <div class=\"pager-container-inner\">\r\n <div class=\"inline-flex\" *ngIf=\"sortOptions && sortOptions.length > 0\">\r\n <lib-drop-down-menu [options]=\"sortOptions\" [selected]=\"sort\" (selectedChanged)=\"sortOptionChanged($event)\"></lib-drop-down-menu>\r\n <button (click)=\"toggleSortdir()\" [disabled]=\"!sort || busy\" class=\"pager-icon-button\">\r\n <span class=\"sr-only\">sort direction</span>\r\n <span class=\"inline-block relative\">\r\n <i [class]=\"sortdirIcon\"></i>\r\n </span>\r\n </button>\r\n </div>\r\n <div class=\"pager-pages-container\">\r\n <lib-drop-down-menu [options]=\"pageSizeOptions\" [selected]=\"pageSize\" (selectedChanged)=\"pageSizeOptionChanged($event)\"></lib-drop-down-menu>\r\n <div class=\"mx-2\" *ngIf=\"count !== null && count > pageSize\">\r\n <button [disabled]=\"!canPreviousPage || busy\" (click)=\"previousPage()\"\r\n class=\"pager-arrow-button-left\">\r\n <span class=\"sr-only\">Previous</span>\r\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\" d=\"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n </button>\r\n <button [disabled]=\"!canNextPage || busy\" (click)=\"nextPage()\"\r\n class=\"pager-arrow-button-right\">\r\n <span class=\"sr-only\">Next</span>\r\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\" d=\"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n </button>\r\n </div>\r\n <lib-drop-down-menu *ngIf=\"(pages && pages.length > 0) && (count !== null && count > pageSize)\" [options]=\"pages\" [selected]=\"page\" (selectedChanged)=\"pageOptionChanged($event)\"></lib-drop-down-menu>\r\n </div>\r\n </div>\r\n</div>\r\n", components: [{ type: DropDownMenuComponent, selector: "lib-drop-down-menu", inputs: ["options", "selected", "multiple", "placeholder"], outputs: ["selectedChange", "selectedChanged"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
517
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PagerComponent, decorators: [{
518
- type: Component,
519
- args: [{
520
- selector: 'lib-pager',
521
- templateUrl: './pager.component.html'
522
- }]
523
- }], ctorParameters: function () { return [{ type: i1$1.Router }]; }, propDecorators: { busy: [{
524
- type: Input
525
- }], count: [{
526
- type: Input
527
- }], page: [{
528
- type: Input
529
- }], pageSize: [{
530
- type: Input,
531
- args: ['page-size']
532
- }], pageSizeOptions: [{
533
- type: Input,
534
- args: ['page-size-options']
535
- }], pageChanged: [{
536
- type: Output
537
- }], pageSizeChanged: [{
538
- type: Output
539
- }], sortOptions: [{
540
- type: Input,
541
- args: ['sort-options']
542
- }], sort: [{
543
- type: Input,
544
- args: ['sort']
545
- }], sortdir: [{
546
- type: Input,
547
- args: ['sort-dir']
548
- }], sortChanged: [{
549
- type: Output
550
- }], sortdirChanged: [{
551
- type: Output
552
- }] } });
553
-
554
- class ListTileComponent {
555
- constructor() {
556
- this.template = null;
557
- }
558
- }
559
- ListTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListTileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
560
- ListTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListTileComponent, selector: "lib-list-tile", queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
561
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListTileComponent, decorators: [{
562
- type: Component,
563
- args: [{ selector: 'lib-list-tile', template: '<ng-content></ng-content>' }]
564
- }], ctorParameters: function () { return []; }, propDecorators: { template: [{
565
- type: ContentChild,
566
- args: [TemplateRef]
567
- }] } });
568
-
569
- class ListColumnComponent {
570
- constructor() {
571
- this.title = null;
572
- // tslint:disable-next-line:no-input-rename
573
- this.fullWidth = false;
574
- this.template = null;
575
- }
576
- }
577
- ListColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
578
- ListColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListColumnComponent, selector: "lib-list-column", inputs: { title: "title", fullWidth: ["full-width", "fullWidth"] }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
579
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListColumnComponent, decorators: [{
580
- type: Component,
581
- args: [{ selector: 'lib-list-column', template: '<ng-content></ng-content>' }]
582
- }], ctorParameters: function () { return []; }, propDecorators: { title: [{
583
- type: Input
584
- }], fullWidth: [{
585
- type: Input,
586
- args: ['full-width']
587
- }], template: [{
588
- type: ContentChild,
589
- args: [TemplateRef]
590
- }] } });
591
-
592
- class ListDetailsSectionComponent {
593
- constructor() {
594
- this.template = null;
595
- }
596
- }
597
- ListDetailsSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListDetailsSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
598
- ListDetailsSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListDetailsSectionComponent, selector: "lib-list-details-section", queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
599
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListDetailsSectionComponent, decorators: [{
600
- type: Component,
601
- args: [{ selector: 'lib-list-details-section', template: '<ng-content></ng-content>' }]
602
- }], ctorParameters: function () { return []; }, propDecorators: { template: [{
603
- type: ContentChild,
604
- args: [TemplateRef]
605
- }] } });
606
-
607
- class SkeletonLoaderComponent {
608
- constructor() {
609
- this.count = 5;
610
- this.type = 'tiles'; // 'large-tile', 'table'
611
- }
612
- ngOnInit() {
613
- }
614
- counter(i) {
615
- return new Array(i);
616
- }
617
- }
618
- SkeletonLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
619
- SkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkeletonLoaderComponent, selector: "lib-skeleton-loader", inputs: { count: "count", type: "type" }, ngImport: i0, template: "<!-- <h1>SKELETON LOADER!</h1> -->\r\n<ng-container *ngSwitch=\"type\">\r\n <div class=\"cards-deck-4\" *ngSwitchCase=\"'tiles'\">\r\n <ng-container *ngFor=\"let i of counter(count)\">\r\n <div class=\"relative p-4 w-full bg-white rounded-lg overflow-hidden shadow hover:shadow-md rounded-lg\">\r\n <div class=\"animate-pulse flex flex-col\">\r\n <div class=\"rounded w-full h-32 bg-gray-200\"></div>\r\n <div class=\"flex flex-col mt-5\">\r\n <div class=\"w-full h-5 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-10/12 h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-8/12 h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 mt-5 gap-x-2 gap-y-1\">\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n\r\n <div class=\"flex items-center mt-5\">\r\n <div>\r\n <div class=\"rounded-full bg-gray-200 w-10 h-10\"></div>\r\n </div>\r\n <div class=\"flex justify-between w-full ml-3\">\r\n <div class=\"w-5/12 h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"w-2/12 h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"cards-deck-3\" *ngSwitchCase=\"'large-tiles'\">\r\n <ng-container *ngFor=\"let i of counter(count)\">\r\n <div class=\"relative p-4 w-full bg-white rounded-lg overflow-hidden shadow hover:shadow-md rounded-lg\">\r\n <div class=\"animate-pulse flex flex-col\">\r\n <div class=\"rounded w-full h-52 bg-gray-200\"></div>\r\n <div class=\"flex flex-col mt-5\">\r\n <div class=\"w-full h-5 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-10/12 h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-8/12 h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 mt-5 gap-x-2 gap-y-1\">\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n\r\n <div class=\"flex items-center mt-5\">\r\n <div>\r\n <div class=\"rounded-full bg-gray-200 w-10 h-10\"></div>\r\n </div>\r\n <div class=\"flex justify-between w-full ml-3\">\r\n <div class=\"w-5/12 h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"w-2/12 h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"cards-deck-1\" *ngSwitchCase=\"'table'\">\r\n <ng-container *ngFor=\"let i of counter(count)\">\r\n <div class=\"border border-light-blue-300 shadow rounded-sm p-4 max-w-sm w-full mx-auto mb-4\">\r\n <div class=\"animate-pulse flex space-x-4\">\r\n <div class=\"rounded-full bg-light-blue-400 h-12 w-12\">&nbsp;</div>\r\n <div class=\"flex-1 space-y-4 py-1\">\r\n <div class=\"h-4 bg-light-blue-400 rounded w-3/4\">&nbsp;</div>\r\n <div class=\"space-y-2\">\r\n <div class=\"h-4 bg-light-blue-400 rounded\">&nbsp;</div>\r\n <div class=\"h-4 bg-light-blue-400 rounded w-5/6\">&nbsp;</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"cards-deck-3\" *ngSwitchDefault>\r\n <ng-container *ngFor=\"let i of counter(count)\">\r\n <div class=\"relative p-4 w-full bg-white rounded-lg overflow-hidden shadow hover:shadow-md rounded-lg\">\r\n <div class=\"animate-pulse flex flex-col\">\r\n <div class=\"rounded w-full h-52 bg-gray-200\"></div>\r\n <div class=\"flex flex-col mt-5\">\r\n <div class=\"w-full h-5 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-10/12 h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-8/12 h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 mt-5 gap-x-2 gap-y-1\">\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"mt-2 w-full h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n\r\n <div class=\"flex items-center mt-5\">\r\n <div>\r\n <div class=\"rounded-full bg-gray-200 w-10 h-10\"></div>\r\n </div>\r\n <div class=\"flex justify-between w-full ml-3\">\r\n <div class=\"w-5/12 h-3 bg-gray-200 rounded\"></div>\r\n <div class=\"w-2/12 h-3 bg-gray-200 rounded\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</ng-container>\r\n", directives: [{ type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
620
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkeletonLoaderComponent, decorators: [{
621
- type: Component,
622
- args: [{
623
- // tslint:disable-next-line:component-selector
624
- selector: 'lib-skeleton-loader',
625
- templateUrl: './skeleton-loader.component.html'
626
- }]
627
- }], ctorParameters: function () { return []; }, propDecorators: { count: [{
628
- type: Input
629
- }], type: [{
630
- type: Input
631
- }] } });
632
-
633
- class ListViewEmptyStateComponent {
634
- constructor() {
635
- this.title = 'Δεν βρέθηκαν εγγραφές.';
636
- // tslint:disable-next-line:no-input-rename
637
- this.subTitle = 'Παρακαλώ αλλάξτε τα κριτήρια αναζήτησης σας ή ξεκινήστε προσθέτοντας μια νέα εγγραφή';
638
- // tslint:disable-next-line:no-input-rename
639
- this.newItemLabel = 'Νέα εγγραφή';
640
- }
641
- ngOnInit() {
642
- }
643
- }
644
- ListViewEmptyStateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewEmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
645
- ListViewEmptyStateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListViewEmptyStateComponent, selector: "lib-list-view-empty-state", inputs: { title: "title", subTitle: ["sub-title", "subTitle"], newItemLabel: ["new-item-label", "newItemLabel"] }, ngImport: i0, template: "<div class=\"p-20\">\r\n <div class=\"text-center p-2\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"mx-auto h-12 w-12 text-gray-400\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4\" />\r\n </svg>\r\n <h3 class=\"mt-2 text-sm font-medium text-gray-900\">{{title}}</h3>\r\n <p class=\"mt-1 text-sm text-gray-500\">\r\n {{subTitle}}\r\n </p>\r\n <div class=\"mt-6\" *ngIf=\"false\">\r\n <button type=\"button\" class=\"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-gray-600 hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-gray-500\">\r\n <!-- Heroicon name: solid/plus -->\r\n <svg class=\"-ml-1 mr-2 h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\">\r\n <path vector-effect=\"non-scaling-stroke\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z\" />\r\n </svg>\r\n {{newItemLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewEmptyStateComponent, decorators: [{
647
- type: Component,
648
- args: [{
649
- selector: 'lib-list-view-empty-state',
650
- templateUrl: './list-view-empty-state.component.html'
651
- }]
652
- }], ctorParameters: function () { return []; }, propDecorators: { title: [{
653
- type: Input
654
- }], subTitle: [{
655
- type: Input,
656
- args: ['sub-title']
657
- }], newItemLabel: [{
658
- type: Input,
659
- args: ['new-item-label']
660
- }] } });
661
-
662
- class ListViewComponent {
663
- constructor() {
664
- // BUSY STATE
665
- this.busy = false;
666
- // PAGING - pass through for pager component
667
- this.count = null;
668
- this.page = 1;
669
- this.view = ListViewType.Table;
670
- this.sort = null;
671
- // tslint:disable-next-line:no-input-rename
672
- this.pageSize = 20;
673
- // tslint:disable-next-line:no-input-rename
674
- this.pageSizeOptions = [];
675
- // SORTING - pass through for pager component
676
- // tslint:disable-next-line:no-input-rename
677
- this.sortOptions = [];
678
- // tslint:disable-next-line:no-input-rename
679
- this.sortdir = '-';
680
- // tslint:disable-next-line:no-input-rename
681
- this.tilesCount = 4;
682
- // tslint:disable-next-line:no-input-rename
683
- this.showPager = true;
684
- // tslint:disable-next-line:no-input-rename
685
- this.pagerPosition = PagerPosition.Top;
686
- // DETAILS SECTION
687
- // Check if details section and button should be displayed according to the count of the value given
688
- // tslint:disable-next-line:no-input-rename
689
- this.detailsSectionPropertyCount = null;
690
- this.pageChanged = new EventEmitter();
691
- this.pageSizeChanged = new EventEmitter();
692
- this.detailsOpened = new EventEmitter();
693
- this.sortChanged = new EventEmitter();
694
- this.sortdirChanged = new EventEmitter();
695
- this.multipleFullWidth = false;
696
- this.expandIcon = Icons.Expand;
697
- this.collapseIcon = Icons.Collapse;
698
- this.tableViewSupported = false;
699
- this.fullWidthTHClass = 'list-view-th-full';
700
- this.fullWidthTDClass = 'list-view-td-full';
701
- this.tilesViewSupported = false;
702
- this.detailsSectionSupported = false;
703
- this.loaderItems = [];
704
- this.columns = [];
705
- this.tilesDeckClass = 'cards-deck-4';
706
- this.tileTemplate = null;
707
- this.detailsTemplate = null;
708
- for (let i = 0; i < 5; i++) {
709
- this.loaderItems.push({});
710
- }
711
- if (this.pagerPosition) {
712
- this.pagerPosition = this.pagerPosition;
713
- }
714
- }
715
- // COLUMNS
716
- set cols(refs) {
717
- this.columns = refs === null || refs === void 0 ? void 0 : refs.toArray();
718
- if (this.columns && this.columns.length > 0) {
719
- this.tableViewSupported = true;
720
- }
721
- this.multipleFullWidth = this.columns.filter(c => c.fullWidth).length > 1;
722
- this.fullWidthTHClass = this.multipleFullWidth ? 'list-view-th-half' : 'list-view-th-full';
723
- this.fullWidthTDClass = this.multipleFullWidth ? 'list-view-td-half' : 'list-view-td-full';
724
- }
725
- // tslint:disable-next-line:no-input-rename
726
- set tiles(ref) {
727
- this.tileTemplate = ref;
728
- if (this.tileTemplate) {
729
- this.tilesViewSupported = true;
730
- }
731
- }
732
- set details(ref) {
733
- this.detailsTemplate = ref;
734
- if (this.detailsTemplate) {
735
- this.detailsSectionSupported = true;
736
- }
737
- }
738
- ngOnChanges(changes) {
739
- const tilesCountChange = changes['tiles-count'] || changes.tilesCount;
740
- if (tilesCountChange) {
741
- this.setTilesDeckClass(tilesCountChange.currentValue);
742
- }
743
- }
744
- // events
745
- emitPageChanged($event) {
746
- this.pageChanged.emit($event);
747
- }
748
- emitPageSizeChanged($event) {
749
- this.pageSizeChanged.emit($event);
750
- }
751
- emitSortChanged($event) {
752
- this.sortChanged.emit($event);
753
- }
754
- emitSortdirChanged($event) {
755
- this.sortdirChanged.emit($event);
756
- }
757
- toggleDetails(item) {
758
- item.detailsExpanded = !item.detailsExpanded;
759
- this.detailsOpened.emit({ item, open: item.detailsExpanded });
760
- }
761
- // helpers
762
- setTilesDeckClass(tiles) {
763
- if (tiles >= 1 && tiles <= 4) {
764
- this.tilesDeckClass =
765
- this.view !== ListViewType.Gallery
766
- ? `cards-deck-${tiles}`
767
- : this.items && this.items.length > 0
768
- ? `gallery-deck-${tiles}`
769
- : 'gallery-deck';
770
- }
771
- else {
772
- this.tilesDeckClass =
773
- this.view !== ListViewType.Gallery
774
- ? 'cards-deck-3'
775
- : this.items && this.items.length > 0
776
- ? 'gallery-deck-3'
777
- : 'gallery-deck';
778
- }
779
- }
780
- }
781
- ListViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
782
- ListViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListViewComponent, selector: "lib-list-view", inputs: { busy: "busy", items: "items", count: "count", page: "page", view: "view", sort: "sort", pageSize: ["page-size", "pageSize"], pageSizeOptions: ["page-size-options", "pageSizeOptions"], sortOptions: ["sort-options", "sortOptions"], sortdir: ["sort-dir", "sortdir"], tilesCount: ["tiles-count", "tilesCount"], showPager: ["show-pager", "showPager"], pagerPosition: ["pager-position", "pagerPosition"], detailsSectionPropertyCount: ["details-section-property-count", "detailsSectionPropertyCount"] }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged", detailsOpened: "detailsOpened", sortChanged: "sortChanged", sortdirChanged: "sortdirChanged" }, queries: [{ propertyName: "tiles", first: true, predicate: ListTileComponent, descendants: true, read: ListTileComponent }, { propertyName: "details", first: true, predicate: ListDetailsSectionComponent, descendants: true, read: ListDetailsSectionComponent }, { propertyName: "cols", predicate: ListColumnComponent, read: ListColumnComponent }], usesOnChanges: true, ngImport: i0, template: "<div class=\"px-2\">\r\n\r\n <lib-pager *ngIf=\"showPager && (pagerPosition == 'top' || pagerPosition == 'both')\"\r\n [page]=\"page\"\r\n [page-size]=\"pageSize\"\r\n [count]=\"count\"\r\n [sort-options]=\"sortOptions\"\r\n [sort]=\"sort\"\r\n [sort-dir]=\"sortdir\"\r\n [busy]=\"busy\"\r\n (pageChanged)=\"emitPageChanged($event)\"\r\n (pageSizeChanged)=\"emitPageSizeChanged($event)\"\r\n (sortChanged)=\"emitSortChanged($event)\"\r\n (sortdirChanged)=\"emitSortdirChanged($event)\">\r\n </lib-pager>\r\n</div>\r\n\r\n<ng-container [ngSwitch]=\"view\">\r\n\r\n <ng-container *ngSwitchCase=\"'tiles'\">\r\n <div [class]=\"tilesDeckClass\">\r\n\r\n <lib-skeleton-loader *ngIf=\"busy\" [count]=\"5\" [type]=\"'tiles'\"></lib-skeleton-loader>\r\n\r\n <ng-container *ngIf=\"items && items.length > 0\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <span *ngIf=\"!tileTemplate || !tileTemplate.template\">template missing..</span>\r\n <ng-template [ngTemplateOutlet]=\"tileTemplate.template\"\r\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </div>\r\n </ng-container>\r\n\r\n\r\n <!-- *ngSwitchCase=\"'gallery'\" -->\r\n <ng-container *ngSwitchCase=\"'gallery'\">\r\n <ul role=\"list\" [class]=\"tilesDeckClass\">\r\n\r\n <lib-skeleton-loader *ngIf=\"busy\" [count]=\"5\" [type]=\"'tiles'\"></lib-skeleton-loader>\r\n\r\n <ng-container *ngIf=\"!busy && items && items.length > 0\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <span *ngIf=\"!tileTemplate || !tileTemplate.template\">template missing..</span>\r\n <ng-template [ngTemplateOutlet]=\"tileTemplate.template\"\r\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </ng-container>\r\n\r\n <!-- *ngSwitchCase=\"'table'\" -->\r\n <ng-container *ngSwitchDefault>\r\n\r\n <div class=\"list-view-container\">\r\n <div class=\"list-view-container-inner\">\r\n <table class=\"list-view-table\">\r\n <thead class=\"list-view-thead\">\r\n <tr>\r\n <ng-container *ngIf=\"detailsSectionSupported\">\r\n <th class=\"list-view-th-details\"></th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let col of columns\">\r\n <th scope=\"col\"\r\n [class]=\"col.fullWidth ? fullWidthTHClass : 'list-view-th'\">\r\n {{col.title}}\r\n </th>\r\n </ng-container>\r\n </tr>\r\n </thead>\r\n <tbody class=\"list-view-tbody\" *ngIf=\"busy\">\r\n <ng-container *ngFor=\"let item of loaderItems;let i=index\">\r\n <tr class=\"list-view-tr\">\r\n <ng-container *ngIf=\"detailsSectionSupported\">\r\n <td class=\"list-view-td-details\"\r\n *ngIf=\"detailsSectionPropertyCount !== null ? item[detailsSectionPropertyCount] !== 0 : true; else hiddenDetailsButton\">\r\n <button disabled\r\n type=\"button\"\r\n class=\"expand-collapse-button\">\r\n <!-- Heroicon name: solid/plus -->\r\n <i [class]=\"item.detailsExpanded ? collapseIcon : expandIcon\"></i>\r\n </button>\r\n </td>\r\n <ng-template #hiddenDetailsButton>\r\n <td class=\"list-view-td-details\"></td>\r\n </ng-template>\r\n </ng-container>\r\n <td *ngFor=\"let col of columns\"\r\n [class]=\"col.fullWidth ? fullWidthTDClass : 'list-view-td'\">\r\n <div class=\"w-full animate-pulse h-8 bg-gray-200 rounded\"></div>\r\n </td>\r\n </tr>\r\n <ng-container *ngIf=\"detailsSectionSupported\">\r\n <tr *ngIf=\"item.detailsExpanded\">\r\n <td [colSpan]=\"columns.length + 1\"\r\n class=\"list-view-td bg-gray-100\">\r\n <ng-template [ngTemplateOutlet]=\"detailsTemplate.template\"\r\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-container>\r\n </tbody>\r\n <tbody class=\"list-view-tbody\" *ngIf=\"!busy\">\r\n <ng-container *ngFor=\"let item of items;let i=index\">\r\n <tr class=\"list-view-tr\">\r\n <ng-container *ngIf=\"detailsSectionSupported\">\r\n <td class=\"list-view-td-details\"\r\n *ngIf=\"detailsSectionPropertyCount !== null ? item[detailsSectionPropertyCount] !== 0 : true; else hiddenDetailsButton\">\r\n <button (click)=\"toggleDetails(item)\"\r\n type=\"button\"\r\n class=\"expand-collapse-button\">\r\n <!-- Heroicon name: solid/plus -->\r\n <i [class]=\"item.detailsExpanded ? collapseIcon : expandIcon\"></i>\r\n </button>\r\n </td>\r\n <ng-template #hiddenDetailsButton>\r\n <td class=\"list-view-td-details\"></td>\r\n </ng-template>\r\n </ng-container>\r\n <td *ngFor=\"let col of columns\"\r\n [class]=\"col.fullWidth ? fullWidthTDClass : 'list-view-td'\">\r\n <ng-template [ngTemplateOutlet]=\"col.template\"\r\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\r\n </td>\r\n </tr>\r\n <ng-container *ngIf=\"detailsSectionSupported\">\r\n <tr *ngIf=\"item.detailsExpanded\">\r\n <td [colSpan]=\"columns.length + 1\"\r\n class=\"list-view-td bg-gray-100\">\r\n <ng-template [ngTemplateOutlet]=\"detailsTemplate.template\"\r\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!busy && items && items.length === 0\">\r\n <div class=\"cards-deck-1\">\r\n <lib-list-view-empty-state></lib-list-view-empty-state>\r\n </div>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-content></ng-content>\r\n\r\n<div class=\"pt-2 px-2\">\r\n\r\n <lib-pager *ngIf=\"showPager && (pagerPosition == 'bottom' || pagerPosition == 'both')\"\r\n [page]=\"page\"\r\n [page-size]=\"pageSize\"\r\n [count]=\"count\"\r\n [sort-options]=\"sortOptions\"\r\n [sort]=\"sort\"\r\n [sort-dir]=\"sortdir\"\r\n [busy]=\"busy\"\r\n (pageChanged)=\"emitPageChanged($event)\"\r\n (pageSizeChanged)=\"emitPageSizeChanged($event)\"\r\n (sortChanged)=\"emitSortChanged($event)\"\r\n (sortdirChanged)=\"emitSortdirChanged($event)\">\r\n </lib-pager>\r\n</div>\r\n", components: [{ type: PagerComponent, selector: "lib-pager", inputs: ["busy", "count", "page", "page-size", "page-size-options", "sort-options", "sort", "sort-dir"], outputs: ["pageChanged", "pageSizeChanged", "sortChanged", "sortdirChanged"] }, { type: SkeletonLoaderComponent, selector: "lib-skeleton-loader", inputs: ["count", "type"] }, { type: ListViewEmptyStateComponent, selector: "lib-list-view-empty-state", inputs: ["title", "sub-title", "new-item-label"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
783
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewComponent, decorators: [{
784
- type: Component,
785
- args: [{
786
- selector: 'lib-list-view',
787
- templateUrl: './list-view.component.html'
788
- }]
789
- }], ctorParameters: function () { return []; }, propDecorators: { busy: [{
790
- type: Input
791
- }], items: [{
792
- type: Input
793
- }], count: [{
794
- type: Input
795
- }], page: [{
796
- type: Input
797
- }], view: [{
798
- type: Input
799
- }], sort: [{
800
- type: Input
801
- }], pageSize: [{
802
- type: Input,
803
- args: ['page-size']
804
- }], pageSizeOptions: [{
805
- type: Input,
806
- args: ['page-size-options']
807
- }], sortOptions: [{
808
- type: Input,
809
- args: ['sort-options']
810
- }], sortdir: [{
811
- type: Input,
812
- args: ['sort-dir']
813
- }], tilesCount: [{
814
- type: Input,
815
- args: ['tiles-count']
816
- }], showPager: [{
817
- type: Input,
818
- args: ['show-pager']
819
- }], pagerPosition: [{
820
- type: Input,
821
- args: ['pager-position']
822
- }], detailsSectionPropertyCount: [{
823
- type: Input,
824
- args: ['details-section-property-count']
825
- }], cols: [{
826
- type: ContentChildren,
827
- args: [ListColumnComponent, { read: ListColumnComponent }]
828
- }], tiles: [{
829
- type: ContentChild,
830
- args: [ListTileComponent, { read: ListTileComponent }]
831
- }], details: [{
832
- type: ContentChild,
833
- args: [ListDetailsSectionComponent, { read: ListDetailsSectionComponent }]
834
- }], pageChanged: [{
835
- type: Output
836
- }], pageSizeChanged: [{
837
- type: Output
838
- }], detailsOpened: [{
839
- type: Output
840
- }], sortChanged: [{
841
- type: Output
842
- }], sortdirChanged: [{
843
- type: Output
844
- }] } });
845
-
846
- class CollapsiblePanelComponent {
847
- constructor() {
848
- this.title = null;
849
- this.visible = false;
850
- }
851
- ngOnInit() {
852
- }
853
- }
854
- CollapsiblePanelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CollapsiblePanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
855
- CollapsiblePanelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CollapsiblePanelComponent, selector: "lib-collapsible-panel", inputs: { title: "title" }, ngImport: i0, template: "<div class=\"collapsible-panel-container\">\r\n <div class=\"collapsible-panel-container-shadow\">\r\n <div class=\"collapsible-panel-container-inner\">\r\n <button type=\"button\" class=\"collapsible-panel-button\" (click)=\"visible = !visible\">\r\n <div class=\"collapsible-panel-button-content-container\">\r\n <span>{{ title }} </span>\r\n <span class=\"ico-plus\"></span>\r\n </div>\r\n </button>\r\n <div class=\"collapsible-panel-content-container\" *ngIf=\"visible\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
856
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CollapsiblePanelComponent, decorators: [{
857
- type: Component,
858
- args: [{
859
- selector: 'lib-collapsible-panel',
860
- templateUrl: './collapsible-panel.component.html'
861
- }]
862
- }], ctorParameters: function () { return []; }, propDecorators: { title: [{
863
- type: Input
864
- }] } });
865
-
866
- class KpiTileComponent {
867
- constructor() {
868
- this.title = undefined;
869
- this.busy = false;
870
- this.kpi = undefined;
871
- // tslint:disable-next-line:no-output-rename
872
- this.tileAction = new EventEmitter();
873
- }
874
- ngOnInit() {
875
- }
876
- emitTileAction($event) {
877
- $event.preventDefault();
878
- $event.stopPropagation();
879
- this.tileAction.emit($event);
880
- return false;
881
- }
882
- }
883
- KpiTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KpiTileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
884
- KpiTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: KpiTileComponent, selector: "lib-kpi-tile", inputs: { title: "title", busy: "busy", kpi: "kpi" }, outputs: { tileAction: "tile-action" }, ngImport: i0, template: "<div class=\"card\"\r\n [ngClass]=\"{'card-deck-busy' : busy }\">\r\n <div class=\"card-body\">\r\n <div class=\"kpi-tile-title-container\">\r\n <a href=\"#\"\r\n class=\"kpi-tile-action\"\r\n (click)=\"emitTileAction($event)\">{{title || '-'}}</a>\r\n </div>\r\n <p class=\"kpi-tile-value\">{{kpi || '-'}}</p>\r\n <div class=\"card-footer\">\r\n <div class=\"text-xs\">\r\n <a href=\"#\"\r\n class=\"kpi-tile-action\"\r\n (click)=\"emitTileAction($event)\">\u03A0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B1</a>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
885
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KpiTileComponent, decorators: [{
886
- type: Component,
887
- args: [{
888
- selector: 'lib-kpi-tile',
889
- templateUrl: './kpi-tile.component.html'
890
- }]
891
- }], ctorParameters: function () { return []; }, propDecorators: { title: [{
892
- type: Input
893
- }], busy: [{
894
- type: Input
895
- }], kpi: [{
896
- type: Input
897
- }], tileAction: [{
898
- type: Output,
899
- args: ['tile-action']
900
- }] } });
901
-
902
- // freaksly simple date picker : https://tailwind-elements.com/docs/standard/forms/datepicker/
903
- class DatepickerComponent {
904
- constructor(locale) {
905
- this.locale = locale;
906
- this.readonly = false;
907
- this.disabled = false;
908
- this.inline = false;
909
- this.displayFormat = 'dd/MM/yyyy';
910
- this.placeholder = '';
911
- this.value = null;
912
- this.valueChange = new EventEmitter();
913
- this.minDate = undefined;
914
- this.maxDate = undefined;
915
- this.showCalendar = false;
916
- this.showYears = false;
917
- this.monthNames = getLocaleMonthNames(this.locale, FormStyle.Standalone, TranslationWidth.Wide);
918
- this.dayNames = getLocaleDayNames(this.locale, FormStyle.Standalone, TranslationWidth.Abbreviated);
919
- this.month = -1;
920
- this.year = -1;
921
- this.calendarDates = [];
922
- this.calendarYears = [];
923
- this.showCalendarYears = [];
924
- this.blankDays = [];
925
- this.calendarYearPage = 1;
926
- this.yearsPerPage = 30;
927
- this.onChange$ = undefined;
928
- this.onTouched$ = undefined;
929
- }
930
- ngOnInit() {
931
- var _a, _b;
932
- let today = new Date();
933
- this.month = today.getMonth();
934
- this.year = today.getFullYear();
935
- this.calendarDates = [{ day: this.value, today: this.value, selected: this.value }];
936
- this.calendarYears = [{ year: (_a = this.value) === null || _a === void 0 ? void 0 : _a.getFullYear(), today: this.value, selected: this.value }];
937
- const yearsArray = [];
938
- for (let i = 1950; i <= today.getFullYear() + 2; i++) {
939
- yearsArray.push({ year: i, today: this.compareDates(today, null, i), selected: i == ((_b = this.value) === null || _b === void 0 ? void 0 : _b.getFullYear()) });
940
- }
941
- this.calendarYears = yearsArray;
942
- this.showCalendarYears = this.paginate(this.calendarYears, 1);
943
- this.calcDays();
944
- }
945
- writeValue(obj) {
946
- if (obj) {
947
- this.value = new Date(obj);
948
- this.month = this.value.getMonth();
949
- this.year = this.value.getFullYear();
950
- }
951
- }
952
- registerOnChange(fn) {
953
- this.onChange$ = fn;
954
- }
955
- registerOnTouched(fn) {
956
- this.onTouched$ = fn;
957
- }
958
- onBlur(event) {
959
- if (this.onTouched$) {
960
- this.onTouched$();
961
- }
962
- this.getDateFromInput();
963
- }
964
- selectDateValue(date) {
965
- // This should be in UTC
966
- if (!this.outOfRangeDate(date.day)) {
967
- let selectedDate = new Date(this.year, this.month, date.day, 3, 0, 0, 0);
968
- this.value = selectedDate;
969
- this.valueChange.emit(this.value);
970
- if (this.onChange$) {
971
- this.onChange$(this.value);
972
- }
973
- this.updateDays();
974
- if (this.onTouched$) {
975
- this.onTouched$();
976
- }
977
- this.calcDays();
978
- this.showCalendar = false;
979
- }
980
- }
981
- selectYearValue(year) {
982
- var _a, _b, _c, _d, _e;
983
- // This should be in UTC
984
- const tempYear = this.year;
985
- this.year = year.year;
986
- if (!this.outOfRangeDate((_b = (_a = this.calendarDates) === null || _a === void 0 ? void 0 : _a.find(x => x.selected == true)) !== null && _b !== void 0 ? _b : { day: 1 })) {
987
- let selectedDate = new Date(year.year, (_c = this.month) !== null && _c !== void 0 ? _c : 1, (_e = (_d = this.calendarDates) === null || _d === void 0 ? void 0 : _d.find(x => x.selected == true).day) !== null && _e !== void 0 ? _e : 1, 3, 0, 0, 0);
988
- this.value = selectedDate;
989
- this.valueChange.emit(this.value);
990
- if (this.onChange$) {
991
- this.onChange$(this.value);
992
- }
993
- this.updateDays();
994
- if (this.onTouched$) {
995
- this.onTouched$();
996
- }
997
- this.showYears = false;
998
- this.showCalendar = true;
999
- this.calcDays();
1000
- }
1001
- else {
1002
- this.year = tempYear;
1003
- this.showYears = false;
1004
- this.showCalendar = true;
1005
- }
1006
- }
1007
- previousMonth() {
1008
- if (this.month !== 0) {
1009
- this.month = this.month - 1;
1010
- this.calcDays();
1011
- }
1012
- else {
1013
- this.month = 11;
1014
- this.year = this.year - 1;
1015
- this.calcDays();
1016
- }
1017
- if (this.onTouched$) {
1018
- this.onTouched$();
1019
- }
1020
- }
1021
- nextMonth() {
1022
- if (this.month !== 11) {
1023
- this.month = this.month + 1;
1024
- this.calcDays();
1025
- }
1026
- else {
1027
- this.month = 0;
1028
- this.year = this.year + 1;
1029
- this.calcDays();
1030
- }
1031
- if (this.onTouched$) {
1032
- this.onTouched$();
1033
- }
1034
- }
1035
- previousYear() {
1036
- this.showCalendarYears = this.paginate(this.calendarYears, this.calendarYearPage > 1 ? --this.calendarYearPage : 1);
1037
- this.calcDays();
1038
- if (this.onTouched$) {
1039
- this.onTouched$();
1040
- }
1041
- }
1042
- nextYear() {
1043
- this.showCalendarYears = this.paginate(this.calendarYears, this.calendarYearPage <= this.calendarYears.length / this.yearsPerPage
1044
- ? ++this.calendarYearPage
1045
- : this.calendarYearPage);
1046
- this.calcDays();
1047
- if (this.onTouched$) {
1048
- this.onTouched$();
1049
- }
1050
- }
1051
- compareDates(date1, day, year) {
1052
- var _a;
1053
- if (!date1) {
1054
- return false;
1055
- }
1056
- const d = new Date(year !== null && year !== void 0 ? year : this.year, this.month, day !== null && day !== void 0 ? day : (_a = this.value) === null || _a === void 0 ? void 0 : _a.getDay());
1057
- return date1.toDateString() === d.toDateString();
1058
- }
1059
- ;
1060
- calcDays() {
1061
- var _a;
1062
- const daysInMonth = new Date(this.year, this.month + 1, 0).getDate();
1063
- // find where to start calendar day of week
1064
- const dayOfWeek = new Date(this.year, this.month).getDay();
1065
- const blankdaysArray = new Array();
1066
- for (var i = 1; i <= dayOfWeek; i++) {
1067
- // check if month is February
1068
- blankdaysArray.push(this.month != 2 ? (32 - i) : (29 - i));
1069
- blankdaysArray.reverse().sort();
1070
- }
1071
- const daysArray = [];
1072
- const today = new Date();
1073
- for (var i = 1; i <= daysInMonth; i++) {
1074
- daysArray.push({ day: i, today: this.compareDates(today, i, null), selected: this.compareDates((_a = this.value) !== null && _a !== void 0 ? _a : today, i, null) });
1075
- }
1076
- const yearsArray = [];
1077
- for (let i = 1950; i <= today.getFullYear() + 2; i++) {
1078
- yearsArray.push({ year: i, today: this.compareDates(today, null, i), selected: i == this.year });
1079
- }
1080
- this.calendarYears = yearsArray;
1081
- this.blankDays = blankdaysArray;
1082
- this.calendarDates = daysArray;
1083
- }
1084
- updateDays() {
1085
- const today = new Date();
1086
- this.calendarDates.forEach(d => {
1087
- d.today = this.compareDates(today, d, this.year);
1088
- d.selected = this.compareDates(this.value, d, this.year);
1089
- });
1090
- }
1091
- paginate(array, page_number) {
1092
- return array.slice((page_number - 1) * this.yearsPerPage, page_number * this.yearsPerPage);
1093
- }
1094
- getDateFromInput() {
1095
- var _a, _b;
1096
- if (((_a = this.dateInput) === null || _a === void 0 ? void 0 : _a.nativeElement.value) !== '' && !this.inline) {
1097
- var dateParts = (_b = this.dateInput) === null || _b === void 0 ? void 0 : _b.nativeElement.value.split("/");
1098
- let dateInGrFormat = new Date(+dateParts[2], dateParts[1] - 1, +dateParts[0], 3, 0, 0);
1099
- if (dateInGrFormat.toString() !== 'Invalid Date') {
1100
- this.writeValue(dateInGrFormat);
1101
- this.calcDays();
1102
- this.valueChange.emit(dateInGrFormat);
1103
- }
1104
- if (this.onChange$) {
1105
- this.onChange$(this.value);
1106
- }
1107
- this.updateDays();
1108
- if (this.onTouched$) {
1109
- this.onTouched$();
1110
- }
1111
- }
1112
- this.showCalendar = false;
1113
- }
1114
- openYears() {
1115
- this.showYears = !this.showYears;
1116
- this.calendarYearPage = Math.ceil(this.calendarYears.map(x => x.year).indexOf(this.year) / this.yearsPerPage);
1117
- this.showCalendarYears = this.paginate(this.calendarYears, this.calendarYearPage !== 0 ? this.calendarYearPage : 1);
1118
- this.calcDays();
1119
- }
1120
- openCalendar() {
1121
- this.showCalendar = !this.showCalendar;
1122
- this.calcDays();
1123
- }
1124
- closeCalendar() {
1125
- this.showCalendar = false;
1126
- this.getDateFromInput();
1127
- }
1128
- outOfRangeDate(date) {
1129
- let outOfRange = false;
1130
- if (this.minDate || this.maxDate) {
1131
- const d = new Date(this.year, this.month, date.day);
1132
- const dateInMillis = d.getTime();
1133
- if (this.minDate) {
1134
- let minDate = this.minDate.getTime();
1135
- if (dateInMillis < minDate && this.minDate.toDateString() !== d.toDateString()) {
1136
- outOfRange = true;
1137
- }
1138
- }
1139
- if (this.maxDate) {
1140
- let maxDate = this.maxDate.getTime();
1141
- if (dateInMillis > maxDate && this.maxDate.toDateString() !== d.toDateString()) {
1142
- outOfRange = true;
1143
- }
1144
- }
1145
- }
1146
- return outOfRange;
1147
- }
1148
- }
1149
- DatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DatepickerComponent, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Component });
1150
- DatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DatepickerComponent, selector: "lib-date-picker", inputs: { readonly: "readonly", disabled: "disabled", inline: "inline", displayFormat: ["display-format", "displayFormat"], placeholder: "placeholder", value: "value", minDate: "minDate", maxDate: "maxDate" }, outputs: { valueChange: "valueChange" }, providers: [
1151
- {
1152
- provide: NG_VALUE_ACCESSOR,
1153
- useExisting: forwardRef(() => DatepickerComponent),
1154
- multi: true
1155
- }
1156
- ], viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true }], ngImport: i0, template: "<div class=\"flex\"\r\n [ngClass]=\"{'relative': !inline}\"\r\n (clickOutside)=\"closeCalendar()\">\r\n\r\n <input type=\"text\"\r\n *ngIf=\"!inline\"\r\n #dateInput\r\n [readonly]=\"readonly\"\r\n name=\"dateInput\"\r\n (blur)=\"onBlur($event)\"\r\n id=\"dateInput\"\r\n (focus)=\"showCalendar = false\"\r\n [value]=\"value | date: displayFormat\"\r\n class=\"detapicker-input\"\r\n [ngClass]=\"{'cursor-not-allowed': disabled}\"\r\n [placeholder]=\"disabled ? '' : placeholder\">\r\n\r\n <button type=\"button\"\r\n *ngIf=\"!inline\"\r\n class=\"datepicker-button\"\r\n [disabled]=\"disabled\"\r\n (click)=\"openCalendar()\"\r\n [ngClass]=\"{'cursor-not-allowed': disabled}\">\r\n <i class=\"ms-Icon ms-Icon--DateTime2\"></i>\r\n </button>\r\n\r\n <div *ngIf=\"showCalendar || inline\"\r\n [ngClass]=\"{'absolute': !inline}\"\r\n class=\"datepicker-background\"\r\n style=\"height:18rem;min-width:16rem;\"\r\n name=\"calendar\">\r\n <div class=\"datepicker-btn-wrapper\">\r\n <div>\r\n <button type=\"button\"\r\n (click)=\"openYears()\">\r\n <span class=\"datepicker-selected-month\">\r\n {{monthNames[month]}}\r\n </span>\r\n <span class=\"datepicker-selected-year\">\r\n {{year}}</span>\r\n </button>\r\n </div>\r\n <div *ngIf=\"!showYears; else showYearsPickerTmpl\">\r\n <button type=\"button\"\r\n class=\"datepicker-nav-btn\"\r\n (click)=\"previousMonth();\">\r\n <svg fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M15 19l-7-7 7-7\" />\r\n </svg>\r\n </button>\r\n <button type=\"button\"\r\n class=\"datepicker-nav-btn\"\r\n (click)=\"nextMonth()\">\r\n <svg fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M9 5l7 7-7 7\" />\r\n </svg>\r\n </button>\r\n </div>\r\n <ng-template #showYearsPickerTmpl>\r\n <div>\r\n <button type=\"button\"\r\n class=\"datepicker-nav-btn\"\r\n (click)=\"previousYear();\">\r\n <svg fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M15 19l-7-7 7-7\" />\r\n </svg>\r\n </button>\r\n <button type=\"button\"\r\n class=\"datepicker-nav-btn\"\r\n (click)=\"nextYear()\">\r\n <svg fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M9 5l7 7-7 7\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </ng-template>\r\n </div>\r\n\r\n <div class=\"datepicker-wrapper\"\r\n *ngIf=\"!showYears; else showCalYearsTmpl\">\r\n <div *ngFor=\"let day of dayNames\"\r\n class=\"datepicker-day-name\"\r\n style=\"width: 14.28%\">{{day}}</div>\r\n </div>\r\n\r\n <ng-template #showCalYearsTmpl>\r\n <div class=\"datepicker-content-wrapper\">\r\n <div *ngFor=\"let year of showCalendarYears\"\r\n style=\"width: 18.28%\"\r\n class=\"px-1 mb-1\">\r\n <div (click)=\"selectYearValue(year)\"\r\n class=\"datepicker-year\"\r\n [class]=\"year.selected ? 'selected' : 'not-selected'\">\r\n {{year.year}}</div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"datepicker-content-wrapper\"\r\n *ngIf=\"!showYears\">\r\n <div *ngFor=\"let blankday of blankDays\"\r\n style=\"width: 14.28%\"\r\n class=\"datepicker-blank-days\">{{blankday}}</div>\r\n <div *ngFor=\"let date of calendarDates;\"\r\n style=\"width: 14.28%\"\r\n class=\"px-1 mb-1\">\r\n <div (click)=\"selectDateValue(date)\"\r\n class=\"datepicker-days\"\r\n [ngClass]=\"{'out-of-range': outOfRangeDate(date),'selected': date.selected, 'not-selected':!date.selected }\">\r\n {{date.day}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>", directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideEnabled", "attachOutsideOnClick", "delayClickOutsideInit", "emitOnBlur", "exclude", "excludeBeforeClick", "clickOutsideEvents"], outputs: ["clickOutside"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "date": i1.DatePipe } });
1157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DatepickerComponent, decorators: [{
1158
- type: Component,
1159
- args: [{
1160
- selector: 'lib-date-picker',
1161
- templateUrl: './date-picker.component.html',
1162
- providers: [
1163
- {
1164
- provide: NG_VALUE_ACCESSOR,
1165
- useExisting: forwardRef(() => DatepickerComponent),
1166
- multi: true
1167
- }
1168
- ]
1169
- }]
1170
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1171
- type: Inject,
1172
- args: [LOCALE_ID]
1173
- }] }]; }, propDecorators: { readonly: [{
1174
- type: Input
1175
- }], disabled: [{
1176
- type: Input
1177
- }], inline: [{
1178
- type: Input
1179
- }], displayFormat: [{
1180
- type: Input,
1181
- args: ['display-format']
1182
- }], placeholder: [{
1183
- type: Input
1184
- }], value: [{
1185
- type: Input
1186
- }], valueChange: [{
1187
- type: Output
1188
- }], dateInput: [{
1189
- type: ViewChild,
1190
- args: ['dateInput']
1191
- }], minDate: [{
1192
- type: Input
1193
- }], maxDate: [{
1194
- type: Input
1195
- }] } });
1196
-
1197
- class ToasterService {
1198
- constructor() {
1199
- this.subject = new BehaviorSubject(NULL_TOAST);
1200
- this.toast$ = this.subject.asObservable()
1201
- .pipe(filter(toast => toast !== null && toast.title !== NULL_TOAST.title));
1202
- }
1203
- show(type, title, body, delay) {
1204
- this.subject.next({ type, title, body, delay });
1205
- }
1206
- }
1207
- ToasterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToasterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1208
- ToasterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToasterService, providedIn: 'root' });
1209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToasterService, decorators: [{
1210
- type: Injectable,
1211
- args: [{
1212
- providedIn: 'root'
1213
- }]
1214
- }], ctorParameters: function () { return []; } });
1215
-
1216
- class ToasterComponent {
1217
- constructor() {
1218
- this.i = 0;
1219
- this.remove = new EventEmitter();
1220
- this.isMobile = false;
1221
- this.closed = false;
1222
- }
1223
- ngOnInit() {
1224
- window.screen.width > 640 ? this.isMobile = false : this.isMobile = true;
1225
- }
1226
- closeToast(index) {
1227
- this.closed = true;
1228
- setTimeout(() => this.remove.emit(index), 100);
1229
- }
1230
- }
1231
- ToasterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToasterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1232
- ToasterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToasterComponent, selector: "lib-toaster", inputs: { toast: "toast", i: "i" }, outputs: { remove: "remove" }, ngImport: i0, template: "<div aria-live=\"assertive\"\r\n [ngClass]=\"closed ? 'toast-closed': 'toast z-50'\"\r\n [ngStyle]=\"isMobile ? { 'margin-bottom.px': i * 85 } : {'margin-top.px': i * 85 }\">\r\n <div class=\"toast-container\">\r\n <div class=\"toast-pill\">\r\n <div class=\"toast-context-padding\">\r\n <div class=\"toast-context\"\r\n [ngSwitch]=\"toast?.type\">\r\n <div class=\"toast-icon\"\r\n *ngSwitchCase=\"'info'\">\r\n <svg class=\"h-5 w-5 text-blue-400\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\"\r\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z\"\r\n clip-rule=\"evenodd\" />\r\n </svg>\r\n </div>\r\n <div class=\"toast-icon\"\r\n *ngSwitchCase=\"'success'\">\r\n <svg class=\"h-5 w-5 text-green-400\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\" />\r\n </svg>\r\n </div>\r\n <div class=\"toast-icon\"\r\n *ngSwitchCase=\"'error'\">\r\n <svg class=\"h-5 w-5 text-red-400\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z\"\r\n clip-rule=\"evenodd\" />\r\n </svg>\r\n </div>\r\n <div class=\"toast-icon\"\r\n *ngSwitchCase=\"'warning'\">\r\n <svg class=\"h-5 w-5 text-yellow-400\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\"\r\n d=\"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z\"\r\n clip-rule=\"evenodd\" />\r\n </svg>\r\n </div>\r\n <div class=\"toast-icon\"\r\n *ngSwitchDefault>\r\n <svg class=\"h-5 w-5 text-green-400\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\" />\r\n </svg>\r\n </div>\r\n\r\n <div class=\"ml-3 w-0 flex-1\">\r\n <p class=\"toast-title\"\r\n *ngIf=\"toast?.title\">\r\n {{toast?.title}}\r\n </p>\r\n <p class=\"toast-body\">\r\n {{toast?.body}}\r\n </p>\r\n </div>\r\n <div class=\"toast-close-icon\">\r\n <button class=\"toast-close-button\"\r\n (click)=\"closeToast(i)\">\r\n <span class=\"sr-only\">Close</span>\r\n <!-- Heroicon name: solid/x -->\r\n <svg class=\"h-5 w-5\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\"\r\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\r\n clip-rule=\"evenodd\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1233
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToasterComponent, decorators: [{
1234
- type: Component,
1235
- args: [{
1236
- selector: 'lib-toaster',
1237
- templateUrl: './toaster.component.html'
1238
- }]
1239
- }], ctorParameters: function () { return []; }, propDecorators: { toast: [{
1240
- type: Input
1241
- }], i: [{
1242
- type: Input
1243
- }], remove: [{
1244
- type: Output
1245
- }] } });
1246
-
1247
- class ToasterContainerComponent {
1248
- constructor(toaster) {
1249
- this.toaster = toaster;
1250
- this.toasts = [];
1251
- }
1252
- ngOnInit() {
1253
- this.toaster.toast$
1254
- .subscribe(toast => {
1255
- this.toasts = [toast, ...this.toasts];
1256
- setTimeout(() => this.toasts.pop(), toast.delay || 6000);
1257
- });
1258
- }
1259
- remove(index) {
1260
- this.toasts = this.toasts.slice(0, index).concat(this.toasts.slice(index + 1));
1261
- }
1262
- }
1263
- ToasterContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToasterContainerComponent, deps: [{ token: ToasterService }], target: i0.ɵɵFactoryTarget.Component });
1264
- ToasterContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToasterContainerComponent, selector: "lib-toaster-container", ngImport: i0, template: "<lib-toaster *ngFor=\"let toast of toasts; let i=index\" [toast]=\"toast\" [i]=\"i\" (remove)=\"remove($event)\"></lib-toaster>\r\n", components: [{ type: ToasterComponent, selector: "lib-toaster", inputs: ["toast", "i"], outputs: ["remove"] }], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToasterContainerComponent, decorators: [{
1266
- type: Component,
1267
- args: [{
1268
- selector: 'lib-toaster-container',
1269
- templateUrl: './toaster-container.component.html'
1270
- }]
1271
- }], ctorParameters: function () { return [{ type: ToasterService }]; } });
1272
-
1273
- class AvatarInitialsComponent {
1274
- constructor() {
1275
- this.large = false;
1276
- this.colors = [
1277
- '#EB7181',
1278
- '#468547',
1279
- '#FFD558',
1280
- '#3670B2', // blue
1281
- ];
1282
- }
1283
- ngOnInit() {
1284
- this.createInititals();
1285
- const randomIndex = Math.floor(Math.random() * Math.floor(this.colors.length));
1286
- // assign this to a class if you want to randomly change background colors of the circle.
1287
- this.circleColor = this.colors[randomIndex];
1288
- }
1289
- createInititals() {
1290
- if (this.name) {
1291
- let initials = '';
1292
- for (let i = 0; i < this.name.length; i++) {
1293
- if (this.name.charAt(i) === ' ') {
1294
- continue;
1295
- }
1296
- if (this.name.charAt(i) === this.name.charAt(i).toUpperCase()) {
1297
- initials += this.name.charAt(i);
1298
- if (initials.length === 2) {
1299
- break;
1300
- }
1301
- }
1302
- }
1303
- this.initials = initials;
1304
- }
1305
- }
1306
- }
1307
- AvatarInitialsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AvatarInitialsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1308
- AvatarInitialsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AvatarInitialsComponent, selector: "lib-avatar-initials", inputs: { name: "name", large: "large" }, ngImport: i0, template: "<div [ngClass]=\"large ? 'avatar-container-large': 'avatar-container'\">\r\n <span [ngClass]=\"large ? 'avatar-text-large': 'avatar-text'\">{{ initials }}</span>\r\n</div>\r\n", directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1309
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AvatarInitialsComponent, decorators: [{
1310
- type: Component,
1311
- args: [{
1312
- selector: 'lib-avatar-initials',
1313
- templateUrl: './avatar-initials.component.html'
1314
- }]
1315
- }], ctorParameters: function () { return []; }, propDecorators: { name: [{
1316
- type: Input
1317
- }], large: [{
1318
- type: Input
1319
- }] } });
1320
-
1321
- class ToggleComponent {
1322
- constructor() {
1323
- this.valueChange = new EventEmitter();
1324
- this.onChange$ = undefined;
1325
- this.onTouched$ = undefined;
1326
- }
1327
- writeValue(obj) {
1328
- if (obj) {
1329
- this.value = obj || false;
1330
- }
1331
- }
1332
- registerOnChange(fn) {
1333
- this.onChange$ = fn;
1334
- }
1335
- registerOnTouched(fn) {
1336
- this.onTouched$ = fn;
1337
- }
1338
- onBlur(event) {
1339
- if (this.onTouched$) {
1340
- this.onTouched$();
1341
- }
1342
- }
1343
- ngOnInit() {
1344
- }
1345
- changeValue() {
1346
- this.value = !this.value;
1347
- this.valueChange.emit(this.value);
1348
- if (this.onChange$) {
1349
- this.onChange$(this.value);
1350
- }
1351
- if (this.onTouched$) {
1352
- this.onTouched$();
1353
- }
1354
- }
1355
- }
1356
- ToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1357
- ToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToggleComponent, selector: "lib-toggle", inputs: { value: "value", disabled: "disabled" }, outputs: { valueChange: "valueChange" }, providers: [
1358
- {
1359
- provide: NG_VALUE_ACCESSOR,
1360
- useExisting: forwardRef(() => ToggleComponent),
1361
- multi: true
1362
- }
1363
- ], ngImport: i0, template: "<button type=\"button\"\r\n [ngClass]=\"value ? (disabled ? 'on disabled' : 'on') : 'off'\"\r\n class=\"toggle-button\"\r\n role=\"switch\"\r\n aria-checked=\"false\"\r\n aria-labelledby=\"isPrivate\"\r\n (click)=\"changeValue()\"\r\n (blur)=\"onBlur($event)\"\r\n value=\"{{value}}\"\r\n [disabled]=\"disabled\"\r\n [title]=\"disabled ? '\u03A4\u03BF \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B9\u03B4\u03C9\u03C4\u03B9\u03BA\u03CC' : '\u0399\u03B4\u03B9\u03C9\u03C4\u03B9\u03BA\u03CC'\">\r\n <span aria-hidden=\"true\"\r\n [ngClass]=\"value ? 'enabled-anim' : 'disabled-anim'\"\r\n class=\"toggle-span\"></span>\r\n</button>", directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToggleComponent, decorators: [{
1365
- type: Component,
1366
- args: [{
1367
- selector: 'lib-toggle',
1368
- templateUrl: './toggle.component.html',
1369
- providers: [
1370
- {
1371
- provide: NG_VALUE_ACCESSOR,
1372
- useExisting: forwardRef(() => ToggleComponent),
1373
- multi: true
1374
- }
1375
- ]
1376
- }]
1377
- }], ctorParameters: function () { return []; }, propDecorators: { value: [{
1378
- type: Input
1379
- }], disabled: [{
1380
- type: Input
1381
- }], valueChange: [{
1382
- type: Output
1383
- }] } });
1384
-
1385
- class SidePaneComponent {
1386
- constructor(router, document) {
1387
- this.router = router;
1388
- this.document = document;
1389
- // tslint:disable-next-line:no-input-rename
1390
- this.showPane = false;
1391
- this.sizeContainerStyle = 'side-pane-box-size';
1392
- this.overlayStyle = 'side-pane-overlay';
1393
- this.onComplete = new EventEmitter();
1394
- }
1395
- ngOnDestroy() {
1396
- }
1397
- ngOnInit() {
1398
- }
1399
- onSidePaneActivated(component) {
1400
- var _a;
1401
- this.document.body.classList.add('modal-active');
1402
- let sizeStyleSuffix = '';
1403
- const state = (_a = this.router.getCurrentNavigation()) === null || _a === void 0 ? void 0 : _a.extras.state;
1404
- if (state) {
1405
- if (state.paneSize) {
1406
- if (state.paneSize === SidePaneSize.Small25) {
1407
- sizeStyleSuffix = '-25';
1408
- }
1409
- else if (state.paneSize === SidePaneSize.Medium50) {
1410
- sizeStyleSuffix = '-50';
1411
- }
1412
- else if (state.paneSize === SidePaneSize.Large75) {
1413
- sizeStyleSuffix = '-75';
1414
- }
1415
- }
1416
- if (state.paneOverlay) {
1417
- if (state.paneOverlay === SidePaneOverlayType.None) {
1418
- this.overlayStyle = 'side-pane-overlay-opacity-0';
1419
- }
1420
- else if (state.paneOverlay === SidePaneOverlayType.Dark) {
1421
- this.overlayStyle = 'side-pane-overlay-opacity-50';
1422
- }
1423
- else {
1424
- this.overlayStyle = 'side-pane-overlay';
1425
- }
1426
- }
1427
- }
1428
- this.sizeContainerStyle = `side-pane-box-size${sizeStyleSuffix}`;
1429
- this.showPane = true;
1430
- }
1431
- onSidePaneDeactivated($event) {
1432
- this.document.body.classList.remove('modal-active');
1433
- this.showPane = false;
1434
- this.onComplete.emit(true);
1435
- }
1436
- }
1437
- SidePaneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidePaneComponent, deps: [{ token: i1$1.Router }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
1438
- SidePaneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidePaneComponent, selector: "lib-side-pane", inputs: { showPane: ["visible", "showPane"] }, outputs: { onComplete: "onComplete" }, ngImport: i0, template: "<div *ngIf=\"showPane\" class=\"side-pane-outer-container\" aria-labelledby=\"slide-over\" role=\"dialog\" aria-modal=\"true\">\r\n <div [class]=\"showPane ? overlayStyle : 'hidden'\" aria-hidden=\"true\"></div>\r\n <div [class]=\"showPane ? 'side-pane-container' : 'hidden'\">\r\n <div [class]=\"sizeContainerStyle\">\r\n <div class=\"side-pane\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1439
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidePaneComponent, decorators: [{
1440
- type: Component,
1441
- args: [{
1442
- selector: 'lib-side-pane',
1443
- templateUrl: './side-pane.component.html'
1444
- }]
1445
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: undefined, decorators: [{
1446
- type: Inject,
1447
- args: [DOCUMENT]
1448
- }] }]; }, propDecorators: { showPane: [{
1449
- type: Input,
1450
- args: ['visible']
1451
- }], onComplete: [{
1452
- type: Output
1453
- }] } });
1454
-
1455
- class NavLinksListComponent {
1456
- constructor() {
1457
- // tslint:disable-next-line:no-input-rename
1458
- this.navLinkClass = 'nav-link';
1459
- // tslint:disable-next-line:no-input-rename
1460
- this.navLinkActiveClass = 'nav-link-active';
1461
- // tslint:disable-next-line:no-input-rename
1462
- this.containerClass = undefined;
1463
- // tslint:disable-next-line:no-input-rename
1464
- this.showIcons = false;
1465
- }
1466
- ngOnInit() {
1467
- }
1468
- }
1469
- NavLinksListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavLinksListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1470
- NavLinksListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NavLinksListComponent, selector: "lib-nav-links-list", inputs: { links: "links", activeFragment: ["active-fragment", "activeFragment"], navLinkClass: ["link-class", "navLinkClass"], navLinkActiveClass: ["link-active-class", "navLinkActiveClass"], containerClass: ["container-class", "containerClass"], showIcons: ["show-icons", "showIcons"] }, ngImport: i0, template: "\r\n<div [class]=\"containerClass ?? 'nav-link-list-container'\">\r\n <div class=\"nav-link-list-container-inner\">\r\n <ng-container *ngFor=\"let link of links | async\">\r\n <ng-container [ngSwitch]=\"link.type\">\r\n <a *ngSwitchCase=\"'router'\"\r\n href=\"#\"\r\n [routerLink]=\"[link.path]\"\r\n [routerLinkActive]=\"navLinkActiveClass\"\r\n [routerLinkActiveOptions]=\"{ exact: link.exact }\"\r\n [class]=\"navLinkClass\">\r\n <i *ngIf=\"showIcons && link.icon\" [class]=\"link.icon + ' mr-3'\"></i>{{ link.text }}\r\n </a>\r\n <a *ngSwitchCase=\"'external'\"\r\n [href]=\"link.path\"\r\n [attr.target]=\"link.external ? '_blank' : '_self'\"\r\n [class]=\"navLinkClass\">\r\n <i *ngIf=\"showIcons && link.icon\" [class]=\"link.icon+ ' mr-3'\"></i>{{ link.text }}\r\n </a>\r\n <a *ngSwitchCase=\"'fragment'\"\r\n routerLink=\".\"\r\n [fragment]=\"link.path\"\r\n [class.active]=\"(activeFragment | async) === link.path\"\r\n [routerLinkActive]=\"navLinkActiveClass\"\r\n [class]=\"navLinkClass\">\r\n <i *ngIf=\"showIcons && link.icon\" [class]=\"link.icon+ ' mr-3'\"></i>{{ link.text }}\r\n </a>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</div>\r\n", directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i1$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], exportAs: ["routerLinkActive"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i1.AsyncPipe } });
1471
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavLinksListComponent, decorators: [{
1472
- type: Component,
1473
- args: [{
1474
- selector: 'lib-nav-links-list',
1475
- templateUrl: './nav-links-list.component.html'
1476
- }]
1477
- }], ctorParameters: function () { return []; }, propDecorators: { links: [{
1478
- type: Input
1479
- }], activeFragment: [{
1480
- type: Input,
1481
- args: ['active-fragment']
1482
- }], navLinkClass: [{
1483
- type: Input,
1484
- args: ['link-class']
1485
- }], navLinkActiveClass: [{
1486
- type: Input,
1487
- args: ['link-active-class']
1488
- }], containerClass: [{
1489
- type: Input,
1490
- args: ['container-class']
1491
- }], showIcons: [{
1492
- type: Input,
1493
- args: ['show-icons']
1494
- }] } });
1495
-
1496
- class ComboboxComponent {
1497
- constructor() {
1498
- this._debouncer = new Subject();
1499
- this._items = [];
1500
- this._defaultItemsFilter = (item) => {
1501
- const selectedItem = this.selectedItems.find(x => x == item);
1502
- return selectedItem == null || selectedItem == undefined;
1503
- };
1504
- this.id = 'combobox';
1505
- this.itemTemplate = null;
1506
- this.selectedItemsFilter = () => true;
1507
- this.selectedItemTemplate = null;
1508
- this.busy = false;
1509
- this.debounceMs = 1000;
1510
- this.onSearch = new EventEmitter();
1511
- this.onItemSelected = new EventEmitter();
1512
- this.showOptions = false;
1513
- this.selectedItems = [];
1514
- }
1515
- set items(items) {
1516
- if (!this.itemTemplate) {
1517
- this._items = items.filter(this._defaultItemsFilter);
1518
- }
1519
- else {
1520
- this._items = items.filter(this.selectedItemsFilter);
1521
- }
1522
- }
1523
- get items() {
1524
- if (!this.itemTemplate) {
1525
- return this._items.filter(this._defaultItemsFilter);
1526
- }
1527
- else {
1528
- return this._items.filter(this.selectedItemsFilter);
1529
- }
1530
- }
1531
- ngOnInit() {
1532
- this.emitSearchEvent();
1533
- this._debouncer
1534
- .pipe(debounceTime(this.debounceMs), distinctUntilChanged())
1535
- .subscribe((value) => this.emitSearchEvent(value));
1536
- }
1537
- onInputClick() {
1538
- this.showOptions = true;
1539
- }
1540
- onInputClickOutside() {
1541
- this.showOptions = false;
1542
- }
1543
- onInputKeyUp(event) {
1544
- this._debouncer.next(event.currentTarget.value);
1545
- }
1546
- onListItemSelected(item) {
1547
- this.onItemSelected.emit(item);
1548
- this.selectedItems.push(item);
1549
- }
1550
- removeSelectedItem(item) {
1551
- const index = this.selectedItems.indexOf(item);
1552
- if (index > -1) {
1553
- this.selectedItems.splice(index, 1);
1554
- }
1555
- }
1556
- emitSearchEvent(searchTerm = undefined) {
1557
- this.onSearch.emit(searchTerm);
1558
- }
1559
- }
1560
- ComboboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1561
- ComboboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ComboboxComponent, selector: "lib-combobox", inputs: { id: "id", items: "items", itemTemplate: "itemTemplate", selectedItemsFilter: "selectedItemsFilter", selectedItemTemplate: "selectedItemTemplate", busy: "busy", debounceMs: "debounceMs" }, outputs: { onSearch: "onSearch", onItemSelected: "onItemSelected" }, ngImport: i0, template: "<div class=\"relative mt-1\">\r\n <form autocomplete=\"off\" [id]=\"id + '-form'\">\r\n <input [id]=\"id + '-input'\" type=\"text\" (click)=\"onInputClick()\" (clickOutside)=\"onInputClickOutside()\" (keyup)=\"onInputKeyUp($event)\"\r\n class=\"w-full rounded-md border border-gray-300 bg-white py-2 pl-3 pr-12 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 sm:text-sm\" role=\"combobox\" aria-controls=\"options\"\r\n aria-expanded=\"false\" autocomplete=\"off\" list=\"autocomplete\">\r\n </form>\r\n <div class=\"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none\">\r\n <svg *ngIf=\"!busy\" xmlns=\"http://www.w3.org/2000/svg\" class=\"h-6 w-6 text-gray-400\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\" />\r\n </svg>\r\n <svg *ngIf=\"busy\" class=\"animate-spin h-6 w-6 text-gray-400\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\r\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\r\n <path class=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"></path>\r\n </svg>\r\n </div>\r\n <ul [id]=\"id + '-options'\" *ngIf=\"showOptions\" class=\"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm\" role=\"listbox\">\r\n <li *ngFor=\"let item of items; let i = index;\" [id]=\"'option-'+ i\" (click)=\"onListItemSelected(item)\" role=\"option\" tabindex=\"-1\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate || defaultItemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\r\n </li>\r\n </ul>\r\n</div>\r\n<ul *ngIf=\"selectedItems.length > 0\" role=\"list\" class=\"grid grid-cols-1\">\r\n <li *ngFor=\"let item of selectedItems; let i = index;\" class=\"mt-3\">\r\n <ng-container [ngTemplateOutlet]=\"selectedItemTemplate || defaultSelectedItemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\r\n </li>\r\n</ul>\r\n<ng-template #defaultItemTemplate let-item>\r\n <span class=\"hover:bg-gray-100 relative cursor-pointer select-none py-2 pl-3 pr-3 block truncate\">{{ item }}</span>\r\n</ng-template>\r\n<ng-template #defaultSelectedItemTemplate let-item>\r\n <div class=\"grid grid-cols-1\">\r\n <div class=\"relative rounded-lg border border-gray-300 bg-white px-6 py-5 shadow-sm flex items-center space-x-3 hover:border-gray-400\">\r\n <div class=\"flex-1 min-w-0\">\r\n <div class=\"focus:outline-none\">\r\n <span class=\"absolute\" aria-hidden=\"true\"></span>\r\n <p class=\"text-sm font-medium text-gray-900\">{{ item }}</p>\r\n </div>\r\n </div>\r\n <div class=\"ml-4 flex-shrink-0 flex\">\r\n <button type=\"button\" (click)=\"removeSelectedItem(item)\" class=\"cursor-pointer bg-white rounded-md inline-flex text-gray-400 hover:text-gray-500\">\r\n <span class=\"sr-only\">Close</span>\r\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\"\r\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\r\n clip-rule=\"evenodd\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>", directives: [{ type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideEnabled", "attachOutsideOnClick", "delayClickOutsideInit", "emitOnBlur", "exclude", "excludeBeforeClick", "clickOutsideEvents"], outputs: ["clickOutside"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
1562
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ComboboxComponent, decorators: [{
1563
- type: Component,
1564
- args: [{
1565
- selector: 'lib-combobox',
1566
- templateUrl: './combobox.component.html'
1567
- }]
1568
- }], ctorParameters: function () { return []; }, propDecorators: { id: [{
1569
- type: Input
1570
- }], items: [{
1571
- type: Input,
1572
- args: ['items']
1573
- }], itemTemplate: [{
1574
- type: Input
1575
- }], selectedItemsFilter: [{
1576
- type: Input
1577
- }], selectedItemTemplate: [{
1578
- type: Input
1579
- }], busy: [{
1580
- type: Input
1581
- }], debounceMs: [{
1582
- type: Input
1583
- }], onSearch: [{
1584
- type: Output
1585
- }], onItemSelected: [{
1586
- type: Output
1587
- }] } });
1588
-
1589
- const APP_LANGUAGES = new InjectionToken('APP_LANGUAGES');
1590
- const APP_LINKS = new InjectionToken('APP_LINKS');
1591
- const APP_NOTIFICATIONS = new InjectionToken('APP_NOTIFICATIONS');
1592
- const LIBSTEPPER_ACCESSOR = new InjectionToken('LibStepperAccessor');
1593
- const LIBTABGROUP_ACCESSOR = new InjectionToken('LibTabGroupAccessor');
1594
- const SHELL_CONFIG = new InjectionToken('SHELL_CONFIG');
1595
-
1596
- class LibTabComponent {
1597
- constructor(_tabGroup) {
1598
- this._tabGroup = _tabGroup;
1599
- this._isActive = false;
1600
- }
1601
- /** Indicates the index of the tab. */
1602
- get index() {
1603
- var _a, _b;
1604
- return ((_b = (_a = this._tabGroup) === null || _a === void 0 ? void 0 : _a.tabs) === null || _b === void 0 ? void 0 : _b.toArray().indexOf(this)) || undefined;
1605
- }
1606
- /** Indicates whether the tab is active. */
1607
- get isActive() {
1608
- return this._isActive;
1609
- }
1610
- /** Setter for LibTabComponent isActive property. */
1611
- set isActive(isActive) {
1612
- this._isActive = isActive;
1613
- }
1614
- ngOnInit() {
1615
- this.id = this.id || uuid.v4();
1616
- }
1617
- }
1618
- LibTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibTabComponent, deps: [{ token: LIBTABGROUP_ACCESSOR, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1619
- LibTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LibTabComponent, selector: "lib-tab", inputs: { label: "label", id: "id" }, viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, static: true }], ngImport: i0, template: `
1620
- <ng-template>
1621
- <ng-content></ng-content>
1622
- </ng-template>
1623
- `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1624
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibTabComponent, decorators: [{
1625
- type: Component,
1626
- args: [{
1627
- selector: 'lib-tab',
1628
- template: `
1629
- <ng-template>
1630
- <ng-content></ng-content>
1631
- </ng-template>
1632
- `,
1633
- encapsulation: ViewEncapsulation.None,
1634
- changeDetection: ChangeDetectionStrategy.OnPush
1635
- }]
1636
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1637
- type: Optional
1638
- }, {
1639
- type: Inject,
1640
- args: [LIBTABGROUP_ACCESSOR]
1641
- }] }]; }, propDecorators: { content: [{
1642
- type: ViewChild,
1643
- args: [TemplateRef, { static: true }]
1644
- }], label: [{
1645
- type: Input
1646
- }], id: [{
1647
- type: Input
1648
- }] } });
1649
-
1650
- class LibTabGroupComponent {
1651
- constructor() {
1652
- /** The inner tabs of the group. */
1653
- this.tabs = undefined;
1654
- /** Emmited when a step change occurs. */
1655
- this.tabChanged = new EventEmitter();
1656
- }
1657
- /** The current tab. */
1658
- get currentTab() {
1659
- var _a;
1660
- return (_a = this.tabs) === null || _a === void 0 ? void 0 : _a.find(x => x.isActive);
1661
- }
1662
- /** The index (starting from zero) of the current tab. */
1663
- get currentΤabIndex() {
1664
- var _a;
1665
- return ((_a = this.currentTab) === null || _a === void 0 ? void 0 : _a.index) || undefined;
1666
- }
1667
- ngOnInit() { }
1668
- ngAfterContentInit() {
1669
- if (!this.tabs) {
1670
- return;
1671
- }
1672
- }
1673
- ngAfterContentChecked() {
1674
- if (this.tabs && this.tabs.length > 0) {
1675
- const anyActive = this.tabs.filter(x => x.isActive).length > 0;
1676
- if (!anyActive) {
1677
- this.tabs.get(0).isActive = true;
1678
- }
1679
- }
1680
- }
1681
- onTabChanged(selectedTab) {
1682
- this.tabs.forEach((tab) => tab.isActive = tab.id === selectedTab.id);
1683
- this.tabChanged.emit(selectedTab);
1684
- }
1685
- onTabSelectChanged(selectedTabIndex) {
1686
- var _a;
1687
- this.tabs.forEach((tab, index) => tab.isActive = index === selectedTabIndex);
1688
- this.tabChanged.emit((_a = this.tabs) === null || _a === void 0 ? void 0 : _a.get(selectedTabIndex));
1689
- }
1690
- }
1691
- LibTabGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibTabGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1692
- LibTabGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LibTabGroupComponent, selector: "lib-tab-group", outputs: { tabChanged: "tabChanged" }, providers: [
1693
- { provide: LIBTABGROUP_ACCESSOR, useExisting: forwardRef(() => LibTabGroupComponent) }
1694
- ], queries: [{ propertyName: "tabs", predicate: LibTabComponent, descendants: true }], ngImport: i0, template: "<div class=\"tab-group-select-hidden\">\r\n <label for=\"tabs\" class=\"sr-only\">Select a tab</label>\r\n <select id=\"tabs\" name=\"tabs\" (change)=\"onTabSelectChanged(+tabsSelect.value)\" class=\"tab-group-select\" #tabsSelect>\r\n <option [value]=\"i\" *ngFor=\"let tab of tabs; let i = index\">{{ tab.label }}</option>\r\n </select>\r\n</div>\r\n<div class=\"tab-group-container-hidden\">\r\n <div class=\"tab-group-container\">\r\n <nav class=\"tab-group-container-nav\" aria-label=\"Tabs\">\r\n <a *ngFor=\"let tab of tabs\" href=\"javascript:void(0)\" [class.tab]=\"!tab.isActive\" [class.tab-active]=\"tab.isActive\" (click)=\"onTabChanged(tab)\">\r\n {{ tab.label }}\r\n </a>\r\n </nav>\r\n </div>\r\n</div>\r\n<div *ngIf=\"currentTab?.content\">\r\n <ng-container [ngTemplateOutlet]=\"currentTab!.content\"></ng-container>\r\n</div>", directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
1695
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibTabGroupComponent, decorators: [{
1696
- type: Component,
1697
- args: [{
1698
- selector: 'lib-tab-group',
1699
- templateUrl: './lib-tab-group.component.html',
1700
- providers: [
1701
- { provide: LIBTABGROUP_ACCESSOR, useExisting: forwardRef(() => LibTabGroupComponent) }
1702
- ]
1703
- }]
1704
- }], ctorParameters: function () { return []; }, propDecorators: { tabs: [{
1705
- type: ContentChildren,
1706
- args: [LibTabComponent, { descendants: true }]
1707
- }], tabChanged: [{
1708
- type: Output
1709
- }] } });
1710
-
1711
- class LibStepInfoDirective {
1712
- constructor(template) {
1713
- this.template = template;
1714
- }
1715
- }
1716
- LibStepInfoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibStepInfoDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1717
- LibStepInfoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: LibStepInfoDirective, selector: "[libStepInfo]", ngImport: i0 });
1718
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibStepInfoDirective, decorators: [{
1719
- type: Directive,
1720
- args: [{
1721
- selector: '[libStepInfo]',
1722
- }]
1723
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
1724
-
1725
- class LibStepLabelDirective {
1726
- constructor(template) {
1727
- this.template = template;
1728
- }
1729
- }
1730
- LibStepLabelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibStepLabelDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1731
- LibStepLabelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: LibStepLabelDirective, selector: "[libStepLabel]", ngImport: i0 });
1732
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibStepLabelDirective, decorators: [{
1733
- type: Directive,
1734
- args: [{
1735
- selector: '[libStepLabel]',
1736
- }]
1737
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
1738
-
1739
- var StepState;
1740
- (function (StepState) {
1741
- StepState["Active"] = "Active";
1742
- StepState["Completed"] = "Completed";
1743
- StepState["Upcoming"] = "Upcoming";
1744
- })(StepState || (StepState = {}));
1745
- ;
1746
- class LibStepComponent {
1747
- constructor(_stepper) {
1748
- this._stepper = _stepper;
1749
- }
1750
- /** Indicates the index of the step. */
1751
- get index() {
1752
- var _a;
1753
- return (_a = this._stepper) === null || _a === void 0 ? void 0 : _a.steps.toArray().indexOf(this);
1754
- }
1755
- /** Indicates whether this step is the last step. */
1756
- get isLast() {
1757
- var _a;
1758
- return ((_a = this._stepper) === null || _a === void 0 ? void 0 : _a.steps.length) - 1 === this.index;
1759
- }
1760
- /** Indicates whether you can navigate to the step or not. */
1761
- get isValid() {
1762
- if (!this.stepControl) {
1763
- return true;
1764
- }
1765
- return this.stepControl.valid;
1766
- }
1767
- /** Shows the current state of the step. */
1768
- get state() {
1769
- var _a;
1770
- const currentIndex = (_a = this._stepper) === null || _a === void 0 ? void 0 : _a.currentStepIndex;
1771
- if (currentIndex === this.index) {
1772
- return StepState.Active;
1773
- }
1774
- if (currentIndex > this.index) {
1775
- return StepState.Completed;
1776
- }
1777
- return StepState.Upcoming;
1778
- }
1779
- }
1780
- LibStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibStepComponent, deps: [{ token: LIBSTEPPER_ACCESSOR, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1781
- LibStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LibStepComponent, selector: "lib-step", inputs: { class: "class", stepControl: "stepControl" }, queries: [{ propertyName: "stepLabel", first: true, predicate: LibStepLabelDirective, descendants: true }, { propertyName: "stepInfo", first: true, predicate: LibStepInfoDirective, descendants: true }], viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, static: true }], ngImport: i0, template: `
1782
- <ng-template>
1783
- <ng-content></ng-content>
1784
- </ng-template>
1785
- `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1786
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibStepComponent, decorators: [{
1787
- type: Component,
1788
- args: [{
1789
- selector: 'lib-step',
1790
- template: `
1791
- <ng-template>
1792
- <ng-content></ng-content>
1793
- </ng-template>
1794
- `,
1795
- encapsulation: ViewEncapsulation.None,
1796
- changeDetection: ChangeDetectionStrategy.OnPush
1797
- }]
1798
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1799
- type: Optional
1800
- }, {
1801
- type: Inject,
1802
- args: [LIBSTEPPER_ACCESSOR]
1803
- }] }]; }, propDecorators: { content: [{
1804
- type: ViewChild,
1805
- args: [TemplateRef, { static: true }]
1806
- }], stepLabel: [{
1807
- type: ContentChild,
1808
- args: [LibStepLabelDirective]
1809
- }], stepInfo: [{
1810
- type: ContentChild,
1811
- args: [LibStepInfoDirective]
1812
- }], class: [{
1813
- type: Input
1814
- }], stepControl: [{
1815
- type: Input
1816
- }] } });
1817
-
1818
- var StepperType;
1819
- (function (StepperType) {
1820
- StepperType["Bullets"] = "Bullets";
1821
- StepperType["BulletsAndText"] = "BulletsAndText";
1822
- StepperType["Circles"] = "Circles";
1823
- StepperType["CirclesWithText"] = "CirclesWithText";
1824
- StepperType["Panels"] = "Panels";
1825
- StepperType["PanelsWithBorder"] = "PanelsWithBorder";
1826
- StepperType["Progress"] = "Progress";
1827
- StepperType["Simple"] = "Simple";
1828
- })(StepperType || (StepperType = {}));
1829
-
1830
- class LibStepperComponent {
1831
- constructor() {
1832
- // Private properties.
1833
- this._currentStepIndex = 0;
1834
- /** Emmited when a step change occurs. */
1835
- this.stepChanged = new EventEmitter();
1836
- /** Indicates whether each step has to be validated before proceeding to the next. */
1837
- this.linear = false;
1838
- /** The type of the stepper. */
1839
- this.type = StepperType.Panels;
1840
- this.StepState = StepState;
1841
- this.StepperType = StepperType;
1842
- }
1843
- /** The current wizard step. */
1844
- get currentStep() {
1845
- var _a;
1846
- return (_a = this.steps) === null || _a === void 0 ? void 0 : _a.get(this._currentStepIndex);
1847
- }
1848
- /** The index (starting from zero) of the current wizard step. */
1849
- get currentStepIndex() {
1850
- return this._currentStepIndex;
1851
- }
1852
- ngOnInit() { }
1853
- /** Proceeds to the next step, if any. */
1854
- goToNextStep() {
1855
- // Cannot go forward.
1856
- if (this._currentStepIndex === this.steps.length - 1) {
1857
- return;
1858
- }
1859
- this.updateCurrentStepIndex(this._currentStepIndex + 1);
1860
- }
1861
- /** Proceeds to the previous step, if any. */
1862
- goToPreviousStep() {
1863
- // Cannot go back.
1864
- if (this._currentStepIndex === 0) {
1865
- return;
1866
- }
1867
- this.updateCurrentStepIndex(this._currentStepIndex - 1);
1868
- }
1869
- onSelectStep(selectedStep) {
1870
- this.updateCurrentStepIndex(selectedStep.index);
1871
- }
1872
- updateCurrentStepIndex(newIndex) {
1873
- const stepsArray = this.steps.toArray();
1874
- const currentStep = stepsArray[this.currentStepIndex];
1875
- const shouldStop = this.linear && ((!currentStep.isValid && newIndex >= this.currentStepIndex) || // If current step is invalid and want to go forward, then stop.
1876
- (currentStep.isValid && newIndex > this.currentStepIndex + 1 && stepsArray.slice(this.currentStepIndex + 1, newIndex).some(x => !x.isValid)) // If going forward (more than 1 steps), check if there are any invalid steps in between.
1877
- );
1878
- if (shouldStop) {
1879
- return;
1880
- }
1881
- this.stepChanged.emit({
1882
- selectedIndex: newIndex,
1883
- previouslySelectedIndex: this.currentStepIndex,
1884
- selectedStep: stepsArray[newIndex],
1885
- previouslySelectedStep: currentStep
1886
- });
1887
- this._currentStepIndex = newIndex;
1888
- }
1889
- }
1890
- LibStepperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1891
- LibStepperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LibStepperComponent, selector: "lib-stepper", inputs: { linear: "linear", type: "type" }, outputs: { stepChanged: "stepChanged" }, providers: [
1892
- { provide: LIBSTEPPER_ACCESSOR, useExisting: forwardRef(() => LibStepperComponent) }
1893
- ], queries: [{ propertyName: "steps", predicate: LibStepComponent, descendants: true }], ngImport: i0, template: "<ng-container [ngSwitch]=\"type\">\r\n <!-- Bullets -->\r\n <nav class=\"flex items-center justify-center\" aria-label=\"Progress\" *ngSwitchCase=\"StepperType.Bullets\">\r\n <p class=\"text-sm font-medium\">Step {{ currentStepIndex + 1 }} of {{ steps.length }}</p>\r\n <ol role=\"list\" class=\"ml-8 flex items-center space-x-5\">\r\n <li class=\"cursor-pointer\" *ngFor=\"let step of steps\" (click)=\"onSelectStep(step)\">\r\n <!-- Completed Step -->\r\n <div class=\"block w-2.5 h-2.5 bg-blue-600 rounded-full hover:bg-blue-900\" *ngIf=\"step.state === StepState.Completed\">\r\n <span class=\"sr-only\">Step {{ step.index }}</span>\r\n </div>\r\n <!-- Active Step -->\r\n <div class=\"relative flex items-center justify-center\" aria-current=\"step\" *ngIf=\"step.state === StepState.Active\">\r\n <span class=\"absolute w-5 h-5 p-px flex\" aria-hidden=\"true\">\r\n <span class=\"w-full h-full rounded-full bg-blue-200\"></span>\r\n </span>\r\n <span class=\"relative block w-2.5 h-2.5 bg-blue-600 rounded-full\" aria-hidden=\"true\"></span>\r\n <span class=\"sr-only\">Step {{ step.index }}</span>\r\n </div>\r\n <!-- Upcoming Step -->\r\n <div href=\"#\" class=\"block w-2.5 h-2.5 bg-gray-200 rounded-full hover:bg-gray-400\" *ngIf=\"step.state === StepState.Upcoming\">\r\n <span class=\"sr-only\">Step {{ step.index }}</span>\r\n </div>\r\n </li>\r\n </ol>\r\n </nav>\r\n <!-- Bullets & Text -->\r\n <div class=\"flex items-center justify-center\" aria-label=\"Progress\" *ngSwitchCase=\"StepperType.BulletsAndText\">\r\n <nav aria-label=\"Progress\">\r\n <ol role=\"list\" class=\"space-y-6\">\r\n <li class=\"cursor-pointer\" *ngFor=\"let step of steps\" (click)=\"onSelectStep(step)\">\r\n <!-- Complete Step -->\r\n <div class=\"group\" *ngIf=\"step.state === StepState.Completed\">\r\n <span class=\"flex items-start\">\r\n <span class=\"flex-shrink-0 relative h-5 w-5 flex items-center justify-center\">\r\n <svg class=\"h-full w-full text-blue-600 group-hover:text-blue-800\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n </span>\r\n <span class=\"ml-3 text-sm font-medium text-gray-500 group-hover:text-gray-900\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n </span>\r\n </div>\r\n <!-- Active Step -->\r\n <div class=\"flex items-start\" aria-current=\"step\" *ngIf=\"step.state === StepState.Active\">\r\n <span class=\"flex-shrink-0 h-5 w-5 relative flex items-center justify-center\" aria-hidden=\"true\">\r\n <span class=\"absolute h-4 w-4 rounded-full bg-blue-200\"></span>\r\n <span class=\"relative block w-2 h-2 bg-blue-600 rounded-full\"></span>\r\n </span>\r\n <span class=\"ml-3 text-sm font-medium text-blue-600\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n </div>\r\n <!-- Upcoming Step -->\r\n <div class=\"group\" *ngIf=\"step.state === StepState.Upcoming\">\r\n <div class=\"flex items-start\">\r\n <div class=\"flex-shrink-0 h-5 w-5 relative flex items-center justify-center\" aria-hidden=\"true\">\r\n <div class=\"h-2 w-2 bg-gray-300 rounded-full group-hover:bg-gray-400\"></div>\r\n </div>\r\n <p class=\"ml-3 text-sm font-medium text-gray-500 group-hover:text-gray-900\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </p>\r\n </div>\r\n </div>\r\n </li>\r\n </ol>\r\n </nav>\r\n </div>\r\n <!-- Circles -->\r\n <nav class=\"flex justify-center\" aria-label=\"Progress\" *ngSwitchCase=\"StepperType.Circles\">\r\n <ol class=\"flex items-center\" role=\"list\">\r\n <li *ngFor=\"let step of steps\" (click)=\"onSelectStep(step)\" class=\"relative pr-8 sm:pr-20 cursor-pointer\">\r\n <!-- Completed Step -->\r\n <ng-container *ngIf=\"step.state === StepState.Completed\">\r\n <div class=\"absolute inset-0 flex items-center\" aria-hidden=\"true\">\r\n <div class=\"h-0.5 w-full bg-blue-600\"></div>\r\n </div>\r\n <div class=\"relative w-8 h-8 flex items-center justify-center bg-blue-600 rounded-full hover:bg-blue-900\">\r\n <svg class=\"w-5 h-5 text-white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\" d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n <span class=\"sr-only\">Step {{ step.index + 1 }}</span>\r\n </div>\r\n </ng-container>\r\n <!-- Active Step -->\r\n <ng-container *ngIf=\"step.state === StepState.Active\">\r\n <div class=\"absolute inset-0 flex items-center\" aria-hidden=\"true\">\r\n <div class=\"h-0.5 w-full bg-gray-200\"></div>\r\n </div>\r\n <div class=\"relative w-8 h-8 flex items-center justify-center bg-white border-2 border-blue-600 rounded-full\" aria-current=\"step\">\r\n <span class=\"h-2.5 w-2.5 bg-blue-600 rounded-full\" aria-hidden=\"true\"></span>\r\n <span class=\"sr-only\">Step {{ step.index + 1 }}</span>\r\n </div>\r\n </ng-container>\r\n <!-- Upcoming Step -->\r\n <ng-container *ngIf=\"step.state === StepState.Upcoming\">\r\n <div class=\"absolute inset-0 flex items-center\" aria-hidden=\"true\">\r\n <div class=\"h-0.5 w-full bg-gray-200\"></div>\r\n </div>\r\n <div class=\"group relative w-8 h-8 flex items-center justify-center bg-white border-2 border-gray-300 rounded-full hover:border-gray-400\">\r\n <span class=\"h-2.5 w-2.5 bg-transparent rounded-full group-hover:bg-gray-300\" aria-hidden=\"true\"></span>\r\n <span class=\"sr-only\">Step {{ step.index + 1 }}</span>\r\n </div>\r\n </ng-container>\r\n </li>\r\n </ol>\r\n </nav>\r\n <!-- Circles With Text -->\r\n <nav class=\"flex items-center justify-center\" aria-label=\"Progress\" *ngSwitchCase=\"StepperType.CirclesWithText\">\r\n <ol role=\"list\" class=\"overflow-hidden\">\r\n <li *ngFor=\"let step of steps\" (click)=\"onSelectStep(step)\" class=\"relative pb-10 cursor-pointer\">\r\n <!-- Complete Step -->\r\n <ng-container *ngIf=\"step.state === StepState.Completed\">\r\n <div class=\"-ml-px absolute mt-0.5 top-4 left-4 w-0.5 h-full bg-blue-600\" aria-hidden=\"true\" *ngIf=\"!step.isLast\"></div>\r\n <div class=\"relative flex items-start group\">\r\n <span class=\"h-9 flex items-center\">\r\n <span class=\"relative z-10 w-8 h-8 flex items-center justify-center bg-blue-600 rounded-full group-hover:bg-blue-800\">\r\n <svg class=\"w-5 h-5 text-white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\" d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n </span>\r\n </span>\r\n <span class=\"ml-4 min-w-0 flex flex-col\">\r\n <span class=\"text-xs font-semibold tracking-wide uppercase\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n <span class=\"text-sm text-gray-500\" *ngIf=\"step.stepInfo\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepInfo.template\"></ng-container>\r\n </span>\r\n </span>\r\n </div>\r\n </ng-container>\r\n <!-- Active Step -->\r\n <ng-container *ngIf=\"step.state === StepState.Active\">\r\n <div class=\"-ml-px absolute mt-0.5 top-4 left-4 w-0.5 h-full bg-gray-300\" aria-hidden=\"true\" *ngIf=\"!step.isLast\"></div>\r\n <div class=\"relative flex items-start group\" aria-current=\"step\">\r\n <span class=\"h-9 flex items-center\" aria-hidden=\"true\">\r\n <span class=\"relative z-10 w-8 h-8 flex items-center justify-center bg-white border-2 border-blue-600 rounded-full\">\r\n <span class=\"h-2.5 w-2.5 bg-blue-600 rounded-full\"></span>\r\n </span>\r\n </span>\r\n <span class=\"ml-4 min-w-0 flex flex-col\">\r\n <span class=\"text-xs font-semibold tracking-wide uppercase text-blue-600\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n <span class=\"text-sm text-gray-500\" *ngIf=\"step.stepInfo\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepInfo.template\"></ng-container>\r\n </span>\r\n </span>\r\n </div>\r\n </ng-container>\r\n <!-- Upcoming Step -->\r\n <ng-container *ngIf=\"step.state === StepState.Upcoming\">\r\n <div class=\"-ml-px absolute mt-0.5 top-4 left-4 w-0.5 h-full bg-gray-300\" aria-hidden=\"true\" *ngIf=\"!step.isLast\"></div>\r\n <div href=\"#\" class=\"relative flex items-start group\">\r\n <span class=\"h-9 flex items-center\" aria-hidden=\"true\">\r\n <span class=\"relative z-10 w-8 h-8 flex items-center justify-center bg-white border-2 border-gray-300 rounded-full group-hover:border-gray-400\">\r\n <span class=\"h-2.5 w-2.5 bg-transparent rounded-full group-hover:bg-gray-300\"></span>\r\n </span>\r\n </span>\r\n <span class=\"ml-4 min-w-0 flex flex-col\">\r\n <span class=\"text-xs font-semibold tracking-wide uppercase text-gray-500\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n <span class=\"text-sm text-gray-500\" *ngIf=\"step.stepInfo\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepInfo.template\"></ng-container>\r\n </span>\r\n </span>\r\n </div>\r\n </ng-container>\r\n </li>\r\n </ol>\r\n </nav>\r\n <!-- Panels -->\r\n <nav aria-label=\"Progress\" *ngSwitchCase=\"StepperType.Panels\">\r\n <ol role=\"list\" class=\"border border-gray-300 rounded-md divide-y divide-gray-300 md:flex md:divide-y-0\">\r\n <li *ngFor=\"let step of steps\" (click)=\"onSelectStep(step)\" class=\"relative md:flex-1 md:flex cursor-pointer\">\r\n <!-- Completed step -->\r\n <div class=\"group flex items-center w-full\" *ngIf=\"step.state === StepState.Completed\">\r\n <span class=\"px-6 py-4 flex items-center text-sm font-medium\">\r\n <span class=\"flex-shrink-0 w-10 h-10 flex items-center justify-center bg-blue-600 rounded-full group-hover:bg-blue-800\">\r\n <svg class=\"w-6 h-6 text-white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\" d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n </span>\r\n <span class=\"ml-4 text-sm font-medium text-gray-900\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n </span>\r\n </div>\r\n <!-- Active step -->\r\n <div class=\"px-6 py-4 flex items-center text-sm font-medium\" *ngIf=\"step.state === StepState.Active\">\r\n <span class=\"flex-shrink-0 w-10 h-10 flex items-center justify-center border-2 border-blue-600 rounded-full\">\r\n <span class=\"text-blue-600\">{{ (step.index + 1) }}</span>\r\n </span>\r\n <span class=\"ml-4 text-sm font-medium text-blue-600\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n </div>\r\n <!-- Upcoming step -->\r\n <div class=\"group flex items-center\" *ngIf=\"step.state === StepState.Upcoming\">\r\n <span class=\"px-6 py-4 flex items-center text-sm font-medium\">\r\n <span class=\"flex-shrink-0 w-10 h-10 flex items-center justify-center border-2 border-gray-300 rounded-full group-hover:border-gray-400\">\r\n <span class=\"text-gray-500 group-hover:text-gray-900\">{{ (step.index + 1) }}</span>\r\n </span>\r\n <span class=\"ml-4 text-sm font-medium text-gray-500 group-hover:text-gray-900\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n </span>\r\n </div>\r\n <!-- Arrow separator for lg screens and up -->\r\n <div *ngIf=\"!step.isLast\" class=\"hidden md:block absolute top-0 right-0 h-full w-5\" aria-hidden=\"true\">\r\n <svg class=\"h-full w-full text-gray-300\" viewBox=\"0 0 22 80\" fill=\"none\" preserveAspectRatio=\"none\">\r\n <path d=\"M0 -2L20 40L0 82\" vector-effect=\"non-scaling-stroke\" stroke=\"currentcolor\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </div>\r\n </li>\r\n </ol>\r\n </nav>\r\n <!-- Panels With Border -->\r\n <div class=\"border-t border-b border-gray-200\" *ngSwitchCase=\"StepperType.PanelsWithBorder\">\r\n <nav class=\"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8\" aria-label=\"Progress\">\r\n <ol role=\"list\" class=\"rounded-md overflow-hidden flex border-l border-r border-gray-200 lg:rounded-none\">\r\n <li *ngFor=\"let step of steps\" (click)=\"onSelectStep(step)\" class=\"relative overflow-hidden lg:flex-1 cursor-pointer\">\r\n <!-- Completed Step -->\r\n <div class=\"border border-gray-200 overflow-hidden border-b-0 rounded-t-md lg:border-0\" *ngIf=\"step.state === StepState.Completed\">\r\n <div class=\"group\">\r\n <span class=\"absolute top-0 left-0 w-1 h-full bg-transparent group-hover:bg-gray-200 lg:w-full lg:h-1 lg:bottom-0 lg:top-auto\" aria-hidden=\"true\"></span>\r\n <span class=\"px-6 py-5 flex items-start text-sm font-medium\">\r\n <span class=\"flex-shrink-0\">\r\n <span class=\"w-10 h-10 flex items-center justify-center bg-blue-600 rounded-full\">\r\n <svg class=\"w-6 h-6 text-white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\" d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n </span>\r\n </span>\r\n <span class=\"mt-0.5 ml-4 min-w-0 flex flex-col\">\r\n <span class=\"text-xs font-semibold tracking-wide uppercase\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n <span class=\"text-sm font-medium text-gray-500\" *ngIf=\"step.stepInfo\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepInfo.template\"></ng-container>\r\n </span>\r\n </span>\r\n </span>\r\n </div>\r\n </div>\r\n <!-- Active Step -->\r\n <div class=\"border border-gray-200 overflow-hidden lg:border-0\" *ngIf=\"step.state === StepState.Active\">\r\n <div aria-current=\"step\">\r\n <span class=\"absolute top-0 left-0 w-1 h-full bg-blue-600 lg:w-full lg:h-1 lg:bottom-0 lg:top-auto\" aria-hidden=\"true\"></span>\r\n <span class=\"px-6 py-5 flex items-start text-sm font-medium lg:pl-9\">\r\n <span class=\"flex-shrink-0\">\r\n <span class=\"w-10 h-10 flex items-center justify-center border-2 border-blue-600 rounded-full\">\r\n <span class=\"text-blue-600\">{{ step.index + 1 }}</span>\r\n </span>\r\n </span>\r\n <span class=\"mt-0.5 ml-4 min-w-0 flex flex-col\">\r\n <span class=\"text-xs font-semibold text-blue-600 tracking-wide uppercase\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n <span class=\"text-sm font-medium text-gray-500\" *ngIf=\"step.stepInfo\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepInfo.template\"></ng-container>\r\n </span>\r\n </span>\r\n </span>\r\n </div>\r\n <!-- Separator -->\r\n <div class=\"hidden absolute top-0 left-0 w-3 inset-0 lg:block\" aria-hidden=\"true\" *ngIf=\"step.index !== 0\">\r\n <svg class=\"h-full w-full text-gray-300\" viewBox=\"0 0 12 82\" fill=\"none\" preserveAspectRatio=\"none\">\r\n <path d=\"M0.5 0V31L10.5 41L0.5 51V82\" stroke=\"currentcolor\" vector-effect=\"non-scaling-stroke\" />\r\n </svg>\r\n </div>\r\n </div>\r\n <!-- Upcoming Step -->\r\n <div class=\"border border-gray-200 overflow-hidden border-t-0 rounded-b-md lg:border-0\" *ngIf=\"step.state === StepState.Upcoming\">\r\n <div class=\"group\">\r\n <span class=\"absolute top-0 left-0 w-1 h-full bg-transparent group-hover:bg-gray-200 lg:w-full lg:h-1 lg:bottom-0 lg:top-auto\" aria-hidden=\"true\"></span>\r\n <span class=\"px-6 py-5 flex items-start text-sm font-medium lg:pl-9\">\r\n <span class=\"flex-shrink-0\">\r\n <span class=\"w-10 h-10 flex items-center justify-center border-2 border-gray-300 rounded-full\">\r\n <span class=\"text-gray-500\">{{ step.index + 1 }}</span>\r\n </span>\r\n </span>\r\n <span class=\"mt-0.5 ml-4 min-w-0 flex flex-col\">\r\n <span class=\"text-xs font-semibold text-gray-500 tracking-wide uppercase\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n <span class=\"text-sm font-medium text-gray-500\" *ngIf=\"step.stepInfo\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepInfo.template\"></ng-container>\r\n </span>\r\n </span>\r\n </span>\r\n </div>\r\n <!-- Separator -->\r\n <div class=\"hidden absolute top-0 left-0 w-3 inset-0 lg:block\" aria-hidden=\"true\" *ngIf=\"step.index !== 0\">\r\n <svg class=\"h-full w-full text-gray-300\" viewBox=\"0 0 12 82\" fill=\"none\" preserveAspectRatio=\"none\">\r\n <path d=\"M0.5 0V31L10.5 41L0.5 51V82\" stroke=\"currentcolor\" vector-effect=\"non-scaling-stroke\" />\r\n </svg>\r\n </div>\r\n </div>\r\n </li>\r\n </ol>\r\n </nav>\r\n </div>\r\n <!-- Progress -->\r\n <div *ngSwitchCase=\"StepperType.Progress\">\r\n <div class=\"mt-6\" aria-hidden=\"true\">\r\n <div class=\"bg-gray-200 rounded-full overflow-hidden\">\r\n <div class=\"h-2 bg-blue-600 rounded-full\" [style.width]=\"(((currentStepIndex + 1) / steps.length) * 100) + '%'\"></div>\r\n </div>\r\n <div class=\"hidden sm:grid grid-cols-4 text-sm font-medium text-gray-600 mt-6\">\r\n <div *ngFor=\"let step of steps\" (click)=\"onSelectStep(step)\" class=\"text-blue-600 cursor-pointer\">\r\n <ng-container *ngIf=\"step.stepLabel\" [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Simple -->\r\n <nav aria-label=\"Progress\" *ngSwitchCase=\"StepperType.Simple\">\r\n <ol role=\"list\" class=\"space-y-4 md:flex md:space-y-0 md:space-x-8\">\r\n <li *ngFor=\"let step of steps\" (click)=\"onSelectStep(step)\" class=\"md:flex-1 cursor-pointer\">\r\n <!-- Completed Step -->\r\n <div class=\"group pl-4 py-2 flex flex-col border-l-4 border-blue-600 hover:border-blue-800 md:pl-0 md:pt-4 md:pb-0 md:border-l-0 md:border-t-4\" *ngIf=\"step.state === StepState.Completed\">\r\n <span class=\"text-xs text-blue-600 font-semibold tracking-wide uppercase group-hover:text-blue-800\">Step {{ step.index + 1 }}</span>\r\n <span class=\"text-sm font-medium\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n </div>\r\n <!-- Active Step -->\r\n <div class=\"pl-4 py-2 flex flex-col border-l-4 border-blue-600 md:pl-0 md:pt-4 md:pb-0 md:border-l-0 md:border-t-4\" aria-current=\"step\" *ngIf=\"step.state === StepState.Active\">\r\n <span class=\"text-xs text-blue-600 font-semibold tracking-wide uppercase\">Step {{ step.index + 1 }}</span>\r\n <span class=\"text-sm font-medium\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n </div>\r\n <!-- Upcoming Step -->\r\n <div class=\"group pl-4 py-2 flex flex-col border-l-4 border-gray-200 hover:border-gray-300 md:pl-0 md:pt-4 md:pb-0 md:border-l-0 md:border-t-4\" *ngIf=\"step.state === StepState.Upcoming\">\r\n <span class=\"text-xs text-gray-500 font-semibold tracking-wide uppercase group-hover:text-gray-700\">Step {{ step.index + 1 }}</span>\r\n <span class=\"text-sm font-medium\" *ngIf=\"step.stepLabel\">\r\n <ng-container [ngTemplateOutlet]=\"step.stepLabel.template\"></ng-container>\r\n </span>\r\n </div>\r\n </li>\r\n </ol>\r\n </nav>\r\n</ng-container>\r\n<ng-container *ngFor=\"let step of steps\">\r\n <ng-container *ngIf=\"step.state === StepState.Active\" [ngTemplateOutlet]=\"step.content\"></ng-container>\r\n</ng-container>", directives: [{ type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
1894
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LibStepperComponent, decorators: [{
1895
- type: Component,
1896
- args: [{
1897
- selector: 'lib-stepper',
1898
- templateUrl: './lib-stepper.component.html',
1899
- providers: [
1900
- { provide: LIBSTEPPER_ACCESSOR, useExisting: forwardRef(() => LibStepperComponent) }
1901
- ]
1902
- }]
1903
- }], ctorParameters: function () { return []; }, propDecorators: { steps: [{
1904
- type: ContentChildren,
1905
- args: [LibStepComponent, { descendants: true }]
1906
- }], stepChanged: [{
1907
- type: Output
1908
- }], linear: [{
1909
- type: Input
1910
- }], type: [{
1911
- type: Input
1912
- }] } });
1913
-
1914
- class DynamicComponentHostDirective {
1915
- constructor(viewContainerRef) {
1916
- this.viewContainerRef = viewContainerRef;
1917
- this.hostName = '';
1918
- }
1919
- }
1920
- DynamicComponentHostDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicComponentHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
1921
- DynamicComponentHostDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DynamicComponentHostDirective, selector: "[appDynamicComponentHost]", inputs: { hostName: "hostName" }, ngImport: i0 });
1922
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicComponentHostDirective, decorators: [{
1923
- type: Directive,
1924
- args: [{ selector: '[appDynamicComponentHost]' }]
1925
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { hostName: [{
1926
- type: Input
1927
- }] } });
1928
-
1929
- /**
1930
- * Holds information about the dynamic content.
1931
- * @remarks
1932
- * `ComponentRef` is undefined in the case content is of `TemplateRef` type.
1933
- */
1934
- class ContentRef {
1935
- constructor(nodes, viewRef, componentRef) {
1936
- this.nodes = nodes;
1937
- this.viewRef = viewRef;
1938
- this.componentRef = componentRef;
1939
- }
1940
- }
1941
-
1942
- /**
1943
- * Provides ways of loading and handling dynamic content.
1944
- *
1945
- * @remarks
1946
- * Do NOT use this directly, create an instance through {@link ComponentLoaderFactory}
1947
- * You can use this loader in two ways:
1948
- * - Attaches a component to `ViewContainerRef`.
1949
- * - Attaches a component to `ViewContainerRef`. The attached component has a `<ng-content>` tag inside its view. The {@link ComponentLoaderOptions.content} will be drawn inside this tag.
1950
- *
1951
- * @internal
1952
- */
1953
- class ComponentLoader {
1954
- constructor(vcr, cfr, applicationRef, injector) {
1955
- this.vcr = vcr;
1956
- this.cfr = cfr;
1957
- this.applicationRef = applicationRef;
1958
- this.injector = injector;
1959
- /**
1960
- * Before content is shown event.
1961
- */
1962
- this.onBeforeShow = new Subject();
1963
- /**
1964
- * After show content event.
1965
- * @returns The id of newly created component ref.
1966
- */
1967
- this.onShown = new Subject();
1968
- /**
1969
- * Before content is hidden event.
1970
- * @returns The instance of attached component;
1971
- */
1972
- this.onBeforeHide = new Subject();
1973
- /**
1974
- * After content is hidden event.
1975
- * @returns The id of destroyed component ref.
1976
- */
1977
- this.onHidden = new Subject();
1978
- this.providers = [];
1979
- this.containerDefaultSelector = 'body';
1980
- }
1981
- /**
1982
- * Attaches component.
1983
- * @param componentType - The type component to attach.
1984
- * @returns Current instance of {@link ComponentLoader}
1985
- */
1986
- attach(componentType) {
1987
- this.componentFactory = this.cfr.resolveComponentFactory(componentType);
1988
- return this;
1989
- }
1990
- /**
1991
- * Body will be used in nothing is provided.
1992
- * @param container - The element in which dynamic content will be drawn inside to. For string case a query to the dom will be executed to find the element.
1993
- * @returns Current instance of {@link ComponentLoader}
1994
- */
1995
- to(container) {
1996
- this.container = container || this.container;
1997
- return this;
1998
- }
1999
- /**
2000
- * Adds provider to the providers array. These providers will be injected to the attached component.
2001
- *
2002
- * @see {@link https://angular.io/guide/glossary#di-token | Injection Token}
2003
- *
2004
- * @param provider - Provider to inject.
2005
- * @returns Current instance of {@link ComponentLoader}
2006
- */
2007
- provide(provider) {
2008
- this.providers.push(provider);
2009
- return this;
2010
- }
2011
- /**
2012
- * Attaches attached component to dom and any dynamic content if provided.
2013
- * @remarks
2014
- * Also triggers the {@link ComponentLoader.onBeforeShow} and {@link ComponentLoader.onShown} events.
2015
- *
2016
- * @param options - {@link ComponentLoaderOptions}.
2017
- * @returns A reference to the created content.
2018
- */
2019
- show(options = {}) {
2020
- if (this.componentRef) {
2021
- throw Error('Component is already shown');
2022
- }
2023
- if (!this.componentFactory) {
2024
- throw Error('You must attach a component');
2025
- }
2026
- this.onBeforeShow.next();
2027
- if (options.content) {
2028
- this.contentRef = this.getContentRef(options.content, options.context, options.initialState);
2029
- }
2030
- this.createComponentAndAttachToView(options);
2031
- this.appendContentToContainer();
2032
- this.markComponentsForCheck();
2033
- this.onShown.next(options.id);
2034
- return this.componentRef;
2035
- }
2036
- /**
2037
- * Removes attached component from dom.
2038
- * @remarks
2039
- * Also triggers the {@link ComponentLoader.onBeforeHide} and {@link ComponentLoader.onHidden} events.
2040
- *
2041
- * @param id - If provided it is returned through the {@link ComponentLoader.onHidden}.
2042
- * @returns Current instance of {@link ComponentLoader}
2043
- */
2044
- hide(id, result) {
2045
- var _a, _b, _c;
2046
- if (!this.componentRef) {
2047
- throw Error('No attached component found to hide');
2048
- }
2049
- this.onBeforeHide.next(this.componentRef.instance);
2050
- const componentEl = this.componentRef.location.nativeElement;
2051
- componentEl.parentNode.removeChild(componentEl);
2052
- if ((_a = this.contentRef) === null || _a === void 0 ? void 0 : _a.componentRef) {
2053
- this.contentRef.componentRef.destroy();
2054
- }
2055
- if (this.vcr && ((_b = this.contentRef) === null || _b === void 0 ? void 0 : _b.viewRef)) {
2056
- this.vcr.remove(this.vcr.indexOf(this.contentRef.viewRef));
2057
- }
2058
- if ((_c = this.contentRef) === null || _c === void 0 ? void 0 : _c.viewRef) {
2059
- this.contentRef.viewRef.destroy();
2060
- }
2061
- this.contentRef = void 0;
2062
- this.componentRef = void 0;
2063
- this.onHidden.next(id ? { id, result } : null);
2064
- return this;
2065
- }
2066
- getInnerComponent() {
2067
- return this.innerComponent;
2068
- }
2069
- markComponentsForCheck() {
2070
- var _a;
2071
- if ((_a = this.contentRef) === null || _a === void 0 ? void 0 : _a.componentRef) {
2072
- this.innerComponent = this.contentRef.componentRef.instance;
2073
- this.contentRef.componentRef.changeDetectorRef.markForCheck();
2074
- this.contentRef.componentRef.changeDetectorRef.detectChanges();
2075
- }
2076
- this.componentRef.changeDetectorRef.markForCheck();
2077
- this.componentRef.changeDetectorRef.detectChanges();
2078
- }
2079
- createComponentAndAttachToView(options) {
2080
- var _a;
2081
- const injector = Injector.create({
2082
- providers: this.providers,
2083
- parent: this.injector,
2084
- });
2085
- this.componentRef = this.componentFactory.create(injector, (_a = this.contentRef) === null || _a === void 0 ? void 0 : _a.nodes);
2086
- this.applicationRef.attachView(this.componentRef.hostView);
2087
- this.instance = this.componentRef.instance;
2088
- Object.assign(this.componentRef.instance, options);
2089
- }
2090
- appendContentToContainer() {
2091
- var _a, _b;
2092
- if (this.container instanceof ElementRef) {
2093
- this.container.nativeElement.appendChild((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.location.nativeElement);
2094
- }
2095
- if (typeof this.container === 'string' && typeof document !== 'undefined') {
2096
- const selectedElement = document.querySelector(this.container) || document.querySelector(this.containerDefaultSelector);
2097
- if (!selectedElement) {
2098
- return;
2099
- }
2100
- selectedElement.appendChild((_b = this.componentRef) === null || _b === void 0 ? void 0 : _b.location.nativeElement);
2101
- }
2102
- }
2103
- getContentRef(content, context, initialState) {
2104
- //TemplateRef case
2105
- if (content instanceof TemplateRef) {
2106
- if (this.vcr) {
2107
- const viewRef = this.vcr.createEmbeddedView(content, context);
2108
- viewRef.markForCheck();
2109
- return new ContentRef([viewRef.rootNodes], viewRef);
2110
- }
2111
- const viewRef = content.createEmbeddedView({});
2112
- this.applicationRef.attachView(viewRef);
2113
- return new ContentRef([viewRef.rootNodes], viewRef);
2114
- }
2115
- //Component case
2116
- if (typeof content === 'function') {
2117
- const contentCf = this.cfr.resolveComponentFactory(content);
2118
- const injector = Injector.create({
2119
- providers: this.providers,
2120
- parent: this.injector,
2121
- });
2122
- const componentRef = contentCf.create(injector);
2123
- Object.assign(componentRef.instance, initialState);
2124
- this.applicationRef.attachView(componentRef.hostView);
2125
- return new ContentRef([[componentRef.location.nativeElement]], componentRef.hostView, componentRef);
2126
- }
2127
- throw Error('Unsupported content type');
2128
- }
2129
- }
2130
-
2131
- /**
2132
- * Use to create instances of {@link ComponentLoader}.
2133
- *
2134
- * @public
2135
- */
2136
- class ComponentLoaderFactory {
2137
- constructor(componentFactoryResolver, injector, applicationRef) {
2138
- this.componentFactoryResolver = componentFactoryResolver;
2139
- this.injector = injector;
2140
- this.applicationRef = applicationRef;
2141
- }
2142
- /**
2143
- * Returns a new instance of {@link ComponentLoader}
2144
- * @param viewContainerRef - The view container the dynamic content will be attached to.
2145
- * @returns A new instance of {@link ComponentLoader}.
2146
- *
2147
- * @public
2148
- */
2149
- createLoader(viewContainerRef) {
2150
- return new ComponentLoader(viewContainerRef, this.componentFactoryResolver, this.applicationRef, this.injector);
2151
- }
2152
- }
2153
- ComponentLoaderFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ComponentLoaderFactory, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
2154
- ComponentLoaderFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ComponentLoaderFactory, providedIn: 'root' });
2155
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ComponentLoaderFactory, decorators: [{
2156
- type: Injectable,
2157
- args: [{ providedIn: 'root' }]
2158
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.Injector }, { type: i0.ApplicationRef }]; } });
2159
-
2160
- class UserProfileMenuComponent {
2161
- constructor(authService, router, links) {
2162
- this.authService = authService;
2163
- this.router = router;
2164
- this.links = links;
2165
- // tslint:disable-next-line:no-input-rename
2166
- this.showUserName = false;
2167
- this.userSub$ = null;
2168
- this.statusSub$ = null;
2169
- this.user = null;
2170
- this.avatarName = null;
2171
- this.userMenuExpanded = false;
2172
- }
2173
- ngOnInit() {
2174
- this.authService.loadUser().subscribe((user) => {
2175
- this.setCurrentUser(user);
2176
- }, error => {
2177
- console.error(error);
2178
- });
2179
- // Detect user changes and display / or not user info accordingly...
2180
- this.userSub$ = this.authService.user$.subscribe((user) => {
2181
- // console.log('ShellHeaderComponent user subscription');
2182
- this.setCurrentUser(user);
2183
- });
2184
- }
2185
- signin(event) {
2186
- if (event) {
2187
- event.preventDefault();
2188
- }
2189
- this.authService.signinRedirect();
2190
- }
2191
- setCurrentUser(user) {
2192
- var _a, _b;
2193
- this.user = user;
2194
- if (this.user && this.user.profile) {
2195
- this.avatarName = `${(_a = this.user.profile.given_name) === null || _a === void 0 ? void 0 : _a.charAt(0)}${(_b = this.user.profile.family_name) === null || _b === void 0 ? void 0 : _b.charAt(0)}`.toUpperCase();
2196
- }
2197
- }
2198
- // tslint:disable-next-line:typedef
2199
- onClickOutside($event) {
2200
- this.userMenuExpanded = false;
2201
- }
2202
- }
2203
- UserProfileMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UserProfileMenuComponent, deps: [{ token: AuthService }, { token: Router }, { token: APP_LINKS }], target: i0.ɵɵFactoryTarget.Component });
2204
- UserProfileMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UserProfileMenuComponent, selector: "lib-user-profile-menu", inputs: { showUserName: ["show-user-name", "showUserName"] }, ngImport: i0, template: "<div class=\"relative\" (clickOutside)=\"onClickOutside($event)\" (click)=\"userMenuExpanded = !userMenuExpanded\">\r\n\r\n <div class=\"inline-flex\">\r\n <!-- Username -->\r\n <div [ngClass]=\"{'shell-header-profile': showUserName}\">\r\n <div *ngIf=\"user && showUserName\" class=\"shell-header-profile-userName\">\r\n {{ user.profile.name }}\r\n </div>\r\n </div>\r\n\r\n <div [class.ml-2]=\"showUserName\">\r\n <button type=\"button\" *ngIf=\"user\"\r\n class=\"shell-header-profile-dropdown-button\"\r\n id=\"user-menu\"\r\n aria-expanded=\"false\"\r\n aria-haspopup=\"true\">\r\n <span class=\"sr-only\">Open user menu</span>\r\n <span class=\"avatar-container\">\r\n <span class=\"avatar-text\">{{this.avatarName}}</span>\r\n </span>\r\n </button>\r\n\r\n <button type=\"button\"\r\n *ngIf=\"!user\"\r\n (click)=\"signin(null)\"\r\n class=\"shell-header-profile-dropdown-button\"\r\n id=\"user-menu\"\r\n aria-expanded=\"false\"\r\n aria-haspopup=\"true\">\r\n <span class=\"sr-only\">sign in</span>\r\n <span class=\"avatar-container\">\r\n <span class=\"avatar-text\"><i class=\"ms-Icon ms-Icon--Signin\"></i></span>\r\n </span>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div [class]=\"userMenuExpanded ?\r\n 'transition ease-out duration-200 origin-top-right z-30 absolute right-0 mt-2 w-56 rounded-sm shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none'\r\n :\r\n 'hidden transition ease-in duration-75 origin-top-right z-30 right-0 mt-2 w-56 rounded-sm shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none'\"\r\n role=\"menu\" aria-orientation=\"vertical\" aria-labelledby=\"menu-button\" tabindex=\"-1\">\r\n <lib-nav-links-list\r\n [links]=\"links.profile\"\r\n [link-class]=\"'nav-link-profile'\"\r\n [link-active-class]=\"'nav-link-profile-active'\">\r\n </lib-nav-links-list>\r\n </div>\r\n\r\n</div>\r\n\r\n", components: [{ type: NavLinksListComponent, selector: "lib-nav-links-list", inputs: ["links", "active-fragment", "link-class", "link-active-class", "container-class", "show-icons"] }], directives: [{ type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideEnabled", "attachOutsideOnClick", "delayClickOutsideInit", "emitOnBlur", "exclude", "excludeBeforeClick", "clickOutsideEvents"], outputs: ["clickOutside"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UserProfileMenuComponent, decorators: [{
2206
- type: Component,
2207
- args: [{
2208
- selector: 'lib-user-profile-menu',
2209
- templateUrl: './user-profile-menu.component.html'
2210
- }]
2211
- }], ctorParameters: function () { return [{ type: i2.AuthService, decorators: [{
2212
- type: Inject,
2213
- args: [AuthService]
2214
- }] }, { type: i1$1.Router, decorators: [{
2215
- type: Inject,
2216
- args: [Router]
2217
- }] }, { type: undefined, decorators: [{
2218
- type: Inject,
2219
- args: [APP_LINKS]
2220
- }] }]; }, propDecorators: { showUserName: [{
2221
- type: Input,
2222
- args: ['show-user-name']
2223
- }] } });
2224
-
2225
- class NotificationsIndicatorComponent {
2226
- constructor(notifications, links) {
2227
- this.notifications = notifications;
2228
- this.links = links;
2229
- this.menuExpanded = false;
2230
- this.unreadCount = 0;
2231
- this.items = [];
2232
- this.inboxAction = undefined;
2233
- this.newArrival = false;
2234
- }
2235
- ngOnDestroy() {
2236
- if (this.notificationsSub$) {
2237
- this.notificationsSub$.unsubscribe();
2238
- }
2239
- }
2240
- ngOnInit() {
2241
- this.links['notifications'].subscribe(notificationsLink => {
2242
- this.allNotificationsLink = notificationsLink;
2243
- });
2244
- this.notificationsSub$ = this.notifications.messages.subscribe(result => {
2245
- if (result.items) {
2246
- this.newArrival = true;
2247
- this.unreadCount = result.count;
2248
- this.items = result.items;
2249
- setTimeout(() => { this.newArrival = false; }, 1000);
2250
- }
2251
- });
2252
- }
2253
- doInboxAction() {
2254
- if (this.notifications.inboxAction) {
2255
- this.notifications.inboxAction();
2256
- }
2257
- else {
2258
- this.menuExpanded = !this.menuExpanded;
2259
- }
2260
- this.unreadCount = 0;
2261
- }
2262
- removeItem(index) {
2263
- this.items.splice(index, 1);
2264
- }
2265
- // this.notificationsSub$ = this.links.notifications?.pipe(map(result => {
2266
- // this.allItemsLink = result.allNotifications;
2267
- // this.items = result.items;
2268
- // this.unreadCount = result.count;
2269
- // }));
2270
- // [this.notificationsLinksPath] as Observable<NotificationNavLink[]>;
2271
- // this.allNotificationsLink = this.links[this.allNotificationsLinkPath] as Observable<NavLink>;
2272
- // this.unreadNotificationsCountObs = this.links[this.notificationsCounterLinksPath] as Observable<number>;
2273
- // this.getUnreadNotificationsCount();
2274
- // tslint:disable-next-line:typedef
2275
- onClickOutside($event) {
2276
- this.menuExpanded = false;
2277
- }
2278
- }
2279
- NotificationsIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NotificationsIndicatorComponent, deps: [{ token: APP_NOTIFICATIONS }, { token: APP_LINKS }], target: i0.ɵɵFactoryTarget.Component });
2280
- NotificationsIndicatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NotificationsIndicatorComponent, selector: "lib-notifications-indicator", ngImport: i0, template: "<div class=\"relative\"\r\n(clickOutside)=\"onClickOutside($event)\">\r\n <!-- Notifications Button -->\r\n <button type=\"button\"\r\n (click)=\"doInboxAction()\"\r\n aria-expanded=\"false\"\r\n aria-haspopup=\"true\">\r\n <span class=\"sr-only\">View notifications</span>\r\n <span class=\"avatar-container\">\r\n <span class=\"avatar-text\">\r\n <i class=\"ms-Icon hover:text-blue-400\"\r\n [class.ms-Icon--MessageFill]=\"unreadCount > 0\"\r\n [class.text-sky-400]=\"unreadCount > 0\"\r\n [class.animate-notification]=\"newArrival\"\r\n [class.ms-Icon--Message]=\"unreadCount === 0\">\r\n </i>\r\n </span>\r\n <span\r\n *ngIf=\"unreadCount > 0\"\r\n [class.animate-pulse]=\"newArrival\"\r\n class=\"absolute top-0 right-0 inline-flex items-center justify-center -mt-1 ml-1 text-xs leading-none text-gray-100 ordinal\">\r\n {{ unreadCount }}\r\n </span>\r\n </span>\r\n </button>\r\n\r\n <!-- Notifications dropdown -->\r\n <div *ngIf=\"menuExpanded\" class=\"header-notifications-dropdown-with-username\" role=\"menu\" aria-orientation=\"vertical\" aria-labelledby=\"messages-menu\">\r\n <div class=\"max-h-64 overflow-y-auto notification-messages min-h\">\r\n <ng-container *ngIf=\"!items; else messagesDropDown\" class=\"py-5\">\r\n <div class=\"notifications-nav-link hover:bg-transparent\">\u0394\u03B5\u03BD \u03AD\u03C7\u03B5\u03C4\u03B5 \u03BD\u03AD\u03B5\u03C2 \u03B5\u03B9\u03B4\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03B5\u03B9\u03C2</div>\r\n </ng-container>\r\n <ng-template #messagesDropDown>\r\n <ul class=\"pr-1.5\">\r\n <ng-container *ngIf=\"items; else loading\">\r\n <ng-container *ngIf=\"items.length <= 0\" class=\"py-5\">\r\n <div class=\"notifications-nav-link hover:bg-transparent\">\u0394\u03B5\u03BD \u03AD\u03C7\u03B5\u03C4\u03B5 \u03BD\u03AD\u03B5\u03C2 \u03B5\u03B9\u03B4\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03B5\u03B9\u03C2</div>\r\n </ng-container>\r\n <ng-container *ngFor=\"let message of items; let i = index\">\r\n <li class=\"mb-2\" [ngClass]=\"{ 'border-l-2 border-blue-500 bg-blue-50 hover:bg-blue-50': !message.data.isRead }\">\r\n <div class=\"flex justify-between\">\r\n <div class=\"flex-grow\">\r\n <a\r\n [routerLink]=\"message.path\"\r\n (click)=\"removeItem(i)\"\r\n class=\"notifications-nav-link grid\"\r\n [ngClass]=\"!message.data.isRead ? ' hover:bg-blue-50' : 'border-b border-gray-100'\"\r\n >\r\n <div class=\"flex flex-col\">\r\n <div class=\"font-thin tracking-tighter\">\r\n {{ message.data.creationDate | date: \"EEE, d MMMM\" }}\r\n </div>\r\n <div class=\"font-bold\">\r\n {{ message.data.text }}\r\n </div>\r\n </div>\r\n </a>\r\n </div>\r\n </div>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-template #loading>\r\n <div class=\"h-32 flex items-center justify-center\">\r\n <div class=\"animate-pulse text-s text-gray-600\">Loading...</div>\r\n </div>\r\n </ng-template>\r\n </ul>\r\n </ng-template>\r\n </div>\r\n <div class=\"p-1 rounded-sm\">\r\n <a [routerLink]=\"allNotificationsLink!.path\">\r\n <button type=\"button\" class=\"header-notifications-dropdown-view-all-button\">{{allNotificationsLink!.text}}</button>\r\n </a>\r\n </div>\r\n </div>\r\n</div>\r\n", directives: [{ type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideEnabled", "attachOutsideOnClick", "delayClickOutsideInit", "emitOnBlur", "exclude", "excludeBeforeClick", "clickOutsideEvents"], outputs: ["clickOutside"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "date": i1.DatePipe } });
2281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NotificationsIndicatorComponent, decorators: [{
2282
- type: Component,
2283
- args: [{
2284
- selector: 'lib-notifications-indicator',
2285
- templateUrl: './notifications-indicator.component.html'
2286
- }]
2287
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2288
- type: Inject,
2289
- args: [APP_NOTIFICATIONS]
2290
- }] }, { type: undefined, decorators: [{
2291
- type: Inject,
2292
- args: [APP_LINKS]
2293
- }] }]; } });
2294
-
2295
- class LanguageSelectionComponent {
2296
- constructor(langsService) {
2297
- this.langsService = langsService;
2298
- this.menuExpanded = false;
2299
- }
2300
- ngOnInit() {
2301
- }
2302
- selectLang(option) {
2303
- var _a;
2304
- if ((_a = this.langsService) === null || _a === void 0 ? void 0 : _a.setSelected) {
2305
- this.langsService.setSelected(option.value);
2306
- }
2307
- }
2308
- onClickOutside($event) {
2309
- this.menuExpanded = false;
2310
- }
2311
- }
2312
- LanguageSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LanguageSelectionComponent, deps: [{ token: APP_LANGUAGES }], target: i0.ɵɵFactoryTarget.Component });
2313
- LanguageSelectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LanguageSelectionComponent, selector: "lib-language-selection", ngImport: i0, template: "<div class=\"relative\" (clickOutside)=\"onClickOutside($event)\">\r\n <button class=\"text-blue-300 hover:text-blue-400\" (click)=\"menuExpanded = !menuExpanded\">\r\n <i class=\"text-xs mr-1 ms-Icon ms-Icon--Globe\"></i>\r\n <span>{{langsService?.selected || langsService?.default}}</span>\r\n </button>\r\n\r\n <div\r\n [class]=\"menuExpanded ? 'transition ease-out duration-200 origin-top-right z-30 absolute right-0 mt-2 w-56 rounded-sm shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none':'hidden transition ease-in duration-75 origin-top-right z-30 right-0 mt-2 w-56 rounded-sm shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none'\" role=\"menu\" aria-orientation=\"vertical\" aria-labelledby=\"menu-button\" tabindex=\"-1\">\r\n <div class=\"py-1\" role=\"none\">\r\n <ng-container *ngFor=\"let lang of langsService?.options | async\">\r\n <a (click)=\"selectLang(lang)\" *ngIf=\"lang.value != langsService?.selected\" class=\"nav-link-profile\" role=\"menuitem\" tabindex=\"-1\" id=\"menu-item-0\">\r\n <i class=\"text-xs mr-1 ms-Icon ms-Icon--GlobeFavorite\"></i>\r\n {{lang.description}}\r\n </a>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", directives: [{ type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideEnabled", "attachOutsideOnClick", "delayClickOutsideInit", "emitOnBlur", "exclude", "excludeBeforeClick", "clickOutsideEvents"], outputs: ["clickOutside"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i1.AsyncPipe } });
2314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LanguageSelectionComponent, decorators: [{
2315
- type: Component,
2316
- args: [{
2317
- selector: 'lib-language-selection',
2318
- templateUrl: './language-selection.component.html'
2319
- }]
2320
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2321
- type: Inject,
2322
- args: [APP_LANGUAGES]
2323
- }] }]; } });
2324
-
2325
- class ShellHeaderComponent {
2326
- constructor(authService, router, route, config, links) {
2327
- this.authService = authService;
2328
- this.router = router;
2329
- this.route = route;
2330
- this.config = config;
2331
- this.links = links;
2332
- // tslint:disable-next-line:no-input-rename
2333
- this.sectionLinksPath = 'main';
2334
- // tslint:disable-next-line:no-input-rename
2335
- this.profileMenuVisible = true;
2336
- // tslint:disable-next-line:no-input-rename
2337
- this.showUserNameOnHeader = false;
2338
- // tslint:disable-next-line:no-input-rename
2339
- this.showAlerts = false;
2340
- // tslint:disable-next-line:no-input-rename
2341
- this.shellLayout = ShellLayoutType.Stacked;
2342
- this.border = true;
2343
- this.sectionLinks = of([]);
2344
- this.mobileMenuExpanded = false;
2345
- this.userMenuExpanded = false;
2346
- this.routerSub$ = null;
2347
- this.userSub$ = null;
2348
- this.statusSub$ = null;
2349
- this.user = null;
2350
- this.avatarName = null;
2351
- this.activeFragment = null;
2352
- this.routeSubject = this.router.events.pipe(filter((event) => event instanceof NavigationStart));
2353
- }
2354
- ngOnInit() {
2355
- this.activeFragment = this.route.fragment.pipe(share());
2356
- this.sectionLinks = this.links[this.sectionLinksPath];
2357
- this.routerSub$ = this.routeSubject.subscribe((event) => {
2358
- this.mobileMenuExpanded = false;
2359
- this.userMenuExpanded = false;
2360
- });
2361
- this.authService.loadUser().subscribe((user) => {
2362
- this.setCurrentUser(user);
2363
- }, error => {
2364
- console.error(error);
2365
- });
2366
- // Detect user changes and display / or not user info accordingly...
2367
- this.userSub$ = this.authService.user$.subscribe((user) => {
2368
- // console.log('ShellHeaderComponent user subscription');
2369
- this.setCurrentUser(user);
2370
- });
2371
- }
2372
- ngOnDestroy() {
2373
- if (this.routerSub$) {
2374
- this.routerSub$.unsubscribe();
2375
- }
2376
- // TODO: check authenticated user here before we start polling server status
2377
- if (this.statusSub$) {
2378
- this.statusSub$.unsubscribe();
2379
- }
2380
- if (this.userSub$) {
2381
- this.userSub$.unsubscribe();
2382
- }
2383
- }
2384
- // tslint:disable-next-line:typedef
2385
- onClickOutside($event) {
2386
- this.userMenuExpanded = false;
2387
- }
2388
- signin(event) {
2389
- if (event) {
2390
- event.preventDefault();
2391
- }
2392
- this.authService.signinRedirect();
2393
- }
2394
- setCurrentUser(user) {
2395
- var _a, _b;
2396
- this.user = user;
2397
- if (this.user && this.user.profile) {
2398
- this.avatarName = `${(_a = this.user.profile.given_name) === null || _a === void 0 ? void 0 : _a.charAt(0)}${(_b = this.user.profile.family_name) === null || _b === void 0 ? void 0 : _b.charAt(0)}`.toUpperCase();
2399
- }
2400
- }
2401
- }
2402
- ShellHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShellHeaderComponent, deps: [{ token: AuthService }, { token: Router }, { token: ActivatedRoute }, { token: SHELL_CONFIG }, { token: APP_LINKS }], target: i0.ɵɵFactoryTarget.Component });
2403
- ShellHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ShellHeaderComponent, selector: "lib-shell-header", inputs: { sectionLinksPath: ["section-links", "sectionLinksPath"], profileMenuVisible: ["profile-menu", "profileMenuVisible"], showUserNameOnHeader: ["show-userName", "showUserNameOnHeader"], showAlerts: ["show-alerts", "showAlerts"], shellLayout: ["shell-layout", "shellLayout"], border: "border" }, ngImport: i0, template: "<nav>\r\n <div class=\"shell-header-paddings\">\r\n <div [class]=\"border ? 'shell-header-border' : ''\">\r\n <div class=\"shell-header-menu-container\">\r\n <div *ngIf=\"shellLayout==='Stacked'\" class=\"shell-header-logo-container\">\r\n <div>\r\n <a href=\"#\" [routerLink]=\"['/']\"><img class=\"app-logo\" [src]=\"config.appLogo\" [alt]=\"config.appLogoAlt\" /></a>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"shellLayout==='Stacked'\" class=\"shell-header-link-container\">\r\n <div class=\"shell-header-link-container-inner\">\r\n <lib-nav-links-list\r\n [links]=\"sectionLinks\"\r\n [active-fragment]=\"activeFragment\"\r\n [link-class]=\"'nav-link'\"\r\n [link-active-class]=\"'nav-link-active'\">\r\n </lib-nav-links-list>\r\n </div>\r\n </div>\r\n\r\n <div class=\"shell-header-md-visible\">\r\n\r\n <div class=\"shell-header-links-far-container\" (clickOutside)=\"onClickOutside($event)\">\r\n\r\n <lib-nav-links-list\r\n [links]=\"links.profileActions\"\r\n [active-fragment]=\"activeFragment\"\r\n [link-class]=\"'shell-header-menu-rounded-button'\"\r\n [link-active-class]=\"'shell-header-menu-rounded-button-active'\">\r\n </lib-nav-links-list>\r\n\r\n\r\n <!-- Profile dropdown -->\r\n <div *ngIf=\"profileMenuVisible\" class=\"ml-2\">\r\n <lib-user-profile-menu [show-user-name]=\"showUserNameOnHeader\"></lib-user-profile-menu>\r\n </div>\r\n\r\n <!-- Notifications dropdown -->\r\n <div *ngIf=\"showAlerts && user\" class=\"ml-2\">\r\n <lib-notifications-indicator></lib-notifications-indicator>\r\n </div>\r\n\r\n <!-- languages dropdown -->\r\n <div *ngIf=\"config.showLangsOnHeader\" class=\"ml-2\">\r\n <lib-language-selection></lib-language-selection>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mobile-menu-button-container\" *ngIf=\"shellLayout === 'Stacked'\">\r\n <!-- Mobile menu button -->\r\n <button type=\"button\"\r\n (click)=\"mobileMenuExpanded = !mobileMenuExpanded\"\r\n class=\"mobile-menu-button\"\r\n aria-controls=\"mobile-menu\"\r\n [attr.aria-expanded]=\"mobileMenuExpanded\">\r\n <span class=\"sr-only\">Open main menu</span>\r\n <!--Heroicon name: outline/menu Menu open: \"hidden\", Menu closed: \"block\"-->\r\n <svg xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n aria-hidden=\"true\"\r\n [class]=\"mobileMenuExpanded ? 'hidden':'block h-6 w-6'\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M4 6h16M4 12h16M4 18h16\" />\r\n </svg>\r\n <!--Heroicon name: outline/x Menu open: \"block\", Menu closed: \"hidden\"-->\r\n <svg xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n aria-hidden=\"true\"\r\n [class]=\"mobileMenuExpanded ? 'block h-6 w-6':'hidden'\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Mobile menu, show/hide based on menu state. -->\r\n <div class=\"mobile-menu-container\" *ngIf=\"mobileMenuExpanded\" id=\"mobile-menu\">\r\n <lib-nav-links-list\r\n [links]=\"sectionLinks\"\r\n [active-fragment]=\"activeFragment\"\r\n [link-class]=\"'nav-link-mobile'\"\r\n [link-active-class]=\"'nav-link-mobile-active'\"\r\n [container-class]=\"'mobile-menu-link-container'\">\r\n </lib-nav-links-list>\r\n\r\n <div *ngIf=\"!user\">\r\n <a href=\"#\" (click)=\"signin($event)\" class=\"nav-link-mobile\">\r\n <i class=\"ms-Icon ms-Icon--Signin mr-2\"></i>\u03A3\u03CD\u03BD\u03B4\u03B5\u03C3\u03B7\r\n </a>\r\n </div>\r\n\r\n <div class=\"mobile-menu-user-info-container\" *ngIf=\"user\">\r\n <div class=\"mobile-menu-user-info-container-inner\">\r\n <div class=\"flex-shrink-0\">\r\n <span class=\"mobile-menu-avatar-container\">\r\n <span class=\"mobile-menu-avatar-name\">{{ this.avatarName }}</span>\r\n </span>\r\n </div>\r\n <div class=\"ml-3\">\r\n <div class=\"mobile-menu-user-name\">{{ user.profile.name }}</div>\r\n <div class=\"mobile-menu-user-email\">{{ user.profile.email }}</div>\r\n </div>\r\n <!--\r\n <button class=\"mobile-menu-rounded-button\">\r\n <span class=\"sr-only\">View notifications</span>\r\n <svg class=\"mobile-menu-rounded-button-icon-style\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n aria-hidden=\"true\">\r\n <path stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n stroke-width=\"2\"\r\n d=\"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9\" />\r\n </svg>\r\n </button>\r\n -->\r\n </div>\r\n </div>\r\n\r\n <lib-nav-links-list\r\n [links]=\"links.profile\"\r\n [active-fragment]=\"activeFragment\"\r\n [link-class]=\"'nav-link-mobile'\"\r\n [link-active-class]=\"'nav-link-mobile-active'\"\r\n [container-class]=\"'mobile-menu-link-container'\">\r\n </lib-nav-links-list>\r\n </div>\r\n</nav>\r\n", components: [{ type: NavLinksListComponent, selector: "lib-nav-links-list", inputs: ["links", "active-fragment", "link-class", "link-active-class", "container-class", "show-icons"] }, { type: UserProfileMenuComponent, selector: "lib-user-profile-menu", inputs: ["show-user-name"] }, { type: NotificationsIndicatorComponent, selector: "lib-notifications-indicator" }, { type: LanguageSelectionComponent, selector: "lib-language-selection" }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideEnabled", "attachOutsideOnClick", "delayClickOutsideInit", "emitOnBlur", "exclude", "excludeBeforeClick", "clickOutsideEvents"], outputs: ["clickOutside"] }] });
2404
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShellHeaderComponent, decorators: [{
2405
- type: Component,
2406
- args: [{
2407
- // tslint:disable-next-line:component-selector
2408
- selector: 'lib-shell-header',
2409
- templateUrl: './shell-header.component.html',
2410
- }]
2411
- }], ctorParameters: function () { return [{ type: i2.AuthService, decorators: [{
2412
- type: Inject,
2413
- args: [AuthService]
2414
- }] }, { type: i1$1.Router, decorators: [{
2415
- type: Inject,
2416
- args: [Router]
2417
- }] }, { type: i1$1.ActivatedRoute, decorators: [{
2418
- type: Inject,
2419
- args: [ActivatedRoute]
2420
- }] }, { type: undefined, decorators: [{
2421
- type: Inject,
2422
- args: [SHELL_CONFIG]
2423
- }] }, { type: undefined, decorators: [{
2424
- type: Inject,
2425
- args: [APP_LINKS]
2426
- }] }]; }, propDecorators: { sectionLinksPath: [{
2427
- type: Input,
2428
- args: ['section-links']
2429
- }], profileMenuVisible: [{
2430
- type: Input,
2431
- args: ['profile-menu']
2432
- }], showUserNameOnHeader: [{
2433
- type: Input,
2434
- args: ['show-userName']
2435
- }], showAlerts: [{
2436
- type: Input,
2437
- args: ['show-alerts']
2438
- }], shellLayout: [{
2439
- type: Input,
2440
- args: ['shell-layout']
2441
- }], border: [{
2442
- type: Input
2443
- }] } });
2444
-
2445
- class ShellFooterComponent {
2446
- constructor(links) {
2447
- this.links = links;
2448
- }
2449
- }
2450
- ShellFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShellFooterComponent, deps: [{ token: APP_LINKS }], target: i0.ɵɵFactoryTarget.Component });
2451
- ShellFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ShellFooterComponent, selector: "lib-shell-footer", ngImport: i0, template: "<footer class=\"shell-footer-component-container\">\r\n <div class=\"shell-footer-paddings\">\r\n <div class=\"shell-footer-component-container-inner\">\r\n <div class=\"shell-footer-sections-container\">\r\n <div class=\"shell-footer-section\">\r\n <img class=\"shell-footer-logo-h\" src=\"assets/images/branding/indice.png\" alt=\"INDICE logo\" />\r\n <nav class=\"mt-4\">\r\n <ul class=\"space-y-2\">\r\n <ng-container *ngFor=\"let link of links.brand | async\">\r\n <li>\r\n <a [href]=\"link.path\" class=\"shell-footer-link\">{{ link.text }}</a>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </nav>\r\n </div>\r\n <div class=\"shell-footer-section-links\">\r\n <h5 class=\"shell-footer-section-title\">Legal</h5>\r\n <nav class=\"mt-4\">\r\n <ul class=\"grid lg:grid-cols-2\">\r\n <ng-container *ngFor=\"let link of links.legal | async\">\r\n <li class=\"mb-2\">\r\n <a [href]=\"link.path\" class=\"shell-footer-link\">{{ link.text }}</a>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </nav>\r\n </div>\r\n <div class=\"shell-footer-section-links\">\r\n <h5 class=\"shell-footer-section-title\">Follow us</h5>\r\n <nav class=\"mt-4\">\r\n <ul class=\"grid lg:grid-cols-2\">\r\n <li class=\"mb-2\">\r\n <a href=\"#\" class=\"shell-footer-social\">\r\n <svg class=\"shell-footer-social-icon\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\"/>\r\n </svg>\r\n <span> Twitter </span>\r\n </a>\r\n </li>\r\n <li class=\"mb-2\">\r\n <a href=\"#\" class=\"shell-footer-social\">\r\n <svg class=\"shell-footer-social-icon\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path fill-rule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clip-rule=\"evenodd\"/>\r\n </svg>\r\n <span> Instagram </span>\r\n </a>\r\n </li>\r\n <li class=\"mb-2\">\r\n <a href=\"#\" class=\"shell-footer-social\">\r\n <svg class=\"shell-footer-social-icon\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 24 24\" >\r\n <path fill-rule=\"evenodd\" d=\"M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z\" clip-rule=\"evenodd\"/>\r\n </svg>\r\n <span> Facebook </span>\r\n </a>\r\n </li>\r\n </ul>\r\n </nav>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"shell-footer-copyright\">\r\n <!--<nav class=\"flex flex-wrap justify-center space-x-6\">\r\n <a href=\"#\" class=\"font-normal text-sm hover:text-gray-100 mb-2\">Cookie settings</a>\r\n </nav>-->\r\n <p class=\"text-sm text-center sm:text-right\">\r\n \u00A9 2021 INDICE. All rights reserved.\r\n </p>\r\n </div>\r\n </div>\r\n</footer>\r\n", directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i1.AsyncPipe } });
2452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShellFooterComponent, decorators: [{
2453
- type: Component,
2454
- args: [{
2455
- selector: 'lib-shell-footer',
2456
- templateUrl: './shell-footer.component.html'
2457
- }]
2458
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2459
- type: Inject,
2460
- args: [APP_LINKS]
2461
- }] }]; } });
2462
-
2463
- class ShellSidebarComponent {
2464
- constructor(router, route, links) {
2465
- this.router = router;
2466
- this.route = route;
2467
- this.links = links;
2468
- // tslint:disable-next-line:no-input-rename
2469
- this.sectionLinksPath = 'main';
2470
- this.sectionLinks = of([]);
2471
- // tslint:disable-next-line:no-input-rename
2472
- this.shellConfig = undefined;
2473
- this.activeFragment = null;
2474
- }
2475
- ngOnInit() {
2476
- this.activeFragment = this.route.fragment.pipe(share());
2477
- this.sectionLinks = this.links[this.sectionLinksPath];
2478
- }
2479
- }
2480
- ShellSidebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShellSidebarComponent, deps: [{ token: Router }, { token: ActivatedRoute }, { token: APP_LINKS }], target: i0.ɵɵFactoryTarget.Component });
2481
- ShellSidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ShellSidebarComponent, selector: "lib-shell-sidebar", inputs: { sectionLinksPath: ["section-links", "sectionLinksPath"], shellConfig: ["config", "shellConfig"] }, ngImport: i0, template: "<!-- Sidebar component, swap this element with another sidebar if you like -->\r\n<div class=\"flex w-full flex-col h-full min-h-0 bg-gray-800\">\r\n <div class=\"flex items-center h-16 flex-shrink-0 px-4 bg-gray-900\">\r\n <!-- <img class=\"h-8 w-auto\" src=\"https://tailwindui.com/img/logos/workflow-logo-indigo-500-mark-white-text.svg\" alt=\"Workflow\"> -->\r\n <a href=\"#\" [routerLink]=\"['/']\"><img class=\"app-logo\" [src]=\"shellConfig?.appLogo\" [alt]=\"shellConfig?.appLogoAlt\" /></a>\r\n </div>\r\n <div class=\"pt-4 px-2 sidebar\">\r\n <lib-nav-links-list\r\n [show-icons]=\"true\"\r\n [links]=\"sectionLinks\"\r\n [active-fragment]=\"activeFragment\"\r\n [link-class]=\"'sidebar nav-link group'\"\r\n [link-active-class]=\"'sidebar nav-link-active group'\">\r\n </lib-nav-links-list>\r\n </div>\r\n</div>\r\n", components: [{ type: NavLinksListComponent, selector: "lib-nav-links-list", inputs: ["links", "active-fragment", "link-class", "link-active-class", "container-class", "show-icons"] }], directives: [{ type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }] });
2482
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShellSidebarComponent, decorators: [{
2483
- type: Component,
2484
- args: [{
2485
- selector: 'lib-shell-sidebar',
2486
- templateUrl: './shell-sidebar.component.html'
2487
- }]
2488
- }], ctorParameters: function () { return [{ type: i1$1.Router, decorators: [{
2489
- type: Inject,
2490
- args: [Router]
2491
- }] }, { type: i1$1.ActivatedRoute, decorators: [{
2492
- type: Inject,
2493
- args: [ActivatedRoute]
2494
- }] }, { type: undefined, decorators: [{
2495
- type: Inject,
2496
- args: [APP_LINKS]
2497
- }] }]; }, propDecorators: { sectionLinksPath: [{
2498
- type: Input,
2499
- args: ['section-links']
2500
- }], shellConfig: [{
2501
- type: Input,
2502
- args: ['config']
2503
- }] } });
2504
-
2505
- class ShellLayoutComponent {
2506
- constructor(document, router, location, config, componentLoaderFactory) {
2507
- this.document = document;
2508
- this.router = router;
2509
- this.location = location;
2510
- this.config = config;
2511
- this.componentLoaderFactory = componentLoaderFactory;
2512
- this.dynamicComponentHosts = null;
2513
- this.showRightPaneSM = false;
2514
- this.routerSub$ = null;
2515
- this.activeConfig = new DefaultShellConfig();
2516
- this.loaded = false;
2517
- this.hideSidebar = false;
2518
- if (!config) {
2519
- config = new DefaultShellConfig();
2520
- }
2521
- this.activeConfig = config;
2522
- }
2523
- ngAfterViewChecked() {
2524
- setTimeout(() => { this.loaded = true; }, 200);
2525
- }
2526
- ngOnInit() {
2527
- this.routerSub$ = this.router.events.pipe(filter((event) => event instanceof ActivationStart)).subscribe((e) => {
2528
- var _a, _b, _c, _d, _e, _f;
2529
- // console.log('ShellLayoutComponent ActivationStart', e);
2530
- if ((_a = e) === null || _a === void 0 ? void 0 : _a.snapshot) {
2531
- // console.log('ShellLayoutComponent ActivationStart snapshot', (e as ActivationStart)?.snapshot);
2532
- if ((_c = (_b = e) === null || _b === void 0 ? void 0 : _b.snapshot) === null || _c === void 0 ? void 0 : _c.data) {
2533
- // console.log('ShellLayoutComponent ActivationStart snapshot data', (e as ActivationStart)?.snapshot.data);
2534
- if ((_e = (_d = e) === null || _d === void 0 ? void 0 : _d.snapshot) === null || _e === void 0 ? void 0 : _e.data.shell) {
2535
- // console.log('ShellLayoutComponent ActivationStart snapshot data shell params',
2536
- // (e as ActivationStart)?.snapshot.data.shell);
2537
- this.activeConfig = (_f = e) === null || _f === void 0 ? void 0 : _f.snapshot.data.shell;
2538
- // console.log('ShellLayoutComponent activeConfig from route: ', this.activeConfig);
2539
- if (this.activeConfig.customHeaderComponent) {
2540
- this.initCustomComponents();
2541
- }
2542
- }
2543
- else {
2544
- this.activeConfig = this.config ? this.config : new DefaultShellConfig();
2545
- // console.log('ShellLayoutComponent default activeConfig: ', this.activeConfig);
2546
- }
2547
- }
2548
- }
2549
- });
2550
- }
2551
- ngAfterViewInit() {
2552
- this.initCustomComponents();
2553
- }
2554
- initCustomComponents() {
2555
- if (this.dynamicComponentHosts && this.dynamicComponentHosts.length > 0) {
2556
- this.loadCustomComponent(this.dynamicComponentHosts.find((_) => _.hostName === 'Header'));
2557
- // since you're not using it...
2558
- // this.loadCustomComponent(this.dynamicComponentHosts.find(_ => _.hostName === 'Footer'));
2559
- }
2560
- }
2561
- ngOnDestroy() {
2562
- if (this.routerSub$) {
2563
- this.routerSub$.unsubscribe();
2564
- }
2565
- }
2566
- loadCustomComponent(host) {
2567
- if (host) {
2568
- const viewContainerRef = host.viewContainerRef;
2569
- if (viewContainerRef && this.activeConfig.customHeaderComponent) {
2570
- const clf = this.componentLoaderFactory.createLoader(viewContainerRef);
2571
- const headerCompRef = clf.attach(this.activeConfig.customHeaderComponent).to(viewContainerRef.element).show();
2572
- }
2573
- }
2574
- }
2575
- }
2576
- ShellLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShellLayoutComponent, deps: [{ token: DOCUMENT }, { token: i1$1.Router }, { token: i1.Location }, { token: SHELL_CONFIG }, { token: ComponentLoaderFactory }], target: i0.ɵɵFactoryTarget.Component });
2577
- ShellLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ShellLayoutComponent, selector: "lib-shell-layout", viewQueries: [{ propertyName: "dynamicComponentHosts", predicate: DynamicComponentHostDirective, descendants: true }], ngImport: i0, template: "<div *ngIf=\"loaded && (activeConfig.layout === 'Stacked' || !activeConfig.layout)\" [style.display]=\"!loaded ? 'none':'block'\" class=\"shell-container active-side-pane\">\r\n\r\n <div class=\"shell-header-container\" *ngIf=\"activeConfig.showHeader\">\r\n <div [class]=\"activeConfig.fluid ? 'shell-header-container-inner-fluid' : 'shell-header-container-inner'\">\r\n <ng-container *ngIf=\"activeConfig.customHeaderComponent\">\r\n <div appDynamicComponentHost =\"Header\"></div>\r\n </ng-container>\r\n <lib-shell-header *ngIf=\"!activeConfig.customHeaderComponent\" [show-userName]=\"activeConfig.showUserNameOnHeader\"\r\n [show-alerts]=\"activeConfig.showAlertsOnHeader\">\r\n </lib-shell-header>\r\n </div>\r\n </div>\r\n\r\n <main [class]=\"activeConfig.showHeader ? 'shell-content-container' : 'shell-content-container-no-header'\">\r\n <div [class]=\"activeConfig.fluid ? 'shell-content-container-inner-fluid' : 'shell-content-container-inner'\">\r\n <router-outlet *ngIf=\"loaded && (activeConfig.layout === 'Stacked' || !activeConfig.layout)\"></router-outlet>\r\n </div>\r\n </main>\r\n\r\n <div class=\"shell-footer-container\" *ngIf=\"activeConfig.showFooter\">\r\n <div [class]=\"activeConfig.fluid ? 'shell-footer-container-inner-fluid' : 'shell-footer-container-inner'\">\r\n <ng-container *ngIf=\"activeConfig.customFooterComponent\">\r\n <div appDynamicComponentHost hostName=\"Footer\"></div>\r\n </ng-container>\r\n <lib-shell-footer *ngIf=\"!activeConfig.customFooterComponent\"></lib-shell-footer>\r\n </div>\r\n </div>\r\n\r\n <lib-side-pane #rightPane>\r\n <router-outlet name=\"rightpane\" (activate)=\"rightPane.onSidePaneActivated($event)\" (deactivate)=\"rightPane.onSidePaneDeactivated($event)\"></router-outlet>\r\n </lib-side-pane>\r\n\r\n <lib-toaster-container></lib-toaster-container>\r\n</div>\r\n\r\n<!-- SIDEBAR LAYOUT -->\r\n\r\n<div *ngIf=\"loaded && activeConfig.layout === 'Sidebar'\" [style.display]=\"!loaded ? 'none':'block'\" class=\"sidebar shell-container active-side-pane\">\r\n\r\n <!-- Static sidebar for desktop -->\r\n <div class=\"hidden w-0 sm:w-64 flex-col inset-y-0 bg-gray-800\" [class.hidden]=\"hideSidebar\" [class.fixed]=\"!hideSidebar\">\r\n <lib-shell-sidebar [config]=\"activeConfig\" ></lib-shell-sidebar>\r\n </div>\r\n\r\n <div class=\"flex flex-col\" [class.pl-64]=\"!hideSidebar\">\r\n <div class=\"sticky top-0 z-10 flex-shrink-0 flex h-16 bg-gray-800\">\r\n\r\n <button type=\"button\" class=\"hidden sm:block px-4 border-0 text-white focus:outline-none\" (click)=\"hideSidebar = !hideSidebar\">\r\n <span class=\"sr-only\">Open sidebar</span>\r\n <!-- Heroicon name: outline/menu-alt-2 -->\r\n <svg class=\"h-6 w-6\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" aria-hidden=\"true\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4 6h16M4 12h16M4 18h7\" />\r\n </svg>\r\n </button>\r\n\r\n <button type=\"button\" class=\"block sm:hidden px-4 border-0 text-gray-200 focus:outline-none\" (click)=\"hideSidebar = !hideSidebar\">\r\n <span class=\"sr-only\">Open sidebar</span>\r\n <!-- Heroicon name: outline/menu-alt-2 --> 111\r\n <svg class=\"h-6 w-6\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" aria-hidden=\"true\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4 6h16M4 12h16M4 18h7\" />\r\n </svg>\r\n </button>\r\n\r\n <div class=\"flex-1\">\r\n <div class=\"shell-header-container\">\r\n <lib-shell-header [shell-layout]=\"activeConfig.layout\" [show-userName]=\"activeConfig.showUserNameOnHeader\" [show-alerts]=\"activeConfig.showAlertsOnHeader\"></lib-shell-header>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <main class=\"shell-content-container-sidebar\">\r\n <div class=\"shell-content-container-inner\">\r\n <router-outlet *ngIf=\"loaded && activeConfig.layout === 'Sidebar'\"></router-outlet>\r\n </div>\r\n </main>\r\n </div>\r\n\r\n <lib-side-pane #rightPane>\r\n <router-outlet name=\"rightpane\" (activate)=\"rightPane.onSidePaneActivated($event)\" (deactivate)=\"rightPane.onSidePaneDeactivated($event)\"></router-outlet>\r\n </lib-side-pane>\r\n\r\n <lib-toaster-container></lib-toaster-container>\r\n\r\n</div>\r\n", components: [{ type: ShellHeaderComponent, selector: "lib-shell-header", inputs: ["section-links", "profile-menu", "show-userName", "show-alerts", "shell-layout", "border"] }, { type: ShellFooterComponent, selector: "lib-shell-footer" }, { type: SidePaneComponent, selector: "lib-side-pane", inputs: ["visible"], outputs: ["onComplete"] }, { type: ToasterContainerComponent, selector: "lib-toaster-container" }, { type: ShellSidebarComponent, selector: "lib-shell-sidebar", inputs: ["section-links", "config"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: DynamicComponentHostDirective, selector: "[appDynamicComponentHost]", inputs: ["hostName"] }, { type: i1$1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }] });
2578
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShellLayoutComponent, decorators: [{
2579
- type: Component,
2580
- args: [{
2581
- // tslint:disable-next-line:component-selector
2582
- selector: 'lib-shell-layout',
2583
- templateUrl: './shell-layout.component.html',
2584
- }]
2585
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2586
- type: Inject,
2587
- args: [DOCUMENT]
2588
- }] }, { type: i1$1.Router }, { type: i1.Location }, { type: undefined, decorators: [{
2589
- type: Inject,
2590
- args: [SHELL_CONFIG]
2591
- }] }, { type: ComponentLoaderFactory }]; }, propDecorators: { dynamicComponentHosts: [{
2592
- type: ViewChildren,
2593
- args: [DynamicComponentHostDirective]
2594
- }] } });
2595
-
2596
- class ViewLayoutComponent {
2597
- constructor(route$, router$) {
2598
- this.route$ = route$;
2599
- this.router$ = router$;
2600
- // tslint:disable-next-line:no-input-rename
2601
- this.header = true;
2602
- this.fluid = false;
2603
- this.title = 'no title';
2604
- this.icon = null;
2605
- this.actions = null;
2606
- this.busy = false;
2607
- // tslint:disable-next-line:no-input-rename
2608
- this.searchPlaceholder = 'αναζήτηση';
2609
- this.view = null;
2610
- // tslint:disable-next-line:no-input-rename
2611
- this.metaItems = [];
2612
- // tslint:disable-next-line:no-output-on-prefix
2613
- this.onAction = new EventEmitter();
2614
- // tslint:disable-next-line:no-output-on-prefix
2615
- this.onSearch = new EventEmitter();
2616
- }
2617
- ngOnInit() {
2618
- var _a;
2619
- if ((_a = this.searchInput$) === null || _a === void 0 ? void 0 : _a.nativeElement) {
2620
- fromEvent(this.searchInput$.nativeElement, 'keyup').pipe(map((event) => {
2621
- return event.target.value; // Get input value.
2622
- }), filter(inputValue => inputValue.length >= 3 || inputValue.length === 0),
2623
- // If character length greater than minimumSearchCharacters setting.
2624
- debounceTime(1000), // Time in milliseconds between key events.
2625
- distinctUntilChanged() // If previous query is different from current.
2626
- ).subscribe();
2627
- }
2628
- }
2629
- emitActionClick(action) {
2630
- this.onAction.emit(action);
2631
- }
2632
- routerLinkActionClick(action) {
2633
- // console.log('routerLinkActionClick', action);
2634
- if (action.outlet) {
2635
- this.router$.navigate(['', { outlets: { rightpane: action.link } }]);
2636
- }
2637
- else {
2638
- this.router$.navigate([action.link]);
2639
- }
2640
- }
2641
- searchActionClick(action, text) {
2642
- this.onSearch.emit(text);
2643
- }
2644
- searchActionType(text) {
2645
- var _a;
2646
- this.onSearch.emit((_a = this.searchInput$) === null || _a === void 0 ? void 0 : _a.nativeElement.value);
2647
- }
2648
- handleClear(event) {
2649
- var _a;
2650
- console.log('handle clear!!!');
2651
- event.stopPropagation();
2652
- this.onSearch.emit((_a = event.target) === null || _a === void 0 ? void 0 : _a.value);
2653
- }
2654
- switchViewActionClick(action) {
2655
- // console.log('switchViewActionClick', action);
2656
- this.view = action.param;
2657
- if (action && action.param) {
2658
- this.router$.navigate([], { queryParams: { view: action.param }, queryParamsHandling: 'merge', skipLocationChange: false });
2659
- }
2660
- }
2661
- }
2662
- ViewLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ViewLayoutComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component });
2663
- ViewLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ViewLayoutComponent, selector: "lib-view-layout", inputs: { header: ["show-header", "header"], fluid: "fluid", title: "title", icon: "icon", actions: "actions", busy: "busy", searchPlaceholder: ["search-placeholder", "searchPlaceholder"], view: "view", metaItems: ["meta-items", "metaItems"] }, outputs: { onAction: "onAction", onSearch: "onSearch" }, viewQueries: [{ propertyName: "searchInput$", first: true, predicate: ["search"], descendants: true }], ngImport: i0, template: "<header *ngIf=\"header\" class=\"view-layout-paddings\">\r\n\r\n <div class=\"view-layout-title-container\">\r\n\r\n <div class=\"view-layout-title-container-inner\">\r\n <div class=\"flex items-center\">\r\n <i *ngIf=\"icon\" [class]=\"icon + ' title-icon'\" aria-hidden=\"true\"></i>\r\n <h1 [class]=\"busy ? 'view-layout-title-busy' : 'view-layout-title'\">{{title}}</h1>\r\n </div>\r\n <div *ngIf=\"metaItems && metaItems.length > 0\" class=\"meta-container\">\r\n <ng-container *ngFor=\"let meta of metaItems\">\r\n <div class=\"meta-item-container\">\r\n <i *ngIf=\"meta.icon\" [class]=\"meta.icon + ' meta-icon'\" aria-hidden=\"true\"></i>\r\n <span class=\"meta-text\">{{meta.text}}</span>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n\r\n <div class=\"flex items-center justify-end\">\r\n <ng-container *ngFor=\"let action of actions\" [ngSwitch]=\"action.type\">\r\n\r\n <ng-container *ngSwitchCase=\"'switch-view'\">\r\n <button [disabled]=\"view === action.param\" type=\"button\" href=\"#\" class=\"ml-1 disabled:opacity-50 btn-view-header\" (click)=\"switchViewActionClick(action)\">\r\n <span class=\"inline-block relative\">\r\n <i [class]=\"action.icon\"></i>\r\n <span *ngIf=\"view === action.param\" class=\"selected-view-indicator\"></span>\r\n </span>\r\n </button>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'search'\">\r\n <label for=\"search\" class=\"sr-only\">Search</label>\r\n <div class=\"search-container\">\r\n <div class=\"pointer-events-none absolute inset-y-0 left-0 pl-3 flex items-center\">\r\n <!--<svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <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\" />\r\n </svg>-->\r\n </div>\r\n <input id=\"search\" #search class=\"search-input\" [placeholder]=\"searchPlaceholder\"\r\n type=\"search\" name=\"search\" (input)=\"searchActionType(search.value)\" (onsearch)=\"handleClear($event)\">\r\n </div>\r\n <button type=\"button\" href=\"#\" class=\"btn-view-header rounded-l-none\" [title]=\"action.tooltip\" (click)=\"searchActionClick(action, search.value)\">\r\n <i [class]=\"action.icon\"></i>\r\n </button>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'router-link'\">\r\n <button type=\"button\" href=\"#\" class=\"ml-1 btn-view-header\" [title]=\"action.tooltip\" (click)=\"routerLinkActionClick(action)\">\r\n <i [class]=\"action.icon\"></i>\r\n </button>\r\n </ng-container>\r\n\r\n\r\n <ng-container *ngSwitchDefault>\r\n <button type=\"button\" class=\"ml-1 btn-view-header\" [title]=\"action.tooltip\" (click)=\"emitActionClick(action)\">\r\n <i [class]=\"action.icon\"></i>\r\n </button>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</header>\r\n\r\n<!-- component -->\r\n<div [class]=\"fluid ? 'view-container-fluid' : 'view-container'\">\r\n <ng-content></ng-content>\r\n</div>\r\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
2664
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ViewLayoutComponent, decorators: [{
2665
- type: Component,
2666
- args: [{
2667
- selector: 'lib-view-layout',
2668
- templateUrl: './view-layout.component.html'
2669
- }]
2670
- }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }]; }, propDecorators: { searchInput$: [{
2671
- type: ViewChild,
2672
- args: ['search']
2673
- }], header: [{
2674
- type: Input,
2675
- args: ['show-header']
2676
- }], fluid: [{
2677
- type: Input
2678
- }], title: [{
2679
- type: Input
2680
- }], icon: [{
2681
- type: Input
2682
- }], actions: [{
2683
- type: Input
2684
- }], busy: [{
2685
- type: Input
2686
- }], searchPlaceholder: [{
2687
- type: Input,
2688
- args: ['search-placeholder']
2689
- }], view: [{
2690
- type: Input
2691
- }], metaItems: [{
2692
- type: Input,
2693
- args: ['meta-items']
2694
- }], onAction: [{
2695
- type: Output
2696
- }], onSearch: [{
2697
- type: Output
2698
- }] } });
2699
-
2700
- class ModelViewLayoutComponent {
2701
- constructor(location) {
2702
- this.location = location;
2703
- this.showRightPaneSM = false;
2704
- this.title = 'no title';
2705
- // tslint:disable-next-line:no-input-rename
2706
- this.primary = null;
2707
- // tslint:disable-next-line:no-input-rename
2708
- this.secondary = null;
2709
- // tslint:disable-next-line:no-input-rename
2710
- this.metaItems = [
2711
- // { key: 'test', icon: Icons.Badges, text: 'βρέθηκαν 200 αποτελέσματα' }
2712
- ];
2713
- }
2714
- ngOnInit() {
2715
- }
2716
- onSidePaneActivated($event) {
2717
- this.showRightPaneSM = true;
2718
- }
2719
- onSidePaneDeactivated($event) {
2720
- this.showRightPaneSM = false;
2721
- }
2722
- closeSidePane() {
2723
- this.location.back();
2724
- }
2725
- }
2726
- ModelViewLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModelViewLayoutComponent, deps: [{ token: i1.Location }], target: i0.ɵɵFactoryTarget.Component });
2727
- ModelViewLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ModelViewLayoutComponent, selector: "lib-model-view-layout", inputs: { title: "title", primary: ["primary-links", "primary"], secondary: ["secondary-links", "secondary"], metaItems: ["meta-items", "metaItems"] }, ngImport: i0, template: "<lib-view-layout [title]=\"title\" [meta-items]=\"metaItems\">\r\n <main class=\"model-view-container\">\r\n <div class=\"model-view-container-inner\">\r\n <aside class=\"model-view-aside\">\r\n <section aria-labelledby=\"menu\" class=\"details-view-aside-header-section\">\r\n <div class=\"model-view-aside-header-container\">\r\n <div class=\"model-view-aside-header-container-inner\">\r\n <ng-content></ng-content>\r\n </div>\r\n <!-- menu items -->\r\n <div class=\"model-view-menu-container\">\r\n <nav class=\"model-view-menu-nav\">\r\n <div class=\"model-view-menu-item\">\r\n <ng-container *ngFor=\"let section of primary\">\r\n <a href=\"#\"\r\n [routerLinkActive]=\"['view-nav-link-active']\"\r\n [routerLink]=\"section.link\"\r\n class=\"view-nav-link\">\r\n {{section.text}}\r\n </a>\r\n </ng-container>\r\n </div>\r\n <div class=\"model-view-menu-item-far\">\r\n <ng-container *ngFor=\"let section of secondary\">\r\n <a href=\"#\"\r\n [routerLinkActive]=\"['view-nav-link-active']\"\r\n [routerLinkActiveOptions]=\"{ exact: true }\"\r\n [routerLink]=\"section.link\"\r\n class=\"view-nav-link\">\r\n {{section.text}}\r\n </a>\r\n </ng-container>\r\n </div>\r\n </nav>\r\n </div>\r\n </div>\r\n </section>\r\n </aside>\r\n <div class=\"model-view-details-container\">\r\n <router-outlet></router-outlet>\r\n </div>\r\n </div>\r\n </main>\r\n", components: [{ type: ViewLayoutComponent, selector: "lib-view-layout", inputs: ["show-header", "fluid", "title", "icon", "actions", "busy", "search-placeholder", "view", "meta-items"], outputs: ["onAction", "onSearch"] }], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i1$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], exportAs: ["routerLinkActive"] }, { type: i1$1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }] });
2728
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModelViewLayoutComponent, decorators: [{
2729
- type: Component,
2730
- args: [{
2731
- // tslint:disable-next-line:component-selector
2732
- selector: 'lib-model-view-layout',
2733
- templateUrl: './model-view-layout.component.html'
2734
- }]
2735
- }], ctorParameters: function () { return [{ type: i1.Location }]; }, propDecorators: { title: [{
2736
- type: Input
2737
- }], primary: [{
2738
- type: Input,
2739
- args: ['primary-links']
2740
- }], secondary: [{
2741
- type: Input,
2742
- args: ['secondary-links']
2743
- }], metaItems: [{
2744
- type: Input,
2745
- args: ['meta-items']
2746
- }] } });
2747
-
2748
- class SideViewLayoutComponent {
2749
- constructor(location, router) {
2750
- this.location = location;
2751
- this.router = router;
2752
- this.title = 'Πληροφορίες';
2753
- this.showActions = true;
2754
- this.disabled = false;
2755
- // tslint:disable-next-line:no-input-rename
2756
- this.okLabel = 'Αποθήκευση';
2757
- // tslint:disable-next-line:no-input-rename
2758
- this.okShow = true;
2759
- // tslint:disable-next-line:no-input-rename
2760
- this.closeOnOk = true;
2761
- // tslint:disable-next-line:no-input-rename
2762
- this.cancelLabel = 'Ακύρωση';
2763
- // tslint:disable-next-line:no-input-rename
2764
- this.cancelShow = true;
2765
- // tslint:disable-next-line:no-input-rename
2766
- this.forceLocationBack = false;
2767
- // @Output() close = new EventEmitter<any>();
2768
- this.cancel = new EventEmitter();
2769
- this.ok = new EventEmitter();
2770
- }
2771
- ngOnInit() {
2772
- }
2773
- closeSidePane() {
2774
- if (this.returnPath) {
2775
- this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => this.router.navigateByUrl(this.returnPath || '/'));
2776
- }
2777
- else {
2778
- if ((this.router.url.split('/(')[0] !== this.router.url) && !this.forceLocationBack) {
2779
- this.router.navigateByUrl(this.router.url.split('/(')[0]);
2780
- }
2781
- else if ((this.router.url.split('(')[0] !== this.router.url) && !this.forceLocationBack) {
2782
- this.router.navigateByUrl(this.router.url.split('(')[0]);
2783
- }
2784
- else {
2785
- this.location.back();
2786
- }
2787
- }
2788
- }
2789
- emitClose() {
2790
- this.cancel.emit(false);
2791
- this.closeSidePane();
2792
- }
2793
- emitCancel() {
2794
- this.cancel.emit(false);
2795
- this.closeSidePane();
2796
- }
2797
- emitOK() {
2798
- this.ok.emit(true);
2799
- if (this.closeOnOk) {
2800
- this.closeSidePane();
2801
- }
2802
- }
2803
- }
2804
- SideViewLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SideViewLayoutComponent, deps: [{ token: i1.Location }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component });
2805
- SideViewLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SideViewLayoutComponent, selector: "lib-side-view-layout", inputs: { title: "title", showActions: "showActions", disabled: "disabled", returnPath: ["return-path", "returnPath"], okLabel: ["ok-label", "okLabel"], okShow: ["ok-show", "okShow"], closeOnOk: ["ok-close-dialog", "closeOnOk"], cancelLabel: ["cancel-label", "cancelLabel"], cancelShow: ["cancel-show", "cancelShow"], forceLocationBack: ["force-location-back", "forceLocationBack"] }, outputs: { cancel: "cancel", ok: "ok" }, ngImport: i0, template: "<div class=\"side-view-layout-size-box\">\r\n <div class=\"side-view-layout-container\">\r\n <div class=\"side-view-layout-container-inner\">\r\n <div class=\"side-view-layout-header-margins\">\r\n <div class=\"side-view-layout-header-container\">\r\n <h2 class=\"side-view-layout-header-title\" id=\"slide-over-title\">\r\n {{title}}\r\n </h2>\r\n <div class=\"side-view-layout-close-button-container\">\r\n <button (click)=\"emitClose()\" class=\"side-view-layout-close-button\">\r\n <span class=\"sr-only\">Close panel</span>\r\n <!-- Heroicon name: outline/x -->\r\n <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\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"side-view-layout-content-container\">\r\n <!-- Replace with your content -->\r\n <ng-content></ng-content>\r\n <!-- /End replace -->\r\n </div>\r\n </div>\r\n <div *ngIf=\"showActions\" class=\"side-view-layout-actions-container\">\r\n <button *ngIf=\"cancelShow\" (click)=\"emitCancel()\" type=\"button\" class=\"side-view-layout-action-button-cancel\">\r\n {{cancelLabel}}\r\n </button>\r\n <button *ngIf=\"okShow\" (click)=\"emitOK()\" class=\"side-view-layout-action-button-submit\" [disabled]=\"disabled\">\r\n {{okLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2806
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SideViewLayoutComponent, decorators: [{
2807
- type: Component,
2808
- args: [{
2809
- selector: 'lib-side-view-layout',
2810
- templateUrl: './side-view-layout.component.html'
2811
- }]
2812
- }], ctorParameters: function () { return [{ type: i1.Location }, { type: i1$1.Router }]; }, propDecorators: { title: [{
2813
- type: Input
2814
- }], showActions: [{
2815
- type: Input
2816
- }], disabled: [{
2817
- type: Input
2818
- }], returnPath: [{
2819
- type: Input,
2820
- args: ['return-path']
2821
- }], okLabel: [{
2822
- type: Input,
2823
- args: ['ok-label']
2824
- }], okShow: [{
2825
- type: Input,
2826
- args: ['ok-show']
2827
- }], closeOnOk: [{
2828
- type: Input,
2829
- args: ['ok-close-dialog']
2830
- }], cancelLabel: [{
2831
- type: Input,
2832
- args: ['cancel-label']
2833
- }], cancelShow: [{
2834
- type: Input,
2835
- args: ['cancel-show']
2836
- }], forceLocationBack: [{
2837
- type: Input,
2838
- args: ['force-location-back']
2839
- }], cancel: [{
2840
- type: Output
2841
- }], ok: [{
2842
- type: Output
2843
- }] } });
2844
-
2845
- class FormLayoutComponent {
2846
- constructor(router$) {
2847
- this.router$ = router$;
2848
- this.title = null;
2849
- // tslint:disable-next-line:no-input-rename
2850
- this.searchPlaceholder = 'αναζήτηση';
2851
- this.actions = null;
2852
- // tslint:disable-next-line:no-input-rename
2853
- this.subTitle = null;
2854
- // tslint:disable-next-line:no-output-on-prefix
2855
- this.onAction = new EventEmitter();
2856
- // tslint:disable-next-line:no-output-on-prefix
2857
- this.onSearch = new EventEmitter();
2858
- this.onComplete = new EventEmitter();
2859
- }
2860
- ngOnInit() {
2861
- var _a;
2862
- if ((_a = this.searchInput$) === null || _a === void 0 ? void 0 : _a.nativeElement) {
2863
- fromEvent(this.searchInput$.nativeElement, 'keyup').pipe(map((event) => {
2864
- return event.target.value; // Get input value.
2865
- }), filter(inputValue => inputValue.length >= 3 || inputValue.length === 0),
2866
- // If character length greater than minimumSearchCharacters setting.
2867
- debounceTime(1000), // Time in milliseconds between key events.
2868
- distinctUntilChanged() // If previous query is different from current.
2869
- ).subscribe();
2870
- }
2871
- }
2872
- onSidePaneDeactivated($event) {
2873
- this.onComplete.emit(true);
2874
- }
2875
- emitActionClick(action) {
2876
- this.onAction.emit(action);
2877
- }
2878
- searchActionClick(action, text) {
2879
- this.onSearch.emit(text);
2880
- }
2881
- searchActionType(text) {
2882
- var _a;
2883
- this.onSearch.emit((_a = this.searchInput$) === null || _a === void 0 ? void 0 : _a.nativeElement.value);
2884
- }
2885
- routerLinkActionClick(action, relative = false) {
2886
- if (action.outlet) {
2887
- this.router$.navigate(['', { outlets: { formRightPane: action.link } }]);
2888
- }
2889
- else {
2890
- this.router$.navigate([action.link]);
2891
- }
2892
- }
2893
- }
2894
- FormLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FormLayoutComponent, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component });
2895
- FormLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FormLayoutComponent, selector: "lib-form-layout", inputs: { title: "title", searchPlaceholder: ["search-placeholder", "searchPlaceholder"], actions: "actions", subTitle: ["sub-title", "subTitle"] }, outputs: { onAction: "onAction", onSearch: "onSearch", onComplete: "onComplete" }, viewQueries: [{ propertyName: "searchInput$", first: true, predicate: ["search"], descendants: true }], ngImport: i0, template: "<div class=\"form-layout-container\">\r\n <div class=\"form-header\" *ngIf=\"title || subTitle || actions\">\r\n <div class=\"form-header-inner\">\r\n <h3 class=\"form-title\">\r\n {{ title }}\r\n </h3>\r\n <p class=\"form-subtitle\">\r\n {{ subTitle }}\r\n </p>\r\n </div>\r\n <div class=\"form-header-actions\">\r\n <ng-container *ngFor=\"let action of actions\" [ngSwitch]=\"action.type\">\r\n <ng-container *ngSwitchCase=\"'search'\">\r\n <label for=\"search\" class=\"sr-only\">Search</label>\r\n <div class=\"search-container\">\r\n <div class=\"pointer-events-none absolute inset-y-0 left-0 pl-3 flex items-center\">\r\n <!--<svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <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\" />\r\n </svg>-->\r\n </div>\r\n <input id=\"search\"\r\n #search\r\n class=\"form-search-input\"\r\n [placeholder]=\"searchPlaceholder\"\r\n type=\"search\"\r\n name=\"search\"\r\n (input)=\"searchActionType(search.value)\">\r\n </div>\r\n <button type=\"button\"\r\n href=\"#\"\r\n class=\"btn-form-view-header-search\"\r\n [title]=\"action.tooltip\"\r\n (click)=\"searchActionClick(action, search.value)\">\r\n <i [class]=\"action.icon\"></i>\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'router-link'\">\r\n <button type=\"button\"\r\n href=\"#\"\r\n class=\"ml-1 btn-form-view-header\"\r\n [title]=\"action.tooltip\"\r\n (click)=\"routerLinkActionClick(action)\">\r\n <i [class]=\"action.icon\"></i>\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <button type=\"button\"\r\n class=\"ml-1 btn-form-view-header\"\r\n [title]=\"action.tooltip\"\r\n (click)=\"emitActionClick(action)\">\r\n <i [class]=\"action.icon\"></i>\r\n </button>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <div class=\"form-content-container\">\r\n <div [ngClass]=\"{'form-content-container-inner': actions}\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n <lib-side-pane #formPane (onComplete)=\"onSidePaneDeactivated($event)\">\r\n <router-outlet name=\"formRightPane\"\r\n (activate)=\"formPane.onSidePaneActivated($event)\"\r\n (deactivate)=\"formPane.onSidePaneDeactivated($event)\"></router-outlet>\r\n </lib-side-pane>\r\n</div>\r\n", components: [{ type: SidePaneComponent, selector: "lib-side-pane", inputs: ["visible"], outputs: ["onComplete"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }] });
2896
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FormLayoutComponent, decorators: [{
2897
- type: Component,
2898
- args: [{
2899
- selector: 'lib-form-layout',
2900
- templateUrl: './form-layout.component.html'
2901
- }]
2902
- }], ctorParameters: function () { return [{ type: i1$1.Router }]; }, propDecorators: { searchInput$: [{
2903
- type: ViewChild,
2904
- args: ['search']
2905
- }], title: [{
2906
- type: Input
2907
- }], searchPlaceholder: [{
2908
- type: Input,
2909
- args: ['search-placeholder']
2910
- }], actions: [{
2911
- type: Input
2912
- }], subTitle: [{
2913
- type: Input,
2914
- args: ['sub-title']
2915
- }], onAction: [{
2916
- type: Output
2917
- }], onSearch: [{
2918
- type: Output
2919
- }], onComplete: [{
2920
- type: Output
2921
- }] } });
2922
-
2923
- class AuthCallbackComponent {
2924
- constructor(authService, router) {
2925
- this.authService = authService;
2926
- this.router = router;
2927
- this.status = 'παρακαλώ περιμένετε...';
2928
- }
2929
- ngOnInit() {
2930
- this.authService.signinRedirectCallback().subscribe((user) => {
2931
- var _a;
2932
- if (user) {
2933
- debugger;
2934
- this.router.navigateByUrl(((_a = user.state) === null || _a === void 0 ? void 0 : _a.url) || '/');
2935
- }
2936
- });
2937
- }
2938
- }
2939
- AuthCallbackComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthCallbackComponent, deps: [{ token: AuthService }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component });
2940
- AuthCallbackComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AuthCallbackComponent, selector: "lib-auth-callback", ngImport: i0, template: "<lib-view-layout [title]=\"status\" [busy]=\"true\"></lib-view-layout>", components: [{ type: ViewLayoutComponent, selector: "lib-view-layout", inputs: ["show-header", "fluid", "title", "icon", "actions", "busy", "search-placeholder", "view", "meta-items"], outputs: ["onAction", "onSearch"] }] });
2941
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthCallbackComponent, decorators: [{
2942
- type: Component,
2943
- args: [{
2944
- selector: 'lib-auth-callback',
2945
- templateUrl: './auth-callback.component.html'
2946
- }]
2947
- }], ctorParameters: function () { return [{ type: i2.AuthService, decorators: [{
2948
- type: Inject,
2949
- args: [AuthService]
2950
- }] }, { type: i1$1.Router }]; } });
2951
-
2952
- class AuthRenewComponent {
2953
- constructor(authService, router) {
2954
- this.authService = authService;
2955
- this.router = router;
2956
- }
2957
- ngOnInit() {
2958
- this.authService.signinSilentCallback().subscribe(user => {
2959
- if (!user) {
2960
- this.router.navigate(['/unauthorized']);
2961
- }
2962
- });
2963
- }
2964
- }
2965
- AuthRenewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthRenewComponent, deps: [{ token: AuthService }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component });
2966
- AuthRenewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AuthRenewComponent, selector: "lib-auth-renew", ngImport: i0, template: '', isInline: true });
2967
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthRenewComponent, decorators: [{
2968
- type: Component,
2969
- args: [{
2970
- selector: 'lib-auth-renew',
2971
- template: ''
2972
- }]
2973
- }], ctorParameters: function () { return [{ type: i2.AuthService, decorators: [{
2974
- type: Inject,
2975
- args: [AuthService]
2976
- }] }, { type: i1$1.Router }]; } });
2977
-
2978
- class LoggedOutComponent {
2979
- constructor(authService) {
2980
- this.authService = authService;
2981
- this.status = 'working on it, please give me a sec...';
2982
- this.finished = false;
2983
- }
2984
- ngOnInit() {
2985
- this.authService.removeUser().subscribe(() => {
2986
- this.status = 'Thank you!';
2987
- this.finished = true;
2988
- });
2989
- }
2990
- }
2991
- LoggedOutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LoggedOutComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component });
2992
- LoggedOutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LoggedOutComponent, selector: "lib-logged-out", ngImport: i0, template: "<lib-view-layout title=\"\u0388\u03C7\u03B5\u03C4\u03B5 \u03B1\u03C0\u03BF\u03C3\u03C5\u03BD\u03B4\u03B5\u03B8\u03B5\u03AF \u03BC\u03B5 \u03B5\u03C0\u03B9\u03C4\u03C5\u03C7\u03AF\u03B1!\"></lib-view-layout>", components: [{ type: ViewLayoutComponent, selector: "lib-view-layout", inputs: ["show-header", "fluid", "title", "icon", "actions", "busy", "search-placeholder", "view", "meta-items"], outputs: ["onAction", "onSearch"] }] });
2993
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LoggedOutComponent, decorators: [{
2994
- type: Component,
2995
- args: [{
2996
- // tslint:disable-next-line:component-selector
2997
- selector: 'lib-logged-out',
2998
- templateUrl: './logged-out.component.html'
2999
- }]
3000
- }], ctorParameters: function () { return [{ type: i2.AuthService, decorators: [{
3001
- type: Inject,
3002
- args: [AuthService]
3003
- }] }]; } });
3004
-
3005
- class ErrorComponent {
3006
- constructor() {
3007
- this.error = 'Error!';
3008
- }
3009
- ngOnInit() {
3010
- }
3011
- }
3012
- ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3013
- ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ErrorComponent, selector: "lib-error", ngImport: i0, template: "<lib-view-layout [show-header]=\"false\" title=\"500 - \u03C0\u03B1\u03C1\u03BF\u03C5\u03C3\u03B9\u03AC\u03C3\u03C4\u03B7\u03BA\u03B5 \u03C3\u03C6\u03AC\u03BB\u03BC\u03B1!\">\r\n <div class=\"bg-gray-600 view-container\">\r\n <div class=\"max-w-2xl mx-auto text-center py-16 px-4 sm:py-20 sm:px-6 lg:px-8\">\r\n <h2 class=\"text-3xl font-extrabold text-white sm:text-4xl\">\r\n <span class=\"block\">500</span>\r\n </h2>\r\n <p class=\"mt-4 text-lg leading-6 text-gray-200\">\u03C3\u03C6\u03AC\u03BB\u03BC\u03B1, \u03BA\u03B1\u03C4\u03B9 \u03B4\u03B5\u03BD \u03C0\u03AE\u03B3\u03B5 \u03BA\u03B1\u03BB\u03AC...!</p>\r\n <a href=\"/\" class=\"mt-8 inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-sm rounded-sm text-gray-600 bg-white hover:bg-gray-50 sm:w-auto\">\r\n \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03B5\u03B4\u03CE \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B5\u03C0\u03B9\u03C3\u03C4\u03C1\u03AD\u03C8\u03B5\u03C4\u03B5\r\n </a>\r\n </div>\r\n </div>\r\n</lib-view-layout>\r\n", components: [{ type: ViewLayoutComponent, selector: "lib-view-layout", inputs: ["show-header", "fluid", "title", "icon", "actions", "busy", "search-placeholder", "view", "meta-items"], outputs: ["onAction", "onSearch"] }] });
3014
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponent, decorators: [{
3015
- type: Component,
3016
- args: [{
3017
- selector: 'lib-error',
3018
- templateUrl: './error.component.html'
3019
- }]
3020
- }] });
3021
-
3022
- class PageNotFoundComponent {
3023
- constructor() { }
3024
- ngOnInit() {
3025
- }
3026
- }
3027
- PageNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PageNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3028
- PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PageNotFoundComponent, selector: "lib-page-not-found", ngImport: i0, template: "<lib-view-layout [show-header]=\"false\" title=\"404 - \u03B4\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B5!\">\r\n <div class=\"text-gray-900\">\r\n <div class=\"max-w-4xl mx-auto text-center py-16 px-4 sm:py-20 sm:px-6 lg:px-8\">\r\n <h2 class=\"text-3xl font-extrabold sm:text-4xl\">\r\n <span class=\"block\">404</span>\r\n </h2>\r\n <p class=\"mt-4 text-lg leading-6 text-gray-800\">\u03B4\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B5 \u03B7 \u03C3\u03B5\u03BB\u03AF\u03B4\u03B1 \u03C0\u03BF\u03C5 \u03B6\u03B7\u03C4\u03AE\u03C3\u03B1\u03C4\u03B5!</p>\r\n <a href=\"/\"\r\n class=\"mt-8 inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-sm rounded-sm text-gray-600 bg-white hover:bg-gray-50 sm:w-auto\">\r\n \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03B5\u03B4\u03CE \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B5\u03C0\u03B9\u03C3\u03C4\u03C1\u03AD\u03C8\u03B5\u03C4\u03B5\r\n </a>\r\n </div>\r\n </div>\r\n</lib-view-layout>\r\n", components: [{ type: ViewLayoutComponent, selector: "lib-view-layout", inputs: ["show-header", "fluid", "title", "icon", "actions", "busy", "search-placeholder", "view", "meta-items"], outputs: ["onAction", "onSearch"] }] });
3029
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PageNotFoundComponent, decorators: [{
3030
- type: Component,
3031
- args: [{
3032
- selector: 'lib-page-not-found',
3033
- templateUrl: './page-not-found.component.html'
3034
- }]
3035
- }], ctorParameters: function () { return []; } });
3036
-
3037
- class UnauthorizedComponent {
3038
- constructor() { }
3039
- ngOnInit() { }
3040
- }
3041
- UnauthorizedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UnauthorizedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3042
- UnauthorizedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UnauthorizedComponent, selector: "lib-unauthorized", ngImport: i0, template: "<lib-view-layout [show-header]=\"false\" title=\"401 - \u03B4\u03B5\u03BD \u03B5\u03C0\u03B9\u03C4\u03C1\u03AD\u03C0\u03B5\u03C4\u03B1\u03B9 \u03B7 \u03C0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03B7!\">\r\n <div class=\"bg-gray-600 view-container\">\r\n <div class=\"max-w-2xl mx-auto text-center py-16 px-4 sm:py-20 sm:px-6 lg:px-8\">\r\n <h2 class=\"text-3xl font-extrabold text-white sm:text-4xl\">\r\n <span class=\"block\">401</span>\r\n </h2>\r\n <p class=\"mt-4 text-lg leading-6 text-gray-200\">\u03B4\u03B5\u03BD \u03AD\u03C7\u03B5\u03C4\u03B5 \u03C4\u03B1 \u03BA\u03B1\u03C4\u03AC\u03BB\u03BB\u03B7\u03BB\u03B1 \u03B4\u03B9\u03BA\u03B1\u03B9\u03CE\u03BC\u03B1\u03C4\u03B1 \u03C0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03B7\u03C2!</p>\r\n <a href=\"/\" class=\"mt-8 inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-sm rounded-sm text-gray-600 bg-white hover:bg-gray-50 sm:w-auto\">\r\n \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03B5\u03B4\u03CE \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B5\u03C0\u03B9\u03C3\u03C4\u03C1\u03AD\u03C8\u03B5\u03C4\u03B5\r\n </a>\r\n </div>\r\n </div>\r\n </lib-view-layout>\r\n\r\n\r\n", components: [{ type: ViewLayoutComponent, selector: "lib-view-layout", inputs: ["show-header", "fluid", "title", "icon", "actions", "busy", "search-placeholder", "view", "meta-items"], outputs: ["onAction", "onSearch"] }] });
3043
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UnauthorizedComponent, decorators: [{
3044
- type: Component,
3045
- args: [{
3046
- selector: 'lib-unauthorized',
3047
- templateUrl: './unauthorized.component.html'
3048
- }]
3049
- }], ctorParameters: function () { return []; } });
3050
-
3051
- class AddressPipe {
3052
- transform(value) {
3053
- if (value === undefined || null || '') {
3054
- return '';
3055
- }
3056
- // tslint:disable-next-line:no-non-null-assertion
3057
- return `${value.street || ''}${value.streetNumber ? ' ' + value.streetNumber : ''}${value.city ? ', ' + value.city : ''}${+value.postalCode ? ', ' + +value.postalCode : ''}`;
3058
- }
3059
- }
3060
- AddressPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AddressPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3061
- AddressPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AddressPipe, name: "address", pure: false });
3062
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AddressPipe, decorators: [{
3063
- type: Pipe,
3064
- args: [{
3065
- name: 'address',
3066
- pure: false
3067
- }]
3068
- }] });
3069
-
3070
- class DurationFormatPipe {
3071
- transform(value, arg1, arg2) {
3072
- let days;
3073
- let seconds;
3074
- let minutes;
3075
- let hours;
3076
- if (arg1 === 'ms' && arg2 === 'hhmmss') {
3077
- seconds = Math.floor((value / 1000) % 60);
3078
- minutes = Math.floor(((value / (1000 * 60)) % 60));
3079
- hours = Math.floor((value / (1000 * 60 * 60)));
3080
- return this.format(arg2, seconds, minutes, hours, days);
3081
- }
3082
- else if (arg1 === 's' && arg2 === 'hhmmss') {
3083
- seconds = Math.floor((value % 60));
3084
- minutes = Math.floor(((value / 60) % 60));
3085
- hours = Math.floor(((value / 60) / 60));
3086
- return this.format(arg2, seconds, minutes, hours, days);
3087
- }
3088
- else if (arg1 === 'ms' && (arg2 === 'ddhhmmss' || arg2 === 'ddhhmmssLong')) {
3089
- seconds = Math.floor(((value / 1000) % 60));
3090
- minutes = Math.floor((value / (1000 * 60) % 60));
3091
- hours = Math.floor((value / (1000 * 60 * 60) % 24));
3092
- days = Math.floor((value / (1000 * 60 * 60 * 24)));
3093
- return this.format(arg2, seconds, minutes, hours, days);
3094
- }
3095
- else if (arg1 === 's' && (arg2 === 'ddhhmmss' || arg2 === 'ddhhmmssLong')) {
3096
- seconds = Math.floor(value % 60);
3097
- minutes = Math.floor(((value / 60) % 60));
3098
- hours = Math.floor(((value / 60) / 60) % 24);
3099
- days = Math.floor((((value / 60) / 60) / 24));
3100
- return this.format(arg2, seconds, minutes, hours, days);
3101
- }
3102
- else {
3103
- return value;
3104
- }
3105
- }
3106
- format(arg2, seconds, minutes, hours, days) {
3107
- (days < 10) ? days = '0' + days : days;
3108
- (hours < 10) ? hours = '0' + hours : hours;
3109
- (minutes < 10) ? minutes = '0' + minutes : minutes;
3110
- (seconds < 10) ? seconds = '0' + seconds : seconds;
3111
- switch (arg2) {
3112
- case 'hhmmss':
3113
- return `${hours}:${minutes}:${seconds}`;
3114
- case 'ddhhmmss':
3115
- return `${days}d, ${hours}h, ${minutes}m, ${seconds}s`;
3116
- case 'ddhhmmssLong':
3117
- return `${days} days, ${hours} hours, ${minutes} minutes, ${seconds} seconds`;
3118
- }
3119
- return undefined;
3120
- }
3121
- }
3122
- DurationFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DurationFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3123
- DurationFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DurationFormatPipe, name: "durationFormat", pure: false });
3124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DurationFormatPipe, decorators: [{
3125
- type: Pipe,
3126
- args: [{
3127
- name: 'durationFormat',
3128
- pure: false
3129
- }]
3130
- }] });
3131
-
3132
- class BaseListComponent {
3133
- constructor(route$, router$) {
3134
- this.route$ = route$;
3135
- this.router$ = router$;
3136
- this.items = null;
3137
- this.view = ListViewType.Tiles;
3138
- this.title = null;
3139
- this.actions = [];
3140
- this.loaderItems = [1, 2, 3, 4, 5];
3141
- this.page = 1;
3142
- this.pageSize = 20;
3143
- this.count = 0;
3144
- this.sort = '';
3145
- this.sortdir = '';
3146
- this.search = '';
3147
- this.sortOptions = [];
3148
- this.metaItems = [];
3149
- }
3150
- ngOnDestroy() {
3151
- if (this.routeSub$) {
3152
- this.routeSub$.unsubscribe();
3153
- }
3154
- }
3155
- getViewActions() {
3156
- const actions = [
3157
- new ViewAction('search', null, null, Icons.Search, 'αναζήτηση'),
3158
- new ViewAction('refresh', null, null, Icons.Refresh, 'ανανέωση στοιχείων')
3159
- ];
3160
- if (this.newItemLink) {
3161
- actions.push(new RouterViewAction(Icons.Add, this.newItemLink, 'rightpane', 'προσθήκη νέας εγγραφής;'));
3162
- }
3163
- return of(actions);
3164
- }
3165
- ngOnInit() {
3166
- this.getViewActions().subscribe(actions => {
3167
- this.actions = actions || [];
3168
- });
3169
- this.metaItems = [
3170
- { key: 'count', icon: Icons.ItemsCount, text: 'παρακαλώ περιμένετε...' }
3171
- ];
3172
- // disabled external route changes monitoring due to sync issues - which is bad :) - refresh from url will not work
3173
- // until i come up with a solution...
3174
- this.routeSub$ = this.route$.queryParamMap.subscribe(params => {
3175
- if (params.keys.length === 0) {
3176
- return;
3177
- }
3178
- // changing the view mode does not require reloading...
3179
- this.view = params.get('view') || ListViewType.Tiles;
3180
- // console.log('route changes ', this.view);
3181
- if (params.get('search') !== null && params.get('search') !== this.search) {
3182
- this.searchChanged(params.get('search'));
3183
- }
3184
- const page = +(params.get('page') || 1);
3185
- if (page !== this.page) {
3186
- this.page = page;
3187
- }
3188
- const size = +(params.get('pagesize') || 20);
3189
- if (this.pageSize !== size) {
3190
- this.pageSize = size;
3191
- }
3192
- if (params.get('search') !== this.search) {
3193
- this.search = params.get('search');
3194
- }
3195
- if (params.get('sort') !== this.sort) {
3196
- this.sort = params.get('sort');
3197
- }
3198
- if (params.get('dir') !== this.sortdir) {
3199
- this.sortdir = params.get('dir');
3200
- }
3201
- });
3202
- // just to sync params in query
3203
- this.setRouteParams(true);
3204
- this.load();
3205
- }
3206
- setRouteParams(locationChange = false) {
3207
- console.log(this.sortdir);
3208
- this.router$.navigate([], {
3209
- relativeTo: this.route$, queryParams: {
3210
- view: this.view,
3211
- page: this.page,
3212
- pagesize: this.pageSize,
3213
- search: this.search,
3214
- sort: this.sort,
3215
- dir: this.sortdir
3216
- }, queryParamsHandling: 'merge', skipLocationChange: locationChange
3217
- });
3218
- }
3219
- actionHandler($event) {
3220
- // console.log('BaseListComponent actionHandler', $event);
3221
- if ($event.key === 'refresh') {
3222
- this.refresh();
3223
- }
3224
- }
3225
- load() {
3226
- // console.log('BaseListComponent LOAD');
3227
- this.count = 0;
3228
- this.items = null;
3229
- this.loadItems().subscribe(result => {
3230
- this.count = result ? result.count : 0;
3231
- this.items = result === null || result === void 0 ? void 0 : result.items;
3232
- this.updateHeaderMeta();
3233
- }, err => {
3234
- this.count = 0;
3235
- this.items = null;
3236
- this.updateHeaderMeta();
3237
- });
3238
- }
3239
- updateHeaderMeta() {
3240
- var _a;
3241
- const count = (_a = this.metaItems) === null || _a === void 0 ? void 0 : _a.filter(m => m.key === 'count')[0];
3242
- if (count) {
3243
- this.count === 1 ? count.text = `${this.count} αποτέλεσμα` : count.text = `${this.count} αποτελέσματα`;
3244
- }
3245
- }
3246
- clear() {
3247
- this.count = 0;
3248
- this.page = 1;
3249
- this.items = null;
3250
- this.search = null;
3251
- this.setRouteParams();
3252
- this.load();
3253
- }
3254
- refresh() {
3255
- this.count = 0;
3256
- this.page = 1;
3257
- this.items = null;
3258
- this.setRouteParams();
3259
- this.load();
3260
- }
3261
- pageChanged(page) {
3262
- if (this.page !== page) {
3263
- this.page = page;
3264
- this.setRouteParams();
3265
- this.load();
3266
- }
3267
- }
3268
- pageSizeChanged(pageSize) {
3269
- if (this.pageSize !== pageSize) {
3270
- this.pageSize = pageSize;
3271
- this.page = 1;
3272
- this.setRouteParams();
3273
- this.refresh();
3274
- }
3275
- }
3276
- sortChanged(sort) {
3277
- // console.log('base-list sortChanged', sort);
3278
- if (this.sort !== sort) {
3279
- this.page = 1;
3280
- this.sort = sort;
3281
- this.setRouteParams();
3282
- this.refresh();
3283
- }
3284
- }
3285
- sortdirChanged(sortdir) {
3286
- if (this.sortdir !== sortdir) {
3287
- this.page = 1;
3288
- this.sortdir = sortdir;
3289
- this.setRouteParams();
3290
- this.refresh();
3291
- }
3292
- }
3293
- searchChanged(searchText) {
3294
- this.count = 0;
3295
- this.page = 1;
3296
- this.items = null;
3297
- this.search = searchText;
3298
- this.setRouteParams();
3299
- this.load();
3300
- }
3301
- }
3302
- BaseListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseListComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component });
3303
- BaseListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseListComponent, selector: "ng-component", ngImport: i0, template: '', isInline: true });
3304
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseListComponent, decorators: [{
3305
- type: Component,
3306
- args: [{ template: '' }]
3307
- }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }]; } });
3308
-
3309
- const cssClassNames = {
3310
- backdrop: 'modal-backdrop',
3311
- show: 'show',
3312
- fade: 'fade',
3313
- modalOpen: 'modal-open'
3314
- };
3315
- const animationTime = {
3316
- backdrop: 150,
3317
- modal: 300,
3318
- };
3319
-
3320
- /**
3321
- * Background layer for modals.
3322
- * Override class name to theme it.
3323
- * @see {@link cssClassNames}
3324
- * @internal
3325
- */
3326
- class ModalBackdropComponent {
3327
- constructor(element, renderer) {
3328
- this.element = element;
3329
- this.renderer = renderer;
3330
- this.animationsEnabled = false;
3331
- }
3332
- ngOnInit() {
3333
- if (this.animationsEnabled) {
3334
- this.renderer.addClass(this.element.nativeElement, cssClassNames.fade);
3335
- this.reflow(this.element.nativeElement);
3336
- }
3337
- this.renderer.addClass(this.element.nativeElement, cssClassNames.show);
3338
- }
3339
- hide() {
3340
- this.renderer.removeClass(this.element.nativeElement, cssClassNames.show);
3341
- setTimeout(() => { var _a; return (_a = this.backdropLoader) === null || _a === void 0 ? void 0 : _a.hide(); }, this.animationsEnabled ? animationTime.backdrop : 0);
3342
- }
3343
- reflow(element) {
3344
- ((bs) => bs)(element.offsetHeight);
3345
- }
3346
- }
3347
- ModalBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalBackdropComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
3348
- ModalBackdropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ModalBackdropComponent, selector: "lib-modal-backdrop", host: { classAttribute: "modal-backdrop" }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
3349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalBackdropComponent, decorators: [{
3350
- type: Component,
3351
- args: [{
3352
- selector: 'lib-modal-backdrop',
3353
- encapsulation: ViewEncapsulation.None,
3354
- template: '',
3355
- host: {
3356
- class: cssClassNames.backdrop,
3357
- },
3358
- }]
3359
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
3360
-
3361
- /**
3362
- * Modals option can be passed to a specific modal from {@link ModalService.show} or
3363
- * set globbaly using the injection token {@link MODAL_CONFIG_DEFAULT_OVERRIDE}.
3364
- * @remarks
3365
- * Modal specific options are merged with global options.
3366
- * @see {@link modalConfigDefaults} for defaults.
3367
- * @public
3368
- */
3369
- class ModalOptions {
3370
- }
3371
- ModalOptions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalOptions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3372
- ModalOptions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalOptions });
3373
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalOptions, decorators: [{
3374
- type: Injectable
3375
- }] });
3376
- /**
3377
- * Default option values.
3378
- */
3379
- const modalConfigDefaults = {
3380
- backdrop: true,
3381
- keyboard: true,
3382
- show: false,
3383
- ignoreBackdropClick: false,
3384
- class: '',
3385
- animated: true,
3386
- initialState: {},
3387
- closeInterceptor: void 0,
3388
- };
3389
- /**
3390
- * Use this injection token to set global options.
3391
- */
3392
- const MODAL_CONFIG_DEFAULT_OVERRIDE = new InjectionToken('override-default-config');
3393
-
3394
- /**
3395
- * Modal container component.
3396
- * @remarks
3397
- * All dynamic content `TemplateRef` or `Component` case will be drawn inside this.
3398
- * You can override css classes to theme it {@link cssClassNames}
3399
- * @internal
3400
- */
3401
- class ModalContainerComponent {
3402
- constructor(options, _element, renderer) {
3403
- this._element = _element;
3404
- this.renderer = renderer;
3405
- this.isShown = false;
3406
- this.animationsEnabled = false;
3407
- this.isModalHiding = false;
3408
- this.clickStartedInContent = false;
3409
- this.config = Object.assign({}, options);
3410
- }
3411
- ngOnInit() {
3412
- if (this.animationsEnabled) {
3413
- this.renderer.addClass(this._element.nativeElement, cssClassNames.fade);
3414
- }
3415
- this.renderer.setStyle(this._element.nativeElement, 'display', 'block');
3416
- setTimeout(() => {
3417
- this.isShown = true;
3418
- this.renderer.addClass(this._element.nativeElement, cssClassNames.show);
3419
- }, this.animationsEnabled ? animationTime.backdrop : 0);
3420
- if (this._element.nativeElement) {
3421
- this._element.nativeElement.focus();
3422
- }
3423
- }
3424
- onClickStarted(event) {
3425
- this.clickStartedInContent = event.target !== this._element.nativeElement;
3426
- }
3427
- onClickStop(event) {
3428
- const clickedInBackdrop = event.target === this._element.nativeElement && !this.clickStartedInContent;
3429
- if (this.config.ignoreBackdropClick || this.config.backdrop === 'static' || !clickedInBackdrop) {
3430
- this.clickStartedInContent = false;
3431
- return;
3432
- }
3433
- this.hide();
3434
- }
3435
- onPopState() {
3436
- this.hide();
3437
- }
3438
- onEsc(event) {
3439
- var _a;
3440
- if (!this.isShown) {
3441
- return;
3442
- }
3443
- if (event.keyCode === 27 || event.key === 'Escape' || event.key === 'Esc') {
3444
- event.preventDefault();
3445
- }
3446
- if (this.config.keyboard && this.config.id === ((_a = this.modalService) === null || _a === void 0 ? void 0 : _a.getActiveModal().config.id)) {
3447
- this.hide();
3448
- }
3449
- }
3450
- ngOnDestroy() {
3451
- if (this.isShown) {
3452
- this._hide();
3453
- }
3454
- }
3455
- hide(result) {
3456
- if (this.isModalHiding || !this.isShown) {
3457
- return;
3458
- }
3459
- if (this.config.closeInterceptor) {
3460
- this.config.closeInterceptor().then(() => this._hide(), () => undefined);
3461
- return;
3462
- }
3463
- this._hide(result);
3464
- }
3465
- _hide(result) {
3466
- this.isModalHiding = true;
3467
- this.renderer.removeClass(this._element.nativeElement, cssClassNames.show);
3468
- setTimeout(() => {
3469
- var _a;
3470
- this.isShown = false;
3471
- (_a = this.modalService) === null || _a === void 0 ? void 0 : _a.hide(this.config.id, result);
3472
- this.isModalHiding = false;
3473
- }, this.animationsEnabled ? animationTime.modal : 0);
3474
- }
3475
- }
3476
- ModalContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalContainerComponent, deps: [{ token: ModalOptions }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
3477
- ModalContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ModalContainerComponent, selector: "lib-modal-container", host: { attributes: { "role": "dialog", "tabindex": "-1" }, listeners: { "mousedown": "onClickStarted($event)", "click": "onClickStop($event)", "window:popstate": "onPopState()", "window:keydown.esc": "onEsc($event)" }, properties: { "attr.aria-modal": "true", "attr.aria-labelledby": "config.ariaLabelledBy", "attr.aria-describedby": "config.ariaDescribedby" }, classAttribute: "modal" }, ngImport: i0, template: `
3478
- <div [class]="'modal-dialog' + (config.class ? ' ' + config.class : '')" role="document" focusTrap>
3479
- <div class="modal-content">
3480
- <ng-content></ng-content>
3481
- </div>
3482
- </div>
3483
- `, isInline: true });
3484
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalContainerComponent, decorators: [{
3485
- type: Component,
3486
- args: [{
3487
- selector: 'lib-modal-container',
3488
- template: `
3489
- <div [class]="'modal-dialog' + (config.class ? ' ' + config.class : '')" role="document" focusTrap>
3490
- <div class="modal-content">
3491
- <ng-content></ng-content>
3492
- </div>
3493
- </div>
3494
- `,
3495
- host: {
3496
- class: 'modal',
3497
- role: 'dialog',
3498
- tabindex: '-1',
3499
- '[attr.aria-modal]': 'true',
3500
- '[attr.aria-labelledby]': 'config.ariaLabelledBy',
3501
- '[attr.aria-describedby]': 'config.ariaDescribedby',
3502
- },
3503
- }]
3504
- }], ctorParameters: function () { return [{ type: ModalOptions }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { onClickStarted: [{
3505
- type: HostListener,
3506
- args: ['mousedown', ['$event']]
3507
- }], onClickStop: [{
3508
- type: HostListener,
3509
- args: ['click', ['$event']]
3510
- }], onPopState: [{
3511
- type: HostListener,
3512
- args: ['window:popstate']
3513
- }], onEsc: [{
3514
- type: HostListener,
3515
- args: ['window:keydown.esc', ['$event']]
3516
- }] } });
3517
-
3518
- /**
3519
- * Modal class.
3520
- * @remarks
3521
- * This is returned from {@link ModalService.show}.
3522
- * @public
3523
- */
3524
- class Modal {
3525
- constructor() {
3526
- /**
3527
- * Hides the modal
3528
- * @param result - A result to the observers.
3529
- */
3530
- this.hide = () => void 0;
3531
- /**
3532
- * Sets new class to modal window.
3533
- */
3534
- this.setClass = () => void 0;
3535
- }
3536
- }
3537
- Modal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Modal, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3538
- Modal.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Modal });
3539
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Modal, decorators: [{
3540
- type: Injectable
3541
- }] });
3542
-
3543
- /**
3544
- * A service for using modals.
3545
- *
3546
- * @public
3547
- */
3548
- class ModalService {
3549
- constructor(clf, rendererFactory, document, modalDefaultOption) {
3550
- this.clf = clf;
3551
- this.document = document;
3552
- this.onBeforeShow = new Subject();
3553
- this.onShown = new Subject();
3554
- this.onBeforeHide = new Subject();
3555
- this.onHidden = new Subject();
3556
- this.loaders = [];
3557
- this.modalsCount = 0;
3558
- this.initialPadding = '0px';
3559
- this.backdropLoader = this.clf.createLoader();
3560
- this.defaultConfig = Object.assign(Object.assign({}, modalConfigDefaults), modalDefaultOption);
3561
- this.renderer = rendererFactory.createRenderer(null, null);
3562
- }
3563
- ngOnDestroy() {
3564
- this.loaders.forEach((loader) => { var _a; return (_a = loader.instance) === null || _a === void 0 ? void 0 : _a.hide(); });
3565
- }
3566
- /**
3567
- * Opens a new modal.
3568
- *
3569
- * @param content - `Component` or `TemplateRef` type.
3570
- * @param config - Specific {@link ModalOptions | options} for this modal. Global and specific options are merged.
3571
- * @returns An instance of {@link Modal}
3572
- */
3573
- show(content, config) {
3574
- this.modalsCount++;
3575
- const combinedConfig = Object.assign(Object.assign({}, this.defaultConfig), config);
3576
- combinedConfig.id = (config === null || config === void 0 ? void 0 : config.id) || new Date().getUTCMilliseconds();
3577
- this.createLoaders();
3578
- this.addBodyPadding();
3579
- if (this.modalsCount === 1) {
3580
- this.renderer.addClass(this.document.body, cssClassNames.modalOpen);
3581
- }
3582
- this.showBackdrop(combinedConfig);
3583
- return this.showModal(content, combinedConfig);
3584
- }
3585
- /**
3586
- * Hide an active modal.
3587
- * @param id - Id of modal to hide. If not provided all active modals are hidden.
3588
- * @param result - A result to be sent to observers.
3589
- */
3590
- hide(id, result) {
3591
- if (this.modalsCount === 1 || id == null) {
3592
- this.hideBackdrop();
3593
- this.revertScrollbar();
3594
- this.renderer.removeClass(this.document.body, cssClassNames.modalOpen);
3595
- }
3596
- this.modalsCount = this.modalsCount >= 1 && id != null ? this.modalsCount - 1 : 0;
3597
- setTimeout(() => {
3598
- this.hideModal(id, result);
3599
- this.removeLoaders(id);
3600
- },
3601
- //Bug
3602
- //Should use combined config but for the moment is not possible to pass it this parameter.
3603
- //If config is an instance variable then every newly opened modal will override the config
3604
- //resulting in opened modals to get a new configuration
3605
- this.defaultConfig.animated ? animationTime.backdrop : 0);
3606
- }
3607
- getActiveModal() {
3608
- return this.loaders[this.modalsCount - 1].instance;
3609
- }
3610
- showModal(content, combinedConfig) {
3611
- var _a;
3612
- const modalLoader = this.loaders[this.loaders.length - 1];
3613
- if (combinedConfig && combinedConfig.providers) {
3614
- combinedConfig.providers.forEach((provider) => modalLoader.provide(provider));
3615
- }
3616
- const modal = new Modal();
3617
- const modalContainerRef = modalLoader
3618
- .provide({ provide: ModalOptions, useValue: combinedConfig })
3619
- .provide({ provide: Modal, useValue: modal })
3620
- .attach(ModalContainerComponent)
3621
- .to('body');
3622
- modal.setClass = (newClass) => {
3623
- if (modalContainerRef.instance) {
3624
- modalContainerRef.instance.config.class = newClass;
3625
- }
3626
- };
3627
- modal.onBeforeHide = new Subject();
3628
- modal.onHidden = new Subject();
3629
- this.copyEvent(modalLoader.onBeforeHide, modal.onBeforeHide);
3630
- this.copyEvent(modalLoader.onHidden, modal.onHidden);
3631
- modalContainerRef.show({
3632
- content,
3633
- animationsEnabled: combinedConfig.animated,
3634
- initialState: combinedConfig.initialState,
3635
- modalService: this,
3636
- id: combinedConfig.id,
3637
- });
3638
- if (modalContainerRef.instance) {
3639
- modalContainerRef.instance.level = this.modalsCount;
3640
- modal.content = modalLoader.getInnerComponent();
3641
- modal.id = (_a = modalContainerRef.instance.config) === null || _a === void 0 ? void 0 : _a.id;
3642
- modal.hide = (res) => { var _a; return (_a = modalContainerRef.instance) === null || _a === void 0 ? void 0 : _a.hide(res); };
3643
- }
3644
- return modal;
3645
- }
3646
- hideModal(id, result) {
3647
- if (id != null) {
3648
- const indexToRemove = this.loaders.findIndex((loader) => { var _a; return ((_a = loader.instance) === null || _a === void 0 ? void 0 : _a.config.id) === id; });
3649
- const modalLoader = this.loaders[indexToRemove];
3650
- if (modalLoader) {
3651
- modalLoader.hide(id, result);
3652
- }
3653
- }
3654
- else {
3655
- this.loaders.forEach((loader) => {
3656
- if (loader.instance) {
3657
- loader.hide(loader.instance.config.id);
3658
- }
3659
- });
3660
- }
3661
- }
3662
- showBackdrop(combinedConfig) {
3663
- const isBackdropEnabled = combinedConfig.backdrop === true || combinedConfig.backdrop === 'static';
3664
- const isBackdropInDOM = this.backdropRef != null;
3665
- if (isBackdropEnabled && !isBackdropInDOM) {
3666
- this.backdropLoader
3667
- .attach(ModalBackdropComponent)
3668
- .to('body')
3669
- .show({ animationsEnabled: combinedConfig.animated, backdropLoader: this.backdropLoader });
3670
- this.backdropRef = this.backdropLoader.componentRef;
3671
- }
3672
- }
3673
- hideBackdrop() {
3674
- if (!this.backdropRef) {
3675
- return;
3676
- }
3677
- this.backdropRef.instance.hide();
3678
- this.backdropRef = void 0;
3679
- }
3680
- removeLoaders(id) {
3681
- if (id != null) {
3682
- const indexToRemove = this.loaders.findIndex((loader) => { var _a; return ((_a = loader.instance) === null || _a === void 0 ? void 0 : _a.config.id) === id; });
3683
- if (indexToRemove >= 0) {
3684
- this.loaders.splice(indexToRemove, 1);
3685
- this.loaders.forEach((loader, i) => {
3686
- if (loader.instance) {
3687
- loader.instance.level = i + 1;
3688
- }
3689
- });
3690
- }
3691
- }
3692
- else {
3693
- this.loaders.splice(0, this.loaders.length);
3694
- }
3695
- }
3696
- addBodyPadding() {
3697
- if (this.modalsCount === 1) {
3698
- const width = this.getScrollbarWidth();
3699
- if (this.isScrollBarPresent(width)) {
3700
- this.initialPadding = this.document.body.style.paddingRight;
3701
- const actualPadding = parseFloat(window.getComputedStyle(this.document.body).paddingRight);
3702
- this.document.body.style.paddingRight = `${actualPadding + width}px`;
3703
- }
3704
- }
3705
- }
3706
- revertScrollbar() {
3707
- this.document.body.style.paddingRight = this.initialPadding;
3708
- }
3709
- getScrollbarWidth() {
3710
- const measurer = this.document.createElement('div');
3711
- measurer.className = 'modal-scrollbar-measure';
3712
- const body = this.document.body;
3713
- body.appendChild(measurer);
3714
- const width = measurer.getBoundingClientRect().width - measurer.clientWidth;
3715
- body.removeChild(measurer);
3716
- return width;
3717
- }
3718
- isScrollBarPresent(scrollbarWidth) {
3719
- const rect = this.document.body.getBoundingClientRect();
3720
- const bodyToViewportGap = window.innerWidth - (rect.left + rect.right);
3721
- const uncertainty = 0.1 * scrollbarWidth;
3722
- return bodyToViewportGap >= scrollbarWidth - uncertainty;
3723
- }
3724
- createLoaders() {
3725
- const loader = this.clf.createLoader();
3726
- this.copyEvent(loader.onBeforeShow, this.onBeforeShow);
3727
- this.copyEvent(loader.onShown, this.onShown);
3728
- this.copyEvent(loader.onBeforeHide, this.onBeforeHide);
3729
- this.copyEvent(loader.onHidden, this.onHidden);
3730
- this.loaders.push(loader);
3731
- }
3732
- copyEvent(from, to) {
3733
- from.subscribe((data) => {
3734
- to.next(data);
3735
- });
3736
- }
3737
- }
3738
- ModalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalService, deps: [{ token: ComponentLoaderFactory }, { token: i0.RendererFactory2 }, { token: DOCUMENT }, { token: MODAL_CONFIG_DEFAULT_OVERRIDE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
3739
- ModalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalService });
3740
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ModalService, decorators: [{
3741
- type: Injectable
3742
- }], ctorParameters: function () { return [{ type: ComponentLoaderFactory }, { type: i0.RendererFactory2 }, { type: undefined, decorators: [{
3743
- type: Inject,
3744
- args: [DOCUMENT]
3745
- }] }, { type: ModalOptions, decorators: [{
3746
- type: Optional
3747
- }, {
3748
- type: Inject,
3749
- args: [MODAL_CONFIG_DEFAULT_OVERRIDE]
3750
- }] }]; } });
3751
-
3752
- class IndiceComponentsModule {
3753
- // tslint:disable-next-line:typedef
3754
- static forRoot() {
3755
- return {
3756
- ngModule: IndiceComponentsModule,
3757
- providers: [ToasterService]
3758
- };
3759
- }
3760
- }
3761
- IndiceComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IndiceComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3762
- IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IndiceComponentsModule, declarations: [
3763
- // Directives
3764
- ClickOutsideDirective,
3765
- DynamicComponentHostDirective,
3766
- // Controls
3767
- DropDownMenuComponent,
3768
- PagerComponent,
3769
- ListViewComponent,
3770
- ListColumnComponent,
3771
- ListTileComponent,
3772
- ListDetailsSectionComponent,
3773
- ListViewEmptyStateComponent,
3774
- SkeletonLoaderComponent,
3775
- CollapsiblePanelComponent,
3776
- KpiTileComponent,
3777
- SidePaneComponent,
3778
- DatepickerComponent,
3779
- AvatarInitialsComponent,
3780
- ToggleComponent,
3781
- ComboboxComponent,
3782
- // Toaster
3783
- ToasterContainerComponent,
3784
- ToasterComponent,
3785
- // Shell Layout
3786
- ShellLayoutComponent,
3787
- ShellHeaderComponent,
3788
- ShellFooterComponent,
3789
- // View Layouts
3790
- ViewLayoutComponent,
3791
- SideViewLayoutComponent,
3792
- ModelViewLayoutComponent,
3793
- FormLayoutComponent,
3794
- // Pages (common)
3795
- AuthCallbackComponent,
3796
- AuthRenewComponent,
3797
- LoggedOutComponent,
3798
- ErrorComponent,
3799
- PageNotFoundComponent,
3800
- UnauthorizedComponent,
3801
- // Pipes
3802
- AddressPipe,
3803
- DurationFormatPipe,
3804
- NavLinksListComponent,
3805
- NotificationsIndicatorComponent,
3806
- LanguageSelectionComponent,
3807
- UserProfileMenuComponent,
3808
- ShellSidebarComponent,
3809
- // Tab Group Component
3810
- LibTabComponent,
3811
- LibTabGroupComponent,
3812
- // Stepper Component
3813
- LibStepperComponent,
3814
- LibStepComponent,
3815
- LibStepLabelDirective,
3816
- LibStepInfoDirective], imports: [CommonModule,
3817
- RouterModule,
3818
- IndiceAuthModule], exports: [AddressPipe,
3819
- AuthCallbackComponent,
3820
- AuthRenewComponent,
3821
- AvatarInitialsComponent,
3822
- ClickOutsideDirective,
3823
- CollapsiblePanelComponent,
3824
- ComboboxComponent,
3825
- DatepickerComponent,
3826
- DropDownMenuComponent,
3827
- DurationFormatPipe,
3828
- ErrorComponent,
3829
- FormLayoutComponent,
3830
- KpiTileComponent,
3831
- LibStepComponent,
3832
- LibStepInfoDirective,
3833
- LibStepLabelDirective,
3834
- LibStepperComponent,
3835
- LibTabComponent,
3836
- LibTabGroupComponent,
3837
- ListColumnComponent,
3838
- ListDetailsSectionComponent,
3839
- ListTileComponent,
3840
- ListViewComponent,
3841
- ListViewEmptyStateComponent,
3842
- LoggedOutComponent,
3843
- ModelViewLayoutComponent,
3844
- PageNotFoundComponent,
3845
- PagerComponent,
3846
- ShellFooterComponent,
3847
- ShellHeaderComponent,
3848
- ShellLayoutComponent,
3849
- SidePaneComponent,
3850
- SideViewLayoutComponent,
3851
- SkeletonLoaderComponent,
3852
- ToasterComponent,
3853
- ToasterContainerComponent,
3854
- ToggleComponent,
3855
- UnauthorizedComponent,
3856
- ViewLayoutComponent] });
3857
- IndiceComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IndiceComponentsModule, imports: [[
3858
- CommonModule,
3859
- RouterModule,
3860
- IndiceAuthModule
3861
- ]] });
3862
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: IndiceComponentsModule, decorators: [{
3863
- type: NgModule,
3864
- args: [{
3865
- declarations: [
3866
- // Directives
3867
- ClickOutsideDirective,
3868
- DynamicComponentHostDirective,
3869
- // Controls
3870
- DropDownMenuComponent,
3871
- PagerComponent,
3872
- ListViewComponent,
3873
- ListColumnComponent,
3874
- ListTileComponent,
3875
- ListDetailsSectionComponent,
3876
- ListViewEmptyStateComponent,
3877
- SkeletonLoaderComponent,
3878
- CollapsiblePanelComponent,
3879
- KpiTileComponent,
3880
- SidePaneComponent,
3881
- DatepickerComponent,
3882
- AvatarInitialsComponent,
3883
- ToggleComponent,
3884
- ComboboxComponent,
3885
- // Toaster
3886
- ToasterContainerComponent,
3887
- ToasterComponent,
3888
- // Shell Layout
3889
- ShellLayoutComponent,
3890
- ShellHeaderComponent,
3891
- ShellFooterComponent,
3892
- // View Layouts
3893
- ViewLayoutComponent,
3894
- SideViewLayoutComponent,
3895
- ModelViewLayoutComponent,
3896
- FormLayoutComponent,
3897
- // Pages (common)
3898
- AuthCallbackComponent,
3899
- AuthRenewComponent,
3900
- LoggedOutComponent,
3901
- ErrorComponent,
3902
- PageNotFoundComponent,
3903
- UnauthorizedComponent,
3904
- // Pipes
3905
- AddressPipe,
3906
- DurationFormatPipe,
3907
- NavLinksListComponent,
3908
- NotificationsIndicatorComponent,
3909
- LanguageSelectionComponent,
3910
- UserProfileMenuComponent,
3911
- ShellSidebarComponent,
3912
- // Tab Group Component
3913
- LibTabComponent,
3914
- LibTabGroupComponent,
3915
- // Stepper Component
3916
- LibStepperComponent,
3917
- LibStepComponent,
3918
- LibStepLabelDirective,
3919
- LibStepInfoDirective
3920
- ],
3921
- imports: [
3922
- CommonModule,
3923
- RouterModule,
3924
- IndiceAuthModule
3925
- ],
3926
- exports: [
3927
- AddressPipe,
3928
- AuthCallbackComponent,
3929
- AuthRenewComponent,
3930
- AvatarInitialsComponent,
3931
- ClickOutsideDirective,
3932
- CollapsiblePanelComponent,
3933
- ComboboxComponent,
3934
- DatepickerComponent,
3935
- DropDownMenuComponent,
3936
- DurationFormatPipe,
3937
- ErrorComponent,
3938
- FormLayoutComponent,
3939
- KpiTileComponent,
3940
- LibStepComponent,
3941
- LibStepInfoDirective,
3942
- LibStepLabelDirective,
3943
- LibStepperComponent,
3944
- LibTabComponent,
3945
- LibTabGroupComponent,
3946
- ListColumnComponent,
3947
- ListDetailsSectionComponent,
3948
- ListTileComponent,
3949
- ListViewComponent,
3950
- ListViewEmptyStateComponent,
3951
- LoggedOutComponent,
3952
- ModelViewLayoutComponent,
3953
- PageNotFoundComponent,
3954
- PagerComponent,
3955
- ShellFooterComponent,
3956
- ShellHeaderComponent,
3957
- ShellLayoutComponent,
3958
- SidePaneComponent,
3959
- SideViewLayoutComponent,
3960
- SkeletonLoaderComponent,
3961
- ToasterComponent,
3962
- ToasterContainerComponent,
3963
- ToggleComponent,
3964
- UnauthorizedComponent,
3965
- ViewLayoutComponent
3966
- ]
3967
- }]
3968
- }] });
3969
-
3970
- // Public API Surface of @indice/ng-components
3971
-
3972
- /**
3973
- * Generated bundle index. Do not edit.
3974
- */
3975
-
3976
- export { APP_LANGUAGES, APP_LINKS, APP_NOTIFICATIONS, AddressPipe, AuthCallbackComponent, AuthRenewComponent, AvatarInitialsComponent, BaseListComponent, ClickOutsideDirective, CollapsiblePanelComponent, ComboboxComponent, ComponentLoaderFactory, DatepickerComponent, DefaultShellConfig, DropDownMenuComponent, DurationFormatPipe, ErrorComponent, ExternalNavLink, FormLayoutComponent, FragmentNavLink, HeaderMetaItem, Icons, IndiceComponentsModule, KpiTileComponent, LIBSTEPPER_ACCESSOR, LIBTABGROUP_ACCESSOR, LibStepComponent, LibStepInfoDirective, LibStepLabelDirective, LibStepperComponent, LibTabComponent, LibTabGroupComponent, ListColumnComponent, ListDetailsSectionComponent, ListTileComponent, ListViewComponent, ListViewEmptyStateComponent, ListViewType, LoggedOutComponent, MODAL_CONFIG_DEFAULT_OVERRIDE, MenuOption, Modal, ModalOptions, ModalService, ModelViewLayoutComponent, NULL_TOAST, NavLink, NavLinksListComponent, NotificationNavLink, PageNotFoundComponent, PagerComponent, PagerPosition, RouterViewAction, SCREEN_SIZE, SHELL_CONFIG, ShellFooterComponent, ShellHeaderComponent, ShellLayoutComponent, ShellLayoutType, SidePaneComponent, SidePaneOverlayType, SidePaneSize, SideViewLayoutComponent, SkeletonLoaderComponent, StepState, StepperType, SwitchViewAction, ToastType, ToasterComponent, ToasterContainerComponent, ToasterService, ToggleComponent, UnauthorizedComponent, ViewAction, ViewLayoutComponent };
3977
- //# sourceMappingURL=indice-ng-components.js.map