verben-authentication-ui 0.3.2 → 0.3.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 (288) hide show
  1. package/ng-package.json +8 -0
  2. package/package.json +8 -14
  3. package/src/lib/components/button/button.component.css +3 -0
  4. package/src/lib/components/button/button.component.html +13 -0
  5. package/src/lib/components/button/button.component.spec.ts +23 -0
  6. package/src/lib/components/button/button.component.ts +24 -0
  7. package/src/lib/components/button/button.module.ts +11 -0
  8. package/{lib/components/forgot-password/ForgotPasswordData.d.ts → src/lib/components/forgot-password/ForgotPasswordData.ts} +1 -1
  9. package/src/lib/components/forgot-password/forgot-password.component.css +29 -0
  10. package/src/lib/components/forgot-password/forgot-password.component.html +13 -0
  11. package/src/lib/components/forgot-password/forgot-password.component.spec.ts +23 -0
  12. package/src/lib/components/forgot-password/forgot-password.component.ts +86 -0
  13. package/src/lib/components/forgot-password/forgot-password.module.ts +18 -0
  14. package/src/lib/components/mail/mail.component.css +0 -0
  15. package/src/lib/components/mail/mail.component.html +11 -0
  16. package/src/lib/components/mail/mail.component.spec.ts +23 -0
  17. package/src/lib/components/mail/mail.component.ts +47 -0
  18. package/src/lib/components/mail/mail.module.ts +13 -0
  19. package/src/lib/components/mail-validation/mail-validation.component.css +59 -0
  20. package/src/lib/components/mail-validation/mail-validation.component.html +37 -0
  21. package/src/lib/components/mail-validation/mail-validation.component.spec.ts +23 -0
  22. package/src/lib/components/mail-validation/mail-validation.component.ts +66 -0
  23. package/src/lib/components/mail-validation/mail-validation.module.ts +18 -0
  24. package/src/lib/components/o-auth/o-auth.component.css +21 -0
  25. package/src/lib/components/o-auth/o-auth.component.html +60 -0
  26. package/src/lib/components/o-auth/o-auth.component.spec.ts +23 -0
  27. package/src/lib/components/o-auth/o-auth.component.ts +43 -0
  28. package/src/lib/components/o-auth/o-auth.module.ts +11 -0
  29. package/src/lib/components/otp-input/otp-input.component.css +19 -0
  30. package/src/lib/components/otp-input/otp-input.component.html +14 -0
  31. package/src/lib/components/otp-input/otp-input.component.spec.ts +23 -0
  32. package/src/lib/components/otp-input/otp-input.component.ts +73 -0
  33. package/src/lib/components/otp-input/otp-input.module.ts +15 -0
  34. package/src/lib/components/reset-password/ResetPasswordData.ts +5 -0
  35. package/src/lib/components/reset-password/reset-password.component.css +29 -0
  36. package/src/lib/components/reset-password/reset-password.component.html +22 -0
  37. package/src/lib/components/reset-password/reset-password.component.spec.ts +23 -0
  38. package/src/lib/components/reset-password/reset-password.component.ts +108 -0
  39. package/src/lib/components/reset-password/reset-password.module.ts +18 -0
  40. package/src/lib/components/sign-in/sign-in.component.css +21 -0
  41. package/src/lib/components/sign-in/sign-in.component.html +84 -0
  42. package/src/lib/components/sign-in/sign-in.component.spec.ts +23 -0
  43. package/src/lib/components/sign-in/sign-in.component.ts +184 -0
  44. package/src/lib/components/sign-in/sign-in.module.ts +17 -0
  45. package/src/lib/components/sign-up/sign-up.component.css +36 -0
  46. package/src/lib/components/sign-up/sign-up.component.html +132 -0
  47. package/src/lib/components/sign-up/sign-up.component.spec.ts +23 -0
  48. package/src/lib/components/sign-up/sign-up.component.ts +176 -0
  49. package/src/lib/components/sign-up/sign-up.module.ts +15 -0
  50. package/src/lib/components/sso/base-table-style.ts +52 -0
  51. package/src/lib/components/sso/helper.ts +15 -0
  52. package/src/lib/components/sso/sso-form/sso-form.component.css +13 -0
  53. package/src/lib/components/sso/sso-form/sso-form.component.html +109 -0
  54. package/src/lib/components/sso/sso-form/sso-form.component.spec.ts +23 -0
  55. package/src/lib/components/sso/sso-form/sso-form.component.ts +70 -0
  56. package/src/lib/components/sso/sso.columns.ts +32 -0
  57. package/src/lib/components/sso/sso.component.css +47 -0
  58. package/src/lib/components/sso/sso.component.html +208 -0
  59. package/src/lib/components/sso/sso.component.spec.ts +23 -0
  60. package/src/lib/components/sso/sso.component.ts +261 -0
  61. package/src/lib/components/sso/sso.module.ts +40 -0
  62. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.css +8 -0
  63. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.html +30 -0
  64. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.spec.ts +23 -0
  65. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.ts +183 -0
  66. package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.ts +15 -0
  67. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.css +17 -0
  68. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.html +45 -0
  69. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.spec.ts +23 -0
  70. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.ts +57 -0
  71. package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.ts +11 -0
  72. package/src/lib/components/user-management/base-table-style.ts +52 -0
  73. package/src/lib/components/user-management/helper.ts +29 -0
  74. package/src/lib/components/user-management/index.ts +4 -0
  75. package/src/lib/components/user-management/useer-management.module.ts +48 -0
  76. package/src/lib/components/user-management/user-management-form/use-management-form.component.ts +61 -0
  77. package/src/lib/components/user-management/user-management-form/user-management-form.component.css +0 -0
  78. package/src/lib/components/user-management/user-management-form/user-management-form.component.html +91 -0
  79. package/src/lib/components/user-management/user-management-form/user-management-form.component.spec.ts +23 -0
  80. package/src/lib/components/user-management/user-management.columns.ts +45 -0
  81. package/src/lib/components/user-management/user-management.component.css +26 -0
  82. package/src/lib/components/user-management/user-management.component.html +275 -0
  83. package/src/lib/components/user-management/user-management.component.spec.ts +23 -0
  84. package/src/lib/components/user-management/user-management.component.ts +380 -0
  85. package/src/lib/components/user-management/user-management.service.ts +42 -0
  86. package/src/lib/components/user-request/user-request.component.css +91 -0
  87. package/src/lib/components/user-request/user-request.component.html +165 -0
  88. package/src/lib/components/user-request/user-request.component.spec.ts +23 -0
  89. package/src/lib/components/user-request/user-request.component.ts +167 -0
  90. package/src/lib/components/user-request/user-request.module.ts +18 -0
  91. package/src/lib/components/user-request-approval/access-request.columns.ts +26 -0
  92. package/src/lib/components/user-request-approval/base-table-style.ts +52 -0
  93. package/src/lib/components/user-request-approval/facades/user-access-request.facade.ts +152 -0
  94. package/src/lib/components/user-request-approval/helper.ts +39 -0
  95. package/src/lib/components/user-request-approval/services/user-access-request.service.spec.ts +16 -0
  96. package/src/lib/components/user-request-approval/services/user-access-request.service.ts +87 -0
  97. package/src/lib/components/user-request-approval/states/user-access-request.state.ts +65 -0
  98. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.css +0 -0
  99. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.html +7 -0
  100. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.spec.ts +23 -0
  101. package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.ts +22 -0
  102. package/src/lib/components/user-request-approval/user-request-approval.component.css +1 -0
  103. package/src/lib/components/user-request-approval/user-request-approval.component.html +218 -0
  104. package/src/lib/components/user-request-approval/user-request-approval.component.spec.ts +23 -0
  105. package/src/lib/components/user-request-approval/user-request-approval.component.ts +301 -0
  106. package/src/lib/components/user-request-approval/user-request-approval.module.ts +52 -0
  107. package/src/lib/components/user-request-approval/user-request-approval.service.spec.ts +16 -0
  108. package/src/lib/components/user-request-approval/user-request-approval.service.ts +58 -0
  109. package/src/lib/components/user-request-approval/user-request-form/use-request-form.component.ts +66 -0
  110. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.css +0 -0
  111. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.html +97 -0
  112. package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.spec.ts +23 -0
  113. package/src/lib/models/ErrorResponse.ts +7 -0
  114. package/src/lib/models/PasswordRequestParam.ts +5 -0
  115. package/src/lib/models/ResponseKeyValue.ts +5 -0
  116. package/src/lib/models/UserRequest.ts +28 -0
  117. package/src/lib/models/auth-mechanism.ts +14 -0
  118. package/src/lib/models/base.ts +11 -0
  119. package/src/lib/models/log-in.ts +7 -0
  120. package/{lib/models/mainUser.d.ts → src/lib/models/mainUser.ts} +3 -2
  121. package/src/lib/models/object-state.ts +6 -0
  122. package/{lib/models/otpValue.d.ts → src/lib/models/otpValue.ts} +3 -1
  123. package/src/lib/models/paged.ts +9 -0
  124. package/src/lib/models/query-params.ts +7 -0
  125. package/src/lib/models/request-status.ts +4 -0
  126. package/src/lib/models/resend-otp-data.ts +8 -0
  127. package/src/lib/models/resource.ts +27 -0
  128. package/src/lib/models/sign-up.ts +11 -0
  129. package/src/lib/models/single-sign-on.ts +9 -0
  130. package/src/lib/models/status.ts +5 -0
  131. package/src/lib/models/user-access-request-status.ts +5 -0
  132. package/{lib/models/user-access-request.d.ts → src/lib/models/user-access-request.ts} +4 -3
  133. package/src/lib/models/user.ts +24 -0
  134. package/src/lib/services/environment.service.spec.ts +16 -0
  135. package/src/lib/services/environment.service.ts +23 -0
  136. package/src/lib/services/http-web-request.service.spec.ts +16 -0
  137. package/src/lib/services/http-web-request.service.ts +101 -0
  138. package/src/lib/services/util.service.spec.ts +16 -0
  139. package/src/lib/services/util.service.ts +28 -0
  140. package/{public-api.d.ts → src/public-api.ts} +21 -0
  141. package/src/styles.css +96 -0
  142. package/src/theme/tailwind-setup.css +3 -0
  143. package/src/theme/tailwind.css +980 -0
  144. package/tailwind.config.js +20 -0
  145. package/tsconfig.lib.json +15 -0
  146. package/tsconfig.lib.prod.json +11 -0
  147. package/tsconfig.spec.json +15 -0
  148. package/esm2022/lib/components/button/button.component.mjs +0 -46
  149. package/esm2022/lib/components/button/button.module.mjs +0 -20
  150. package/esm2022/lib/components/forgot-password/ForgotPasswordData.mjs +0 -2
  151. package/esm2022/lib/components/forgot-password/forgot-password.component.mjs +0 -86
  152. package/esm2022/lib/components/forgot-password/forgot-password.module.mjs +0 -34
  153. package/esm2022/lib/components/mail/mail.component.mjs +0 -69
  154. package/esm2022/lib/components/mail/mail.module.mjs +0 -21
  155. package/esm2022/lib/components/mail-validation/mail-validation.component.mjs +0 -108
  156. package/esm2022/lib/components/mail-validation/mail-validation.module.mjs +0 -34
  157. package/esm2022/lib/components/o-auth/o-auth.component.mjs +0 -25
  158. package/esm2022/lib/components/o-auth/o-auth.module.mjs +0 -19
  159. package/esm2022/lib/components/otp-input/otp-input.component.mjs +0 -75
  160. package/esm2022/lib/components/otp-input/otp-input.module.mjs +0 -23
  161. package/esm2022/lib/components/reset-password/ResetPasswordData.mjs +0 -2
  162. package/esm2022/lib/components/reset-password/reset-password.component.mjs +0 -107
  163. package/esm2022/lib/components/reset-password/reset-password.module.mjs +0 -34
  164. package/esm2022/lib/components/sign-in/sign-in.component.mjs +0 -214
  165. package/esm2022/lib/components/sign-in/sign-in.module.mjs +0 -24
  166. package/esm2022/lib/components/sign-up/sign-up.component.mjs +0 -223
  167. package/esm2022/lib/components/sign-up/sign-up.module.mjs +0 -24
  168. package/esm2022/lib/components/sso/base-table-style.mjs +0 -53
  169. package/esm2022/lib/components/sso/helper.mjs +0 -14
  170. package/esm2022/lib/components/sso/sso-form/sso-form.component.mjs +0 -74
  171. package/esm2022/lib/components/sso/sso.columns.mjs +0 -29
  172. package/esm2022/lib/components/sso/sso.component.mjs +0 -236
  173. package/esm2022/lib/components/sso/sso.module.mjs +0 -63
  174. package/esm2022/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.mjs +0 -201
  175. package/esm2022/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.mjs +0 -22
  176. package/esm2022/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.mjs +0 -90
  177. package/esm2022/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.mjs +0 -19
  178. package/esm2022/lib/components/user-management/base-table-style.mjs +0 -53
  179. package/esm2022/lib/components/user-management/helper.mjs +0 -26
  180. package/esm2022/lib/components/user-management/useer-management.module.mjs +0 -68
  181. package/esm2022/lib/components/user-management/user-management-form/use-management-form.component.mjs +0 -57
  182. package/esm2022/lib/components/user-management/user-management.columns.mjs +0 -43
  183. package/esm2022/lib/components/user-management/user-management.component.mjs +0 -323
  184. package/esm2022/lib/components/user-request/user-request.component.mjs +0 -206
  185. package/esm2022/lib/components/user-request/user-request.module.mjs +0 -34
  186. package/esm2022/lib/components/user-request-approval/access-request.columns.mjs +0 -24
  187. package/esm2022/lib/components/user-request-approval/base-table-style.mjs +0 -53
  188. package/esm2022/lib/components/user-request-approval/facades/user-access-request.facade.mjs +0 -128
  189. package/esm2022/lib/components/user-request-approval/helper.mjs +0 -35
  190. package/esm2022/lib/components/user-request-approval/services/user-access-request.service.mjs +0 -72
  191. package/esm2022/lib/components/user-request-approval/states/user-access-request.state.mjs +0 -59
  192. package/esm2022/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.mjs +0 -26
  193. package/esm2022/lib/components/user-request-approval/user-request-approval.component.mjs +0 -251
  194. package/esm2022/lib/components/user-request-approval/user-request-approval.module.mjs +0 -77
  195. package/esm2022/lib/components/user-request-approval/user-request-approval.service.mjs +0 -32
  196. package/esm2022/lib/components/user-request-approval/user-request-form/use-request-form.component.mjs +0 -64
  197. package/esm2022/lib/models/ErrorResponse.mjs +0 -11
  198. package/esm2022/lib/models/PasswordRequestParam.mjs +0 -2
  199. package/esm2022/lib/models/ResponseKeyValue.mjs +0 -2
  200. package/esm2022/lib/models/UserRequest.mjs +0 -2
  201. package/esm2022/lib/models/base.mjs +0 -2
  202. package/esm2022/lib/models/log-in.mjs +0 -2
  203. package/esm2022/lib/models/mainUser.mjs +0 -2
  204. package/esm2022/lib/models/object-state.mjs +0 -8
  205. package/esm2022/lib/models/otpValue.mjs +0 -2
  206. package/esm2022/lib/models/paged.mjs +0 -2
  207. package/esm2022/lib/models/query-params.mjs +0 -2
  208. package/esm2022/lib/models/request-status.mjs +0 -5
  209. package/esm2022/lib/models/sign-up.mjs +0 -2
  210. package/esm2022/lib/models/single-sign-on.mjs +0 -2
  211. package/esm2022/lib/models/status.mjs +0 -6
  212. package/esm2022/lib/models/user-access-request-status.mjs +0 -7
  213. package/esm2022/lib/models/user-access-request.mjs +0 -2
  214. package/esm2022/lib/models/user.mjs +0 -2
  215. package/esm2022/lib/services/environment.service.mjs +0 -26
  216. package/esm2022/lib/services/http-web-request.service.mjs +0 -83
  217. package/esm2022/lib/services/util.service.mjs +0 -32
  218. package/esm2022/public-api.mjs +0 -43
  219. package/esm2022/verben-authentication-ui.mjs +0 -5
  220. package/fesm2022/verben-authentication-ui.mjs +0 -3545
  221. package/fesm2022/verben-authentication-ui.mjs.map +0 -1
  222. package/index.d.ts +0 -5
  223. package/lib/components/button/button.component.d.ts +0 -17
  224. package/lib/components/button/button.module.d.ts +0 -10
  225. package/lib/components/forgot-password/forgot-password.component.d.ts +0 -28
  226. package/lib/components/forgot-password/forgot-password.module.d.ts +0 -10
  227. package/lib/components/mail/mail.component.d.ts +0 -32
  228. package/lib/components/mail/mail.module.d.ts +0 -11
  229. package/lib/components/mail-validation/mail-validation.component.d.ts +0 -42
  230. package/lib/components/mail-validation/mail-validation.module.d.ts +0 -10
  231. package/lib/components/o-auth/o-auth.component.d.ts +0 -10
  232. package/lib/components/o-auth/o-auth.module.d.ts +0 -9
  233. package/lib/components/otp-input/otp-input.component.d.ts +0 -20
  234. package/lib/components/otp-input/otp-input.module.d.ts +0 -13
  235. package/lib/components/reset-password/ResetPasswordData.d.ts +0 -5
  236. package/lib/components/reset-password/reset-password.component.d.ts +0 -30
  237. package/lib/components/reset-password/reset-password.module.d.ts +0 -10
  238. package/lib/components/sign-in/sign-in.component.d.ts +0 -77
  239. package/lib/components/sign-in/sign-in.module.d.ts +0 -13
  240. package/lib/components/sign-up/sign-up.component.d.ts +0 -66
  241. package/lib/components/sign-up/sign-up.module.d.ts +0 -13
  242. package/lib/components/sso/base-table-style.d.ts +0 -1
  243. package/lib/components/sso/helper.d.ts +0 -2
  244. package/lib/components/sso/sso-form/sso-form.component.d.ts +0 -21
  245. package/lib/components/sso/sso.columns.d.ts +0 -3
  246. package/lib/components/sso/sso.component.d.ts +0 -54
  247. package/lib/components/sso/sso.module.d.ts +0 -11
  248. package/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.d.ts +0 -65
  249. package/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.d.ts +0 -12
  250. package/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.d.ts +0 -39
  251. package/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.d.ts +0 -9
  252. package/lib/components/user-management/base-table-style.d.ts +0 -1
  253. package/lib/components/user-management/helper.d.ts +0 -2
  254. package/lib/components/user-management/useer-management.module.d.ts +0 -11
  255. package/lib/components/user-management/user-management-form/use-management-form.component.d.ts +0 -20
  256. package/lib/components/user-management/user-management.columns.d.ts +0 -3
  257. package/lib/components/user-management/user-management.component.d.ts +0 -60
  258. package/lib/components/user-request/user-request.component.d.ts +0 -60
  259. package/lib/components/user-request/user-request.module.d.ts +0 -10
  260. package/lib/components/user-request-approval/access-request.columns.d.ts +0 -3
  261. package/lib/components/user-request-approval/base-table-style.d.ts +0 -1
  262. package/lib/components/user-request-approval/facades/user-access-request.facade.d.ts +0 -23
  263. package/lib/components/user-request-approval/helper.d.ts +0 -6
  264. package/lib/components/user-request-approval/services/user-access-request.service.d.ts +0 -50
  265. package/lib/components/user-request-approval/states/user-access-request.state.d.ts +0 -21
  266. package/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.d.ts +0 -12
  267. package/lib/components/user-request-approval/user-request-approval.component.d.ts +0 -59
  268. package/lib/components/user-request-approval/user-request-approval.module.d.ts +0 -12
  269. package/lib/components/user-request-approval/user-request-approval.service.d.ts +0 -18
  270. package/lib/components/user-request-approval/user-request-form/use-request-form.component.d.ts +0 -21
  271. package/lib/models/ErrorResponse.d.ts +0 -6
  272. package/lib/models/PasswordRequestParam.d.ts +0 -5
  273. package/lib/models/ResponseKeyValue.d.ts +0 -5
  274. package/lib/models/UserRequest.d.ts +0 -24
  275. package/lib/models/base.d.ts +0 -10
  276. package/lib/models/log-in.d.ts +0 -7
  277. package/lib/models/object-state.d.ts +0 -6
  278. package/lib/models/paged.d.ts +0 -9
  279. package/lib/models/query-params.d.ts +0 -7
  280. package/lib/models/request-status.d.ts +0 -3
  281. package/lib/models/sign-up.d.ts +0 -9
  282. package/lib/models/single-sign-on.d.ts +0 -7
  283. package/lib/models/status.d.ts +0 -4
  284. package/lib/models/user-access-request-status.d.ts +0 -5
  285. package/lib/models/user.d.ts +0 -23
  286. package/lib/services/environment.service.d.ts +0 -16
  287. package/lib/services/http-web-request.service.d.ts +0 -23
  288. package/lib/services/util.service.d.ts +0 -8
