@kms-ngx-ui/presentational 16.3.0 → 16.3.2

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 (223) hide show
  1. package/jest.config.js +27 -0
  2. package/ng-package.json +13 -0
  3. package/package.json +3 -17
  4. package/src/lib/directives/directives.module.ts +28 -0
  5. package/src/lib/directives/mousewheel.directive.ts +43 -0
  6. package/src/lib/directives/sum-of-height.directive.ts +73 -0
  7. package/src/lib/directives/swipe.directive.ts +193 -0
  8. package/{lib/directives/swipe.model.d.ts → src/lib/directives/swipe.model.ts} +6 -0
  9. package/src/lib/directives/tooltip.directive.spec.ts.BAK +8 -0
  10. package/src/lib/directives/tooltip.directive.ts +121 -0
  11. package/src/lib/kms-ngx-ui-presentational.component.spec.ts +25 -0
  12. package/src/lib/kms-ngx-ui-presentational.component.ts +20 -0
  13. package/src/lib/kms-ngx-ui-presentational.module.ts +124 -0
  14. package/src/lib/kms-ngx-ui-presentational.service.spec.ts +16 -0
  15. package/src/lib/kms-ngx-ui-presentational.service.ts +9 -0
  16. package/src/lib/models/address.model.ts +16 -0
  17. package/src/lib/models/iconSize.enum.ts +17 -0
  18. package/src/lib/models/image-snippet.model.ts +17 -0
  19. package/src/lib/models/is-value.function.ts +20 -0
  20. package/src/lib/models/salutation.enum.ts +6 -0
  21. package/{lib/models/types/attached-file-dto.model.d.ts → src/lib/models/types/attached-file-dto.model.ts} +1 -1
  22. package/{lib/models/types/nullable.type.d.ts → src/lib/models/types/nullable.type.ts} +1 -0
  23. package/src/lib/parent-components/actions.component.ts +43 -0
  24. package/src/lib/parent-components/form-control.component.ts +77 -0
  25. package/src/lib/parent-components/form.component.ts +79 -0
  26. package/src/lib/pipes/custom-pipes.module.ts +48 -0
  27. package/src/lib/pipes/decode-uri.pipe.ts +15 -0
  28. package/src/lib/pipes/encode-uri.pipe.ts +14 -0
  29. package/src/lib/pipes/integer-currency.pipe.ts +22 -0
  30. package/src/lib/pipes/prettyjson.pipe.ts +104 -0
  31. package/src/lib/pipes/safe-html.pipe.ts +17 -0
  32. package/src/lib/pipes/safe-resource-url.pipe.ts +17 -0
  33. package/src/lib/pipes/safe-style.pipe.ts +17 -0
  34. package/src/lib/pipes/safe-url.pipe.ts +17 -0
  35. package/src/lib/pipes/to-number.pipe.ts +19 -0
  36. package/src/lib/pipes/trim.pipe.ts +16 -0
  37. package/src/lib/pipes/typeof.pipe.ts +10 -0
  38. package/src/lib/services/viewport.service.ts +241 -0
  39. package/src/lib/ui/back-to-top/back-to-top.component.html +7 -0
  40. package/src/lib/ui/back-to-top/back-to-top.component.ts +43 -0
  41. package/src/lib/ui/back-to-top/back-to-top.stories.ts +19 -0
  42. package/src/lib/ui/button-with-confirm-dialog/button-response-types.enum.ts +4 -0
  43. package/src/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.html +8 -0
  44. package/src/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.spec.ts.BAK +25 -0
  45. package/src/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.ts +55 -0
  46. package/src/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.stories.ts +21 -0
  47. package/{lib/ui/button-with-confirm-dialog/dialog-data.model.d.ts → src/lib/ui/button-with-confirm-dialog/dialog-data.model.ts} +4 -3
  48. package/src/lib/ui/checkbox/checkbox.component.html +15 -0
  49. package/src/lib/ui/checkbox/checkbox.component.stories.ts +19 -0
  50. package/src/lib/ui/checkbox/checkbox.component.ts +75 -0
  51. package/src/lib/ui/color-input/color-input.component.html +11 -0
  52. package/src/lib/ui/color-input/color-input.component.spec.ts +44 -0
  53. package/src/lib/ui/color-input/color-input.component.ts +67 -0
  54. package/src/lib/ui/dropdown-from-data/dropdown-from-data.component.html +23 -0
  55. package/src/lib/ui/dropdown-from-data/dropdown-from-data.component.ts +174 -0
  56. package/src/lib/ui/enum-radiogroup/enum-radiogroup.component.html +6 -0
  57. package/src/lib/ui/enum-radiogroup/enum-radiogroup.component.spec.ts.BAK +25 -0
  58. package/src/lib/ui/enum-radiogroup/enum-radiogroup.component.ts +43 -0
  59. package/src/lib/ui/file-input/file-input.component.html +45 -0
  60. package/src/lib/ui/file-input/file-input.component.spec.ts.BAK +25 -0
  61. package/src/lib/ui/file-input/file-input.component.ts +236 -0
  62. package/src/lib/ui/flyout/flyout.component.html +35 -0
  63. package/src/lib/ui/flyout/flyout.component.spec.ts.BAK +30 -0
  64. package/src/lib/ui/flyout/flyout.component.ts +95 -0
  65. package/src/lib/ui/generic-dialog/generic-dialog.component.html +24 -0
  66. package/src/lib/ui/generic-dialog/generic-dialog.component.spec.ts.BAK +43 -0
  67. package/src/lib/ui/generic-dialog/generic-dialog.component.ts +54 -0
  68. package/src/lib/ui/icon/icon.component.html +22 -0
  69. package/src/lib/ui/icon/icon.component.spec.ts.BAK +31 -0
  70. package/src/lib/ui/icon/icon.component.ts +67 -0
  71. package/src/lib/ui/icon/iconSize.enum.ts +17 -0
  72. package/src/lib/ui/image-slider/image-slider.component.html +54 -0
  73. package/src/lib/ui/image-slider/image-slider.component.ts +205 -0
  74. package/src/lib/ui/kms-accordion-item/kms-accordion-item.component.html +22 -0
  75. package/src/lib/ui/kms-accordion-item/kms-accordion-item.component.spec.ts +61 -0
  76. package/src/lib/ui/kms-accordion-item/kms-accordion-item.component.ts +32 -0
  77. package/src/lib/ui/loader/loader.component.html +3 -0
  78. package/src/lib/ui/loader/loader.component.spec.ts.BAK +26 -0
  79. package/src/lib/ui/loader/loader.component.ts +16 -0
  80. package/src/lib/ui/map/map.component.html +18 -0
  81. package/src/lib/ui/map/map.component.spec.ts.BAK +31 -0
  82. package/src/lib/ui/map/map.component.ts +138 -0
  83. package/src/lib/ui/radiobutton/radiobutton.component.html +42 -0
  84. package/src/lib/ui/radiobutton/radiobutton.component.ts +71 -0
  85. package/src/lib/ui/salutation-dropdown/salutation-dropdown.component.html +9 -0
  86. package/src/lib/ui/salutation-dropdown/salutation-dropdown.component.spec.ts.BAK +26 -0
  87. package/src/lib/ui/salutation-dropdown/salutation-dropdown.component.ts +48 -0
  88. package/src/lib/ui/salutation-radiogroup/salutation-radiogroup.component.html +13 -0
  89. package/src/lib/ui/salutation-radiogroup/salutation-radiogroup.component.spec.ts.BAK +25 -0
  90. package/src/lib/ui/salutation-radiogroup/salutation-radiogroup.component.ts +41 -0
  91. package/src/lib/ui/time-input/time-input.component.html +5 -0
  92. package/src/lib/ui/time-input/time-input.component.spec.ts +28 -0
  93. package/src/lib/ui/time-input/time-input.component.ts +88 -0
  94. package/src/lib/ui/tooltip/tooltip.component.html +1 -0
  95. package/src/lib/ui/tooltip/tooltip.component.spec.ts.BAK +26 -0
  96. package/src/lib/ui/tooltip/tooltip.component.ts +10 -0
  97. package/src/lib/ui/tooltip-icon/tooltip-icon.component.html +11 -0
  98. package/src/lib/ui/tooltip-icon/tooltip-icon.component.spec.ts.BAK +28 -0
  99. package/src/lib/ui/tooltip-icon/tooltip-icon.component.ts +19 -0
  100. package/src/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.html +7 -0
  101. package/src/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.scss +17 -0
  102. package/src/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.spec.ts.BAK +25 -0
  103. package/src/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.ts +79 -0
  104. package/{public-api.d.ts → src/public-api.ts} +8 -0
  105. package/src/styles/styles.scss +3 -1
  106. package/src/test-setup.ts +2 -0
  107. package/tsconfig.lib.json +26 -0
  108. package/tsconfig.lib.prod.json +10 -0
  109. package/tsconfig.spec.json +17 -0
  110. package/tslint.json +17 -0
  111. package/esm2022/kms-ngx-ui-presentational.mjs +0 -5
  112. package/esm2022/lib/directives/directives.module.mjs +0 -40
  113. package/esm2022/lib/directives/mousewheel.directive.mjs +0 -56
  114. package/esm2022/lib/directives/sum-of-height.directive.mjs +0 -74
  115. package/esm2022/lib/directives/swipe.directive.mjs +0 -183
  116. package/esm2022/lib/directives/swipe.model.mjs +0 -5
  117. package/esm2022/lib/directives/tooltip.directive.mjs +0 -144
  118. package/esm2022/lib/kms-ngx-ui-presentational.component.mjs +0 -22
  119. package/esm2022/lib/kms-ngx-ui-presentational.module.mjs +0 -211
  120. package/esm2022/lib/kms-ngx-ui-presentational.service.mjs +0 -14
  121. package/esm2022/lib/models/address.model.mjs +0 -6
  122. package/esm2022/lib/models/iconSize.enum.mjs +0 -17
  123. package/esm2022/lib/models/image-snippet.model.mjs +0 -18
  124. package/esm2022/lib/models/index.mjs +0 -5
  125. package/esm2022/lib/models/is-value.function.mjs +0 -17
  126. package/esm2022/lib/models/salutation.enum.mjs +0 -8
  127. package/esm2022/lib/models/types/attached-file-dto.model.mjs +0 -6
  128. package/esm2022/lib/models/types/nullable.type.mjs +0 -5
  129. package/esm2022/lib/parent-components/actions.component.mjs +0 -56
  130. package/esm2022/lib/parent-components/form-control.component.mjs +0 -75
  131. package/esm2022/lib/parent-components/form.component.mjs +0 -78
  132. package/esm2022/lib/pipes/custom-pipes.module.mjs +0 -71
  133. package/esm2022/lib/pipes/decode-uri.pipe.mjs +0 -19
  134. package/esm2022/lib/pipes/encode-uri.pipe.mjs +0 -19
  135. package/esm2022/lib/pipes/integer-currency.pipe.mjs +0 -27
  136. package/esm2022/lib/pipes/safe-html.pipe.mjs +0 -23
  137. package/esm2022/lib/pipes/safe-resource-url.pipe.mjs +0 -23
  138. package/esm2022/lib/pipes/safe-style.pipe.mjs +0 -23
  139. package/esm2022/lib/pipes/safe-url.pipe.mjs +0 -23
  140. package/esm2022/lib/pipes/to-number.pipe.mjs +0 -23
  141. package/esm2022/lib/pipes/trim.pipe.mjs +0 -20
  142. package/esm2022/lib/pipes/typeof.pipe.mjs +0 -16
  143. package/esm2022/lib/services/viewport.service.mjs +0 -216
  144. package/esm2022/lib/ui/back-to-top/back-to-top.component.mjs +0 -49
  145. package/esm2022/lib/ui/button-with-confirm-dialog/button-response-types.enum.mjs +0 -6
  146. package/esm2022/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.mjs +0 -58
  147. package/esm2022/lib/ui/button-with-confirm-dialog/dialog-data.model.mjs +0 -2
  148. package/esm2022/lib/ui/checkbox/checkbox.component.mjs +0 -71
  149. package/esm2022/lib/ui/color-input/color-input.component.mjs +0 -76
  150. package/esm2022/lib/ui/dropdown-from-data/dropdown-from-data.component.mjs +0 -157
  151. package/esm2022/lib/ui/enum-radiogroup/enum-radiogroup.component.mjs +0 -53
  152. package/esm2022/lib/ui/file-input/file-input.component.mjs +0 -232
  153. package/esm2022/lib/ui/flyout/flyout.component.mjs +0 -119
  154. package/esm2022/lib/ui/generic-dialog/generic-dialog.component.mjs +0 -55
  155. package/esm2022/lib/ui/icon/icon.component.mjs +0 -48
  156. package/esm2022/lib/ui/icon/iconSize.enum.mjs +0 -17
  157. package/esm2022/lib/ui/image-slider/image-slider.component.mjs +0 -189
  158. package/esm2022/lib/ui/kms-accordion-item/kms-accordion-item.component.mjs +0 -40
  159. package/esm2022/lib/ui/loader/loader.component.mjs +0 -21
  160. package/esm2022/lib/ui/map/map.component.mjs +0 -116
  161. package/esm2022/lib/ui/radiobutton/radiobutton.component.mjs +0 -73
  162. package/esm2022/lib/ui/salutation-dropdown/salutation-dropdown.component.mjs +0 -55
  163. package/esm2022/lib/ui/salutation-radiogroup/salutation-radiogroup.component.mjs +0 -49
  164. package/esm2022/lib/ui/time-input/time-input.component.mjs +0 -83
  165. package/esm2022/lib/ui/tooltip/tooltip.component.mjs +0 -16
  166. package/esm2022/lib/ui/tooltip-icon/tooltip-icon.component.mjs +0 -35
  167. package/esm2022/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.mjs +0 -82
  168. package/esm2022/public-api.mjs +0 -49
  169. package/fesm2022/kms-ngx-ui-presentational.mjs +0 -3003
  170. package/fesm2022/kms-ngx-ui-presentational.mjs.map +0 -1
  171. package/index.d.ts +0 -5
  172. package/lib/directives/directives.module.d.ts +0 -11
  173. package/lib/directives/mousewheel.directive.d.ts +0 -15
  174. package/lib/directives/sum-of-height.directive.d.ts +0 -31
  175. package/lib/directives/swipe.directive.d.ts +0 -45
  176. package/lib/directives/tooltip.directive.d.ts +0 -29
  177. package/lib/kms-ngx-ui-presentational.component.d.ts +0 -8
  178. package/lib/kms-ngx-ui-presentational.module.d.ts +0 -47
  179. package/lib/kms-ngx-ui-presentational.service.d.ts +0 -6
  180. package/lib/models/address.model.d.ts +0 -14
  181. package/lib/models/iconSize.enum.d.ts +0 -15
  182. package/lib/models/image-snippet.model.d.ts +0 -15
  183. package/lib/models/is-value.function.d.ts +0 -9
  184. package/lib/models/salutation.enum.d.ts +0 -5
  185. package/lib/parent-components/actions.component.d.ts +0 -31
  186. package/lib/parent-components/form-control.component.d.ts +0 -27
  187. package/lib/parent-components/form.component.d.ts +0 -34
  188. package/lib/pipes/custom-pipes.module.d.ts +0 -17
  189. package/lib/pipes/decode-uri.pipe.d.ts +0 -10
  190. package/lib/pipes/encode-uri.pipe.d.ts +0 -10
  191. package/lib/pipes/integer-currency.pipe.d.ts +0 -13
  192. package/lib/pipes/safe-html.pipe.d.ts +0 -13
  193. package/lib/pipes/safe-resource-url.pipe.d.ts +0 -13
  194. package/lib/pipes/safe-style.pipe.d.ts +0 -13
  195. package/lib/pipes/safe-url.pipe.d.ts +0 -13
  196. package/lib/pipes/to-number.pipe.d.ts +0 -10
  197. package/lib/pipes/trim.pipe.d.ts +0 -10
  198. package/lib/pipes/typeof.pipe.d.ts +0 -7
  199. package/lib/services/viewport.service.d.ts +0 -74
  200. package/lib/ui/back-to-top/back-to-top.component.d.ts +0 -10
  201. package/lib/ui/button-with-confirm-dialog/button-response-types.enum.d.ts +0 -4
  202. package/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.d.ts +0 -19
  203. package/lib/ui/checkbox/checkbox.component.d.ts +0 -31
  204. package/lib/ui/color-input/color-input.component.d.ts +0 -19
  205. package/lib/ui/dropdown-from-data/dropdown-from-data.component.d.ts +0 -55
  206. package/lib/ui/enum-radiogroup/enum-radiogroup.component.d.ts +0 -17
  207. package/lib/ui/file-input/file-input.component.d.ts +0 -89
  208. package/lib/ui/flyout/flyout.component.d.ts +0 -32
  209. package/lib/ui/generic-dialog/generic-dialog.component.d.ts +0 -26
  210. package/lib/ui/icon/icon.component.d.ts +0 -42
  211. package/lib/ui/icon/iconSize.enum.d.ts +0 -15
  212. package/lib/ui/image-slider/image-slider.component.d.ts +0 -62
  213. package/lib/ui/kms-accordion-item/kms-accordion-item.component.d.ts +0 -22
  214. package/lib/ui/loader/loader.component.d.ts +0 -9
  215. package/lib/ui/map/map.component.d.ts +0 -71
  216. package/lib/ui/radiobutton/radiobutton.component.d.ts +0 -26
  217. package/lib/ui/salutation-dropdown/salutation-dropdown.component.d.ts +0 -17
  218. package/lib/ui/salutation-radiogroup/salutation-radiogroup.component.d.ts +0 -15
  219. package/lib/ui/time-input/time-input.component.d.ts +0 -22
  220. package/lib/ui/tooltip/tooltip.component.d.ts +0 -6
  221. package/lib/ui/tooltip-icon/tooltip-icon.component.d.ts +0 -13
  222. package/lib/ui/yes-no-radiogroup/yes-no-radiogroup.component.d.ts +0 -27
  223. /package/{lib/models/index.d.ts → src/lib/models/index.ts} +0 -0
