cat-qw-lib 0.0.2 → 0.0.3

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 (248) hide show
  1. package/fesm2022/cat-qw-lib.mjs +2033 -0
  2. package/fesm2022/cat-qw-lib.mjs.map +1 -0
  3. package/index.d.ts +5 -0
  4. package/lib/admin/action-admin/action-admin.module.d.ts +9 -0
  5. package/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.d.ts +5 -0
  6. package/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.d.ts +12 -0
  7. package/lib/admin/action-admin/models/action.model.d.ts +9 -0
  8. package/lib/admin/action-admin/state/action.service.d.ts +13 -0
  9. package/lib/admin/action-admin/state/action.store.d.ts +8 -0
  10. package/lib/admin/api-admin/api-admin.module.d.ts +18 -0
  11. package/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.d.ts +30 -0
  12. package/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.d.ts +10 -0
  13. package/lib/admin/api-admin/components/api-credential-form/api-credential-form.component.d.ts +14 -0
  14. package/lib/admin/api-admin/models/api-admin.model.d.ts +15 -0
  15. package/lib/admin/api-admin/models/credentials.model.d.ts +4 -0
  16. package/lib/admin/api-admin/state/api-admin.service.d.ts +16 -0
  17. package/lib/admin/api-admin/state/api-admin.store.d.ts +8 -0
  18. package/lib/shared/_base/base-control/base-control.component.d.ts +22 -0
  19. package/lib/shared/_base/base-form/base-form.component.d.ts +27 -0
  20. package/lib/shared/_base/base-list/base-list.component.d.ts +16 -0
  21. package/lib/shared/components/form-container/form-container.component.d.ts +26 -0
  22. package/lib/shared/components/sidebar/sidebar.component.d.ts +13 -0
  23. package/lib/shared/constant/CSS.d.ts +11 -0
  24. package/lib/shared/constant/DATASOURCES.d.ts +10 -0
  25. package/lib/shared/constant/ERROR.d.ts +3 -0
  26. package/lib/shared/constant/HEADERS.d.ts +4 -0
  27. package/lib/shared/constant/LIST-CONFIG.d.ts +8 -0
  28. package/lib/shared/constant/LOOKUPS.d.ts +3 -0
  29. package/lib/shared/constant/ROUTES.d.ts +12 -0
  30. package/lib/shared/constant/SHARED.d.ts +565 -0
  31. package/lib/shared/constant/URLS.d.ts +3 -0
  32. package/lib/shared/controls/button/button.component.d.ts +6 -0
  33. package/lib/shared/controls/check-box/check-box.component.d.ts +6 -0
  34. package/lib/shared/controls/date/date.component.d.ts +12 -0
  35. package/lib/shared/controls/dropdown/dropdown.component.d.ts +19 -0
  36. package/lib/shared/controls/file-upload/file-upload.component.d.ts +7 -0
  37. package/lib/shared/controls/password/password.component.d.ts +9 -0
  38. package/lib/shared/controls/text-area/text-area.component.d.ts +8 -0
  39. package/lib/shared/controls/text-box/text-box.component.d.ts +7 -0
  40. package/lib/shared/controls/username/username.component.d.ts +6 -0
  41. package/{src/lib/shared/index.ts → lib/shared/index.d.ts} +30 -35
  42. package/lib/shared/models/attribute.model.d.ts +41 -0
  43. package/lib/shared/models/base.model.d.ts +3 -0
  44. package/lib/shared/models/list.model.d.ts +11 -0
  45. package/lib/shared/pipe/capitalize-words.pipe.d.ts +7 -0
  46. package/lib/shared/services/app-config.service.d.ts +12 -0
  47. package/lib/shared/services/auth/auth.guard.d.ts +12 -0
  48. package/lib/shared/services/date-parser.service.d.ts +7 -0
  49. package/lib/shared/services/list.service.d.ts +13 -0
  50. package/lib/shared/services/session.service.d.ts +13 -0
  51. package/lib/shared/services/table.builder.d.ts +11 -0
  52. package/lib/shared/services/validator.service.d.ts +7 -0
  53. package/lib/shared/shared.module.d.ts +32 -0
  54. package/lib/shared/state/base.query.d.ts +19 -0
  55. package/lib/shared/state/base.service.d.ts +27 -0
  56. package/lib/shared/state/base.state.d.ts +4 -0
  57. package/lib/shared/state/base.store.d.ts +24 -0
  58. package/lib/shared/table-primary/components/table-primary.component.d.ts +26 -0
  59. package/lib/shared/table-primary/models/table-primary-header.model.d.ts +6 -0
  60. package/lib/shared/table-primary/models/table-primary.model.d.ts +5 -0
  61. package/package.json +25 -16
  62. package/{src/public-api.ts → public-api.d.ts} +6 -11
  63. package/ng-package.json +0 -10
  64. package/src/lib/admin/action-admin/action-admin.module.ts +0 -16
  65. package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.html +0 -1
  66. package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.scss +0 -0
  67. package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.spec.ts +0 -23
  68. package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.ts +0 -11
  69. package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.html +0 -5
  70. package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.scss +0 -0
  71. package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.spec.ts +0 -23
  72. package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.ts +0 -24
  73. package/src/lib/admin/action-admin/models/action.model.ts +0 -12
  74. package/src/lib/admin/action-admin/state/action.query.ts +0 -11
  75. package/src/lib/admin/action-admin/state/action.service.ts +0 -18
  76. package/src/lib/admin/action-admin/state/action.state.ts +0 -14
  77. package/src/lib/admin/action-admin/state/action.store.ts +0 -14
  78. package/src/lib/admin/admin.module.ts +0 -22
  79. package/src/lib/admin/api-admin/api-admin.module.ts +0 -39
  80. package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.html +0 -96
  81. package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.scss +0 -6
  82. package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.spec.ts +0 -23
  83. package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.ts +0 -94
  84. package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.html +0 -6
  85. package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.scss +0 -0
  86. package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.spec.ts +0 -23
  87. package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.ts +0 -17
  88. package/src/lib/admin/api-admin/components/api-credential-form/api-credential-form.component.html +0 -29
  89. package/src/lib/admin/api-admin/components/api-credential-form/api-credential-form.component.scss +0 -0
  90. package/src/lib/admin/api-admin/components/api-credential-form/api-credential-form.component.spec.ts +0 -21
  91. package/src/lib/admin/api-admin/components/api-credential-form/api-credential-form.component.ts +0 -25
  92. package/src/lib/admin/api-admin/models/api-admin.model.ts +0 -16
  93. package/src/lib/admin/api-admin/models/credentials.model.ts +0 -4
  94. package/src/lib/admin/api-admin/state/api-admin.query.ts +0 -14
  95. package/src/lib/admin/api-admin/state/api-admin.service.ts +0 -31
  96. package/src/lib/admin/api-admin/state/api-admin.state.ts +0 -14
  97. package/src/lib/admin/api-admin/state/api-admin.store.ts +0 -13
  98. package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.css +0 -0
  99. package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.html +0 -1
  100. package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.spec.ts +0 -23
  101. package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.ts +0 -11
  102. package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.css +0 -0
  103. package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.html +0 -1
  104. package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.spec.ts +0 -23
  105. package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.ts +0 -11
  106. package/src/lib/admin/dd-admin/dd-admin.module.ts +0 -12
  107. package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.css +0 -0
  108. package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.html +0 -1
  109. package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.spec.ts +0 -23
  110. package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.ts +0 -11
  111. package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.css +0 -0
  112. package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.html +0 -1
  113. package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.spec.ts +0 -23
  114. package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.ts +0 -11
  115. package/src/lib/admin/queue-admin/queue-admin.module.ts +0 -12
  116. package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.css +0 -0
  117. package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.html +0 -1
  118. package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.spec.ts +0 -23
  119. package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.ts +0 -11
  120. package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.css +0 -0
  121. package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.html +0 -1
  122. package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.spec.ts +0 -23
  123. package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.ts +0 -11
  124. package/src/lib/admin/widget-admin/widget-admin.module.ts +0 -12
  125. package/src/lib/shared/_base/base-control/base-control.component.html +0 -1
  126. package/src/lib/shared/_base/base-control/base-control.component.scss +0 -0
  127. package/src/lib/shared/_base/base-control/base-control.component.spec.ts +0 -21
  128. package/src/lib/shared/_base/base-control/base-control.component.ts +0 -55
  129. package/src/lib/shared/_base/base-form/base-form.component.html +0 -1
  130. package/src/lib/shared/_base/base-form/base-form.component.scss +0 -0
  131. package/src/lib/shared/_base/base-form/base-form.component.spec.ts +0 -21
  132. package/src/lib/shared/_base/base-form/base-form.component.ts +0 -81
  133. package/src/lib/shared/_base/base-list/base-list.component.html +0 -1
  134. package/src/lib/shared/_base/base-list/base-list.component.scss +0 -0
  135. package/src/lib/shared/_base/base-list/base-list.component.spec.ts +0 -21
  136. package/src/lib/shared/_base/base-list/base-list.component.ts +0 -31
  137. package/src/lib/shared/components/form-container/form-container.component.html +0 -55
  138. package/src/lib/shared/components/form-container/form-container.component.scss +0 -108
  139. package/src/lib/shared/components/form-container/form-container.component.spec.ts +0 -21
  140. package/src/lib/shared/components/form-container/form-container.component.ts +0 -55
  141. package/src/lib/shared/components/sidebar/sidebar.component.html +0 -13
  142. package/src/lib/shared/components/sidebar/sidebar.component.scss +0 -45
  143. package/src/lib/shared/components/sidebar/sidebar.component.spec.ts +0 -21
  144. package/src/lib/shared/components/sidebar/sidebar.component.ts +0 -26
  145. package/src/lib/shared/constant/CSS.ts +0 -9
  146. package/src/lib/shared/constant/DATASOURCES.ts +0 -10
  147. package/src/lib/shared/constant/ERROR.ts +0 -3
  148. package/src/lib/shared/constant/HEADERS.ts +0 -4
  149. package/src/lib/shared/constant/LIST-CONFIG.ts +0 -10
  150. package/src/lib/shared/constant/LOOKUPS.ts +0 -3
  151. package/src/lib/shared/constant/ROUTES.ts +0 -12
  152. package/src/lib/shared/constant/SHARED.ts +0 -603
  153. package/src/lib/shared/constant/URLS.ts +0 -3
  154. package/src/lib/shared/controls/button/button.component.html +0 -25
  155. package/src/lib/shared/controls/button/button.component.scss +0 -0
  156. package/src/lib/shared/controls/button/button.component.spec.ts +0 -21
  157. package/src/lib/shared/controls/button/button.component.ts +0 -15
  158. package/src/lib/shared/controls/check-box/check-box.component.html +0 -22
  159. package/src/lib/shared/controls/check-box/check-box.component.scss +0 -32
  160. package/src/lib/shared/controls/check-box/check-box.component.spec.ts +0 -26
  161. package/src/lib/shared/controls/check-box/check-box.component.ts +0 -16
  162. package/src/lib/shared/controls/date/date.component.html +0 -43
  163. package/src/lib/shared/controls/date/date.component.scss +0 -0
  164. package/src/lib/shared/controls/date/date.component.spec.ts +0 -21
  165. package/src/lib/shared/controls/date/date.component.ts +0 -42
  166. package/src/lib/shared/controls/dropdown/dropdown.component.html +0 -28
  167. package/src/lib/shared/controls/dropdown/dropdown.component.scss +0 -12
  168. package/src/lib/shared/controls/dropdown/dropdown.component.ts +0 -71
  169. package/src/lib/shared/controls/file-upload/file-upload.component.html +0 -18
  170. package/src/lib/shared/controls/file-upload/file-upload.component.scss +0 -0
  171. package/src/lib/shared/controls/file-upload/file-upload.component.spec.ts +0 -21
  172. package/src/lib/shared/controls/file-upload/file-upload.component.ts +0 -19
  173. package/src/lib/shared/controls/number-feild/number-feild.component.html +0 -39
  174. package/src/lib/shared/controls/number-feild/number-feild.component.scss +0 -13
  175. package/src/lib/shared/controls/number-feild/number-feild.component.spec.ts +0 -21
  176. package/src/lib/shared/controls/number-feild/number-feild.component.ts +0 -35
  177. package/src/lib/shared/controls/password/password.component.html +0 -22
  178. package/src/lib/shared/controls/password/password.component.scss +0 -0
  179. package/src/lib/shared/controls/password/password.component.spec.ts +0 -28
  180. package/src/lib/shared/controls/password/password.component.ts +0 -24
  181. package/src/lib/shared/controls/text-area/text-area.component.html +0 -36
  182. package/src/lib/shared/controls/text-area/text-area.component.scss +0 -22
  183. package/src/lib/shared/controls/text-area/text-area.component.spec.ts +0 -23
  184. package/src/lib/shared/controls/text-area/text-area.component.ts +0 -25
  185. package/src/lib/shared/controls/text-box/text-box.component.html +0 -44
  186. package/src/lib/shared/controls/text-box/text-box.component.scss +0 -25
  187. package/src/lib/shared/controls/text-box/text-box.component.spec.ts +0 -30
  188. package/src/lib/shared/controls/text-box/text-box.component.ts +0 -26
  189. package/src/lib/shared/controls/username/username.component.html +0 -16
  190. package/src/lib/shared/controls/username/username.component.scss +0 -0
  191. package/src/lib/shared/controls/username/username.component.spec.ts +0 -29
  192. package/src/lib/shared/controls/username/username.component.ts +0 -17
  193. package/src/lib/shared/models/attribute.model.ts +0 -42
  194. package/src/lib/shared/models/base.model.ts +0 -3
  195. package/src/lib/shared/models/list.model.ts +0 -27
  196. package/src/lib/shared/models/message.model.ts +0 -4
  197. package/src/lib/shared/pipe/capitalize-words.pipe.spec.ts +0 -8
  198. package/src/lib/shared/pipe/capitalize-words.pipe.ts +0 -17
  199. package/src/lib/shared/services/app-config.service.spec.ts +0 -16
  200. package/src/lib/shared/services/app-config.service.ts +0 -25
  201. package/src/lib/shared/services/auth/auth.guard.spec.ts +0 -17
  202. package/src/lib/shared/services/auth/auth.guard.ts +0 -25
  203. package/src/lib/shared/services/data-transformer.service.spec.ts +0 -16
  204. package/src/lib/shared/services/data-transformer.service.ts +0 -41
  205. package/src/lib/shared/services/date-parser.service.spec.ts +0 -16
  206. package/src/lib/shared/services/date-parser.service.ts +0 -54
  207. package/src/lib/shared/services/list.service.spec.ts +0 -16
  208. package/src/lib/shared/services/list.service.ts +0 -53
  209. package/src/lib/shared/services/session.service.spec.ts +0 -16
  210. package/src/lib/shared/services/session.service.ts +0 -37
  211. package/src/lib/shared/services/table.builder.ts +0 -38
  212. package/src/lib/shared/services/validator.service.spec.ts +0 -16
  213. package/src/lib/shared/services/validator.service.ts +0 -13
  214. package/src/lib/shared/shared.module.ts +0 -62
  215. package/src/lib/shared/state/base.query.ts +0 -48
  216. package/src/lib/shared/state/base.service.ts +0 -69
  217. package/src/lib/shared/state/base.state.ts +0 -6
  218. package/src/lib/shared/state/base.store.ts +0 -56
  219. package/src/lib/shared/table-primary/components/table-primary.component.html +0 -56
  220. package/src/lib/shared/table-primary/components/table-primary.component.scss +0 -187
  221. package/src/lib/shared/table-primary/components/table-primary.component.spec.ts +0 -21
  222. package/src/lib/shared/table-primary/components/table-primary.component.ts +0 -71
  223. package/src/lib/shared/table-primary/models/table-primary-header.model.ts +0 -7
  224. package/src/lib/shared/table-primary/models/table-primary.model.ts +0 -6
  225. package/src/lib/widget/components/widget-body/widget-body.component.html +0 -1
  226. package/src/lib/widget/components/widget-body/widget-body.component.scss +0 -0
  227. package/src/lib/widget/components/widget-body/widget-body.component.spec.ts +0 -23
  228. package/src/lib/widget/components/widget-body/widget-body.component.ts +0 -11
  229. package/src/lib/widget/components/widget-container/widget-container.component.css +0 -0
  230. package/src/lib/widget/components/widget-container/widget-container.component.html +0 -1
  231. package/src/lib/widget/components/widget-container/widget-container.component.spec.ts +0 -23
  232. package/src/lib/widget/components/widget-container/widget-container.component.ts +0 -11
  233. package/src/lib/widget/components/widget-footer/widget-footer.component.css +0 -0
  234. package/src/lib/widget/components/widget-footer/widget-footer.component.html +0 -1
  235. package/src/lib/widget/components/widget-footer/widget-footer.component.spec.ts +0 -23
  236. package/src/lib/widget/components/widget-footer/widget-footer.component.ts +0 -11
  237. package/src/lib/widget/components/widget-header/widget-header.component.css +0 -0
  238. package/src/lib/widget/components/widget-header/widget-header.component.html +0 -1
  239. package/src/lib/widget/components/widget-header/widget-header.component.spec.ts +0 -23
  240. package/src/lib/widget/components/widget-header/widget-header.component.ts +0 -11
  241. package/src/lib/widget/components/widget-item/widget-item.component.css +0 -0
  242. package/src/lib/widget/components/widget-item/widget-item.component.html +0 -1
  243. package/src/lib/widget/components/widget-item/widget-item.component.spec.ts +0 -23
  244. package/src/lib/widget/components/widget-item/widget-item.component.ts +0 -11
  245. package/src/lib/widget/widget.module.ts +0 -12
  246. package/tsconfig.lib.json +0 -15
  247. package/tsconfig.lib.prod.json +0 -11
  248. package/tsconfig.spec.json +0 -15
