spiderly 19.0.1 → 19.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/fesm2022/spiderly.mjs +4612 -0
  2. package/fesm2022/spiderly.mjs.map +1 -0
  3. package/index.d.ts +5 -0
  4. package/lib/components/auth/login/login.component.d.ts +35 -0
  5. package/lib/components/auth/partials/auth.component.d.ts +21 -0
  6. package/lib/components/auth/partials/login-verification.component.d.ts +18 -0
  7. package/lib/components/auth/partials/registration-verification.component.d.ts +17 -0
  8. package/lib/components/auth/partials/verification-wrapper.component.d.ts +31 -0
  9. package/lib/components/auth/registration/registration.component.d.ts +34 -0
  10. package/lib/components/base-details/role-base-details.component.d.ts +50 -0
  11. package/lib/components/base-form/base-form copy.d.ts +54 -0
  12. package/lib/components/card-skeleton/card-skeleton.component.d.ts +12 -0
  13. package/lib/components/footer/footer.component.d.ts +9 -0
  14. package/lib/components/index-card/index-card.component.d.ts +22 -0
  15. package/lib/components/info-card/info-card.component.d.ts +11 -0
  16. package/lib/components/layout/layout-base.component.d.ts +37 -0
  17. package/lib/components/layout/sidebar/menuitem.component.d.ts +43 -0
  18. package/lib/components/layout/sidebar/sidebar-menu.component.d.ts +23 -0
  19. package/lib/components/layout/sidebar/sidebar-menu.service.d.ts +12 -0
  20. package/lib/components/layout/sidebar/sidebar.component.d.ts +11 -0
  21. package/lib/components/layout/topbar/topbar.component.d.ts +45 -0
  22. package/lib/components/not-found/not-found.component.d.ts +9 -0
  23. package/lib/components/required/required.component.d.ts +6 -0
  24. package/lib/components/spiderly-buttons/google-button/google-button.component.d.ts +17 -0
  25. package/lib/components/spiderly-buttons/return-button/return-button.component.d.ts +10 -0
  26. package/lib/components/spiderly-buttons/spiderly-button/spiderly-button.component.d.ts +6 -0
  27. package/lib/components/spiderly-buttons/spiderly-button-base/spiderly-button-base.d.ts +27 -0
  28. package/lib/components/spiderly-buttons/spiderly-split-button/spiderly-split-button.component.d.ts +8 -0
  29. package/lib/components/spiderly-data-table/spiderly-data-table.component.d.ts +157 -0
  30. package/lib/components/spiderly-delete-dialog/spiderly-delete-confirmation.component.d.ts +11 -0
  31. package/lib/components/spiderly-form-control/spiderly-form-control.d.ts +37 -0
  32. package/lib/components/spiderly-panels/panel-body/panel-body.component.d.ts +9 -0
  33. package/lib/components/spiderly-panels/panel-footer/panel-footer.component.d.ts +8 -0
  34. package/lib/components/spiderly-panels/panel-header/panel-header.component.d.ts +29 -0
  35. package/lib/components/spiderly-panels/spiderly-card/spiderly-card.component.d.ts +10 -0
  36. package/lib/components/spiderly-panels/spiderly-panel/spiderly-panel.component.d.ts +25 -0
  37. package/lib/components/spiderly-panels/spiderly-panels.module.d.ts +13 -0
  38. package/lib/controls/base-autocomplete-control.d.ts +9 -0
  39. package/lib/controls/base-control.d.ts +23 -0
  40. package/lib/controls/base-dropdown-control.d.ts +18 -0
  41. package/lib/controls/spiderly-autocomplete/spiderly-autocomplete.component.d.ts +18 -0
  42. package/lib/controls/spiderly-calendar/spiderly-calendar.component.d.ts +13 -0
  43. package/lib/controls/spiderly-checkbox/spiderly-checkbox.component.d.ts +14 -0
  44. package/lib/controls/spiderly-colorpick/spiderly-colorpick.component.d.ts +11 -0
  45. package/lib/controls/spiderly-controls.module.d.ts +22 -0
  46. package/lib/controls/spiderly-dropdown/spiderly-dropdown.component.d.ts +14 -0
  47. package/lib/controls/spiderly-editor/spiderly-editor.component.d.ts +16 -0
  48. package/lib/controls/spiderly-file/spiderly-file.component.d.ts +36 -0
  49. package/lib/controls/spiderly-multiautocomplete/spiderly-multiautocomplete.component.d.ts +13 -0
  50. package/lib/controls/spiderly-multiselect/spiderly-multiselect.component.d.ts +11 -0
  51. package/lib/controls/spiderly-number/spiderly-number.component.d.ts +15 -0
  52. package/lib/controls/spiderly-password/spiderly-password.component.d.ts +12 -0
  53. package/lib/controls/spiderly-textarea/spiderly-textarea.component.d.ts +11 -0
  54. package/lib/controls/spiderly-textbox/spiderly-textbox.component.d.ts +15 -0
  55. package/lib/entities/base-entity.d.ts +14 -0
  56. package/lib/entities/codebook.d.ts +9 -0
  57. package/lib/entities/init-company-auth-dialog-details.d.ts +9 -0
  58. package/lib/entities/init-top-bar-data.d.ts +16 -0
  59. package/lib/entities/is-authorized-for-save-event.d.ts +9 -0
  60. package/lib/entities/last-menu-icon-index-clicked.d.ts +7 -0
  61. package/lib/entities/lazy-load-selected-ids-result.d.ts +9 -0
  62. package/{src/lib/entities/menuchangeevent.ts → lib/entities/menuchangeevent.d.ts} +4 -4
  63. package/lib/entities/mime-type.d.ts +11 -0
  64. package/lib/entities/namebook.d.ts +9 -0
  65. package/lib/entities/primeng-option.d.ts +9 -0
  66. package/lib/entities/security-entities.d.ts +211 -0
  67. package/lib/entities/simple-save-result.d.ts +7 -0
  68. package/lib/entities/spiderly-button.d.ts +13 -0
  69. package/{src/lib/entities/table-filter-context.ts → lib/entities/table-filter-context.d.ts} +5 -6
  70. package/lib/entities/table-filter-sort-meta.d.ts +4 -0
  71. package/{src/lib/entities/table-filter.ts → lib/entities/table-filter.d.ts} +23 -48
  72. package/lib/entities/table-response.d.ts +4 -0
  73. package/lib/enums/security-enums.d.ts +22 -0
  74. package/lib/enums/verification-type-codes.d.ts +4 -0
  75. package/lib/guards/auth.guard.d.ts +15 -0
  76. package/lib/guards/not-auth.guard.d.ts +12 -0
  77. package/lib/handlers/spiderly-error-handler.d.ts +14 -0
  78. package/lib/handlers/spiderly-transloco-fallback-strategy.d.ts +13 -0
  79. package/lib/interceptors/http-loading.interceptor.d.ts +2 -0
  80. package/lib/interceptors/json-parser.interceptor.d.ts +2 -0
  81. package/lib/interceptors/jwt.interceptor.d.ts +2 -0
  82. package/lib/interceptors/unauthorized.interceptor.d.ts +2 -0
  83. package/lib/modules/core.module.d.ts +2 -0
  84. package/lib/modules/primeng.module.d.ts +42 -0
  85. package/lib/modules/spiderly-transloco.module.d.ts +15 -0
  86. package/lib/services/api.service.security.d.ts +35 -0
  87. package/lib/services/app-initializer.d.ts +4 -0
  88. package/lib/services/app-layout-base.service.d.ts +60 -0
  89. package/lib/services/auth-base.service.d.ts +55 -0
  90. package/lib/services/base-form.service.d.ts +27 -0
  91. package/lib/services/config-base.service.d.ts +24 -0
  92. package/lib/services/helper-functions.d.ts +37 -0
  93. package/lib/services/spiderly-message.service.d.ts +17 -0
  94. package/lib/services/spiderly-transloco-loader.d.ts +10 -0
  95. package/lib/services/translate-labels-abstract.service.d.ts +7 -0
  96. package/lib/services/validator-abstract.service.d.ts +13 -0
  97. package/package.json +66 -55
  98. package/{src/public-api.ts → public-api.d.ts} +91 -103
  99. package/eslint.config.js +0 -32
  100. package/ng-package.json +0 -10
  101. package/src/lib/components/auth/login/login.component.html +0 -25
  102. package/src/lib/components/auth/login/login.component.ts +0 -77
  103. package/src/lib/components/auth/partials/auth.component.html +0 -29
  104. package/src/lib/components/auth/partials/auth.component.ts +0 -60
  105. package/src/lib/components/auth/partials/login-verification.component.html +0 -2
  106. package/src/lib/components/auth/partials/login-verification.component.ts +0 -41
  107. package/src/lib/components/auth/partials/registration-verification.component.html +0 -1
  108. package/src/lib/components/auth/partials/registration-verification.component.ts +0 -41
  109. package/src/lib/components/auth/partials/verification-wrapper.component.html +0 -39
  110. package/src/lib/components/auth/partials/verification-wrapper.component.ts +0 -68
  111. package/src/lib/components/auth/registration/registration.component.html +0 -31
  112. package/src/lib/components/auth/registration/registration.component.ts +0 -77
  113. package/src/lib/components/base-details/role-base-details.component.html +0 -33
  114. package/src/lib/components/base-details/role-base-details.component.ts +0 -194
  115. package/src/lib/components/base-form/base-form copy.ts +0 -356
  116. package/src/lib/components/card-skeleton/card-skeleton.component.html +0 -8
  117. package/src/lib/components/card-skeleton/card-skeleton.component.ts +0 -21
  118. package/src/lib/components/footer/app.footer.component.ts +0 -17
  119. package/src/lib/components/footer/footer.component.html +0 -3
  120. package/src/lib/components/footer/footer.component.ts +0 -17
  121. package/src/lib/components/index-card/index-card.component.html +0 -15
  122. package/src/lib/components/index-card/index-card.component.ts +0 -48
  123. package/src/lib/components/info-card/info-card.component.html +0 -18
  124. package/src/lib/components/info-card/info-card.component.ts +0 -29
  125. package/src/lib/components/layout/layout-base.component.ts +0 -140
  126. package/src/lib/components/layout/sidebar/menuitem.component.html +0 -40
  127. package/src/lib/components/layout/sidebar/menuitem.component.ts +0 -179
  128. package/src/lib/components/layout/sidebar/sidebar-menu.component.html +0 -6
  129. package/src/lib/components/layout/sidebar/sidebar-menu.component.ts +0 -44
  130. package/src/lib/components/layout/sidebar/sidebar-menu.service.ts +0 -22
  131. package/src/lib/components/layout/sidebar/sidebar.component.html +0 -1
  132. package/src/lib/components/layout/sidebar/sidebar.component.ts +0 -20
  133. package/src/lib/components/layout/topbar/topbar.component.html +0 -64
  134. package/src/lib/components/layout/topbar/topbar.component.ts +0 -137
  135. package/src/lib/components/not-found/not-found.component.html +0 -27
  136. package/src/lib/components/not-found/not-found.component.ts +0 -22
  137. package/src/lib/components/required/required.component.html +0 -1
  138. package/src/lib/components/required/required.component.ts +0 -13
  139. package/src/lib/components/spiderly-buttons/google-button/google-button.component.html +0 -5
  140. package/src/lib/components/spiderly-buttons/google-button/google-button.component.ts +0 -53
  141. package/src/lib/components/spiderly-buttons/return-button/return-button.component.html +0 -3
  142. package/src/lib/components/spiderly-buttons/return-button/return-button.component.ts +0 -35
  143. package/src/lib/components/spiderly-buttons/spiderly-button/spiderly-button.component.html +0 -14
  144. package/src/lib/components/spiderly-buttons/spiderly-button/spiderly-button.component.ts +0 -27
  145. package/src/lib/components/spiderly-buttons/spiderly-button-base/spiderly-button-base.ts +0 -61
  146. package/src/lib/components/spiderly-buttons/spiderly-split-button/spiderly-split-button.component.html +0 -15
  147. package/src/lib/components/spiderly-buttons/spiderly-split-button/spiderly-split-button.component.ts +0 -24
  148. package/src/lib/components/spiderly-data-table/spiderly-data-table.component.html +0 -93
  149. package/src/lib/components/spiderly-data-table/spiderly-data-table.component.ts +0 -614
  150. package/src/lib/components/spiderly-delete-dialog/spiderly-delete-confirmation.component.html +0 -17
  151. package/src/lib/components/spiderly-delete-dialog/spiderly-delete-confirmation.component.ts +0 -39
  152. package/src/lib/components/spiderly-form-control/spiderly-form-control.ts +0 -60
  153. package/src/lib/components/spiderly-panels/panel-body/panel-body.component.html +0 -8
  154. package/src/lib/components/spiderly-panels/panel-body/panel-body.component.ts +0 -16
  155. package/src/lib/components/spiderly-panels/panel-footer/panel-footer.component.html +0 -8
  156. package/src/lib/components/spiderly-panels/panel-footer/panel-footer.component.ts +0 -15
  157. package/src/lib/components/spiderly-panels/panel-header/panel-header.component.html +0 -25
  158. package/src/lib/components/spiderly-panels/panel-header/panel-header.component.ts +0 -69
  159. package/src/lib/components/spiderly-panels/spiderly-card/spiderly-card.component.html +0 -7
  160. package/src/lib/components/spiderly-panels/spiderly-card/spiderly-card.component.ts +0 -17
  161. package/src/lib/components/spiderly-panels/spiderly-panel/spiderly-panel.component.html +0 -40
  162. package/src/lib/components/spiderly-panels/spiderly-panel/spiderly-panel.component.ts +0 -42
  163. package/src/lib/components/spiderly-panels/spiderly-panels.module.ts +0 -32
  164. package/src/lib/controls/base-autocomplete-control.ts +0 -17
  165. package/src/lib/controls/base-control.ts +0 -60
  166. package/src/lib/controls/base-dropdown-control.ts +0 -37
  167. package/src/lib/controls/spiderly-autocomplete/spiderly-autocomplete.component.html +0 -36
  168. package/src/lib/controls/spiderly-autocomplete/spiderly-autocomplete.component.ts +0 -56
  169. package/src/lib/controls/spiderly-calendar/spiderly-calendar.component.html +0 -21
  170. package/src/lib/controls/spiderly-calendar/spiderly-calendar.component.ts +0 -37
  171. package/src/lib/controls/spiderly-checkbox/spiderly-checkbox.component.html +0 -16
  172. package/src/lib/controls/spiderly-checkbox/spiderly-checkbox.component.ts +0 -38
  173. package/src/lib/controls/spiderly-colorpick/spiderly-colorpick.component.html +0 -33
  174. package/src/lib/controls/spiderly-colorpick/spiderly-colorpick.component.ts +0 -40
  175. package/src/lib/controls/spiderly-controls.module.ts +0 -61
  176. package/src/lib/controls/spiderly-dropdown/spiderly-dropdown.component.html +0 -27
  177. package/src/lib/controls/spiderly-dropdown/spiderly-dropdown.component.ts +0 -39
  178. package/src/lib/controls/spiderly-editor/spiderly-editor.component.html +0 -22
  179. package/src/lib/controls/spiderly-editor/spiderly-editor.component.ts +0 -58
  180. package/src/lib/controls/spiderly-file/spiderly-file.component.html +0 -54
  181. package/src/lib/controls/spiderly-file/spiderly-file.component.ts +0 -123
  182. package/src/lib/controls/spiderly-multiautocomplete/spiderly-multiautocomplete.component.html +0 -30
  183. package/src/lib/controls/spiderly-multiautocomplete/spiderly-multiautocomplete.component.ts +0 -38
  184. package/src/lib/controls/spiderly-multiselect/spiderly-multiselect.component.html +0 -23
  185. package/src/lib/controls/spiderly-multiselect/spiderly-multiselect.component.ts +0 -32
  186. package/src/lib/controls/spiderly-number/spiderly-number.component.html +0 -19
  187. package/src/lib/controls/spiderly-number/spiderly-number.component.ts +0 -37
  188. package/src/lib/controls/spiderly-password/spiderly-password.component.html +0 -17
  189. package/src/lib/controls/spiderly-password/spiderly-password.component.ts +0 -34
  190. package/src/lib/controls/spiderly-textarea/spiderly-textarea.component.html +0 -18
  191. package/src/lib/controls/spiderly-textarea/spiderly-textarea.component.ts +0 -32
  192. package/src/lib/controls/spiderly-textbox/spiderly-textbox.component.html +0 -23
  193. package/src/lib/controls/spiderly-textbox/spiderly-textbox.component.ts +0 -41
  194. package/src/lib/entities/base-entity.ts +0 -25
  195. package/src/lib/entities/codebook.ts +0 -23
  196. package/src/lib/entities/init-company-auth-dialog-details.ts +0 -22
  197. package/src/lib/entities/init-top-bar-data.ts +0 -35
  198. package/src/lib/entities/is-authorized-for-save-event.ts +0 -22
  199. package/src/lib/entities/last-menu-icon-index-clicked.ts +0 -18
  200. package/src/lib/entities/lazy-load-selected-ids-result.ts +0 -22
  201. package/src/lib/entities/mime-type.ts +0 -15
  202. package/src/lib/entities/namebook.ts +0 -22
  203. package/src/lib/entities/primeng-option.ts +0 -23
  204. package/src/lib/entities/readonly-object.ts +0 -1
  205. package/src/lib/entities/security-entities.ts +0 -548
  206. package/src/lib/entities/simple-save-result.ts +0 -19
  207. package/src/lib/entities/spiderly-button.ts +0 -30
  208. package/src/lib/entities/table-filter-sort-meta.ts +0 -5
  209. package/src/lib/entities/table-response.ts +0 -5
  210. package/src/lib/enums/security-enums.ts +0 -28
  211. package/src/lib/enums/verification-type-codes.ts +0 -5
  212. package/src/lib/guards/auth.guard.ts +0 -39
  213. package/src/lib/guards/not-auth.guard.ts +0 -32
  214. package/src/lib/handlers/spiderly-error-handler.ts +0 -32
  215. package/src/lib/handlers/spiderly-transloco-fallback-strategy.ts +0 -25
  216. package/src/lib/interceptors/http-loading.interceptor.ts +0 -21
  217. package/src/lib/interceptors/json-parser.interceptor.ts +0 -44
  218. package/src/lib/interceptors/jwt.interceptor.ts +0 -18
  219. package/src/lib/interceptors/unauthorized.interceptor.ts +0 -77
  220. package/src/lib/modules/core.module.ts +0 -22
  221. package/src/lib/modules/primeng.module.ts +0 -122
  222. package/src/lib/modules/spiderly-transloco.module.ts +0 -50
  223. package/src/lib/services/api.service.security.ts +0 -120
  224. package/src/lib/services/app-initializer.ts +0 -9
  225. package/src/lib/services/app-layout-base.service.ts +0 -184
  226. package/src/lib/services/auth-base.service.ts +0 -271
  227. package/src/lib/services/base-form.service.ts +0 -178
  228. package/src/lib/services/config-base.service.ts +0 -36
  229. package/src/lib/services/helper-functions.ts +0 -288
  230. package/src/lib/services/spiderly-message.service.ts +0 -66
  231. package/src/lib/services/spiderly-transloco-loader.ts +0 -15
  232. package/src/lib/services/translate-labels-abstract.service.ts +0 -13
  233. package/src/lib/services/validator-abstract.service.ts +0 -63
  234. package/tsconfig.lib.json +0 -17
  235. package/tsconfig.lib.prod.json +0 -10
  236. package/tsconfig.spec.json +0 -14
  237. /package/{src/lib → styles}/components/spiderly-data-table/spiderly-data-table.component.scss +0 -0
  238. /package/{src/lib → styles}/components/spiderly-panels/panel-footer/panel-footer.component.scss +0 -0
  239. /package/{src/lib → styles}/components/spiderly-panels/spiderly-panel/spiderly-panel.component.scss +0 -0
  240. /package/{src/lib → styles}/styles/layout/_config.scss +0 -0
  241. /package/{src/lib → styles}/styles/layout/_content.scss +0 -0
  242. /package/{src/lib → styles}/styles/layout/_footer.scss +0 -0
  243. /package/{src/lib → styles}/styles/layout/_main.scss +0 -0
  244. /package/{src/lib → styles}/styles/layout/_menu.scss +0 -0
  245. /package/{src/lib → styles}/styles/layout/_mixins.scss +0 -0
  246. /package/{src/lib → styles}/styles/layout/_preloading.scss +0 -0
  247. /package/{src/lib → styles}/styles/layout/_responsive.scss +0 -0
  248. /package/{src/lib → styles}/styles/layout/_spiderly-controls.scss +0 -0
  249. /package/{src/lib → styles}/styles/layout/_topbar.scss +0 -0
  250. /package/{src/lib → styles}/styles/layout/_typography.scss +0 -0
  251. /package/{src/lib → styles}/styles/layout/_utils.scss +0 -0
  252. /package/{src/lib → styles}/styles/layout/_variables.scss +0 -0
  253. /package/{src/lib → styles}/styles/layout/layout.scss +0 -0
  254. /package/{src/lib → styles}/styles/shared.scss +0 -0
  255. /package/{src/lib → styles}/styles/styles.scss +0 -0