@@ -0,0 +1,124 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
5
+ import { KmsUiPresentationalComponent } from './kms-ngx-ui-presentational.component';
6
+ import { ActionsParentComponent } from './parent-components/actions.component';
7
+ import { CheckboxComponent } from './ui/checkbox/checkbox.component';
8
+
9
+ import { MatCheckboxModule } from '@angular/material/checkbox';
10
+ import { MatRadioModule } from '@angular/material/radio';
11
+ import { ColorInputComponent } from './ui/color-input/color-input.component';
12
+ import { RadioButtonComponent } from './ui/radiobutton/radiobutton.component';
13
+ import { TimeInputComponent } from './ui/time-input/time-input.component';
14
+ import { YesNoRadiogroupComponent } from './ui/yes-no-radiogroup/yes-no-radiogroup.component';
15
+ import { FileInputComponent } from './ui/file-input/file-input.component';
16
+ import { LoaderComponent } from './ui/loader/loader.component';
17
+ import { FlyoutComponent } from './ui/flyout/flyout.component';
18
+ import { CustomPipesModule } from './pipes/custom-pipes.module';
19
+ import { IconComponent } from './ui/icon/icon.component';
20
+ import { EnumRadiogroupComponent } from './ui/enum-radiogroup/enum-radiogroup.component';
21
+ import { KMSAccordionItemComponent } from './ui/kms-accordion-item/kms-accordion-item.component';
22
+ import { MapComponent } from './ui/map/map.component';
23
+ import { SalutationDropdownComponent } from './ui/salutation-dropdown/salutation-dropdown.component';
24
+ import { TooltipComponent } from './ui/tooltip/tooltip.component';
25
+ import { TooltipIconComponent } from './ui/tooltip-icon/tooltip-icon.component';
26
+
27
+ import { SalutationRadiogroupComponent } from './ui/salutation-radiogroup/salutation-radiogroup.component';
28
+ import { BackToTopComponent } from './ui/back-to-top/back-to-top.component';
29
+ import { ButtonWithConfirmDialogComponent } from './ui/button-with-confirm-dialog/button-with-confirm-dialog.component';
30
+ import { GoogleMapsModule } from '@angular/google-maps';
31
+ import { MatDialogModule } from '@angular/material/dialog';
32
+ import { MatButtonModule } from '@angular/material/button';
33
+ import { GenericDialogComponent } from './ui/generic-dialog/generic-dialog.component';
34
+ import { MatExpansionModule } from '@angular/material/expansion';
35
+ import { MatSelectModule } from '@angular/material/select';
36
+ import { MatMenuModule } from '@angular/material/menu';
37
+ import { DropdownFromDataComponent } from './ui/dropdown-from-data/dropdown-from-data.component';
38
+ import { ImageSliderComponent } from './ui/image-slider/image-slider.component';
39
+ import { DirectivesModule } from './directives/directives.module';
40
+ import { TranslateModule } from '@ngx-translate/core';
41
+ import { ViewportService } from './services/viewport.service';
42
+ import { MatFormFieldModule } from '@angular/material/form-field';
43
+ import { MatInputModule } from '@angular/material/input';
44
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
45
+ import { NgxUsefulSwiperModule } from 'ngx-useful-swiper';
46
+ import { DragDropModule } from '@angular/cdk/drag-drop';
47
+
48
+ @NgModule({
49
+ declarations: [
50
+ ActionsParentComponent,
51
+ BackToTopComponent,
52
+ ButtonWithConfirmDialogComponent,
53
+ CheckboxComponent,
54
+ ColorInputComponent,
55
+ DropdownFromDataComponent,
56
+ EnumRadiogroupComponent,
57
+ EnumRadiogroupComponent,
58
+ FileInputComponent,
59
+ FlyoutComponent,
60
+ GenericDialogComponent,
61
+ IconComponent,
62
+ ImageSliderComponent,
63
+ KMSAccordionItemComponent,
64
+ KmsUiPresentationalComponent,
65
+ LoaderComponent,
66
+ MapComponent,
67
+ RadioButtonComponent,
68
+ SalutationDropdownComponent,
69
+ SalutationRadiogroupComponent,
70
+ TimeInputComponent,
71
+ TooltipComponent,
72
+ TooltipIconComponent,
73
+ YesNoRadiogroupComponent,
74
+ ],
75
+ imports: [
76
+ CommonModule,
77
+ DragDropModule,
78
+ MatCheckboxModule,
79
+ MatButtonModule,
80
+ MatRadioModule,
81
+ MatDialogModule,
82
+ FormsModule,
83
+ ReactiveFormsModule,
84
+ MatFormFieldModule,
85
+ MatInputModule,
86
+ MatMenuModule,
87
+ CustomPipesModule,
88
+ GoogleMapsModule,
89
+ MatExpansionModule,
90
+ MatSelectModule,
91
+ MatProgressSpinnerModule,
92
+ DirectivesModule,
93
+ TranslateModule,
94
+ NgxUsefulSwiperModule,
95
+ ],
96
+ exports: [
97
+ ActionsParentComponent,
98
+ BackToTopComponent,
99
+ ButtonWithConfirmDialogComponent,
100
+ CheckboxComponent,
101
+ ColorInputComponent,
102
+ DropdownFromDataComponent,
103
+ EnumRadiogroupComponent,
104
+ EnumRadiogroupComponent,
105
+ FileInputComponent,
106
+ FlyoutComponent,
107
+ GenericDialogComponent,
108
+ IconComponent,
109
+ ImageSliderComponent,
110
+ KMSAccordionItemComponent,
111
+ KmsUiPresentationalComponent,
112
+ LoaderComponent,
113
+ MapComponent,
114
+ RadioButtonComponent,
115
+ SalutationDropdownComponent,
116
+ SalutationRadiogroupComponent,
117
+ TimeInputComponent,
118
+ TooltipComponent,
119
+ TooltipIconComponent,
120
+ YesNoRadiogroupComponent,
121
+ ],
122
+ providers: [ViewportService],
123
+ })
124
+ export class KmsUiPresentationalModule {}
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { KmsUiPresentationalService } from './kms-ngx-ui-presentational.service';
4
+
5
+ describe('KmsUiPresentationalService', () => {
6
+ let service: KmsUiPresentationalService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(KmsUiPresentationalService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,9 @@
1
+ import { Injectable } from '@angular/core';
2
+
3
+ @Injectable({
4
+ providedIn: 'root'
5
+ })
6
+ export class KmsUiPresentationalService {
7
+
8
+ constructor() { }
9
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @copyright KMS GmbH
3
+ */
4
+ import { NullAble } from "./types/nullable.type";
5
+
6
+
7
+ /**
8
+ * Typical basic address data
9
+ */
10
+ export class Address {
11
+ public City: NullAble<string>;
12
+ public Name1: NullAble<string>;
13
+ public Name2: NullAble<string>;
14
+ public Street: NullAble<string>;
15
+ public Zip: NullAble<string>;
16
+ }
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * @copyright FLYACTS GmbH 2019
3
+ */
4
+
5
+ export enum IconSize {
6
+ FULLSIZE = 'size-full',
7
+ TINY = 'size-16',
8
+ SMALLER = 'size-20',
9
+ SMALL = 'size-32',
10
+ MEDIUM = 'size-64',
11
+ LARGE = 'size-128',
12
+ XL = 'size-256',
13
+ XXL = 'size-512',
14
+ XXXL = 'size-1024',
15
+ NONE = 'NONE',
16
+ }
17
+
@@ -0,0 +1,17 @@
1
+ /**
2
+ * General Image Model
3
+ */
4
+ export class ImageSnippet {
5
+ status = 'init';
6
+ constructor(
7
+ public src: string,
8
+ public fileName: string,
9
+ public srcType = ImageSourceType.ByteArray,
10
+ ) {}
11
+ }
12
+
13
+ export enum ImageSourceType {
14
+ Ident = 'Idnet',
15
+ ByteArray = 'ByteArray',
16
+ URL = 'URL'
17
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @copyright FLYACTS GmbH 2019
3
+ */
4
+
5
+ import { NullAble } from "./types/nullable.type";
6
+
7
+
8
+ /**
9
+ * Check if null or undefined
10
+ * @param value value that is being checked
11
+ */
12
+ export function isValue<T>(value: NullAble<T>): value is T {
13
+ if (value === null) {
14
+ return false;
15
+ }
16
+ if (typeof value === 'undefined') {
17
+ return false;
18
+ }
19
+ return true;
20
+ }
@@ -0,0 +1,6 @@
1
+ // TODO change values after cleaned up database
2
+ export enum SalutationEnum {
3
+ NOT_SPECIFIED = 'Keine Anrede',
4
+ MALE = 'Herr',
5
+ FEMALE = 'Frau',
6
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Attached File DTO
3
3
  */
4
- export declare class AttachedFileDTO {
4
+ export class AttachedFileDTO {
5
5
  ImageIdent?: string;
6
6
  ImageLink?: string;
7
7
  Filename?: string;
@@ -1,4 +1,5 @@
1
1
  /*!
2
2
  * @copyright FLYACTS GmbH 2019
3
3
  */
4
+
4
5
  export type NullAble<T> = T | null | undefined;
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * @copyright FLYACTS GmbH 2019
3
+ */
4
+
5
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
6
+
7
+ @Component({
8
+ selector: 'kms-actions',
9
+ template: '',
10
+ })
11
+ export class ActionsParentComponent {
12
+ /**
13
+ * Defines the disabled property
14
+ */
15
+ @Input() disabled = false;
16
+
17
+ /**
18
+ * Set button as selected. F.e. in multiselect component
19
+ */
20
+ @Input() checked = false;
21
+
22
+ /**
23
+ * Displayed label.
24
+ */
25
+ @Input() label = '';
26
+
27
+ /**
28
+ * Link
29
+ */
30
+ @Input() link = '';
31
+
32
+ /**
33
+ * Internal value that will be send if a form is submitted.
34
+ */
35
+ @Input() initialValue = '';
36
+
37
+ @Output() select = new EventEmitter();
38
+
39
+ selectAction(id: string) {
40
+ this.checked = !this.checked;
41
+ this.select.emit(id);
42
+ }
43
+ }
@@ -0,0 +1,77 @@
1
+ import { Component, ElementRef, Input, EventEmitter, Output, ViewChild, Renderer2 } from '@angular/core';
2
+ import { UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
3
+ import { FormParentComponent } from './form.component';
4
+
5
+ @Component({
6
+ selector: 'kms-formControlParent',
7
+ template: '',
8
+ })
9
+ export class FormControlParentComponent extends FormParentComponent {
10
+ @Input() defaultDataOverride = ''; // when we have NO form around, get default via input to set it manually
11
+ @Output() onSelectItemEmitter = new EventEmitter<string>();
12
+
13
+ @ViewChild('child') public child?: ElementRef<HTMLInputElement>;
14
+
15
+ public internalValue = '';
16
+
17
+ constructor(public formBuilder: UntypedFormBuilder, public renderer: Renderer2) {
18
+ super(formBuilder);
19
+ }
20
+
21
+ ngOnInit(){
22
+ super.ngOnInit();
23
+ }
24
+
25
+ change(value: string) {
26
+ this.onChange(value);
27
+ this.onTouched();
28
+ }
29
+
30
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
31
+ public onChange: any = () => {};
32
+
33
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
34
+ onTouch: any = () => {};
35
+
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
37
+ onTouched: any = () => {};
38
+
39
+ get value(): string {
40
+ return this.internalValue;
41
+ }
42
+
43
+ set value(value: string) {
44
+ this.internalValue = value;
45
+ if (value !== undefined && this.internalValue !== value) {
46
+ if (!this.internalValue && this.defaultDataOverride) {
47
+ this.internalValue = this.defaultDataOverride;
48
+ }
49
+ this.onChange(value);
50
+ this.onTouch(value);
51
+ }
52
+ }
53
+
54
+ writeValue(value: string) {
55
+ this.internalValue = value;
56
+ this.value = value;
57
+ }
58
+
59
+ registerOnChange(fn: any) {
60
+ this.onChange = fn;
61
+ }
62
+
63
+ registerOnTouched(fn: any) {
64
+ this.onTouch = fn;
65
+ }
66
+
67
+ setDisabledState?(isDisabled: boolean) {
68
+ if (this.child) {
69
+ this.renderer.setProperty(this.child.nativeElement, 'disabled', isDisabled);
70
+ }
71
+ }
72
+
73
+ validate(_: UntypedFormControl) {
74
+ return this.form.valid ? null : false;
75
+ }
76
+
77
+ }
@@ -0,0 +1,79 @@
1
+ /*!
2
+ * @copyright FLYACTS GmbH 2019
3
+ */
4
+
5
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
6
+ import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
7
+
8
+ @Component({
9
+ selector: 'kms-form',
10
+ template: '',
11
+ })
12
+ export class FormParentComponent implements OnInit {
13
+ public form!: UntypedFormGroup;
14
+ public formInitialized = false;
15
+ private allowedCharsOnlyNumbers = new Set('0123456789'.split('').map(c => c.charCodeAt(0)));
16
+
17
+ @Output() formDataChanged: EventEmitter<UntypedFormGroup> = new EventEmitter();
18
+
19
+ @Input() disabled = false;
20
+
21
+ constructor(
22
+ public formBuilder: UntypedFormBuilder
23
+ ) {
24
+
25
+ }
26
+
27
+ // TODO make a service or make own compoennt etc.
28
+ /**
29
+ * Returns if a number was pressed
30
+ * @param e
31
+ * @returns
32
+ */
33
+ checkIfKeyWasNumber(e: KeyboardEvent, allowDelete = true, allowArrows = true, allowCutCopyPaste = true){
34
+ // returns if keycode of numbers-row or numberpad. Or if parameter set, allow delete/backspace key
35
+ const isNumberRow = e.keyCode >= 48 && e.keyCode <= 57;
36
+ const isNumberPad = e.keyCode >= 96 && e.keyCode <= 105;
37
+ const isArrows = e.keyCode >= 37 && e.keyCode <= 40;
38
+ const isDelete = e.keyCode == 8 || e.keyCode == 46;
39
+ const isCutCopyOrPaste = (e.ctrlKey || e.metaKey) && (e.keyCode == 86 || e.keyCode == 88 || e.keyCode == 67);
40
+ return (isNumberRow) || (isNumberPad) || (allowDelete && isDelete) || (allowArrows && isArrows) || (allowCutCopyPaste && isCutCopyOrPaste);
41
+ }
42
+
43
+ // TODO make a service or make own compoennt etc.
44
+ /**
45
+ * Prevents to input other chars than numbers in input
46
+ * @param event
47
+ */
48
+ removeNumbersOnType(event: KeyboardEvent) {
49
+ // only allow keydown from numbers-row or numberpad of keybard and block other chars than numbers
50
+ if (!this.checkIfKeyWasNumber(event) && !this.allowedCharsOnlyNumbers.has(event.keyCode)) {
51
+ event.preventDefault();
52
+ }
53
+ }
54
+
55
+ // TODO make a service or make own compoennt etc.
56
+ /**
57
+ * Prevents input when pasting which is not number
58
+ * @param event
59
+ */
60
+ removeNumbersOnPaste(event: ClipboardEvent){
61
+ const clipboardData = event.clipboardData;
62
+ if(clipboardData){
63
+ const pastedText = clipboardData.getData('text');
64
+ if(pastedText){
65
+ const isnum = /^\d+$/.test(pastedText);
66
+ if(!isnum) {
67
+ event.preventDefault();
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ ngOnInit() {
74
+ this.formDataChanged.emit(this.form);
75
+ this.form.valueChanges.subscribe(() => {
76
+ this.formDataChanged.emit(this.form);
77
+ });
78
+ }
79
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @copyright KMS GmbH
3
+ */
4
+
5
+ import { CommonModule, CurrencyPipe } from '@angular/common';
6
+ import { NgModule } from '@angular/core';
7
+
8
+ import { IntegerCurrency } from './integer-currency.pipe';
9
+ import { DecodeUriPipe } from './decode-uri.pipe';
10
+ import { EncodeUriPipe } from './encode-uri.pipe';
11
+ import { SafeHtmlPipe } from './safe-html.pipe';
12
+ import { SafeStylePipe } from './safe-style.pipe';
13
+ import { SafeUrlPipe } from './safe-url.pipe';
14
+ import { SafeResourceUrlPipe } from './safe-resource-url.pipe';
15
+ import { TypeofPipe } from './typeof.pipe';
16
+ import { TrimPipe } from './trim.pipe';
17
+ import { ToNumberPipe } from './to-number.pipe';
18
+
19
+ @NgModule({
20
+ declarations: [
21
+ IntegerCurrency,
22
+ SafeHtmlPipe,
23
+ SafeStylePipe,
24
+ SafeResourceUrlPipe,
25
+ SafeUrlPipe,
26
+ EncodeUriPipe,
27
+ DecodeUriPipe,
28
+ TypeofPipe,
29
+ TrimPipe,
30
+ ToNumberPipe,
31
+ ],
32
+ imports: [CommonModule],
33
+ exports: [
34
+ IntegerCurrency,
35
+ SafeHtmlPipe,
36
+ SafeStylePipe,
37
+ SafeResourceUrlPipe,
38
+ SafeUrlPipe,
39
+ EncodeUriPipe,
40
+ DecodeUriPipe,
41
+ TypeofPipe,
42
+ TrimPipe,
43
+ ToNumberPipe,
44
+ ],
45
+ providers: [CurrencyPipe],
46
+ })
47
+ export class CustomPipesModule {}
48
+
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * @copyright FLYACTS GmbH 2019
3
+ */
4
+
5
+ import { Pipe, PipeTransform } from '@angular/core';
6
+
7
+ @Pipe({
8
+ name: 'kmsDecodeUri',
9
+ })
10
+ export class DecodeUriPipe implements PipeTransform {
11
+
12
+ transform(value: any, _args?: any): any {
13
+ return decodeURI(value);
14
+ }
15
+ }
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * @copyright FLYACTS GmbH 2019
3
+ */
4
+
5
+ import { Pipe, PipeTransform } from '@angular/core';
6
+
7
+ @Pipe({
8
+ name: 'kmsEncodeUri',
9
+ })
10
+ export class EncodeUriPipe implements PipeTransform {
11
+ transform(value: any, _args?: any): any {
12
+ return encodeURI(value);
13
+ }
14
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @copyright KMS GmbH
3
+ */
4
+
5
+ import { CurrencyPipe } from '@angular/common';
6
+ import { Pipe, PipeTransform } from '@angular/core';
7
+
8
+ @Pipe({
9
+ name: 'kmsIntegerCurrency',
10
+ })
11
+ export class IntegerCurrency implements PipeTransform {
12
+ constructor(private cp: CurrencyPipe) {}
13
+ transform(value: any, currencyCode?: string, display?: boolean, digitsInfo?: string): string | null {
14
+ const currencyPipeValue = this.cp.transform(value, currencyCode, display, digitsInfo)
15
+ if (currencyPipeValue) {
16
+ const convertedValue = currencyPipeValue.split(',')[0] + ' ' + currencyPipeValue.slice(-1)
17
+ return convertedValue
18
+ } else {
19
+ throw new Error("No value provided");
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,104 @@
1
+ import { Pipe, PipeTransform, Renderer2, SecurityContext } from '@angular/core';
2
+ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
+
4
+ @Pipe({
5
+ name: 'kmsPrettyJson',
6
+ pure: true,
7
+ })
8
+ export class PrettyJsonPipe implements PipeTransform {
9
+ constructor(public sanitizer: DomSanitizer, public renderer2: Renderer2) { }
10
+
11
+ transform(value: any, args: any[]): any {
12
+ let ret = '' as SafeHtml;
13
+ try {
14
+ /**
15
+ * check and try to parse value if it's not an object
16
+ * if it fails to parse which means it is an invalid JSON
17
+ */
18
+ //, args[0], args[1]
19
+ if(args && args[0] && args[1]){
20
+ //console.log(args[0], args[1]);
21
+ }
22
+ ret = '<pre>' + this.applyColors(typeof value === 'object' ? value : JSON.parse(value)) + '</pre>';
23
+ //return this.sanitizer.bypassSecurityTrustHtml(ret);
24
+ } catch (e) {
25
+ ret = this.applyColors({ error: 'Invalid JSON' });
26
+ }
27
+ //console.log(ret);
28
+ //return this.sanitizer.sanitize(SecurityContext.HTML, this.sanitizer.bypassSecurityTrustHtml('<b>test</b>')) as kmsSafeHtml;
29
+ return this.sanitizer.sanitize(SecurityContext.HTML, this.sanitizer.bypassSecurityTrustHtml(ret as string)) as SafeHtml;
30
+ }
31
+
32
+ applyColors(obj: any, showNumebrLine = false, padding = 4) {
33
+ // line number start from 1
34
+ let line = 1;
35
+
36
+ if (typeof obj != 'string') {
37
+ obj = JSON.stringify(obj, undefined, 3);
38
+ }
39
+
40
+ /**
41
+ * Converts special charaters like &, <, > to equivalent HTML code of it
42
+ */
43
+ obj = obj
44
+ .replace(/&/g, '&amp;')
45
+ .replace(/</g, '&lt;')
46
+ .replace(/>/g, '&gt;');
47
+ /* taken from https://stackoverflow.com/a/7220510 */
48
+
49
+ /**
50
+ * wraps every datatype, key for e.g
51
+ * numbers from json object to something like
52
+ * <span class="number" > 234 </span>
53
+ * this is why needed custom themeClass which we created in _global.css
54
+ * @return final bunch of span tags after all conversion
55
+ */
56
+ obj = obj.replace(
57
+ /("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,
58
+ (match: any) => {
59
+ // class to be applied inside pre tag
60
+ let themeClass = 'number';
61
+ if (/^"/.test(match)) {
62
+ if (/:$/.test(match)) {
63
+ themeClass = 'key';
64
+ } else {
65
+ themeClass = 'string';
66
+ }
67
+ } else if (/true|false/.test(match)) {
68
+ themeClass = 'boolean';
69
+ } else if (/null/.test(match)) {
70
+ themeClass = 'null';
71
+ }
72
+ return '<span class="' + themeClass + '">' + match + '</span>';
73
+ },
74
+ );
75
+ obj = obj.replaceAll('[','<span class="arrayOpen">[</span>');
76
+ obj = obj.replaceAll(']','<span class="arrayClose">]</span>');
77
+ obj = obj.replaceAll(',','<span class="comma">,</span>');
78
+ obj = obj.replaceAll('{','<kms-branch>{</kms-branch>');
79
+ //obj = obj.replaceAll('{','<span class="open" (click)="console.log(\'changed\'); status=!status" [ngClass]="status ? \'show\' : \'hide\'">{</span>');
80
+ obj = obj.replaceAll('}','<span class="close">}</span>');
81
+
82
+
83
+
84
+ /**
85
+ * Regex for the start of the line, insert a number-line themeClass tag before each line
86
+ */
87
+ return showNumebrLine
88
+ ? obj.replace(
89
+ /^/gm,
90
+ () => `<span class="number-line pl-3 select-none" >${String(line++).padEnd(padding)}</span>`,
91
+ )
92
+ : obj;
93
+ }
94
+
95
+ toggleClass(event: any, className: string) {
96
+ const hasClass = event.target.classList.contains(className);
97
+
98
+ if(hasClass) {
99
+ this.renderer2.removeClass(event.target, className);
100
+ } else {
101
+ this.renderer2.addClass(event.target, className);
102
+ }
103
+ }
104
+ }
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * @copyright FLYACTS GmbH 2019
3
+ */
4
+
5
+ import { Pipe, PipeTransform } from '@angular/core';
6
+ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
7
+
8
+ @Pipe({
9
+ name: 'kmsSafeHtml',
10
+ })
11
+ export class SafeHtmlPipe implements PipeTransform {
12
+ constructor(private sanitizer: DomSanitizer) { }
13
+
14
+ transform(html: string): SafeHtml {
15
+ return this.sanitizer.bypassSecurityTrustHtml(html);
16
+ }
17
+ }