@@ -0,0 +1,261 @@
1
+ import { Component, ViewChild } from '@angular/core';
2
+ import { columns } from './sso.columns';
3
+ import { mockData } from './helper';
4
+ import { baseStyle } from './base-table-style';
5
+ import {
6
+ CardData,
7
+ CardDataViewComponent,
8
+ ColumnDefinition,
9
+ DataFilterType,
10
+ DataViewComponent,
11
+ IDataFilter,
12
+ } from 'verben-ng-ui';
13
+ import { SingleSignOn } from '../../models/single-sign-on';
14
+
15
+
16
+
17
+ @Component({
18
+ selector: 'lib-sso',
19
+ templateUrl: './sso.component.html',
20
+ styleUrl: './sso.component.css',
21
+ })
22
+ export class SsoComponent {
23
+ @ViewChild('vdcv') cardDataView!: CardDataViewComponent;
24
+ @ViewChild('vdv') dataView!: DataViewComponent;
25
+
26
+ columns = columns;
27
+ data = mockData;
28
+ filteredColumns: ColumnDefinition<SingleSignOn>[] =columns
29
+ styles = baseStyle;
30
+ currentData: CardData | null = null;
31
+ isGridView = true;
32
+ selected: CardData | null = null;
33
+
34
+ cardData: CardData[] = mockData.map(({ Name, Description, Link,Logo }) => ({
35
+ selected: false,
36
+ title: Name,
37
+ data: { Name, Description,Link,Logo } as Partial<SingleSignOn>,
38
+ body: [
39
+ { title: 'Description', value:Description??'' },
40
+ ],
41
+ children: [],
42
+ }));
43
+
44
+ openDetailView(name: string) {
45
+ const cardItem = this.getCardDataByMailAddress(name);
46
+ if (cardItem && this.cardDataView) {
47
+ this.dataView.toggleView();
48
+ this.cardData.forEach((item) => {
49
+ item.selected = false;
50
+ if (item.children) {
51
+ item.children.forEach((child) => (child.selected = false));
52
+ }
53
+ });
54
+
55
+ cardItem.selected = true;
56
+ this.currentData = this.cardDataView.onItemClick(cardItem);
57
+ }
58
+ }
59
+
60
+ getCardDataByMailAddress(name: string): CardData | undefined {
61
+ return this.cardData.find(({ data }) => data.Name === name);
62
+ }
63
+
64
+ onViewChange(isGridView: boolean): void {
65
+ isGridView=isGridView
66
+
67
+ if (this.currentData) {
68
+ this.cardDataView?.clearData();
69
+ this.currentData = null;
70
+ }
71
+
72
+ if (this.selected) {
73
+ this.cardDataView.onItemClick(this.selected);
74
+ }
75
+ }
76
+
77
+ openFormView(index: number) {
78
+ const item = this.cardData[index];
79
+ console.log('ITEM = ', item);
80
+ }
81
+
82
+ handleExport(exportedData: Partial<any>[]) {
83
+ console.log('Exported data:', exportedData);
84
+ this.downloadCSV(exportedData);
85
+ }
86
+
87
+ /**
88
+ *
89
+ * @param data Simple csv export for testing
90
+ */
91
+ private downloadCSV(data: Partial<any>[]) {
92
+ const headers = Object.keys(data[0]);
93
+ const csvContent = [
94
+ headers.join(','),
95
+ ...data.map((row) => headers.map((header) => row[header]).join(',')),
96
+ ].join('\n');
97
+
98
+ const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
99
+ const link = document.createElement('a');
100
+ if (link.download !== undefined) {
101
+ const url = URL.createObjectURL(blob);
102
+ link.setAttribute('href', url);
103
+ link.setAttribute('download', 'export.csv');
104
+ link.style.visibility = 'hidden';
105
+ document.body.appendChild(link);
106
+ link.click();
107
+ document.body.removeChild(link);
108
+ }
109
+ }
110
+
111
+ onSelectionChange(selectedRows:SingleSignOn[]) {
112
+ console.log('Selection changed:', selectedRows);
113
+ // Handle the selection change
114
+ }
115
+
116
+ /**
117
+ * Copied over from card view doc until I understand usage
118
+ */
119
+ selectedColumnCount: number = 0;
120
+ selectedFilterTableCount: number = 0;
121
+ isOPen: boolean = true;
122
+ selectedSortCount: number = 0;
123
+ showColumn: boolean = false;
124
+ showSort: boolean = false;
125
+ showExport: boolean = false;
126
+ selectedAll: boolean = false;
127
+ showFilter: boolean = false;
128
+ visibleColumns: IDataFilter[] = columns.map((col) => ({
129
+ checked: false,
130
+ name: typeof col.header === 'string' ? col.header : col.id,
131
+ type: DataFilterType.Bool,
132
+ }));
133
+ filterArray: IDataFilter[] = [
134
+ {
135
+ name: 'Name',
136
+ type: DataFilterType.String,
137
+ checked: false,
138
+ },
139
+ {
140
+ name: 'Description',
141
+ type: DataFilterType.String,
142
+ checked: false,
143
+ },
144
+ {
145
+ name: 'Logo',
146
+ type: DataFilterType.String,
147
+ checked: false,
148
+ },
149
+ {
150
+ name: 'Link',
151
+ type: DataFilterType.String,
152
+ checked: false,
153
+ },
154
+ {
155
+ name: 'CreatedAt',
156
+ type: DataFilterType.Date,
157
+ checked: false,
158
+ },
159
+ ];
160
+ sortOptions: IDataFilter[] = [
161
+ {
162
+ name: 'Name',
163
+ type: DataFilterType.String,
164
+ checked: false,
165
+ },
166
+ {
167
+ name: 'Description',
168
+ type: DataFilterType.String,
169
+ checked: false,
170
+ },
171
+ {
172
+ name: 'Link',
173
+ type: DataFilterType.String,
174
+ checked: false,
175
+ },
176
+ {
177
+ name: 'Logo',
178
+ type: DataFilterType.String,
179
+ checked: false,
180
+ },
181
+ {
182
+ name: 'CreatedAt',
183
+ type: DataFilterType.Date,
184
+ checked: false,
185
+ },
186
+ ];
187
+ clearData() {
188
+ this.currentData = {} as CardData;
189
+ }
190
+ loadMore() {
191
+ this.cardData = this.cardData.concat(this.cardData);
192
+ }
193
+ onColumnChange(event: boolean) {
194
+ this.showColumn = event;
195
+ }
196
+ onSortChange(event: boolean) {
197
+ this.showSort = false
198
+ console.log(event);
199
+ }
200
+
201
+
202
+ onColumnsUpdated(updatedColumns: IDataFilter[]) {
203
+ this.showColumn = false;
204
+ this.selectedColumnCount = updatedColumns.length;
205
+
206
+ if (updatedColumns) {
207
+ // Filter columns to include only visible ones
208
+ this.filteredColumns = this.columns.filter((col) =>
209
+ this.visibleColumns.find(
210
+ (filter) => filter.name === col.header && filter.checked
211
+ )
212
+ );
213
+
214
+ // Reorder columns based on the order in visibleColumns
215
+ const visibleColumnOrder = this.visibleColumns
216
+ .filter((filter) => filter.checked)
217
+ .map((filter) => filter.name);
218
+
219
+ this.columns.sort((a, b) => {
220
+ const indexA = visibleColumnOrder.indexOf(a.header as string);
221
+ const indexB = visibleColumnOrder.indexOf(b.header as string);
222
+ return indexA - indexB;
223
+ });
224
+ }
225
+ }
226
+
227
+ onFilterApplied(appliedFilter: IDataFilter[]) {
228
+ this.showFilter=false
229
+ if (Array.isArray(appliedFilter)) {
230
+ this.selectedFilterTableCount = appliedFilter.length;
231
+ } else {
232
+ console.log('appliedFilter is not an array');
233
+ }
234
+ }
235
+
236
+ onSortUpdated(updatedSorts: IDataFilter[]) {
237
+ this.onSortChange(false);
238
+ this.selectedSortCount = updatedSorts.length;
239
+ console.log(updatedSorts);
240
+
241
+ }
242
+
243
+ onStateChange(event: { key: string; value: boolean }): void {
244
+ switch (event.key) {
245
+ case 'column':
246
+ this.showColumn=event.value
247
+ break;
248
+ case 'sort':
249
+ this.showSort=event.value
250
+ break;
251
+ case 'export':
252
+ this.showExport=event.value
253
+ break;
254
+ case 'filter':
255
+ this.showFilter=event.value
256
+ break;
257
+ default:
258
+ break;
259
+ }
260
+ }
261
+ }
@@ -0,0 +1,40 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule } from '@angular/forms';
4
+ import { ReactiveFormsModule } from '@angular/forms';
5
+ import {
6
+ DataViewModule,
7
+ TableFilterModule,
8
+ SortTableModule,
9
+ DataExportModule,
10
+ VisibleColumnModule,
11
+ VerbenaButtonModule,
12
+ CardDataViewModule,
13
+ SvgModule,
14
+ VerbenaInputModule,
15
+ DataTableModule,
16
+ VerbenaTextareaModule,
17
+ } from 'verben-ng-ui';
18
+ import { SsoComponent } from './sso.component';
19
+ import { SsoFormComponent } from './sso-form/sso-form.component';
20
+ @NgModule({
21
+ declarations: [SsoComponent,SsoFormComponent],
22
+ imports: [
23
+ CommonModule,
24
+ FormsModule,
25
+ ReactiveFormsModule,
26
+ DataViewModule,
27
+ TableFilterModule,
28
+ SortTableModule,
29
+ DataExportModule,
30
+ VisibleColumnModule,
31
+ VerbenaButtonModule,
32
+ CardDataViewModule,
33
+ VerbenaInputModule,
34
+ SvgModule,
35
+ VerbenaTextareaModule,
36
+ DataTableModule,
37
+ ],
38
+ exports: [SsoComponent],
39
+ })
40
+ export class SsoModule {}
@@ -0,0 +1,8 @@
1
+ .otpWrapper{
2
+ margin-bottom: 20px;
3
+ margin-top: 15px;
4
+ }
5
+ .resendWrapper{
6
+ margin-top: 10px;
7
+ margin-bottom: 0px !important;
8
+ }
@@ -0,0 +1,30 @@
1
+ <section
2
+ [ngStyle]="styles"
3
+ class="{{ customClass }}"
4
+ >
5
+ <h3 class="{{headlingClass}}">{{headlingText}}</h3>
6
+ <div class="otpWrapper">
7
+ <p class="{{paragraphClass}}">Enter the {{length}} digit code sent to you</p>
8
+ <verben-otp-input
9
+ [length]="length"
10
+ (otpChange)="onOtpChange($event)"
11
+ [otpClass]="otpClass"
12
+ ></verben-otp-input>
13
+ </div>
14
+ <lib-button
15
+ [buttonClass]="btnClass"
16
+ [color]="btnColor"
17
+ [border]="btnBorder"
18
+ [borderRadius]="btnBorderRadius"
19
+ [bgColor]="btnBgColor"
20
+ [pd]="btnPd"
21
+ [text]="btnText"
22
+ (buttonClick)="submitData()"
23
+ [disabled]="!otpForm.valid"
24
+ ></lib-button>
25
+ <p class="resendWrapper">
26
+ Didn’t get a code?
27
+ <a class="{{resendClass}}" (click)="resendOtp()">Resend</a>
28
+ </p>
29
+
30
+ </section>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { TwoFactorAuthOtpComponent } from './two-factor-auth-otp.component';
4
+
5
+ describe('TwoFactorAuthOtpComponent', () => {
6
+ let component: TwoFactorAuthOtpComponent;
7
+ let fixture: ComponentFixture<TwoFactorAuthOtpComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [TwoFactorAuthOtpComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(TwoFactorAuthOtpComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,183 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import { FormGroup, FormBuilder, Validators } from '@angular/forms';
3
+ import { HttpWebRequestService } from '../../services/http-web-request.service';
4
+ import { UtilService } from '../../services/util.service';
5
+ import { ErrorResponse } from '../../models/ErrorResponse';
6
+ import { ResponseKeyValue } from '../../models/ResponseKeyValue';
7
+ import { OtpData } from '../../models/otpValue';
8
+ import { User } from '../../models/user';
9
+ import { ObjectState } from '../../models/object-state';
10
+ import { MainUser } from '../../models/mainUser';
11
+ import { ResendOtpData } from '../../models/resend-otp-data';
12
+
13
+ @Component({
14
+ selector: 'verben-auth-otp',
15
+ templateUrl: './two-factor-auth-otp.component.html',
16
+ styleUrl: './two-factor-auth-otp.component.css'
17
+ })
18
+
19
+ export class TwoFactorAuthOtpComponent {
20
+ @Input() customClass: string = ''
21
+ @Input() headlingClass: string = ''
22
+ @Input() headlingText: string = 'Two Factor Authentication'
23
+ @Input() paragraphClass: string = ''
24
+ @Input() resendClass: string = ''
25
+ @Input() width: string = '';
26
+ @Input() maxWidth: string = '';
27
+ @Input() margin: string = '';
28
+ @Input() pd: string = '';
29
+ @Input() bgColor: string = '#fff';
30
+ @Input() boxShadow: string = '4px 4px 4px rgba(0, 0, 0, 0.25)';
31
+ @Input() border: string = '1px solid #66666680';
32
+ @Input() borderRadius: string = '24px';
33
+ @Input() textColor: string = '#333';
34
+ @Input() height: string = 'auto';
35
+ @Input() length: number = 6;
36
+ @Input() otpClass: string = '';
37
+ @Input() resendOtpData: ResendOtpData = {
38
+ MailAddress: "verbena@gmail.com",
39
+ Password: "Default",
40
+ LoginType: "InApp",
41
+ APIKey: "PDLTC6",
42
+ Secrete: "$White360$",
43
+ RedirectUri: "/auth/otp"
44
+ };
45
+
46
+ @Input() User:MainUser = {
47
+ Code: '024',
48
+ TenantId: '53b1c579bdf3de74f76bdac9',
49
+ Id: '53b1c579bdf3de74f76bdac9',
50
+ ServiceName: 'chinedu',
51
+ MailAddress: 'nwaekwuchinedu@gmail.com',
52
+ PhoneNumber: '070',
53
+ FirstName: 'nwaekwu',
54
+ LastName: 'chinedu',
55
+ OtherName: 'chinedu',
56
+ Role: [],
57
+ Tags: [
58
+ {
59
+ Name: "tester",
60
+ IsOptional: true
61
+ }],
62
+ Password: 'Default',
63
+ Status: 'Active',
64
+ CreatedAt: new Date(),
65
+ UpdatedAt: new Date(),
66
+ DataState: ObjectState.New
67
+ }
68
+
69
+ @Input() OtpData:OtpData = {
70
+ User: this.User,
71
+ Token: '',
72
+ ValidateUrl: '',
73
+ Secret: '',
74
+ OTP: '',
75
+ Info: ''
76
+ }
77
+
78
+ @Input() btnClass: string = ''
79
+ @Input() btnBgColor: string = '#FFE681'
80
+ @Input() btnColor: string = ''
81
+ @Input() btnBorder: string = ''
82
+ @Input() btnBorderRadius: string = '24px'
83
+ @Input() btnPd: string = '';
84
+ @Input() btnText: string = 'Submit';
85
+
86
+
87
+ otpValue: string = '';
88
+ otpForm!: FormGroup;
89
+
90
+ @Output() buttonClick = new EventEmitter<string>();
91
+ @Output() otpChange = new EventEmitter<string>();
92
+ @Output() onSubmitEnd: EventEmitter<ResponseKeyValue | ErrorResponse> = new EventEmitter();
93
+ @Output() resend: EventEmitter<ResponseKeyValue | ErrorResponse> = new EventEmitter();
94
+
95
+ constructor(
96
+ private fb: FormBuilder,
97
+ private server: HttpWebRequestService,
98
+ private utilService: UtilService
99
+ ) {}
100
+
101
+ ngOnInit() {
102
+ this.otpForm = this.fb.group({
103
+ otpValue: ['', [Validators.required, Validators.minLength(6)]]
104
+ });
105
+ }
106
+
107
+ onOtpChange(value: string) {
108
+ this.otpValue = value;
109
+ this.otpForm.get('otpValue')?.setValue(value);
110
+ this.otpChange.emit(this.otpValue);
111
+ }
112
+
113
+ async submitData() {
114
+ const data:OtpData = {
115
+ User: {
116
+ ...this.User
117
+ },
118
+ Token: this.OtpData.Token,
119
+ ValidateUrl: this.OtpData.ValidateUrl,
120
+ Secret: this.OtpData.Secret,
121
+ OTP: this.OtpData.OTP,
122
+ Info: this.OtpData.Info,
123
+ };
124
+
125
+
126
+ if (this.otpForm.valid) {
127
+ // this.buttonClick.emit(this.otpForm.get('otpValue')?.value);
128
+ this.utilService.sendBI(true);
129
+ const res = await this.server.post(
130
+ `Authentication/Validate`,data
131
+ );
132
+ this.utilService.sendBI(false);
133
+ if (res instanceof ErrorResponse) {
134
+ this.onSubmitEnd.emit(res);
135
+ } else {
136
+ var result = res as ResponseKeyValue;
137
+ this.onSubmitEnd.emit(result);
138
+ }
139
+ }
140
+ }
141
+
142
+
143
+ async resendOtp() {
144
+ const data:ResendOtpData = {
145
+ MailAddress:this.resendOtpData?.MailAddress,
146
+ Password:this.resendOtpData?.Password,
147
+ LoginType:this.resendOtpData?.LoginType,
148
+ APIKey:this.resendOtpData?.APIKey,
149
+ Secrete:this.resendOtpData?.Secrete,
150
+ RedirectUri:this.resendOtpData?.RedirectUri
151
+ };
152
+
153
+ this.utilService.sendBI(true);
154
+ const res = await this.server.post(
155
+ `Authentication/ResendOTP`,data
156
+ );
157
+ this.utilService.sendBI(false);
158
+ if (res instanceof ErrorResponse) {
159
+ this.resend.emit(res);
160
+ } else {
161
+ var result = res as ResponseKeyValue;
162
+ this.resend.emit(result);
163
+ }
164
+ }
165
+
166
+
167
+ get styles() {
168
+ return {
169
+ 'background-color': this.bgColor,
170
+ 'box-shadow': this.boxShadow,
171
+ 'border': this.border,
172
+ 'border-radius': this.borderRadius,
173
+ 'color': this.textColor,
174
+ 'width': this.width,
175
+ 'max-width':this.maxWidth,
176
+ 'margin':this.margin,
177
+ 'height': this.height,
178
+ 'padding':this.pd
179
+ };
180
+ }
181
+
182
+ }
183
+
@@ -0,0 +1,15 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { TwoFactorAuthOtpComponent } from './two-factor-auth-otp.component';
4
+ import { ButtonModule } from '../button/button.module';
5
+ import { OtpInputModule } from '../otp-input/otp-input.module';
6
+ import { RouterLink } from '@angular/router';
7
+ import { ReactiveFormsModule } from '@angular/forms';
8
+
9
+
10
+ @NgModule({
11
+ declarations: [TwoFactorAuthOtpComponent],
12
+ imports: [CommonModule,ButtonModule,OtpInputModule,RouterLink,ReactiveFormsModule],
13
+ exports: [TwoFactorAuthOtpComponent]
14
+ })
15
+ export class TwoFactorAuthOtpModule {}
@@ -0,0 +1,17 @@
1
+ .setUpBtnWrapper{
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 12px;
5
+ margin-top: 40px;
6
+ }
7
+ .iconWrapper{
8
+ display: flex;
9
+ cursor: pointer;
10
+ align-items:center;
11
+ justify-content:end;
12
+ gap: 12px;
13
+ margin-bottom:50px;
14
+ }
15
+ .custom-button{
16
+ font-weight: 500;
17
+ }
@@ -0,0 +1,45 @@
1
+ <section
2
+ [ngStyle]="styles"
3
+ class="{{ customClass }}"
4
+ >
5
+ <h3 class="{{headlingClass}}">{{headlingText}}</h3>
6
+ <div class="setUpBtnWrapper">
7
+ <verbena-button
8
+ svg="2fa-mail"
9
+ [svgHeight]="16"
10
+ [svgWidth]="20"
11
+ text="Continue with Mail"
12
+ bgColor="white"
13
+ textColor="#333333"
14
+ border="1px solid #333"
15
+ borderRadius="40px"
16
+ pd="10px 20px"
17
+ width="100%"
18
+ svgPosition="left"
19
+ buttonClass="font-normal text-[24px] leading-[29.05px] text-[#333] mb-2"
20
+ (click)="continueWithMail()"
21
+ ></verbena-button>
22
+ <verbena-button
23
+ svg="2fa-sms"
24
+ [svgHeight]="24"
25
+ [svgWidth]="24"
26
+ text="Continue with SMS"
27
+ bgColor="white"
28
+ textColor="#333333"
29
+ border="1px solid #333"
30
+ borderRadius="40px"
31
+ pd="10px 20px"
32
+ width="100%"
33
+ svgPosition="left"
34
+ (click)="continueWithSMS()"
35
+ ></verbena-button>
36
+ <!-- <div class="iconWrapper" (click)="handleSkip()">
37
+ <p class="{{paragraphClass}}">Skip for now</p>
38
+ <verben-svg
39
+ icon="skip-forward"
40
+ [height]="24"
41
+ [width]="24"
42
+ />
43
+ </div> -->
44
+ </div>
45
+ </section>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { TwoFactorAuthSetupComponent } from './two-factor-auth-setup.component';
4
+
5
+ describe('TwoFactorAuthSetupComponent', () => {
6
+ let component: TwoFactorAuthSetupComponent;
7
+ let fixture: ComponentFixture<TwoFactorAuthSetupComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [TwoFactorAuthSetupComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(TwoFactorAuthSetupComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });