@lenne.tech/ng-base 15.0.0-beta-2 → 16.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 (241) hide show
  1. package/base-components/base-components.module.d.ts +1 -2
  2. package/base-components/components/checkbox/checkbox.component.d.ts +1 -1
  3. package/base-components/components/delete-account/delete-account.component.d.ts +1 -1
  4. package/base-components/components/fab-button/fab-button.component.d.ts +1 -1
  5. package/base-components/components/input/input.component.d.ts +1 -1
  6. package/base-components/components/loading-bar/loading-bar.component.d.ts +1 -1
  7. package/base-components/components/model-form/model-form-base.component.d.ts +1 -1
  8. package/base-components/components/model-form/model-form.component.d.ts +1 -1
  9. package/base-components/components/model-form-sub/model-form-sub.component.d.ts +1 -1
  10. package/base-components/components/model-table/model-table.component.d.ts +17 -5
  11. package/base-components/components/refence-input/refence-input.component.d.ts +1 -1
  12. package/base-components/components/select/select.component.d.ts +1 -1
  13. package/base-components/components/skeleton-loader/skeleton-loader.component.d.ts +1 -1
  14. package/base-components/components/tags/tags.component.d.ts +1 -1
  15. package/base-components/components/textarea/textarea.component.d.ts +1 -1
  16. package/base-components/components/toast/toast.component.d.ts +1 -1
  17. package/base-components/components/upload-image/upload-image.component.d.ts +1 -1
  18. package/base-components/directives/context-menu.directive.d.ts +1 -1
  19. package/base-components/directives/sort.directive.d.ts +3 -2
  20. package/base-prototype/pages/login/login.component.d.ts +1 -1
  21. package/base-prototype/pages/profile/profile.component.d.ts +1 -1
  22. package/base-prototype/pages/set-password/set-password.component.d.ts +1 -1
  23. package/esm2022/base-cms/base-cms-routing.module.mjs +33 -0
  24. package/esm2022/base-cms/base-cms.module.mjs +61 -0
  25. package/esm2022/base-cms/pages/base-cms/base-cms.component.mjs +233 -0
  26. package/esm2022/base-components/base-components.module.mjs +123 -0
  27. package/esm2022/base-components/components/breadcrumb/breadcrumb.component.mjs +21 -0
  28. package/esm2022/base-components/components/change-password/change-password.component.mjs +96 -0
  29. package/esm2022/base-components/components/checkbox/checkbox.component.mjs +35 -0
  30. package/esm2022/base-components/components/delete-account/delete-account.component.mjs +61 -0
  31. package/esm2022/base-components/components/fab-button/fab-button.component.mjs +21 -0
  32. package/esm2022/base-components/components/input/input.component.mjs +72 -0
  33. package/esm2022/base-components/components/loading-bar/loading-bar.component.mjs +39 -0
  34. package/esm2022/base-components/components/model-form/model-form-base.component.mjs +145 -0
  35. package/esm2022/base-components/components/model-form/model-form.component.mjs +585 -0
  36. package/esm2022/base-components/components/model-form-sub/model-form-sub.component.mjs +111 -0
  37. package/esm2022/base-components/components/model-table/model-table.component.mjs +470 -0
  38. package/esm2022/base-components/components/refence-input/refence-input.component.mjs +273 -0
  39. package/esm2022/base-components/components/select/select.component.mjs +59 -0
  40. package/esm2022/base-components/components/skeleton-loader/skeleton-loader.component.mjs +32 -0
  41. package/esm2022/base-components/components/tags/tags.component.mjs +224 -0
  42. package/esm2022/base-components/components/textarea/textarea.component.mjs +76 -0
  43. package/esm2022/base-components/components/toast/toast.component.mjs +70 -0
  44. package/esm2022/base-components/components/upload-image/upload-image.component.mjs +343 -0
  45. package/esm2022/base-components/directives/back-button.directive.mjs +25 -0
  46. package/esm2022/base-components/directives/context-menu.directive.mjs +112 -0
  47. package/esm2022/base-components/directives/sort.directive.mjs +61 -0
  48. package/esm2022/base-components/directives/stop-propagation.directive.mjs +24 -0
  49. package/esm2022/base-components/pipes/ellipses.pipe.mjs +23 -0
  50. package/esm2022/base-prototype/base-prototype.module.mjs +54 -0
  51. package/esm2022/base-prototype/pages/email-verification/email-verification.component.mjs +62 -0
  52. package/esm2022/base-prototype/pages/forgot-password/forgot-password.component.mjs +75 -0
  53. package/esm2022/base-prototype/pages/login/login.component.mjs +111 -0
  54. package/esm2022/base-prototype/pages/profile/profile.component.mjs +86 -0
  55. package/esm2022/base-prototype/pages/register/register.component.mjs +94 -0
  56. package/esm2022/base-prototype/pages/set-password/set-password.component.mjs +90 -0
  57. package/esm2022/shared/classes/auth.class.mjs +14 -0
  58. package/esm2022/shared/classes/basic-user.class.mjs +49 -0
  59. package/esm2022/shared/classes/graphql-enum.class.mjs +10 -0
  60. package/esm2022/shared/classes/graphql-meta.class.mjs +345 -0
  61. package/esm2022/shared/classes/graphql-type.class.mjs +14 -0
  62. package/esm2022/shared/classes/sort.class.mjs +38 -0
  63. package/esm2022/shared/services/auth.service.mjs +153 -0
  64. package/esm2022/shared/services/breadcrumb.service.mjs +70 -0
  65. package/{esm2020 → esm2022}/shared/services/cms.service.mjs +7 -5
  66. package/esm2022/shared/services/file.service.mjs +87 -0
  67. package/esm2022/shared/services/forms.service.mjs +62 -0
  68. package/esm2022/shared/services/graphql-meta.service.mjs +133 -0
  69. package/esm2022/shared/services/graphql-plus.service.mjs +94 -0
  70. package/esm2022/shared/services/graphql.service.mjs +511 -0
  71. package/esm2022/shared/services/image.service.mjs +103 -0
  72. package/esm2022/shared/services/loader.service.mjs +79 -0
  73. package/esm2022/shared/services/navigation.service.mjs +39 -0
  74. package/esm2022/shared/services/scroll.service.mjs +208 -0
  75. package/esm2022/shared/services/storage.service.mjs +142 -0
  76. package/esm2022/shared/services/toast.service.mjs +40 -0
  77. package/esm2022/shared/services/user.service.mjs +161 -0
  78. package/esm2022/shared/services/ws.service.mjs +18 -0
  79. package/esm2022/src/base.module.mjs +98 -0
  80. package/esm2022/src/directives/lazy-load.directive.mjs +48 -0
  81. package/esm2022/src/directives/match-height.directive.mjs +92 -0
  82. package/esm2022/src/directives/resizable.directive.mjs +92 -0
  83. package/esm2022/src/factories/apollo-options.factory.mjs +108 -0
  84. package/esm2022/src/functions/extract-files.function.mjs +87 -0
  85. package/esm2022/src/guards/auth.guard.mjs +84 -0
  86. package/esm2022/src/guards/can-deactivate.guard.mjs +17 -0
  87. package/esm2022/src/guards/logout.guard.mjs +35 -0
  88. package/esm2022/src/pipes/date-ago.pipe.mjs +64 -0
  89. package/esm2022/src/pipes/safe-html.pipe.mjs +23 -0
  90. package/esm2022/src/services/fullscreen.service.mjs +52 -0
  91. package/esm2022/src/services/seo.service.mjs +100 -0
  92. package/esm2022/src/services/theme.service.mjs +45 -0
  93. package/{fesm2020 → fesm2022}/lenne.tech-ng-base-base-cms.mjs +42 -30
  94. package/{fesm2020 → fesm2022}/lenne.tech-ng-base-base-cms.mjs.map +1 -1
  95. package/{fesm2020 → fesm2022}/lenne.tech-ng-base-base-components.mjs +467 -286
  96. package/fesm2022/lenne.tech-ng-base-base-components.mjs.map +1 -0
  97. package/{fesm2020 → fesm2022}/lenne.tech-ng-base-base-prototype.mjs +127 -87
  98. package/{fesm2015 → fesm2022}/lenne.tech-ng-base-base-prototype.mjs.map +1 -1
  99. package/{fesm2020 → fesm2022}/lenne.tech-ng-base-shared.mjs +165 -113
  100. package/{fesm2020 → fesm2022}/lenne.tech-ng-base-shared.mjs.map +1 -1
  101. package/{fesm2020 → fesm2022}/lenne.tech-ng-base.mjs +113 -90
  102. package/fesm2022/lenne.tech-ng-base.mjs.map +1 -0
  103. package/package.json +27 -42
  104. package/src/directives/lazy-load.directive.d.ts +1 -1
  105. package/src/directives/match-height.directive.d.ts +1 -1
  106. package/src/directives/resizable.directive.d.ts +1 -1
  107. package/src/guards/auth.guard.d.ts +2 -2
  108. package/src/guards/can-deactivate.guard.d.ts +1 -2
  109. package/src/guards/logout.guard.d.ts +2 -2
  110. package/esm2020/base-cms/base-cms-routing.module.mjs +0 -32
  111. package/esm2020/base-cms/base-cms.module.mjs +0 -59
  112. package/esm2020/base-cms/pages/base-cms/base-cms.component.mjs +0 -222
  113. package/esm2020/base-components/base-components.module.mjs +0 -123
  114. package/esm2020/base-components/components/breadcrumb/breadcrumb.component.mjs +0 -18
  115. package/esm2020/base-components/components/change-password/change-password.component.mjs +0 -90
  116. package/esm2020/base-components/components/checkbox/checkbox.component.mjs +0 -31
  117. package/esm2020/base-components/components/delete-account/delete-account.component.mjs +0 -56
  118. package/esm2020/base-components/components/fab-button/fab-button.component.mjs +0 -21
  119. package/esm2020/base-components/components/input/input.component.mjs +0 -67
  120. package/esm2020/base-components/components/loading-bar/loading-bar.component.mjs +0 -35
  121. package/esm2020/base-components/components/model-form/model-form-base.component.mjs +0 -136
  122. package/esm2020/base-components/components/model-form/model-form.component.mjs +0 -564
  123. package/esm2020/base-components/components/model-form-sub/model-form-sub.component.mjs +0 -102
  124. package/esm2020/base-components/components/model-table/model-table.component.mjs +0 -397
  125. package/esm2020/base-components/components/refence-input/refence-input.component.mjs +0 -261
  126. package/esm2020/base-components/components/select/select.component.mjs +0 -54
  127. package/esm2020/base-components/components/skeleton-loader/skeleton-loader.component.mjs +0 -32
  128. package/esm2020/base-components/components/tags/tags.component.mjs +0 -218
  129. package/esm2020/base-components/components/textarea/textarea.component.mjs +0 -72
  130. package/esm2020/base-components/components/toast/toast.component.mjs +0 -68
  131. package/esm2020/base-components/components/upload-image/upload-image.component.mjs +0 -324
  132. package/esm2020/base-components/directives/back-button.directive.mjs +0 -23
  133. package/esm2020/base-components/directives/context-menu.directive.mjs +0 -108
  134. package/esm2020/base-components/directives/sort.directive.mjs +0 -54
  135. package/esm2020/base-components/directives/stop-propagation.directive.mjs +0 -23
  136. package/esm2020/base-components/pipes/ellipses.pipe.mjs +0 -22
  137. package/esm2020/base-prototype/base-prototype.module.mjs +0 -53
  138. package/esm2020/base-prototype/pages/email-verification/email-verification.component.mjs +0 -55
  139. package/esm2020/base-prototype/pages/forgot-password/forgot-password.component.mjs +0 -67
  140. package/esm2020/base-prototype/pages/login/login.component.mjs +0 -102
  141. package/esm2020/base-prototype/pages/profile/profile.component.mjs +0 -81
  142. package/esm2020/base-prototype/pages/register/register.component.mjs +0 -86
  143. package/esm2020/base-prototype/pages/set-password/set-password.component.mjs +0 -82
  144. package/esm2020/shared/classes/auth.class.mjs +0 -17
  145. package/esm2020/shared/classes/basic-user.class.mjs +0 -52
  146. package/esm2020/shared/classes/graphql-enum.class.mjs +0 -9
  147. package/esm2020/shared/classes/graphql-meta.class.mjs +0 -344
  148. package/esm2020/shared/classes/graphql-type.class.mjs +0 -17
  149. package/esm2020/shared/classes/sort.class.mjs +0 -40
  150. package/esm2020/shared/services/auth.service.mjs +0 -148
  151. package/esm2020/shared/services/breadcrumb.service.mjs +0 -68
  152. package/esm2020/shared/services/file.service.mjs +0 -84
  153. package/esm2020/shared/services/forms.service.mjs +0 -59
  154. package/esm2020/shared/services/graphql-meta.service.mjs +0 -123
  155. package/esm2020/shared/services/graphql-plus.service.mjs +0 -89
  156. package/esm2020/shared/services/graphql.service.mjs +0 -507
  157. package/esm2020/shared/services/image.service.mjs +0 -102
  158. package/esm2020/shared/services/loader.service.mjs +0 -79
  159. package/esm2020/shared/services/navigation.service.mjs +0 -36
  160. package/esm2020/shared/services/scroll.service.mjs +0 -179
  161. package/esm2020/shared/services/storage.service.mjs +0 -140
  162. package/esm2020/shared/services/toast.service.mjs +0 -41
  163. package/esm2020/shared/services/user.service.mjs +0 -155
  164. package/esm2020/shared/services/ws.service.mjs +0 -16
  165. package/esm2020/src/base.module.mjs +0 -97
  166. package/esm2020/src/directives/lazy-load.directive.mjs +0 -45
  167. package/esm2020/src/directives/match-height.directive.mjs +0 -84
  168. package/esm2020/src/directives/resizable.directive.mjs +0 -90
  169. package/esm2020/src/factories/apollo-options.factory.mjs +0 -106
  170. package/esm2020/src/functions/extract-files.function.mjs +0 -84
  171. package/esm2020/src/guards/auth.guard.mjs +0 -80
  172. package/esm2020/src/guards/can-deactivate.guard.mjs +0 -16
  173. package/esm2020/src/guards/logout.guard.mjs +0 -32
  174. package/esm2020/src/pipes/date-ago.pipe.mjs +0 -65
  175. package/esm2020/src/pipes/safe-html.pipe.mjs +0 -21
  176. package/esm2020/src/services/fullscreen.service.mjs +0 -51
  177. package/esm2020/src/services/seo.service.mjs +0 -97
  178. package/esm2020/src/services/theme.service.mjs +0 -43
  179. package/fesm2015/lenne.tech-ng-base-base-cms.mjs +0 -322
  180. package/fesm2015/lenne.tech-ng-base-base-cms.mjs.map +0 -1
  181. package/fesm2015/lenne.tech-ng-base-base-components.mjs +0 -2806
  182. package/fesm2015/lenne.tech-ng-base-base-components.mjs.map +0 -1
  183. package/fesm2015/lenne.tech-ng-base-base-prototype.mjs +0 -495
  184. package/fesm2015/lenne.tech-ng-base-shared.mjs +0 -2749
  185. package/fesm2015/lenne.tech-ng-base-shared.mjs.map +0 -1
  186. package/fesm2015/lenne.tech-ng-base.mjs +0 -902
  187. package/fesm2015/lenne.tech-ng-base.mjs.map +0 -1
  188. package/fesm2020/lenne.tech-ng-base-base-components.mjs.map +0 -1
  189. package/fesm2020/lenne.tech-ng-base-base-prototype.mjs.map +0 -1
  190. package/fesm2020/lenne.tech-ng-base.mjs.map +0 -1
  191. /package/{esm2020 → esm2022}/base-cms/interfaces/base-cms-module-config.interface.mjs +0 -0
  192. /package/{esm2020 → esm2022}/base-cms/lenne.tech-ng-base-base-cms.mjs +0 -0
  193. /package/{esm2020 → esm2022}/base-cms/public-api.mjs +0 -0
  194. /package/{esm2020 → esm2022}/base-components/lenne.tech-ng-base-base-components.mjs +0 -0
  195. /package/{esm2020 → esm2022}/base-components/public-api.mjs +0 -0
  196. /package/{esm2020 → esm2022}/base-prototype/lenne.tech-ng-base-base-prototype.mjs +0 -0
  197. /package/{esm2020 → esm2022}/base-prototype/public-api.mjs +0 -0
  198. /package/{esm2020 → esm2022}/lenne.tech-ng-base.mjs +0 -0
  199. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
  200. /package/{esm2020 → esm2022}/shared/classes/helper.class.mjs +0 -0
  201. /package/{esm2020 → esm2022}/shared/classes/standard.class.mjs +0 -0
  202. /package/{esm2020 → esm2022}/shared/decorators/debounce.decorator.mjs +0 -0
  203. /package/{esm2020 → esm2022}/shared/enums/comparison-operator.enum.mjs +0 -0
  204. /package/{esm2020 → esm2022}/shared/enums/graphql-request-type.enum.mjs +0 -0
  205. /package/{esm2020 → esm2022}/shared/enums/logical-operator.enum.mjs +0 -0
  206. /package/{esm2020 → esm2022}/shared/enums/skeleton-type.enum.mjs +0 -0
  207. /package/{esm2020 → esm2022}/shared/enums/sort-order.enum.mjs +0 -0
  208. /package/{esm2020 → esm2022}/shared/enums/toast-type.enum.mjs +0 -0
  209. /package/{esm2020 → esm2022}/shared/functions/ws-client.function.mjs +0 -0
  210. /package/{esm2020 → esm2022}/shared/interfaces/base-module-config.interface.mjs +0 -0
  211. /package/{esm2020 → esm2022}/shared/interfaces/breadcrumb.interface.mjs +0 -0
  212. /package/{esm2020 → esm2022}/shared/interfaces/can-component-deactivate.interface.mjs +0 -0
  213. /package/{esm2020 → esm2022}/shared/interfaces/cms-enum-values.interface.mjs +0 -0
  214. /package/{esm2020 → esm2022}/shared/interfaces/cms-field-config.interface.mjs +0 -0
  215. /package/{esm2020 → esm2022}/shared/interfaces/cms-model-config.interface.mjs +0 -0
  216. /package/{esm2020 → esm2022}/shared/interfaces/cms-table-field.interface.mjs +0 -0
  217. /package/{esm2020 → esm2022}/shared/interfaces/combined-filter-input.interface.mjs +0 -0
  218. /package/{esm2020 → esm2022}/shared/interfaces/compress-options.interface.mjs +0 -0
  219. /package/{esm2020 → esm2022}/shared/interfaces/cropping-options.interface.mjs +0 -0
  220. /package/{esm2020 → esm2022}/shared/interfaces/field-object.interface.mjs +0 -0
  221. /package/{esm2020 → esm2022}/shared/interfaces/field.interface.mjs +0 -0
  222. /package/{esm2020 → esm2022}/shared/interfaces/filter-input.interface.mjs +0 -0
  223. /package/{esm2020 → esm2022}/shared/interfaces/find-args.interface.mjs +0 -0
  224. /package/{esm2020 → esm2022}/shared/interfaces/graphql-crud-type.interface.mjs +0 -0
  225. /package/{esm2020 → esm2022}/shared/interfaces/graphql-fields-object.interface.mjs +0 -0
  226. /package/{esm2020 → esm2022}/shared/interfaces/graphql-options.interface.mjs +0 -0
  227. /package/{esm2020 → esm2022}/shared/interfaces/graphql-plus-options.interfacen.mjs +0 -0
  228. /package/{esm2020 → esm2022}/shared/interfaces/graphql-type-collection.interface.mjs +0 -0
  229. /package/{esm2020 → esm2022}/shared/interfaces/login-config.interface.mjs +0 -0
  230. /package/{esm2020 → esm2022}/shared/interfaces/single-filter-input.interface.mjs +0 -0
  231. /package/{esm2020 → esm2022}/shared/interfaces/sort-input.interface.mjs +0 -0
  232. /package/{esm2020 → esm2022}/shared/interfaces/time-components.interface.mjs +0 -0
  233. /package/{esm2020 → esm2022}/shared/interfaces/toast.interface.mjs +0 -0
  234. /package/{esm2020 → esm2022}/shared/lenne.tech-ng-base-shared.mjs +0 -0
  235. /package/{esm2020 → esm2022}/shared/public-api.mjs +0 -0
  236. /package/{esm2020 → esm2022}/shared/types/graphql-fields.type.mjs +0 -0
  237. /package/{esm2020 → esm2022}/shared/types/storage.type.mjs +0 -0
  238. /package/{esm2020 → esm2022}/shared/validators/email.validator.mjs +0 -0
  239. /package/{esm2020 → esm2022}/shared/validators/match.validator.mjs +0 -0
  240. /package/{esm2020 → esm2022}/shared/validators/secure-password.validator.mjs +0 -0
  241. /package/{esm2020 → esm2022}/src/decorators/auto-unsubscribe.decorator.mjs +0 -0
