@kms-ngx-ui/presentational 0.0.23 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +28 -28
  2. package/{esm2015/kms-ngx-ui-presentational.js → esm2020/kms-ngx-ui-presentational.mjs} +4 -4
  3. package/{esm2015/lib/directives/directives.module.js → esm2020/lib/directives/directives.module.mjs} +40 -40
  4. package/{esm2015/lib/directives/mousewheel.directive.js → esm2020/lib/directives/mousewheel.directive.mjs} +56 -56
  5. package/{esm2015/lib/directives/sum-of-height.directive.js → esm2020/lib/directives/sum-of-height.directive.mjs} +74 -74
  6. package/{esm2015/lib/directives/swipe.directive.js → esm2020/lib/directives/swipe.directive.mjs} +183 -183
  7. package/esm2020/lib/directives/swipe.model.mjs +5 -0
  8. package/{esm2015/lib/directives/tooltip.directive.js → esm2020/lib/directives/tooltip.directive.mjs} +144 -144
  9. package/{esm2015/lib/kms-ngx-ui-presentational.component.js → esm2020/lib/kms-ngx-ui-presentational.component.mjs} +26 -26
  10. package/{esm2015/lib/kms-ngx-ui-presentational.module.js → esm2020/lib/kms-ngx-ui-presentational.module.mjs} +217 -217
  11. package/{esm2015/lib/kms-ngx-ui-presentational.service.js → esm2020/lib/kms-ngx-ui-presentational.service.mjs} +14 -14
  12. package/esm2020/lib/models/address.model.mjs +6 -0
  13. package/{esm2015/lib/models/iconSize.enum.js → esm2020/lib/models/iconSize.enum.mjs} +17 -17
  14. package/{esm2015/lib/models/image-snippet.model.js → esm2020/lib/models/image-snippet.model.mjs} +18 -18
  15. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +5 -5
  16. package/{esm2015/lib/models/is-value.function.js → esm2020/lib/models/is-value.function.mjs} +17 -17
  17. package/{esm2015/lib/models/salutation.enum.js → esm2020/lib/models/salutation.enum.mjs} +8 -8
  18. package/{esm2015/lib/models/types/attached-file-dto.model.js → esm2020/lib/models/types/attached-file-dto.model.mjs} +6 -6
  19. package/{esm2015/lib/models/types/nullable.type.js → esm2020/lib/models/types/nullable.type.mjs} +5 -5
  20. package/{esm2015/lib/parent-components/actions.component.js → esm2020/lib/parent-components/actions.component.mjs} +56 -56
  21. package/{esm2015/lib/parent-components/form-control.component.js → esm2020/lib/parent-components/form-control.component.mjs} +75 -75
  22. package/{esm2015/lib/parent-components/form.component.js → esm2020/lib/parent-components/form.component.mjs} +78 -78
  23. package/{esm2015/lib/pipes/custom-pipes.module.js → esm2020/lib/pipes/custom-pipes.module.mjs} +71 -71
  24. package/{esm2015/lib/pipes/decode-uri.pipe.js → esm2020/lib/pipes/decode-uri.pipe.mjs} +19 -19
  25. package/{esm2015/lib/pipes/encode-uri.pipe.js → esm2020/lib/pipes/encode-uri.pipe.mjs} +19 -19
  26. package/{esm2015/lib/pipes/integer-currency.pipe.js → esm2020/lib/pipes/integer-currency.pipe.mjs} +27 -27
  27. package/{esm2015/lib/pipes/safe-html.pipe.js → esm2020/lib/pipes/safe-html.pipe.mjs} +23 -23
  28. package/{esm2015/lib/pipes/safe-resource-url.pipe.js → esm2020/lib/pipes/safe-resource-url.pipe.mjs} +23 -23
  29. package/{esm2015/lib/pipes/safe-style.pipe.js → esm2020/lib/pipes/safe-style.pipe.mjs} +23 -23
  30. package/{esm2015/lib/pipes/safe-url.pipe.js → esm2020/lib/pipes/safe-url.pipe.mjs} +23 -23
  31. package/{esm2015/lib/pipes/to-number.pipe.js → esm2020/lib/pipes/to-number.pipe.mjs} +23 -23
  32. package/{esm2015/lib/pipes/trim.pipe.js → esm2020/lib/pipes/trim.pipe.mjs} +20 -20
  33. package/{esm2015/lib/pipes/typeof.pipe.js → esm2020/lib/pipes/typeof.pipe.mjs} +16 -16
  34. package/{esm2015/lib/services/viewport.service.js → esm2020/lib/services/viewport.service.mjs} +216 -216
  35. package/esm2020/lib/ui/back-to-top/back-to-top.component.mjs +49 -0
  36. package/{esm2015/lib/ui/button-with-confirm-dialog/button-response-types.enum.js → esm2020/lib/ui/button-with-confirm-dialog/button-response-types.enum.mjs} +6 -6
  37. package/esm2020/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.mjs +58 -0
  38. package/{esm2015/lib/ui/button-with-confirm-dialog/dialog-data.model.js → esm2020/lib/ui/button-with-confirm-dialog/dialog-data.model.mjs} +2 -2
  39. package/esm2020/lib/ui/checkbox/checkbox.component.mjs +71 -0
  40. package/esm2020/lib/ui/color-input/color-input.component.mjs +76 -0
  41. package/esm2020/lib/ui/dropdown-from-data/dropdown-from-data.component.mjs +165 -0
  42. package/esm2020/lib/ui/enum-radiogroup/enum-radiogroup.component.mjs +53 -0
  43. package/esm2020/lib/ui/file-input/file-input.component.mjs +232 -0
  44. package/esm2020/lib/ui/flyout/flyout.component.mjs +119 -0
  45. package/esm2020/lib/ui/generic-dialog/generic-dialog.component.mjs +54 -0
  46. package/esm2020/lib/ui/icon/icon.component.mjs +48 -0
  47. package/{esm2015/lib/ui/icon/iconSize.enum.js → esm2020/lib/ui/icon/iconSize.enum.mjs} +17 -17
  48. package/esm2020/lib/ui/image-slider/image-slider.component.mjs +189 -0
  49. package/esm2020/lib/ui/kms-accordion-item/kms-accordion-item.component.mjs +40 -0
  50. package/esm2020/lib/ui/loader/loader.component.mjs +21 -0
  51. package/esm2020/lib/ui/map/map.component.mjs +116 -0
  52. package/esm2020/lib/ui/radiobutton/radiobutton.component.mjs +73 -0
  53. package/esm2020/lib/ui/salutation-dropdown/salutation-dropdown.component.mjs +55 -0
  54. package/esm2020/lib/ui/salutation-radiogroup/salutation-radiogroup.component.mjs +49 -0
  55. package/esm2020/lib/ui/time-input/time-input.component.mjs +83 -0
  56. package/esm2020/lib/ui/tooltip/tooltip.component.mjs +16 -0
  57. package/esm2020/lib/ui/tooltip-icon/tooltip-icon.component.mjs +35 -0
  58. package/esm2020/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.mjs +82 -0
  59. package/{esm2015/public-api.js → esm2020/public-api.mjs} +49 -49
  60. package/fesm2015/kms-ngx-ui-presentational.mjs +3019 -0
  61. package/fesm2015/kms-ngx-ui-presentational.mjs.map +1 -0
  62. package/{fesm2015/kms-ngx-ui-presentational.js → fesm2020/kms-ngx-ui-presentational.mjs} +2869 -2958
  63. package/fesm2020/kms-ngx-ui-presentational.mjs.map +1 -0
  64. package/kms-ngx-ui-presentational.d.ts +5 -5
  65. package/lib/directives/directives.module.d.ts +11 -11
  66. package/lib/directives/mousewheel.directive.d.ts +15 -15
  67. package/lib/directives/sum-of-height.directive.d.ts +31 -31
  68. package/lib/directives/swipe.directive.d.ts +45 -45
  69. package/lib/directives/swipe.model.d.ts +49 -49
  70. package/lib/directives/tooltip.directive.d.ts +29 -29
  71. package/lib/kms-ngx-ui-presentational.component.d.ts +8 -8
  72. package/lib/kms-ngx-ui-presentational.module.d.ts +47 -47
  73. package/lib/kms-ngx-ui-presentational.service.d.ts +6 -6
  74. package/lib/models/address.model.d.ts +14 -14
  75. package/lib/models/iconSize.enum.d.ts +15 -15
  76. package/lib/models/image-snippet.model.d.ts +15 -15
  77. package/lib/models/index.d.ts +4 -4
  78. package/lib/models/is-value.function.d.ts +9 -9
  79. package/lib/models/salutation.enum.d.ts +5 -5
  80. package/lib/models/types/attached-file-dto.model.d.ts +11 -11
  81. package/lib/models/types/nullable.type.d.ts +4 -4
  82. package/lib/parent-components/actions.component.d.ts +31 -31
  83. package/lib/parent-components/form-control.component.d.ts +27 -27
  84. package/lib/parent-components/form.component.d.ts +34 -34
  85. package/lib/pipes/custom-pipes.module.d.ts +17 -17
  86. package/lib/pipes/decode-uri.pipe.d.ts +10 -10
  87. package/lib/pipes/encode-uri.pipe.d.ts +10 -10
  88. package/lib/pipes/integer-currency.pipe.d.ts +13 -13
  89. package/lib/pipes/safe-html.pipe.d.ts +13 -13
  90. package/lib/pipes/safe-resource-url.pipe.d.ts +13 -13
  91. package/lib/pipes/safe-style.pipe.d.ts +13 -13
  92. package/lib/pipes/safe-url.pipe.d.ts +13 -13
  93. package/lib/pipes/to-number.pipe.d.ts +10 -10
  94. package/lib/pipes/trim.pipe.d.ts +10 -10
  95. package/lib/pipes/typeof.pipe.d.ts +7 -7
  96. package/lib/services/viewport.service.d.ts +74 -74
  97. package/lib/ui/back-to-top/back-to-top.component.d.ts +10 -10
  98. package/lib/ui/button-with-confirm-dialog/button-response-types.enum.d.ts +4 -4
  99. package/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.d.ts +19 -19
  100. package/lib/ui/button-with-confirm-dialog/dialog-data.model.d.ts +9 -9
  101. package/lib/ui/checkbox/checkbox.component.d.ts +31 -31
  102. package/lib/ui/color-input/color-input.component.d.ts +19 -19
  103. package/lib/ui/dropdown-from-data/dropdown-from-data.component.d.ts +55 -55
  104. package/lib/ui/enum-radiogroup/enum-radiogroup.component.d.ts +17 -17
  105. package/lib/ui/file-input/file-input.component.d.ts +89 -89
  106. package/lib/ui/flyout/flyout.component.d.ts +32 -32
  107. package/lib/ui/generic-dialog/generic-dialog.component.d.ts +26 -26
  108. package/lib/ui/icon/icon.component.d.ts +42 -42
  109. package/lib/ui/icon/iconSize.enum.d.ts +15 -15
  110. package/lib/ui/image-slider/image-slider.component.d.ts +62 -62
  111. package/lib/ui/kms-accordion-item/kms-accordion-item.component.d.ts +22 -22
  112. package/lib/ui/loader/loader.component.d.ts +9 -9
  113. package/lib/ui/map/map.component.d.ts +69 -69
  114. package/lib/ui/radiobutton/radiobutton.component.d.ts +26 -26
  115. package/lib/ui/salutation-dropdown/salutation-dropdown.component.d.ts +17 -17
  116. package/lib/ui/salutation-radiogroup/salutation-radiogroup.component.d.ts +15 -15
  117. package/lib/ui/time-input/time-input.component.d.ts +22 -22
  118. package/lib/ui/tooltip/tooltip.component.d.ts +6 -6
  119. package/lib/ui/tooltip-icon/tooltip-icon.component.d.ts +13 -13
  120. package/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.d.ts +27 -27
  121. package/package.json +25 -12
  122. package/public-api.d.ts +45 -45
  123. package/src/lib/ui/back-to-top/back-to-top.component.scss +46 -46
  124. package/src/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.scss +2 -2
  125. package/src/lib/ui/checkbox/checkbox.component.scss +48 -48
  126. package/src/lib/ui/color-input/color-input.component.scss +38 -38
  127. package/src/lib/ui/file-input/file-input.component.scss +2 -2
  128. package/src/lib/ui/flyout/flyout.component.scss +34 -34
  129. package/src/lib/ui/generic-dialog/generic-dialog.component.scss +59 -59
  130. package/src/lib/ui/icon/icon.component.scss +148 -148
  131. package/src/lib/ui/image-slider/image-slider.component.scss +219 -219
  132. package/src/lib/ui/kms-accordion-item/kms-accordion-item.component.scss +95 -95
  133. package/src/lib/ui/radiobutton/radiobutton.component.scss +31 -31
  134. package/src/lib/ui/time-input/time-input.component.scss +10 -10
  135. package/src/lib/ui/tooltip/tooltip.component.scss +26 -26
  136. package/src/lib/ui/tooltip-icon/tooltip-icon.component.scss +2 -2
  137. package/src/styles/mixins.scss +8 -8
  138. package/src/styles/styles.scss +30 -30
  139. package/bundles/kms-ngx-ui-presentational.umd.js +0 -3628
  140. package/bundles/kms-ngx-ui-presentational.umd.js.map +0 -1
  141. package/esm2015/lib/directives/swipe.model.js +0 -5
  142. package/esm2015/lib/models/address.model.js +0 -6
  143. package/esm2015/lib/ui/back-to-top/back-to-top.component.js +0 -52
  144. package/esm2015/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.js +0 -62
  145. package/esm2015/lib/ui/checkbox/checkbox.component.js +0 -76
  146. package/esm2015/lib/ui/color-input/color-input.component.js +0 -81
  147. package/esm2015/lib/ui/dropdown-from-data/dropdown-from-data.component.js +0 -169
  148. package/esm2015/lib/ui/enum-radiogroup/enum-radiogroup.component.js +0 -57
  149. package/esm2015/lib/ui/file-input/file-input.component.js +0 -237
  150. package/esm2015/lib/ui/flyout/flyout.component.js +0 -124
  151. package/esm2015/lib/ui/generic-dialog/generic-dialog.component.js +0 -58
  152. package/esm2015/lib/ui/icon/icon.component.js +0 -52
  153. package/esm2015/lib/ui/image-slider/image-slider.component.js +0 -193
  154. package/esm2015/lib/ui/kms-accordion-item/kms-accordion-item.component.js +0 -44
  155. package/esm2015/lib/ui/loader/loader.component.js +0 -25
  156. package/esm2015/lib/ui/map/map.component.js +0 -120
  157. package/esm2015/lib/ui/radiobutton/radiobutton.component.js +0 -78
  158. package/esm2015/lib/ui/salutation-dropdown/salutation-dropdown.component.js +0 -59
  159. package/esm2015/lib/ui/salutation-radiogroup/salutation-radiogroup.component.js +0 -53
  160. package/esm2015/lib/ui/time-input/time-input.component.js +0 -88
  161. package/esm2015/lib/ui/tooltip/tooltip.component.js +0 -20
  162. package/esm2015/lib/ui/tooltip-icon/tooltip-icon.component.js +0 -39
  163. package/esm2015/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.js +0 -86
  164. package/fesm2015/kms-ngx-ui-presentational.js.map +0 -1
@@ -0,0 +1,3019 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, EventEmitter, Input, Output, forwardRef, ViewChild, VERSION, Directive, HostListener, Pipe, NgModule, PLATFORM_ID, Inject } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import { CommonModule, CurrencyPipe, isPlatformBrowser } from '@angular/common';
5
+ import * as i1$1 from '@angular/forms';
6
+ import { NG_VALUE_ACCESSOR, FormControl, NG_VALIDATORS, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i1 from '@angular/material/checkbox';
8
+ import { MatCheckboxModule } from '@angular/material/checkbox';
9
+ import * as i2$2 from '@angular/material/radio';
10
+ import { MatRadioModule } from '@angular/material/radio';
11
+ import * as i2$1 from '@angular/material/form-field';
12
+ import { MatFormFieldModule } from '@angular/material/form-field';
13
+ import * as i1$2 from '@angular/platform-browser';
14
+ import * as i5 from '@angular/material/input';
15
+ import { MatInputModule } from '@angular/material/input';
16
+ import * as i2$3 from '@angular/material/button';
17
+ import { MatButtonModule } from '@angular/material/button';
18
+ import * as i5$1 from '@ngx-translate/core';
19
+ import { TranslateModule } from '@ngx-translate/core';
20
+ import * as i1$3 from '@angular/material/progress-spinner';
21
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
22
+ import { trigger, state, style } from '@angular/animations';
23
+ import * as i2$4 from '@angular/material/expansion';
24
+ import { MatExpansionModule } from '@angular/material/expansion';
25
+ import { Subject } from 'rxjs';
26
+ import * as i2$5 from '@angular/google-maps';
27
+ import { GoogleMapsModule } from '@angular/google-maps';
28
+ import * as i3 from '@angular/material/select';
29
+ import { MatSelectModule } from '@angular/material/select';
30
+ import * as i4 from '@angular/material/core';
31
+ import { SubSink } from 'subsink';
32
+ import * as i1$4 from '@angular/material/dialog';
33
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
34
+ import * as i3$1 from '@angular/material/menu';
35
+ import { MatMenuModule } from '@angular/material/menu';
36
+ import { EnumValues } from 'enum-values/src/enumValues';
37
+ import * as i6 from '@angular/cdk/drag-drop';
38
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
39
+ import * as i2$6 from 'ngx-useful-swiper';
40
+ import { NgxUsefulSwiperModule } from 'ngx-useful-swiper';
41
+
42
+ class KmsUiPresentationalService {
43
+ constructor() { }
44
+ }
45
+ KmsUiPresentationalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
46
+ KmsUiPresentationalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalService, providedIn: 'root' });
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalService, decorators: [{
48
+ type: Injectable,
49
+ args: [{
50
+ providedIn: 'root'
51
+ }]
52
+ }], ctorParameters: function () { return []; } });
53
+
54
+ class KmsUiPresentationalComponent {
55
+ constructor() { }
56
+ ngOnInit() {
57
+ }
58
+ }
59
+ KmsUiPresentationalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
60
+ KmsUiPresentationalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: KmsUiPresentationalComponent, selector: "lib-kms-ngx-ui-presentational", ngImport: i0, template: `
61
+ <p>
62
+ kms-ngx-ui-presentational works!
63
+ </p>
64
+ `, isInline: true });
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalComponent, decorators: [{
66
+ type: Component,
67
+ args: [{
68
+ selector: 'lib-kms-ngx-ui-presentational',
69
+ template: `
70
+ <p>
71
+ kms-ngx-ui-presentational works!
72
+ </p>
73
+ `,
74
+ styles: []
75
+ }]
76
+ }], ctorParameters: function () { return []; } });
77
+
78
+ /*!
79
+ * @copyright FLYACTS GmbH 2019
80
+ */
81
+ class ActionsParentComponent {
82
+ constructor() {
83
+ /**
84
+ * Defines the disabled property
85
+ */
86
+ this.disabled = false;
87
+ /**
88
+ * Set button as selected. F.e. in multiselect component
89
+ */
90
+ this.checked = false;
91
+ /**
92
+ * Displayed label.
93
+ */
94
+ this.label = '';
95
+ /**
96
+ * Link
97
+ */
98
+ this.link = '';
99
+ /**
100
+ * Internal value that will be send if a form is submitted.
101
+ */
102
+ this.initialValue = '';
103
+ this.select = new EventEmitter();
104
+ }
105
+ selectAction(id) {
106
+ this.checked = !this.checked;
107
+ this.select.emit(id);
108
+ }
109
+ }
110
+ ActionsParentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ActionsParentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
111
+ ActionsParentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ActionsParentComponent, selector: "kms-actions", inputs: { disabled: "disabled", checked: "checked", label: "label", link: "link", initialValue: "initialValue" }, outputs: { select: "select" }, ngImport: i0, template: '', isInline: true });
112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ActionsParentComponent, decorators: [{
113
+ type: Component,
114
+ args: [{
115
+ selector: 'kms-actions',
116
+ template: '',
117
+ }]
118
+ }], propDecorators: { disabled: [{
119
+ type: Input
120
+ }], checked: [{
121
+ type: Input
122
+ }], label: [{
123
+ type: Input
124
+ }], link: [{
125
+ type: Input
126
+ }], initialValue: [{
127
+ type: Input
128
+ }], select: [{
129
+ type: Output
130
+ }] } });
131
+
132
+ /*!
133
+ * @copyright FLYACTS GmbH 2019
134
+ */
135
+ class CheckboxComponent extends ActionsParentComponent {
136
+ constructor() {
137
+ super();
138
+ /**
139
+ * Internal description name. All checkboxes with the same name belong to the same group.
140
+ * User can select none, one or all checkboxes with the same name.
141
+ */
142
+ this.name = '';
143
+ this.select = new EventEmitter();
144
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
145
+ this.onChange = () => { };
146
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
147
+ this.onTouch = () => { };
148
+ }
149
+ selectAction(id) {
150
+ this.select.emit(id);
151
+ this.checked = !this.checked;
152
+ }
153
+ get value() {
154
+ return this.checked;
155
+ }
156
+ set value(value) {
157
+ this.checked = value;
158
+ this.onChange(value);
159
+ this.onTouch(value);
160
+ }
161
+ writeValue(value) {
162
+ this.value = value;
163
+ }
164
+ registerOnChange(fn) {
165
+ this.onChange = fn;
166
+ }
167
+ registerOnTouched(fn) {
168
+ this.onTouch = fn;
169
+ }
170
+ }
171
+ CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
172
+ CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: CheckboxComponent, selector: "kms-checkbox", inputs: { infoText: "infoText", name: "name" }, outputs: { select: "select" }, providers: [
173
+ {
174
+ provide: NG_VALUE_ACCESSOR,
175
+ useExisting: forwardRef(() => CheckboxComponent),
176
+ multi: true,
177
+ },
178
+ ], usesInheritance: true, ngImport: i0, template: "<!-- <label class=\"wrapper ui-copy-text\"\n [ngClass]=\"{'disabled' : disabled}\">{{label}}\n <input type=\"checkbox\" \n [checked]=\"checked\"\n [value]=\"value\"\n [name]=\"name\"\n [disabled]=\"disabled\"\n (change)=\"selectAction($event)\">\n\n</label> -->\n<mat-checkbox class=\"example-margin\" [disabled]=\"disabled\" [name]=\"name\" [(ngModel)]=\"checked\"></mat-checkbox>\n<span *ngIf=\"infoText && infoText.length > 0\" \n class=\"\"\n [ngClass]=\"{'disabled' : disabled}\">{{infoText}}\n</span>", styles: [""], components: [{ type: i1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CheckboxComponent, decorators: [{
180
+ type: Component,
181
+ args: [{ selector: 'kms-checkbox', providers: [
182
+ {
183
+ provide: NG_VALUE_ACCESSOR,
184
+ useExisting: forwardRef(() => CheckboxComponent),
185
+ multi: true,
186
+ },
187
+ ], template: "<!-- <label class=\"wrapper ui-copy-text\"\n [ngClass]=\"{'disabled' : disabled}\">{{label}}\n <input type=\"checkbox\" \n [checked]=\"checked\"\n [value]=\"value\"\n [name]=\"name\"\n [disabled]=\"disabled\"\n (change)=\"selectAction($event)\">\n\n</label> -->\n<mat-checkbox class=\"example-margin\" [disabled]=\"disabled\" [name]=\"name\" [(ngModel)]=\"checked\"></mat-checkbox>\n<span *ngIf=\"infoText && infoText.length > 0\" \n class=\"\"\n [ngClass]=\"{'disabled' : disabled}\">{{infoText}}\n</span>", styles: [""] }]
188
+ }], ctorParameters: function () { return []; }, propDecorators: { infoText: [{
189
+ type: Input
190
+ }], name: [{
191
+ type: Input
192
+ }], select: [{
193
+ type: Output
194
+ }] } });
195
+
196
+ /*!
197
+ * @copyright FLYACTS GmbH 2019
198
+ */
199
+ class FormParentComponent {
200
+ constructor(formBuilder) {
201
+ this.formBuilder = formBuilder;
202
+ this.formInitialized = false;
203
+ this.allowedCharsOnlyNumbers = new Set('0123456789'.split('').map(c => c.charCodeAt(0)));
204
+ this.formDataChanged = new EventEmitter();
205
+ this.disabled = false;
206
+ }
207
+ // TODO make a service or make own compoennt etc.
208
+ /**
209
+ * Returns if a number was pressed
210
+ * @param e
211
+ * @returns
212
+ */
213
+ checkIfKeyWasNumber(e, allowDelete = true, allowArrows = true, allowCutCopyPaste = true) {
214
+ // returns if keycode of numbers-row or numberpad. Or if parameter set, allow delete/backspace key
215
+ const isNumberRow = e.keyCode >= 48 && e.keyCode <= 57;
216
+ const isNumberPad = e.keyCode >= 96 && e.keyCode <= 105;
217
+ const isArrows = e.keyCode >= 37 && e.keyCode <= 40;
218
+ const isDelete = e.keyCode == 8 || e.keyCode == 46;
219
+ const isCutCopyOrPaste = (e.ctrlKey || e.metaKey) && (e.keyCode == 86 || e.keyCode == 88 || e.keyCode == 67);
220
+ return (isNumberRow) || (isNumberPad) || (allowDelete && isDelete) || (allowArrows && isArrows) || (allowCutCopyPaste && isCutCopyOrPaste);
221
+ }
222
+ // TODO make a service or make own compoennt etc.
223
+ /**
224
+ * Prevents to input other chars than numbers in input
225
+ * @param event
226
+ */
227
+ removeNumbersOnType(event) {
228
+ // only allow keydown from numbers-row or numberpad of keybard and block other chars than numbers
229
+ if (!this.checkIfKeyWasNumber(event) && !this.allowedCharsOnlyNumbers.has(event.keyCode)) {
230
+ event.preventDefault();
231
+ }
232
+ }
233
+ // TODO make a service or make own compoennt etc.
234
+ /**
235
+ * Prevents input when pasting which is not number
236
+ * @param event
237
+ */
238
+ removeNumbersOnPaste(event) {
239
+ const clipboardData = event.clipboardData;
240
+ if (clipboardData) {
241
+ const pastedText = clipboardData.getData('text');
242
+ if (pastedText) {
243
+ const isnum = /^\d+$/.test(pastedText);
244
+ if (!isnum) {
245
+ event.preventDefault();
246
+ }
247
+ }
248
+ }
249
+ }
250
+ ngOnInit() {
251
+ this.formDataChanged.emit(this.form);
252
+ this.form.valueChanges.subscribe(() => {
253
+ this.formDataChanged.emit(this.form);
254
+ });
255
+ }
256
+ }
257
+ FormParentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormParentComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
258
+ FormParentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FormParentComponent, selector: "kms-form", inputs: { disabled: "disabled" }, outputs: { formDataChanged: "formDataChanged" }, ngImport: i0, template: '', isInline: true });
259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormParentComponent, decorators: [{
260
+ type: Component,
261
+ args: [{
262
+ selector: 'kms-form',
263
+ template: '',
264
+ }]
265
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }]; }, propDecorators: { formDataChanged: [{
266
+ type: Output
267
+ }], disabled: [{
268
+ type: Input
269
+ }] } });
270
+
271
+ class FormControlParentComponent extends FormParentComponent {
272
+ constructor(formBuilder, renderer) {
273
+ super(formBuilder);
274
+ this.formBuilder = formBuilder;
275
+ this.renderer = renderer;
276
+ this.defaultDataOverride = ''; // when we have NO form around, get default via input to set it manually
277
+ this.onSelectItemEmitter = new EventEmitter();
278
+ this.internalValue = '';
279
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
280
+ this.onChange = () => { };
281
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
282
+ this.onTouch = () => { };
283
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
284
+ this.onTouched = () => { };
285
+ }
286
+ ngOnInit() {
287
+ super.ngOnInit();
288
+ }
289
+ change(value) {
290
+ this.onChange(value);
291
+ this.onTouched();
292
+ }
293
+ get value() {
294
+ return this.internalValue;
295
+ }
296
+ set value(value) {
297
+ this.internalValue = value;
298
+ if (value !== undefined && this.internalValue !== value) {
299
+ if (!this.internalValue && this.defaultDataOverride) {
300
+ this.internalValue = this.defaultDataOverride;
301
+ }
302
+ this.onChange(value);
303
+ this.onTouch(value);
304
+ }
305
+ }
306
+ writeValue(value) {
307
+ this.internalValue = value;
308
+ this.value = value;
309
+ }
310
+ registerOnChange(fn) {
311
+ this.onChange = fn;
312
+ }
313
+ registerOnTouched(fn) {
314
+ this.onTouch = fn;
315
+ }
316
+ setDisabledState(isDisabled) {
317
+ if (this.child) {
318
+ this.renderer.setProperty(this.child.nativeElement, 'disabled', isDisabled);
319
+ }
320
+ }
321
+ validate(_) {
322
+ return this.form.valid ? null : false;
323
+ }
324
+ }
325
+ FormControlParentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormControlParentComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
326
+ FormControlParentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FormControlParentComponent, selector: "kms-formControlParent", inputs: { defaultDataOverride: "defaultDataOverride" }, outputs: { onSelectItemEmitter: "onSelectItemEmitter" }, viewQueries: [{ propertyName: "child", first: true, predicate: ["child"], descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormControlParentComponent, decorators: [{
328
+ type: Component,
329
+ args: [{
330
+ selector: 'kms-formControlParent',
331
+ template: '',
332
+ }]
333
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.Renderer2 }]; }, propDecorators: { defaultDataOverride: [{
334
+ type: Input
335
+ }], onSelectItemEmitter: [{
336
+ type: Output
337
+ }], child: [{
338
+ type: ViewChild,
339
+ args: ['child']
340
+ }] } });
341
+
342
+ /**
343
+ * Attached File DTO
344
+ */
345
+ class AttachedFileDTO {
346
+ }
347
+
348
+ /*!
349
+ * @copyright FLYACTS GmbH 2019
350
+ */
351
+ var IconSize$1;
352
+ (function (IconSize) {
353
+ IconSize["FULLSIZE"] = "size-full";
354
+ IconSize["TINY"] = "size-16";
355
+ IconSize["SMALLER"] = "size-20";
356
+ IconSize["SMALL"] = "size-32";
357
+ IconSize["MEDIUM"] = "size-64";
358
+ IconSize["LARGE"] = "size-128";
359
+ IconSize["XL"] = "size-256";
360
+ IconSize["XXL"] = "size-512";
361
+ IconSize["XXXL"] = "size-1024";
362
+ IconSize["NONE"] = "NONE";
363
+ })(IconSize$1 || (IconSize$1 = {}));
364
+
365
+ /**
366
+ * @copyright FLYACTS GmbH 2019
367
+ */
368
+ /**
369
+ * Check if null or undefined
370
+ * @param value value that is being checked
371
+ */
372
+ function isValue(value) {
373
+ if (value === null) {
374
+ return false;
375
+ }
376
+ if (typeof value === 'undefined') {
377
+ return false;
378
+ }
379
+ return true;
380
+ }
381
+
382
+ /*!
383
+ * @copyright FLYACTS GmbH 2019
384
+ */
385
+ var IconSize;
386
+ (function (IconSize) {
387
+ IconSize["FULLSIZE"] = "size-full";
388
+ IconSize["TINY"] = "size-16";
389
+ IconSize["SMALLER"] = "size-20";
390
+ IconSize["SMALL"] = "size-32";
391
+ IconSize["MEDIUM"] = "size-64";
392
+ IconSize["LARGE"] = "size-128";
393
+ IconSize["XL"] = "size-256";
394
+ IconSize["XXL"] = "size-512";
395
+ IconSize["XXXL"] = "size-1024";
396
+ IconSize["NONE"] = "NONE";
397
+ })(IconSize || (IconSize = {}));
398
+
399
+ /**
400
+ * @copyright KMS GmbH
401
+ */
402
+ class IconComponent {
403
+ constructor(sanitizer) {
404
+ this.sanitizer = sanitizer;
405
+ /**
406
+ * Optional: Different size via CSS inline style.
407
+ */
408
+ this.iconSize = IconSize.FULLSIZE;
409
+ /**
410
+ * Dont use icon sprite
411
+ */
412
+ this.dontUseSprite = false;
413
+ this.IconSize = IconSize;
414
+ this.Version = VERSION.full;
415
+ this.timestamp = 0;
416
+ this.iconToShow = this.icon;
417
+ }
418
+ ngOnInit() {
419
+ this.iconToShow = this.icon;
420
+ const d = new Date();
421
+ const n = d.getTime();
422
+ this.timestamp = n;
423
+ }
424
+ }
425
+ IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: IconComponent, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
426
+ IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: IconComponent, selector: "kms-icon", inputs: { icon: "icon", iconClass: "iconClass", iconStyle: "iconStyle", iconSize: "iconSize", dontUseSprite: "dontUseSprite" }, ngImport: i0, template: "<ng-container *ngIf=\"icon !== 'none' && dontUseSprite === false\">\n <span class=\"icon {{ iconSize }}\" [ngClass]=\"iconClass\" [ngStyle]=\"iconStyle\">\n <svg>\n <use\n [attr.xlink:href]=\"\n 'assets/sprite.svg?Version=' + Version + '#' + iconToShow\n \"\n ></use>\n </svg>\n </span>\n</ng-container>\n<ng-container *ngIf=\"icon !== 'none' && dontUseSprite === true\">\n <object\n [data]=\"\n sanitizer.bypassSecurityTrustResourceUrl('assets/icons/' + icon + '')\n \"\n type=\"image/svg+xml\"\n class=\"icon {{ iconSize }}\"\n [ngClass]=\"iconClass\"\n [ngStyle]=\"iconStyle\"\n ></object>\n</ng-container>\n", styles: [""], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
427
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: IconComponent, decorators: [{
428
+ type: Component,
429
+ args: [{ selector: 'kms-icon', template: "<ng-container *ngIf=\"icon !== 'none' && dontUseSprite === false\">\n <span class=\"icon {{ iconSize }}\" [ngClass]=\"iconClass\" [ngStyle]=\"iconStyle\">\n <svg>\n <use\n [attr.xlink:href]=\"\n 'assets/sprite.svg?Version=' + Version + '#' + iconToShow\n \"\n ></use>\n </svg>\n </span>\n</ng-container>\n<ng-container *ngIf=\"icon !== 'none' && dontUseSprite === true\">\n <object\n [data]=\"\n sanitizer.bypassSecurityTrustResourceUrl('assets/icons/' + icon + '')\n \"\n type=\"image/svg+xml\"\n class=\"icon {{ iconSize }}\"\n [ngClass]=\"iconClass\"\n [ngStyle]=\"iconStyle\"\n ></object>\n</ng-container>\n", styles: [""] }]
430
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; }, propDecorators: { icon: [{
431
+ type: Input
432
+ }], iconClass: [{
433
+ type: Input
434
+ }], iconStyle: [{
435
+ type: Input
436
+ }], iconSize: [{
437
+ type: Input
438
+ }], dontUseSprite: [{
439
+ type: Input
440
+ }] } });
441
+
442
+ class TooltipDirective {
443
+ constructor(el, renderer) {
444
+ this.el = el;
445
+ this.renderer = renderer;
446
+ this.tooltipTitle = "";
447
+ this.tooltipText = "";
448
+ this.tooltipLinkText = "";
449
+ this.tooltipLinkUrl = "";
450
+ this.tooltipPlacement = "bottom";
451
+ this.tooltipDelay = 1000;
452
+ this.tooltipPlaceIntoHost = false;
453
+ this.tooltipOnlyonclick = false;
454
+ this.offset = 0;
455
+ }
456
+ onMouseEnter() {
457
+ if (!this.tooltipOnlyonclick) {
458
+ this.show();
459
+ }
460
+ }
461
+ onClick() {
462
+ if (this.tooltipOnlyonclick) {
463
+ this.show();
464
+ }
465
+ }
466
+ onMouseLeave() {
467
+ if (this.tooltipElem) {
468
+ this.hide();
469
+ }
470
+ }
471
+ show() {
472
+ if (!this.tooltipElem) {
473
+ this.create();
474
+ this.setPosition();
475
+ }
476
+ this.renderer.addClass(this.tooltipElem, 'tooltip-show');
477
+ }
478
+ hide() {
479
+ this.renderer.removeClass(this.tooltipElem, 'tooltip-show');
480
+ window.setTimeout(() => {
481
+ }, this.tooltipDelay);
482
+ }
483
+ create() {
484
+ this.tooltipElem = this.renderer.createElement('kms-tooltip-element');
485
+ this.tooltipTitleElem = this.renderer.createElement('b');
486
+ this.renderer.appendChild(this.tooltipTitleElem, this.renderer.createText(this.tooltipTitle));
487
+ this.renderer.appendChild(this.tooltipElem, this.tooltipTitleElem);
488
+ this.tooltipTextElem = this.renderer.createElement('div');
489
+ this.renderer.appendChild(this.tooltipTextElem, this.renderer.createText(this.tooltipText));
490
+ this.renderer.appendChild(this.tooltipElem, this.tooltipTextElem);
491
+ this.tooltipLinkElem = this.renderer.createElement('a');
492
+ this.renderer.setAttribute(this.tooltipLinkElem, 'href', this.tooltipLinkUrl);
493
+ this.renderer.appendChild(this.tooltipLinkElem, this.renderer.createText(this.tooltipLinkText));
494
+ this.renderer.appendChild(this.tooltipElem, this.tooltipLinkElem);
495
+ if (this.tooltipPlaceIntoHost) {
496
+ this.renderer.appendChild(this.el.nativeElement, this.tooltipElem);
497
+ }
498
+ else {
499
+ this.renderer.appendChild(document.body, this.tooltipElem);
500
+ }
501
+ this.renderer.addClass(this.tooltipElem, 'tooltip');
502
+ this.renderer.addClass(this.tooltipElem, `tooltip-${this.tooltipPlacement}`);
503
+ this.renderer.setStyle(this.tooltipElem, '-webkit-transition', `opacity ${this.tooltipDelay}ms`);
504
+ this.renderer.setStyle(this.tooltipElem, '-moz-transition', `opacity ${this.tooltipDelay}ms`);
505
+ this.renderer.setStyle(this.tooltipElem, '-o-transition', `opacity ${this.tooltipDelay}ms`);
506
+ this.renderer.setStyle(this.tooltipElem, 'transition', `opacity ${this.tooltipDelay}ms`);
507
+ }
508
+ setPosition() {
509
+ if (this.tooltipElem) {
510
+ const hostPos = this.el.nativeElement.getBoundingClientRect();
511
+ const tooltipPos = this.tooltipElem.getBoundingClientRect();
512
+ let top, left;
513
+ if (this.tooltipPlaceIntoHost) {
514
+ left = 0;
515
+ top = hostPos.height;
516
+ }
517
+ else {
518
+ const scrollPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
519
+ if (this.tooltipPlacement === 'top') {
520
+ top = hostPos.top - tooltipPos.height - this.offset;
521
+ left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
522
+ }
523
+ if (!this.tooltipPlacement || this.tooltipPlacement === 'bottom') {
524
+ top = hostPos.bottom + this.offset;
525
+ left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
526
+ }
527
+ if (this.tooltipPlacement === 'left') {
528
+ top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
529
+ left = hostPos.left - tooltipPos.width - this.offset;
530
+ }
531
+ if (this.tooltipPlacement === 'right') {
532
+ top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
533
+ left = hostPos.right + this.offset;
534
+ }
535
+ top += scrollPos;
536
+ }
537
+ this.renderer.setStyle(this.tooltipElem, 'top', `${top}px`);
538
+ this.renderer.setStyle(this.tooltipElem, 'left', `${left}px`);
539
+ }
540
+ }
541
+ }
542
+ TooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
543
+ TooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: TooltipDirective, selector: "[kmsTooltip]", inputs: { tooltipTitle: "tooltipTitle", tooltipText: "tooltipText", tooltipLinkText: "tooltipLinkText", tooltipLinkUrl: "tooltipLinkUrl", tooltipPlacement: "tooltipPlacement", tooltipDelay: "tooltipDelay", tooltipPlaceIntoHost: "tooltipPlaceIntoHost", tooltipOnlyonclick: "tooltipOnlyonclick" }, host: { listeners: { "mouseenter": "onMouseEnter()", "click": "onClick()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 });
544
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TooltipDirective, decorators: [{
545
+ type: Directive,
546
+ args: [{
547
+ selector: '[kmsTooltip]'
548
+ }]
549
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { tooltipTitle: [{
550
+ type: Input,
551
+ args: ['tooltipTitle']
552
+ }], tooltipText: [{
553
+ type: Input,
554
+ args: ['tooltipText']
555
+ }], tooltipLinkText: [{
556
+ type: Input,
557
+ args: ['tooltipLinkText']
558
+ }], tooltipLinkUrl: [{
559
+ type: Input,
560
+ args: ['tooltipLinkUrl']
561
+ }], tooltipPlacement: [{
562
+ type: Input,
563
+ args: ['tooltipPlacement']
564
+ }], tooltipDelay: [{
565
+ type: Input,
566
+ args: ['tooltipDelay']
567
+ }], tooltipPlaceIntoHost: [{
568
+ type: Input,
569
+ args: ['tooltipPlaceIntoHost']
570
+ }], tooltipOnlyonclick: [{
571
+ type: Input,
572
+ args: ['tooltipOnlyonclick']
573
+ }], onMouseEnter: [{
574
+ type: HostListener,
575
+ args: ['mouseenter']
576
+ }], onClick: [{
577
+ type: HostListener,
578
+ args: ['click']
579
+ }], onMouseLeave: [{
580
+ type: HostListener,
581
+ args: ['mouseleave']
582
+ }] } });
583
+
584
+ class TooltipIconComponent {
585
+ constructor() {
586
+ this.tooltipTitle = "";
587
+ this.tooltipText = "";
588
+ this.tooltipLinkText = "";
589
+ this.tooltipLinkUrl = "";
590
+ this.placement = "";
591
+ this.delay = 1000;
592
+ this.IconSize = IconSize$1;
593
+ }
594
+ }
595
+ TooltipIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TooltipIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
596
+ TooltipIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: TooltipIconComponent, selector: "kms-tooltip-icon", inputs: { tooltipTitle: "tooltipTitle", tooltipText: "tooltipText", tooltipLinkText: "tooltipLinkText", tooltipLinkUrl: "tooltipLinkUrl", placement: "placement", delay: "delay" }, ngImport: i0, template: "<span\n kmsTooltip\n [tooltipTitle]=\"tooltipTitle\"\n [tooltipText]=\"tooltipText\"\n [tooltipPlacement]=\"placement\"\n [tooltipDelay]=\"delay\"\n [tooltipLinkText]=\"tooltipLinkText\"\n [tooltipLinkUrl]=\"tooltipLinkUrl\"\n>\n <kms-icon icon=\"ic_info\" [iconSize]=\"IconSize.SMALLER\" [iconClass]=\"'color-primary'\"></kms-icon>\n</span>\n", styles: [""], components: [{ type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "iconStyle", "iconSize", "dontUseSprite"] }], directives: [{ type: TooltipDirective, selector: "[kmsTooltip]", inputs: ["tooltipTitle", "tooltipText", "tooltipLinkText", "tooltipLinkUrl", "tooltipPlacement", "tooltipDelay", "tooltipPlaceIntoHost", "tooltipOnlyonclick"] }] });
597
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TooltipIconComponent, decorators: [{
598
+ type: Component,
599
+ args: [{ selector: 'kms-tooltip-icon', template: "<span\n kmsTooltip\n [tooltipTitle]=\"tooltipTitle\"\n [tooltipText]=\"tooltipText\"\n [tooltipPlacement]=\"placement\"\n [tooltipDelay]=\"delay\"\n [tooltipLinkText]=\"tooltipLinkText\"\n [tooltipLinkUrl]=\"tooltipLinkUrl\"\n>\n <kms-icon icon=\"ic_info\" [iconSize]=\"IconSize.SMALLER\" [iconClass]=\"'color-primary'\"></kms-icon>\n</span>\n", styles: [""] }]
600
+ }], propDecorators: { tooltipTitle: [{
601
+ type: Input
602
+ }], tooltipText: [{
603
+ type: Input
604
+ }], tooltipLinkText: [{
605
+ type: Input
606
+ }], tooltipLinkUrl: [{
607
+ type: Input
608
+ }], placement: [{
609
+ type: Input
610
+ }], delay: [{
611
+ type: Input
612
+ }] } });
613
+
614
+ class ColorInputComponent extends FormControlParentComponent {
615
+ constructor(formBuilder, renderer) {
616
+ super(formBuilder, renderer);
617
+ this.formBuilder = formBuilder;
618
+ this.renderer = renderer;
619
+ this.label = '';
620
+ this.tooltipText = '';
621
+ this.placeholder = '';
622
+ }
623
+ ngOnInit() {
624
+ this.form = this.formBuilder.group({
625
+ color: '',
626
+ });
627
+ super.ngOnInit();
628
+ this.formInitialized = true;
629
+ this.form.valueChanges.subscribe((value) => {
630
+ this.internalValue = value.color;
631
+ this.onChange(value.color);
632
+ });
633
+ }
634
+ validate(_) {
635
+ // TODO fix to validate complete form
636
+ this.valid = this.matchesHex(this.form.value) ? null : false;
637
+ return this.valid && {
638
+ invalid: !this.valid
639
+ };
640
+ }
641
+ matchesHex(match) {
642
+ if (match) {
643
+ const ret = match.match(/^#[0-9a-f]{6}$/i);
644
+ this.valid = ret && ret.length > 0;
645
+ return ret;
646
+ }
647
+ return false;
648
+ }
649
+ updateSelectedColor(value) {
650
+ const color = value.target.value;
651
+ this.value = color;
652
+ this.internalValue = color;
653
+ this.change(color);
654
+ }
655
+ }
656
+ ColorInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ColorInputComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
657
+ ColorInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ColorInputComponent, selector: "kms-color-input", inputs: { label: "label", tooltipText: "tooltipText", placeholder: "placeholder" }, providers: [
658
+ {
659
+ provide: NG_VALUE_ACCESSOR,
660
+ useExisting: forwardRef(() => ColorInputComponent),
661
+ multi: true,
662
+ },
663
+ ], usesInheritance: true, ngImport: i0, template: "\n<form [formGroup]=\"form\" *ngIf=\"formInitialized\">\n <div>\n <mat-form-field class=\"colorInput\">\n <kms-tooltip-icon [tooltipText]=\"tooltipText\" *ngIf=\"tooltipText\"></kms-tooltip-icon>\n <mat-label>{{ label }}</mat-label>\n <input type=\"text\" [(ngModel)]=\"value\" matInput formControlName=\"color\" [placeholder]=\"placeholder\" [ngClass]=\"{'my-inValid': !matchesHex(value)}\" />\n <input type=\"color\" [value]=\"value && matchesHex(value) ? value : '#ffffff'\" (change)=\"updateSelectedColor($event)\" [ngClass]=\"{'my-inValid': !matchesHex(value)}\" />\n </mat-form-field>\n </div>\n</form>", styles: [""], components: [{ type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: TooltipIconComponent, selector: "kms-tooltip-icon", inputs: ["tooltipTitle", "tooltipText", "tooltipLinkText", "tooltipLinkUrl", "placement", "delay"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$1.MatLabel, selector: "mat-label" }, { type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ColorInputComponent, decorators: [{
665
+ type: Component,
666
+ args: [{ selector: 'kms-color-input', providers: [
667
+ {
668
+ provide: NG_VALUE_ACCESSOR,
669
+ useExisting: forwardRef(() => ColorInputComponent),
670
+ multi: true,
671
+ },
672
+ ], template: "\n<form [formGroup]=\"form\" *ngIf=\"formInitialized\">\n <div>\n <mat-form-field class=\"colorInput\">\n <kms-tooltip-icon [tooltipText]=\"tooltipText\" *ngIf=\"tooltipText\"></kms-tooltip-icon>\n <mat-label>{{ label }}</mat-label>\n <input type=\"text\" [(ngModel)]=\"value\" matInput formControlName=\"color\" [placeholder]=\"placeholder\" [ngClass]=\"{'my-inValid': !matchesHex(value)}\" />\n <input type=\"color\" [value]=\"value && matchesHex(value) ? value : '#ffffff'\" (change)=\"updateSelectedColor($event)\" [ngClass]=\"{'my-inValid': !matchesHex(value)}\" />\n </mat-form-field>\n </div>\n</form>", styles: [""] }]
673
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.Renderer2 }]; }, propDecorators: { label: [{
674
+ type: Input
675
+ }], tooltipText: [{
676
+ type: Input
677
+ }], placeholder: [{
678
+ type: Input
679
+ }] } });
680
+
681
+ /*!
682
+ * @copyright FLYACTS GmbH 2019
683
+ */
684
+ class RadioButtonComponent extends ActionsParentComponent {
685
+ constructor() {
686
+ super();
687
+ /**
688
+ * Internal description name. All radio buttons with the same name belong to the same group.
689
+ * User can select exactly one of the radio buttons from the same group.
690
+ */
691
+ this.name = '';
692
+ /**
693
+ * Internal description id. Will be send in the output event when the radio button is selected.
694
+ */
695
+ this.id = '';
696
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
697
+ this.onChange = () => { };
698
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
699
+ this.onTouch = () => { };
700
+ }
701
+ selectAction(id) {
702
+ this.select.emit(id);
703
+ this.checked = !this.checked;
704
+ }
705
+ get value() {
706
+ return this.checked;
707
+ }
708
+ set value(value) {
709
+ this.checked = value;
710
+ this.onChange(value);
711
+ this.onTouch(value);
712
+ }
713
+ writeValue(value) {
714
+ this.value = value;
715
+ }
716
+ registerOnChange(fn) {
717
+ this.onChange = fn;
718
+ }
719
+ registerOnTouched(fn) {
720
+ this.onTouch = fn;
721
+ }
722
+ }
723
+ RadioButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: RadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
724
+ RadioButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: RadioButtonComponent, selector: "kms-radiobutton", inputs: { name: "name", id: "id", formControl: "formControl" }, providers: [
725
+ {
726
+ provide: NG_VALUE_ACCESSOR,
727
+ useExisting: forwardRef(() => RadioButtonComponent),
728
+ multi: true,
729
+ },
730
+ ], usesInheritance: true, ngImport: i0, template: "<label class=\"wrapper ui-small-text\"\n [ngClass]=\"{'disabled' : disabled}\">\n <input type=\"radio\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n (change)=\"selectAction($event)\">{{label}}\n\n <kms-icon\n class=\"checkmark\" \n aria-hidden=\"true\"\n *ngIf=\"checked\"\n [ngClass]=\"{\n 'disabled' : disabled\n }\"\n [iconClass]=\"{\n 'disabled' : disabled, \n 'color-primary': true,\n 'size-16': true\n }\"\n [icon]=\"'ic_radiobutton_active'\"\n >\n </kms-icon>\n <kms-icon\n class=\"checkmark\" \n aria-hidden=\"true\"\n *ngIf=\"!checked\"\n [ngClass]=\"{\n 'disabled' : disabled\n }\"\n [iconClass]=\"{\n 'disabled' : disabled, \n 'color-primary': true,\n 'size-16': true\n }\"\n [icon]=\"'ic_radiobutton_inactive'\"\n >\n </kms-icon>\n <ng-content></ng-content>\n</label>\n", styles: [""], components: [{ type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "iconStyle", "iconSize", "dontUseSprite"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
731
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: RadioButtonComponent, decorators: [{
732
+ type: Component,
733
+ args: [{ selector: 'kms-radiobutton', providers: [
734
+ {
735
+ provide: NG_VALUE_ACCESSOR,
736
+ useExisting: forwardRef(() => RadioButtonComponent),
737
+ multi: true,
738
+ },
739
+ ], template: "<label class=\"wrapper ui-small-text\"\n [ngClass]=\"{'disabled' : disabled}\">\n <input type=\"radio\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n (change)=\"selectAction($event)\">{{label}}\n\n <kms-icon\n class=\"checkmark\" \n aria-hidden=\"true\"\n *ngIf=\"checked\"\n [ngClass]=\"{\n 'disabled' : disabled\n }\"\n [iconClass]=\"{\n 'disabled' : disabled, \n 'color-primary': true,\n 'size-16': true\n }\"\n [icon]=\"'ic_radiobutton_active'\"\n >\n </kms-icon>\n <kms-icon\n class=\"checkmark\" \n aria-hidden=\"true\"\n *ngIf=\"!checked\"\n [ngClass]=\"{\n 'disabled' : disabled\n }\"\n [iconClass]=\"{\n 'disabled' : disabled, \n 'color-primary': true,\n 'size-16': true\n }\"\n [icon]=\"'ic_radiobutton_inactive'\"\n >\n </kms-icon>\n <ng-content></ng-content>\n</label>\n", styles: [""] }]
740
+ }], ctorParameters: function () { return []; }, propDecorators: { name: [{
741
+ type: Input
742
+ }], id: [{
743
+ type: Input
744
+ }], formControl: [{
745
+ type: Input
746
+ }] } });
747
+
748
+ class TimeInputComponent {
749
+ constructor(formBuilder) {
750
+ this.formBuilder = formBuilder;
751
+ this.h = '';
752
+ this.m = '';
753
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
754
+ this.onChange = () => { };
755
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
756
+ this.onTouch = () => { };
757
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
758
+ this.onTouched = () => { };
759
+ }
760
+ get value() {
761
+ return this.value;
762
+ }
763
+ set value(value) {
764
+ this.onChange(value);
765
+ this.onTouch(value);
766
+ }
767
+ writeValue(value) {
768
+ if (value && value.length === 8) {
769
+ this.h = value.substr(0, 2);
770
+ this.m = value.substr(3, 2);
771
+ }
772
+ else if (value && value.length === 5) {
773
+ this.h = value.substr(0, 2);
774
+ this.m = value.substr(-2);
775
+ }
776
+ //we need to also update the form value because angular has a problem reading it from first time when valuechanges subscription was fired.
777
+ this.form.controls['h'].setValue(this.h);
778
+ this.form.controls['m'].setValue(this.m);
779
+ this.form.valueChanges.subscribe(value => {
780
+ this.h = value.h;
781
+ this.m = value.m;
782
+ value = this.getNewOrDefault();
783
+ this.value = value;
784
+ this.onChange(value);
785
+ });
786
+ }
787
+ ngOnInit() {
788
+ this.form = this.formBuilder.group({
789
+ h: '',
790
+ m: '',
791
+ });
792
+ }
793
+ getNewOrDefault() {
794
+ //reset if user deletes everything
795
+ if (this.h === '' && this.m === '') {
796
+ return '';
797
+ }
798
+ const ret = this.h.padStart(2, '0') + ':' + this.m.padStart(2, '0');
799
+ return ret;
800
+ }
801
+ registerOnChange(fn) {
802
+ this.onChange = fn;
803
+ }
804
+ registerOnTouched(fn) {
805
+ this.onTouch = fn;
806
+ }
807
+ }
808
+ TimeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TimeInputComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
809
+ TimeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: TimeInputComponent, selector: "kms-time-input", providers: [
810
+ {
811
+ provide: NG_VALUE_ACCESSOR,
812
+ useExisting: forwardRef(() => TimeInputComponent),
813
+ multi: true,
814
+ },
815
+ ], ngImport: i0, template: "<form [formGroup]=\"form\" class=\"timeInput\">\n <input type=\"text\" formControlName=\"h\" [value]=\"h\" maxlength=\"2\" pattern=\"(0?[0-9]|1[0-9]|2[0-3])\"/>\n <span>:</span>\n <input type=\"text\" formControlName=\"m\" [value]=\"m\" maxlength=\"2\" pattern=\"(0?[0-9]|[1-5][0-9])\"/>\n</form>", styles: [""], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i1$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }] });
816
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TimeInputComponent, decorators: [{
817
+ type: Component,
818
+ args: [{ selector: 'kms-time-input', providers: [
819
+ {
820
+ provide: NG_VALUE_ACCESSOR,
821
+ useExisting: forwardRef(() => TimeInputComponent),
822
+ multi: true,
823
+ },
824
+ ], template: "<form [formGroup]=\"form\" class=\"timeInput\">\n <input type=\"text\" formControlName=\"h\" [value]=\"h\" maxlength=\"2\" pattern=\"(0?[0-9]|1[0-9]|2[0-3])\"/>\n <span>:</span>\n <input type=\"text\" formControlName=\"m\" [value]=\"m\" maxlength=\"2\" pattern=\"(0?[0-9]|[1-5][0-9])\"/>\n</form>", styles: [""] }]
825
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }]; } });
826
+
827
+ class YesNoRadiogroupComponent {
828
+ constructor(formBuilder, renderer) {
829
+ this.formBuilder = formBuilder;
830
+ this.renderer = renderer;
831
+ this.disabled = false;
832
+ this.textYes = '';
833
+ this.textNo = '';
834
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
835
+ this.onChange = () => { };
836
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
837
+ this.onTouch = () => { };
838
+ }
839
+ get value() {
840
+ return this.internalValue;
841
+ }
842
+ set value(value) {
843
+ this.internalValue = value;
844
+ if (value !== undefined && this.internalValue !== value) {
845
+ this.onChange(value);
846
+ this.onTouch(value);
847
+ }
848
+ }
849
+ writeValue(value) {
850
+ this.internalValue = value;
851
+ this.value = value;
852
+ }
853
+ registerOnChange(fn) {
854
+ this.onChange = fn;
855
+ }
856
+ registerOnTouched(fn) {
857
+ this.onTouch = fn;
858
+ }
859
+ setDisabledState(isDisabled) {
860
+ if (this.child) {
861
+ this.renderer.setProperty(this.child.nativeElement, 'disabled', isDisabled);
862
+ }
863
+ }
864
+ ngOnInit() {
865
+ this.form = this.formBuilder.group({
866
+ yesno: [],
867
+ });
868
+ this.form.valueChanges.subscribe((value) => {
869
+ this.internalValue = value.yesno;
870
+ this.onChange(value.yesno);
871
+ });
872
+ }
873
+ }
874
+ YesNoRadiogroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: YesNoRadiogroupComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
875
+ YesNoRadiogroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: YesNoRadiogroupComponent, selector: "kms-yesno-radiogroup", inputs: { header: "header", disabled: "disabled", textYes: "textYes", textNo: "textNo" }, providers: [
876
+ {
877
+ provide: NG_VALUE_ACCESSOR,
878
+ useExisting: forwardRef(() => YesNoRadiogroupComponent),
879
+ multi: true,
880
+ },
881
+ ], viewQueries: [{ propertyName: "child", first: true, predicate: ["child"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"form\">\n <div>{{ header }}</div>\n <mat-radio-group [formControl]=\"form.controls['yesno']\" [disabled]=\"disabled\" #child>\n <mat-radio-button [value]=\"true\" [checked]=\"internalValue === true\"> {{ textYes }}</mat-radio-button>\n <mat-radio-button [value]=\"false\" [checked]=\"internalValue === false\"> {{ textNo }}</mat-radio-button>\n </mat-radio-group>\n</form>\n", components: [{ type: i2$2.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$2.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
882
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: YesNoRadiogroupComponent, decorators: [{
883
+ type: Component,
884
+ args: [{ selector: 'kms-yesno-radiogroup', providers: [
885
+ {
886
+ provide: NG_VALUE_ACCESSOR,
887
+ useExisting: forwardRef(() => YesNoRadiogroupComponent),
888
+ multi: true,
889
+ },
890
+ ], template: "<form [formGroup]=\"form\">\n <div>{{ header }}</div>\n <mat-radio-group [formControl]=\"form.controls['yesno']\" [disabled]=\"disabled\" #child>\n <mat-radio-button [value]=\"true\" [checked]=\"internalValue === true\"> {{ textYes }}</mat-radio-button>\n <mat-radio-button [value]=\"false\" [checked]=\"internalValue === false\"> {{ textNo }}</mat-radio-button>\n </mat-radio-group>\n</form>\n" }]
891
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.Renderer2 }]; }, propDecorators: { header: [{
892
+ type: Input
893
+ }], disabled: [{
894
+ type: Input
895
+ }], textYes: [{
896
+ type: Input
897
+ }], textNo: [{
898
+ type: Input
899
+ }], child: [{
900
+ type: ViewChild,
901
+ args: ['child']
902
+ }] } });
903
+
904
+ // Max size in bytes of uploaded image
905
+ const MAX_SIZE_BYTES = 2097152;
906
+ class FileInputComponent {
907
+ /**
908
+ * Constructor
909
+ * @param formBuilder
910
+ * @param appRef
911
+ * @param cd
912
+ * @param translateService
913
+ * @param renderer
914
+ */
915
+ constructor(formBuilder, appRef, cd,
916
+ //private translateService: TranslateService,
917
+ renderer) {
918
+ this.formBuilder = formBuilder;
919
+ this.appRef = appRef;
920
+ this.cd = cd;
921
+ this.renderer = renderer;
922
+ this.label = '';
923
+ this.previewImage = true;
924
+ this.allowRemove = true;
925
+ this.previewImageText = '';
926
+ this.maxSizeBytes = MAX_SIZE_BYTES;
927
+ this.resizePixels = 0;
928
+ this.acceptedFileMimetypes = 'image/jpeg, image/jpg, image/png';
929
+ this.form = this.formBuilder.group({
930
+ ImageIdent: new FormControl(''),
931
+ ImageLink: new FormControl(''),
932
+ Filename: new FormControl(''),
933
+ ImageAsDataURL: new FormControl(''),
934
+ Text: new FormControl(''),
935
+ });
936
+ this.subscriptions = [];
937
+ this.newImageLoading = false;
938
+ this.IconSize = IconSize$1;
939
+ this.formDataChanged = new EventEmitter();
940
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
941
+ this.onChange = () => { };
942
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
943
+ this.onTouch = () => { };
944
+ }
945
+ /**
946
+ * Click on button triggers file-input to open OS file dialog
947
+ */
948
+ selectImageOverlay() {
949
+ this.fileInput.nativeElement.click();
950
+ }
951
+ /**
952
+ * Function to manage the input image
953
+ * Returns an error if the file exceeds maximum wanted filesize (Mb).
954
+ * @param ev
955
+ * @returns
956
+ */
957
+ selectImage(ev) {
958
+ if (ev.target.files && ev.target.files[0]) {
959
+ const file = ev.target.files[0];
960
+ if (file.size > this.maxSizeBytes) {
961
+ this.clearInputValue(ev);
962
+ //alert(this.translateService.instant('errors.fileTooBig'));
963
+ return;
964
+ }
965
+ else {
966
+ this.newImageLoading = true;
967
+ if (this.resizePixels > 0) {
968
+ const logoUrl = URL.createObjectURL(file);
969
+ const imgEl = document.createElement('img');
970
+ imgEl.addEventListener('load', () => {
971
+ const resizedLogo = this.resizeImage(imgEl, this.resizePixels);
972
+ const newFile = this.generateModel(file.name, resizedLogo, this.value.ImageIdent, this.value.ImageLink, this.value.Text);
973
+ this.value = newFile;
974
+ this.newImageLoading = false;
975
+ this.cd.markForCheck();
976
+ });
977
+ imgEl.src = logoUrl;
978
+ }
979
+ else {
980
+ const reader = new FileReader();
981
+ reader.readAsDataURL(file);
982
+ reader.onload = (e) => {
983
+ const newFile = this.generateModel(file.name, e.target.result, this.value.ImageIdent, this.value.ImageLink, this.value.Text);
984
+ this.value = newFile;
985
+ this.newImageLoading = false;
986
+ this.cd.markForCheck();
987
+ };
988
+ }
989
+ }
990
+ }
991
+ else {
992
+ console.warn("No file selected");
993
+ }
994
+ }
995
+ /**
996
+ * Resize an image
997
+ * @param imgEl
998
+ * @param wantedWidth as number
999
+ * @returns string
1000
+ */
1001
+ resizeImage(imgEl, wantedWidth) {
1002
+ const canvas = document.createElement('canvas');
1003
+ const ctx = canvas.getContext('2d');
1004
+ const aspect = imgEl.width / imgEl.height;
1005
+ canvas.width = wantedWidth;
1006
+ canvas.height = wantedWidth / aspect;
1007
+ if (isValue(ctx))
1008
+ ctx.drawImage(imgEl, 0, 0, canvas.width, canvas.height);
1009
+ return canvas.toDataURL();
1010
+ }
1011
+ /**
1012
+ * Generate default object
1013
+ * @param name as string
1014
+ * @param content as string
1015
+ * @returns AttachedFileDTO
1016
+ */
1017
+ generateModel(name, content, ident, imageLink, text) {
1018
+ return {
1019
+ ImageIdent: ident ? ident : '',
1020
+ Filename: name ? name : '',
1021
+ ImageAsDataURL: content ? content : '',
1022
+ ImageLink: imageLink ? imageLink : '',
1023
+ Text: text ? text : ''
1024
+ };
1025
+ }
1026
+ /**
1027
+ * Remove image
1028
+ */
1029
+ removeFromList() {
1030
+ this.value = this.generateModel('', '', '', '');
1031
+ }
1032
+ /**
1033
+ * get value
1034
+ */
1035
+ get value() {
1036
+ return this.form.value;
1037
+ }
1038
+ /**
1039
+ * set value
1040
+ */
1041
+ set value(value) {
1042
+ this.form.setValue(value);
1043
+ this.onChange(value);
1044
+ this.formDataChanged.emit(this.form);
1045
+ }
1046
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1047
+ ngOnInit() { }
1048
+ ngOnDestroy() {
1049
+ this.subscriptions.forEach(s => s.unsubscribe());
1050
+ }
1051
+ registerOnChange(fn) {
1052
+ this.onChange = fn;
1053
+ }
1054
+ registerOnTouched(fn) {
1055
+ this.onTouch = fn;
1056
+ }
1057
+ writeValue(value) {
1058
+ if (value) {
1059
+ this.value = value;
1060
+ }
1061
+ if (value === null) {
1062
+ this.form.reset();
1063
+ }
1064
+ }
1065
+ // eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures
1066
+ validate(_) {
1067
+ return this.form.valid ? null : { styles: { valid: false } };
1068
+ }
1069
+ /**
1070
+ * OnClick event listener of input#fileInput to clear his input value
1071
+ */
1072
+ clearInputValue(ev) {
1073
+ const element = ev.target;
1074
+ element.value = '';
1075
+ }
1076
+ }
1077
+ FileInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FileInputComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.ApplicationRef }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1078
+ FileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FileInputComponent, selector: "kms-file-input", inputs: { label: "label", previewImage: "previewImage", allowRemove: "allowRemove", previewImageText: "previewImageText", maxSizeBytes: "maxSizeBytes", resizePixels: "resizePixels", acceptedFileMimetypes: "acceptedFileMimetypes" }, outputs: { formDataChanged: "formDataChanged" }, providers: [
1079
+ {
1080
+ provide: NG_VALUE_ACCESSOR,
1081
+ useExisting: forwardRef(() => FileInputComponent),
1082
+ multi: true,
1083
+ },
1084
+ {
1085
+ provide: NG_VALIDATORS,
1086
+ useExisting: forwardRef(() => FileInputComponent),
1087
+ multi: true,
1088
+ },
1089
+ ], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"form\" (change)=\"newImageLoading=true\" class=\"fileInput\"> \n\n <div *ngIf=\"form.value.Filename && previewImage\">\n <div *ngIf=\"newImageLoading\">\n {{ 'file-input.loading' | translate }}\n </div>\n <div *ngIf=\"!newImageLoading\">\n <div class=\"\">\n <div class=\"\">\n <img *ngIf=\"form.value.ImageLink && form.value.ImageLink !== '' && !(form.value.ImageAsDataURL && form.value.ImageAsDataURL !== '')\" [src]=\"form.value.ImageAsDataURL\" [src]=\"form.value.ImageLink\" style=\"height: 40px; width: fit-content;\" />\n <img *ngIf=\"form.value.ImageAsDataURL && form.value.ImageAsDataURL !== ''\" [src]=\"form.value.ImageAsDataURL\" style=\"height: 40px; width: fit-content;\" />\n </div>\n <div class=\"\">{{form.value.Filename}}</div>\n <div class=\"\">\n <div (click)=\"removeFromList()\" *ngIf=\"allowRemove\">\n <kms-icon icon=\"trash\" [iconSize]=\"IconSize.TINY\" iconClass=\"color-black\"></kms-icon> \n {{ 'file-input.remove' }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"!previewImage\">\n <div class=\"\">{{form.value.Filename}}</div>\n </div>\n\n <button (click)=\"selectImageOverlay()\" class=\"button-primary-font-color\" mat-stroked-button>\n <span>{{ label }}</span>\n </button>\n <input\n type=\"file\"\n [accept]=\"acceptedFileMimetypes\"\n style=\"display: none\"\n #fileInput\n (click)=\"clearInputValue($event)\"\n (change)=\"selectImage($event)\"\n />\n\n <input type=\"hidden\" [formControl]=\"form.controls['ImageIdent']\" />\n <input type=\"hidden\" [formControl]=\"form.controls['ImageLink']\" />\n <input type=\"hidden\" [formControl]=\"form.controls['Filename']\" />\n <input type=\"hidden\" [formControl]=\"form.controls['ImageAsDataURL']\" />\n <input type=\"hidden\" [formControl]=\"form.controls['Text']\" />\n\n</form>", styles: [""], components: [{ type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "iconStyle", "iconSize", "dontUseSprite"] }, { type: i2$3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i5$1.TranslatePipe } });
1090
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FileInputComponent, decorators: [{
1091
+ type: Component,
1092
+ args: [{ selector: 'kms-file-input', providers: [
1093
+ {
1094
+ provide: NG_VALUE_ACCESSOR,
1095
+ useExisting: forwardRef(() => FileInputComponent),
1096
+ multi: true,
1097
+ },
1098
+ {
1099
+ provide: NG_VALIDATORS,
1100
+ useExisting: forwardRef(() => FileInputComponent),
1101
+ multi: true,
1102
+ },
1103
+ ], template: "<form [formGroup]=\"form\" (change)=\"newImageLoading=true\" class=\"fileInput\"> \n\n <div *ngIf=\"form.value.Filename && previewImage\">\n <div *ngIf=\"newImageLoading\">\n {{ 'file-input.loading' | translate }}\n </div>\n <div *ngIf=\"!newImageLoading\">\n <div class=\"\">\n <div class=\"\">\n <img *ngIf=\"form.value.ImageLink && form.value.ImageLink !== '' && !(form.value.ImageAsDataURL && form.value.ImageAsDataURL !== '')\" [src]=\"form.value.ImageAsDataURL\" [src]=\"form.value.ImageLink\" style=\"height: 40px; width: fit-content;\" />\n <img *ngIf=\"form.value.ImageAsDataURL && form.value.ImageAsDataURL !== ''\" [src]=\"form.value.ImageAsDataURL\" style=\"height: 40px; width: fit-content;\" />\n </div>\n <div class=\"\">{{form.value.Filename}}</div>\n <div class=\"\">\n <div (click)=\"removeFromList()\" *ngIf=\"allowRemove\">\n <kms-icon icon=\"trash\" [iconSize]=\"IconSize.TINY\" iconClass=\"color-black\"></kms-icon> \n {{ 'file-input.remove' }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"!previewImage\">\n <div class=\"\">{{form.value.Filename}}</div>\n </div>\n\n <button (click)=\"selectImageOverlay()\" class=\"button-primary-font-color\" mat-stroked-button>\n <span>{{ label }}</span>\n </button>\n <input\n type=\"file\"\n [accept]=\"acceptedFileMimetypes\"\n style=\"display: none\"\n #fileInput\n (click)=\"clearInputValue($event)\"\n (change)=\"selectImage($event)\"\n />\n\n <input type=\"hidden\" [formControl]=\"form.controls['ImageIdent']\" />\n <input type=\"hidden\" [formControl]=\"form.controls['ImageLink']\" />\n <input type=\"hidden\" [formControl]=\"form.controls['Filename']\" />\n <input type=\"hidden\" [formControl]=\"form.controls['ImageAsDataURL']\" />\n <input type=\"hidden\" [formControl]=\"form.controls['Text']\" />\n\n</form>", styles: [""] }]
1104
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.ApplicationRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }]; }, propDecorators: { fileInput: [{
1105
+ type: ViewChild,
1106
+ args: ['fileInput']
1107
+ }], label: [{
1108
+ type: Input
1109
+ }], previewImage: [{
1110
+ type: Input
1111
+ }], allowRemove: [{
1112
+ type: Input
1113
+ }], previewImageText: [{
1114
+ type: Input
1115
+ }], maxSizeBytes: [{
1116
+ type: Input
1117
+ }], resizePixels: [{
1118
+ type: Input
1119
+ }], acceptedFileMimetypes: [{
1120
+ type: Input
1121
+ }], formDataChanged: [{
1122
+ type: Output
1123
+ }] } });
1124
+
1125
+ class LoaderComponent {
1126
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1127
+ constructor() {
1128
+ this.loading = false;
1129
+ }
1130
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1131
+ ngOnInit() { }
1132
+ }
1133
+ LoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1134
+ LoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: LoaderComponent, selector: "kms-loader", inputs: { loading: "loading" }, ngImport: i0, template: "<div class=\"loading-spinner-shade\" *ngIf=\"loading\">\n <mat-spinner class=\"spinnerMargin\" color=\"accent\" diameter=\"44\"></mat-spinner>\n</div>\n", styles: [""], components: [{ type: i1$3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LoaderComponent, decorators: [{
1136
+ type: Component,
1137
+ args: [{ selector: 'kms-loader', template: "<div class=\"loading-spinner-shade\" *ngIf=\"loading\">\n <mat-spinner class=\"spinnerMargin\" color=\"accent\" diameter=\"44\"></mat-spinner>\n</div>\n", styles: [""] }]
1138
+ }], ctorParameters: function () { return []; }, propDecorators: { loading: [{
1139
+ type: Input
1140
+ }] } });
1141
+
1142
+ /*!
1143
+ * @copyright FLYACTS GmbH 2019
1144
+ */
1145
+ /**
1146
+ * Directive to calc the height of all inner elements
1147
+ */
1148
+ class GetMaxHeightDirective {
1149
+ constructor(el) {
1150
+ this.el = el;
1151
+ /**
1152
+ * CSS class name of the child items (markup elements) that should be checked for their height.
1153
+ * This is mandatory.
1154
+ */
1155
+ this.cssClassName = '';
1156
+ /**
1157
+ * Event that will pass the height of the tallest child inside the container.
1158
+ * Useful to calculate the target height of containers with different content (like accordion) for animations.
1159
+ */
1160
+ this.maxHeightChanged = new EventEmitter();
1161
+ /**
1162
+ * Event that will pass the complete sum of all height values from each child.
1163
+ * Useful to calculate the full target height of a container (like dropdown) for animations.
1164
+ */
1165
+ this.sumOfHeight = new EventEmitter();
1166
+ }
1167
+ ngAfterContentChecked() {
1168
+ this.checkHeightOfChildren(this.el.nativeElement, this.cssClassName);
1169
+ }
1170
+ checkHeightOfChildren(parent, cssClassName) {
1171
+ if (!parent) {
1172
+ return;
1173
+ }
1174
+ // find all the child elements with the selected class name
1175
+ const children = parent.getElementsByClassName(cssClassName);
1176
+ // failsafe
1177
+ if (!children) {
1178
+ return;
1179
+ }
1180
+ // get all the child elements heights
1181
+ const itemHeights = Array.from(children).map((x) => x.getBoundingClientRect().height);
1182
+ // failsafe
1183
+ if (itemHeights.length === 0) {
1184
+ return;
1185
+ }
1186
+ // find out the tallest element
1187
+ const maxHeight = itemHeights.reduce((prev, curr) => {
1188
+ return curr > prev ? curr : prev;
1189
+ }, 0);
1190
+ // get sum of heights
1191
+ const sumOfHeight = itemHeights.reduce((pv, cv) => pv + cv, 0);
1192
+ // inform
1193
+ this.maxHeightChanged.emit(maxHeight);
1194
+ this.sumOfHeight.emit(sumOfHeight);
1195
+ }
1196
+ }
1197
+ GetMaxHeightDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: GetMaxHeightDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1198
+ GetMaxHeightDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: GetMaxHeightDirective, selector: "[getMaxHeight]", inputs: { cssClassName: ["getMaxHeight", "cssClassName"] }, outputs: { maxHeightChanged: "maxHeightChanged", sumOfHeight: "sumOfHeight" }, ngImport: i0 });
1199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: GetMaxHeightDirective, decorators: [{
1200
+ type: Directive,
1201
+ args: [{
1202
+ selector: '[getMaxHeight]',
1203
+ }]
1204
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { cssClassName: [{
1205
+ type: Input,
1206
+ args: ['getMaxHeight']
1207
+ }], maxHeightChanged: [{
1208
+ type: Output
1209
+ }], sumOfHeight: [{
1210
+ type: Output
1211
+ }] } });
1212
+
1213
+ /*!
1214
+ * @copyright FLYACTS GmbH 2019
1215
+ */
1216
+ class SafeHtmlPipe {
1217
+ constructor(sanitizer) {
1218
+ this.sanitizer = sanitizer;
1219
+ }
1220
+ transform(html) {
1221
+ return this.sanitizer.bypassSecurityTrustHtml(html);
1222
+ }
1223
+ }
1224
+ SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1225
+ SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeHtmlPipe, name: "kmsSafeHtml" });
1226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeHtmlPipe, decorators: [{
1227
+ type: Pipe,
1228
+ args: [{
1229
+ name: 'kmsSafeHtml',
1230
+ }]
1231
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
1232
+
1233
+ /*!
1234
+ * @copyright FLYACTS GmbH 2019
1235
+ */
1236
+ class FlyoutComponent {
1237
+ constructor() {
1238
+ this.icon = 'filter';
1239
+ this.isDropdownOpened = false;
1240
+ this.targetHeight = '0';
1241
+ this.animationTime = 5000;
1242
+ this.headerCssClass = '';
1243
+ this.bodyCssClass = '';
1244
+ this.headerTitle = '';
1245
+ this.headerText = '';
1246
+ this.hasButtonForMore = false;
1247
+ this.moreText = '';
1248
+ this.lessText = '';
1249
+ }
1250
+ /**
1251
+ * Open/close dropdown if click on header.
1252
+ * Except, if mode is set to hasButtonForMore. When there is a extra button to open/close
1253
+ */
1254
+ toggleDropdownHeader() {
1255
+ if (!this.hasButtonForMore) {
1256
+ this.toggleDropdown();
1257
+ }
1258
+ }
1259
+ /**
1260
+ * Open or close the dropdown
1261
+ */
1262
+ toggleDropdown() {
1263
+ this.isDropdownOpened = !this.isDropdownOpened;
1264
+ }
1265
+ /**
1266
+ * Set the height of the dropdown list items dynamic - needed for the animation
1267
+ */
1268
+ setDropdownListHeight(contentHeight) {
1269
+ this.targetHeight = `${contentHeight}px`;
1270
+ }
1271
+ }
1272
+ FlyoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FlyoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1273
+ FlyoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FlyoutComponent, selector: "kms-flyout", inputs: { icon: "icon", headerCssClass: "headerCssClass", bodyCssClass: "bodyCssClass", headerTitle: "headerTitle", headerText: "headerText", hasButtonForMore: "hasButtonForMore", moreText: "moreText", lessText: "lessText" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }, { propertyName: "flyoutHeader", first: true, predicate: ["flyoutHeader"], descendants: true }], ngImport: i0, template: "<div class=\"flyout\"\n [ngClass]=\"{'is-active': isDropdownOpened}\"\n>\n <div class=\"flyout-header\" (click)=\"toggleDropdownHeader()\" [ngClass]=\"headerCssClass\">\n <span [innerHtml]=\"headerTitle | kmsSafeHtml\"></span>\n <span [innerHtml]=\"headerText | kmsSafeHtml\"></span>\n\n <ng-content select=\"[header]\"></ng-content>\n\n <div *ngIf=\"hasButtonForMore\" (click)=\"toggleDropdown()\" class=\"flyout-header-more\">\n <span *ngIf=\"!isDropdownOpened\">\n {{ moreText }}\n </span>\n <span *ngIf=\"isDropdownOpened\">\n {{ lessText }}\n </span>\n <kms-icon [icon]=\"'chevron-down'\"\n [iconClass]=\"{'size-16': true, 'is-rotating180': isDropdownOpened}\" >\n </kms-icon>\n </div>\n </div>\n <div \n class=\"flyout-body\"\n [ngClass]=\"bodyCssClass\"\n tabindex=\"0\"\n [@dropdownAnimation]=\"{value: isDropdownOpened, params: {targetHeight: targetHeight, animationTime: '500'}}\"\n getMaxHeight=\"inner\"\n (sumOfHeight)=\"setDropdownListHeight($event)\"\n #flyoutHeader>\n <div class=\"inner\" #content>\n <ng-content ></ng-content>\n </div>\n </div>\n\n</div>\n", styles: [""], components: [{ type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "iconStyle", "iconSize", "dontUseSprite"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: GetMaxHeightDirective, selector: "[getMaxHeight]", inputs: ["getMaxHeight"], outputs: ["maxHeightChanged", "sumOfHeight"] }], pipes: { "kmsSafeHtml": SafeHtmlPipe }, animations: [
1274
+ trigger('dropdownAnimation', [
1275
+ state('true', style({
1276
+ height: '{{targetHeight}}',
1277
+ transition: 'height {{animationTime}}ms ease-in-out',
1278
+ }), {
1279
+ params: {
1280
+ targetHeight: '300px',
1281
+ animationTime: 3000,
1282
+ },
1283
+ }),
1284
+ state('false', style({
1285
+ height: 0,
1286
+ transition: 'height {{animationTime}}ms ease-in-out',
1287
+ }), {
1288
+ params: {
1289
+ targetHeight: '300px',
1290
+ opacity: 0,
1291
+ animationTime: 3000,
1292
+ },
1293
+ }),
1294
+ ]),
1295
+ ] });
1296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FlyoutComponent, decorators: [{
1297
+ type: Component,
1298
+ args: [{ selector: 'kms-flyout', animations: [
1299
+ trigger('dropdownAnimation', [
1300
+ state('true', style({
1301
+ height: '{{targetHeight}}',
1302
+ transition: 'height {{animationTime}}ms ease-in-out',
1303
+ }), {
1304
+ params: {
1305
+ targetHeight: '300px',
1306
+ animationTime: 3000,
1307
+ },
1308
+ }),
1309
+ state('false', style({
1310
+ height: 0,
1311
+ transition: 'height {{animationTime}}ms ease-in-out',
1312
+ }), {
1313
+ params: {
1314
+ targetHeight: '300px',
1315
+ opacity: 0,
1316
+ animationTime: 3000,
1317
+ },
1318
+ }),
1319
+ ]),
1320
+ ], template: "<div class=\"flyout\"\n [ngClass]=\"{'is-active': isDropdownOpened}\"\n>\n <div class=\"flyout-header\" (click)=\"toggleDropdownHeader()\" [ngClass]=\"headerCssClass\">\n <span [innerHtml]=\"headerTitle | kmsSafeHtml\"></span>\n <span [innerHtml]=\"headerText | kmsSafeHtml\"></span>\n\n <ng-content select=\"[header]\"></ng-content>\n\n <div *ngIf=\"hasButtonForMore\" (click)=\"toggleDropdown()\" class=\"flyout-header-more\">\n <span *ngIf=\"!isDropdownOpened\">\n {{ moreText }}\n </span>\n <span *ngIf=\"isDropdownOpened\">\n {{ lessText }}\n </span>\n <kms-icon [icon]=\"'chevron-down'\"\n [iconClass]=\"{'size-16': true, 'is-rotating180': isDropdownOpened}\" >\n </kms-icon>\n </div>\n </div>\n <div \n class=\"flyout-body\"\n [ngClass]=\"bodyCssClass\"\n tabindex=\"0\"\n [@dropdownAnimation]=\"{value: isDropdownOpened, params: {targetHeight: targetHeight, animationTime: '500'}}\"\n getMaxHeight=\"inner\"\n (sumOfHeight)=\"setDropdownListHeight($event)\"\n #flyoutHeader>\n <div class=\"inner\" #content>\n <ng-content ></ng-content>\n </div>\n </div>\n\n</div>\n", styles: [""] }]
1321
+ }], propDecorators: { icon: [{
1322
+ type: Input
1323
+ }], headerCssClass: [{
1324
+ type: Input
1325
+ }], bodyCssClass: [{
1326
+ type: Input
1327
+ }], headerTitle: [{
1328
+ type: Input
1329
+ }], headerText: [{
1330
+ type: Input
1331
+ }], hasButtonForMore: [{
1332
+ type: Input
1333
+ }], moreText: [{
1334
+ type: Input
1335
+ }], lessText: [{
1336
+ type: Input
1337
+ }], content: [{
1338
+ type: ViewChild,
1339
+ args: ['content']
1340
+ }], flyoutHeader: [{
1341
+ type: ViewChild,
1342
+ args: ['flyoutHeader']
1343
+ }] } });
1344
+
1345
+ class IntegerCurrency {
1346
+ constructor(cp) {
1347
+ this.cp = cp;
1348
+ }
1349
+ transform(value, currencyCode, display, digitsInfo) {
1350
+ const currencyPipeValue = this.cp.transform(value, currencyCode, display, digitsInfo);
1351
+ if (currencyPipeValue) {
1352
+ const convertedValue = currencyPipeValue.split(',')[0] + ' ' + currencyPipeValue.slice(-1);
1353
+ return convertedValue;
1354
+ }
1355
+ else {
1356
+ throw new Error("No value provided");
1357
+ }
1358
+ }
1359
+ }
1360
+ IntegerCurrency.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: IntegerCurrency, deps: [{ token: i2.CurrencyPipe }], target: i0.ɵɵFactoryTarget.Pipe });
1361
+ IntegerCurrency.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: IntegerCurrency, name: "kmsIntegerCurrency" });
1362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: IntegerCurrency, decorators: [{
1363
+ type: Pipe,
1364
+ args: [{
1365
+ name: 'kmsIntegerCurrency',
1366
+ }]
1367
+ }], ctorParameters: function () { return [{ type: i2.CurrencyPipe }]; } });
1368
+
1369
+ /*!
1370
+ * @copyright FLYACTS GmbH 2019
1371
+ */
1372
+ class DecodeUriPipe {
1373
+ transform(value, _args) {
1374
+ return decodeURI(value);
1375
+ }
1376
+ }
1377
+ DecodeUriPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DecodeUriPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1378
+ DecodeUriPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DecodeUriPipe, name: "kmsDecodeUri" });
1379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DecodeUriPipe, decorators: [{
1380
+ type: Pipe,
1381
+ args: [{
1382
+ name: 'kmsDecodeUri',
1383
+ }]
1384
+ }] });
1385
+
1386
+ /*!
1387
+ * @copyright FLYACTS GmbH 2019
1388
+ */
1389
+ class EncodeUriPipe {
1390
+ transform(value, _args) {
1391
+ return encodeURI(value);
1392
+ }
1393
+ }
1394
+ EncodeUriPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EncodeUriPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1395
+ EncodeUriPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EncodeUriPipe, name: "kmsEncodeUri" });
1396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EncodeUriPipe, decorators: [{
1397
+ type: Pipe,
1398
+ args: [{
1399
+ name: 'kmsEncodeUri',
1400
+ }]
1401
+ }] });
1402
+
1403
+ /**
1404
+ * @copyright KMS GmbH
1405
+ */
1406
+ class SafeStylePipe {
1407
+ constructor(sanitizer) {
1408
+ this.sanitizer = sanitizer;
1409
+ }
1410
+ transform(style) {
1411
+ return this.sanitizer.bypassSecurityTrustStyle(style);
1412
+ }
1413
+ }
1414
+ SafeStylePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeStylePipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1415
+ SafeStylePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeStylePipe, name: "kmsSafeStyle" });
1416
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeStylePipe, decorators: [{
1417
+ type: Pipe,
1418
+ args: [{
1419
+ name: 'kmsSafeStyle',
1420
+ }]
1421
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
1422
+
1423
+ /**
1424
+ * @copyright KMS GmbH
1425
+ */
1426
+ class SafeUrlPipe {
1427
+ constructor(sanitizer) {
1428
+ this.sanitizer = sanitizer;
1429
+ }
1430
+ transform(url) {
1431
+ return this.sanitizer.bypassSecurityTrustUrl(url);
1432
+ }
1433
+ }
1434
+ SafeUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeUrlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1435
+ SafeUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeUrlPipe, name: "kmsSafeSUrl" });
1436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeUrlPipe, decorators: [{
1437
+ type: Pipe,
1438
+ args: [{
1439
+ name: 'kmsSafeSUrl',
1440
+ }]
1441
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
1442
+
1443
+ /**
1444
+ * @copyright KMS GmbH
1445
+ */
1446
+ class SafeResourceUrlPipe {
1447
+ constructor(sanitizer) {
1448
+ this.sanitizer = sanitizer;
1449
+ }
1450
+ transform(url) {
1451
+ return this.sanitizer.bypassSecurityTrustResourceUrl(url);
1452
+ }
1453
+ }
1454
+ SafeResourceUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeResourceUrlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1455
+ SafeResourceUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeResourceUrlPipe, name: "kmsSafeResourceSUrl" });
1456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SafeResourceUrlPipe, decorators: [{
1457
+ type: Pipe,
1458
+ args: [{
1459
+ name: 'kmsSafeResourceSUrl',
1460
+ }]
1461
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
1462
+
1463
+ class TypeofPipe {
1464
+ transform(value) {
1465
+ return typeof value;
1466
+ }
1467
+ }
1468
+ TypeofPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TypeofPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1469
+ TypeofPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TypeofPipe, name: "kmsTypeOf" });
1470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TypeofPipe, decorators: [{
1471
+ type: Pipe,
1472
+ args: [{
1473
+ name: 'kmsTypeOf',
1474
+ }]
1475
+ }] });
1476
+
1477
+ /**
1478
+ * @copyright KMS GmbH
1479
+ */
1480
+ class TrimPipe {
1481
+ transform(value) {
1482
+ if (!value) {
1483
+ return '';
1484
+ }
1485
+ return value.trim();
1486
+ }
1487
+ }
1488
+ TrimPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TrimPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1489
+ TrimPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TrimPipe, name: "kmsTrim" });
1490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TrimPipe, decorators: [{
1491
+ type: Pipe,
1492
+ args: [{ name: 'kmsTrim' }]
1493
+ }] });
1494
+
1495
+ /**
1496
+ * @copyright KMS GmbH
1497
+ */
1498
+ class ToNumberPipe {
1499
+ transform(items) {
1500
+ if (!items) {
1501
+ return 0;
1502
+ }
1503
+ return parseInt(items, 10);
1504
+ }
1505
+ }
1506
+ ToNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ToNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1507
+ ToNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ToNumberPipe, name: "kmsToNumber", pure: false });
1508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ToNumberPipe, decorators: [{
1509
+ type: Pipe,
1510
+ args: [{
1511
+ name: 'kmsToNumber',
1512
+ pure: false
1513
+ }]
1514
+ }] });
1515
+
1516
+ /**
1517
+ * @copyright KMS GmbH
1518
+ */
1519
+ class CustomPipesModule {
1520
+ }
1521
+ CustomPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CustomPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1522
+ CustomPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CustomPipesModule, declarations: [IntegerCurrency,
1523
+ SafeHtmlPipe,
1524
+ SafeStylePipe,
1525
+ SafeResourceUrlPipe,
1526
+ SafeUrlPipe,
1527
+ EncodeUriPipe,
1528
+ DecodeUriPipe,
1529
+ TypeofPipe,
1530
+ TrimPipe,
1531
+ ToNumberPipe], imports: [CommonModule], exports: [IntegerCurrency,
1532
+ SafeHtmlPipe,
1533
+ SafeStylePipe,
1534
+ SafeResourceUrlPipe,
1535
+ SafeUrlPipe,
1536
+ EncodeUriPipe,
1537
+ DecodeUriPipe,
1538
+ TypeofPipe,
1539
+ TrimPipe,
1540
+ ToNumberPipe] });
1541
+ CustomPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CustomPipesModule, providers: [CurrencyPipe], imports: [[CommonModule]] });
1542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CustomPipesModule, decorators: [{
1543
+ type: NgModule,
1544
+ args: [{
1545
+ declarations: [
1546
+ IntegerCurrency,
1547
+ SafeHtmlPipe,
1548
+ SafeStylePipe,
1549
+ SafeResourceUrlPipe,
1550
+ SafeUrlPipe,
1551
+ EncodeUriPipe,
1552
+ DecodeUriPipe,
1553
+ TypeofPipe,
1554
+ TrimPipe,
1555
+ ToNumberPipe,
1556
+ ],
1557
+ imports: [CommonModule],
1558
+ exports: [
1559
+ IntegerCurrency,
1560
+ SafeHtmlPipe,
1561
+ SafeStylePipe,
1562
+ SafeResourceUrlPipe,
1563
+ SafeUrlPipe,
1564
+ EncodeUriPipe,
1565
+ DecodeUriPipe,
1566
+ TypeofPipe,
1567
+ TrimPipe,
1568
+ ToNumberPipe,
1569
+ ],
1570
+ providers: [CurrencyPipe],
1571
+ }]
1572
+ }] });
1573
+
1574
+ class EnumRadiogroupComponent extends FormControlParentComponent {
1575
+ constructor(formBuilder, renderer) {
1576
+ super(formBuilder, renderer);
1577
+ this.formBuilder = formBuilder;
1578
+ this.renderer = renderer;
1579
+ this.translationPrefix = '';
1580
+ }
1581
+ ngOnInit() {
1582
+ this.optionValues = Object.keys(this.optionsEnum).filter(x => !(parseInt(x) >= 0));
1583
+ this.form = this.formBuilder.group({
1584
+ enumData: [],
1585
+ });
1586
+ this.formInitialized = true;
1587
+ this.form.valueChanges.subscribe((value) => {
1588
+ this.internalValue = value.enumData;
1589
+ this.onChange(value.enumData);
1590
+ });
1591
+ super.ngOnInit();
1592
+ }
1593
+ }
1594
+ EnumRadiogroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EnumRadiogroupComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1595
+ EnumRadiogroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: EnumRadiogroupComponent, selector: "kms-enum-radiogroup", inputs: { header: "header", optionsEnum: "optionsEnum", translationPrefix: "translationPrefix" }, providers: [
1596
+ {
1597
+ provide: NG_VALUE_ACCESSOR,
1598
+ useExisting: forwardRef(() => EnumRadiogroupComponent),
1599
+ multi: true,
1600
+ },
1601
+ ], usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"form\">\n <div>{{ header }}</div>\n <mat-radio-group [formControl]=\"form.controls['enumData']\" [disabled]=\"disabled\" #child>\n <mat-radio-button [value]=\"choice\" [checked]=\"value === choice\" *ngFor=\"let choice of optionValues\">{{ translationPrefix + '.' + choice | translate }}</mat-radio-button>\n </mat-radio-group>\n</form>", components: [{ type: i2$2.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$2.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i5$1.TranslatePipe } });
1602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EnumRadiogroupComponent, decorators: [{
1603
+ type: Component,
1604
+ args: [{ selector: 'kms-enum-radiogroup', providers: [
1605
+ {
1606
+ provide: NG_VALUE_ACCESSOR,
1607
+ useExisting: forwardRef(() => EnumRadiogroupComponent),
1608
+ multi: true,
1609
+ },
1610
+ ], template: "<form [formGroup]=\"form\">\n <div>{{ header }}</div>\n <mat-radio-group [formControl]=\"form.controls['enumData']\" [disabled]=\"disabled\" #child>\n <mat-radio-button [value]=\"choice\" [checked]=\"value === choice\" *ngFor=\"let choice of optionValues\">{{ translationPrefix + '.' + choice | translate }}</mat-radio-button>\n </mat-radio-group>\n</form>" }]
1611
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.Renderer2 }]; }, propDecorators: { header: [{
1612
+ type: Input
1613
+ }], optionsEnum: [{
1614
+ type: Input
1615
+ }], translationPrefix: [{
1616
+ type: Input
1617
+ }] } });
1618
+
1619
+ /*!
1620
+ * @copyright FLYACTS GmbH 2019
1621
+ */
1622
+ /**
1623
+ * A generic dialog component
1624
+ */
1625
+ class KMSAccordionItemComponent {
1626
+ constructor(sanitizer) {
1627
+ this.sanitizer = sanitizer;
1628
+ this.itemTitle = '';
1629
+ this.showAsCard = false;
1630
+ this.isSmall = false;
1631
+ this.expanded = false;
1632
+ this.panelOpenState = false;
1633
+ }
1634
+ ngOnInit() {
1635
+ this.itemTitleTrustHtml = this.sanitizer.bypassSecurityTrustHtml(this.itemTitle);
1636
+ }
1637
+ }
1638
+ KMSAccordionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KMSAccordionItemComponent, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
1639
+ KMSAccordionItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: KMSAccordionItemComponent, selector: "kms-accordion-item", inputs: { itemTitle: "itemTitle", showAsCard: "showAsCard", isSmall: "isSmall", expanded: "expanded" }, ngImport: i0, template: "<mat-expansion-panel\n class=\"accordion-item\"\n [ngClass]=\"{showAsCard: showAsCard, showFlat: !showAsCard, isSmall: isSmall}\"\n (opened)=\"panelOpenState = true\"\n (closed)=\"panelOpenState = false\"\n [expanded] = \"expanded\"\n hideToggle=\"true\">\n <mat-expansion-panel-header class=\"accordion-item-header\">\n <mat-panel-title class=\"mat-subheading-2 accordion-item-title\">\n <div [innerHtml]=\"itemTitleTrustHtml\"></div>\n <ng-content select=\"[itemTitleElement]\"></ng-content>\n </mat-panel-title>\n <div class=\"accordion-item-header-icon-wrapper\">\n <kms-icon *ngIf=\"!panelOpenState\" icon=\"ic_plus\" iconClass=\"color-red\" class=\"accordion-item-header-icon-wrapper-desktop\"></kms-icon>\n <kms-icon *ngIf=\"panelOpenState\" icon=\"ic_minus\" iconClass=\"color-red\" class=\"accordion-item-header-icon-wrapper-desktop\"></kms-icon>\n\n <kms-icon *ngIf=\"!panelOpenState\" icon=\"chevron-down\" iconClass=\"color-red\" class=\"accordion-item-header-icon-wrapper-mobile\"></kms-icon>\n <kms-icon *ngIf=\"panelOpenState\" icon=\"chevron-top\" iconClass=\"color-red\" class=\"accordion-item-header-icon-wrapper-mobile\"></kms-icon>\n </div>\n </mat-expansion-panel-header>\n <ng-content></ng-content>\n</mat-expansion-panel>\n", styles: [""], components: [{ type: i2$4.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i2$4.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "iconStyle", "iconSize", "dontUseSprite"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$4.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1640
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KMSAccordionItemComponent, decorators: [{
1641
+ type: Component,
1642
+ args: [{ selector: 'kms-accordion-item', template: "<mat-expansion-panel\n class=\"accordion-item\"\n [ngClass]=\"{showAsCard: showAsCard, showFlat: !showAsCard, isSmall: isSmall}\"\n (opened)=\"panelOpenState = true\"\n (closed)=\"panelOpenState = false\"\n [expanded] = \"expanded\"\n hideToggle=\"true\">\n <mat-expansion-panel-header class=\"accordion-item-header\">\n <mat-panel-title class=\"mat-subheading-2 accordion-item-title\">\n <div [innerHtml]=\"itemTitleTrustHtml\"></div>\n <ng-content select=\"[itemTitleElement]\"></ng-content>\n </mat-panel-title>\n <div class=\"accordion-item-header-icon-wrapper\">\n <kms-icon *ngIf=\"!panelOpenState\" icon=\"ic_plus\" iconClass=\"color-red\" class=\"accordion-item-header-icon-wrapper-desktop\"></kms-icon>\n <kms-icon *ngIf=\"panelOpenState\" icon=\"ic_minus\" iconClass=\"color-red\" class=\"accordion-item-header-icon-wrapper-desktop\"></kms-icon>\n\n <kms-icon *ngIf=\"!panelOpenState\" icon=\"chevron-down\" iconClass=\"color-red\" class=\"accordion-item-header-icon-wrapper-mobile\"></kms-icon>\n <kms-icon *ngIf=\"panelOpenState\" icon=\"chevron-top\" iconClass=\"color-red\" class=\"accordion-item-header-icon-wrapper-mobile\"></kms-icon>\n </div>\n </mat-expansion-panel-header>\n <ng-content></ng-content>\n</mat-expansion-panel>\n", styles: [""] }]
1643
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; }, propDecorators: { itemTitle: [{
1644
+ type: Input
1645
+ }], showAsCard: [{
1646
+ type: Input
1647
+ }], isSmall: [{
1648
+ type: Input
1649
+ }], expanded: [{
1650
+ type: Input
1651
+ }] } });
1652
+
1653
+ /**
1654
+ * @copyright KMS GmbH
1655
+ */
1656
+ /**
1657
+ * Service to get viewport
1658
+ */
1659
+ class ViewportService {
1660
+ constructor(platformId) {
1661
+ this.platformId = platformId;
1662
+ this.viewports = [
1663
+ {
1664
+ name: 'xs',
1665
+ low: 420,
1666
+ high: 990,
1667
+ },
1668
+ {
1669
+ name: 's',
1670
+ low: 991,
1671
+ high: 1024,
1672
+ },
1673
+ {
1674
+ name: 'm',
1675
+ low: 1025,
1676
+ high: 1200,
1677
+ },
1678
+ {
1679
+ name: 'l',
1680
+ low: 12001,
1681
+ high: 1400,
1682
+ },
1683
+ {
1684
+ name: 'xl',
1685
+ low: 1401,
1686
+ high: 1600,
1687
+ },
1688
+ {
1689
+ name: 'xxl',
1690
+ low: 1601,
1691
+ high: 1920,
1692
+ },
1693
+ {
1694
+ name: 'xxxl',
1695
+ low: 1921,
1696
+ high: 99999,
1697
+ },
1698
+ ];
1699
+ this.viewportChangedSubscriber = new Subject();
1700
+ this.viewportResizedSubscriber = new Subject();
1701
+ if (isPlatformBrowser(this.platformId)) {
1702
+ window.addEventListener('resize', this.documentSizeChanged.bind(this), { passive: true });
1703
+ }
1704
+ }
1705
+ /**
1706
+ * Get window height
1707
+ */
1708
+ getDocumentHeight() {
1709
+ return isPlatformBrowser(this.platformId) ? document.body.clientHeight : 1200;
1710
+ }
1711
+ /**
1712
+ * Get window width
1713
+ */
1714
+ getDocumentWidth() {
1715
+ return isPlatformBrowser(this.platformId) ? document.body.clientWidth : 1200;
1716
+ }
1717
+ /**
1718
+ * Get window height
1719
+ */
1720
+ getWindowHeight() {
1721
+ return isPlatformBrowser(this.platformId) ? window.innerHeight : 1200;
1722
+ }
1723
+ /**
1724
+ * Get window width
1725
+ */
1726
+ getWindowWidth() {
1727
+ return isPlatformBrowser(this.platformId) ? window.innerWidth : 1200;
1728
+ }
1729
+ /**
1730
+ * Returns the current viewport MQ as string
1731
+ * @returns string
1732
+ */
1733
+ getCurrentViewPort() {
1734
+ if (!this.currentViewport) {
1735
+ const currentWidth = isPlatformBrowser(this.platformId) ? document.body.clientWidth : 1200;
1736
+ this.currentViewport = this.convertWidthToMediaQuery(currentWidth);
1737
+ }
1738
+ return this.currentViewport;
1739
+ }
1740
+ /**
1741
+ * Provides mq´s as string
1742
+ */
1743
+ getViewportChangedObserver() {
1744
+ return this.viewportChangedSubscriber.asObservable();
1745
+ }
1746
+ /**
1747
+ * Provides the current window width as number
1748
+ */
1749
+ getViewportResizedObserver() {
1750
+ return this.viewportResizedSubscriber.asObservable();
1751
+ }
1752
+ scrollToElementId(el, alignCenter = false) {
1753
+ if (isPlatformBrowser(this.platformId)) {
1754
+ this.scrollToElement(document.querySelector('#' + el), alignCenter);
1755
+ }
1756
+ }
1757
+ /**
1758
+ * Helper function that scrolls to the given markup element.
1759
+ * @param el - nativeElement from markup
1760
+ * @param alignCenter - defines if the element needs to be centered on window
1761
+ */
1762
+ scrollToElement(el, alignCenter = false) {
1763
+ if (isPlatformBrowser(this.platformId)) {
1764
+ let extraScrollTop = 0;
1765
+ if (alignCenter) {
1766
+ extraScrollTop = (window.innerHeight - el.clientHeight) / 2;
1767
+ }
1768
+ /*
1769
+ const elementPos: DOMRect = el.getBoundingClientRect();
1770
+ const scrollTopPosition = elementPos.x - extraScrollTop;
1771
+ */
1772
+ //let offsetLeft = 0;
1773
+ let offsetTop = 0;
1774
+ let elTemp = el;
1775
+ while (elTemp) {
1776
+ //offsetLeft += elTemp.offsetLeft;
1777
+ offsetTop += elTemp.offsetTop;
1778
+ elTemp = elTemp.parentElement ? elTemp.parentElement : null;
1779
+ }
1780
+ window.scrollTo({ left: 0, top: offsetTop - extraScrollTop, behavior: 'smooth' });
1781
+ }
1782
+ }
1783
+ /**
1784
+ * Scroll to the top position
1785
+ * @param top - top position value
1786
+ */
1787
+ scrollTop(top) {
1788
+ if (isPlatformBrowser(this.platformId)) {
1789
+ window.scrollTo({ left: 0, top: top, behavior: 'smooth' });
1790
+ }
1791
+ }
1792
+ ngOnDestroy() {
1793
+ if (isPlatformBrowser(this.platformId)) {
1794
+ window.removeEventListener('resize', this.documentSizeChanged);
1795
+ }
1796
+ }
1797
+ /**
1798
+ * If viewport changed
1799
+ * @event
1800
+ */
1801
+ documentSizeChanged(event) {
1802
+ const currentWindowWidth = event.target.innerWidth;
1803
+ // inform who´s interested
1804
+ this.viewportResizedSubscriber.next(currentWindowWidth);
1805
+ if (currentWindowWidth > 0) {
1806
+ for (const mqs of this.viewports) {
1807
+ if (currentWindowWidth > mqs.high) {
1808
+ continue;
1809
+ }
1810
+ else if ((currentWindowWidth >= mqs.low || currentWindowWidth <= mqs.high) &&
1811
+ this.currentViewport !== mqs.name) {
1812
+ this.currentViewport = mqs.name;
1813
+ // inform who´s interested
1814
+ this.viewportChangedSubscriber.next(mqs.name);
1815
+ break;
1816
+ }
1817
+ else if (this.currentViewport === mqs.name) {
1818
+ break;
1819
+ }
1820
+ else {
1821
+ console.error('ERROR');
1822
+ }
1823
+ }
1824
+ }
1825
+ }
1826
+ /**
1827
+ * Get the Media Query for the given width
1828
+ * @param width Width to get the according MQ for
1829
+ */
1830
+ convertWidthToMediaQuery(width) {
1831
+ let currentViewport = '';
1832
+ for (const mqs of this.viewports) {
1833
+ if (width <= mqs.high && width >= mqs.low) {
1834
+ currentViewport = mqs.name;
1835
+ break;
1836
+ }
1837
+ }
1838
+ return currentViewport;
1839
+ }
1840
+ isPortrait() {
1841
+ if (isPlatformBrowser(this.platformId))
1842
+ return window.innerHeight > window.innerWidth;
1843
+ else
1844
+ return;
1845
+ }
1846
+ isLandscape() {
1847
+ if (isPlatformBrowser(this.platformId)) {
1848
+ const isLandscape = window.orientation === 90 || window.orientation === -90;
1849
+ return isLandscape;
1850
+ }
1851
+ else {
1852
+ return;
1853
+ }
1854
+ }
1855
+ }
1856
+ ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ViewportService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
1857
+ ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ViewportService });
1858
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ViewportService, decorators: [{
1859
+ type: Injectable
1860
+ }], ctorParameters: function () {
1861
+ return [{ type: Object, decorators: [{
1862
+ type: Inject,
1863
+ args: [PLATFORM_ID]
1864
+ }] }];
1865
+ } });
1866
+
1867
+ /*!
1868
+ * @copyright FLYACTS GmbH 2019
1869
+ */
1870
+ /**
1871
+ * MarkerOptions class for Marker
1872
+ */
1873
+ class MarkerOptions {
1874
+ }
1875
+ /**
1876
+ * MarkerLabel class for Marker
1877
+ */
1878
+ class MarkerLabel {
1879
+ }
1880
+ /**
1881
+ * Marker class
1882
+ */
1883
+ class Marker {
1884
+ }
1885
+ /**
1886
+ * Component to show marker on google map for specific address
1887
+ */
1888
+ class MapComponent {
1889
+ //
1890
+ constructor(viewPortService) {
1891
+ this.viewPortService = viewPortService;
1892
+ this.markers = [];
1893
+ this.geoDataFoundForAddress = false;
1894
+ this.widthSet = false;
1895
+ this.width = '100%';
1896
+ this.zoom = 15;
1897
+ this.center = {
1898
+ lat: 52.097449,
1899
+ lng: 12.7436911,
1900
+ };
1901
+ this.options = {
1902
+ mapTypeId: 'roadmap',
1903
+ zoomControl: false,
1904
+ scrollwheel: false,
1905
+ disableDoubleClickZoom: true,
1906
+ maxZoom: 15,
1907
+ minZoom: 8,
1908
+ };
1909
+ }
1910
+ ngOnInit() {
1911
+ this.findLocation(this.data.Street + ' ' + this.data.Zip + ' ' + this.data.City);
1912
+ }
1913
+ /**
1914
+ * Asks google for geocoordinates of a given address string
1915
+ * @input address as string
1916
+ */
1917
+ findLocation(address) {
1918
+ if (!this.geocoder) {
1919
+ this.geocoder = new google.maps.Geocoder();
1920
+ }
1921
+ this.geocoder.geocode({
1922
+ 'address': address,
1923
+ }, (results, status) => {
1924
+ if (status === google.maps.GeocoderStatus.OK) {
1925
+ this.center.lat = results[0].geometry.location.lat();
1926
+ this.center.lng = results[0].geometry.location.lng();
1927
+ this.addMarker();
1928
+ this.geoDataFoundForAddress = true;
1929
+ }
1930
+ else {
1931
+ console.error('Sorry, this search of map address produced no results.');
1932
+ }
1933
+ });
1934
+ }
1935
+ /**
1936
+ * Adds a marker to the map
1937
+ */
1938
+ addMarker() {
1939
+ this.markers.push({
1940
+ position: {
1941
+ lat: this.center.lat,
1942
+ lng: this.center.lng,
1943
+ },
1944
+ label: {
1945
+ color: 'blue',
1946
+ text: this.data.Name1 || '',
1947
+ },
1948
+ title: this.data.Name1 + ' ' + this.data.Street + ' ' + this.data.Zip,
1949
+ options: { animation: google.maps.Animation.DROP },
1950
+ });
1951
+ }
1952
+ /**
1953
+ * Zooms in into map
1954
+ */
1955
+ zoomIn() {
1956
+ if (this.options.maxZoom && this.zoom < this.options.maxZoom) {
1957
+ this.zoom++;
1958
+ }
1959
+ }
1960
+ /**
1961
+ * Zooms out from map
1962
+ */
1963
+ zoomOut() {
1964
+ if (this.options.minZoom && this.zoom > this.options.minZoom) {
1965
+ this.zoom--;
1966
+ }
1967
+ }
1968
+ }
1969
+ MapComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MapComponent, deps: [{ token: ViewportService }], target: i0.ɵɵFactoryTarget.Component });
1970
+ MapComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: MapComponent, selector: "kms-map", inputs: { data: "data" }, ngImport: i0, template: "<div *ngIf=\"geoDataFoundForAddress && widthSet\">\n <google-map\n height=\"415px\"\n [width]=\"width\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n [options]=\"options\"\n >\n <map-marker\n *ngFor=\"let marker of markers\"\n [position]=\"marker.position\"\n [label]=\"marker.label\"\n [title]=\"marker.title\"\n [options]=\"marker.options\"\n >\n </map-marker>\n </google-map>\n</div>", styles: [""], components: [{ type: i2$5.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$5.MapMarker, selector: "map-marker", inputs: ["title", "position", "label", "clickable", "options", "icon", "visible"], outputs: ["animationChanged", "mapClick", "clickableChanged", "cursorChanged", "mapDblclick", "mapDrag", "mapDragend", "draggableChanged", "mapDragstart", "flatChanged", "iconChanged", "mapMousedown", "mapMouseout", "mapMouseover", "mapMouseup", "positionChanged", "mapRightclick", "shapeChanged", "titleChanged", "visibleChanged", "zindexChanged"], exportAs: ["mapMarker"] }] });
1971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MapComponent, decorators: [{
1972
+ type: Component,
1973
+ args: [{ selector: 'kms-map', template: "<div *ngIf=\"geoDataFoundForAddress && widthSet\">\n <google-map\n height=\"415px\"\n [width]=\"width\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n [options]=\"options\"\n >\n <map-marker\n *ngFor=\"let marker of markers\"\n [position]=\"marker.position\"\n [label]=\"marker.label\"\n [title]=\"marker.title\"\n [options]=\"marker.options\"\n >\n </map-marker>\n </google-map>\n</div>", styles: [""] }]
1974
+ }], ctorParameters: function () { return [{ type: ViewportService }]; }, propDecorators: { data: [{
1975
+ type: Input
1976
+ }] } });
1977
+
1978
+ // TODO change values after cleaned up database
1979
+ var SalutationEnum;
1980
+ (function (SalutationEnum) {
1981
+ SalutationEnum["NOT_SPECIFIED"] = "Keine Anrede";
1982
+ SalutationEnum["MALE"] = "Herr";
1983
+ SalutationEnum["FEMALE"] = "Frau";
1984
+ })(SalutationEnum || (SalutationEnum = {}));
1985
+
1986
+ class SalutationDropdownComponent extends FormControlParentComponent {
1987
+ constructor(formBuilder, renderer) {
1988
+ super(formBuilder, renderer);
1989
+ this.formBuilder = formBuilder;
1990
+ this.renderer = renderer;
1991
+ //For view
1992
+ this.SalutationEnum = SalutationEnum;
1993
+ this.Object = Object;
1994
+ }
1995
+ ngOnInit() {
1996
+ this.form = this.formBuilder.group({
1997
+ salut: [],
1998
+ });
1999
+ this.formInitialized = true;
2000
+ //somehow for dropowns we have to set value manually with timeout for default value
2001
+ setTimeout(() => {
2002
+ this.form.controls['salut'].setValue(this.value ? this.value : '');
2003
+ }, 1000);
2004
+ this.form.valueChanges.subscribe((value) => {
2005
+ this.onChange(value.salut);
2006
+ });
2007
+ super.ngOnInit();
2008
+ }
2009
+ }
2010
+ SalutationDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SalutationDropdownComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
2011
+ SalutationDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SalutationDropdownComponent, selector: "kms-salutation-dropdown", inputs: { placeholder: "placeholder" }, providers: [
2012
+ {
2013
+ provide: NG_VALUE_ACCESSOR,
2014
+ useExisting: forwardRef(() => SalutationDropdownComponent),
2015
+ multi: true,
2016
+ },
2017
+ ], usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"form\" class=\"row\">\n <mat-form-field class=\"col\">\n <mat-select disableOptionCentering [formControl]=\"form.controls['salut']\" [placeholder]=\"placeholder\" [value]=\"value\" #child>\n <mat-option [value]=\"SalutationEnum.NOT_SPECIFIED\">{{ 'general.salutation.' + Object.keys(SalutationEnum)[0]?.toLowerCase() | translate }}</mat-option>\n <mat-option [value]=\"SalutationEnum.MALE\">{{ 'general.salutation.' + Object.keys(SalutationEnum)[1]?.toLowerCase() | translate }}</mat-option>\n <mat-option [value]=\"SalutationEnum.FEMALE\">{{ 'general.salutation.' + Object.keys(SalutationEnum)[2]?.toLowerCase() | translate }}</mat-option>\n </mat-select>\n </mat-form-field>\n</form>", components: [{ type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i4.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i5$1.TranslatePipe } });
2018
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SalutationDropdownComponent, decorators: [{
2019
+ type: Component,
2020
+ args: [{ selector: 'kms-salutation-dropdown', providers: [
2021
+ {
2022
+ provide: NG_VALUE_ACCESSOR,
2023
+ useExisting: forwardRef(() => SalutationDropdownComponent),
2024
+ multi: true,
2025
+ },
2026
+ ], template: "<form [formGroup]=\"form\" class=\"row\">\n <mat-form-field class=\"col\">\n <mat-select disableOptionCentering [formControl]=\"form.controls['salut']\" [placeholder]=\"placeholder\" [value]=\"value\" #child>\n <mat-option [value]=\"SalutationEnum.NOT_SPECIFIED\">{{ 'general.salutation.' + Object.keys(SalutationEnum)[0]?.toLowerCase() | translate }}</mat-option>\n <mat-option [value]=\"SalutationEnum.MALE\">{{ 'general.salutation.' + Object.keys(SalutationEnum)[1]?.toLowerCase() | translate }}</mat-option>\n <mat-option [value]=\"SalutationEnum.FEMALE\">{{ 'general.salutation.' + Object.keys(SalutationEnum)[2]?.toLowerCase() | translate }}</mat-option>\n </mat-select>\n </mat-form-field>\n</form>" }]
2027
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.Renderer2 }]; }, propDecorators: { placeholder: [{
2028
+ type: Input
2029
+ }] } });
2030
+
2031
+ class TooltipComponent {
2032
+ constructor() {
2033
+ this.tooltipTitle = "";
2034
+ }
2035
+ }
2036
+ TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2037
+ TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: TooltipComponent, selector: "kms-tooltip-element", inputs: { tooltipTitle: "tooltipTitle" }, ngImport: i0, template: "<ng-content></ng-content>", styles: ["[kmsTooltip]{position:relative}\n"] });
2038
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TooltipComponent, decorators: [{
2039
+ type: Component,
2040
+ args: [{ selector: 'kms-tooltip-element', template: "<ng-content></ng-content>", styles: ["[kmsTooltip]{position:relative}\n"] }]
2041
+ }], propDecorators: { tooltipTitle: [{
2042
+ type: Input
2043
+ }] } });
2044
+
2045
+ class SalutationRadiogroupComponent extends FormControlParentComponent {
2046
+ constructor(formBuilder, renderer) {
2047
+ super(formBuilder, renderer);
2048
+ this.formBuilder = formBuilder;
2049
+ this.renderer = renderer;
2050
+ //For view
2051
+ this.SalutationEnum = SalutationEnum;
2052
+ this.Object = Object;
2053
+ }
2054
+ ngOnInit() {
2055
+ this.form = this.formBuilder.group({
2056
+ salut: [isValue(this.value) ? this.value : '', null],
2057
+ });
2058
+ this.formInitialized = true;
2059
+ this.form.valueChanges.subscribe((value) => {
2060
+ this.internalValue = value.salut;
2061
+ this.onChange(value.salut);
2062
+ });
2063
+ super.ngOnInit();
2064
+ }
2065
+ }
2066
+ SalutationRadiogroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SalutationRadiogroupComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
2067
+ SalutationRadiogroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SalutationRadiogroupComponent, selector: "kms-salutation-radiogroup", providers: [
2068
+ {
2069
+ provide: NG_VALUE_ACCESSOR,
2070
+ useExisting: forwardRef(() => SalutationRadiogroupComponent),
2071
+ multi: true,
2072
+ },
2073
+ ], usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"form\" >\n <mat-radio-group [formControl]=\"form.controls['salut']\" [disabled]=\"disabled\" #radioGroup>\n <mat-radio-button color=\"primary\" [value]=\"SalutationEnum.NOT_SPECIFIED\" [checked]=\"value === SalutationEnum.NOT_SPECIFIED\">\n {{ 'general.salutation.' + Object.keys(SalutationEnum)[0]?.toLowerCase() | translate }}\n </mat-radio-button>\n <mat-radio-button color=\"primary\" [value]=\"SalutationEnum.MALE\" [checked]=\"value === SalutationEnum.MALE\">\n {{ 'general.salutation.' + Object.keys(SalutationEnum)[1]?.toLowerCase() | translate }}\n </mat-radio-button>\n <mat-radio-button color=\"primary\" [value]=\"SalutationEnum.FEMALE\" [checked]=\"value === SalutationEnum.FEMALE\">\n {{ 'general.salutation.' + Object.keys(SalutationEnum)[2]?.toLowerCase() | translate }}\n </mat-radio-button>\n </mat-radio-group>\n</form>", components: [{ type: i2$2.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$2.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i5$1.TranslatePipe } });
2074
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SalutationRadiogroupComponent, decorators: [{
2075
+ type: Component,
2076
+ args: [{ selector: 'kms-salutation-radiogroup', providers: [
2077
+ {
2078
+ provide: NG_VALUE_ACCESSOR,
2079
+ useExisting: forwardRef(() => SalutationRadiogroupComponent),
2080
+ multi: true,
2081
+ },
2082
+ ], template: "<form [formGroup]=\"form\" >\n <mat-radio-group [formControl]=\"form.controls['salut']\" [disabled]=\"disabled\" #radioGroup>\n <mat-radio-button color=\"primary\" [value]=\"SalutationEnum.NOT_SPECIFIED\" [checked]=\"value === SalutationEnum.NOT_SPECIFIED\">\n {{ 'general.salutation.' + Object.keys(SalutationEnum)[0]?.toLowerCase() | translate }}\n </mat-radio-button>\n <mat-radio-button color=\"primary\" [value]=\"SalutationEnum.MALE\" [checked]=\"value === SalutationEnum.MALE\">\n {{ 'general.salutation.' + Object.keys(SalutationEnum)[1]?.toLowerCase() | translate }}\n </mat-radio-button>\n <mat-radio-button color=\"primary\" [value]=\"SalutationEnum.FEMALE\" [checked]=\"value === SalutationEnum.FEMALE\">\n {{ 'general.salutation.' + Object.keys(SalutationEnum)[2]?.toLowerCase() | translate }}\n </mat-radio-button>\n </mat-radio-group>\n</form>" }]
2083
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.Renderer2 }]; } });
2084
+
2085
+ /**
2086
+ * @copyright KMS GmbH
2087
+ */
2088
+ class BackToTopComponent {
2089
+ constructor(platformId) {
2090
+ this.platformId = platformId;
2091
+ }
2092
+ onWindowScroll() {
2093
+ if (isPlatformBrowser(this.platformId)) {
2094
+ if (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop > 100) {
2095
+ this.windowScrolled = true;
2096
+ }
2097
+ else if ((this.windowScrolled && window.pageYOffset) ||
2098
+ document.documentElement.scrollTop ||
2099
+ document.body.scrollTop < 10) {
2100
+ this.windowScrolled = false;
2101
+ }
2102
+ }
2103
+ }
2104
+ scrollToTop() {
2105
+ if (isPlatformBrowser(this.platformId)) {
2106
+ (function smoothscroll() {
2107
+ const currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
2108
+ if (currentScroll > 0) {
2109
+ window.requestAnimationFrame(smoothscroll);
2110
+ window.scrollTo(0, currentScroll - currentScroll / 8);
2111
+ }
2112
+ })();
2113
+ }
2114
+ }
2115
+ }
2116
+ BackToTopComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BackToTopComponent, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
2117
+ BackToTopComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: BackToTopComponent, selector: "kms-back-to-top", host: { listeners: { "window:scroll": "onWindowScroll()" } }, ngImport: i0, template: "<div class=\"scrollToTop\"\n [ngClass]=\"{'show': windowScrolled}\"\n (click)=\"scrollToTop()\">\n <div class=\"scrollToTop-inner\">\n <kms-icon icon=\"floating_button_clear\" iconClass=\"color-white\"></kms-icon>\n </div>\n</div>", components: [{ type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "iconStyle", "iconSize", "dontUseSprite"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BackToTopComponent, decorators: [{
2119
+ type: Component,
2120
+ args: [{ selector: 'kms-back-to-top', template: "<div class=\"scrollToTop\"\n [ngClass]=\"{'show': windowScrolled}\"\n (click)=\"scrollToTop()\">\n <div class=\"scrollToTop-inner\">\n <kms-icon icon=\"floating_button_clear\" iconClass=\"color-white\"></kms-icon>\n </div>\n</div>" }]
2121
+ }], ctorParameters: function () {
2122
+ return [{ type: Object, decorators: [{
2123
+ type: Inject,
2124
+ args: [PLATFORM_ID]
2125
+ }] }];
2126
+ }, propDecorators: { onWindowScroll: [{
2127
+ type: HostListener,
2128
+ args: ['window:scroll', []]
2129
+ }] } });
2130
+
2131
+ var ButtonResponseType;
2132
+ (function (ButtonResponseType) {
2133
+ ButtonResponseType["primary"] = "primary";
2134
+ ButtonResponseType["secondary"] = "secondary";
2135
+ })(ButtonResponseType || (ButtonResponseType = {}));
2136
+
2137
+ /**
2138
+ * @copyright KMS GmbH
2139
+ */
2140
+ /**
2141
+ * A generic dialog component
2142
+ */
2143
+ class GenericDialogComponent {
2144
+ constructor(dialogRef, zone, data) {
2145
+ this.dialogRef = dialogRef;
2146
+ this.zone = zone;
2147
+ this.data = data;
2148
+ this.ButtonResponseType = ButtonResponseType;
2149
+ if (isValue(data.buttons)) {
2150
+ this.buttons = data.buttons;
2151
+ }
2152
+ else {
2153
+ this.buttons = { primary: 'Yes', secondary: 'No' };
2154
+ }
2155
+ }
2156
+ /**
2157
+ * Action called when clicked
2158
+ * @param clickedButton Whether the primary or secondary button was clicked
2159
+ */
2160
+ onClickAction(clickedButton) {
2161
+ this.zone.run(() => {
2162
+ this.dialogRef.close(clickedButton);
2163
+ this.dialogRef.afterClosed().subscribe(() => {
2164
+ const buttonList = document.querySelectorAll('.mat-flat-button, .mat-button');
2165
+ let i = 0;
2166
+ for (i; i < buttonList.length; i++) {
2167
+ buttonList[i].classList.remove('cdk-focused');
2168
+ buttonList[i].classList.remove('cdk-program-focused');
2169
+ }
2170
+ });
2171
+ });
2172
+ }
2173
+ }
2174
+ GenericDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: GenericDialogComponent, deps: [{ token: i1$4.MatDialogRef }, { token: i0.NgZone }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2175
+ GenericDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: GenericDialogComponent, selector: "kms-generic-dialog", ngImport: i0, template: "<div mat-dialog-title class=\"mat-dialog-title\">\n <h3>{{ data.title }}</h3>\n</div>\n<div mat-dialog-content class=\"mat-dialog-content\">\n {{ data.message }}\n</div>\n<div mat-dialog-actions class=\"custom-dialog-actions\">\n <button\n mat-flat-button\n class=\"test_secondary_button\"\n color=\"accent\"\n (click)=\"onClickAction(ButtonResponseType.secondary)\"\n >\n {{ buttons.secondary }}\n </button>\n <button\n mat-flat-button\n class=\"test_primary_button\"\n color=\"primary\"\n (click)=\"onClickAction(ButtonResponseType.primary)\"\n >\n {{ buttons.primary }}\n </button>\n</div>\n", styles: [""], components: [{ type: i2$3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
2176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: GenericDialogComponent, decorators: [{
2177
+ type: Component,
2178
+ args: [{ selector: 'kms-generic-dialog', template: "<div mat-dialog-title class=\"mat-dialog-title\">\n <h3>{{ data.title }}</h3>\n</div>\n<div mat-dialog-content class=\"mat-dialog-content\">\n {{ data.message }}\n</div>\n<div mat-dialog-actions class=\"custom-dialog-actions\">\n <button\n mat-flat-button\n class=\"test_secondary_button\"\n color=\"accent\"\n (click)=\"onClickAction(ButtonResponseType.secondary)\"\n >\n {{ buttons.secondary }}\n </button>\n <button\n mat-flat-button\n class=\"test_primary_button\"\n color=\"primary\"\n (click)=\"onClickAction(ButtonResponseType.primary)\"\n >\n {{ buttons.primary }}\n </button>\n</div>\n", styles: [""] }]
2179
+ }], ctorParameters: function () {
2180
+ return [{ type: i1$4.MatDialogRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
2181
+ type: Inject,
2182
+ args: [MAT_DIALOG_DATA]
2183
+ }] }];
2184
+ } });
2185
+
2186
+ class ButtonWithConfirmDialogComponent {
2187
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2188
+ constructor(dialog) {
2189
+ this.dialog = dialog;
2190
+ // Outputs when dialogue was closed. Returns true, if yes was clicked, false otherwise
2191
+ this.onConfirmClosed = new EventEmitter();
2192
+ this.subs = new SubSink();
2193
+ }
2194
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2195
+ ngOnInit() { }
2196
+ start() {
2197
+ const data = {
2198
+ title: this.confirmTitle,
2199
+ buttons: {
2200
+ primary: this.confirmTextYes,
2201
+ secondary: this.confirmTextNo,
2202
+ }
2203
+ };
2204
+ const dialogRef = this.dialog.open(GenericDialogComponent, {
2205
+ data: data,
2206
+ });
2207
+ this.subs.sink = dialogRef.afterClosed().subscribe(result => {
2208
+ if (result === ButtonResponseType.primary) {
2209
+ this.onConfirmClosed.emit(true);
2210
+ }
2211
+ else {
2212
+ this.onConfirmClosed.emit(false);
2213
+ }
2214
+ dialogRef.close();
2215
+ });
2216
+ }
2217
+ }
2218
+ ButtonWithConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ButtonWithConfirmDialogComponent, deps: [{ token: i1$4.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2219
+ ButtonWithConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ButtonWithConfirmDialogComponent, selector: "kms-button-with-confirm-dialog", inputs: { disabled: "disabled", buttonText: "buttonText", confirmTitle: "confirmTitle", confirmTextYes: "confirmTextYes", confirmTextNo: "confirmTextNo" }, outputs: { onConfirmClosed: "onConfirmClosed" }, ngImport: i0, template: "<button\n type=\"button\"\n (click)=\"start()\"\n mat-stroked-button\n [disabled]=\"disabled\"\n>\n {{ buttonText }}\n</button>\n", styles: [""], components: [{ type: i2$3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
2220
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ButtonWithConfirmDialogComponent, decorators: [{
2221
+ type: Component,
2222
+ args: [{ selector: 'kms-button-with-confirm-dialog', template: "<button\n type=\"button\"\n (click)=\"start()\"\n mat-stroked-button\n [disabled]=\"disabled\"\n>\n {{ buttonText }}\n</button>\n", styles: [""] }]
2223
+ }], ctorParameters: function () { return [{ type: i1$4.MatDialog }]; }, propDecorators: { disabled: [{
2224
+ type: Input
2225
+ }], buttonText: [{
2226
+ type: Input
2227
+ }], confirmTitle: [{
2228
+ type: Input
2229
+ }], confirmTextYes: [{
2230
+ type: Input
2231
+ }], confirmTextNo: [{
2232
+ type: Input
2233
+ }], onConfirmClosed: [{
2234
+ type: Output
2235
+ }] } });
2236
+
2237
+ /**
2238
+ * Dropdown from data component {@link https://leaseplan-dev.rentoffice.de/styleguide#ui-elements}
2239
+ */
2240
+ class DropdownFromDataComponent extends FormControlParentComponent {
2241
+ constructor(formBuilder, renderer) {
2242
+ super(formBuilder, renderer);
2243
+ this.formBuilder = formBuilder;
2244
+ this.renderer = renderer;
2245
+ // options for the dropdown have a null value at the beginning of the array
2246
+ this.hasNullOption = false;
2247
+ this.placeholder = '';
2248
+ this.label = '';
2249
+ this.required = false;
2250
+ this.useEnumIndexAsValue = false;
2251
+ // multiple selection
2252
+ this.multiple = false;
2253
+ this.keys = [];
2254
+ this.values = [];
2255
+ this.Object = Object;
2256
+ }
2257
+ /**
2258
+ * Hook used to sync changes on set Label and Type
2259
+ * @param changes
2260
+ */
2261
+ ngOnChanges(changes) {
2262
+ if (changes.optionsPlainArray) {
2263
+ this.keys = this.optionsPlainArray;
2264
+ this.values = this.optionsPlainArray;
2265
+ }
2266
+ this.setKeyValues();
2267
+ }
2268
+ ngOnInit() {
2269
+ this.form = this.formBuilder.group({
2270
+ dropdownData: [],
2271
+ });
2272
+ this.formInitialized = true;
2273
+ this.form.valueChanges.subscribe((value) => {
2274
+ this.internalValue = value.dropdownData;
2275
+ this.onChange(value.dropdownData);
2276
+ });
2277
+ super.ngOnInit();
2278
+ }
2279
+ /**
2280
+ * transofrms the data values to the correct format for be used by the template
2281
+ * @param value
2282
+ */
2283
+ setKeyValues() {
2284
+ if (this.optionsObjArray && this.mapKey && this.mapValue) {
2285
+ this.keys = this.optionsObjArray.map((obj) => obj[`${this.mapKey}`]);
2286
+ this.values = this.optionsObjArray.map((obj) => obj[`${this.mapValue}`]);
2287
+ }
2288
+ else if (this.optionsObjArray && this.mapKey) {
2289
+ this.keys = this.optionsObjArray.map((obj) => obj[`${this.mapKey}`]);
2290
+ this.values = this.optionsObjArray.map((obj) => obj[`${this.mapKey}`]);
2291
+ }
2292
+ if (this.optionsEnum) {
2293
+ this.keys = EnumValues.getNames(this.optionsEnum);
2294
+ if (this.optionsPlainArray) {
2295
+ this.values = this.optionsPlainArray;
2296
+ }
2297
+ else {
2298
+ const values = EnumValues.getValues(this.optionsEnum);
2299
+ // var who defines if enum is componed just with keys or keyValues. E.g enum KeyEnum { VALUE1, VALUE2 } or enum KeyValueEnum { VALUE4 = 'V4', VALUE5 = 'V5' }
2300
+ let keyValueEnum = false;
2301
+ for (let i = 0; i < this.keys.length; i++) {
2302
+ if (i !== values[i]) {
2303
+ keyValueEnum = true;
2304
+ }
2305
+ }
2306
+ if (keyValueEnum || this.useEnumIndexAsValue) {
2307
+ this.values = values;
2308
+ }
2309
+ else {
2310
+ this.values = EnumValues.getNames(this.optionsEnum);
2311
+ }
2312
+ }
2313
+ }
2314
+ if (this.hasNullOption === true)
2315
+ this.keys.unshift(null);
2316
+ if (this.hasNullOption === true)
2317
+ this.values.unshift(null);
2318
+ }
2319
+ /**
2320
+ * set the value of the dropdown based if translation is set
2321
+ * @param key
2322
+ */
2323
+ setDisplayKey(key) {
2324
+ /*
2325
+ if (this.translation && key !== null) {
2326
+ if (this.translation.isPrefix) {
2327
+ return this.translationService.instant(this.translation.path + '.' + key);
2328
+ } else if (this.translation.useKey) {
2329
+ return this.translationService.instant(this.translation.path, { key: key });
2330
+ } else if (!this.translation?.useKey && !this.translation?.isPrefix) {
2331
+ return this.translationService.instant(this.translation.path);
2332
+ }
2333
+ } else if (key == null) {
2334
+ return '';
2335
+ } else if (!this.translation) {
2336
+ return key;
2337
+ }
2338
+ */
2339
+ return key;
2340
+ }
2341
+ valueChanged(value) {
2342
+ this.form.patchValue({
2343
+ dropdownData: value,
2344
+ });
2345
+ this.onSelectItemEmitter.emit(value);
2346
+ }
2347
+ }
2348
+ DropdownFromDataComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DropdownFromDataComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
2349
+ DropdownFromDataComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: DropdownFromDataComponent, selector: "kms-dropdown-from-data", inputs: { optionsEnum: "optionsEnum", optionsPlainArray: "optionsPlainArray", optionsObjArray: "optionsObjArray", mapKey: "mapKey", mapValue: "mapValue", hasNullOption: "hasNullOption", translation: "translation", placeholder: "placeholder", label: "label", required: "required", useEnumIndexAsValue: "useEnumIndexAsValue", multiple: "multiple" }, providers: [
2350
+ {
2351
+ provide: NG_VALUE_ACCESSOR,
2352
+ useExisting: forwardRef(() => DropdownFromDataComponent),
2353
+ multi: true,
2354
+ },
2355
+ ], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\">\n <mat-form-field [attr.required]=\"required\" [floatLabel]=\"placeholder ? 'always' : 'auto'\">\n <mat-label>{{ label }}</mat-label>\n <mat-select\n placeholder=\"{{ placeholder }}\"\n disableOptionCentering\n [(value)]=\"value\"\n (selectionChange)=\"valueChanged($event?.value)\"\n #child\n [disabled]=\"disabled\"\n [multiple]=\"multiple\"\n >\n <mat-option *ngFor=\"let key of keys; let i = index\" [value]=\"values[i]\">\n <span>{{ setDisplayKey(key) }}</span>\n </mat-option>\n </mat-select>\n </mat-form-field>\n</form>\n", components: [{ type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i4.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$1.MatLabel, selector: "mat-label" }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
2356
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DropdownFromDataComponent, decorators: [{
2357
+ type: Component,
2358
+ args: [{ selector: 'kms-dropdown-from-data', providers: [
2359
+ {
2360
+ provide: NG_VALUE_ACCESSOR,
2361
+ useExisting: forwardRef(() => DropdownFromDataComponent),
2362
+ multi: true,
2363
+ },
2364
+ ], template: "<form [formGroup]=\"form\">\n <mat-form-field [attr.required]=\"required\" [floatLabel]=\"placeholder ? 'always' : 'auto'\">\n <mat-label>{{ label }}</mat-label>\n <mat-select\n placeholder=\"{{ placeholder }}\"\n disableOptionCentering\n [(value)]=\"value\"\n (selectionChange)=\"valueChanged($event?.value)\"\n #child\n [disabled]=\"disabled\"\n [multiple]=\"multiple\"\n >\n <mat-option *ngFor=\"let key of keys; let i = index\" [value]=\"values[i]\">\n <span>{{ setDisplayKey(key) }}</span>\n </mat-option>\n </mat-select>\n </mat-form-field>\n</form>\n" }]
2365
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.Renderer2 }]; }, propDecorators: { optionsEnum: [{
2366
+ type: Input
2367
+ }], optionsPlainArray: [{
2368
+ type: Input
2369
+ }], optionsObjArray: [{
2370
+ type: Input
2371
+ }], mapKey: [{
2372
+ type: Input
2373
+ }], mapValue: [{
2374
+ type: Input
2375
+ }], hasNullOption: [{
2376
+ type: Input
2377
+ }], translation: [{
2378
+ type: Input
2379
+ }], placeholder: [{
2380
+ type: Input
2381
+ }], label: [{
2382
+ type: Input
2383
+ }], required: [{
2384
+ type: Input
2385
+ }], useEnumIndexAsValue: [{
2386
+ type: Input
2387
+ }], multiple: [{
2388
+ type: Input
2389
+ }] } });
2390
+
2391
+ /*!
2392
+ * @copyright FLYACTS GmbH 2019
2393
+ */
2394
+ class SwipeDirective {
2395
+ constructor() {
2396
+ /**
2397
+ * Output Event that is emitted during swipe process (mouse move or touch move event).
2398
+ * Can be used for calculation purposes.
2399
+ */
2400
+ this.moveEvent = new EventEmitter();
2401
+ /**
2402
+ * Output Event that is emitted when swipe process end (mouse up or touch end event).
2403
+ * Can be used for calculation purposes.
2404
+ */
2405
+ this.releaseEvent = new EventEmitter();
2406
+ this._startPosition = -1;
2407
+ this._lastPosX = 0;
2408
+ this._thresholdWasReached = false;
2409
+ this._timeStart = 0;
2410
+ }
2411
+ /**
2412
+ * Needed config that defines swipe behaviour.
2413
+ * @param options SwipeOptions
2414
+ */
2415
+ set config(options) {
2416
+ if (options) {
2417
+ this._swipeOptions = options;
2418
+ }
2419
+ }
2420
+ onMouseDown(event) {
2421
+ this.calculateStartPosition(event);
2422
+ }
2423
+ onMove(event) {
2424
+ this.move(event);
2425
+ }
2426
+ onRelease(event) {
2427
+ this.release(event);
2428
+ this.reset();
2429
+ }
2430
+ // ** PRIVATE ** //
2431
+ /**
2432
+ * Function checks if the current moving delta is inside the defined threshold.
2433
+ * Sets the flag to true if the threshold was reached once.
2434
+ */
2435
+ checkThreshold(moveEvent) {
2436
+ const percentage = this._swipeOptions && this._swipeOptions.swipeThresholdType === '%';
2437
+ if (!percentage && this._swipeOptions && moveEvent.swipeDistanceTotal < this._swipeOptions.swipeThreshold) {
2438
+ return;
2439
+ }
2440
+ else if (percentage &&
2441
+ this._swipeOptions &&
2442
+ moveEvent.swipeDistancePercentage < this._swipeOptions.swipeThreshold / 100) {
2443
+ return;
2444
+ }
2445
+ else {
2446
+ this._thresholdWasReached = true;
2447
+ }
2448
+ }
2449
+ calculateStartPosition(event) {
2450
+ // detect if touch or click
2451
+ this._isMobile = event.type === 'touchstart';
2452
+ // save start position
2453
+ if (this._swipeOptions && this._swipeOptions.swipeLocalPosition) {
2454
+ if (this._isMobile) {
2455
+ const touch = event.touches[0];
2456
+ this._startPosition = this._swipeOptions.swipeLocalPosition ? touch.clientX : touch.pageX;
2457
+ }
2458
+ else {
2459
+ this._startPosition = this._swipeOptions.swipeLocalPosition ? event.offsetX : event.pageX;
2460
+ }
2461
+ }
2462
+ this._lastPosX = this._startPosition;
2463
+ this._timeStart = event.timeStamp;
2464
+ this._thresholdWasReached = false;
2465
+ }
2466
+ move(event) {
2467
+ // failsafe
2468
+ if (typeof event === 'undefined') {
2469
+ return;
2470
+ }
2471
+ let posX = 0;
2472
+ if (this._swipeOptions) {
2473
+ if (this._isMobile && event.type === 'touchmove') {
2474
+ const touch = event.touches[0];
2475
+ posX = this._swipeOptions.swipeLocalPosition ? touch.clientX : touch.pageX;
2476
+ }
2477
+ else {
2478
+ posX = this._swipeOptions.swipeLocalPosition ? event.offsetX : event.pageX;
2479
+ }
2480
+ }
2481
+ const offsetPerFrame = posX - this._lastPosX;
2482
+ const swipeDistanceTotal = Math.abs(posX - this._startPosition);
2483
+ const swipeDistancePercentage = Math.abs(swipeDistanceTotal / event.target.clientWidth);
2484
+ const timeDuration = Math.abs(event.timeStamp - this._timeStart);
2485
+ let direction;
2486
+ let speed = 1 - swipeDistanceTotal / timeDuration;
2487
+ speed = Math.max(0.1, speed);
2488
+ if (posX - this._startPosition > 0) {
2489
+ direction = 1; // a.k.a LTR
2490
+ }
2491
+ else {
2492
+ direction = -1; // a.k.a RTL
2493
+ }
2494
+ this._moveEventData = {
2495
+ position: posX,
2496
+ offsetPerFrame: offsetPerFrame,
2497
+ swipeDistanceTotal: swipeDistanceTotal,
2498
+ swipeDistancePercentage: swipeDistancePercentage,
2499
+ direction: direction,
2500
+ speed: speed,
2501
+ thresholdWasReached: this._thresholdWasReached,
2502
+ };
2503
+ this.checkThreshold(this._moveEventData);
2504
+ // update move delta
2505
+ this._lastPosX = posX;
2506
+ // inform
2507
+ this.moveEvent.emit(this._moveEventData);
2508
+ }
2509
+ release(event) {
2510
+ // case: just a click/touch
2511
+ if (!this._moveEventData) {
2512
+ return;
2513
+ }
2514
+ const releaseEventData = {
2515
+ thresholdWasReached: this._thresholdWasReached,
2516
+ direction: this._moveEventData.direction,
2517
+ speed: this._moveEventData.speed,
2518
+ easingType: this.getEasingCurve(this._moveEventData.speed),
2519
+ target: event.currentTarget,
2520
+ };
2521
+ // inform
2522
+ this.releaseEvent.emit(releaseEventData);
2523
+ }
2524
+ getEasingCurve(speed) {
2525
+ return speed > 0.5 ? 'ease-in' : 'ease-out';
2526
+ }
2527
+ reset() {
2528
+ this._startPosition = -1;
2529
+ this._thresholdWasReached = false;
2530
+ if (this._moveEventData) {
2531
+ this._moveEventData = undefined;
2532
+ }
2533
+ }
2534
+ }
2535
+ SwipeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SwipeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2536
+ SwipeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: SwipeDirective, selector: "[swipeDirective]", inputs: { config: ["swipeDirective", "config"] }, outputs: { moveEvent: "moveEvent", releaseEvent: "releaseEvent" }, host: { listeners: { "mousedown": "onMouseDown($event)", "touchstart": "onMouseDown($event)", "mousemove": "onMove($event)", "touchmove": "onMove($event)", "mouseup": "onRelease($event)", "mouseleave": "onRelease($event)", "touchend": "onRelease($event)" } }, ngImport: i0 });
2537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SwipeDirective, decorators: [{
2538
+ type: Directive,
2539
+ args: [{
2540
+ selector: '[swipeDirective]',
2541
+ }]
2542
+ }], propDecorators: { moveEvent: [{
2543
+ type: Output
2544
+ }], releaseEvent: [{
2545
+ type: Output
2546
+ }], config: [{
2547
+ type: Input,
2548
+ args: ['swipeDirective']
2549
+ }], onMouseDown: [{
2550
+ type: HostListener,
2551
+ args: ['mousedown', ['$event']]
2552
+ }, {
2553
+ type: HostListener,
2554
+ args: ['touchstart', ['$event']]
2555
+ }], onMove: [{
2556
+ type: HostListener,
2557
+ args: ['mousemove', ['$event']]
2558
+ }, {
2559
+ type: HostListener,
2560
+ args: ['touchmove', ['$event']]
2561
+ }], onRelease: [{
2562
+ type: HostListener,
2563
+ args: ['mouseup', ['$event']]
2564
+ }, {
2565
+ type: HostListener,
2566
+ args: ['mouseleave', ['$event']]
2567
+ }, {
2568
+ type: HostListener,
2569
+ args: ['touchend', ['$event']]
2570
+ }] } });
2571
+
2572
+ /*!
2573
+ * @copyright FLYACTS GmbH 2019
2574
+ */
2575
+ class ImageSliderComponent {
2576
+ constructor(sanitizer) {
2577
+ this.sanitizer = sanitizer;
2578
+ this.editMode = false;
2579
+ this.orderChanged = new EventEmitter();
2580
+ this.deleteImageEvent = new EventEmitter();
2581
+ /**
2582
+ * Optional: Define Swipe behaviour configuration.
2583
+ * Default is 10% for the threshold definition until a swipe triggers next/previous slide.
2584
+ */
2585
+ this.swipeConfig = {
2586
+ swipeThreshold: 5,
2587
+ swipeThresholdType: '%',
2588
+ swipeLocalPosition: true,
2589
+ };
2590
+ this.selectedSlide = 0;
2591
+ this.isLastClickedInSliderImage = false;
2592
+ this.config = {
2593
+ initialSlide: 0,
2594
+ slidesPerView: 3,
2595
+ navigation: {
2596
+ nextEl: '.swiper-button-next',
2597
+ prevEl: '.swiper-button-prev',
2598
+ },
2599
+ watchOverflow: true,
2600
+ autoHeight: true,
2601
+ allowTouchMove: false,
2602
+ spaceBetween: 30,
2603
+ on: {
2604
+ slideChange: () => {
2605
+ // do something
2606
+ },
2607
+ slideChangeTransitionEnd: () => {
2608
+ // do something
2609
+ },
2610
+ },
2611
+ };
2612
+ }
2613
+ ngOnInit() {
2614
+ if (this.slides) {
2615
+ // TODO use Pipe safeStyle
2616
+ this.selectedSlideImage = this.sanitizer.bypassSecurityTrustStyle('url(' + this.slides[0] + ')');
2617
+ }
2618
+ }
2619
+ // !TODO
2620
+ onKeydownHandler(event) {
2621
+ if (event.key === 'ArrowRight') {
2622
+ this.nextSlide();
2623
+ }
2624
+ if (event.key === 'ArrowLeft') {
2625
+ this.previousSlide();
2626
+ }
2627
+ }
2628
+ /**
2629
+ * Slide follows the finger or mouse according to it´s move delta.
2630
+ * @param event SwipeMoveEvent
2631
+ */
2632
+ handleMoveEvent(event) {
2633
+ // certain move threshold needs to be reached
2634
+ if (!event.thresholdWasReached) {
2635
+ return;
2636
+ }
2637
+ this.config.direction = event.direction === 1 ? 'horizontal' : 'vertical';
2638
+ }
2639
+ /**
2640
+ * Mouse up or slide container was left.
2641
+ * @param event SwipeReleaseEvent
2642
+ */
2643
+ handleReleaseEvent(event) {
2644
+ if (!event.thresholdWasReached) {
2645
+ return;
2646
+ }
2647
+ // Just do if user clicked to slide on image and not on arrow or other element
2648
+ if (!this.isLastClickedInSliderImage) {
2649
+ return;
2650
+ }
2651
+ if (event.direction === 1) {
2652
+ this.previousSlide();
2653
+ }
2654
+ else {
2655
+ this.nextSlide();
2656
+ }
2657
+ }
2658
+ lastClicked() {
2659
+ this.isLastClickedInSliderImage = true;
2660
+ }
2661
+ noLastClicked() {
2662
+ this.isLastClickedInSliderImage = false;
2663
+ }
2664
+ scrollLeft() {
2665
+ this.previousSlide();
2666
+ }
2667
+ scrollRight() {
2668
+ this.nextSlide();
2669
+ }
2670
+ nextSlide() {
2671
+ if (this.slides && this.selectedSlide < this.slides.length - 1) {
2672
+ if (this.usefulSwiper) {
2673
+ this.usefulSwiper.swiper.slideNext();
2674
+ }
2675
+ this.openSlide(this.selectedSlide + 1);
2676
+ }
2677
+ this.isLastClickedInSliderImage = false;
2678
+ }
2679
+ previousSlide() {
2680
+ if (this.selectedSlide > 0) {
2681
+ if (this.usefulSwiper) {
2682
+ this.usefulSwiper.swiper.slidePrev();
2683
+ }
2684
+ this.openSlide(this.selectedSlide - 1);
2685
+ }
2686
+ this.isLastClickedInSliderImage = false;
2687
+ }
2688
+ slideTo(index) {
2689
+ if (this.usefulSwiper) {
2690
+ this.usefulSwiper.swiper.slideTo(index);
2691
+ }
2692
+ }
2693
+ openSlide(number) {
2694
+ if (this.slides && number < this.slides.length && number >= 0) {
2695
+ this.selectedSlide = number;
2696
+ // TODO use Pipe safeStyle
2697
+ this.selectedSlideImage = this.sanitizer.bypassSecurityTrustStyle('url(' + this.slides[number] || ')');
2698
+ }
2699
+ }
2700
+ ngOnChanges(_changes) {
2701
+ if (_changes.slides) {
2702
+ if (this.slides) {
2703
+ // TODO use Pipe safeStyle
2704
+ this.selectedSlideImage = this.sanitizer.bypassSecurityTrustStyle('url(' + this.slides[0] + ')');
2705
+ }
2706
+ }
2707
+ }
2708
+ /**
2709
+ * Re-order slides and notify parent component
2710
+ */
2711
+ drop(event) {
2712
+ if (this.slides && this.imagesTOSave) {
2713
+ moveItemInArray(this.slides, event.previousIndex, event.currentIndex);
2714
+ moveItemInArray(this.imagesTOSave, event.previousIndex, event.currentIndex);
2715
+ this.orderChanged.emit(this.imagesTOSave);
2716
+ }
2717
+ }
2718
+ /**
2719
+ * Send image index to parent to perform delete
2720
+ */
2721
+ deleteImage(index) {
2722
+ this.deleteImageEvent.emit(index);
2723
+ }
2724
+ }
2725
+ ImageSliderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ImageSliderComponent, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
2726
+ ImageSliderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ImageSliderComponent, selector: "kms-image-slider", inputs: { slides: "slides", editMode: "editMode", imagesTOSave: "imagesTOSave", swipeConfig: "swipeConfig" }, outputs: { orderChanged: "orderChanged", deleteImageEvent: "deleteImageEvent" }, host: { listeners: { "document:keydown": "onKeydownHandler($event)" } }, viewQueries: [{ propertyName: "usefulSwiper", first: true, predicate: ["usefulSwiper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"all-wrapper\">\n <!--(swiperight)=\"previousSlide()\" (swipeleft)=\"nextSlide()\"-->\n <div \n class=\"swiper-bigImage\"\n [style.backgroundImage]=\"selectedSlideImage\"\n [swipeDirective]=\"swipeConfig\"\n (moveEvent)=\"handleMoveEvent($event)\"\n (releaseEvent)=\"handleReleaseEvent($event)\"\n (mouseup)=\"lastClicked()\"\n (mouseout)=\"noLastClicked()\" >\n </div>\n\n <ng-content select=\"[description]\"></ng-content>\n\n <div class=\"swiper-holder\">\n <!--\n (mouseWheelUp)=\"scrollLeft($event)\"\n (mouseWheelDown)=\"scrollRight($event)\"\n -->\n\n <swiper [config]=\"config\" #usefulSwiper>\n <div class=\"swiper-wrapper\" \n cdkDropList (cdkDropListDropped)=\"drop($event)\" \n cdkDropListOrientation=\"horizontal\"> \n <div class=\"swiper-slide\" \n *ngFor=\"let slide of slides; let index = index\" \n cdkDrag [cdkDragDisabled]=\"!editMode\">\n <button mat-menu-item *ngIf=\"editMode\" (click)=\"deleteImage(index)\"> \n <kms-icon icon=\"trash\"></kms-icon>\n </button>\n <div class=\"img\" (click)=\"openSlide(index)\"\n [style.backgroundImage]=\"sanitizer.bypassSecurityTrustStyle('url(' + slide + ')')\"\n [ngClass]=\"{'active': index === selectedSlide}\">\n </div>\n \n <div class=\"default-image\">{{\"common.defaultImage\" | translate}} </div>\n </div>\n </div>\n </swiper>\n\n <div class=\"swiper-button-next\" *ngIf=\"slides?.length > 3\"></div>\n <div class=\"swiper-button-prev\" *ngIf=\"slides?.length > 3\"></div>\n\n <div class=\"swiper-button-next2\" *ngIf=\"slides?.length > 1\" (click)=\"nextSlide()\">\n <kms-icon icon=\"chevron-right\" [iconClass]=\"{'color-disabled': selectedSlide == slides?.length - 1, 'color-primary': true}\"></kms-icon>\n </div>\n <div class=\"swiper-button-prev2\" *ngIf=\"slides?.length > 1\" (click)=\"previousSlide()\">\n <kms-icon icon=\"chevron-left\" [iconClass]=\"{'color-disabled': selectedSlide == 0, 'color-primary': true}\"></kms-icon>\n </div>\n\n </div>\n\n <ng-content></ng-content>\n</div>", styles: [""], components: [{ type: i2$6.SwiperComponent, selector: "swiper", inputs: ["initialize", "config"] }, { type: i3$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "iconStyle", "iconSize", "dontUseSprite"] }], directives: [{ type: SwipeDirective, selector: "[swipeDirective]", inputs: ["swipeDirective"], outputs: ["moveEvent", "releaseEvent"] }, { type: i6.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i5$1.TranslatePipe } });
2727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ImageSliderComponent, decorators: [{
2728
+ type: Component,
2729
+ args: [{ selector: 'kms-image-slider', template: "<div class=\"all-wrapper\">\n <!--(swiperight)=\"previousSlide()\" (swipeleft)=\"nextSlide()\"-->\n <div \n class=\"swiper-bigImage\"\n [style.backgroundImage]=\"selectedSlideImage\"\n [swipeDirective]=\"swipeConfig\"\n (moveEvent)=\"handleMoveEvent($event)\"\n (releaseEvent)=\"handleReleaseEvent($event)\"\n (mouseup)=\"lastClicked()\"\n (mouseout)=\"noLastClicked()\" >\n </div>\n\n <ng-content select=\"[description]\"></ng-content>\n\n <div class=\"swiper-holder\">\n <!--\n (mouseWheelUp)=\"scrollLeft($event)\"\n (mouseWheelDown)=\"scrollRight($event)\"\n -->\n\n <swiper [config]=\"config\" #usefulSwiper>\n <div class=\"swiper-wrapper\" \n cdkDropList (cdkDropListDropped)=\"drop($event)\" \n cdkDropListOrientation=\"horizontal\"> \n <div class=\"swiper-slide\" \n *ngFor=\"let slide of slides; let index = index\" \n cdkDrag [cdkDragDisabled]=\"!editMode\">\n <button mat-menu-item *ngIf=\"editMode\" (click)=\"deleteImage(index)\"> \n <kms-icon icon=\"trash\"></kms-icon>\n </button>\n <div class=\"img\" (click)=\"openSlide(index)\"\n [style.backgroundImage]=\"sanitizer.bypassSecurityTrustStyle('url(' + slide + ')')\"\n [ngClass]=\"{'active': index === selectedSlide}\">\n </div>\n \n <div class=\"default-image\">{{\"common.defaultImage\" | translate}} </div>\n </div>\n </div>\n </swiper>\n\n <div class=\"swiper-button-next\" *ngIf=\"slides?.length > 3\"></div>\n <div class=\"swiper-button-prev\" *ngIf=\"slides?.length > 3\"></div>\n\n <div class=\"swiper-button-next2\" *ngIf=\"slides?.length > 1\" (click)=\"nextSlide()\">\n <kms-icon icon=\"chevron-right\" [iconClass]=\"{'color-disabled': selectedSlide == slides?.length - 1, 'color-primary': true}\"></kms-icon>\n </div>\n <div class=\"swiper-button-prev2\" *ngIf=\"slides?.length > 1\" (click)=\"previousSlide()\">\n <kms-icon icon=\"chevron-left\" [iconClass]=\"{'color-disabled': selectedSlide == 0, 'color-primary': true}\"></kms-icon>\n </div>\n\n </div>\n\n <ng-content></ng-content>\n</div>", styles: [""] }]
2730
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; }, propDecorators: { slides: [{
2731
+ type: Input
2732
+ }], editMode: [{
2733
+ type: Input
2734
+ }], imagesTOSave: [{
2735
+ type: Input
2736
+ }], orderChanged: [{
2737
+ type: Output
2738
+ }], deleteImageEvent: [{
2739
+ type: Output
2740
+ }], swipeConfig: [{
2741
+ type: Input
2742
+ }], usefulSwiper: [{
2743
+ type: ViewChild,
2744
+ args: ['usefulSwiper']
2745
+ }], onKeydownHandler: [{
2746
+ type: HostListener,
2747
+ args: ['document:keydown', ['$event']]
2748
+ }] } });
2749
+
2750
+ /*!
2751
+ * @copyright FLYACTS GmbH 2019
2752
+ */
2753
+ class MouseWheelDirective {
2754
+ constructor() {
2755
+ this.mouseWheelUp = new EventEmitter();
2756
+ this.mouseWheelDown = new EventEmitter();
2757
+ }
2758
+ onMouseWheelChrome(event) {
2759
+ this.mouseWheelFunc(event);
2760
+ }
2761
+ onMouseWheelFirefox(event) {
2762
+ this.mouseWheelFunc(event);
2763
+ }
2764
+ onMouseWheelIE(event) {
2765
+ this.mouseWheelFunc(event);
2766
+ }
2767
+ mouseWheelFunc(event) {
2768
+ event = window.event || event; // old IE support
2769
+ const delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
2770
+ if (delta > 0) {
2771
+ this.mouseWheelUp.emit(event);
2772
+ }
2773
+ else if (delta < 0) {
2774
+ this.mouseWheelDown.emit(event);
2775
+ }
2776
+ // for IE
2777
+ event.returnValue = false;
2778
+ // for Chrome and Firefox
2779
+ if (event.preventDefault) {
2780
+ event.preventDefault();
2781
+ }
2782
+ }
2783
+ }
2784
+ MouseWheelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MouseWheelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2785
+ MouseWheelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: MouseWheelDirective, selector: "[mouseWheel]", outputs: { mouseWheelUp: "mouseWheelUp", mouseWheelDown: "mouseWheelDown" }, host: { listeners: { "mousewheel": "onMouseWheelChrome($event)", "DOMMouseScroll": "onMouseWheelFirefox($event)", "onmousewheel": "onMouseWheelIE($event)" } }, ngImport: i0 });
2786
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MouseWheelDirective, decorators: [{
2787
+ type: Directive,
2788
+ args: [{ selector: '[mouseWheel]' }]
2789
+ }], propDecorators: { mouseWheelUp: [{
2790
+ type: Output
2791
+ }], mouseWheelDown: [{
2792
+ type: Output
2793
+ }], onMouseWheelChrome: [{
2794
+ type: HostListener,
2795
+ args: ['mousewheel', ['$event']]
2796
+ }], onMouseWheelFirefox: [{
2797
+ type: HostListener,
2798
+ args: ['DOMMouseScroll', ['$event']]
2799
+ }], onMouseWheelIE: [{
2800
+ type: HostListener,
2801
+ args: ['onmousewheel', ['$event']]
2802
+ }] } });
2803
+
2804
+ /**
2805
+ * @copyright KMS GmbH
2806
+ */
2807
+ class DirectivesModule {
2808
+ }
2809
+ DirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2810
+ DirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DirectivesModule, declarations: [SwipeDirective,
2811
+ MouseWheelDirective,
2812
+ GetMaxHeightDirective,
2813
+ TooltipDirective], imports: [CommonModule], exports: [SwipeDirective,
2814
+ MouseWheelDirective,
2815
+ GetMaxHeightDirective,
2816
+ TooltipDirective] });
2817
+ DirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DirectivesModule, imports: [[CommonModule]] });
2818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DirectivesModule, decorators: [{
2819
+ type: NgModule,
2820
+ args: [{
2821
+ declarations: [
2822
+ SwipeDirective,
2823
+ MouseWheelDirective,
2824
+ GetMaxHeightDirective,
2825
+ TooltipDirective,
2826
+ ],
2827
+ imports: [CommonModule],
2828
+ exports: [
2829
+ SwipeDirective,
2830
+ MouseWheelDirective,
2831
+ GetMaxHeightDirective,
2832
+ TooltipDirective,
2833
+ ],
2834
+ }]
2835
+ }] });
2836
+
2837
+ class KmsUiPresentationalModule {
2838
+ }
2839
+ KmsUiPresentationalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2840
+ KmsUiPresentationalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalModule, declarations: [ActionsParentComponent,
2841
+ BackToTopComponent,
2842
+ ButtonWithConfirmDialogComponent,
2843
+ CheckboxComponent,
2844
+ ColorInputComponent,
2845
+ DropdownFromDataComponent,
2846
+ EnumRadiogroupComponent,
2847
+ EnumRadiogroupComponent,
2848
+ FileInputComponent,
2849
+ FlyoutComponent,
2850
+ GenericDialogComponent,
2851
+ IconComponent,
2852
+ ImageSliderComponent,
2853
+ KMSAccordionItemComponent,
2854
+ KmsUiPresentationalComponent,
2855
+ LoaderComponent,
2856
+ MapComponent,
2857
+ RadioButtonComponent,
2858
+ SalutationDropdownComponent,
2859
+ SalutationRadiogroupComponent,
2860
+ TimeInputComponent,
2861
+ TooltipComponent,
2862
+ TooltipIconComponent,
2863
+ YesNoRadiogroupComponent], imports: [CommonModule,
2864
+ DragDropModule,
2865
+ MatCheckboxModule,
2866
+ MatButtonModule,
2867
+ MatRadioModule,
2868
+ MatDialogModule,
2869
+ FormsModule,
2870
+ ReactiveFormsModule,
2871
+ MatFormFieldModule,
2872
+ MatInputModule,
2873
+ MatMenuModule,
2874
+ CustomPipesModule,
2875
+ GoogleMapsModule,
2876
+ MatExpansionModule,
2877
+ MatSelectModule,
2878
+ MatProgressSpinnerModule,
2879
+ DirectivesModule,
2880
+ TranslateModule,
2881
+ NgxUsefulSwiperModule], exports: [ActionsParentComponent,
2882
+ BackToTopComponent,
2883
+ ButtonWithConfirmDialogComponent,
2884
+ CheckboxComponent,
2885
+ ColorInputComponent,
2886
+ DropdownFromDataComponent,
2887
+ EnumRadiogroupComponent,
2888
+ EnumRadiogroupComponent,
2889
+ FileInputComponent,
2890
+ FlyoutComponent,
2891
+ GenericDialogComponent,
2892
+ IconComponent,
2893
+ ImageSliderComponent,
2894
+ KMSAccordionItemComponent,
2895
+ KmsUiPresentationalComponent,
2896
+ LoaderComponent,
2897
+ MapComponent,
2898
+ RadioButtonComponent,
2899
+ SalutationDropdownComponent,
2900
+ SalutationRadiogroupComponent,
2901
+ TimeInputComponent,
2902
+ TooltipComponent,
2903
+ TooltipIconComponent,
2904
+ YesNoRadiogroupComponent] });
2905
+ KmsUiPresentationalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalModule, providers: [
2906
+ ViewportService
2907
+ ], imports: [[
2908
+ CommonModule,
2909
+ DragDropModule,
2910
+ MatCheckboxModule,
2911
+ MatButtonModule,
2912
+ MatRadioModule,
2913
+ MatDialogModule,
2914
+ FormsModule,
2915
+ ReactiveFormsModule,
2916
+ MatFormFieldModule,
2917
+ MatInputModule,
2918
+ MatMenuModule,
2919
+ CustomPipesModule,
2920
+ GoogleMapsModule,
2921
+ MatExpansionModule,
2922
+ MatSelectModule,
2923
+ MatProgressSpinnerModule,
2924
+ DirectivesModule,
2925
+ TranslateModule,
2926
+ NgxUsefulSwiperModule,
2927
+ ]] });
2928
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KmsUiPresentationalModule, decorators: [{
2929
+ type: NgModule,
2930
+ args: [{
2931
+ declarations: [
2932
+ ActionsParentComponent,
2933
+ BackToTopComponent,
2934
+ ButtonWithConfirmDialogComponent,
2935
+ CheckboxComponent,
2936
+ ColorInputComponent,
2937
+ DropdownFromDataComponent,
2938
+ EnumRadiogroupComponent,
2939
+ EnumRadiogroupComponent,
2940
+ FileInputComponent,
2941
+ FlyoutComponent,
2942
+ GenericDialogComponent,
2943
+ IconComponent,
2944
+ ImageSliderComponent,
2945
+ KMSAccordionItemComponent,
2946
+ KmsUiPresentationalComponent,
2947
+ LoaderComponent,
2948
+ MapComponent,
2949
+ RadioButtonComponent,
2950
+ SalutationDropdownComponent,
2951
+ SalutationRadiogroupComponent,
2952
+ TimeInputComponent,
2953
+ TooltipComponent,
2954
+ TooltipIconComponent,
2955
+ YesNoRadiogroupComponent,
2956
+ ],
2957
+ imports: [
2958
+ CommonModule,
2959
+ DragDropModule,
2960
+ MatCheckboxModule,
2961
+ MatButtonModule,
2962
+ MatRadioModule,
2963
+ MatDialogModule,
2964
+ FormsModule,
2965
+ ReactiveFormsModule,
2966
+ MatFormFieldModule,
2967
+ MatInputModule,
2968
+ MatMenuModule,
2969
+ CustomPipesModule,
2970
+ GoogleMapsModule,
2971
+ MatExpansionModule,
2972
+ MatSelectModule,
2973
+ MatProgressSpinnerModule,
2974
+ DirectivesModule,
2975
+ TranslateModule,
2976
+ NgxUsefulSwiperModule,
2977
+ ],
2978
+ exports: [
2979
+ ActionsParentComponent,
2980
+ BackToTopComponent,
2981
+ ButtonWithConfirmDialogComponent,
2982
+ CheckboxComponent,
2983
+ ColorInputComponent,
2984
+ DropdownFromDataComponent,
2985
+ EnumRadiogroupComponent,
2986
+ EnumRadiogroupComponent,
2987
+ FileInputComponent,
2988
+ FlyoutComponent,
2989
+ GenericDialogComponent,
2990
+ IconComponent,
2991
+ ImageSliderComponent,
2992
+ KMSAccordionItemComponent,
2993
+ KmsUiPresentationalComponent,
2994
+ LoaderComponent,
2995
+ MapComponent,
2996
+ RadioButtonComponent,
2997
+ SalutationDropdownComponent,
2998
+ SalutationRadiogroupComponent,
2999
+ TimeInputComponent,
3000
+ TooltipComponent,
3001
+ TooltipIconComponent,
3002
+ YesNoRadiogroupComponent,
3003
+ ],
3004
+ providers: [
3005
+ ViewportService
3006
+ ]
3007
+ }]
3008
+ }] });
3009
+
3010
+ /*
3011
+ * Public API Surface of kms-ngx-ui-presentational
3012
+ */
3013
+
3014
+ /**
3015
+ * Generated bundle index. Do not edit.
3016
+ */
3017
+
3018
+ export { ActionsParentComponent, BackToTopComponent, ButtonWithConfirmDialogComponent, CheckboxComponent, ColorInputComponent, CustomPipesModule, DecodeUriPipe, DirectivesModule, DropdownFromDataComponent, EncodeUriPipe, EnumRadiogroupComponent, FileInputComponent, FlyoutComponent, FormParentComponent, GenericDialogComponent, GetMaxHeightDirective, IconComponent, IconSize$1 as IconSize, ImageSliderComponent, IntegerCurrency, KMSAccordionItemComponent, KmsUiPresentationalComponent, KmsUiPresentationalModule, KmsUiPresentationalService, LoaderComponent, MapComponent, Marker, MarkerLabel, MarkerOptions, MouseWheelDirective, RadioButtonComponent, SafeHtmlPipe, SafeResourceUrlPipe, SafeStylePipe, SafeUrlPipe, SalutationDropdownComponent, SalutationEnum, SalutationRadiogroupComponent, SwipeDirective, TimeInputComponent, ToNumberPipe, TooltipComponent, TooltipDirective, TooltipIconComponent, TrimPipe, TypeofPipe, ViewportService, YesNoRadiogroupComponent };
3019
+ //# sourceMappingURL=kms-ngx-ui-presentational.mjs.map