@@ -1,37 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { Router } from '@angular/router';
3
- import { SHARED } from '../constant/SHARED';
4
-
5
- @Injectable({
6
- providedIn: 'root'
7
- })
8
- export class SessionService {
9
-
10
- constructor(public router : Router) {
11
-
12
- }
13
-
14
- getUserRole() {
15
- const role = sessionStorage.getItem('role');
16
- return role;
17
- }
18
-
19
- setUserSession(data: any): void {
20
- sessionStorage.setItem(SHARED.SESSIONKEY, JSON.stringify(data));
21
- }
22
-
23
- getUserSession(): any {
24
- const sessionData = sessionStorage.getItem(SHARED.SESSIONKEY);
25
- return sessionData ? JSON.parse(sessionData) : null;
26
- }
27
-
28
-
29
- getSessionID(){
30
- return 1;
31
- }
32
-
33
- clearSession(): void {
34
- sessionStorage.clear();
35
- localStorage.clear();
36
- }
37
- }
@@ -1,38 +0,0 @@
1
- import { Injectable } from "@angular/core";
2
- import { TablePrimaryModel } from "../table-primary/models/table-primary.model";
3
- import { SHARED } from "../constant/SHARED";
4
- import { TablePrimaryHeaderModel } from "../table-primary/models/table-primary-header.model";
5
-
6
-
7
- @Injectable({
8
- providedIn:'root'
9
- })
10
- export class TableBuilder{
11
-
12
- public hiddenHeaders: string[] = [];
13
- buildTable(records: any[], headerWidths?: { [key: string]: string }): TablePrimaryModel {
14
- const table = new TablePrimaryModel();
15
- table.records = records;
16
- if (records && records.length > 0) {
17
- table.headers = this.buildHeaders(Object.keys(records[0]),headerWidths);
18
- } else {
19
- table.headers = [];
20
- }
21
- return table;
22
- }
23
-
24
- private buildHeaders(keys: string[], headerWidths: { [key: string]: string } | undefined): TablePrimaryHeaderModel[] {
25
-
26
- const headers: TablePrimaryHeaderModel[] = [];
27
- const filteredKeys = keys.filter(
28
- key => key !== SHARED.ID && !this.hiddenHeaders.includes(key) // hide headers
29
- );
30
- for (const key of filteredKeys) {
31
- const header = new TablePrimaryHeaderModel();
32
- header.name = key;
33
- if(headerWidths) header.width = headerWidths[key] || SHARED.WIDTH_AUTO;
34
- headers.push(header);
35
- }
36
- return headers;
37
- }
38
- }
@@ -1,16 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { ValidatorService } from './validator.service';
4
-
5
- describe('ValidatorService', () => {
6
- let service: ValidatorService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(ValidatorService);
11
- });
12
-
13
- it('should be created', () => {
14
- expect(service).toBeTruthy();
15
- });
16
- });
@@ -1,13 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
-
3
- @Injectable({
4
- providedIn: 'root'
5
- })
6
- export class ValidatorService {
7
-
8
- constructor() { }
9
-
10
- handleValidateRecords(record:any){
11
- return true
12
- }
13
- }
@@ -1,62 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { FormsModule } from '@angular/forms';
4
- import { InputTextModule } from 'primeng/inputtext';
5
- import { DropdownModule } from 'primeng/dropdown';
6
- import { InputGroupModule } from 'primeng/inputgroup';
7
- import { ButtonModule } from 'primeng/button';
8
- import { CardModule } from 'primeng/card';
9
- import { SidebarModule } from 'primeng/sidebar';
10
- import { SidebarComponent } from './components/sidebar/sidebar.component';
11
- import { CheckBoxComponent } from './controls/check-box/check-box.component';
12
- import { DragDropModule } from 'primeng/dragdrop';
13
- import { FormContainerComponent } from './components/form-container/form-container.component';
14
- import { BaseListComponent } from './_base/base-list/base-list.component';
15
- import { DropdownComponent } from './controls/dropdown/dropdown.component'
16
- import { BaseFormComponent } from './_base/base-form/base-form.component';
17
- import { TextBoxComponent } from './controls/text-box/text-box.component';
18
- import { InputTextareaModule } from 'primeng/inputtextarea';
19
- import { DividerModule } from 'primeng/divider';
20
- import { DateComponent } from './controls/date/date.component';
21
- import { DialogModule } from 'primeng/dialog';
22
- import { TimelineModule } from 'primeng/timeline';
23
- import { ListboxModule } from 'primeng/listbox';
24
- import { CheckboxModule } from 'primeng/checkbox';
25
- import { FileUploadComponent } from './controls/file-upload/file-upload.component';
26
- import { FileUploadModule } from 'primeng/fileupload';
27
- import { CapitalizeWordsPipe } from './pipe/capitalize-words.pipe';
28
- import { TextAreaComponent } from './controls/text-area/text-area.component';
29
- @NgModule({
30
-
31
- declarations: [ SidebarComponent],
32
- imports: [
33
- CommonModule,
34
- FormsModule,
35
- InputTextModule,
36
- ButtonModule,
37
- DropdownModule,
38
- InputGroupModule,
39
- CardModule,
40
- SidebarModule,
41
- CheckBoxComponent,
42
- DragDropModule,
43
- FormContainerComponent,
44
- BaseListComponent,
45
- DropdownComponent,
46
- BaseListComponent,
47
- TextBoxComponent,
48
- InputTextareaModule,
49
- DividerModule,
50
- DateComponent,
51
- DialogModule,
52
- TimelineModule,
53
- ListboxModule,
54
- CheckboxModule,
55
- FileUploadComponent,
56
- FileUploadModule,
57
- CapitalizeWordsPipe,
58
- TextAreaComponent
59
- ],
60
- exports: [ CapitalizeWordsPipe,TextBoxComponent,FormsModule,ListboxModule,DialogModule, CheckboxModule,DropdownComponent,FormContainerComponent, BaseListComponent, SidebarComponent, DividerModule, CardModule]
61
- })
62
- export class SharedModule { }
@@ -1,48 +0,0 @@
1
- import { QueryEntity } from '@datorama/akita';
2
- import { BaseEntityState, BaseStore } from './base.store';
3
- import { Injectable } from '@angular/core';
4
- import { Observable } from 'rxjs';
5
- import { BaseModel } from '../models/base.model';
6
-
7
- @Injectable({ providedIn: 'root' })
8
- export class BaseQuery<T extends BaseModel> extends QueryEntity<BaseEntityState<T>, T> {
9
- constructor(protected override store: BaseStore<T>) {
10
- super(store);
11
- }
12
-
13
- selectAllEntities() {
14
- return this.selectAll();
15
- }
16
-
17
- selectEntityById(id: string) {
18
- return this.selectEntity(id);
19
- }
20
-
21
- getLists(): Observable<any> {
22
- return this.select(state => state.lists);
23
- }
24
-
25
- getRecordChange() {
26
- return this.store.recordChange$.asObservable();
27
- }
28
-
29
- getOnDocumentAccept() {
30
- return this.store.onDocumentAccept$.asObservable();
31
- }
32
-
33
- getonDailogClose() {
34
- return this.store.onDailogClose$.asObservable();
35
- }
36
-
37
- getOpenDocument() {
38
- return this.store.openDocument$.asObservable();
39
- }
40
-
41
- getAlertMessage() {
42
- return this.store.alertMessage$.asObservable();
43
- }
44
-
45
-
46
-
47
-
48
- }
@@ -1,69 +0,0 @@
1
- import { Injectable, Injector } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { Observable } from 'rxjs';
4
- import { map, tap } from 'rxjs/operators';
5
- import { BaseStore } from './base.store';
6
- import { SHARED } from '../constant/SHARED';
7
- import { BaseModel } from '../models/base.model';
8
- import { AppConfigService } from '../services/app-config.service';
9
- import { ListService } from '../services/list.service';
10
-
11
- @Injectable({providedIn:'root'})
12
- export class BaseService<T extends BaseModel> {
13
- public _pathName: string = SHARED.EMPTY;
14
- protected lists!:string[];
15
- protected http: HttpClient;
16
- protected list!:[]
17
- constructor(http: HttpClient, private store: BaseStore<T>, private appConfigService: AppConfigService, protected listService : ListService) {
18
-
19
- this.http = http;
20
- }
21
-
22
-
23
- get apiUrl(): string {
24
- return this.appConfigService.apiBaseUrl;
25
- }
26
-
27
- set pathName(value: string) {
28
- this._pathName = value;
29
- }
30
-
31
- async initList() {
32
- let response = await this.listService.getLists(this.list)
33
- if (response && response.length > 0) {
34
- this.store.setList(response as any)
35
- }
36
-
37
- }
38
-
39
- create(entity: T): Observable<T> {
40
- return this.http.post<T>(this.apiUrl + this._pathName, entity).pipe(
41
- tap((newEntity: T) => this.store.add(newEntity))
42
- );
43
- }
44
-
45
- getAll(): Observable<T[]> {
46
- return this.http.get<T[]>(this.apiUrl + this._pathName).pipe(
47
- tap((entities: T[]) => this.store.set(entities))
48
- );
49
- }
50
-
51
- getById(id: string): Observable<T> {
52
- return this.http.get<T>(`${this.apiUrl}${this._pathName}/${id}`).pipe(
53
- tap((entity: T) => this.store.upsert(id, entity))
54
- );
55
- }
56
-
57
- update(id: string, entity: T): Observable<T> {
58
- return this.http.put<T>(`${this.apiUrl}${this._pathName}/${id}`, entity).pipe(
59
- tap((updatedEntity: T) => this.store.update(id, updatedEntity))
60
- );
61
- }
62
-
63
- delete(id: string): Observable<void> {
64
- return this.http.delete<void>(`${this.apiUrl}${this._pathName}/${id}`).pipe(
65
- tap(() => this.store.remove(id))
66
- );
67
- }
68
-
69
- }
@@ -1,6 +0,0 @@
1
-
2
- import { EntityState } from "@datorama/akita"
3
- export class BaseState {
4
- records !: any[];
5
- lists !: any[];
6
- }
@@ -1,56 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { EntityState, EntityStore, StoreConfig } from '@datorama/akita';
3
- import { BaseState } from './base.state';
4
- import { BehaviorSubject } from 'rxjs';
5
- import { BaseModel } from '../models/base.model';
6
- export interface BaseEntityState<T> extends BaseState, EntityState<T> {
7
-
8
- }
9
-
10
- @StoreConfig({ name: 'base' })
11
- @Injectable({ providedIn: 'root' })
12
- export class BaseStore<T extends BaseModel> extends EntityStore<BaseEntityState<T>, T> {
13
- static storeName = 'base';
14
- public recordChange$: BehaviorSubject<any>;
15
- public onDocumentAccept$: BehaviorSubject<any>;
16
- public onDailogClose$: BehaviorSubject<any>;
17
- public openDocument$: BehaviorSubject<any>;
18
- public alertMessage$: BehaviorSubject<any>;
19
-
20
- constructor() {
21
- super({ records: [], lists: [] }, { name: BaseStore.storeName });
22
- this.recordChange$ = new BehaviorSubject<any>([]);
23
- this.onDocumentAccept$ = new BehaviorSubject<any>({});
24
- this.onDailogClose$ = new BehaviorSubject<boolean>(false);
25
- this.openDocument$ = new BehaviorSubject<any>({});
26
- this.alertMessage$ = new BehaviorSubject<string>('');
27
- }
28
-
29
- setList(data: T[]) {
30
- this.update({ lists: data });
31
- }
32
-
33
- setRecordChange(value: any) {
34
- this.recordChange$.next(value);
35
- }
36
-
37
- setOnDocumentAccept(value: any) {
38
- this.onDocumentAccept$.next(value);
39
- }
40
-
41
- setOnDailogClose(value: any) {
42
- this.onDailogClose$.next(value);
43
- }
44
-
45
- setOpenDocument(value: any) {
46
- this.openDocument$.next(value);
47
- }
48
-
49
- setAlertMessage(value: any) {
50
- this.alertMessage$.next(value);
51
- }
52
-
53
-
54
-
55
-
56
- }
@@ -1,56 +0,0 @@
1
- <p-table #dt2 [columns]="table.headers" class="table-primary-container" [value]="table.records">
2
- <ng-template pTemplate="caption">
3
- <div class="table-header-wrapper flex align-items-center justify-content-between">
4
- <h3 class="text-color table-title-wrapper text-color m-0">{{title}}</h3>
5
- <div class="flex align-items-center justify-content-between w-full">
6
- <div class="flex justify-content-end w-full" *ngIf="showSearchBar">
7
- <input pInputText type="text" [(ngModel)]="globalFilter" (input)="dt2.filterGlobal($event, 'contains')"
8
- [placeholder]="'Search ' + title + '...'" class="search-input-wrapper w-4" />
9
- <p-button icon="pi pi-cog" class="setting-icon-wrapper ml-3"></p-button>
10
- </div>
11
- </div>
12
- </div>
13
- </ng-template>
14
-
15
- <!-- Header Template -->
16
- <ng-template pTemplate="header" let-columns>
17
- <tr *ngIf="table.headers.length > 0">
18
- <th *ngFor="let col of table.headers" class="p-4" [pSortableColumn]="col.name" [ngClass]="col.width">
19
- <h4 class="flex align-items-center table-header-title capitalize text-color font-semibold m-0">
20
- {{ col.name }}
21
- <p-sortIcon [field]="col.name" />
22
- </h4>
23
- </th>
24
- <th *ngIf="showActions" class="table-action-title p-4 w-2">
25
- <h4 class="text-color font-semibold table-header-title capitalize m-0">Actions</h4></th>
26
- </tr>
27
- </ng-template>
28
-
29
- <!-- Table Body -->
30
- <ng-template pTemplate="body" let-rowData>
31
- <tr *ngIf="table.headers.length > 0" class="table-row-wrapper relative table-group-wrapper">
32
- <td class="text-left p-4" *ngFor="let col of table.headers">
33
- <div class="table-text-wrapper p-0"
34
- [ngClass]="{
35
- 'enable-badge-wrapper': col.name.toLowerCase() === 'status' && rowData[col.name] === 'Enable',
36
- 'disable-badge-wrapper': col.name.toLowerCase() === 'status' && rowData[col.name] === 'Disable',
37
- 'w-8': col.name.toLowerCase() === 'status',
38
- 'text-primary font-semibold': col.name.toLowerCase() === 'action' || col.name.toLowerCase() === 'name'
39
- }"
40
- >
41
- {{ rowData[col.name] }}
42
- <p *ngIf="col.name.toLowerCase() === 'action'" class="text-color font-normal">{{rowData['apiEndPoint']}}</p>
43
- </div>
44
- </td>
45
-
46
- <!-- Actions -->
47
- <td *ngIf="showActions" class="action-data-wrapper text-left p-4">
48
- <div class="flex align-items-center">
49
- <p-button icon="pi pi-pencil" (click)="handleEditClick(rowData._id)" class="edit-icon-wrapper mr-3"></p-button>
50
- <p-button icon="pi pi-trash" (click)="deleteRow(rowData)" class="delete-icon-wrapper mr-3"></p-button>
51
- </div>
52
- </td>
53
- <p-button icon="pi pi-eye" (click)="viewRow(rowData)" class="view-icon-wrapper icon-position-wrapper table-group-wrapper-hover:visible"></p-button>
54
- </tr>
55
- </ng-template>
56
- </p-table>
@@ -1,187 +0,0 @@
1
- .table-header-container {
2
- padding: 20px 20px 20px 8px;
3
- }
4
-
5
- .table-header-title {
6
- font-size: 14px;
7
- }
8
-
9
- .table-text-wrapper {
10
- display: -webkit-box;
11
- -webkit-line-clamp: 2;
12
- -webkit-box-orient: vertical;
13
- overflow: hidden;
14
- text-overflow: ellipsis;
15
- white-space: normal;
16
- max-width: 100%;
17
- padding: 0.5rem;
18
- box-sizing: border-box;
19
- }
20
-
21
- .table-title-wrapper {
22
- font-size: 20px;
23
- font-weight: 700;
24
- }
25
-
26
- .table-action-title {
27
- border-radius: 0 10px 0 0;
28
- border-right: 1px solid rgba(68, 72, 109, 0.10) !important;
29
- }
30
-
31
- .action-data-wrapper {
32
- border-right: 1px solid rgba(68, 72, 109, 0.10) !important;
33
- }
34
-
35
- .enable-badge-wrapper {
36
- border-radius: 4px;
37
- background: var(--green-500);
38
- color: var(--surface-0);
39
- text-align: center;
40
- padding: 5px !important;
41
- }
42
-
43
- .disable-badge-wrapper {
44
- border-radius: 4px;
45
- background: #44486D;
46
- color: var(--surface-0);
47
- text-align: center;
48
- padding: 5px !important;
49
- }
50
-
51
- .search-input-wrapper {
52
- height: 50px;
53
- border-radius: 10px;
54
- border: 1px solid rgba(76, 98, 146, 0.10);
55
- background: rgba(76, 98, 146, 0.04);
56
- }
57
-
58
- .table-row-wrapper {
59
- position: relative;
60
- transition: all 0.3s ease-in-out;
61
- }
62
-
63
- .icon-position-wrapper {
64
- position: absolute;
65
- top: 50%;
66
- left: 16%;
67
- transform: translate(-50%, -50%);
68
- opacity: 0;
69
- visibility: hidden;
70
- transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
71
- }
72
-
73
- .table-row-wrapper:hover .icon-position-wrapper {
74
- opacity: 1;
75
- visibility: visible;
76
- }
77
-
78
- .table-group-wrapper:hover .icon-position-wrapper {
79
- visibility: visible;
80
- opacity: 1;
81
- }
82
-
83
- ::ng-deep {
84
- .edit-icon-wrapper {
85
- .p-button {
86
- border-radius: 10px;
87
- border: 1px solid rgba(76, 98, 146, 0.10);
88
- background: #EEF0F5;
89
- padding: 12px 20px;
90
-
91
- .pi-pencil {
92
- color: var(--primary-color);
93
- }
94
- }
95
- }
96
-
97
- .delete-icon-wrapper {
98
- .p-button {
99
- border-radius: 10px;
100
- border: 1px solid rgba(76, 98, 146, 0.10);
101
- background: #EEF0F5;
102
- padding: 12px 20px;
103
-
104
- .pi-trash {
105
- color: var(--red-500);
106
- }
107
- }
108
- }
109
-
110
- .setting-icon-wrapper {
111
- .p-button {
112
- border-radius: 10px;
113
- border: 1px solid rgba(76, 98, 146, 0.10);
114
- background: #EEF0F5;
115
- padding: 24px;
116
- height: 50px;
117
-
118
- .pi-cog {
119
- color: var(--primary-color);
120
- }
121
- }
122
- }
123
-
124
- .view-icon-wrapper {
125
- .p-button {
126
- border-radius: 10px;
127
- border: 1px solid rgba(76, 98, 146, 0.30);
128
- background: var(--surface-0);
129
- padding: 20px;
130
- height: 40px;
131
- box-shadow: none;
132
-
133
- .pi-eye {
134
- color: #44486D;
135
- }
136
- }
137
- }
138
-
139
- .table-primary-container {
140
- .p-datatable-table {
141
- min-width: 50rem;
142
- padding: 20px;
143
- background-color: #FFF;
144
- table-layout: fixed;
145
- }
146
-
147
- .p-datatable-header {
148
- padding: 20px 20px 0;
149
- border-radius: 10px 10px 0 0 !important;
150
- border: none !important;
151
- }
152
-
153
- .p-datatable-thead {
154
- th {
155
- border: 1px solid rgba(68, 72, 109, 0.10);
156
- border-left: none;
157
- border-right: none;
158
- background: #F9F9FA;
159
-
160
- &:first-child {
161
- border-radius: 10px 0 0 0;
162
- border-left: 1px solid rgba(68, 72, 109, 0.10);
163
- }
164
- }
165
- }
166
-
167
- tr {
168
- td {
169
- border-bottom: 1px solid rgba(68, 72, 109, 0.10);
170
- }
171
-
172
- td:first-child {
173
- border-left: 1px solid rgba(68, 72, 109, 0.10);
174
- }
175
- }
176
-
177
- tr:last-child {
178
- td:first-child {
179
- border-radius: 0 0 0 10px;
180
- }
181
-
182
- td:last-child {
183
- border-radius: 0 0 10px 0;
184
- }
185
- }
186
- }
187
- }
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { TablePrimaryComponent } from './table-primary.component';
3
-
4
- describe('TablePrimaryComponent', () => {
5
- let component: TablePrimaryComponent;
6
- let fixture: ComponentFixture<TablePrimaryComponent>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [TablePrimaryComponent],
11
- }).compileComponents();
12
-
13
- fixture = TestBed.createComponent(TablePrimaryComponent);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });
@@ -1,71 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { TableModule } from 'primeng/table';
4
- import { TablePrimaryModel } from '../models/table-primary.model';
5
- import { ButtonModule } from 'primeng/button';
6
- import { ToggleButtonModule } from 'primeng/togglebutton';
7
- import { FormsModule } from '@angular/forms';
8
- import { InputSwitchModule } from 'primeng/inputswitch';
9
- import { InputTextModule } from 'primeng/inputtext';
10
- import { TooltipModule } from 'primeng/tooltip';
11
- import { Router } from '@angular/router';
12
- import { SHARED } from '../../constant/SHARED';
13
-
14
- @Component({
15
- selector: 'lib-table-primary',
16
- standalone: true,
17
- imports: [CommonModule, TableModule, ButtonModule, ToggleButtonModule, FormsModule, InputSwitchModule, InputTextModule, TooltipModule],
18
- templateUrl: './table-primary.component.html',
19
- styleUrl: './table-primary.component.scss',
20
- })
21
- export class TablePrimaryComponent implements OnInit {
22
- @Input() table!: TablePrimaryModel;
23
- @Input() title!: string;
24
-
25
- @Input() showStatus = true;
26
- @Input() showActions = true;
27
- @Input() showSearchBar = true;
28
- @Input() showNewRecordButton = true;
29
- @Input() showRefreshButton = true;
30
-
31
- globalFilter: string = SHARED.EMPTY;
32
-
33
- constructor(private _router: Router) {}
34
-
35
- ngOnInit(): void {
36
- // Ensure that table headers are not empty
37
- if (this.table.headers.length === 0) {
38
- console.error('Table headers are missing.');
39
- }
40
- }
41
-
42
- clearSearch(table: any) {
43
- this.globalFilter = SHARED.EMPTY;
44
- table.clear();
45
- }
46
-
47
- refreshTable() {
48
- }
49
-
50
- handleCreate() {
51
- const currentRouteURL = this._router.url;
52
- this._router.navigate([currentRouteURL + SHARED.SLASH + SHARED.ZERO])
53
- }
54
-
55
- handleEditClick(id: number) {
56
- const currentRouteURL = this._router.url;
57
- this._router.navigate([currentRouteURL + SHARED.SLASH + id])
58
- }
59
-
60
- editRow(rowData: any) {
61
- console.log('Edit Row:', rowData);
62
- }
63
-
64
- deleteRow(rowData: any) {
65
- console.log('Delete Row:', rowData);
66
- }
67
-
68
- viewRow(rowData: any) {
69
- console.log('Delete Row:', rowData);
70
- }
71
- }