@@ -1,2806 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Input, Output, ViewChild, Directive, Inject, HostListener, Pipe, ViewContainerRef, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/forms';
4
- import { FormControl, UntypedFormControl, UntypedFormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import * as i2 from '@angular/common';
6
- import { DOCUMENT, CommonModule } from '@angular/common';
7
- import * as i3 from '@ng-bootstrap/ng-bootstrap';
8
- import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
9
- import { trigger, transition, query, style, animate } from '@angular/animations';
10
- import { Subscription } from 'rxjs';
11
- import * as i1$1 from '@lenne.tech/ng-base/shared';
12
- import { ToastType, Sort, SortOrderEnum, GraphQLRequestType, BasicUser, fullEmail, securePasswordValidator, Validation } from '@lenne.tech/ng-base/shared';
13
- import * as i2$1 from '@angular/router';
14
- import { RouterModule } from '@angular/router';
15
- import { __awaiter } from 'tslib';
16
- import * as i1$2 from '@angular/common/http';
17
- import * as i4 from 'ngx-image-cropper';
18
- import { ImageCropperModule } from 'ngx-image-cropper';
19
-
20
- class InputComponent {
21
- constructor() {
22
- this.placeholder = '';
23
- this.type = 'text';
24
- this.required = false;
25
- this.eyeButton = false;
26
- this.objectPath = '';
27
- this.enter = new EventEmitter();
28
- }
29
- /**
30
- * If the control has a value, emit the enter event
31
- */
32
- enterEvent() {
33
- var _a;
34
- if ((_a = this.control) === null || _a === void 0 ? void 0 : _a.value) {
35
- this.enter.emit();
36
- }
37
- }
38
- /**
39
- * Switch input type
40
- */
41
- togglePasswordType() {
42
- if (this.type === 'password') {
43
- this.type = 'text';
44
- }
45
- else {
46
- this.type = 'password';
47
- }
48
- }
49
- }
50
- InputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
51
- InputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: InputComponent, selector: "base-input", inputs: { id: "id", name: "name", infoText: "infoText", label: "label", placeholder: "placeholder", autocomplete: "autocomplete", tabIndex: "tabIndex", control: "control", type: "type", required: "required", eyeButton: "eyeButton", objectPath: "objectPath" }, outputs: { enter: "enter" }, ngImport: i0, template: "<div class=\"form-group mb-3\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n <div class=\"input-group\">\n <input\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n class=\"form-control\"\n [type]=\"type\"\n [formControl]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (keyup.enter)=\"enterEvent()\"\n [attr.aria-describedby]=\"id + 'eye-button'\"\n />\n <button\n class=\"btn btn-outline-primary\"\n type=\"button\"\n [id]=\"id + 'eye-button'\"\n (click)=\"togglePasswordType()\"\n *ngIf=\"eyeButton\"\n >\n <i class=\"bi bi-eye\" *ngIf=\"type === 'password'\"></i>\n <i class=\"bi bi-eye-slash\" *ngIf=\"type === 'text'\"></i>\n </button>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['pattern'] && type === 'tel'\">Bitte eine g\u00FCltige Telefonnummer angeben.</div>\n <div *ngIf=\"control?.errors?.['invalidEmail']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n <div *ngIf=\"control?.errors?.['invalidSecurePassword']\">\n Das Passwort ist zu unsicher. Es muss mind. 8 Zeichen lang sein, ein Gro\u00DFbustabe, ein Kleinbuchstabe, eine Zahl\n und ein Sonderzeichen enthalten.\n </div>\n </div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}.input-group>.btn{min-width:100px}button{height:100%}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: InputComponent, decorators: [{
53
- type: Component,
54
- args: [{ selector: 'base-input', template: "<div class=\"form-group mb-3\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n <div class=\"input-group\">\n <input\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n class=\"form-control\"\n [type]=\"type\"\n [formControl]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (keyup.enter)=\"enterEvent()\"\n [attr.aria-describedby]=\"id + 'eye-button'\"\n />\n <button\n class=\"btn btn-outline-primary\"\n type=\"button\"\n [id]=\"id + 'eye-button'\"\n (click)=\"togglePasswordType()\"\n *ngIf=\"eyeButton\"\n >\n <i class=\"bi bi-eye\" *ngIf=\"type === 'password'\"></i>\n <i class=\"bi bi-eye-slash\" *ngIf=\"type === 'text'\"></i>\n </button>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['pattern'] && type === 'tel'\">Bitte eine g\u00FCltige Telefonnummer angeben.</div>\n <div *ngIf=\"control?.errors?.['invalidEmail']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n <div *ngIf=\"control?.errors?.['invalidSecurePassword']\">\n Das Passwort ist zu unsicher. Es muss mind. 8 Zeichen lang sein, ein Gro\u00DFbustabe, ein Kleinbuchstabe, eine Zahl\n und ein Sonderzeichen enthalten.\n </div>\n </div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}.input-group>.btn{min-width:100px}button{height:100%}\n"] }]
55
- }], propDecorators: { id: [{
56
- type: Input
57
- }], name: [{
58
- type: Input
59
- }], infoText: [{
60
- type: Input
61
- }], label: [{
62
- type: Input
63
- }], placeholder: [{
64
- type: Input
65
- }], autocomplete: [{
66
- type: Input
67
- }], tabIndex: [{
68
- type: Input
69
- }], control: [{
70
- type: Input
71
- }], type: [{
72
- type: Input
73
- }], required: [{
74
- type: Input
75
- }], eyeButton: [{
76
- type: Input
77
- }], objectPath: [{
78
- type: Input
79
- }], enter: [{
80
- type: Output
81
- }] } });
82
-
83
- class SelectComponent {
84
- constructor() {
85
- this.placeholder = '';
86
- this.objectPath = '';
87
- this.required = false;
88
- this.multiple = false;
89
- this.search = false;
90
- this.options = [];
91
- }
92
- ngOnInit() {
93
- if (this.multiple) {
94
- this.select.nativeElement.setAttribute('multiple', true);
95
- }
96
- }
97
- }
98
- SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
99
- SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: SelectComponent, selector: "base-select", inputs: { id: "id", name: "name", infoText: "infoText", label: "label", placeholder: "placeholder", objectPath: "objectPath", control: "control", tabIndex: "tabIndex", required: "required", multiple: "multiple", search: "search", options: "options" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true }], ngImport: i0, template: "<div class=\"form-group mb-3\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n <select\n #select\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n class=\"form-select\"\n [attr.aria-label]=\"placeholder\"\n [attr.data-live-search]=\"search\"\n [formControl]=\"control\"\n [required]=\"required\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n >\n <option [ngValue]=\"null\" disabled selected>{{ placeholder }}</option>\n <option *ngFor=\"let option of options\" [ngValue]=\"option.value\">\n {{ option.text }}\n </option>\n </select>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SelectComponent, decorators: [{
101
- type: Component,
102
- args: [{ selector: 'base-select', template: "<div class=\"form-group mb-3\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n <select\n #select\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n class=\"form-select\"\n [attr.aria-label]=\"placeholder\"\n [attr.data-live-search]=\"search\"\n [formControl]=\"control\"\n [required]=\"required\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n >\n <option [ngValue]=\"null\" disabled selected>{{ placeholder }}</option>\n <option *ngFor=\"let option of options\" [ngValue]=\"option.value\">\n {{ option.text }}\n </option>\n </select>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}\n"] }]
103
- }], propDecorators: { select: [{
104
- type: ViewChild,
105
- args: ['select']
106
- }], id: [{
107
- type: Input
108
- }], name: [{
109
- type: Input
110
- }], infoText: [{
111
- type: Input
112
- }], label: [{
113
- type: Input
114
- }], placeholder: [{
115
- type: Input
116
- }], objectPath: [{
117
- type: Input
118
- }], control: [{
119
- type: Input
120
- }], tabIndex: [{
121
- type: Input
122
- }], required: [{
123
- type: Input
124
- }], multiple: [{
125
- type: Input
126
- }], search: [{
127
- type: Input
128
- }], options: [{
129
- type: Input
130
- }] } });
131
-
132
- class CheckboxComponent {
133
- constructor() {
134
- this.required = false;
135
- this.objectPath = '';
136
- }
137
- }
138
- CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
139
- CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: CheckboxComponent, selector: "base-checkbox", inputs: { id: "id", name: "name", label: "label", value: "value", control: "control", required: "required", objectPath: "objectPath" }, ngImport: i0, template: "<div class=\"form-check\">\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n [formControl]=\"control\"\n [required]=\"required\"\n [value]=\"value\"\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n />\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\">\n <ng-container *ngIf=\"label\">\n {{ label }}\n </ng-container>\n <ng-content></ng-content>\n </label>\n\n <div class=\"invalid-feedback ms-0 m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}\n"], dependencies: [{ kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
140
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CheckboxComponent, decorators: [{
141
- type: Component,
142
- args: [{ selector: 'base-checkbox', template: "<div class=\"form-check\">\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n [formControl]=\"control\"\n [required]=\"required\"\n [value]=\"value\"\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n />\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\">\n <ng-container *ngIf=\"label\">\n {{ label }}\n </ng-container>\n <ng-content></ng-content>\n </label>\n\n <div class=\"invalid-feedback ms-0 m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}\n"] }]
143
- }], propDecorators: { id: [{
144
- type: Input
145
- }], name: [{
146
- type: Input
147
- }], label: [{
148
- type: Input
149
- }], value: [{
150
- type: Input
151
- }], control: [{
152
- type: Input
153
- }], required: [{
154
- type: Input
155
- }], objectPath: [{
156
- type: Input
157
- }] } });
158
-
159
- class TextareaComponent {
160
- constructor() {
161
- this.label = '';
162
- this.placeholder = '';
163
- this.rows = 5;
164
- this.required = false;
165
- this.autoHeight = true;
166
- this.objectPath = '';
167
- }
168
- ngOnChanges(changes) {
169
- if (changes['control'] && this.autoHeight) {
170
- setTimeout(() => {
171
- this.adjustInitHeight();
172
- }, 350);
173
- }
174
- }
175
- adjustInitHeight() {
176
- if (!this.textarea || !this.autoHeight) {
177
- return;
178
- }
179
- this.textarea.nativeElement.style.cssText = 'height:auto;';
180
- this.textarea.nativeElement.style.cssText = 'height:' + (this.textarea.nativeElement.scrollHeight + 5) + 'px';
181
- }
182
- adjustHeight(event) {
183
- if (!this.autoHeight) {
184
- return;
185
- }
186
- setTimeout(() => {
187
- event.target.style.cssText = 'height:auto;';
188
- // for box-sizing other than "content-box" use:
189
- // el.style.cssText = '-moz-box-sizing:content-box';
190
- event.target.style.cssText = 'height:' + (event.target.scrollHeight + 5) + 'px';
191
- }, 0);
192
- }
193
- }
194
- TextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
195
- TextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: TextareaComponent, selector: "base-textarea", inputs: { id: "id", name: "name", infoText: "infoText", label: "label", placeholder: "placeholder", control: "control", rows: "rows", required: "required", autoHeight: "autoHeight", tabIndex: "tabIndex", objectPath: "objectPath" }, viewQueries: [{ propertyName: "textarea", first: true, predicate: ["textarea"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"form-group mb-3\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n\n <textarea\n #textarea\n class=\"form-control\"\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n [rows]=\"rows\"\n (input)=\"adjustHeight($event)\"\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n ></textarea>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TextareaComponent, decorators: [{
197
- type: Component,
198
- args: [{ selector: 'base-textarea', template: "<div class=\"form-group mb-3\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n\n <textarea\n #textarea\n class=\"form-control\"\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n [rows]=\"rows\"\n (input)=\"adjustHeight($event)\"\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n ></textarea>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}\n"] }]
199
- }], propDecorators: { textarea: [{
200
- type: ViewChild,
201
- args: ['textarea']
202
- }], id: [{
203
- type: Input
204
- }], name: [{
205
- type: Input
206
- }], infoText: [{
207
- type: Input
208
- }], label: [{
209
- type: Input
210
- }], placeholder: [{
211
- type: Input
212
- }], control: [{
213
- type: Input
214
- }], rows: [{
215
- type: Input
216
- }], required: [{
217
- type: Input
218
- }], autoHeight: [{
219
- type: Input
220
- }], tabIndex: [{
221
- type: Input
222
- }], objectPath: [{
223
- type: Input
224
- }] } });
225
-
226
- const toastAnimation = trigger('toastAnimation', [
227
- transition('* <=> *', [
228
- query(':enter', [style({ transform: 'translateX({{ x }})' }), animate('200ms ease-in', style({ transform: 'translateX(0%)' }))], { optional: true }),
229
- query(':leave', animate('200ms ease-in', style({ transform: 'translateX({{ x }})' })), { optional: true }),
230
- ]),
231
- ]);
232
- class ToastComponent {
233
- constructor(toastService) {
234
- this.toastService = toastService;
235
- this.toasts = [];
236
- this.ToastType = ToastType;
237
- this.subscriptions = new Subscription();
238
- this.position = 'bottom-right';
239
- }
240
- ngOnInit() {
241
- this.subscriptions.add(this.toastService.toastsAsObservable.subscribe({
242
- next: (value) => {
243
- this.toasts = value;
244
- },
245
- }));
246
- }
247
- ngOnDestroy() {
248
- this.subscriptions.unsubscribe();
249
- }
250
- getDefaultTitle(toast) {
251
- switch (toast.type) {
252
- case ToastType.ERROR:
253
- return 'Irgendetwas ist schiefgelaufen';
254
- case ToastType.INFO:
255
- return 'Info';
256
- case ToastType.WARNING:
257
- return 'Achtung';
258
- case ToastType.SUCCESS:
259
- return 'Erfolgreich';
260
- }
261
- }
262
- getDefaultDescription(toast) {
263
- switch (toast.type) {
264
- case ToastType.ERROR:
265
- return 'Sollte das Problem länger bestehen bleiben, dann wenden Sie sich bitte\n' + ' an den Support.';
266
- case ToastType.INFO:
267
- return 'Info';
268
- case ToastType.WARNING:
269
- return 'Warning';
270
- case ToastType.SUCCESS:
271
- return 'Die Änderungen wurden erfolgreich gespeichert.';
272
- }
273
- }
274
- reload() {
275
- location.reload();
276
- }
277
- }
278
- ToastComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ToastComponent, deps: [{ token: i1$1.ToastService }], target: i0.ɵɵFactoryTarget.Component });
279
- ToastComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ToastComponent, selector: "base-toast", inputs: { position: "position" }, ngImport: i0, template: "<div\n class=\"toast-container position-fixed\"\n [ngClass]=\"position\"\n [@toastAnimation]=\"{ value: toasts.length, params: { x: position.includes('left') ? '-100%' : '100%' } }\"\n>\n <div\n class=\"toast show\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n *ngFor=\"let toast of toasts\"\n [ngClass]=\"toast.type\"\n >\n <div class=\"toast-header\">\n <strong class=\"me-auto\">{{ toast?.title ?? getDefaultTitle(toast) }}</strong>\n <button type=\"button\" class=\"btn-close btn-close-white\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button>\n </div>\n <div class=\"toast-body\">\n {{ toast?.description ?? getDefaultDescription(toast) }}\n\n <div class=\"mt-2\" *ngIf=\"toast?.errorCode\">\n <code>ERROR: {{ toast.errorCode }}</code>\n </div>\n\n <div class=\"mt-2\" *ngIf=\"toast.type === ToastType.ERROR\">\n <a class=\"color-secondary\" href=\"#\" (click)=\"reload()\">Seite neu laden</a>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{--base-toast-z-index: 999}.toast-container{padding:10px;z-index:var(--base-toast-z-index)}.bottom-right{bottom:0;right:0}.top-right{top:0;right:0}.bottom-left{bottom:0;left:0}.top-left{top:0;left:0}.toast{border-radius:0;border:0}.toast a{text-decoration:none;font-weight:600}.toast .toast-header{border-radius:0}.error .toast-header{background-color:var(--bs-danger);color:var(--bs-white)}.warning .toast-header{background-color:var(--bs-warning);color:var(--bs-white)}.info .toast-header{background-color:var(--bs-info);color:var(--bs-white)}.success .toast-header{background-color:var(--bs-success);color:var(--bs-white)}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [toastAnimation] });
280
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ToastComponent, decorators: [{
281
- type: Component,
282
- args: [{ selector: 'base-toast', animations: [toastAnimation], template: "<div\n class=\"toast-container position-fixed\"\n [ngClass]=\"position\"\n [@toastAnimation]=\"{ value: toasts.length, params: { x: position.includes('left') ? '-100%' : '100%' } }\"\n>\n <div\n class=\"toast show\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n *ngFor=\"let toast of toasts\"\n [ngClass]=\"toast.type\"\n >\n <div class=\"toast-header\">\n <strong class=\"me-auto\">{{ toast?.title ?? getDefaultTitle(toast) }}</strong>\n <button type=\"button\" class=\"btn-close btn-close-white\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button>\n </div>\n <div class=\"toast-body\">\n {{ toast?.description ?? getDefaultDescription(toast) }}\n\n <div class=\"mt-2\" *ngIf=\"toast?.errorCode\">\n <code>ERROR: {{ toast.errorCode }}</code>\n </div>\n\n <div class=\"mt-2\" *ngIf=\"toast.type === ToastType.ERROR\">\n <a class=\"color-secondary\" href=\"#\" (click)=\"reload()\">Seite neu laden</a>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{--base-toast-z-index: 999}.toast-container{padding:10px;z-index:var(--base-toast-z-index)}.bottom-right{bottom:0;right:0}.top-right{top:0;right:0}.bottom-left{bottom:0;left:0}.top-left{top:0;left:0}.toast{border-radius:0;border:0}.toast a{text-decoration:none;font-weight:600}.toast .toast-header{border-radius:0}.error .toast-header{background-color:var(--bs-danger);color:var(--bs-white)}.warning .toast-header{background-color:var(--bs-warning);color:var(--bs-white)}.info .toast-header{background-color:var(--bs-info);color:var(--bs-white)}.success .toast-header{background-color:var(--bs-success);color:var(--bs-white)}\n"] }]
283
- }], ctorParameters: function () { return [{ type: i1$1.ToastService }]; }, propDecorators: { position: [{
284
- type: Input
285
- }] } });
286
-
287
- class TagsComponent {
288
- constructor() {
289
- this.label = '';
290
- this.placeholder = '';
291
- this.custom = true;
292
- this.removeByKey = true;
293
- this.required = false;
294
- this.objectPath = '';
295
- this.validators = [];
296
- this.inputValue = '';
297
- }
298
- /**
299
- * Convert id into text field
300
- */
301
- getReadableTag(tag) {
302
- var _a;
303
- if (((_a = this.control) === null || _a === void 0 ? void 0 : _a.value) && this.options) {
304
- const foundElement = this.options.find((e) => e.value === tag);
305
- if (foundElement) {
306
- return foundElement.text;
307
- }
308
- else {
309
- return tag;
310
- }
311
- }
312
- else {
313
- return tag;
314
- }
315
- }
316
- /**
317
- * Listen to enter keys
318
- *
319
- * @param event
320
- */
321
- enterKey(event) {
322
- this.selectedElement = event.target;
323
- if (this.removeByKey && event.code === 'Backspace' && !this.inputValue) {
324
- this.removeTag();
325
- return;
326
- }
327
- else {
328
- if (event.code === 'Comma' || event.code === 'Space' || event.code === 'Enter') {
329
- this.addTag(this.inputValue);
330
- }
331
- }
332
- }
333
- /**
334
- * Add new tag
335
- *
336
- * @param tag
337
- * @param reset
338
- * @param isOption
339
- */
340
- addTag(tag, reset = true, isOption = false) {
341
- var _a;
342
- if (tag.endsWith(',') || tag.endsWith(' ')) {
343
- tag = tag.slice(0, -1);
344
- }
345
- const temp = new FormControl(tag, this.validators);
346
- this.control.setErrors(Object.assign(Object.assign({}, this.control.errors), temp.errors));
347
- if (temp.invalid) {
348
- return;
349
- }
350
- // Check if user copy string into input
351
- if (tag.split(' ').length > 1 && !isOption) {
352
- const tags = tag.split(' ');
353
- for (let i = 0; i < tags.length; i++) {
354
- this.addTag(tags[i], i + 1 === tags.length);
355
- }
356
- return;
357
- }
358
- // Check if user copy string into input
359
- if (tag.split(',').length > 1 && !isOption) {
360
- const tags = tag.split(',');
361
- for (let i = 0; i < tags.length; i++) {
362
- this.addTag(tags[i], i + 1 === tags.length);
363
- }
364
- return;
365
- }
366
- let foundOption;
367
- if (!this.options) {
368
- foundOption = { value: tag, text: tag };
369
- }
370
- else {
371
- foundOption = this.options.find((e) => e.text === tag);
372
- }
373
- if (!this.custom && !foundOption) {
374
- return;
375
- }
376
- this.selectedElement = null;
377
- if (!this.control.value) {
378
- this.control.setValue([]);
379
- }
380
- if (((_a = this.control.value) === null || _a === void 0 ? void 0 : _a.length) === 0) {
381
- this.control.setValue([foundOption.value]);
382
- if (reset) {
383
- this.inputValue = '';
384
- }
385
- this.control.setErrors(null);
386
- return;
387
- }
388
- if (tag.length > 0 &&
389
- this.control.value &&
390
- !this.control.value.some((item) => item === foundOption.value)) {
391
- this.control.setValue([...this.control.value, foundOption.value]);
392
- if (reset) {
393
- this.inputValue = '';
394
- }
395
- this.control.setErrors(null);
396
- }
397
- if (this.control.value.some((item) => item === foundOption.value)) {
398
- if (reset) {
399
- this.inputValue = '';
400
- }
401
- }
402
- }
403
- /**
404
- * Remove tag
405
- *
406
- * @param tag
407
- */
408
- removeTag(tag) {
409
- var _a, _b;
410
- let foundOption;
411
- if (!this.options) {
412
- foundOption = { value: tag, text: tag };
413
- }
414
- else {
415
- foundOption = this.options.find((e) => e.value === tag);
416
- }
417
- this.control.markAsTouched();
418
- if (foundOption) {
419
- this.control.setValue((_a = this.control.value) === null || _a === void 0 ? void 0 : _a.filter((item) => item !== foundOption.value));
420
- }
421
- else if (this.control.value) {
422
- this.control.value.splice(-1);
423
- }
424
- if (((_b = this.control.value) === null || _b === void 0 ? void 0 : _b.length) === 0) {
425
- this.control.setErrors(Object.assign(Object.assign({}, this.control.errors), { required: true }));
426
- }
427
- }
428
- /**
429
- * Filter options for drop down
430
- */
431
- filterOptions() {
432
- return this.options
433
- ? this.options.filter((e) => { var _a, _b; return (!this.inputValue || ((_a = e === null || e === void 0 ? void 0 : e.text) === null || _a === void 0 ? void 0 : _a.includes(this.inputValue))) && !((_b = this.control.value) === null || _b === void 0 ? void 0 : _b.includes(e.value)); })
434
- : [];
435
- }
436
- /**
437
- * Show dropdown focus
438
- */
439
- onFocus(event) {
440
- if (event) {
441
- this.control.setErrors(null);
442
- this.selectedElement = event.target;
443
- }
444
- else {
445
- if (this.inputValue) {
446
- this.addTag(this.inputValue);
447
- }
448
- this.control.markAsTouched();
449
- setTimeout(() => {
450
- var _a;
451
- if (this.options && this.inputValue) {
452
- if (this.options.find((e) => e.text === this.inputValue)) {
453
- this.addTag(this.inputValue);
454
- this.control.setErrors(null);
455
- }
456
- else {
457
- this.inputValue = '';
458
- }
459
- }
460
- if (!this.control.value || ((_a = this.control.value) === null || _a === void 0 ? void 0 : _a.length) === 0) {
461
- this.control.setErrors(Object.assign(Object.assign({}, this.control.errors), { required: true }));
462
- }
463
- this.selectedElement = null;
464
- }, 250);
465
- }
466
- }
467
- }
468
- TagsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TagsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
469
- TagsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: TagsComponent, selector: "base-tags", inputs: { id: "id", name: "name", infoText: "infoText", label: "label", placeholder: "placeholder", autocomplete: "autocomplete", tabIndex: "tabIndex", control: "control", options: "options", custom: "custom", removeByKey: "removeByKey", required: "required", objectPath: "objectPath", validators: "validators" }, ngImport: i0, template: "<div class=\"form-group position-relative\" *ngIf=\"control\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n\n <div class=\"tag-wrapper\" *ngIf=\"control?.value\">\n <div class=\"tag\" *ngFor=\"let tag of control?.value\">\n {{ getReadableTag(tag) }}\n <span (click)=\"removeTag(tag)\"><i class=\"bi bi-x-circle\"></i></span>\n </div>\n </div>\n <input [formControl]=\"control\" hidden />\n <input\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n [(ngModel)]=\"inputValue\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onFocus()\"\n type=\"text\"\n class=\"form-control\"\n (keyup)=\"enterKey($event)\"\n />\n\n <div class=\"tag-options\" *ngIf=\"options && selectedElement\">\n <div class=\"tag-option-item\" *ngFor=\"let option of filterOptions()\" (click)=\"addTag(option?.text, true, true)\">\n {{ option?.text }}\n </div>\n </div>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['invalidReference'] && inputValue\">\n {{ inputValue }} ist kein g\u00FCltiger Wert f\u00FCr {{ label }}.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte gib eine g\u00FCltige E-Mail Adresse ein.</div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}.tag-options{position:absolute;display:block;top:100%;left:0;right:0;border-top:0;background-color:#fff;box-shadow:0 2px 5px #00000029,0 2px 10px #0000001f;transition:all .5s;z-index:999;max-height:200px;overflow-y:scroll}.tag-options .tag-option-item{padding:10px;cursor:pointer}.tag-options .tag-option-item:hover{color:var(--bs-primary)}.tag-wrapper{display:flex;flex-direction:row;justify-content:flex-start;column-gap:10px;row-gap:10px;flex-wrap:wrap;margin-bottom:10px;position:relative}.tag-wrapper .tag{background-color:var(--bs-light);color:var(--bs-dark);padding:10px 15px;font-style:normal;font-weight:300;font-size:14px;line-height:140%}.tag-wrapper .tag span{margin-left:20px;cursor:pointer}.tag-wrapper .tag span .bi{color:var(--bs-black)}.tag-wrapper .tag span .bi:before{vertical-align:-.175em}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
470
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TagsComponent, decorators: [{
471
- type: Component,
472
- args: [{ selector: 'base-tags', template: "<div class=\"form-group position-relative\" *ngIf=\"control\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n\n <div class=\"tag-wrapper\" *ngIf=\"control?.value\">\n <div class=\"tag\" *ngFor=\"let tag of control?.value\">\n {{ getReadableTag(tag) }}\n <span (click)=\"removeTag(tag)\"><i class=\"bi bi-x-circle\"></i></span>\n </div>\n </div>\n <input [formControl]=\"control\" hidden />\n <input\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n [(ngModel)]=\"inputValue\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onFocus()\"\n type=\"text\"\n class=\"form-control\"\n (keyup)=\"enterKey($event)\"\n />\n\n <div class=\"tag-options\" *ngIf=\"options && selectedElement\">\n <div class=\"tag-option-item\" *ngFor=\"let option of filterOptions()\" (click)=\"addTag(option?.text, true, true)\">\n {{ option?.text }}\n </div>\n </div>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['invalidReference'] && inputValue\">\n {{ inputValue }} ist kein g\u00FCltiger Wert f\u00FCr {{ label }}.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte gib eine g\u00FCltige E-Mail Adresse ein.</div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}.tag-options{position:absolute;display:block;top:100%;left:0;right:0;border-top:0;background-color:#fff;box-shadow:0 2px 5px #00000029,0 2px 10px #0000001f;transition:all .5s;z-index:999;max-height:200px;overflow-y:scroll}.tag-options .tag-option-item{padding:10px;cursor:pointer}.tag-options .tag-option-item:hover{color:var(--bs-primary)}.tag-wrapper{display:flex;flex-direction:row;justify-content:flex-start;column-gap:10px;row-gap:10px;flex-wrap:wrap;margin-bottom:10px;position:relative}.tag-wrapper .tag{background-color:var(--bs-light);color:var(--bs-dark);padding:10px 15px;font-style:normal;font-weight:300;font-size:14px;line-height:140%}.tag-wrapper .tag span{margin-left:20px;cursor:pointer}.tag-wrapper .tag span .bi{color:var(--bs-black)}.tag-wrapper .tag span .bi:before{vertical-align:-.175em}\n"] }]
473
- }], propDecorators: { id: [{
474
- type: Input
475
- }], name: [{
476
- type: Input
477
- }], infoText: [{
478
- type: Input
479
- }], label: [{
480
- type: Input
481
- }], placeholder: [{
482
- type: Input
483
- }], autocomplete: [{
484
- type: Input
485
- }], tabIndex: [{
486
- type: Input
487
- }], control: [{
488
- type: Input
489
- }], options: [{
490
- type: Input
491
- }], custom: [{
492
- type: Input
493
- }], removeByKey: [{
494
- type: Input
495
- }], required: [{
496
- type: Input
497
- }], objectPath: [{
498
- type: Input
499
- }], validators: [{
500
- type: Input
501
- }] } });
502
-
503
- class LoadingBarComponent {
504
- constructor(ngZone, changeDetectorRef, loaderService) {
505
- this.ngZone = ngZone;
506
- this.changeDetectorRef = changeDetectorRef;
507
- this.loaderService = loaderService;
508
- this.manuallyLoading = false;
509
- this.loading = false;
510
- this.subscription = new Subscription();
511
- }
512
- ngOnInit() {
513
- this.ngZone.runOutsideAngular(() => {
514
- this.subscription.add(this.loaderService.isLoading.subscribe((value) => {
515
- this.loading = value;
516
- this.changeDetectorRef.detectChanges();
517
- }));
518
- });
519
- }
520
- ngOnDestroy() {
521
- this.subscription.unsubscribe();
522
- }
523
- }
524
- LoadingBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: LoadingBarComponent, deps: [{ token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i1$1.LoaderService }], target: i0.ɵɵFactoryTarget.Component });
525
- LoadingBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: LoadingBarComponent, selector: "base-loading-bar", inputs: { manuallyLoading: "manuallyLoading" }, ngImport: i0, template: "<div class=\"slider\" *ngIf=\"loading || manuallyLoading\">\n <div class=\"line\"></div>\n <div class=\"subline inc\"></div>\n <div class=\"subline dec\"></div>\n</div>\n", styles: [":host{--base-loading-bar-color: #f28c18;--base-loading-bar-height: 5px;--base-loading-bar-z-index: 999999999}.slider{position:fixed;left:0;right:0;height:var(--base-loading-bar-height);overflow-x:hidden;z-index:var(--base-loading-bar-z-index);background-color:#fff}.line{position:absolute;opacity:.6;background:var(--base-loading-bar-color);width:150%;height:var(--base-loading-bar-height)}.subline{position:absolute;background:var(--base-loading-bar-color);height:var(--base-loading-bar-height)}.inc{animation:increase 2s infinite}.dec{animation:decrease 2s .5s infinite}@keyframes increase{0%{left:-5%;width:5%}to{left:130%;width:100%}}@keyframes decrease{0%{left:-80%;width:80%}to{left:110%;width:10%}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
526
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: LoadingBarComponent, decorators: [{
527
- type: Component,
528
- args: [{ selector: 'base-loading-bar', template: "<div class=\"slider\" *ngIf=\"loading || manuallyLoading\">\n <div class=\"line\"></div>\n <div class=\"subline inc\"></div>\n <div class=\"subline dec\"></div>\n</div>\n", styles: [":host{--base-loading-bar-color: #f28c18;--base-loading-bar-height: 5px;--base-loading-bar-z-index: 999999999}.slider{position:fixed;left:0;right:0;height:var(--base-loading-bar-height);overflow-x:hidden;z-index:var(--base-loading-bar-z-index);background-color:#fff}.line{position:absolute;opacity:.6;background:var(--base-loading-bar-color);width:150%;height:var(--base-loading-bar-height)}.subline{position:absolute;background:var(--base-loading-bar-color);height:var(--base-loading-bar-height)}.inc{animation:increase 2s infinite}.dec{animation:decrease 2s .5s infinite}@keyframes increase{0%{left:-5%;width:5%}to{left:130%;width:100%}}@keyframes decrease{0%{left:-80%;width:80%}to{left:110%;width:10%}}\n"] }]
529
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i1$1.LoaderService }]; }, propDecorators: { manuallyLoading: [{
530
- type: Input
531
- }] } });
532
-
533
- class SkeletonLoaderComponent {
534
- constructor() {
535
- this.count = 1;
536
- this.size = 18;
537
- }
538
- convertToArray(value) {
539
- if (!value) {
540
- return [];
541
- }
542
- const res = [];
543
- for (let i = 0; i < value; i++) {
544
- res.push(i);
545
- }
546
- return res;
547
- }
548
- }
549
- SkeletonLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
550
- SkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: SkeletonLoaderComponent, selector: "base-skeleton-loader", inputs: { type: "type", count: "count", size: "size" }, ngImport: i0, template: "<ng-container *ngIf=\"type\" [ngSwitch]=\"type\">\n <div *ngSwitchCase=\"'LINE'\">\n <div class=\"line-loader-wrapper\">\n <div class=\"line-loader\" *ngFor=\"let key of convertToArray(count)\"></div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'RECTANGLE'\">\n <div class=\"line-rectangle\" [ngStyle]=\"{ height: size + 'px' }\"></div>\n </div>\n\n <div *ngSwitchCase=\"'AVATAR'\">\n <div class=\"line-avatar\" [ngStyle]=\"{ height: size + 'px', width: size + 'px' }\"></div>\n </div>\n</ng-container>\n", styles: ["@keyframes shine{to{background-position-x:-200%}}.line-loader-wrapper>:not(:first-of-type){margin-top:10px}.line-loader-wrapper .line-loader{background:linear-gradient(110deg,#ececec 8%,#f5f5f5 18%,#ececec 33%);background-size:200% 100%;animation:1.5s shine linear infinite;height:18px;border-radius:5px}.line-rectangle{background:linear-gradient(110deg,#ececec 8%,#f5f5f5 18%,#ececec 33%);background-size:200% 100%;animation:1.5s shine linear infinite;border-radius:5px}.line-avatar{background:linear-gradient(110deg,#ececec 8%,#f5f5f5 18%,#ececec 33%);background-size:200% 100%;animation:1.5s shine linear infinite;border-radius:50%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
551
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SkeletonLoaderComponent, decorators: [{
552
- type: Component,
553
- args: [{ selector: 'base-skeleton-loader', template: "<ng-container *ngIf=\"type\" [ngSwitch]=\"type\">\n <div *ngSwitchCase=\"'LINE'\">\n <div class=\"line-loader-wrapper\">\n <div class=\"line-loader\" *ngFor=\"let key of convertToArray(count)\"></div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'RECTANGLE'\">\n <div class=\"line-rectangle\" [ngStyle]=\"{ height: size + 'px' }\"></div>\n </div>\n\n <div *ngSwitchCase=\"'AVATAR'\">\n <div class=\"line-avatar\" [ngStyle]=\"{ height: size + 'px', width: size + 'px' }\"></div>\n </div>\n</ng-container>\n", styles: ["@keyframes shine{to{background-position-x:-200%}}.line-loader-wrapper>:not(:first-of-type){margin-top:10px}.line-loader-wrapper .line-loader{background:linear-gradient(110deg,#ececec 8%,#f5f5f5 18%,#ececec 33%);background-size:200% 100%;animation:1.5s shine linear infinite;height:18px;border-radius:5px}.line-rectangle{background:linear-gradient(110deg,#ececec 8%,#f5f5f5 18%,#ececec 33%);background-size:200% 100%;animation:1.5s shine linear infinite;border-radius:5px}.line-avatar{background:linear-gradient(110deg,#ececec 8%,#f5f5f5 18%,#ececec 33%);background-size:200% 100%;animation:1.5s shine linear infinite;border-radius:50%}\n"] }]
554
- }], propDecorators: { type: [{
555
- type: Input
556
- }], count: [{
557
- type: Input
558
- }], size: [{
559
- type: Input
560
- }] } });
561
-
562
- class BreadcrumbComponent {
563
- constructor(breadcrumbService) {
564
- this.breadcrumbService = breadcrumbService;
565
- this.breadcrumbs$ = breadcrumbService.breadcrumbsObservable;
566
- }
567
- }
568
- BreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BreadcrumbComponent, deps: [{ token: i1$1.BreadcrumbService }], target: i0.ɵɵFactoryTarget.Component });
569
- BreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: BreadcrumbComponent, selector: "base-breadcrumb", ngImport: i0, template: "<ul class=\"pt-3\">\n <li *ngFor=\"let breadcrumb of breadcrumbs$ | async\">\n <a [routerLink]=\"breadcrumb.url\">{{ breadcrumb.label }}</a>\n </li>\n</ul>\n", styles: ["ul{list-style:none;margin:0;padding:0}ul li{display:inline}ul li:before{content:\"|\";margin:0 6px}ul li:first-child:before{content:\"\";margin:0}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] });
570
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BreadcrumbComponent, decorators: [{
571
- type: Component,
572
- args: [{ selector: 'base-breadcrumb', template: "<ul class=\"pt-3\">\n <li *ngFor=\"let breadcrumb of breadcrumbs$ | async\">\n <a [routerLink]=\"breadcrumb.url\">{{ breadcrumb.label }}</a>\n </li>\n</ul>\n", styles: ["ul{list-style:none;margin:0;padding:0}ul li{display:inline}ul li:before{content:\"|\";margin:0 6px}ul li:first-child:before{content:\"\";margin:0}\n"] }]
573
- }], ctorParameters: function () { return [{ type: i1$1.BreadcrumbService }]; } });
574
-
575
- class SortDirective {
576
- constructor(renderer, targetElem, document) {
577
- this.renderer = renderer;
578
- this.targetElem = targetElem;
579
- }
580
- /**
581
- * Sorts columns on click
582
- */
583
- sortColumn() {
584
- const items = document.getElementsByTagName('th');
585
- for (let i = 0; i < items.length; i++) {
586
- items[i].classList.remove('asc');
587
- items[i].classList.remove('desc');
588
- }
589
- const sort = new Sort();
590
- const elem = this.targetElem.nativeElement;
591
- const order = elem.getAttribute('data-order');
592
- const type = elem.getAttribute('data-type');
593
- const property = elem.getAttribute('data-name');
594
- if (order === 'desc') {
595
- this.baseSort.sort(sort.startSort(property, order, type));
596
- elem.setAttribute('data-order', 'asc');
597
- elem.classList.remove('desc');
598
- elem.classList.add('asc');
599
- }
600
- else {
601
- this.baseSort.sort(sort.startSort(property, order, type));
602
- elem.setAttribute('data-order', 'desc');
603
- elem.classList.remove('asc');
604
- elem.classList.add('desc');
605
- }
606
- }
607
- }
608
- SortDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SortDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
609
- SortDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: SortDirective, selector: "[baseSort]", inputs: { baseSort: "baseSort" }, host: { listeners: { "click": "sortColumn()" } }, ngImport: i0 });
610
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SortDirective, decorators: [{
611
- type: Directive,
612
- args: [{
613
- selector: '[baseSort]',
614
- }]
615
- }], ctorParameters: function () {
616
- return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: Document, decorators: [{
617
- type: Inject,
618
- args: [DOCUMENT]
619
- }] }];
620
- }, propDecorators: { baseSort: [{
621
- type: Input
622
- }], sortColumn: [{
623
- type: HostListener,
624
- args: ['click']
625
- }] } });
626
-
627
- /**
628
- * Directive vor context menu
629
- * See https://stackblitz.com/edit/angular-custom-context-menu
630
- */
631
- class ContextMenuDirective {
632
- constructor(el) {
633
- this.el = el;
634
- this.xGap = 0;
635
- this.yGap = 0;
636
- this.overflowSpace = 10;
637
- this.selectors = '*';
638
- this.clickedElement = null;
639
- this.previousDisplayStatus = null;
640
- }
641
- ngOnInit() {
642
- if (this.ltContextMenu) {
643
- this.previousDisplayStatus = this.ltContextMenu.style.display;
644
- }
645
- // Add a click listener to the window,
646
- // so that we can close the context menu on left click
647
- window.addEventListener('click', () => {
648
- this.showContextMenu(null, false);
649
- });
650
- // Close context menu when escape is pressed
651
- window.addEventListener('keydown', (e) => {
652
- if (e.code === 'Escape') {
653
- this.showContextMenu(null, false);
654
- }
655
- });
656
- // Add an event listener to listen to the 'contextmenu' event
657
- this.el.nativeElement.addEventListener('contextmenu', (e) => {
658
- // Prevent the default context menu to popup
659
- if (e.preventDefault) {
660
- e.preventDefault();
661
- }
662
- // Shows our own context menu
663
- this.showContextMenu(e, true);
664
- });
665
- }
666
- // Shows or hides our custom context menu, which is specified as a input
667
- showContextMenu(event, show) {
668
- var _a;
669
- const cm = this.ltContextMenu;
670
- if (cm) {
671
- // Try to open context menu
672
- if (show && event && event instanceof MouseEvent) {
673
- // Get valid clicked structureElement
674
- const clickedElement = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.closest(this.selectors);
675
- if (clickedElement) {
676
- this.clickedElement = clickedElement;
677
- setTimeout(() => {
678
- // Set display status
679
- cm.style.display = 'block';
680
- // Calculate top position
681
- let top = event.y + this.yGap;
682
- if (top + cm.offsetHeight + 10 > document.documentElement.clientHeight) {
683
- top = document.documentElement.clientHeight - cm.offsetHeight - this.overflowSpace;
684
- }
685
- // Calculate left position
686
- let left = event.x + this.xGap;
687
- if (left + cm.offsetWidth + 10 > document.documentElement.clientWidth) {
688
- left = document.documentElement.clientWidth - cm.offsetWidth - this.overflowSpace;
689
- }
690
- // Set position
691
- cm.style.top = top + 'px';
692
- cm.style.left = left + 'px';
693
- // Show
694
- cm.style.opacity = '1.0';
695
- cm.style['pointer-events'] = 'auto';
696
- }, 1);
697
- return;
698
- }
699
- }
700
- // Close context menu
701
- this.clickedElement = null;
702
- if (this.previousDisplayStatus) {
703
- cm.style.display = this.previousDisplayStatus;
704
- }
705
- cm.style.opacity = '0.01';
706
- cm.style['pointer-events'] = 'none';
707
- }
708
- }
709
- }
710
- ContextMenuDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ContextMenuDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
711
- ContextMenuDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: ContextMenuDirective, selector: "[ltContextMenu]", inputs: { contextMenuData: "contextMenuData", ltContextMenu: "ltContextMenu", xGap: "xGap", yGap: "yGap", overflowSpace: "overflowSpace", selectors: "selectors" }, outputs: { clickedElement: "clickedElement" }, exportAs: ["contextMenuData"], ngImport: i0 });
712
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ContextMenuDirective, decorators: [{
713
- type: Directive,
714
- args: [{
715
- selector: '[ltContextMenu]',
716
- exportAs: 'contextMenuData',
717
- }]
718
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { contextMenuData: [{
719
- type: Input
720
- }], ltContextMenu: [{
721
- type: Input
722
- }], xGap: [{
723
- type: Input
724
- }], yGap: [{
725
- type: Input
726
- }], overflowSpace: [{
727
- type: Input
728
- }], selectors: [{
729
- type: Input
730
- }], clickedElement: [{
731
- type: Output
732
- }] } });
733
-
734
- /**
735
- * Stops propagation of click events
736
- * Inspired by https://stackoverflow.com/a/41001184
737
- */
738
- class StopPropagationDirective {
739
- onClick(event) {
740
- event.stopPropagation();
741
- }
742
- }
743
- StopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: StopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
744
- StopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: StopPropagationDirective, selector: "[baseStopPropagation]", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
745
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: StopPropagationDirective, decorators: [{
746
- type: Directive,
747
- args: [{
748
- selector: '[baseStopPropagation]',
749
- }]
750
- }], propDecorators: { onClick: [{
751
- type: HostListener,
752
- args: ['click', ['$event']]
753
- }] } });
754
-
755
- class UploadImageComponent {
756
- constructor(httpClient, authService, fileService, toastService) {
757
- this.httpClient = httpClient;
758
- this.authService = authService;
759
- this.fileService = fileService;
760
- this.toastService = toastService;
761
- this.supportText = 'Supports: JPEG, JPG, PNG';
762
- this.required = false;
763
- this.defaultDragText = 'Drag & Drop';
764
- this.defaultReleaseText = 'Release to Upload';
765
- this.preButtonText = 'or';
766
- this.buttonText = 'browse';
767
- this.validExtensions = ['image/jpeg', 'image/jpg', 'image/png', 'image/webp'];
768
- this.url = 'http://localhost:3000';
769
- this.uploadPath = '/files/upload';
770
- this.deletePath = '/files/';
771
- this.path = '/files/';
772
- this.uploadDirectly = false;
773
- this.croppingImage = false;
774
- this.mode = 'file';
775
- this.imageUploaded = new EventEmitter();
776
- this.imageDeleted = new EventEmitter();
777
- this.fileChanged = new EventEmitter();
778
- this.dragActive = false;
779
- this.dragText = 'Drag & Drop';
780
- this.loading = false;
781
- this.croppedInProgress = false;
782
- }
783
- ngOnInit() {
784
- // Set default options for cropping
785
- this.cOptions = Object.assign({ maintainAspectRatio: true, aspectRatio: 4 / 3, onlyScaleDown: false, imageQuality: 92, autoCrop: true, alignImage: 'center', format: 'jpeg' }, this.croppingOptions);
786
- }
787
- /**
788
- * The dragOver function is called when the user drags a file over the dropzone. It prevents the default action of the
789
- * event, and sets the dragText to 'Release to Upload' and the dragActive to true
790
- *
791
- * @param event - any - This is the event that is triggered when the user drags a file over the dropzone.
792
- */
793
- dragOver(event) {
794
- event.preventDefault();
795
- this.dragText = this.defaultReleaseText;
796
- this.dragActive = true;
797
- }
798
- /**
799
- * When the user drags a file over the drop zone, the dragActive variable is set to true, which will change the color of
800
- * the drop zone to green
801
- *
802
- * @param event - The event object that is passed to the dragLeave event.
803
- */
804
- dragLeave(event) {
805
- this.dragText = this.defaultDragText;
806
- this.dragActive = false;
807
- }
808
- /**
809
- * The function takes an event as a parameter, prevents the default action of the event, sets the URL of the image to the
810
- * file that was dragged and dropped, sets the text of the drag and drop area to the default text, and sets the
811
- * dragActive variable to false
812
- *
813
- * @param event - any - This is the event that is triggered when the user drags and drops a file.
814
- */
815
- drop(event) {
816
- event.preventDefault();
817
- this.fileInput.nativeElement.files = event.dataTransfer.files;
818
- const e = new Event('change');
819
- this.fileInput.nativeElement.dispatchEvent(e);
820
- this.dragText = 'Drag & Drop';
821
- this.dragActive = false;
822
- }
823
- /**
824
- * It takes a file as an argument, checks if the file type is valid, and if it is, it creates a new FileReader object,
825
- * sets the onload function to set the fileUrl to the result of the fileReader, sets the selectedFile to the file, and
826
- * calls the upload function
827
- *
828
- * @param file - any - this is the file that is selected by the user.
829
- */
830
- setUrl(file) {
831
- const fileReader = new FileReader();
832
- fileReader.onload = (result) => {
833
- this.loading = true;
834
- this.fileUrl = fileReader.result;
835
- this.selectedFile = file;
836
- this.upload();
837
- };
838
- fileReader.readAsDataURL(file);
839
- }
840
- checkFile(file) {
841
- if (this.maxSize && file.size > this.maxSize) {
842
- this.toastService.show({
843
- id: 'image-invalid-size',
844
- type: ToastType.ERROR,
845
- title: 'Fehlgeschlagen',
846
- description: 'Die Datei ist zu groß. Die Datei darf nicht größer als ' +
847
- (this.maxSize / (1024 * 1024)).toFixed(2) +
848
- 'MB sein.',
849
- }, 3500);
850
- return false;
851
- }
852
- else {
853
- if (this.validExtensions.includes(file === null || file === void 0 ? void 0 : file.type)) {
854
- return true;
855
- }
856
- else {
857
- this.toastService.show({
858
- id: 'image-invalid-format',
859
- type: ToastType.ERROR,
860
- title: 'Fehlgeschlagen',
861
- description: 'Das Format der Datei wird nicht unterstützt.',
862
- }, 3500);
863
- return false;
864
- }
865
- }
866
- }
867
- /**
868
- * The function takes an event as an argument, and then sets the url of the file to the first file in the event's
869
- * target's files array
870
- *
871
- * @param event - any - The event that is triggered when the user selects a file.
872
- */
873
- selectFile(event) {
874
- if (!this.checkFile(event.target.files[0])) {
875
- return;
876
- }
877
- if (this.croppingImage) {
878
- this.croppedInProgress = true;
879
- this.fileEvent = event;
880
- }
881
- else {
882
- this.setUrl(event.target.files[0]);
883
- }
884
- }
885
- /**
886
- * We create a new FormData object, append the selected file to it, and then send it to the server
887
- */
888
- upload() {
889
- return __awaiter(this, void 0, void 0, function* () {
890
- // Prepare file data
891
- let file = this.selectedFile;
892
- if (this.compressOptions) {
893
- file = yield this.fileService.compress(file, this.compressOptions);
894
- }
895
- const fileData = {
896
- field: this.objectPath ? this.objectPath + '.' + this.id : this.id,
897
- file,
898
- base64: yield this.getBase64(file),
899
- };
900
- // Emit file data
901
- this.fileChanged.emit(fileData);
902
- // Set control value and upload directly if required
903
- if (this.uploadDirectly) {
904
- const result = yield this.fileService.upload(this.url, this.uploadPath, this.selectedFile);
905
- if (result === null || result === void 0 ? void 0 : result.id) {
906
- this.control.setValue(result.id);
907
- this.imageUploaded.emit(result.id);
908
- }
909
- }
910
- else {
911
- this.control.setValue(this.mode === 'base64' ? fileData.base64 : this.selectedFile);
912
- }
913
- // Final processes
914
- this.control.markAsTouched();
915
- this.loading = false;
916
- });
917
- }
918
- /**
919
- * It deletes the file from the server and sets the selectedFile and fileUrl to null
920
- *
921
- * @param [id] - The id of the file to delete.
922
- */
923
- deleteFile(id) {
924
- return __awaiter(this, void 0, void 0, function* () {
925
- if (!this.uploadDirectly) {
926
- this.selectedFile = null;
927
- this.fileUrl = null;
928
- this.control.setValue('');
929
- this.control.markAsTouched();
930
- this.fileChanged.emit({
931
- field: this.objectPath ? this.objectPath + '.' + this.id : this.id,
932
- file: null,
933
- base64: null,
934
- });
935
- return;
936
- }
937
- this.loading = true;
938
- this.selectedFile = null;
939
- this.fileUrl = null;
940
- if (id) {
941
- const result = yield this.fileService.delete(this.url, this.deletePath, id);
942
- if (result) {
943
- this.selectedFile = null;
944
- this.fileUrl = null;
945
- this.control.setValue('');
946
- this.imageDeleted.emit();
947
- this.loading = false;
948
- }
949
- }
950
- });
951
- }
952
- /**
953
- * Convert a file into a BASE64 encoded string
954
- */
955
- getBase64(file) {
956
- return new Promise((resolve, reject) => {
957
- if (!file) {
958
- return resolve(null);
959
- }
960
- const reader = new FileReader();
961
- reader.readAsDataURL(file);
962
- reader.onload = () => {
963
- if (!reader.result) {
964
- return reject(new Error('Conversion failed'));
965
- }
966
- resolve(reader.result.toString());
967
- };
968
- reader.onerror = (error) => {
969
- reject(error);
970
- };
971
- });
972
- }
973
- base64ToFile(base64, fileName, fileType) {
974
- return new Promise((resolve, reject) => {
975
- fetch(base64)
976
- .then((res) => res.blob())
977
- .then((blob) => {
978
- resolve(new File([blob], fileName, { type: fileType }));
979
- }, (err) => {
980
- reject(err);
981
- });
982
- });
983
- }
984
- imageCropped($event, fileEvent) {
985
- return __awaiter(this, void 0, void 0, function* () {
986
- const file = fileEvent.target.files[0];
987
- this.croppedFile = yield this.base64ToFile($event.base64, file.name, file.type);
988
- });
989
- }
990
- finishedCropping() {
991
- this.fileEvent = null;
992
- this.setUrl(this.croppedFile);
993
- this.croppedInProgress = false;
994
- this.croppedFile = null;
995
- }
996
- loadImageFailed() {
997
- this.toastService.show({
998
- id: 'image-invalid-cropped',
999
- type: ToastType.ERROR,
1000
- title: 'Fehlgeschlagen',
1001
- description: 'Es ist ein Fehler aufgetreten. Bitte probieren Sie es später erneut oder wenden Sie sich an den Support.',
1002
- }, 3500);
1003
- }
1004
- }
1005
- UploadImageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UploadImageComponent, deps: [{ token: i1$2.HttpClient }, { token: i1$1.AuthService }, { token: i1$1.FileService }, { token: i1$1.ToastService }], target: i0.ɵɵFactoryTarget.Component });
1006
- UploadImageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: UploadImageComponent, selector: "base-upload-image", inputs: { id: "id", name: "name", infoText: "infoText", label: "label", supportText: "supportText", required: "required", defaultDragText: "defaultDragText", defaultReleaseText: "defaultReleaseText", preButtonText: "preButtonText", buttonText: "buttonText", validExtensions: "validExtensions", control: "control", url: "url", uploadPath: "uploadPath", deletePath: "deletePath", path: "path", compressOptions: "compressOptions", maxSize: "maxSize", uploadDirectly: "uploadDirectly", croppingImage: "croppingImage", croppingOptions: "croppingOptions", objectPath: "objectPath", mode: "mode" }, outputs: { imageUploaded: "imageUploaded", imageDeleted: "imageDeleted", fileChanged: "fileChanged" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<div class=\"form-group mt-3\" [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n\n <div\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n class=\"drag-area\"\n (dragover)=\"dragOver($event)\"\n (dragleave)=\"dragLeave($event)\"\n (drop)=\"drop($event)\"\n [ngClass]=\"{ active: dragActive, pointer: !loading, 'is-invalid': control?.invalid && control?.touched }\"\n (click)=\"!croppedInProgress && !loading && fileInput.click()\"\n >\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n\n <ng-container *ngIf=\"selectedFile && !fileEvent && !croppedInProgress && !loading\">\n <img [src]=\"fileUrl\" *ngIf=\"selectedFile\" />\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteFile()\" baseStopPropagation>L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"control?.value && !fileEvent && !selectedFile && !loading && !croppedInProgress\">\n <img [src]=\"control?.value.startsWith('data:') ? control?.value : url + path + control?.value\" />\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteFile(control?.value)\" baseStopPropagation>\n L\u00F6schen\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"!selectedFile && !control?.value && !loading && !fileEvent\">\n <div class=\"icon\">\n <i class=\"bi bi-images\"></i>\n </div>\n\n <span class=\"header\">{{ dragText }}</span>\n <span class=\"header\"\n >{{ preButtonText }}\n <span class=\"button\" (click)=\"fileInput.click()\" baseStopPropagation>{{ buttonText }}</span></span\n >\n <span class=\"support\" [innerText]=\"supportText\"></span>\n </ng-container>\n\n <input type=\"file\" (change)=\"selectFile($event)\" [attr.accept]=\"validExtensions?.join(',')\" hidden #fileInput />\n\n <ng-container *ngIf=\"croppedInProgress && fileEvent\">\n <image-cropper\n [imageChangedEvent]=\"fileEvent\"\n [maintainAspectRatio]=\"cOptions.maintainAspectRatio\"\n [aspectRatio]=\"cOptions.aspectRatio\"\n [alignImage]=\"cOptions.alignImage\"\n [resizeToWidth]=\"cOptions.resizeToWidth\"\n [resizeToHeight]=\"cOptions.resizeToHeight\"\n [autoCrop]=\"cOptions.autoCrop\"\n [imageQuality]=\"cOptions.imageQuality\"\n [onlyScaleDown]=\"cOptions.onlyScaleDown\"\n [format]=\"cOptions.format\"\n (imageCropped)=\"imageCropped($event, fileEvent)\"\n (loadImageFailed)=\"loadImageFailed()\"\n ></image-cropper>\n <button class=\"btn btn-primary mt-2\" type=\"button\" (click)=\"finishedCropping()\" baseStopPropagation>\n Zuschneiden\n </button>\n </ng-container>\n </div>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n </div>\n</div>\n", styles: [":host{--base-upload-image-area-bg: #ffffff;--base-upload-image-area-border-color: #e1e1e1;--base-upload-image-area-height: 400px}.is-invalid .drag-area{border-color:var(--bs-danger)}.is-invalid .invalid-feedback{display:block}.required:after{content:\" *\"}.drag-area{height:var(--base-upload-image-area-height);border:2px dashed var(--base-upload-image-area-border-color);background-color:var(--base-upload-image-area-bg);display:flex;flex-direction:column;justify-content:center;align-items:center;margin:10px auto;padding:20px}.drag-area img{height:100%;max-height:280px;max-width:100%;object-fit:scale-down}.drag-area .btn-danger{margin-top:auto}.drag-area .icon{font-size:50px;color:var(--bs-primary)}.drag-area .header{font-size:20px;font-weight:500}.drag-area .support{font-size:12px;color:#e1e1e1;margin:10px 0 15px}.drag-area .button{font-size:20px;font-weight:500;color:var(--bs-primary);cursor:pointer}.active{border:2px solid var(--bs-primary)}.pointer{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "format", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "directive", type: i3.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "directive", type: StopPropagationDirective, selector: "[baseStopPropagation]" }] });
1007
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UploadImageComponent, decorators: [{
1008
- type: Component,
1009
- args: [{ selector: 'base-upload-image', template: "<div class=\"form-group mt-3\" [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n\n <div\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n class=\"drag-area\"\n (dragover)=\"dragOver($event)\"\n (dragleave)=\"dragLeave($event)\"\n (drop)=\"drop($event)\"\n [ngClass]=\"{ active: dragActive, pointer: !loading, 'is-invalid': control?.invalid && control?.touched }\"\n (click)=\"!croppedInProgress && !loading && fileInput.click()\"\n >\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n\n <ng-container *ngIf=\"selectedFile && !fileEvent && !croppedInProgress && !loading\">\n <img [src]=\"fileUrl\" *ngIf=\"selectedFile\" />\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteFile()\" baseStopPropagation>L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"control?.value && !fileEvent && !selectedFile && !loading && !croppedInProgress\">\n <img [src]=\"control?.value.startsWith('data:') ? control?.value : url + path + control?.value\" />\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteFile(control?.value)\" baseStopPropagation>\n L\u00F6schen\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"!selectedFile && !control?.value && !loading && !fileEvent\">\n <div class=\"icon\">\n <i class=\"bi bi-images\"></i>\n </div>\n\n <span class=\"header\">{{ dragText }}</span>\n <span class=\"header\"\n >{{ preButtonText }}\n <span class=\"button\" (click)=\"fileInput.click()\" baseStopPropagation>{{ buttonText }}</span></span\n >\n <span class=\"support\" [innerText]=\"supportText\"></span>\n </ng-container>\n\n <input type=\"file\" (change)=\"selectFile($event)\" [attr.accept]=\"validExtensions?.join(',')\" hidden #fileInput />\n\n <ng-container *ngIf=\"croppedInProgress && fileEvent\">\n <image-cropper\n [imageChangedEvent]=\"fileEvent\"\n [maintainAspectRatio]=\"cOptions.maintainAspectRatio\"\n [aspectRatio]=\"cOptions.aspectRatio\"\n [alignImage]=\"cOptions.alignImage\"\n [resizeToWidth]=\"cOptions.resizeToWidth\"\n [resizeToHeight]=\"cOptions.resizeToHeight\"\n [autoCrop]=\"cOptions.autoCrop\"\n [imageQuality]=\"cOptions.imageQuality\"\n [onlyScaleDown]=\"cOptions.onlyScaleDown\"\n [format]=\"cOptions.format\"\n (imageCropped)=\"imageCropped($event, fileEvent)\"\n (loadImageFailed)=\"loadImageFailed()\"\n ></image-cropper>\n <button class=\"btn btn-primary mt-2\" type=\"button\" (click)=\"finishedCropping()\" baseStopPropagation>\n Zuschneiden\n </button>\n </ng-container>\n </div>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n </div>\n</div>\n", styles: [":host{--base-upload-image-area-bg: #ffffff;--base-upload-image-area-border-color: #e1e1e1;--base-upload-image-area-height: 400px}.is-invalid .drag-area{border-color:var(--bs-danger)}.is-invalid .invalid-feedback{display:block}.required:after{content:\" *\"}.drag-area{height:var(--base-upload-image-area-height);border:2px dashed var(--base-upload-image-area-border-color);background-color:var(--base-upload-image-area-bg);display:flex;flex-direction:column;justify-content:center;align-items:center;margin:10px auto;padding:20px}.drag-area img{height:100%;max-height:280px;max-width:100%;object-fit:scale-down}.drag-area .btn-danger{margin-top:auto}.drag-area .icon{font-size:50px;color:var(--bs-primary)}.drag-area .header{font-size:20px;font-weight:500}.drag-area .support{font-size:12px;color:#e1e1e1;margin:10px 0 15px}.drag-area .button{font-size:20px;font-weight:500;color:var(--bs-primary);cursor:pointer}.active{border:2px solid var(--bs-primary)}.pointer{cursor:pointer}\n"] }]
1010
- }], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i1$1.AuthService }, { type: i1$1.FileService }, { type: i1$1.ToastService }]; }, propDecorators: { fileInput: [{
1011
- type: ViewChild,
1012
- args: ['fileInput']
1013
- }], id: [{
1014
- type: Input
1015
- }], name: [{
1016
- type: Input
1017
- }], infoText: [{
1018
- type: Input
1019
- }], label: [{
1020
- type: Input
1021
- }], supportText: [{
1022
- type: Input
1023
- }], required: [{
1024
- type: Input
1025
- }], defaultDragText: [{
1026
- type: Input
1027
- }], defaultReleaseText: [{
1028
- type: Input
1029
- }], preButtonText: [{
1030
- type: Input
1031
- }], buttonText: [{
1032
- type: Input
1033
- }], validExtensions: [{
1034
- type: Input
1035
- }], control: [{
1036
- type: Input
1037
- }], url: [{
1038
- type: Input
1039
- }], uploadPath: [{
1040
- type: Input
1041
- }], deletePath: [{
1042
- type: Input
1043
- }], path: [{
1044
- type: Input
1045
- }], compressOptions: [{
1046
- type: Input
1047
- }], maxSize: [{
1048
- type: Input
1049
- }], uploadDirectly: [{
1050
- type: Input
1051
- }], croppingImage: [{
1052
- type: Input
1053
- }], croppingOptions: [{
1054
- type: Input
1055
- }], objectPath: [{
1056
- type: Input
1057
- }], mode: [{
1058
- type: Input
1059
- }], imageUploaded: [{
1060
- type: Output
1061
- }], imageDeleted: [{
1062
- type: Output
1063
- }], fileChanged: [{
1064
- type: Output
1065
- }] } });
1066
-
1067
- class RefenceInputComponent {
1068
- constructor(graphQLService, router) {
1069
- this.graphQLService = graphQLService;
1070
- this.router = router;
1071
- this.isList = false;
1072
- this.search = true;
1073
- this.useParamAsArg = false;
1074
- this.placeholder = '';
1075
- this.required = false;
1076
- this.method = 'find';
1077
- this.fields = ['id', 'name'];
1078
- this.valueField = 'id';
1079
- this.objectPath = '';
1080
- this.nameField = 'name';
1081
- this.creationLink = '';
1082
- this.objects = [];
1083
- this.optionsForTagInput = [];
1084
- this.subscription = new Subscription();
1085
- }
1086
- ngOnInit() {
1087
- return __awaiter(this, void 0, void 0, function* () {
1088
- this.getReferences();
1089
- this.subscription.add(this.control.valueChanges.subscribe(() => {
1090
- if (!this.currentValue) {
1091
- this.setValue();
1092
- }
1093
- }));
1094
- });
1095
- }
1096
- ngOnDestroy() {
1097
- this.subscription.unsubscribe();
1098
- }
1099
- /**
1100
- * Open creation link for new reference if enabled
1101
- */
1102
- openLink() {
1103
- this.router.navigate([this.creationLink]);
1104
- }
1105
- /**
1106
- * It gets the references from the GraphQL server and sets the value of the select
1107
- */
1108
- getReferences() {
1109
- const fields = [...this.fields];
1110
- if (Array.isArray(this.nameField)) {
1111
- for (const field of this.nameField) {
1112
- if (!fields.includes(field)) {
1113
- fields.push(field);
1114
- }
1115
- }
1116
- }
1117
- else {
1118
- if (!fields.includes(this.nameField)) {
1119
- fields.push(this.nameField);
1120
- }
1121
- }
1122
- let args;
1123
- if (!this.useParamAsArg) {
1124
- args = { sort: [{ field: fields.includes('name') ? 'name' : fields[0], order: SortOrderEnum.ASC }] };
1125
- }
1126
- else {
1127
- args = {
1128
- id: this.param,
1129
- sort: [{ field: fields.includes('name') ? 'name' : fields[0], order: SortOrderEnum.ASC }],
1130
- };
1131
- }
1132
- this.graphQLService
1133
- .graphQl(this.method, {
1134
- fields,
1135
- arguments: args,
1136
- type: GraphQLRequestType.QUERY,
1137
- })
1138
- .subscribe((result) => __awaiter(this, void 0, void 0, function* () {
1139
- if (result) {
1140
- this.objects = result;
1141
- this.setObjectsAsOptions();
1142
- if (!this.currentValue) {
1143
- this.setValue();
1144
- }
1145
- }
1146
- }));
1147
- }
1148
- /**
1149
- * If the current value is not valid, set the control to an invalid state
1150
- */
1151
- checkValidReference() {
1152
- if (!this.currentValue) {
1153
- this.control.markAsTouched();
1154
- this.control.markAsDirty();
1155
- this.control.setValue('');
1156
- this.control.setErrors(null);
1157
- return;
1158
- }
1159
- const foundElement = this.objects.find((e) => this.checkForNameFields(e));
1160
- if (!foundElement) {
1161
- this.control.setValue(null);
1162
- this.control.markAsTouched();
1163
- this.control.markAsDirty();
1164
- this.control.setErrors({ invalidReference: true });
1165
- }
1166
- else {
1167
- this.control.setErrors(null);
1168
- }
1169
- }
1170
- /**
1171
- * If the user presses the enter key, mark the control as touched
1172
- */
1173
- enterKey(event) {
1174
- this.selectedElement = event.target;
1175
- this.control.markAsTouched();
1176
- }
1177
- /**
1178
- * If the control has a value and the objects array is not empty, then find the object in the array that has the same
1179
- * value as the control's value and set the currentValue to the textField of that object. If the control has a value but
1180
- * the objects array is empty, then set the currentValue to the control's value
1181
- */
1182
- setValue() {
1183
- var _a, _b, _c, _d;
1184
- if (((_a = this.control) === null || _a === void 0 ? void 0 : _a.value) && ((_b = this.objects) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1185
- if ((_d = (_c = this.control) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.id) {
1186
- this.control.setValue(this.control.value.id);
1187
- }
1188
- const foundElement = this.objects.find((e) => e[this.valueField] === this.control.value);
1189
- if (foundElement) {
1190
- this.currentValue = this.prepareNameField(foundElement);
1191
- }
1192
- }
1193
- }
1194
- /**
1195
- * It sets the value of the control to the id of the selected option
1196
- */
1197
- set(id) {
1198
- this.control.markAsTouched();
1199
- this.control.markAsDirty();
1200
- this.control.setValue(id);
1201
- this.setValue();
1202
- this.selectedElement = null;
1203
- }
1204
- /**
1205
- * Filter options for drop down
1206
- */
1207
- filterOptions() {
1208
- return this.objects
1209
- ? this.objects.filter((e) => { var _a, _b; return (!this.currentValue || this.checkForNameFields(e)) && !((_b = (_a = this.control) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.includes(e === null || e === void 0 ? void 0 : e.value)); })
1210
- : [];
1211
- }
1212
- /**
1213
- * It takes an array of objects and returns an array of objects with the text and value fields specified
1214
- */
1215
- setObjectsAsOptions() {
1216
- this.optionsForTagInput = this.objects.map((e) => {
1217
- return {
1218
- text: this.prepareNameField(e),
1219
- value: e[this.valueField],
1220
- };
1221
- });
1222
- }
1223
- /**
1224
- * Show dropdown focus
1225
- */
1226
- onFocus(event) {
1227
- if (event) {
1228
- this.selectedElement = event.target;
1229
- }
1230
- else {
1231
- this.checkValidReference();
1232
- setTimeout(() => {
1233
- this.selectedElement = null;
1234
- }, 250);
1235
- }
1236
- }
1237
- /**
1238
- * Prepare string function if name fields is an array
1239
- */
1240
- prepareNameField(object) {
1241
- let result;
1242
- if (Array.isArray(this.nameField)) {
1243
- for (const field of this.nameField) {
1244
- if (!result) {
1245
- result = object[field];
1246
- }
1247
- else if (object[field]) {
1248
- result = result + ' ' + object[field];
1249
- }
1250
- }
1251
- }
1252
- else {
1253
- result = object[this.nameField];
1254
- }
1255
- return result;
1256
- }
1257
- /**
1258
- * Check function if name fields is an array
1259
- */
1260
- checkForNameFields(object) {
1261
- var _a;
1262
- if (Array.isArray(this.nameField)) {
1263
- let result = false;
1264
- for (const field of this.nameField) {
1265
- const check = object[field].includes(this.currentValue);
1266
- if (check) {
1267
- result = check;
1268
- }
1269
- }
1270
- return result;
1271
- }
1272
- else {
1273
- return (_a = object[this.nameField]) === null || _a === void 0 ? void 0 : _a.includes(this.currentValue);
1274
- }
1275
- }
1276
- }
1277
- RefenceInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: RefenceInputComponent, deps: [{ token: i1$1.GraphQLService }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Component });
1278
- RefenceInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: RefenceInputComponent, selector: "base-refence-input", inputs: { id: "id", name: "name", infoText: "infoText", label: "label", isList: "isList", search: "search", useParamAsArg: "useParamAsArg", param: "param", placeholder: "placeholder", autocomplete: "autocomplete", tabIndex: "tabIndex", control: "control", required: "required", method: "method", fields: "fields", valueField: "valueField", objectPath: "objectPath", nameField: "nameField", creationLink: "creationLink" }, ngImport: i0, template: "<ng-container *ngIf=\"!isList\">\n <div class=\"form-group mb-3\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n\n <div class=\"position-relative\" *ngIf=\"search\">\n <div class=\"d-flex flex-row\">\n <input [formControl]=\"control\" hidden />\n <input\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n class=\"form-control\"\n [(ngModel)]=\"currentValue\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onFocus()\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n (keyup)=\"enterKey($event)\"\n />\n <button class=\"btn btn-primary\" (click)=\"openLink()\" *ngIf=\"creationLink\">Erstellen</button>\n </div>\n <div class=\"options\" *ngIf=\"objects && selectedElement\">\n <div class=\"option-item\" *ngFor=\"let object of filterOptions()\" (click)=\"set(object[valueField])\">\n {{ prepareNameField(object) }}\n </div>\n </div>\n </div>\n\n <div *ngIf=\"!search\">\n <div class=\"d-flex flex-row\">\n <select\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n class=\"form-select\"\n [attr.aria-label]=\"placeholder\"\n [formControl]=\"control\"\n [required]=\"required\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n >\n <option [ngValue]=\"null\" selected>{{ placeholder }}</option>\n <option *ngFor=\"let object of objects\" [ngValue]=\"object[valueField]\">\n {{ prepareNameField(object) }}\n </option>\n </select>\n <button class=\"btn btn-primary\" (click)=\"openLink()\" *ngIf=\"creationLink\">Erstellen</button>\n </div>\n </div>\n\n <div\n class=\"d-block invalid-feedback m-2\"\n *ngIf=\"control?.invalid && (control?.dirty || control?.touched) && !selectedElement\"\n >\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['invalidReference'] && currentValue\">\n {{ currentValue }} ist kein g\u00FCltiger Wert f\u00FCr {{ label }}.\n </div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"isList\">\n <base-tags\n [id]=\"id\"\n [label]=\"label\"\n [name]=\"name\"\n [control]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [custom]=\"false\"\n [options]=\"optionsForTagInput\"\n ></base-tags>\n</ng-container>\n", styles: [".options{position:absolute;display:block;top:100%;left:0;right:0;border-top:0;background-color:#fff;box-shadow:0 2px 5px #00000029,0 2px 10px #0000001f;transition:all .5s;z-index:999;max-height:200px;overflow-y:scroll}.options .option-item{padding:10px;cursor:pointer}.options .option-item:hover{color:var(--bs-primary)}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "component", type: TagsComponent, selector: "base-tags", inputs: ["id", "name", "infoText", "label", "placeholder", "autocomplete", "tabIndex", "control", "options", "custom", "removeByKey", "required", "objectPath", "validators"] }] });
1279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: RefenceInputComponent, decorators: [{
1280
- type: Component,
1281
- args: [{ selector: 'base-refence-input', template: "<ng-container *ngIf=\"!isList\">\n <div class=\"form-group mb-3\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <i class=\"bi bi-info-circle\" [ngbTooltip]=\"infoText\" placement=\"start\" *ngIf=\"infoText\"></i>\n </div>\n\n <div class=\"position-relative\" *ngIf=\"search\">\n <div class=\"d-flex flex-row\">\n <input [formControl]=\"control\" hidden />\n <input\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n class=\"form-control\"\n [(ngModel)]=\"currentValue\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onFocus()\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n (keyup)=\"enterKey($event)\"\n />\n <button class=\"btn btn-primary\" (click)=\"openLink()\" *ngIf=\"creationLink\">Erstellen</button>\n </div>\n <div class=\"options\" *ngIf=\"objects && selectedElement\">\n <div class=\"option-item\" *ngFor=\"let object of filterOptions()\" (click)=\"set(object[valueField])\">\n {{ prepareNameField(object) }}\n </div>\n </div>\n </div>\n\n <div *ngIf=\"!search\">\n <div class=\"d-flex flex-row\">\n <select\n [id]=\"objectPath ? objectPath + '.' + id : id\"\n [name]=\"name\"\n class=\"form-select\"\n [attr.aria-label]=\"placeholder\"\n [formControl]=\"control\"\n [required]=\"required\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n >\n <option [ngValue]=\"null\" selected>{{ placeholder }}</option>\n <option *ngFor=\"let object of objects\" [ngValue]=\"object[valueField]\">\n {{ prepareNameField(object) }}\n </option>\n </select>\n <button class=\"btn btn-primary\" (click)=\"openLink()\" *ngIf=\"creationLink\">Erstellen</button>\n </div>\n </div>\n\n <div\n class=\"d-block invalid-feedback m-2\"\n *ngIf=\"control?.invalid && (control?.dirty || control?.touched) && !selectedElement\"\n >\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['invalidReference'] && currentValue\">\n {{ currentValue }} ist kein g\u00FCltiger Wert f\u00FCr {{ label }}.\n </div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"isList\">\n <base-tags\n [id]=\"id\"\n [label]=\"label\"\n [name]=\"name\"\n [control]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [custom]=\"false\"\n [options]=\"optionsForTagInput\"\n ></base-tags>\n</ng-container>\n", styles: [".options{position:absolute;display:block;top:100%;left:0;right:0;border-top:0;background-color:#fff;box-shadow:0 2px 5px #00000029,0 2px 10px #0000001f;transition:all .5s;z-index:999;max-height:200px;overflow-y:scroll}.options .option-item{padding:10px;cursor:pointer}.options .option-item:hover{color:var(--bs-primary)}\n"] }]
1282
- }], ctorParameters: function () { return [{ type: i1$1.GraphQLService }, { type: i2$1.Router }]; }, propDecorators: { id: [{
1283
- type: Input
1284
- }], name: [{
1285
- type: Input
1286
- }], infoText: [{
1287
- type: Input
1288
- }], label: [{
1289
- type: Input
1290
- }], isList: [{
1291
- type: Input
1292
- }], search: [{
1293
- type: Input
1294
- }], useParamAsArg: [{
1295
- type: Input
1296
- }], param: [{
1297
- type: Input
1298
- }], placeholder: [{
1299
- type: Input
1300
- }], autocomplete: [{
1301
- type: Input
1302
- }], tabIndex: [{
1303
- type: Input
1304
- }], control: [{
1305
- type: Input
1306
- }], required: [{
1307
- type: Input
1308
- }], method: [{
1309
- type: Input
1310
- }], fields: [{
1311
- type: Input
1312
- }], valueField: [{
1313
- type: Input
1314
- }], objectPath: [{
1315
- type: Input
1316
- }], nameField: [{
1317
- type: Input
1318
- }], creationLink: [{
1319
- type: Input
1320
- }] } });
1321
-
1322
- class ModelFormSubComponent {
1323
- constructor(authService) {
1324
- this.authService = authService;
1325
- this.imageChanged = new EventEmitter();
1326
- this.fileChanged = new EventEmitter();
1327
- this.keys = [];
1328
- }
1329
- ngOnInit() {
1330
- // Get keys
1331
- const unsortedKeys = Object.keys(this.fields);
1332
- // Sort keys by config order
1333
- this.keys = unsortedKeys.sort((a, b) => {
1334
- var _a, _b, _c, _d;
1335
- return ((((_a = this.config[a]) === null || _a === void 0 ? void 0 : _a.order) ? (_b = this.config[a]) === null || _b === void 0 ? void 0 : _b.order : 99) - (((_c = this.config[b]) === null || _c === void 0 ? void 0 : _c.order) ? (_d = this.config[b]) === null || _d === void 0 ? void 0 : _d.order : 99));
1336
- });
1337
- // Set user for roles check
1338
- this.user = BasicUser.map(this.authService.currentUser);
1339
- if (this.parentKey) {
1340
- if (!this.objectPath) {
1341
- this.objectPath = this.parentKey;
1342
- }
1343
- else {
1344
- this.objectPath = this.objectPath + '.' + this.parentKey;
1345
- }
1346
- }
1347
- }
1348
- /**
1349
- * If the field has fields, return true, otherwise return false.
1350
- */
1351
- checkFieldHasFields(field) {
1352
- var _a;
1353
- return ((_a = Object.keys(field.fields)) === null || _a === void 0 ? void 0 : _a.length) !== 0;
1354
- }
1355
- /**
1356
- * It takes a string, capitalizes the first letter, and returns the new string
1357
- *
1358
- * @param value - The string that you want to capitalize the first letter of.
1359
- * @returns The first letter of the string is being capitalized and the rest of the string is being returned.
1360
- */
1361
- capitalizeFirstLetter(value) {
1362
- return value.charAt(0).toUpperCase() + value.slice(1);
1363
- }
1364
- /**
1365
- * It takes an array of values and returns an array of objects with a value and text property
1366
- *
1367
- * @param values - any[] - the array of values that you want to convert to a selectable list
1368
- * @param config
1369
- * @returns An array of objects with a value and text property.
1370
- */
1371
- prepareEnumForSelect(values, config = {}) {
1372
- return values
1373
- .filter((i) => {
1374
- var _a, _b;
1375
- return !(config && ((_a = config[i]) === null || _a === void 0 ? void 0 : _a.roles) && !this.user.hasAllRoles((_b = config[i]) === null || _b === void 0 ? void 0 : _b.roles));
1376
- })
1377
- .map((e) => {
1378
- var _a;
1379
- return {
1380
- value: e,
1381
- text: config && ((_a = config[e]) === null || _a === void 0 ? void 0 : _a.text) ? config[e].text : e,
1382
- };
1383
- });
1384
- }
1385
- /**
1386
- * It takes an AbstractControl and returns a FormControl
1387
- *
1388
- * @param control - AbstractControl | null | undefined
1389
- * @returns A FormControl
1390
- */
1391
- transformToControl(control) {
1392
- return control;
1393
- }
1394
- }
1395
- ModelFormSubComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModelFormSubComponent, deps: [{ token: i1$1.AuthService }], target: i0.ɵɵFactoryTarget.Component });
1396
- ModelFormSubComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: { id: "id", parentKey: "parentKey", fields: "fields", form: "form", config: "config" }, outputs: { imageChanged: "imageChanged", fileChanged: "fileChanged" }, ngImport: i0, template: "<div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container\n *ngIf=\"checkFieldHasFields(fields[key]) && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\"\n >\n <fieldset class=\"border rounded-3 p-3 mt-3\">\n <legend class=\"float-none w-auto px-3\">\n {{ config[key]?.label ? config[key].label : capitalizeFirstLetter(key) }}\n </legend>\n <base-model-form-sub\n [parentKey]=\"key\"\n [fields]=\"fields[key].fields\"\n [config]=\"config[key]?.fields || {}\"\n [form]=\"form.get(key)\"\n (imageChanged)=\"imageChanged.emit($event)\"\n (fileChanged)=\"fileChanged.emit($event)\"\n ></base-model-form-sub>\n </fieldset>\n </ng-container>\n\n <ng-container\n *ngIf=\"!checkFieldHasFields(fields[key]) && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\"\n >\n <ng-container *ngIf=\"fields[key]?.isEnum && !config[key]?.exclude\">\n <base-select\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || 'Bitte einen Wert ausw\u00E4hlen'\"\n [options]=\"prepareEnumForSelect(fields[key]?.validEnums, config[key]?.enumValues)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\"\n [objectPath]=\"objectPath\"\n ></base-select>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isEnum && !config[key]?.exclude\">\n <ng-container [ngSwitch]=\"config[key]?.type ? config[key]?.type : fields[key]?.type\">\n <ng-container *ngSwitchCase=\"'String'\">\n <ng-container *ngIf=\"fields[key]?.isList && !config[key]?.exclude\">\n <base-tags\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [validators]=\"config[key]?.validators\"\n [objectPath]=\"objectPath\"\n ></base-tags>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isList && !config[key]?.exclude\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'text'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Image'\">\n <base-upload-image\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [url]=\"config[key]?.url\"\n [path]=\"config[key]?.path || '/files/'\"\n [uploadPath]=\"config[key]?.uploadPath || '/files/upload'\"\n [deletePath]=\"config[key]?.deletePath || '/files/'\"\n [supportText]=\"config[key]?.supportText || 'Unterst\u00FCtzte Formate: JPEG, JPG, PNG'\"\n [defaultDragText]=\"config[key]?.dragText || 'Drag & Drop'\"\n [defaultReleaseText]=\"config[key]?.releaseText || 'Loslassen zum hochladen'\"\n [preButtonText]=\"config[key]?.preButtonText || 'or'\"\n [buttonText]=\"config[key]?.buttonText || 'browse'\"\n [validExtensions]=\"config[key]?.validExtensions || ['image/jpeg', 'image/jpg', 'image/png', 'image/webp']\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [compressOptions]=\"config[key]?.compressOptions\"\n [croppingOptions]=\"config[key]?.croppingOptions\"\n [croppingImage]=\"config[key]?.croppingImage\"\n [maxSize]=\"config[key]?.maxSize\"\n [uploadDirectly]=\"false\"\n [objectPath]=\"objectPath\"\n [mode]=\"config[key]?.imageMode || 'base64'\"\n (fileChanged)=\"fileChanged.emit($event)\"\n (imageDeleted)=\"imageChanged.emit(key)\"\n (imageUploaded)=\"imageChanged.emit(key)\"\n ></base-upload-image>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Upload'\">\n <base-upload-image\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [supportText]=\"config[key]?.supportText || 'Unterst\u00FCtzte Formate: JPEG, JPG, PNG'\"\n [defaultDragText]=\"config[key]?.dragText || 'Drag & Drop'\"\n [defaultReleaseText]=\"config[key]?.releaseText || 'Loslassen zum hochladen'\"\n [preButtonText]=\"config[key]?.preButtonText || 'or'\"\n [buttonText]=\"config[key]?.buttonText || 'browse'\"\n [validExtensions]=\"config[key]?.validExtensions || ['image/jpeg', 'image/jpg', 'image/png', 'image/webp']\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [compressOptions]=\"config[key]?.compressOptions\"\n [maxSize]=\"config[key]?.maxSize\"\n [objectPath]=\"objectPath\"\n [mode]=\"'file'\"\n ></base-upload-image>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Reference'\">\n <base-refence-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [isList]=\"fields[key]?.isList\"\n [useParamAsArg]=\"config[key]?.useParamAsArg ?? false\"\n [param]=\"id\"\n [search]=\"config[key]?.searchable ?? true\"\n [placeholder]=\"config[key]?.placeholder || 'Bitte einen Wert ausw\u00E4hlen'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [method]=\"config[key]?.method || 'find'\"\n [fields]=\"config[key]?.requestFields || ['id', 'name']\"\n [valueField]=\"config[key]?.valueField || 'id'\"\n [nameField]=\"config[key]?.nameField || 'name'\"\n [creationLink]=\"config[key]?.creationLink || ''\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-refence-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <base-checkbox\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-checkbox>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'LongText'\">\n <base-textarea\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-textarea>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Float'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [type]=\"'number'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Password'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [type]=\"'password'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Color'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [type]=\"'color'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'URL'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'url'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Email'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'email'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'datetime-local'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: InputComponent, selector: "base-input", inputs: ["id", "name", "infoText", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required", "eyeButton", "objectPath"], outputs: ["enter"] }, { kind: "component", type: SelectComponent, selector: "base-select", inputs: ["id", "name", "infoText", "label", "placeholder", "objectPath", "control", "tabIndex", "required", "multiple", "search", "options"] }, { kind: "component", type: CheckboxComponent, selector: "base-checkbox", inputs: ["id", "name", "label", "value", "control", "required", "objectPath"] }, { kind: "component", type: TextareaComponent, selector: "base-textarea", inputs: ["id", "name", "infoText", "label", "placeholder", "control", "rows", "required", "autoHeight", "tabIndex", "objectPath"] }, { kind: "component", type: TagsComponent, selector: "base-tags", inputs: ["id", "name", "infoText", "label", "placeholder", "autocomplete", "tabIndex", "control", "options", "custom", "removeByKey", "required", "objectPath", "validators"] }, { kind: "component", type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: ["id", "parentKey", "fields", "form", "config"], outputs: ["imageChanged", "fileChanged"] }, { kind: "component", type: UploadImageComponent, selector: "base-upload-image", inputs: ["id", "name", "infoText", "label", "supportText", "required", "defaultDragText", "defaultReleaseText", "preButtonText", "buttonText", "validExtensions", "control", "url", "uploadPath", "deletePath", "path", "compressOptions", "maxSize", "uploadDirectly", "croppingImage", "croppingOptions", "objectPath", "mode"], outputs: ["imageUploaded", "imageDeleted", "fileChanged"] }, { kind: "component", type: RefenceInputComponent, selector: "base-refence-input", inputs: ["id", "name", "infoText", "label", "isList", "search", "useParamAsArg", "param", "placeholder", "autocomplete", "tabIndex", "control", "required", "method", "fields", "valueField", "objectPath", "nameField", "creationLink"] }] });
1397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModelFormSubComponent, decorators: [{
1398
- type: Component,
1399
- args: [{ selector: 'base-model-form-sub', template: "<div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container\n *ngIf=\"checkFieldHasFields(fields[key]) && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\"\n >\n <fieldset class=\"border rounded-3 p-3 mt-3\">\n <legend class=\"float-none w-auto px-3\">\n {{ config[key]?.label ? config[key].label : capitalizeFirstLetter(key) }}\n </legend>\n <base-model-form-sub\n [parentKey]=\"key\"\n [fields]=\"fields[key].fields\"\n [config]=\"config[key]?.fields || {}\"\n [form]=\"form.get(key)\"\n (imageChanged)=\"imageChanged.emit($event)\"\n (fileChanged)=\"fileChanged.emit($event)\"\n ></base-model-form-sub>\n </fieldset>\n </ng-container>\n\n <ng-container\n *ngIf=\"!checkFieldHasFields(fields[key]) && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\"\n >\n <ng-container *ngIf=\"fields[key]?.isEnum && !config[key]?.exclude\">\n <base-select\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || 'Bitte einen Wert ausw\u00E4hlen'\"\n [options]=\"prepareEnumForSelect(fields[key]?.validEnums, config[key]?.enumValues)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\"\n [objectPath]=\"objectPath\"\n ></base-select>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isEnum && !config[key]?.exclude\">\n <ng-container [ngSwitch]=\"config[key]?.type ? config[key]?.type : fields[key]?.type\">\n <ng-container *ngSwitchCase=\"'String'\">\n <ng-container *ngIf=\"fields[key]?.isList && !config[key]?.exclude\">\n <base-tags\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [validators]=\"config[key]?.validators\"\n [objectPath]=\"objectPath\"\n ></base-tags>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isList && !config[key]?.exclude\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'text'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Image'\">\n <base-upload-image\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [url]=\"config[key]?.url\"\n [path]=\"config[key]?.path || '/files/'\"\n [uploadPath]=\"config[key]?.uploadPath || '/files/upload'\"\n [deletePath]=\"config[key]?.deletePath || '/files/'\"\n [supportText]=\"config[key]?.supportText || 'Unterst\u00FCtzte Formate: JPEG, JPG, PNG'\"\n [defaultDragText]=\"config[key]?.dragText || 'Drag & Drop'\"\n [defaultReleaseText]=\"config[key]?.releaseText || 'Loslassen zum hochladen'\"\n [preButtonText]=\"config[key]?.preButtonText || 'or'\"\n [buttonText]=\"config[key]?.buttonText || 'browse'\"\n [validExtensions]=\"config[key]?.validExtensions || ['image/jpeg', 'image/jpg', 'image/png', 'image/webp']\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [compressOptions]=\"config[key]?.compressOptions\"\n [croppingOptions]=\"config[key]?.croppingOptions\"\n [croppingImage]=\"config[key]?.croppingImage\"\n [maxSize]=\"config[key]?.maxSize\"\n [uploadDirectly]=\"false\"\n [objectPath]=\"objectPath\"\n [mode]=\"config[key]?.imageMode || 'base64'\"\n (fileChanged)=\"fileChanged.emit($event)\"\n (imageDeleted)=\"imageChanged.emit(key)\"\n (imageUploaded)=\"imageChanged.emit(key)\"\n ></base-upload-image>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Upload'\">\n <base-upload-image\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [supportText]=\"config[key]?.supportText || 'Unterst\u00FCtzte Formate: JPEG, JPG, PNG'\"\n [defaultDragText]=\"config[key]?.dragText || 'Drag & Drop'\"\n [defaultReleaseText]=\"config[key]?.releaseText || 'Loslassen zum hochladen'\"\n [preButtonText]=\"config[key]?.preButtonText || 'or'\"\n [buttonText]=\"config[key]?.buttonText || 'browse'\"\n [validExtensions]=\"config[key]?.validExtensions || ['image/jpeg', 'image/jpg', 'image/png', 'image/webp']\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [compressOptions]=\"config[key]?.compressOptions\"\n [maxSize]=\"config[key]?.maxSize\"\n [objectPath]=\"objectPath\"\n [mode]=\"'file'\"\n ></base-upload-image>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Reference'\">\n <base-refence-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [isList]=\"fields[key]?.isList\"\n [useParamAsArg]=\"config[key]?.useParamAsArg ?? false\"\n [param]=\"id\"\n [search]=\"config[key]?.searchable ?? true\"\n [placeholder]=\"config[key]?.placeholder || 'Bitte einen Wert ausw\u00E4hlen'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [method]=\"config[key]?.method || 'find'\"\n [fields]=\"config[key]?.requestFields || ['id', 'name']\"\n [valueField]=\"config[key]?.valueField || 'id'\"\n [nameField]=\"config[key]?.nameField || 'name'\"\n [creationLink]=\"config[key]?.creationLink || ''\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-refence-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <base-checkbox\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-checkbox>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'LongText'\">\n <base-textarea\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-textarea>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Float'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [type]=\"'number'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Password'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [type]=\"'password'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Color'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [type]=\"'color'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'URL'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'url'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Email'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'email'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [infoText]=\"config[key]?.infoText ? config[key].infoText : null\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'datetime-local'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n [objectPath]=\"objectPath\"\n ></base-input>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n" }]
1400
- }], ctorParameters: function () { return [{ type: i1$1.AuthService }]; }, propDecorators: { id: [{
1401
- type: Input
1402
- }], parentKey: [{
1403
- type: Input
1404
- }], fields: [{
1405
- type: Input
1406
- }], form: [{
1407
- type: Input
1408
- }], config: [{
1409
- type: Input
1410
- }], imageChanged: [{
1411
- type: Output
1412
- }], fileChanged: [{
1413
- type: Output
1414
- }] } });
1415
-
1416
- class FabButtonComponent {
1417
- constructor() {
1418
- this.fabIcon = 'bi-list';
1419
- this.toggle = false;
1420
- }
1421
- }
1422
- FabButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: FabButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1423
- FabButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: FabButtonComponent, selector: "base-fab-button", inputs: { fabIcon: "fabIcon", buttons: "buttons" }, ngImport: i0, template: "<div class=\"fab-container\" [ngClass]=\"{ 'fab-container-active': toggle }\">\n <div class=\"fab shadow\">\n <div class=\"fab-content\" (click)=\"toggle = !toggle\">\n <i class=\"bi bi-x-lg\" *ngIf=\"toggle\"></i>\n <i class=\"bi\" *ngIf=\"!toggle\" [ngClass]=\"fabIcon\"></i>\n </div>\n </div>\n <div\n class=\"sub-button shadow\"\n *ngFor=\"let button of buttons\"\n (click)=\"button.event.emit(true); toggle = !toggle\"\n [ngStyle]=\"{ backgroundColor: button.color }\"\n >\n <a [routerLink]=\"button.routerLink\">\n <i class=\"bi\" [ngClass]=\"button.icon\"></i>\n </a>\n </div>\n</div>\n", styles: [".fab-container{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;-webkit-user-select:none;user-select:none;position:absolute;bottom:10px;right:10px}.fab-container-active{height:100%}.fab-container-active .sub-button:nth-child(2){transform:translateY(-80px)}.fab-container-active .sub-button:nth-child(3){transform:translateY(-140px)}.fab-container-active .sub-button:nth-child(4){transform:translateY(-200px)}.fab-container-active .sub-button:nth-child(5){transform:translateY(-260px)}.fab-container-active .sub-button:nth-child(6){transform:translateY(-320px)}.fab-container .fab{position:relative;height:60px;width:60px;background-color:var(--bs-primary);border-radius:50%;z-index:2}.fab-container .fab:before{content:\" \";position:absolute;bottom:0;right:0;height:30px;width:30px;background-color:inherit;border-radius:0 0 10px;z-index:-1}.fab-container .fab .fab-content{display:flex;align-items:center;justify-content:center;height:inherit;width:inherit;border-radius:50%}.fab-container .fab .fab-content .bi{color:#fff;font-size:32px}.fab-container .sub-button{position:absolute;display:flex;align-items:center;justify-content:center;bottom:10px;right:10px;height:40px;width:40px;background-color:var(--bs-primary);border-radius:50%;transition:all .3s ease}.fab-container .sub-button:hover{cursor:pointer}.fab-container .sub-button .bi{color:#fff;padding-top:6px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
1424
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: FabButtonComponent, decorators: [{
1425
- type: Component,
1426
- args: [{ selector: 'base-fab-button', template: "<div class=\"fab-container\" [ngClass]=\"{ 'fab-container-active': toggle }\">\n <div class=\"fab shadow\">\n <div class=\"fab-content\" (click)=\"toggle = !toggle\">\n <i class=\"bi bi-x-lg\" *ngIf=\"toggle\"></i>\n <i class=\"bi\" *ngIf=\"!toggle\" [ngClass]=\"fabIcon\"></i>\n </div>\n </div>\n <div\n class=\"sub-button shadow\"\n *ngFor=\"let button of buttons\"\n (click)=\"button.event.emit(true); toggle = !toggle\"\n [ngStyle]=\"{ backgroundColor: button.color }\"\n >\n <a [routerLink]=\"button.routerLink\">\n <i class=\"bi\" [ngClass]=\"button.icon\"></i>\n </a>\n </div>\n</div>\n", styles: [".fab-container{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;-webkit-user-select:none;user-select:none;position:absolute;bottom:10px;right:10px}.fab-container-active{height:100%}.fab-container-active .sub-button:nth-child(2){transform:translateY(-80px)}.fab-container-active .sub-button:nth-child(3){transform:translateY(-140px)}.fab-container-active .sub-button:nth-child(4){transform:translateY(-200px)}.fab-container-active .sub-button:nth-child(5){transform:translateY(-260px)}.fab-container-active .sub-button:nth-child(6){transform:translateY(-320px)}.fab-container .fab{position:relative;height:60px;width:60px;background-color:var(--bs-primary);border-radius:50%;z-index:2}.fab-container .fab:before{content:\" \";position:absolute;bottom:0;right:0;height:30px;width:30px;background-color:inherit;border-radius:0 0 10px;z-index:-1}.fab-container .fab .fab-content{display:flex;align-items:center;justify-content:center;height:inherit;width:inherit;border-radius:50%}.fab-container .fab .fab-content .bi{color:#fff;font-size:32px}.fab-container .sub-button{position:absolute;display:flex;align-items:center;justify-content:center;bottom:10px;right:10px;height:40px;width:40px;background-color:var(--bs-primary);border-radius:50%;transition:all .3s ease}.fab-container .sub-button:hover{cursor:pointer}.fab-container .sub-button .bi{color:#fff;padding-top:6px}\n"] }]
1427
- }], propDecorators: { fabIcon: [{
1428
- type: Input
1429
- }], buttons: [{
1430
- type: Input
1431
- }] } });
1432
-
1433
- /**
1434
- * ModelFormComponent
1435
- *
1436
- * Hint for handling extensions of this component in project:
1437
- * If you want to use complete custom services and methods, extend ModelFormBaseComponent instead of ModelFormComponent
1438
- */
1439
- class ModelFormComponent {
1440
- set loading(value) {
1441
- if (!value) {
1442
- setTimeout(() => {
1443
- this._loading = value;
1444
- }, 400);
1445
- }
1446
- else {
1447
- this._loading = value;
1448
- }
1449
- }
1450
- constructor(graphQLMetaService, graphQLService, formsService, authService, router, route, cmsService, toastService, fileService) {
1451
- this.graphQLMetaService = graphQLMetaService;
1452
- this.graphQLService = graphQLService;
1453
- this.formsService = formsService;
1454
- this.authService = authService;
1455
- this.router = router;
1456
- this.route = route;
1457
- this.cmsService = cmsService;
1458
- this.toastService = toastService;
1459
- this.fileService = fileService;
1460
- this.delete = true;
1461
- this.onlyUpdateMode = false;
1462
- this.duplicate = false;
1463
- this.logging = false;
1464
- this.showFavButton = true;
1465
- this.finished = new EventEmitter();
1466
- this._loading = false;
1467
- this.keys = [];
1468
- this.fabButtons = [];
1469
- }
1470
- ngOnInit() {
1471
- // Set user for roles check
1472
- this.user = BasicUser.map(this.authService.currentUser);
1473
- this.graphQLMetaService.getMeta().subscribe((meta) => {
1474
- this.meta = meta;
1475
- if (this.modelName) {
1476
- this.init();
1477
- }
1478
- });
1479
- this.initFabActions();
1480
- }
1481
- ngOnChanges(changes) {
1482
- // Reinit form for new model or load and patch form with new id
1483
- if (changes['modelName'] || changes['id']) {
1484
- this.init();
1485
- }
1486
- }
1487
- /**
1488
- * > If the model name and metadata are present, set the operation to update or create, get the fields from the
1489
- * metadata, create the form, and if the value is present, patch the form with the value
1490
- */
1491
- init(id) {
1492
- if (id) {
1493
- this.id = id;
1494
- }
1495
- if (!this.id && this.onlyUpdateMode) {
1496
- return;
1497
- }
1498
- if (this.modelName && this.meta) {
1499
- this.operation = this.id ? 'update' : 'create';
1500
- if (this.logging) {
1501
- console.log('ModelFormComponent::init->operation', this.operation);
1502
- console.log('ModelFormComponent::init->meta.getArgs', this.operation + this.capitalizeFirstLetter(this.modelName));
1503
- }
1504
- this.fields = this.meta.getArgs(this.operation + this.capitalizeFirstLetter(this.modelName), {
1505
- type: GraphQLRequestType.MUTATION,
1506
- }).fields;
1507
- this.fields = this.fields['input'].fields;
1508
- this.keys = Object.keys(this.fields);
1509
- if (this.logging) {
1510
- console.log('ModelFormComponent::init->id', this.id);
1511
- console.log('ModelFormComponent::init->fields', this.fields);
1512
- console.log('ModelFormComponent::init->keys', this.keys);
1513
- }
1514
- this.form = this.createForm(this.fields);
1515
- if (this.id) {
1516
- this.getObjectById(this.id);
1517
- }
1518
- }
1519
- }
1520
- /**
1521
- * It takes a key as an argument, and returns an array of keys from the sub-object
1522
- */
1523
- getKeysFromSubObject(key) {
1524
- return Object.keys(this.fields[key]);
1525
- }
1526
- /**
1527
- * It takes an id, and then calls the graphQLService to get the object from the database
1528
- *
1529
- * @param id - The id of the object to be loaded
1530
- */
1531
- getObjectById(id) {
1532
- if (!id) {
1533
- return;
1534
- }
1535
- if (this.logging) {
1536
- console.log('ModelFormComponent::getObjectById->id', id);
1537
- console.log('ModelFormComponent::getObjectById->requestFields', this.createRequestObject(this.fields));
1538
- }
1539
- this.graphQLService
1540
- .graphQl('get' + this.capitalizeFirstLetter(this.modelName), {
1541
- arguments: { id },
1542
- fields: this.createRequestObject(this.fields),
1543
- type: GraphQLRequestType.QUERY,
1544
- })
1545
- .subscribe({
1546
- next: (response) => {
1547
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1548
- if (this.logging) {
1549
- console.log('ModelFormComponent::get->value', response);
1550
- }
1551
- this.object = response;
1552
- this.form.patchValue(Object.assign({}, response));
1553
- // Process patchFields for reference input
1554
- for (const [key, value] of Object.entries(this.fields)) {
1555
- if (((_a = this.nestedObject(key, this.fields)) === null || _a === void 0 ? void 0 : _a.type) === 'DateTime' ||
1556
- ((_b = this.nestedObject(key, this.config)) === null || _b === void 0 ? void 0 : _b.type) === 'DateTime') {
1557
- this.form.get(key).patchValue(this.formatDate(this.nestedObject(key, response)));
1558
- }
1559
- // If it not an array
1560
- if (((_c = this.nestedObject(key, this.config)) === null || _c === void 0 ? void 0 : _c.type) === 'Reference' &&
1561
- !((_d = this.nestedObject(key, this.fields)) === null || _d === void 0 ? void 0 : _d.isList)) {
1562
- if (this.form.get(key)) {
1563
- this.form
1564
- .get(key)
1565
- .patchValue((_g = response[((_e = this.nestedObject(key, this.config)) === null || _e === void 0 ? void 0 : _e.patchField)
1566
- ? (_f = this.nestedObject(key, this.config)) === null || _f === void 0 ? void 0 : _f.patchField
1567
- : key]) === null || _g === void 0 ? void 0 : _g.id);
1568
- }
1569
- }
1570
- // If value is an array
1571
- if (((_h = this.nestedObject(key, this.config)) === null || _h === void 0 ? void 0 : _h.type) === 'Reference' &&
1572
- ((_j = this.nestedObject(key, this.fields)) === null || _j === void 0 ? void 0 : _j.isList)) {
1573
- if (this.form.get(key)) {
1574
- this.form
1575
- .get(key)
1576
- .patchValue((_m = response[((_k = this.nestedObject(key, this.config)) === null || _k === void 0 ? void 0 : _k.patchField)
1577
- ? (_l = this.nestedObject(key, this.config)) === null || _l === void 0 ? void 0 : _l.patchField
1578
- : key]) === null || _m === void 0 ? void 0 : _m.map((e) => e === null || e === void 0 ? void 0 : e.id));
1579
- }
1580
- }
1581
- }
1582
- if (this.logging) {
1583
- console.log('ModelFormComponent::getObjectById->patchedForm', this.form);
1584
- }
1585
- },
1586
- error: (err) => {
1587
- console.error('Error on load object', err);
1588
- this.finished.emit(null);
1589
- },
1590
- });
1591
- }
1592
- /**
1593
- * It takes a GraphQL type collection and returns an array of strings and objects
1594
- *
1595
- * @param fields - IGraphQLTypeCollection - This is the object that is returned from the
1596
- * introspection query.
1597
- * @returns An array of strings and objects.
1598
- */
1599
- createRequestObject(fields) {
1600
- var _a, _b, _c, _d, _e, _f, _g;
1601
- const requestFields = [];
1602
- for (const [key, value] of Object.entries(fields)) {
1603
- if (((_a = this.config[key]) === null || _a === void 0 ? void 0 : _a.exclude) !== undefined && ((_b = this.config[key]) === null || _b === void 0 ? void 0 : _b.exclude)) {
1604
- continue;
1605
- }
1606
- if (((_d = Object.keys((_c = fields[key]) === null || _c === void 0 ? void 0 : _c.fields)) === null || _d === void 0 ? void 0 : _d.length) === 0) {
1607
- if (((_e = this.config[key]) === null || _e === void 0 ? void 0 : _e.type) !== 'Reference') {
1608
- requestFields.push(key);
1609
- }
1610
- else {
1611
- requestFields.push({ [((_f = this.config[key]) === null || _f === void 0 ? void 0 : _f.patchField) ? (_g = this.config[key]) === null || _g === void 0 ? void 0 : _g.patchField : key]: ['id'] });
1612
- }
1613
- }
1614
- else {
1615
- const subkeys = this.createRequestObject(fields[key].fields);
1616
- const resultObject = {};
1617
- resultObject[key] = subkeys;
1618
- requestFields.push(resultObject);
1619
- }
1620
- }
1621
- if (this.logging) {
1622
- console.log('ModelFormComponent::createRequestObject->requestFields', requestFields);
1623
- }
1624
- return requestFields;
1625
- }
1626
- /**
1627
- * It takes a collection of GraphQL types and creates a form group with a form control for each type
1628
- *
1629
- * @param fields - IGraphQLTypeCollection
1630
- * @param parents
1631
- */
1632
- createForm(fields, parents = []) {
1633
- var _a;
1634
- const group = {};
1635
- let internParents = [...[], ...parents];
1636
- for (const [key, value] of Object.entries(fields)) {
1637
- if (((_a = Object.keys(value === null || value === void 0 ? void 0 : value.fields)) === null || _a === void 0 ? void 0 : _a.length) === 0) {
1638
- group[key] = new UntypedFormControl(null, this.processValidators(this.nestedObject(internParents.length ? internParents.join('.') + '.' + key : key, this.config), value));
1639
- }
1640
- else {
1641
- internParents.push(key);
1642
- group[key] = this.createForm(fields[key].fields, internParents);
1643
- internParents = [];
1644
- }
1645
- }
1646
- if (this.logging) {
1647
- console.log('ModelFormComponent::createForm->group', group);
1648
- }
1649
- return new UntypedFormGroup(group);
1650
- }
1651
- /**
1652
- * Process form validators for control
1653
- */
1654
- processValidators(config, value) {
1655
- const validators = [];
1656
- if (config) {
1657
- if ((config === null || config === void 0 ? void 0 : config.required) !== undefined ? config === null || config === void 0 ? void 0 : config.required : value.isRequired) {
1658
- validators.push(Validators.required);
1659
- }
1660
- if ((config === null || config === void 0 ? void 0 : config.type) === 'Email') {
1661
- validators.push(fullEmail());
1662
- }
1663
- if ((config === null || config === void 0 ? void 0 : config.type) === 'Password') {
1664
- validators.push(Validators.minLength(6));
1665
- }
1666
- if (typeof (config === null || config === void 0 ? void 0 : config.min) === 'number') {
1667
- validators.push(Validators.min(config.min));
1668
- }
1669
- if (typeof (config === null || config === void 0 ? void 0 : config.max) === 'number') {
1670
- validators.push(Validators.max(config.max));
1671
- }
1672
- if (Array.isArray(config === null || config === void 0 ? void 0 : config.validators)) {
1673
- validators.push(...config === null || config === void 0 ? void 0 : config.validators);
1674
- }
1675
- }
1676
- return validators;
1677
- }
1678
- /**
1679
- * It calls the graphQLService to delete the object with the id of the object that is currently being edited
1680
- */
1681
- deleteObject() {
1682
- this.cmsService.deleteObject(this.id, this.modelName).then(() => {
1683
- this.toastService.show({
1684
- id: this.modelName + '-success',
1685
- type: ToastType.SUCCESS,
1686
- title: 'Erfolgreich',
1687
- description: this.label + ' wurde erfolgreich gelöscht.',
1688
- });
1689
- this.finished.emit(null);
1690
- });
1691
- }
1692
- /**
1693
- * It sends a GraphQL mutation to the server to duplicate the object
1694
- */
1695
- duplicateObject() {
1696
- return __awaiter(this, void 0, void 0, function* () {
1697
- this.cmsService.duplicateObject(this.id, this.modelName).then((value) => __awaiter(this, void 0, void 0, function* () {
1698
- if (value === null || value === void 0 ? void 0 : value.id) {
1699
- yield this.router.navigate(['../'], { relativeTo: this.route });
1700
- this.toastService.show({
1701
- id: this.modelName + '-success',
1702
- type: ToastType.SUCCESS,
1703
- title: 'Erfolgreich',
1704
- description: this.label + ' wurde erfolgreich dupliziert.',
1705
- });
1706
- }
1707
- else {
1708
- this.finished.emit(null);
1709
- }
1710
- }));
1711
- });
1712
- }
1713
- /**
1714
- * It takes a string, capitalizes the first letter, and returns the modified string
1715
- *
1716
- * @param value - The string to capitalize.
1717
- * @returns The first letter of the string is being capitalized and the rest of the string is being returned.
1718
- */
1719
- capitalizeFirstLetter(value) {
1720
- return this.cmsService.capitalizeFirstLetter(value);
1721
- }
1722
- /**
1723
- * It takes an AbstractControl and returns a FormControl
1724
- *
1725
- * @param control - AbstractControl | null | undefined
1726
- * @returns A FormControl
1727
- */
1728
- transformToControl(control) {
1729
- return control;
1730
- }
1731
- /**
1732
- * It takes the key of the form control that has changed, gets the value of that form control, creates an object with the
1733
- * key and value, and then sends that object to the GraphQL server to update the database
1734
- */
1735
- imageChanged(key) {
1736
- const data = {};
1737
- data[key] = this.form.get(key).value;
1738
- if (this.logging) {
1739
- console.log('ModelFormComponent::imageChanged->body', data);
1740
- }
1741
- if (this.id) {
1742
- try {
1743
- this.graphQLService
1744
- .graphQl('update' + this.capitalizeFirstLetter(this.modelName), {
1745
- arguments: { id: this.id, input: data },
1746
- fields: ['id'],
1747
- type: GraphQLRequestType.MUTATION,
1748
- })
1749
- .subscribe({
1750
- next: (value) => {
1751
- if (this.logging) {
1752
- console.log('ModelFormComponent::imageChanged->success', value);
1753
- }
1754
- },
1755
- });
1756
- }
1757
- catch (e) {
1758
- if (this.logging) {
1759
- console.log('ModelFormComponent::imageChanged->error', e);
1760
- }
1761
- }
1762
- }
1763
- }
1764
- /**
1765
- * It takes the form, validates it, and then sends it to the GraphQL server
1766
- *
1767
- * @returns The id of the newly created or updated object.
1768
- */
1769
- submit(secret = false) {
1770
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1771
- var _a, _b, _c, _d, _e, _f, _g;
1772
- if (!secret) {
1773
- this.loading = true;
1774
- }
1775
- if (this.form.invalid && !secret) {
1776
- this.formsService.validateAllFormFields(this.form);
1777
- this.formsService.scrollToInvalidControl(this.form);
1778
- this.loading = false;
1779
- resolve(null);
1780
- return;
1781
- }
1782
- if (this.operation === 'update' && !this.id) {
1783
- console.error('ID is missing for update!');
1784
- this.loading = false;
1785
- resolve(null);
1786
- return;
1787
- }
1788
- if (this.logging) {
1789
- console.log('ModelFormComponent::submit->formValue', this.form.value);
1790
- }
1791
- // Prepare data for server request
1792
- let data = Object.assign({}, this.form.value);
1793
- data = this.prepareDataForRequest(this.config, this.fields, data);
1794
- if (this.logging) {
1795
- console.log('ModelFormComponent::submit->valueToGraphql', data);
1796
- console.log('ModelFormComponent::submit->fileChanges', this.fileChanges);
1797
- }
1798
- if ((_a = this.fileChanges) === null || _a === void 0 ? void 0 : _a.length) {
1799
- for (const fileChange of this.fileChanges) {
1800
- const key = fileChange.field;
1801
- const config = this.nestedObject(key, this.config);
1802
- if (fileChange.file) {
1803
- // Upload
1804
- const value = this.form.get(key).value;
1805
- // Check if file is an ID or a base64 string
1806
- if (typeof value === 'string') {
1807
- // Delete if ID
1808
- if (!((_b = this.form.get(key).value) === null || _b === void 0 ? void 0 : _b.startsWith('data:'))) {
1809
- const deleteResult = yield this.fileService.delete((_c = this.nestedObject(key, this.config)) === null || _c === void 0 ? void 0 : _c.url, ((_d = this.nestedObject(key, this.config)) === null || _d === void 0 ? void 0 : _d.deletePath) || '/files/', this.nestedObject(key, this.object));
1810
- if (deleteResult) {
1811
- this.nestedObject(key, data, '');
1812
- }
1813
- }
1814
- const uploadResult = yield this.fileService.upload((_e = this.nestedObject(key, this.config)) === null || _e === void 0 ? void 0 : _e.url, ((_f = this.nestedObject(key, this.config)) === null || _f === void 0 ? void 0 : _f.uploadPath) || '/files/upload', fileChange.file);
1815
- if (uploadResult === null || uploadResult === void 0 ? void 0 : uploadResult.id) {
1816
- this.nestedObject(key, data, uploadResult.id);
1817
- }
1818
- }
1819
- else if ((config === null || config === void 0 ? void 0 : config.imageMode) && (config === null || config === void 0 ? void 0 : config.imageMode) !== 'file') {
1820
- // Delete
1821
- const result = yield this.fileService.delete(config === null || config === void 0 ? void 0 : config.url, ((_g = this.nestedObject(key, this.config)) === null || _g === void 0 ? void 0 : _g.deletePath) || '/files/', this.nestedObject(key, this.object));
1822
- if (result) {
1823
- this.nestedObject(key, data, '');
1824
- }
1825
- }
1826
- }
1827
- }
1828
- }
1829
- this.graphQLService
1830
- .graphQl(this.operation + this.capitalizeFirstLetter(this.modelName), {
1831
- arguments: this.operation === 'update' ? { id: this.id, input: data } : { input: data },
1832
- fields: ['id'],
1833
- type: GraphQLRequestType.MUTATION,
1834
- })
1835
- .subscribe({
1836
- next: (value) => {
1837
- if (!secret) {
1838
- this.loading = false;
1839
- this.finished.emit(null);
1840
- this.toastService.show({
1841
- id: this.modelName + '-success',
1842
- type: ToastType.SUCCESS,
1843
- title: 'Erfolgreich',
1844
- description: this.label + ' wurde erfolgreich ' + (this.operation === 'create' ? 'erstellt.' : 'aktualisiert.'),
1845
- });
1846
- }
1847
- resolve(value);
1848
- },
1849
- error: (err) => {
1850
- if (!secret) {
1851
- console.error('Failed on ' + this.operation, err);
1852
- this.loading = false;
1853
- this.toastService.show({
1854
- id: this.modelName + '-success',
1855
- type: ToastType.ERROR,
1856
- description: 'Beim ' +
1857
- (this.operation === 'create' ? 'erstellen' : 'aktualisieren') +
1858
- ' von ' +
1859
- this.label +
1860
- ' ist etwas schiefgelaufen.',
1861
- });
1862
- }
1863
- reject();
1864
- },
1865
- });
1866
- }));
1867
- }
1868
- /**
1869
- * Prepare data for server
1870
- */
1871
- prepareDataForRequest(config, fieldsConfig, data) {
1872
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1873
- if (!data) {
1874
- return data;
1875
- }
1876
- for (const [key, value] of Object.entries(data)) {
1877
- if ((((_a = this.fields[key]) === null || _a === void 0 ? void 0 : _a.type) === 'DateTime' || ((_b = this.config[key]) === null || _b === void 0 ? void 0 : _b.type) === 'DateTime') && value === '') {
1878
- data[key] = null;
1879
- continue;
1880
- }
1881
- if ((((_c = config[key]) === null || _c === void 0 ? void 0 : _c.roles) ? !this.user.hasAllRoles((_d = config[key]) === null || _d === void 0 ? void 0 : _d.roles) : false) || ((_e = config[key]) === null || _e === void 0 ? void 0 : _e.exclude)) {
1882
- delete data[key];
1883
- continue;
1884
- }
1885
- if (value && typeof value === 'object' && !Array.isArray(value) && ((_f = this.fields[key]) === null || _f === void 0 ? void 0 : _f.type) !== 'Upload') {
1886
- data[key] = Object.keys(data[key])
1887
- .filter((k) => data[key][k] != null)
1888
- .reduce((a, k) => (Object.assign(Object.assign({}, a), { [k]: data[key][k] })), {});
1889
- if (((_g = Object.keys(data[key])) === null || _g === void 0 ? void 0 : _g.length) === 0) {
1890
- if (this.logging) {
1891
- console.log('Object is empty from result');
1892
- }
1893
- data[key] = null;
1894
- }
1895
- }
1896
- // Set type for graphql method
1897
- if (((_h = fieldsConfig[key]) === null || _h === void 0 ? void 0 : _h.type) === 'Float') {
1898
- if (value) {
1899
- data[key] = Number(value);
1900
- }
1901
- else {
1902
- data[key] = null;
1903
- }
1904
- }
1905
- if (((_j = fieldsConfig[key]) === null || _j === void 0 ? void 0 : _j.fields) && Object.keys((_k = fieldsConfig[key]) === null || _k === void 0 ? void 0 : _k.fields).length > 0) {
1906
- data[key] = this.prepareDataForRequest((_l = config[key]) === null || _l === void 0 ? void 0 : _l.fields, (_m = fieldsConfig[key]) === null || _m === void 0 ? void 0 : _m.fields, data[key]);
1907
- }
1908
- }
1909
- return data;
1910
- }
1911
- /**
1912
- * Init fab buttons for mobile devices
1913
- */
1914
- initFabActions() {
1915
- const saveEvent = new EventEmitter();
1916
- this.fabButtons.push({ icon: 'bi-check-lg', color: 'var(--bs-success)', event: saveEvent });
1917
- saveEvent.subscribe(() => this.submit(false));
1918
- if (this.duplicate && this.operation === 'update') {
1919
- const event = new EventEmitter();
1920
- this.fabButtons.push({ icon: 'bi-back', color: 'var(--bs-info)', event });
1921
- event.subscribe(() => this.duplicateObject());
1922
- }
1923
- if (this.operation === 'update' && this.delete) {
1924
- const event = new EventEmitter();
1925
- this.fabButtons.push({ icon: 'bi-trash3', color: 'var(--bs-danger)', event });
1926
- event.subscribe(() => this.deleteObject());
1927
- }
1928
- }
1929
- /**
1930
- * Set file changes for process
1931
- */
1932
- processFileChanges(event) {
1933
- var _a;
1934
- const index = (_a = this.fileChanges) === null || _a === void 0 ? void 0 : _a.findIndex((e) => e.field === event.field);
1935
- if (index !== undefined && index !== -1) {
1936
- this.fileChanges[index] = event;
1937
- }
1938
- else if (this.fileChanges) {
1939
- this.fileChanges.push(event);
1940
- }
1941
- else {
1942
- this.fileChanges = [event];
1943
- }
1944
- }
1945
- formatDate(date) {
1946
- if (!date) {
1947
- return null;
1948
- }
1949
- const newDate = new Date(date);
1950
- return newDate.toISOString().substring(0, 16);
1951
- }
1952
- nestedObject(key, nestedObject, value) {
1953
- var _a, _b, _c, _d;
1954
- const props = key.split('.');
1955
- let result = nestedObject;
1956
- for (let i = 0; i < props.length; i++) {
1957
- if (value && i === props.length - 1) {
1958
- result[props[i]] = value;
1959
- return result[props[i]];
1960
- }
1961
- result =
1962
- ((_a = result[props[i]]) === null || _a === void 0 ? void 0 : _a.fields) && ((_c = Object.keys((_b = result[props[i]]) === null || _b === void 0 ? void 0 : _b.fields)) === null || _c === void 0 ? void 0 : _c.length) > 0
1963
- ? (_d = result[props[i]]) === null || _d === void 0 ? void 0 : _d.fields
1964
- : result[props[i]];
1965
- }
1966
- return result;
1967
- }
1968
- }
1969
- ModelFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModelFormComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }, { token: i1$1.FormsService }, { token: i1$1.AuthService }, { token: i2$1.Router }, { token: i2$1.ActivatedRoute }, { token: i1$1.CmsService }, { token: i1$1.ToastService }, { token: i1$1.FileService }], target: i0.ɵɵFactoryTarget.Component });
1970
- ModelFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ModelFormComponent, selector: "base-model-form", inputs: { modelName: "modelName", label: "label", id: "id", delete: "delete", onlyUpdateMode: "onlyUpdateMode", duplicate: "duplicate", logging: "logging", config: "config", showFavButton: "showFavButton" }, outputs: { finished: "finished" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"w-100\" *ngIf=\"form\">\n <div class=\"d-flex flex-row justify-content-between mt-3\">\n <div class=\"responsive-back d-flex d-lg-none\">\n <i class=\"bi bi-arrow-left\" routerLink=\"../\"></i>\n </div>\n <h2 class=\"mb-0\">\n {{ label ? label : capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}\n </h2>\n\n <div class=\"d-none d-lg-flex flex-row align-items-center justify-content-end\">\n <button class=\"btn btn-outline-primary me-2\" *ngIf=\"id && duplicate && !_loading\" (click)=\"duplicateObject()\">\n Duplizieren\n </button>\n <button\n class=\"btn btn-primary\"\n type=\"button\"\n [disabled]=\"!form.touched && !form.dirty\"\n (click)=\"submit(false)\"\n *ngIf=\"!_loading\"\n >\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"_loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n\n <form [formGroup]=\"form\">\n <base-model-form-sub\n [id]=\"id\"\n [fields]=\"fields\"\n [config]=\"config\"\n [form]=\"form\"\n (imageChanged)=\"imageChanged($event)\"\n (fileChanged)=\"processFileChanges($event)\"\n ></base-model-form-sub>\n\n <div class=\"d-none d-lg-flex mt-4\" [ngClass]=\"id && delete ? 'justify-content-between' : 'justify-content-end'\">\n <div *ngIf=\"id && delete\">\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteObject()\">L\u00F6schen</button>\n </div>\n <div>\n <button\n class=\"btn btn-primary\"\n type=\"button\"\n [disabled]=\"!form.touched && !form.dirty\"\n (click)=\"submit(false)\"\n *ngIf=\"!_loading\"\n >\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"_loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n </form>\n</div>\n\n<div class=\"d-block d-lg-none responsive-action-button\" *ngIf=\"showFavButton\">\n <base-fab-button [buttons]=\"fabButtons\"></base-fab-button>\n</div>\n", styles: [".responsive-back{display:flex;align-items:center;margin-right:6px}.responsive-back .bi-arrow-left{font-size:28px}h2{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.responsive-action-button{position:fixed;bottom:15px;right:15px;z-index:100}\n"], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: ["id", "parentKey", "fields", "form", "config"], outputs: ["imageChanged", "fileChanged"] }, { kind: "component", type: FabButtonComponent, selector: "base-fab-button", inputs: ["fabIcon", "buttons"] }] });
1971
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModelFormComponent, decorators: [{
1972
- type: Component,
1973
- args: [{ selector: 'base-model-form', template: "<div class=\"w-100\" *ngIf=\"form\">\n <div class=\"d-flex flex-row justify-content-between mt-3\">\n <div class=\"responsive-back d-flex d-lg-none\">\n <i class=\"bi bi-arrow-left\" routerLink=\"../\"></i>\n </div>\n <h2 class=\"mb-0\">\n {{ label ? label : capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}\n </h2>\n\n <div class=\"d-none d-lg-flex flex-row align-items-center justify-content-end\">\n <button class=\"btn btn-outline-primary me-2\" *ngIf=\"id && duplicate && !_loading\" (click)=\"duplicateObject()\">\n Duplizieren\n </button>\n <button\n class=\"btn btn-primary\"\n type=\"button\"\n [disabled]=\"!form.touched && !form.dirty\"\n (click)=\"submit(false)\"\n *ngIf=\"!_loading\"\n >\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"_loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n\n <form [formGroup]=\"form\">\n <base-model-form-sub\n [id]=\"id\"\n [fields]=\"fields\"\n [config]=\"config\"\n [form]=\"form\"\n (imageChanged)=\"imageChanged($event)\"\n (fileChanged)=\"processFileChanges($event)\"\n ></base-model-form-sub>\n\n <div class=\"d-none d-lg-flex mt-4\" [ngClass]=\"id && delete ? 'justify-content-between' : 'justify-content-end'\">\n <div *ngIf=\"id && delete\">\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteObject()\">L\u00F6schen</button>\n </div>\n <div>\n <button\n class=\"btn btn-primary\"\n type=\"button\"\n [disabled]=\"!form.touched && !form.dirty\"\n (click)=\"submit(false)\"\n *ngIf=\"!_loading\"\n >\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"_loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n </form>\n</div>\n\n<div class=\"d-block d-lg-none responsive-action-button\" *ngIf=\"showFavButton\">\n <base-fab-button [buttons]=\"fabButtons\"></base-fab-button>\n</div>\n", styles: [".responsive-back{display:flex;align-items:center;margin-right:6px}.responsive-back .bi-arrow-left{font-size:28px}h2{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.responsive-action-button{position:fixed;bottom:15px;right:15px;z-index:100}\n"] }]
1974
- }], ctorParameters: function () { return [{ type: i1$1.GraphQLMetaService }, { type: i1$1.GraphQLService }, { type: i1$1.FormsService }, { type: i1$1.AuthService }, { type: i2$1.Router }, { type: i2$1.ActivatedRoute }, { type: i1$1.CmsService }, { type: i1$1.ToastService }, { type: i1$1.FileService }]; }, propDecorators: { modelName: [{
1975
- type: Input
1976
- }], label: [{
1977
- type: Input
1978
- }], id: [{
1979
- type: Input
1980
- }], delete: [{
1981
- type: Input
1982
- }], onlyUpdateMode: [{
1983
- type: Input
1984
- }], duplicate: [{
1985
- type: Input
1986
- }], logging: [{
1987
- type: Input
1988
- }], config: [{
1989
- type: Input
1990
- }], showFavButton: [{
1991
- type: Input
1992
- }], finished: [{
1993
- type: Output
1994
- }] } });
1995
-
1996
- /**
1997
- * Truncate string with ellipses
1998
- */
1999
- class EllipsesPipe {
2000
- transform(value, limit) {
2001
- if (!value) {
2002
- return null;
2003
- }
2004
- return value.length > limit ? value.substring(0, limit) + '...' : value;
2005
- }
2006
- }
2007
- EllipsesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: EllipsesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2008
- EllipsesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: EllipsesPipe, name: "baseEllipses" });
2009
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: EllipsesPipe, decorators: [{
2010
- type: Pipe,
2011
- args: [{
2012
- name: 'baseEllipses',
2013
- }]
2014
- }] });
2015
-
2016
- class ModelTableComponent {
2017
- constructor(graphQLMetaService, graphQLService, cmsService, toastService, scrollService) {
2018
- this.graphQLMetaService = graphQLMetaService;
2019
- this.graphQLService = graphQLService;
2020
- this.cmsService = cmsService;
2021
- this.toastService = toastService;
2022
- this.scrollService = scrollService;
2023
- this.createMode = false;
2024
- this.logging = false;
2025
- this.create = true;
2026
- this.update = true;
2027
- this.delete = true;
2028
- this.import = true;
2029
- this.export = true;
2030
- this.duplicate = true;
2031
- this.modelConfig = null;
2032
- this.showFavButton = false;
2033
- this.idSelected = new EventEmitter();
2034
- this.createModeChanged = new EventEmitter();
2035
- this.uniqueField = 'id';
2036
- this.tableFields = {
2037
- id: { label: 'ID' },
2038
- name: { label: 'Name' },
2039
- title: { label: 'Titel' },
2040
- description: { label: 'Beschreibung' },
2041
- email: { label: 'E-Mail' },
2042
- createdAt: { label: 'Erstellt am', dateFormat: 'dd.MM.YYYY HH:mm' },
2043
- updatedAt: { label: 'Bearbeitet am', dateFormat: 'dd.MM.YYYY HH:mm' },
2044
- };
2045
- this.objects = [];
2046
- this.availableFields = [];
2047
- this.id = '';
2048
- this.queryName = null;
2049
- this.possibleFields = {};
2050
- this.componentRef = undefined;
2051
- this.selectedPageIndex = 0;
2052
- this.pages = [];
2053
- }
2054
- ngAfterViewInit() {
2055
- // Needed time out to prevent ExpressionChangedAfterItHasBeenCheckedError
2056
- setTimeout(() => {
2057
- this.integrateCustomFormComponent();
2058
- }, 10);
2059
- }
2060
- ngOnInit() {
2061
- this.graphQLMetaService.getMeta().subscribe((meta) => {
2062
- this.meta = meta;
2063
- if (this.modelName) {
2064
- this.init();
2065
- }
2066
- if (this.objectId) {
2067
- this.id = this.objectId;
2068
- // Needed time out for rerender
2069
- setTimeout(() => {
2070
- this.integrateCustomFormComponent();
2071
- }, 10);
2072
- }
2073
- });
2074
- }
2075
- ngOnChanges(changes) {
2076
- if (changes['modelName'] && this.meta) {
2077
- this.init();
2078
- }
2079
- if (changes['objectId'] && this.meta) {
2080
- if (this.id !== this.objectId) {
2081
- if (this.logging) {
2082
- console.log('ModelTableComponent::ngOnChanges->selectedId', this.id);
2083
- }
2084
- this.id = this.objectId;
2085
- }
2086
- }
2087
- this.setChangesInComponentRef();
2088
- }
2089
- /**
2090
- * We're using the `meta` service to get the fields that are available for the `find` query for the model we're working
2091
- * with. We're then using that information to populate the `availableFields` array
2092
- */
2093
- init() {
2094
- var _a, _b, _c, _d, _e, _f;
2095
- return __awaiter(this, void 0, void 0, function* () {
2096
- this.availableFields = [];
2097
- this.pages = [];
2098
- this.totalCount = null;
2099
- this.camelModelName = this.kebabToCamelCase(this.modelName);
2100
- // Set query name
2101
- if (!((_a = this.modelConfig) === null || _a === void 0 ? void 0 : _a.queryName)) {
2102
- this.queryName = 'findAndCount' + this.capitalizeFirstLetter(this.camelModelName) + 's';
2103
- }
2104
- else {
2105
- this.queryName = (_b = this.modelConfig) === null || _b === void 0 ? void 0 : _b.queryName;
2106
- }
2107
- if ((_c = this.modelConfig) === null || _c === void 0 ? void 0 : _c.tableFields) {
2108
- this.tableFields = this.modelConfig.tableFields;
2109
- }
2110
- if (this.logging) {
2111
- console.log('ModelTableComponent::init->modelName', this.modelName);
2112
- console.log('ModelTableComponent::init->camelModelName', this.camelModelName);
2113
- console.log('ModelTableComponent::init->queryName', this.queryName);
2114
- console.log('ModelTableComponent::init->tableFields', this.tableFields);
2115
- }
2116
- this.possibleFields = this.meta.getFields(this.queryName).fields;
2117
- let keys;
2118
- if (((_d = this.possibleFields) === null || _d === void 0 ? void 0 : _d.items) && Object.keys((_f = (_e = this.possibleFields) === null || _e === void 0 ? void 0 : _e.items) === null || _f === void 0 ? void 0 : _f.fields).length > 0) {
2119
- keys = Object.keys(this.possibleFields.items.fields);
2120
- }
2121
- else {
2122
- keys = Object.keys(this.possibleFields);
2123
- }
2124
- const tableFieldKeys = Object.keys(this.tableFields);
2125
- tableFieldKeys === null || tableFieldKeys === void 0 ? void 0 : tableFieldKeys.forEach((field) => {
2126
- if (keys.includes(field)) {
2127
- this.availableFields.push(field);
2128
- }
2129
- });
2130
- if (this.logging) {
2131
- console.log('ModelTableComponent::init->possibleFields', this.possibleFields);
2132
- console.log('ModelTableComponent::init->keys', keys);
2133
- console.log('ModelTableComponent::init->availableFields', this.availableFields);
2134
- }
2135
- this.selectedPageIndex = 0;
2136
- this.objects = yield this.loadObjects(this.availableFields, 0, 25);
2137
- });
2138
- }
2139
- integrateCustomFormComponent() {
2140
- var _a, _b;
2141
- if (!this.customFormTemplate || this.componentRef) {
2142
- return;
2143
- }
2144
- const customComponent = (_a = this.modelConfig) === null || _a === void 0 ? void 0 : _a.customTemplateComponent;
2145
- if (customComponent) {
2146
- this.componentRef = (_b = this.customFormTemplate) === null || _b === void 0 ? void 0 : _b.createComponent(customComponent);
2147
- this.setChangesInComponentRef();
2148
- this.componentRef.instance.finished.subscribe(() => {
2149
- this.selectId('');
2150
- });
2151
- }
2152
- }
2153
- setChangesInComponentRef() {
2154
- var _a;
2155
- if (this.componentRef) {
2156
- const data = {
2157
- config: this.config,
2158
- delete: this.delete,
2159
- duplicate: this.duplicate,
2160
- id: this.id,
2161
- label: (_a = this.modelConfig) === null || _a === void 0 ? void 0 : _a.label,
2162
- logging: this.logging,
2163
- modelName: this.camelModelName,
2164
- showFavButton: this.showFavButton,
2165
- };
2166
- for (const [key, value] of Object.entries(data)) {
2167
- this.componentRef.setInput(key, value);
2168
- }
2169
- }
2170
- }
2171
- /**
2172
- * When the user clicks the "Create New" button, the createModeChanged event is emitted, which is then handled by the
2173
- * parent component
2174
- */
2175
- createNewObject() {
2176
- this.createMode = true;
2177
- this.createModeChanged.emit(true);
2178
- }
2179
- /**
2180
- * It loads the objects from the database and stores them in the objects variable
2181
- *
2182
- * @param fields - string[] - The fields you want to load from the database.
2183
- * @param skip
2184
- * @param limit
2185
- */
2186
- loadObjects(fields, skip = 0, limit = 25) {
2187
- return new Promise((resolve, reject) => {
2188
- const requestFields = [...fields];
2189
- const idInFields = requestFields.find((e) => e === 'id');
2190
- if (!idInFields) {
2191
- requestFields.push('id');
2192
- }
2193
- const isFindAndCount = this.queryName.includes('findAndCount');
2194
- this.graphQLService
2195
- .graphQl(this.queryName, {
2196
- arguments: {
2197
- sort: [{ field: 'createdAt', order: SortOrderEnum.ASC }],
2198
- limit: isFindAndCount ? limit : null,
2199
- skip: isFindAndCount ? skip : null,
2200
- },
2201
- fields: isFindAndCount ? ['totalCount', { items: requestFields }] : requestFields,
2202
- type: GraphQLRequestType.QUERY,
2203
- })
2204
- .subscribe({
2205
- next: (value) => {
2206
- let items;
2207
- if (this.logging) {
2208
- console.log('ModelTableComponent::loadObjects->value', value);
2209
- }
2210
- if ((value === null || value === void 0 ? void 0 : value.totalCount) >= 0) {
2211
- items = value.items;
2212
- this.totalCount = value.totalCount;
2213
- this.pages = [];
2214
- let numbers = 0;
2215
- while (numbers < this.totalCount) {
2216
- this.pages.push({
2217
- skip: numbers,
2218
- limit: 25,
2219
- });
2220
- numbers = numbers + 25;
2221
- }
2222
- }
2223
- else {
2224
- items = value;
2225
- }
2226
- resolve(items);
2227
- },
2228
- error: (err) => {
2229
- console.log('Error on loading objects', err);
2230
- reject(err);
2231
- },
2232
- });
2233
- });
2234
- }
2235
- /**
2236
- * If the update property is true, then set the selectedId property to the id of the object passed in, and emit the
2237
- * selectedId property
2238
- */
2239
- selectId(object) {
2240
- if (!object) {
2241
- this.createMode = false;
2242
- this.createModeChanged.emit(false);
2243
- }
2244
- if (this.update) {
2245
- this.id = object['id'];
2246
- this.idSelected.emit(this.id);
2247
- }
2248
- }
2249
- /**
2250
- * It calls the duplicateObject function in the cmsService, passing in the id of the object to be duplicated and the
2251
- * modelName of the object
2252
- */
2253
- duplicateObject(id) {
2254
- return __awaiter(this, void 0, void 0, function* () {
2255
- yield this.cmsService.duplicateObject(id, this.camelModelName);
2256
- this.selectedPageIndex = 0;
2257
- this.objects = yield this.loadObjects(this.availableFields, this.pages[this.selectedPageIndex].skip, this.pages[this.selectedPageIndex].limit);
2258
- });
2259
- }
2260
- /**
2261
- * It calls the deleteObject function in the cmsService, passing in the id of the object to delete and the name of the
2262
- * model
2263
- */
2264
- deleteObject(id) {
2265
- return __awaiter(this, void 0, void 0, function* () {
2266
- yield this.cmsService.deleteObject(id, this.camelModelName);
2267
- this.selectedPageIndex = 0;
2268
- this.objects = yield this.loadObjects(this.availableFields, this.pages[this.selectedPageIndex].skip, this.pages[this.selectedPageIndex].limit);
2269
- });
2270
- }
2271
- /**
2272
- * It takes a string, capitalizes the first letter, and returns the modified string
2273
- */
2274
- capitalizeFirstLetter(value) {
2275
- return this.cmsService.capitalizeFirstLetter(value);
2276
- }
2277
- /**
2278
- * Kebab to camel case string
2279
- */
2280
- kebabToCamelCase(str) {
2281
- return str.replace(/-./g, (match) => match[1].toUpperCase());
2282
- }
2283
- /**
2284
- * Import objects from json file
2285
- */
2286
- processImport(event) {
2287
- // Create a new FileReader() object
2288
- const reader = new FileReader();
2289
- // Setup the callback event to run when the file is read
2290
- reader.onload = (readerEvent) => __awaiter(this, void 0, void 0, function* () {
2291
- let jsonResult = JSON.parse(readerEvent.target.result);
2292
- if (!Array.isArray(jsonResult)) {
2293
- jsonResult = [jsonResult];
2294
- }
2295
- for (let i = 0; i < jsonResult.length; i++) {
2296
- try {
2297
- this.graphQLService
2298
- .graphQl('create' + this.capitalizeFirstLetter(this.modelName), {
2299
- arguments: { input: jsonResult[i] },
2300
- fields: ['id'],
2301
- type: GraphQLRequestType.MUTATION,
2302
- })
2303
- .subscribe({
2304
- next: () => __awaiter(this, void 0, void 0, function* () {
2305
- this.toastService.show({
2306
- id: this.modelName + '-' + i + '-success',
2307
- type: ToastType.SUCCESS,
2308
- title: 'Erfolgreich',
2309
- description: 'Element ' + (i + 1) + ' von ' + jsonResult.length + ' erfolgreich importiert.',
2310
- });
2311
- if (i === jsonResult.length - 1) {
2312
- this.selectedPageIndex = 0;
2313
- this.objects = yield this.loadObjects(this.availableFields, this.pages[this.selectedPageIndex].skip, this.pages[this.selectedPageIndex].limit);
2314
- }
2315
- }),
2316
- error: () => {
2317
- this.toastService.show({
2318
- id: this.modelName + '-' + i + '-error',
2319
- type: ToastType.ERROR,
2320
- title: 'Error',
2321
- description: 'Element ' + (i + 1) + ' von ' + jsonResult.length + ' konnte nicht importiert werden.',
2322
- });
2323
- },
2324
- });
2325
- }
2326
- catch (e) {
2327
- this.toastService.show({
2328
- id: this.modelName + '-' + i + '-error',
2329
- type: ToastType.ERROR,
2330
- title: 'Error',
2331
- description: 'Element ' + (i + 1) + ' von ' + jsonResult.length + ' konnte nicht importiert werden.',
2332
- });
2333
- }
2334
- }
2335
- });
2336
- // Read the file
2337
- reader.readAsText(event.target.files[0]);
2338
- }
2339
- /**
2340
- * Export objects as json
2341
- */
2342
- processExport() {
2343
- return __awaiter(this, void 0, void 0, function* () {
2344
- const keys = this.getAllKeys();
2345
- const items = yield this.loadObjects(keys, this.pages[this.selectedPageIndex].skip, this.pages[this.selectedPageIndex].limit);
2346
- const data = JSON.stringify(items);
2347
- const blob = new Blob([data], { type: 'text/json;charset=utf-8;' });
2348
- const url = URL.createObjectURL(blob);
2349
- const link = document.createElement('a');
2350
- link.setAttribute('href', url);
2351
- link.setAttribute('download', this.modelName + 's.json');
2352
- document.body.appendChild(link);
2353
- link.click();
2354
- });
2355
- }
2356
- /**
2357
- * Get all keys for request to export objects as json
2358
- */
2359
- getAllKeys() {
2360
- const items = [];
2361
- for (const [key, value] of Object.entries(this.possibleFields)) {
2362
- if (!this.possibleFields[key].fields || Object.keys(this.possibleFields[key].fields).length === 0) {
2363
- items.push(key);
2364
- }
2365
- }
2366
- return items;
2367
- }
2368
- selectPage(i) {
2369
- return __awaiter(this, void 0, void 0, function* () {
2370
- this.selectedPageIndex = i;
2371
- yield this.scrollService.scrollTo('model-table-top');
2372
- this.objects = yield this.loadObjects(this.availableFields, this.pages[this.selectedPageIndex].skip, this.pages[this.selectedPageIndex].limit);
2373
- });
2374
- }
2375
- }
2376
- ModelTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModelTableComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }, { token: i1$1.CmsService }, { token: i1$1.ToastService }, { token: i1$1.ScrollService }], target: i0.ɵɵFactoryTarget.Component });
2377
- ModelTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ModelTableComponent, selector: "base-model-table", inputs: { modelName: "modelName", objectId: "objectId", createMode: "createMode", logging: "logging", create: "create", update: "update", delete: "delete", import: "import", export: "export", duplicate: "duplicate", modelConfig: "modelConfig", config: "config", showFavButton: "showFavButton" }, outputs: { idSelected: "idSelected", createModeChanged: "createModeChanged" }, viewQueries: [{ propertyName: "customFormTemplate", first: true, predicate: ["customFormTemplate"], descendants: true, read: ViewContainerRef }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"!id && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between align-items-center mb-2 mb-lg-4\">\n <h2 id=\"model-table-top\" class=\"mb-0\" *ngIf=\"modelName\">\n {{\n modelConfig?.plural\n ? modelConfig?.plural\n : modelConfig?.label\n ? modelConfig?.label\n : capitalizeFirstLetter(camelModelName) + 's'\n }}\n </h2>\n <div class=\"d-flex align-items-center d-none d-lg-block\">\n <input #importFile type=\"file\" accept=\".json\" class=\"d-none\" (change)=\"processImport($event)\" />\n <div class=\"btn-group me-4\" *ngIf=\"import || export\">\n <i\n class=\"bi bi-three-dots-vertical\"\n id=\"settingsDropdown\"\n type=\"button\"\n data-bs-toggle=\"dropdown\"\n data-bs-auto-close=\"true\"\n aria-expanded=\"false\"\n ></i>\n <ul class=\"dropdown-menu dropdown-menu-end\" aria-labelledby=\"settingsDropdown\">\n <li><a class=\"dropdown-item cursor-pointer\" *ngIf=\"export\" (click)=\"processExport()\">Export</a></li>\n <li><a class=\"dropdown-item cursor-pointer\" *ngIf=\"import\" (click)=\"importFile.click()\"> Import </a></li>\n </ul>\n </div>\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n\n <div\n class=\"table-responsive\"\n [ltContextMenu]=\"contextMenu\"\n [selectors]=\"'.object-col'\"\n #contextMenuData=\"contextMenuData\"\n >\n <table class=\"table table-hover bg-white d-none d-lg-table\">\n <thead>\n <tr>\n <th\n scope=\"col\"\n *ngFor=\"let field of availableFields\"\n [baseSort]=\"objects\"\n data-order=\"desc\"\n [attr.data-name]=\"field\"\n >\n {{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"object-col\" *ngFor=\"let object of objects\" [id]=\"object[uniqueField]\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n <ng-container *ngIf=\"tableFields[field]?.dateFormat\">\n {{ object[field] | date: tableFields[field]?.dateFormat }} Uhr\n </ng-container>\n\n <ng-container *ngIf=\"tableFields[field]?.enumValues\">\n {{ tableFields[field]?.enumValues[object[field]]?.text }}\n </ng-container>\n\n <ng-container *ngIf=\"!tableFields[field]?.dateFormat && !tableFields[field]?.enumValues\">\n {{ object[field] | baseEllipses: 60 }}\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n\n <div class=\"d-flex d-lg-none flex-column flex-grow-1\">\n <div class=\"table-card\" *ngFor=\"let object of objects\" [id]=\"object[uniqueField]\">\n <div class=\"table-card-entry\" *ngFor=\"let field of availableFields; let i = index\" (click)=\"selectId(object)\">\n <b *ngIf=\"i > 0\"\n >{{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}:</b\n >\n <p [ngClass]=\"{ 'table-card-entry-first': i === 0 }\">\n <ng-container *ngIf=\"tableFields[field]?.dateFormat\">\n {{ object[field] | date: tableFields[field]?.dateFormat }} Uhr\n </ng-container>\n\n <ng-container *ngIf=\"tableFields[field]?.enumValues\">\n {{ tableFields[field]?.enumValues[object[field]]?.text }}\n </ng-container>\n\n <ng-container *ngIf=\"!tableFields[field]?.dateFormat && !tableFields[field]?.enumValues\">\n {{ object[field] | baseEllipses: 60 }}\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n\n <nav *ngIf=\"totalCount >= 0\">\n <ul class=\"pagination justify-content-center\">\n <li class=\"page-item\">\n <a\n class=\"page-link\"\n (click)=\"selectPage(selectedPageIndex - 1)\"\n aria-label=\"Previous\"\n [ngClass]=\"{ disabled: selectedPageIndex - 1 > 0 }\"\n >\n <span aria-hidden=\"true\">&laquo;</span>\n </a>\n </li>\n <li class=\"page-item\" *ngFor=\"let page of pages; let i = index\">\n <a class=\"page-link\" [ngClass]=\"{ active: selectedPageIndex === i }\" (click)=\"selectPage(i)\">{{ i + 1 }}</a>\n </li>\n <li class=\"page-item\">\n <a\n class=\"page-link\"\n (click)=\"selectPage(selectedPageIndex + 1)\"\n aria-label=\"Next\"\n [ngClass]=\"{ disabled: pages[selectedPageIndex + 1] }\"\n >\n <span aria-hidden=\"true\">&raquo;</span>\n </a>\n </li>\n </ul>\n </nav>\n\n <div class=\"context-menu\" #contextMenu>\n <div class=\"context-menu-item\" (click)=\"selectId({ id: contextMenuData.clickedElement?.id })\">Bearbeiten</div>\n <div class=\"context-menu-item\" *ngIf=\"duplicate\" (click)=\"duplicateObject(contextMenuData.clickedElement?.id)\">\n Duplizieren\n </div>\n <div class=\"context-menu-item\" *ngIf=\"delete\" (click)=\"deleteObject(contextMenuData.clickedElement?.id)\">\n L\u00F6schen\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"w-100\" *ngIf=\"id || createMode\">\n <button class=\"d-none d-lg-block btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n *ngIf=\"!modelConfig?.customTemplateComponent\"\n [modelName]=\"camelModelName\"\n [label]=\"modelConfig?.label\"\n [config]=\"config\"\n [logging]=\"logging\"\n [id]=\"id\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n [duplicate]=\"duplicate\"\n [showFavButton]=\"showFavButton\"\n ></base-model-form>\n <ng-template *ngIf=\"modelConfig?.customTemplateComponent\" #customFormTemplate></ng-template>\n</div>\n\n<div class=\"responsive-action-button d-block d-lg-none\">\n <base-fab-button\n [fabIcon]=\"'bi-plus'\"\n (click)=\"createNewObject()\"\n *ngIf=\"!(id || createMode) && showFavButton\"\n ></base-fab-button>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.asc:after,.desc:after{border-style:solid;border-width:.2em .2em 0 0;content:\"\";display:inline-block;height:.45em;left:5px;position:relative;transform:rotate(-45deg);vertical-align:middle;width:.45em}.asc:after{transform:rotate(135deg)}td{vertical-align:middle}.bi,th{cursor:pointer;-webkit-user-select:none;user-select:none}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}.context-menu{opacity:.01%;pointer-events:none;background-color:#fff;border:1px solid #ccc;box-shadow:1px 1px 10px #0000001a;padding:10px 0;position:fixed;top:0;left:0;width:200px}.context-menu-item{cursor:pointer;padding:8px 15px}.context-menu-item:hover{color:var(--bs-primary)}.table-card{background:var(--bs-white);padding:10px;margin-bottom:10px}.table-card-entry{margin-top:4px}.table-card-entry-first{font-size:18px;font-weight:800;color:var(--bs-primary)}.responsive-action-button{position:fixed;bottom:15px;right:15px}.bi-three-dots-vertical{font-size:18px;line-height:18px}.page-item{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: SortDirective, selector: "[baseSort]", inputs: ["baseSort"] }, { kind: "directive", type: ContextMenuDirective, selector: "[ltContextMenu]", inputs: ["contextMenuData", "ltContextMenu", "xGap", "yGap", "overflowSpace", "selectors"], outputs: ["clickedElement"], exportAs: ["contextMenuData"] }, { kind: "component", type: ModelFormComponent, selector: "base-model-form", inputs: ["modelName", "label", "id", "delete", "onlyUpdateMode", "duplicate", "logging", "config", "showFavButton"], outputs: ["finished"] }, { kind: "component", type: FabButtonComponent, selector: "base-fab-button", inputs: ["fabIcon", "buttons"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: EllipsesPipe, name: "baseEllipses" }] });
2378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModelTableComponent, decorators: [{
2379
- type: Component,
2380
- args: [{ selector: 'base-model-table', template: "<div *ngIf=\"!id && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between align-items-center mb-2 mb-lg-4\">\n <h2 id=\"model-table-top\" class=\"mb-0\" *ngIf=\"modelName\">\n {{\n modelConfig?.plural\n ? modelConfig?.plural\n : modelConfig?.label\n ? modelConfig?.label\n : capitalizeFirstLetter(camelModelName) + 's'\n }}\n </h2>\n <div class=\"d-flex align-items-center d-none d-lg-block\">\n <input #importFile type=\"file\" accept=\".json\" class=\"d-none\" (change)=\"processImport($event)\" />\n <div class=\"btn-group me-4\" *ngIf=\"import || export\">\n <i\n class=\"bi bi-three-dots-vertical\"\n id=\"settingsDropdown\"\n type=\"button\"\n data-bs-toggle=\"dropdown\"\n data-bs-auto-close=\"true\"\n aria-expanded=\"false\"\n ></i>\n <ul class=\"dropdown-menu dropdown-menu-end\" aria-labelledby=\"settingsDropdown\">\n <li><a class=\"dropdown-item cursor-pointer\" *ngIf=\"export\" (click)=\"processExport()\">Export</a></li>\n <li><a class=\"dropdown-item cursor-pointer\" *ngIf=\"import\" (click)=\"importFile.click()\"> Import </a></li>\n </ul>\n </div>\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n\n <div\n class=\"table-responsive\"\n [ltContextMenu]=\"contextMenu\"\n [selectors]=\"'.object-col'\"\n #contextMenuData=\"contextMenuData\"\n >\n <table class=\"table table-hover bg-white d-none d-lg-table\">\n <thead>\n <tr>\n <th\n scope=\"col\"\n *ngFor=\"let field of availableFields\"\n [baseSort]=\"objects\"\n data-order=\"desc\"\n [attr.data-name]=\"field\"\n >\n {{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"object-col\" *ngFor=\"let object of objects\" [id]=\"object[uniqueField]\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n <ng-container *ngIf=\"tableFields[field]?.dateFormat\">\n {{ object[field] | date: tableFields[field]?.dateFormat }} Uhr\n </ng-container>\n\n <ng-container *ngIf=\"tableFields[field]?.enumValues\">\n {{ tableFields[field]?.enumValues[object[field]]?.text }}\n </ng-container>\n\n <ng-container *ngIf=\"!tableFields[field]?.dateFormat && !tableFields[field]?.enumValues\">\n {{ object[field] | baseEllipses: 60 }}\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n\n <div class=\"d-flex d-lg-none flex-column flex-grow-1\">\n <div class=\"table-card\" *ngFor=\"let object of objects\" [id]=\"object[uniqueField]\">\n <div class=\"table-card-entry\" *ngFor=\"let field of availableFields; let i = index\" (click)=\"selectId(object)\">\n <b *ngIf=\"i > 0\"\n >{{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}:</b\n >\n <p [ngClass]=\"{ 'table-card-entry-first': i === 0 }\">\n <ng-container *ngIf=\"tableFields[field]?.dateFormat\">\n {{ object[field] | date: tableFields[field]?.dateFormat }} Uhr\n </ng-container>\n\n <ng-container *ngIf=\"tableFields[field]?.enumValues\">\n {{ tableFields[field]?.enumValues[object[field]]?.text }}\n </ng-container>\n\n <ng-container *ngIf=\"!tableFields[field]?.dateFormat && !tableFields[field]?.enumValues\">\n {{ object[field] | baseEllipses: 60 }}\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n\n <nav *ngIf=\"totalCount >= 0\">\n <ul class=\"pagination justify-content-center\">\n <li class=\"page-item\">\n <a\n class=\"page-link\"\n (click)=\"selectPage(selectedPageIndex - 1)\"\n aria-label=\"Previous\"\n [ngClass]=\"{ disabled: selectedPageIndex - 1 > 0 }\"\n >\n <span aria-hidden=\"true\">&laquo;</span>\n </a>\n </li>\n <li class=\"page-item\" *ngFor=\"let page of pages; let i = index\">\n <a class=\"page-link\" [ngClass]=\"{ active: selectedPageIndex === i }\" (click)=\"selectPage(i)\">{{ i + 1 }}</a>\n </li>\n <li class=\"page-item\">\n <a\n class=\"page-link\"\n (click)=\"selectPage(selectedPageIndex + 1)\"\n aria-label=\"Next\"\n [ngClass]=\"{ disabled: pages[selectedPageIndex + 1] }\"\n >\n <span aria-hidden=\"true\">&raquo;</span>\n </a>\n </li>\n </ul>\n </nav>\n\n <div class=\"context-menu\" #contextMenu>\n <div class=\"context-menu-item\" (click)=\"selectId({ id: contextMenuData.clickedElement?.id })\">Bearbeiten</div>\n <div class=\"context-menu-item\" *ngIf=\"duplicate\" (click)=\"duplicateObject(contextMenuData.clickedElement?.id)\">\n Duplizieren\n </div>\n <div class=\"context-menu-item\" *ngIf=\"delete\" (click)=\"deleteObject(contextMenuData.clickedElement?.id)\">\n L\u00F6schen\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"w-100\" *ngIf=\"id || createMode\">\n <button class=\"d-none d-lg-block btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n *ngIf=\"!modelConfig?.customTemplateComponent\"\n [modelName]=\"camelModelName\"\n [label]=\"modelConfig?.label\"\n [config]=\"config\"\n [logging]=\"logging\"\n [id]=\"id\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n [duplicate]=\"duplicate\"\n [showFavButton]=\"showFavButton\"\n ></base-model-form>\n <ng-template *ngIf=\"modelConfig?.customTemplateComponent\" #customFormTemplate></ng-template>\n</div>\n\n<div class=\"responsive-action-button d-block d-lg-none\">\n <base-fab-button\n [fabIcon]=\"'bi-plus'\"\n (click)=\"createNewObject()\"\n *ngIf=\"!(id || createMode) && showFavButton\"\n ></base-fab-button>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.asc:after,.desc:after{border-style:solid;border-width:.2em .2em 0 0;content:\"\";display:inline-block;height:.45em;left:5px;position:relative;transform:rotate(-45deg);vertical-align:middle;width:.45em}.asc:after{transform:rotate(135deg)}td{vertical-align:middle}.bi,th{cursor:pointer;-webkit-user-select:none;user-select:none}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}.context-menu{opacity:.01%;pointer-events:none;background-color:#fff;border:1px solid #ccc;box-shadow:1px 1px 10px #0000001a;padding:10px 0;position:fixed;top:0;left:0;width:200px}.context-menu-item{cursor:pointer;padding:8px 15px}.context-menu-item:hover{color:var(--bs-primary)}.table-card{background:var(--bs-white);padding:10px;margin-bottom:10px}.table-card-entry{margin-top:4px}.table-card-entry-first{font-size:18px;font-weight:800;color:var(--bs-primary)}.responsive-action-button{position:fixed;bottom:15px;right:15px}.bi-three-dots-vertical{font-size:18px;line-height:18px}.page-item{cursor:pointer}\n"] }]
2381
- }], ctorParameters: function () { return [{ type: i1$1.GraphQLMetaService }, { type: i1$1.GraphQLService }, { type: i1$1.CmsService }, { type: i1$1.ToastService }, { type: i1$1.ScrollService }]; }, propDecorators: { modelName: [{
2382
- type: Input
2383
- }], objectId: [{
2384
- type: Input
2385
- }], createMode: [{
2386
- type: Input
2387
- }], logging: [{
2388
- type: Input
2389
- }], create: [{
2390
- type: Input
2391
- }], update: [{
2392
- type: Input
2393
- }], delete: [{
2394
- type: Input
2395
- }], import: [{
2396
- type: Input
2397
- }], export: [{
2398
- type: Input
2399
- }], duplicate: [{
2400
- type: Input
2401
- }], modelConfig: [{
2402
- type: Input
2403
- }], config: [{
2404
- type: Input
2405
- }], showFavButton: [{
2406
- type: Input
2407
- }], idSelected: [{
2408
- type: Output
2409
- }], createModeChanged: [{
2410
- type: Output
2411
- }], customFormTemplate: [{
2412
- type: ViewChild,
2413
- args: ['customFormTemplate', { read: ViewContainerRef }]
2414
- }] } });
2415
-
2416
- class ChangePasswordComponent {
2417
- constructor(formsService, userService, authService, toastService) {
2418
- this.formsService = formsService;
2419
- this.userService = userService;
2420
- this.authService = authService;
2421
- this.toastService = toastService;
2422
- this.loading = false;
2423
- }
2424
- ngOnInit() {
2425
- this.createForm();
2426
- }
2427
- /**
2428
- * Create password change form
2429
- */
2430
- createForm() {
2431
- this.form = new UntypedFormGroup({
2432
- current: new FormControl('', [Validators.required]),
2433
- password: new FormControl('', [Validators.required, securePasswordValidator()]),
2434
- passwordConfirm: new FormControl('', [Validators.required, securePasswordValidator()]),
2435
- }, { validators: Validation.match('password', 'passwordConfirm') });
2436
- }
2437
- /**
2438
- * Submit form and change password of user
2439
- */
2440
- submit() {
2441
- this.loading = true;
2442
- this.userService
2443
- .login({
2444
- email: this.authService.currentUser.email,
2445
- password: this.form.get('current').value,
2446
- })
2447
- .subscribe({
2448
- next: () => {
2449
- if (this.form.invalid) {
2450
- this.formsService.validateAllFormFields(this.form);
2451
- this.loading = false;
2452
- return;
2453
- }
2454
- this.userService.changePassword(this.authService.currentUser.id, this.form.get('password').value).subscribe({
2455
- next: (response) => {
2456
- if (response) {
2457
- this.form.reset();
2458
- this.toastService.show({
2459
- id: 'password-change-success',
2460
- title: 'Erfolgreich',
2461
- description: 'Passwort wurde erfolgreich geändert.',
2462
- type: ToastType.SUCCESS,
2463
- });
2464
- }
2465
- this.loading = false;
2466
- },
2467
- error: () => {
2468
- this.loading = false;
2469
- this.toastService.show({
2470
- id: 'password-change-error',
2471
- title: 'Fehlgeschlagen',
2472
- description: 'Passwort ändern ist fehlgeschlagen, bitte versuche es später erneut.',
2473
- type: ToastType.ERROR,
2474
- });
2475
- },
2476
- });
2477
- },
2478
- error: () => {
2479
- this.loading = false;
2480
- this.toastService.show({
2481
- id: 'password-change-error',
2482
- title: 'Fehlgeschlagen',
2483
- description: 'Passwort ändern ist fehlgeschlagen. Falsches Passwort.',
2484
- type: ToastType.ERROR,
2485
- errorCode: '401',
2486
- });
2487
- },
2488
- });
2489
- }
2490
- }
2491
- ChangePasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ChangePasswordComponent, deps: [{ token: i1$1.FormsService }, { token: i1$1.UserService }, { token: i1$1.AuthService }, { token: i1$1.ToastService }], target: i0.ɵɵFactoryTarget.Component });
2492
- ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ChangePasswordComponent, selector: "base-change-password", ngImport: i0, template: "<h3>Passwort \u00E4ndern</h3>\n\n<form [formGroup]=\"form\">\n <base-input\n [id]=\"'Aktuelles Passwort'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('current')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password'\"\n [label]=\"'Neues Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Neues Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"3\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InputComponent, selector: "base-input", inputs: ["id", "name", "infoText", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required", "eyeButton", "objectPath"], outputs: ["enter"] }] });
2493
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ChangePasswordComponent, decorators: [{
2494
- type: Component,
2495
- args: [{ selector: 'base-change-password', template: "<h3>Passwort \u00E4ndern</h3>\n\n<form [formGroup]=\"form\">\n <base-input\n [id]=\"'Aktuelles Passwort'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('current')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password'\"\n [label]=\"'Neues Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Neues Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"3\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n" }]
2496
- }], ctorParameters: function () { return [{ type: i1$1.FormsService }, { type: i1$1.UserService }, { type: i1$1.AuthService }, { type: i1$1.ToastService }]; } });
2497
-
2498
- class DeleteAccountComponent {
2499
- constructor(userService, authService, toastService, router) {
2500
- this.userService = userService;
2501
- this.authService = authService;
2502
- this.toastService = toastService;
2503
- this.router = router;
2504
- this.description = 'Mit dem Löschen Deines Kontos werden alle persönlichen Daten sofort gelöscht und sind nicht wiederherstellbar.';
2505
- this.loading = false;
2506
- }
2507
- deleteAccount() {
2508
- this.loading = true;
2509
- if (!confirm('Willst Du wirklich ein Konto unwiderruflich löschen?')) {
2510
- this.loading = false;
2511
- return;
2512
- }
2513
- this.userService.delete(this.authService.currentUser.id).subscribe({
2514
- next: (response) => {
2515
- if (response) {
2516
- this.toastService.show({
2517
- id: 'delete-user-success',
2518
- title: 'Erfolgreich',
2519
- description: 'Dein Konto wurde erfolgreich gelöscht.',
2520
- type: ToastType.SUCCESS,
2521
- });
2522
- }
2523
- this.authService.logout();
2524
- this.router.navigate(['/']);
2525
- this.loading = false;
2526
- },
2527
- error: (error) => {
2528
- this.loading = false;
2529
- this.toastService.show({
2530
- id: 'delete-user-error',
2531
- title: 'Fehlgeschlagen',
2532
- description: 'Konto löschen ist fehlgeschlagen, bitte versuche es später erneut.',
2533
- type: ToastType.ERROR,
2534
- });
2535
- },
2536
- });
2537
- }
2538
- }
2539
- DeleteAccountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: DeleteAccountComponent, deps: [{ token: i1$1.UserService }, { token: i1$1.AuthService }, { token: i1$1.ToastService }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Component });
2540
- DeleteAccountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: DeleteAccountComponent, selector: "base-delete-account", inputs: { description: "description" }, ngImport: i0, template: "<div>\n <h3>Konto l\u00F6schen</h3>\n\n <p>{{ description }}</p>\n\n <div class=\"d-flex justify-content-end mt-3\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"deleteAccount()\" *ngIf=\"!loading\">Konto l\u00F6schen</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2541
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: DeleteAccountComponent, decorators: [{
2542
- type: Component,
2543
- args: [{ selector: 'base-delete-account', template: "<div>\n <h3>Konto l\u00F6schen</h3>\n\n <p>{{ description }}</p>\n\n <div class=\"d-flex justify-content-end mt-3\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"deleteAccount()\" *ngIf=\"!loading\">Konto l\u00F6schen</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</div>\n" }]
2544
- }], ctorParameters: function () { return [{ type: i1$1.UserService }, { type: i1$1.AuthService }, { type: i1$1.ToastService }, { type: i2$1.Router }]; }, propDecorators: { description: [{
2545
- type: Input
2546
- }] } });
2547
-
2548
- class BackButtonDirective {
2549
- constructor(navigation) {
2550
- this.navigation = navigation;
2551
- }
2552
- onClick() {
2553
- this.navigation.back();
2554
- }
2555
- }
2556
- BackButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BackButtonDirective, deps: [{ token: i1$1.NavigationService }], target: i0.ɵɵFactoryTarget.Directive });
2557
- BackButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: BackButtonDirective, selector: "[baseBackButton]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
2558
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BackButtonDirective, decorators: [{
2559
- type: Directive,
2560
- args: [{
2561
- selector: '[baseBackButton]',
2562
- }]
2563
- }], ctorParameters: function () { return [{ type: i1$1.NavigationService }]; }, propDecorators: { onClick: [{
2564
- type: HostListener,
2565
- args: ['click']
2566
- }] } });
2567
-
2568
- // Modules
2569
- const imports = [FormsModule, ReactiveFormsModule, CommonModule, RouterModule, ImageCropperModule, NgbTooltipModule];
2570
- // Imported and exported elements
2571
- const elements = [
2572
- // Directives
2573
- SortDirective,
2574
- BackButtonDirective,
2575
- ContextMenuDirective,
2576
- StopPropagationDirective,
2577
- // Components
2578
- InputComponent,
2579
- SelectComponent,
2580
- CheckboxComponent,
2581
- TextareaComponent,
2582
- ToastComponent,
2583
- TagsComponent,
2584
- LoadingBarComponent,
2585
- SkeletonLoaderComponent,
2586
- BreadcrumbComponent,
2587
- ModelFormComponent,
2588
- ModelTableComponent,
2589
- ModelFormSubComponent,
2590
- UploadImageComponent,
2591
- RefenceInputComponent,
2592
- ChangePasswordComponent,
2593
- DeleteAccountComponent,
2594
- FabButtonComponent,
2595
- // Pipes
2596
- EllipsesPipe,
2597
- ];
2598
- class BaseComponentsModule {
2599
- }
2600
- BaseComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BaseComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2601
- BaseComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: BaseComponentsModule, declarations: [
2602
- // Directives
2603
- SortDirective,
2604
- BackButtonDirective,
2605
- ContextMenuDirective,
2606
- StopPropagationDirective,
2607
- // Components
2608
- InputComponent,
2609
- SelectComponent,
2610
- CheckboxComponent,
2611
- TextareaComponent,
2612
- ToastComponent,
2613
- TagsComponent,
2614
- LoadingBarComponent,
2615
- SkeletonLoaderComponent,
2616
- BreadcrumbComponent,
2617
- ModelFormComponent,
2618
- ModelTableComponent,
2619
- ModelFormSubComponent,
2620
- UploadImageComponent,
2621
- RefenceInputComponent,
2622
- ChangePasswordComponent,
2623
- DeleteAccountComponent,
2624
- FabButtonComponent,
2625
- // Pipes
2626
- EllipsesPipe
2627
- ], imports: [FormsModule, ReactiveFormsModule, CommonModule, RouterModule, ImageCropperModule, NgbTooltipModule], exports: [
2628
- // Directives
2629
- SortDirective,
2630
- BackButtonDirective,
2631
- ContextMenuDirective,
2632
- StopPropagationDirective,
2633
- // Components
2634
- InputComponent,
2635
- SelectComponent,
2636
- CheckboxComponent,
2637
- TextareaComponent,
2638
- ToastComponent,
2639
- TagsComponent,
2640
- LoadingBarComponent,
2641
- SkeletonLoaderComponent,
2642
- BreadcrumbComponent,
2643
- ModelFormComponent,
2644
- ModelTableComponent,
2645
- ModelFormSubComponent,
2646
- UploadImageComponent,
2647
- RefenceInputComponent,
2648
- ChangePasswordComponent,
2649
- DeleteAccountComponent,
2650
- FabButtonComponent,
2651
- // Pipes
2652
- EllipsesPipe
2653
- ] });
2654
- BaseComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BaseComponentsModule, imports: [imports] });
2655
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BaseComponentsModule, decorators: [{
2656
- type: NgModule,
2657
- args: [{
2658
- declarations: elements,
2659
- imports,
2660
- exports: elements,
2661
- }]
2662
- }] });
2663
-
2664
- /**
2665
- * Abstract Component for inputs and outputs only
2666
- *
2667
- * Hint for handling extensions of this component in project:
2668
- * If you want to use complete custom services and methods, extend ModelFormComponent instead of ModelFormBaseComponent
2669
- */
2670
- class ModelFormBaseComponent {
2671
- constructor(cmsService, toastService, router, route) {
2672
- this.cmsService = cmsService;
2673
- this.toastService = toastService;
2674
- this.router = router;
2675
- this.route = route;
2676
- this.delete = true;
2677
- this.onlyUpdateMode = false;
2678
- this.duplicate = false;
2679
- this.logging = false;
2680
- this.config = null;
2681
- this.showFavButton = true;
2682
- this.finished = new EventEmitter();
2683
- this.fabButtons = [];
2684
- }
2685
- ngOnInit() {
2686
- this.initFabActions();
2687
- }
2688
- /**
2689
- * Init fab buttons for mobile devices
2690
- */
2691
- initFabActions() {
2692
- const saveEvent = new EventEmitter();
2693
- this.fabButtons.push({ icon: 'bi-check-lg', color: 'var(--bs-success)', event: saveEvent });
2694
- saveEvent.subscribe(() => this.submit());
2695
- if (this.duplicate && this.operation === 'update') {
2696
- const event = new EventEmitter();
2697
- this.fabButtons.push({ icon: 'bi-back', color: 'var(--bs-info)', event });
2698
- event.subscribe(() => this.duplicateObject());
2699
- }
2700
- if (this.operation === 'update' && this.delete) {
2701
- const event = new EventEmitter();
2702
- this.fabButtons.push({ icon: 'bi-trash3', color: 'var(--bs-danger)', event });
2703
- event.subscribe(() => this.deleteObject());
2704
- }
2705
- }
2706
- submit() { }
2707
- /**
2708
- * It calls the graphQLService to delete the object with the id of the object that is currently being edited
2709
- */
2710
- deleteObject() {
2711
- this.cmsService.deleteObject(this.id, this.modelName).then(() => {
2712
- this.toastService.show({
2713
- id: this.modelName + '-success',
2714
- type: ToastType.SUCCESS,
2715
- title: 'Erfolgreich',
2716
- description: this.label + ' wurde erfolgreich gelöscht.',
2717
- });
2718
- this.finished.emit(null);
2719
- });
2720
- }
2721
- /**
2722
- * It sends a GraphQL mutation to the server to duplicate the object
2723
- */
2724
- duplicateObject() {
2725
- return __awaiter(this, void 0, void 0, function* () {
2726
- this.cmsService.duplicateObject(this.id, this.modelName).then((value) => __awaiter(this, void 0, void 0, function* () {
2727
- if (value === null || value === void 0 ? void 0 : value.id) {
2728
- yield this.router.navigate(['../'], { relativeTo: this.route });
2729
- this.toastService.show({
2730
- id: this.modelName + '-success',
2731
- type: ToastType.SUCCESS,
2732
- title: 'Erfolgreich',
2733
- description: this.label + ' wurde erfolgreich dupliziert.',
2734
- });
2735
- }
2736
- else {
2737
- this.finished.emit(null);
2738
- }
2739
- }));
2740
- });
2741
- }
2742
- /**
2743
- * It takes a string, capitalizes the first letter, and returns the modified string
2744
- *
2745
- * @param value - The string to capitalize.
2746
- * @returns The first letter of the string is being capitalized and the rest of the string is being returned.
2747
- */
2748
- capitalizeFirstLetter(value) {
2749
- return this.cmsService.capitalizeFirstLetter(value);
2750
- }
2751
- /**
2752
- * It takes an AbstractControl and returns a FormControl
2753
- *
2754
- * @param control - AbstractControl | null | undefined
2755
- * @returns A FormControl
2756
- */
2757
- transformToControl(control) {
2758
- return control;
2759
- }
2760
- formatDate(date) {
2761
- if (!date) {
2762
- return null;
2763
- }
2764
- const newDate = new Date(date);
2765
- return newDate.toISOString().substring(0, 16);
2766
- }
2767
- }
2768
- ModelFormBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModelFormBaseComponent, deps: [{ token: i1$1.CmsService }, { token: i1$1.ToastService }, { token: i2$1.Router }, { token: i2$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
2769
- ModelFormBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ModelFormBaseComponent, selector: "ng-component", inputs: { modelName: "modelName", label: "label", id: "id", delete: "delete", onlyUpdateMode: "onlyUpdateMode", duplicate: "duplicate", logging: "logging", config: "config", showFavButton: "showFavButton" }, outputs: { finished: "finished" }, ngImport: i0, template: '', isInline: true });
2770
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModelFormBaseComponent, decorators: [{
2771
- type: Component,
2772
- args: [{
2773
- template: '',
2774
- }]
2775
- }], ctorParameters: function () { return [{ type: i1$1.CmsService }, { type: i1$1.ToastService }, { type: i2$1.Router }, { type: i2$1.ActivatedRoute }]; }, propDecorators: { modelName: [{
2776
- type: Input
2777
- }], label: [{
2778
- type: Input
2779
- }], id: [{
2780
- type: Input
2781
- }], delete: [{
2782
- type: Input
2783
- }], onlyUpdateMode: [{
2784
- type: Input
2785
- }], duplicate: [{
2786
- type: Input
2787
- }], logging: [{
2788
- type: Input
2789
- }], config: [{
2790
- type: Input
2791
- }], showFavButton: [{
2792
- type: Input
2793
- }], finished: [{
2794
- type: Output
2795
- }] } });
2796
-
2797
- /**
2798
- * Exports for public API
2799
- */
2800
-
2801
- /**
2802
- * Generated bundle index. Do not edit.
2803
- */
2804
-
2805
- export { BackButtonDirective, BaseComponentsModule, BreadcrumbComponent, ChangePasswordComponent, CheckboxComponent, ContextMenuDirective, DeleteAccountComponent, EllipsesPipe, FabButtonComponent, InputComponent, LoadingBarComponent, ModelFormBaseComponent, ModelFormComponent, ModelFormSubComponent, ModelTableComponent, RefenceInputComponent, SelectComponent, SkeletonLoaderComponent, SortDirective, StopPropagationDirective, TagsComponent, TextareaComponent, ToastComponent, UploadImageComponent };
2806
- //# sourceMappingURL=lenne.tech-ng-base-base-components.mjs.map