@@ -1,356 +0,0 @@
1
- import { BaseFormService } from './../../services/base-form.service';
2
- import {
3
- ChangeDetectorRef,
4
- Component,
5
- KeyValueDiffer,
6
- KeyValueDiffers,
7
- OnInit,
8
- } from '@angular/core';
9
- import { SpiderlyFormArray, SpiderlyFormControl, SpiderlyFormGroup } from '../spiderly-form-control/spiderly-form-control';
10
- import { HttpClient } from '@angular/common/http';
11
- import { SpiderlyMessageService } from '../../services/spiderly-message.service';
12
- import { ActivatedRoute, Router } from '@angular/router';
13
- import { MenuItem } from 'primeng/api';
14
- import { getControl, getParentUrl } from '../../services/helper-functions';
15
- import { TranslocoService } from '@jsverse/transloco';
16
- import { BaseEntity } from '../../entities/base-entity';
17
- import { LastMenuIconIndexClicked } from '../../entities/last-menu-icon-index-clicked';
18
-
19
- @Component({
20
- selector: 'base-form',
21
- template: '',
22
- styles: [],
23
- standalone: false
24
- })
25
- export class BaseFormCopy implements OnInit {
26
- formGroup: SpiderlyFormGroup = new SpiderlyFormGroup({});
27
- saveBody: any;
28
- successfulSaveToastDescription: string = this.translocoService.translate('SuccessfulSaveToastDescription');
29
- loading: boolean = true;
30
-
31
- private modelDiffer: KeyValueDiffer<string, any>;
32
-
33
- constructor(
34
- protected differs: KeyValueDiffers,
35
- protected http: HttpClient,
36
- protected messageService: SpiderlyMessageService,
37
- protected changeDetectorRef: ChangeDetectorRef,
38
- protected router: Router,
39
- protected route: ActivatedRoute,
40
- protected translocoService: TranslocoService,
41
- protected baseFormService: BaseFormService,
42
- ) {
43
- }
44
-
45
- ngOnInit(){
46
- }
47
-
48
- //#region Model
49
-
50
- initFormGroup = <T>(
51
- formGroup: SpiderlyFormGroup<T>,
52
- parentFormGroup: SpiderlyFormGroup,
53
- modelConstructor: any,
54
- propertyNameInSaveBody: string,
55
- updateOnChangeControls?: (keyof T)[]
56
- ) => {
57
- return this.baseFormService.addFormGroup(
58
- formGroup, parentFormGroup, modelConstructor, propertyNameInSaveBody, updateOnChangeControls
59
- );
60
- }
61
-
62
- createFormGroup = <T>(
63
- formGroup: SpiderlyFormGroup<T>,
64
- modelConstructor: T & BaseEntity,
65
- updateOnChangeControls?: (keyof T)[]
66
- ) => {
67
- return this.baseFormService.initFormGroup(
68
- formGroup, modelConstructor, updateOnChangeControls
69
- );
70
- }
71
-
72
- control = <T extends BaseEntity>(formControlName: string & keyof T, formGroup: SpiderlyFormGroup<T>) => {
73
- return getControl(formControlName, formGroup);
74
- }
75
-
76
- onSave = (reroute: boolean = true) => {
77
- this.saveBody = this.formGroup.initSaveBody();
78
- this.onBeforeSave(this.saveBody);
79
-
80
- this.saveBody = this.saveBody ?? this.formGroup.getRawValue();
81
-
82
- let isValid: boolean = this.areFormGroupsFromParentFormGroupValid();
83
- let isFormArrayValid: boolean = this.areFormArraysValid();
84
-
85
- if(isValid && isFormArrayValid){
86
- this.formGroup.saveObservableMethod(this.saveBody).subscribe(res => {
87
- this.messageService.successMessage(this.successfulSaveToastDescription);
88
-
89
- Object.keys(res).forEach((key) => {
90
- const formControl = this.formGroup.get(key);
91
-
92
- if (formControl) {
93
- if (formControl instanceof SpiderlyFormArray) {
94
- const formArray = formControl as SpiderlyFormArray;
95
- if (res[key].length !== 0) {
96
- formArray.clear();
97
- }
98
- else{
99
- // FT: This is okay because when we have M2M association with additional fields, we will not give back the list because we are not checking version on the server.
100
- // console.error(`You returned empty array for control: ${formArray.translationKey}.`);
101
- }
102
-
103
- res[key].forEach((model: any) => {
104
- if (typeof model === 'object' && model !== null) {
105
- Object.assign(formArray.modelConstructor, model);
106
- let helperFormGroup = new SpiderlyFormGroup({});
107
- this.baseFormService.initFormGroup(helperFormGroup, formArray.modelConstructor)
108
- formArray.push(helperFormGroup);
109
- } else {
110
- console.error('Can not add primitive form control inside form array.');
111
- }
112
- });
113
-
114
- } else {
115
- formControl.patchValue(res[key]);
116
- }
117
- }else{
118
- // FT: It's okay to do this.
119
- // console.error('You returned something that is not in the save DTO.');
120
- }
121
- });
122
-
123
- if (reroute) {
124
- const savedObjectId = (res as any)[this.formGroup.mainDTOName]?.id;
125
- this.rerouteToSavedObject(savedObjectId); // You always need to have id, because of id == 0 and version change
126
- }
127
-
128
- this.onAfterSave();
129
- });
130
-
131
- this.onAfterSaveRequest();
132
- }else{
133
- this.baseFormService.showInvalidFieldsMessage();
134
- }
135
- }
136
-
137
- rerouteToSavedObject = (rerouteId: number | string): void => {
138
- if(rerouteId == null){
139
- // console.error('You do not have rerouteId in your DTO.')
140
- const currentUrl = this.router.url;
141
- const parentUrl: string = getParentUrl(currentUrl);
142
- this.router.navigateByUrl(parentUrl);
143
- return;
144
- }
145
-
146
- const segments = this.router.url.split('/');
147
- segments[segments.length - 1] = rerouteId.toString();
148
-
149
- const newUrl = segments.join('/');
150
- this.router.navigateByUrl(newUrl);
151
- }
152
-
153
- onBeforeSave = (saveBody?: any) => {}
154
- onAfterSave = () => {}
155
- onAfterSaveRequest = () => {}
156
-
157
- areFormGroupsFromParentFormGroupValid(): boolean {
158
- if(this.formGroup.controls == null)
159
- return true;
160
-
161
- let invalid: boolean = false;
162
-
163
- Object.keys(this.formGroup.controls).forEach(key => {
164
- const formGroupOrControl = this.formGroup.controls[key];
165
-
166
- if (formGroupOrControl instanceof SpiderlyFormGroup){
167
- Object.keys(formGroupOrControl.controls).forEach(key => {
168
- const formControl = formGroupOrControl.controls[key] as SpiderlyFormControl; // this.formArray.markAsDirty(); // FT: For some reason this doesnt work
169
-
170
- if (formGroupOrControl.controlNamesFromHtml.includes(formControl.label) && formControl.invalid) {
171
- formControl.markAsDirty();
172
- invalid = true;
173
- }
174
- });
175
- }
176
- else if (formGroupOrControl instanceof SpiderlyFormControl){
177
- if (formGroupOrControl.invalid) {
178
- formGroupOrControl.markAsDirty();
179
- invalid = true;
180
- }
181
- }
182
-
183
- });
184
-
185
- if (invalid) {
186
- return false;
187
- }
188
-
189
- return true;
190
- }
191
-
192
- //#endregion
193
-
194
- //#region Model List
195
-
196
- getFormArrayControlByIndex<T>(formControlName: keyof T & string, formArray: SpiderlyFormArray<T>, index: number, filter?: (formGroups: SpiderlyFormGroup<T>[]) => SpiderlyFormGroup<T>[]): SpiderlyFormControl {
197
- if(formArray.controlNamesFromHtml.findIndex(x => x === formControlName) === -1)
198
- formArray.controlNamesFromHtml.push(formControlName);
199
-
200
- let filteredFormGroups: SpiderlyFormGroup<T>[];
201
-
202
- if (filter) {
203
- filteredFormGroups = filter(formArray.controls as SpiderlyFormGroup<T>[]);
204
- }
205
- else{
206
- return (formArray.controls[index] as SpiderlyFormGroup<T>).controls[formControlName] as SpiderlyFormControl;
207
- }
208
-
209
- return filteredFormGroups[index]?.controls[formControlName] as SpiderlyFormControl; // FT: Don't change this. It's always possible that change detection occurs before something.
210
- }
211
-
212
- getFormArrayControls<T>(formControlName: keyof T & string, formArray: SpiderlyFormArray<T>, filter?: (formGroups: SpiderlyFormGroup<T>[]) => SpiderlyFormGroup<T>[]): SpiderlyFormControl[] {
213
- if(formArray.controlNamesFromHtml.findIndex(x => x === formControlName) === -1)
214
- formArray.controlNamesFromHtml.push(formControlName);
215
-
216
- let filteredFormGroups: SpiderlyFormGroup<T>[];
217
-
218
- if (filter) {
219
- filteredFormGroups = filter(formArray.controls as SpiderlyFormGroup<T>[]);
220
- }
221
- else{
222
- return (formArray.controls as SpiderlyFormGroup<T>[]).map(x => x.controls[formControlName] as SpiderlyFormControl);
223
- }
224
-
225
- return filteredFormGroups.map(x => x.controls[formControlName] as SpiderlyFormControl);
226
- }
227
-
228
- getFormArrayGroups<T>(formArray: SpiderlyFormArray<T>): SpiderlyFormGroup<T>[]{
229
- return this.baseFormService.getFormArrayGroups(formArray);
230
- }
231
-
232
- addNewFormGroupToFormArray<T>(
233
- formArray: SpiderlyFormArray<T>,
234
- modelConstructor: T & BaseEntity,
235
- index: number,
236
- ) : SpiderlyFormGroup {
237
- return this.baseFormService.addNewFormGroupToFormArray(formArray, modelConstructor, index)
238
- }
239
-
240
- initFormArray<T>(
241
- parentFormGroup: SpiderlyFormGroup,
242
- modelList: (T & BaseEntity)[],
243
- modelConstructor: T & BaseEntity,
244
- formArraySaveBodyName: string,
245
- formArrayTranslationKey: string,
246
- required: boolean = false)
247
- {
248
- return this.baseFormService.initFormArray<T>(
249
- parentFormGroup, modelList, modelConstructor, formArraySaveBodyName, formArrayTranslationKey, required
250
- );
251
- }
252
-
253
- removeFormControlFromTheFormArray(formArray: SpiderlyFormArray, index: number) {
254
- if(index == null)
255
- throw new Error('Can not pass null index.');
256
-
257
- formArray.removeAt(index);
258
- }
259
-
260
- removeFormControlsFromTheFormArray(formArray: SpiderlyFormArray, indexes: number[]) {
261
- // Sort indexes in descending order to avoid index shifts when removing controls
262
- const sortedIndexes = indexes.sort((a, b) => b - a);
263
-
264
- sortedIndexes.forEach(index => {
265
- if (index >= 0 && index < formArray.length) {
266
- formArray.removeAt(index);
267
- }
268
- });
269
- }
270
-
271
- areFormArraysValid(): boolean {
272
- if(this.formGroup.controls == null)
273
- return true;
274
-
275
- let invalid: boolean = false;
276
-
277
- Object.keys(this.formGroup.controls).forEach(key => {
278
- const formArray = this.formGroup.controls[key] as unknown as SpiderlyFormArray;
279
-
280
- if (formArray instanceof SpiderlyFormArray){
281
- (formArray.controls as SpiderlyFormGroup[]).forEach(formGroup => {
282
- Object.keys(formGroup.controls).forEach(key => {
283
- const formControl = formGroup.controls[key] as SpiderlyFormControl; // this.formArray.markAsDirty(); // FT: For some reason this doesn't work
284
-
285
- if (
286
- (formGroup.controlNamesFromHtml.includes(formControl.label) || formArray.controlNamesFromHtml.includes(formControl.label)) &&
287
- formControl.invalid
288
- ) {
289
- formControl.markAsDirty();
290
- invalid = true;
291
- }
292
- });
293
- });
294
-
295
- if (formArray.required == true && formArray.length == 0) {
296
- invalid = true;
297
- this.messageService.warningMessage(this.translocoService.translate('ListCanNotBeEmpty'));
298
- }
299
- }
300
- });
301
-
302
- if (invalid) {
303
- return false;
304
- }
305
-
306
- return true;
307
- }
308
-
309
- onBeforeSaveList(){}
310
- onAfterSaveList(){}
311
- onAfterSaveListRequest(){}
312
-
313
- // FT: Sending LastMenuIconIndexClicked class because of reference type
314
- getCrudMenuForOrderedData = (
315
- formArray: SpiderlyFormArray,
316
- modelConstructor: BaseEntity,
317
- lastMenuIconIndexClicked: LastMenuIconIndexClicked,
318
- adjustFormArrayManually: boolean = false
319
- ): MenuItem[] => {
320
- let crudMenuForOrderedData: MenuItem[] = [
321
- {label: this.translocoService.translate('Remove'), icon: 'pi pi-minus', command: () => {
322
- this.onBeforeRemove(formArray, modelConstructor, lastMenuIconIndexClicked.index);
323
- if (adjustFormArrayManually === false) {
324
- this.removeFormControlFromTheFormArray(formArray, lastMenuIconIndexClicked.index);
325
- }
326
- }},
327
- {label: this.translocoService.translate('AddAbove'), icon: 'pi pi-arrow-up', command: () => {
328
- this.onBeforeAddAbove(formArray, modelConstructor, lastMenuIconIndexClicked.index);
329
- if (adjustFormArrayManually === false) {
330
- this.baseFormService.addNewFormGroupToFormArray(
331
- formArray, modelConstructor, lastMenuIconIndexClicked.index
332
- );
333
- }
334
- }},
335
- {label: this.translocoService.translate('AddBelow'), icon: 'pi pi-arrow-down', command: () => {
336
- this.onBeforeAddBelow(formArray, modelConstructor, lastMenuIconIndexClicked.index);
337
- if (adjustFormArrayManually === false) {
338
- this.baseFormService.addNewFormGroupToFormArray(
339
- formArray, modelConstructor, lastMenuIconIndexClicked.index + 1
340
- );
341
- }
342
- }},
343
- ];
344
-
345
- return crudMenuForOrderedData;
346
- }
347
-
348
- onBeforeRemove = (formArray: SpiderlyFormArray, modelConstructor: any, lastMenuIconIndexClicked: number) => {}
349
-
350
- onBeforeAddAbove = (formArray: SpiderlyFormArray, modelConstructor: any, lastMenuIconIndexClicked: number) => {}
351
-
352
- onBeforeAddBelow = (formArray: SpiderlyFormArray, modelConstructor: any, lastMenuIconIndexClicked: number) => {}
353
-
354
- //#endregion
355
-
356
- }
@@ -1,8 +0,0 @@
1
- <div class="border-round border-1 surface-border p-4 surface-card" [style]="'height: ' + height + 'px;'">
2
- <div [style]="'margin-bottom:' + titleMarginBottom + 'px; margin-top:' + titleMarginTop + 'px;'">
3
- <p-skeleton width="160px" [height]="titleHeight + 'px'"></p-skeleton>
4
- </div>
5
- <div [style]="'height: ' + dataHeight + 'px;'">
6
- <p-skeleton width="100%" height="100%"/>
7
- </div>
8
- </div>
@@ -1,21 +0,0 @@
1
- import { Component, Input } from "@angular/core";
2
- import { SkeletonModule } from 'primeng/skeleton';
3
-
4
- @Component({
5
- selector: 'card-skeleton',
6
- templateUrl: './card-skeleton.component.html',
7
- styles: [],
8
- imports: [SkeletonModule]
9
- })
10
- export class CardSkeletonComponent {
11
- @Input() height: number = 400;
12
- titleHeight: number = 23;
13
- dataHeight: number;
14
- padding: number = 21;
15
- titleMarginBottom: number = 14;
16
- titleMarginTop: number = 4;
17
-
18
- ngOnInit(){
19
- this.dataHeight = this.height - (this.titleHeight + this.padding * 2 + this.titleMarginBottom + this.titleMarginTop)
20
- }
21
- }
@@ -1,17 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { ConfigBaseService } from '../../services/config-base.service'
3
-
4
- @Component({
5
- selector: 'footer',
6
- templateUrl: './app.footer.component.html',
7
- standalone: true
8
- })
9
- export class FooterComponent {
10
- companyName: string = this.config.companyName;
11
-
12
- constructor(
13
- private config: ConfigBaseService
14
- ) {
15
-
16
- }
17
- }
@@ -1,3 +0,0 @@
1
- <div class="layout-footer">
2
- <span class="font-medium ml-2">{{companyName}}</span>
3
- </div>
@@ -1,17 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { ConfigBaseService } from '../../services/config-base.service'
3
-
4
- @Component({
5
- selector: 'footer',
6
- templateUrl: './footer.component.html',
7
- standalone: true
8
- })
9
- export class FooterComponent {
10
- companyName: string = this.config.companyName;
11
-
12
- constructor(
13
- private config: ConfigBaseService
14
- ) {
15
-
16
- }
17
- }
@@ -1,15 +0,0 @@
1
- <div [ngClass]="{
2
- 'last-child-zero-margin': last,
3
- 'card-margin-bottom': true,
4
- }">
5
- <spiderly-panel [crudMenu]="crudMenu" [showCrudMenu]="showCrudMenu" (onMenuIconClick)="menuIconClick($event)" [showRemoveIcon]="showRemoveIcon" (onRemoveIconClick)="removeIconClick()" [index]="index">
6
- <panel-header [title]="header" [index]="index" [showIcon]="false"></panel-header>
7
-
8
- <panel-body>
9
- <ng-content>
10
- <!-- Custom things below description -->
11
- </ng-content>
12
- </panel-body>
13
-
14
- </spiderly-panel>
15
- </div>
@@ -1,48 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { Component, EventEmitter, Input, Output } from '@angular/core';
3
- import { FormBuilder } from '@angular/forms';
4
- import { MenuItem } from 'primeng/api';
5
- import { SpiderlyPanelsModule } from "../spiderly-panels/spiderly-panels.module";
6
- import { PrimengModule } from '../../modules/primeng.module';
7
-
8
- @Component({
9
- selector: 'index-card',
10
- templateUrl: './index-card.component.html',
11
- imports: [
12
- CommonModule,
13
- PrimengModule,
14
- SpiderlyPanelsModule
15
- ]
16
- })
17
- export class IndexCardComponent {
18
- @Input() last: boolean;
19
- @Input() index: number;
20
- @Input() header: string = '';
21
- @Input() description: string;
22
- @Input() showRemoveIcon: boolean;
23
- @Input() showCrudMenu: boolean = true;
24
-
25
- @Input() crudMenu: MenuItem[];
26
-
27
- @Output() onMenuIconClick = new EventEmitter<number>();
28
- @Output() onRemoveIconClick = new EventEmitter<null>();
29
-
30
- constructor(
31
- protected formBuilder: FormBuilder,
32
- ) {
33
-
34
- }
35
-
36
- ngOnInit(){
37
- // console.log(this.last);
38
- }
39
-
40
- menuIconClick(index: number){
41
- this.onMenuIconClick.next(index);
42
- }
43
-
44
- removeIconClick(){
45
- this.onRemoveIconClick.next(null);
46
- }
47
-
48
- }
@@ -1,18 +0,0 @@
1
- <div class="card responsive-card-padding" style="background-color: var(--p-primary-100); position: relative; overflow: hidden;">
2
- <!-- TODO FT: Translate -->
3
- <div style="display: flex; align-items: center; gap: 21px; position: relative; z-index: 2;">
4
- <i class="pi pi-info-circle" style="font-size: 26px; color: var(--p-primary-color);"></i>
5
- <div>
6
- <div class="header" style="color:var(--p-primary-color); font-weight: 600; text-align: left;">
7
- {{header}}
8
- </div>
9
- <div style="text-align: left; margin-top: 8px;">
10
- <ng-content></ng-content>
11
- </div>
12
- </div>
13
- </div>
14
-
15
- <div class="card-overflow-icon" style="position: absolute; overflow: hidden; right: 8px; top: -25px; z-index: 1;">
16
- <i class="pi pi-info-circle" style="font-size: 270px;"></i>
17
- </div>
18
- </div>
@@ -1,29 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { Component, Input } from '@angular/core';
3
- import { FormBuilder } from '@angular/forms';
4
- import { SpiderlyPanelsModule } from "../spiderly-panels/spiderly-panels.module";
5
- import { PrimengModule } from '../../modules/primeng.module';
6
-
7
- @Component({
8
- selector: 'info-card',
9
- templateUrl: './info-card.component.html',
10
- imports: [
11
- CommonModule,
12
- PrimengModule,
13
- SpiderlyPanelsModule
14
- ]
15
- })
16
- export class InfoCardComponent {
17
- @Input() public header: string = '';
18
- @Input() public description: string;
19
-
20
- constructor(
21
- protected formBuilder: FormBuilder,
22
- ) {
23
-
24
- }
25
-
26
- ngOnInit(){
27
- }
28
-
29
- }
@@ -1,140 +0,0 @@
1
- import { Component, OnDestroy, Renderer2, ViewChild } from '@angular/core';
2
- import { NavigationEnd, Router } from '@angular/router';
3
- import { filter, Subscription } from 'rxjs';
4
- import { AppSidebarComponent } from './sidebar/sidebar.component';
5
- import { AppTopBarComponent } from './topbar/topbar.component';
6
- import { LayoutBaseService } from '../../services/app-layout-base.service';
7
-
8
- @Component({
9
- selector: 'layout-base',
10
- template: '',
11
- standalone: true
12
- })
13
- export class LayoutBaseComponent implements OnDestroy {
14
-
15
- overlayMenuOpenSubscription: Subscription;
16
-
17
- menuOutsideClickListener: any;
18
-
19
- profileMenuOutsideClickListener: any;
20
-
21
- @ViewChild(AppSidebarComponent) appSidebar!: AppSidebarComponent;
22
-
23
- @ViewChild(AppTopBarComponent) appTopbar!: AppTopBarComponent;
24
-
25
- constructor(
26
- protected layoutService: LayoutBaseService,
27
- protected renderer: Renderer2,
28
- protected router: Router,
29
- ) {
30
- this.overlayMenuOpenSubscription = this.layoutService.overlayOpen$.subscribe(() => {
31
- if (!this.menuOutsideClickListener) {
32
- this.menuOutsideClickListener = this.renderer.listen('document', 'click', event => {
33
- const isOutsideClicked = !(
34
- this.appSidebar.el.nativeElement.isSameNode(event.target) ||
35
- this.appSidebar.el.nativeElement.contains(event.target) ||
36
- this.appTopbar.menuButton.nativeElement.isSameNode(event.target) ||
37
- this.appTopbar.menuButton.nativeElement.contains(event.target) ||
38
- (event.target.closest('.p-autocomplete-items')) ||
39
- (event.target.closest('.p-autocomplete-clear-icon'))
40
- );
41
-
42
- if (isOutsideClicked) {
43
- this.hideMenu();
44
- }
45
- });
46
- }
47
-
48
- if (!this.profileMenuOutsideClickListener) {
49
- this.profileMenuOutsideClickListener = this.renderer.listen('document', 'click', event => {
50
- const isOutsideClicked = !(
51
- this.appTopbar.menu.nativeElement.isSameNode(event.target) ||
52
- this.appTopbar.menu.nativeElement.contains(event.target)
53
- );
54
-
55
- if (isOutsideClicked) {
56
- this.hideProfileMenu();
57
- }
58
- });
59
- }
60
-
61
- if (this.layoutService.state.staticMenuMobileActive) {
62
- this.blockBodyScroll();
63
- }
64
- });
65
-
66
- this.router.events.pipe(filter(event => event instanceof NavigationEnd))
67
- .subscribe(() => {
68
- this.hideMenu();
69
- this.hideProfileMenu();
70
- });
71
- }
72
-
73
- hideMenu() {
74
- this.layoutService.state.overlayMenuActive = false;
75
- this.layoutService.state.staticMenuMobileActive = false;
76
- this.layoutService.state.menuHoverActive = false;
77
- if (this.menuOutsideClickListener) {
78
- this.menuOutsideClickListener();
79
- this.menuOutsideClickListener = null;
80
- }
81
- this.unblockBodyScroll();
82
- }
83
-
84
- hideProfileMenu() {
85
- this.layoutService.state.profileSidebarVisible = false;
86
- if (this.profileMenuOutsideClickListener) {
87
- this.profileMenuOutsideClickListener();
88
- this.profileMenuOutsideClickListener = null;
89
- }
90
- }
91
-
92
- blockBodyScroll(): void {
93
- if (document.body.classList) {
94
- document.body.classList.add('blocked-scroll');
95
- }
96
- else {
97
- document.body.className += ' blocked-scroll';
98
- }
99
- }
100
-
101
- unblockBodyScroll(): void {
102
- if (document.body.classList) {
103
- document.body.classList.remove('blocked-scroll');
104
- }
105
- else {
106
- document.body.className = document.body.className.replace(new RegExp('(^|\\b)' +
107
- 'blocked-scroll'.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
108
- }
109
- }
110
-
111
- get containerClass() {
112
- return {
113
- 'layout-theme-light': this.layoutService.layoutConfig.colorScheme === 'light',
114
- 'layout-theme-dark': this.layoutService.layoutConfig.colorScheme === 'dark',
115
- 'layout-overlay': this.layoutService.layoutConfig.menuMode === 'overlay',
116
- 'layout-static': this.layoutService.layoutConfig.menuMode === 'static',
117
- 'layout-static-inactive': this.layoutService.state.staticMenuDesktopInactive && this.layoutService.layoutConfig.menuMode === 'static',
118
- 'layout-overlay-active': this.layoutService.state.overlayMenuActive,
119
- 'layout-mobile-active': this.layoutService.state.staticMenuMobileActive,
120
- 'p-input-filled': this.layoutService.layoutConfig.inputStyle === 'filled',
121
- 'p-ripple-disabled': !this.layoutService.layoutConfig.ripple
122
- }
123
- }
124
-
125
- ngOnDestroy() {
126
- if (this.overlayMenuOpenSubscription) {
127
- this.overlayMenuOpenSubscription.unsubscribe();
128
- }
129
-
130
- if (this.menuOutsideClickListener) {
131
- this.menuOutsideClickListener();
132
- }
133
-
134
- this.onAfterNgDestroy();
135
- }
136
-
137
- onAfterNgDestroy = () => {}
138
-
139
- }
140
-