@edsis/angular 21.3.13 → 22.0.1

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 (514) hide show
  1. package/.npmignore +2 -0
  2. package/README.md +261 -88
  3. package/collection.json +30 -0
  4. package/component/accordion/README.md +195 -0
  5. package/component/accordion/package.json +4 -0
  6. package/component/alert/README.md +182 -0
  7. package/component/alert/package.json +4 -0
  8. package/component/alert-dialog/README.md +239 -0
  9. package/component/alert-dialog/package.json +4 -0
  10. package/component/aspect-ratio/README.md +112 -0
  11. package/component/aspect-ratio/package.json +4 -0
  12. package/component/avatar/README.md +176 -0
  13. package/component/avatar/package.json +4 -0
  14. package/component/badge/README.md +133 -0
  15. package/component/badge/package.json +4 -0
  16. package/component/breadcrumb/README.md +216 -0
  17. package/component/breadcrumb/package.json +4 -0
  18. package/component/button/README.md +139 -0
  19. package/component/button/package.json +4 -0
  20. package/component/button-group/README.md +208 -0
  21. package/component/button-group/package.json +4 -0
  22. package/component/calendar/README.md +132 -0
  23. package/component/calendar/package.json +4 -0
  24. package/component/card/README.md +220 -0
  25. package/component/card/package.json +4 -0
  26. package/component/carousel/README.md +276 -0
  27. package/component/carousel/package.json +4 -0
  28. package/component/chart/README.md +249 -0
  29. package/component/chart/area/package.json +4 -0
  30. package/component/chart/bar/package.json +4 -0
  31. package/component/chart/line/package.json +4 -0
  32. package/component/chart/package.json +4 -0
  33. package/component/chart/pie/package.json +4 -0
  34. package/component/chart/radar/package.json +4 -0
  35. package/component/chart/radial/package.json +4 -0
  36. package/component/chart/scatter/package.json +4 -0
  37. package/component/checkbox/README.md +149 -0
  38. package/component/checkbox/package.json +4 -0
  39. package/component/collapsible/README.md +195 -0
  40. package/component/collapsible/package.json +4 -0
  41. package/component/combobox/README.md +198 -0
  42. package/component/combobox/package.json +4 -0
  43. package/component/command/README.md +275 -0
  44. package/component/command/package.json +4 -0
  45. package/component/composer/README.md +235 -0
  46. package/component/composer/package.json +4 -0
  47. package/component/context-menu/README.md +267 -0
  48. package/component/context-menu/package.json +4 -0
  49. package/component/date-picker/README.md +177 -0
  50. package/component/date-picker/package.json +4 -0
  51. package/component/dialog/README.md +237 -0
  52. package/component/dialog/package.json +4 -0
  53. package/component/drawer/README.md +145 -0
  54. package/component/drawer/package.json +4 -0
  55. package/component/dropdown-menu/README.md +311 -0
  56. package/component/dropdown-menu/package.json +4 -0
  57. package/component/editor/README.md +136 -0
  58. package/component/editor/package.json +4 -0
  59. package/component/empty/README.md +183 -0
  60. package/component/empty/package.json +4 -0
  61. package/component/form/README.md +210 -0
  62. package/component/form/package.json +4 -0
  63. package/component/hover-card/README.md +146 -0
  64. package/component/hover-card/package.json +4 -0
  65. package/component/input/README.md +159 -0
  66. package/component/input/package.json +4 -0
  67. package/component/input-group/README.md +239 -0
  68. package/component/input-group/package.json +4 -0
  69. package/component/input-otp/README.md +278 -0
  70. package/component/input-otp/package.json +4 -0
  71. package/component/item/README.md +247 -0
  72. package/component/item/package.json +4 -0
  73. package/component/kanban/README.md +81 -0
  74. package/component/kanban/package.json +4 -0
  75. package/component/kbd/README.md +139 -0
  76. package/component/kbd/package.json +4 -0
  77. package/component/label/README.md +136 -0
  78. package/component/label/package.json +4 -0
  79. package/component/menubar/README.md +269 -0
  80. package/component/menubar/package.json +4 -0
  81. package/component/native-select/README.md +176 -0
  82. package/component/native-select/package.json +4 -0
  83. package/component/navigation-menu/README.md +160 -0
  84. package/component/navigation-menu/package.json +4 -0
  85. package/component/pagination/README.md +144 -0
  86. package/component/pagination/package.json +4 -0
  87. package/component/pillbox/README.md +67 -0
  88. package/component/pillbox/package.json +4 -0
  89. package/component/popover/README.md +43 -0
  90. package/component/popover/package.json +4 -0
  91. package/component/progress/README.md +160 -0
  92. package/component/progress/package.json +4 -0
  93. package/component/radio/README.md +209 -0
  94. package/component/radio/package.json +4 -0
  95. package/component/resizable/README.md +168 -0
  96. package/component/resizable/package.json +4 -0
  97. package/component/scroll-area/README.md +143 -0
  98. package/component/scroll-area/package.json +4 -0
  99. package/component/select/README.md +174 -0
  100. package/component/select/package.json +4 -0
  101. package/component/separator/README.md +170 -0
  102. package/component/separator/package.json +4 -0
  103. package/component/sheet/README.md +183 -0
  104. package/component/sheet/package.json +4 -0
  105. package/component/skeleton/README.md +158 -0
  106. package/component/skeleton/package.json +4 -0
  107. package/component/slider/README.md +207 -0
  108. package/component/slider/package.json +4 -0
  109. package/component/spinner/README.md +160 -0
  110. package/component/spinner/package.json +4 -0
  111. package/component/switch/README.md +166 -0
  112. package/component/switch/package.json +4 -0
  113. package/component/table/README.md +291 -0
  114. package/component/table/package.json +4 -0
  115. package/component/tabs/README.md +219 -0
  116. package/component/tabs/package.json +4 -0
  117. package/component/textarea/README.md +154 -0
  118. package/component/textarea/package.json +4 -0
  119. package/component/timeline/README.md +94 -0
  120. package/component/timeline/package.json +4 -0
  121. package/component/toast/README.md +321 -0
  122. package/component/toast/package.json +4 -0
  123. package/component/toggle/README.md +131 -0
  124. package/component/toggle/package.json +4 -0
  125. package/component/toggle-group/README.md +206 -0
  126. package/component/toggle-group/package.json +4 -0
  127. package/component/tooltip/README.md +211 -0
  128. package/component/tooltip/package.json +4 -0
  129. package/component/utils/package.json +4 -0
  130. package/fesm2022/ojiepermana-angular-component-accordion.mjs +189 -0
  131. package/fesm2022/ojiepermana-angular-component-accordion.mjs.map +1 -0
  132. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +276 -0
  133. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs.map +1 -0
  134. package/fesm2022/ojiepermana-angular-component-alert.mjs +99 -0
  135. package/fesm2022/ojiepermana-angular-component-alert.mjs.map +1 -0
  136. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +37 -0
  137. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs.map +1 -0
  138. package/fesm2022/ojiepermana-angular-component-avatar.mjs +139 -0
  139. package/fesm2022/ojiepermana-angular-component-avatar.mjs.map +1 -0
  140. package/fesm2022/ojiepermana-angular-component-badge.mjs +50 -0
  141. package/fesm2022/ojiepermana-angular-component-badge.mjs.map +1 -0
  142. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +200 -0
  143. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs.map +1 -0
  144. package/fesm2022/ojiepermana-angular-component-button-group.mjs +103 -0
  145. package/fesm2022/ojiepermana-angular-component-button-group.mjs.map +1 -0
  146. package/fesm2022/ojiepermana-angular-component-button.mjs +68 -0
  147. package/fesm2022/ojiepermana-angular-component-button.mjs.map +1 -0
  148. package/fesm2022/ojiepermana-angular-component-calendar.mjs +88 -0
  149. package/fesm2022/ojiepermana-angular-component-calendar.mjs.map +1 -0
  150. package/fesm2022/ojiepermana-angular-component-card.mjs +152 -0
  151. package/fesm2022/ojiepermana-angular-component-card.mjs.map +1 -0
  152. package/fesm2022/ojiepermana-angular-component-carousel.mjs +334 -0
  153. package/fesm2022/ojiepermana-angular-component-carousel.mjs.map +1 -0
  154. package/fesm2022/ojiepermana-angular-component-chart-area.mjs +6 -0
  155. package/fesm2022/ojiepermana-angular-component-chart-area.mjs.map +1 -0
  156. package/fesm2022/ojiepermana-angular-component-chart-bar.mjs +6 -0
  157. package/fesm2022/ojiepermana-angular-component-chart-bar.mjs.map +1 -0
  158. package/fesm2022/ojiepermana-angular-component-chart-line.mjs +6 -0
  159. package/fesm2022/ojiepermana-angular-component-chart-line.mjs.map +1 -0
  160. package/fesm2022/ojiepermana-angular-component-chart-pie.mjs +6 -0
  161. package/fesm2022/ojiepermana-angular-component-chart-pie.mjs.map +1 -0
  162. package/fesm2022/ojiepermana-angular-component-chart-radar.mjs +6 -0
  163. package/fesm2022/ojiepermana-angular-component-chart-radar.mjs.map +1 -0
  164. package/fesm2022/ojiepermana-angular-component-chart-radial.mjs +6 -0
  165. package/fesm2022/ojiepermana-angular-component-chart-radial.mjs.map +1 -0
  166. package/fesm2022/ojiepermana-angular-component-chart-scatter.mjs +6 -0
  167. package/fesm2022/ojiepermana-angular-component-chart-scatter.mjs.map +1 -0
  168. package/fesm2022/ojiepermana-angular-component-chart.mjs +3925 -0
  169. package/fesm2022/ojiepermana-angular-component-chart.mjs.map +1 -0
  170. package/fesm2022/ojiepermana-angular-component-checkbox.mjs +114 -0
  171. package/fesm2022/ojiepermana-angular-component-checkbox.mjs.map +1 -0
  172. package/fesm2022/ojiepermana-angular-component-collapsible.mjs +124 -0
  173. package/fesm2022/ojiepermana-angular-component-collapsible.mjs.map +1 -0
  174. package/fesm2022/ojiepermana-angular-component-combobox.mjs +272 -0
  175. package/fesm2022/ojiepermana-angular-component-combobox.mjs.map +1 -0
  176. package/fesm2022/ojiepermana-angular-component-command.mjs +293 -0
  177. package/fesm2022/ojiepermana-angular-component-command.mjs.map +1 -0
  178. package/fesm2022/ojiepermana-angular-component-composer.mjs +352 -0
  179. package/fesm2022/ojiepermana-angular-component-composer.mjs.map +1 -0
  180. package/fesm2022/ojiepermana-angular-component-context-menu.mjs +103 -0
  181. package/fesm2022/ojiepermana-angular-component-context-menu.mjs.map +1 -0
  182. package/fesm2022/ojiepermana-angular-component-date-picker.mjs +170 -0
  183. package/fesm2022/ojiepermana-angular-component-date-picker.mjs.map +1 -0
  184. package/fesm2022/ojiepermana-angular-component-dialog.mjs +279 -0
  185. package/fesm2022/ojiepermana-angular-component-dialog.mjs.map +1 -0
  186. package/fesm2022/ojiepermana-angular-component-drawer.mjs +6 -0
  187. package/fesm2022/ojiepermana-angular-component-drawer.mjs.map +1 -0
  188. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +492 -0
  189. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs.map +1 -0
  190. package/fesm2022/ojiepermana-angular-component-editor.mjs +717 -0
  191. package/fesm2022/ojiepermana-angular-component-editor.mjs.map +1 -0
  192. package/fesm2022/ojiepermana-angular-component-empty.mjs +145 -0
  193. package/fesm2022/ojiepermana-angular-component-empty.mjs.map +1 -0
  194. package/fesm2022/ojiepermana-angular-component-form.mjs +366 -0
  195. package/fesm2022/ojiepermana-angular-component-form.mjs.map +1 -0
  196. package/fesm2022/ojiepermana-angular-component-hover-card.mjs +297 -0
  197. package/fesm2022/ojiepermana-angular-component-hover-card.mjs.map +1 -0
  198. package/fesm2022/ojiepermana-angular-component-input-group.mjs +179 -0
  199. package/fesm2022/ojiepermana-angular-component-input-group.mjs.map +1 -0
  200. package/fesm2022/ojiepermana-angular-component-input-otp.mjs +514 -0
  201. package/fesm2022/ojiepermana-angular-component-input-otp.mjs.map +1 -0
  202. package/fesm2022/ojiepermana-angular-component-input.mjs +45 -0
  203. package/fesm2022/ojiepermana-angular-component-input.mjs.map +1 -0
  204. package/fesm2022/ojiepermana-angular-component-item.mjs +264 -0
  205. package/fesm2022/ojiepermana-angular-component-item.mjs.map +1 -0
  206. package/fesm2022/ojiepermana-angular-component-kanban.mjs +314 -0
  207. package/fesm2022/ojiepermana-angular-component-kanban.mjs.map +1 -0
  208. package/fesm2022/ojiepermana-angular-component-kbd.mjs +55 -0
  209. package/fesm2022/ojiepermana-angular-component-kbd.mjs.map +1 -0
  210. package/fesm2022/ojiepermana-angular-component-label.mjs +33 -0
  211. package/fesm2022/ojiepermana-angular-component-label.mjs.map +1 -0
  212. package/fesm2022/ojiepermana-angular-component-menubar.mjs +308 -0
  213. package/fesm2022/ojiepermana-angular-component-menubar.mjs.map +1 -0
  214. package/fesm2022/ojiepermana-angular-component-native-select.mjs +67 -0
  215. package/fesm2022/ojiepermana-angular-component-native-select.mjs.map +1 -0
  216. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +413 -0
  217. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs.map +1 -0
  218. package/fesm2022/ojiepermana-angular-component-pagination.mjs +226 -0
  219. package/fesm2022/ojiepermana-angular-component-pagination.mjs.map +1 -0
  220. package/fesm2022/ojiepermana-angular-component-pillbox.mjs +812 -0
  221. package/fesm2022/ojiepermana-angular-component-pillbox.mjs.map +1 -0
  222. package/fesm2022/ojiepermana-angular-component-popover.mjs +169 -0
  223. package/fesm2022/ojiepermana-angular-component-popover.mjs.map +1 -0
  224. package/fesm2022/ojiepermana-angular-component-progress.mjs +60 -0
  225. package/fesm2022/ojiepermana-angular-component-progress.mjs.map +1 -0
  226. package/fesm2022/ojiepermana-angular-component-radio.mjs +122 -0
  227. package/fesm2022/ojiepermana-angular-component-radio.mjs.map +1 -0
  228. package/fesm2022/ojiepermana-angular-component-resizable.mjs +481 -0
  229. package/fesm2022/ojiepermana-angular-component-resizable.mjs.map +1 -0
  230. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +54 -0
  231. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs.map +1 -0
  232. package/fesm2022/ojiepermana-angular-component-select.mjs +176 -0
  233. package/fesm2022/ojiepermana-angular-component-select.mjs.map +1 -0
  234. package/fesm2022/ojiepermana-angular-component-separator.mjs +37 -0
  235. package/fesm2022/ojiepermana-angular-component-separator.mjs.map +1 -0
  236. package/fesm2022/ojiepermana-angular-component-sheet.mjs +284 -0
  237. package/fesm2022/ojiepermana-angular-component-sheet.mjs.map +1 -0
  238. package/fesm2022/ojiepermana-angular-component-skeleton.mjs +31 -0
  239. package/fesm2022/ojiepermana-angular-component-skeleton.mjs.map +1 -0
  240. package/fesm2022/ojiepermana-angular-component-slider.mjs +423 -0
  241. package/fesm2022/ojiepermana-angular-component-slider.mjs.map +1 -0
  242. package/fesm2022/ojiepermana-angular-component-spinner.mjs +60 -0
  243. package/fesm2022/ojiepermana-angular-component-spinner.mjs.map +1 -0
  244. package/fesm2022/ojiepermana-angular-component-switch.mjs +116 -0
  245. package/fesm2022/ojiepermana-angular-component-switch.mjs.map +1 -0
  246. package/fesm2022/ojiepermana-angular-component-table.mjs +155 -0
  247. package/fesm2022/ojiepermana-angular-component-table.mjs.map +1 -0
  248. package/fesm2022/ojiepermana-angular-component-tabs.mjs +272 -0
  249. package/fesm2022/ojiepermana-angular-component-tabs.mjs.map +1 -0
  250. package/fesm2022/ojiepermana-angular-component-textarea.mjs +39 -0
  251. package/fesm2022/ojiepermana-angular-component-textarea.mjs.map +1 -0
  252. package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -0
  253. package/fesm2022/ojiepermana-angular-component-timeline.mjs.map +1 -0
  254. package/fesm2022/ojiepermana-angular-component-toast.mjs +71 -0
  255. package/fesm2022/ojiepermana-angular-component-toast.mjs.map +1 -0
  256. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +289 -0
  257. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs.map +1 -0
  258. package/fesm2022/ojiepermana-angular-component-toggle.mjs +82 -0
  259. package/fesm2022/ojiepermana-angular-component-toggle.mjs.map +1 -0
  260. package/fesm2022/ojiepermana-angular-component-tooltip.mjs +354 -0
  261. package/fesm2022/ojiepermana-angular-component-tooltip.mjs.map +1 -0
  262. package/fesm2022/ojiepermana-angular-component-utils.mjs +13 -0
  263. package/fesm2022/ojiepermana-angular-component-utils.mjs.map +1 -0
  264. package/fesm2022/ojiepermana-angular-generator-api.mjs +68 -0
  265. package/fesm2022/ojiepermana-angular-generator-api.mjs.map +1 -0
  266. package/fesm2022/ojiepermana-angular-layout-component.mjs +602 -0
  267. package/fesm2022/ojiepermana-angular-layout-component.mjs.map +1 -0
  268. package/fesm2022/ojiepermana-angular-layout-provider.mjs +21 -0
  269. package/fesm2022/ojiepermana-angular-layout-provider.mjs.map +1 -0
  270. package/fesm2022/ojiepermana-angular-layout-services.mjs +116 -0
  271. package/fesm2022/ojiepermana-angular-layout-services.mjs.map +1 -0
  272. package/fesm2022/ojiepermana-angular-layout-shell.mjs +48 -0
  273. package/fesm2022/ojiepermana-angular-layout-shell.mjs.map +1 -0
  274. package/fesm2022/ojiepermana-angular-layout-token-directive.mjs +30 -0
  275. package/fesm2022/ojiepermana-angular-layout-token-directive.mjs.map +1 -0
  276. package/fesm2022/ojiepermana-angular-layout-token.mjs +33 -0
  277. package/fesm2022/ojiepermana-angular-layout-token.mjs.map +1 -0
  278. package/fesm2022/ojiepermana-angular-layout-type-empty.mjs +49 -0
  279. package/fesm2022/ojiepermana-angular-layout-type-empty.mjs.map +1 -0
  280. package/fesm2022/ojiepermana-angular-layout-type-horizontal.mjs +128 -0
  281. package/fesm2022/ojiepermana-angular-layout-type-horizontal.mjs.map +1 -0
  282. package/fesm2022/ojiepermana-angular-layout-type-vertical.mjs +123 -0
  283. package/fesm2022/ojiepermana-angular-layout-type-vertical.mjs.map +1 -0
  284. package/fesm2022/ojiepermana-angular-layout.mjs +485 -0
  285. package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -0
  286. package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs +334 -0
  287. package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs.map +1 -0
  288. package/fesm2022/ojiepermana-angular-navigation-icon.mjs +63 -0
  289. package/fesm2022/ojiepermana-angular-navigation-icon.mjs.map +1 -0
  290. package/fesm2022/ojiepermana-angular-navigation-item.mjs +559 -0
  291. package/fesm2022/ojiepermana-angular-navigation-item.mjs.map +1 -0
  292. package/fesm2022/ojiepermana-angular-navigation-service.mjs +213 -0
  293. package/fesm2022/ojiepermana-angular-navigation-service.mjs.map +1 -0
  294. package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs +401 -0
  295. package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs.map +1 -0
  296. package/fesm2022/ojiepermana-angular-navigation-topbar.mjs +670 -0
  297. package/fesm2022/ojiepermana-angular-navigation-topbar.mjs.map +1 -0
  298. package/fesm2022/ojiepermana-angular-navigation-types.mjs +4 -0
  299. package/fesm2022/ojiepermana-angular-navigation-types.mjs.map +1 -0
  300. package/fesm2022/ojiepermana-angular-theme-provider.mjs +35 -0
  301. package/fesm2022/ojiepermana-angular-theme-provider.mjs.map +1 -0
  302. package/fesm2022/ojiepermana-angular-theme-services.mjs +294 -0
  303. package/fesm2022/ojiepermana-angular-theme-services.mjs.map +1 -0
  304. package/fesm2022/ojiepermana-angular-theme-token.mjs +56 -0
  305. package/fesm2022/ojiepermana-angular-theme-token.mjs.map +1 -0
  306. package/fesm2022/ojiepermana-angular-theme.mjs +390 -0
  307. package/fesm2022/ojiepermana-angular-theme.mjs.map +1 -0
  308. package/fesm2022/ojiepermana-angular.mjs +22 -0
  309. package/fesm2022/ojiepermana-angular.mjs.map +1 -0
  310. package/generator/api/README.md +252 -0
  311. package/generator/api/bin/package.json +3 -0
  312. package/generator/api/bin/schematics/init/index.js +90 -0
  313. package/generator/api/bin/schematics/ng-add/index.js +131 -0
  314. package/generator/api/bin/schematics/sdk/index.js +76 -0
  315. package/generator/api/bin/src/config/loader.js +41 -0
  316. package/generator/api/bin/src/config/schema.js +57 -0
  317. package/generator/api/bin/src/emit/client.js +248 -0
  318. package/generator/api/bin/src/emit/metadata.js +295 -0
  319. package/generator/api/bin/src/emit/models.js +106 -0
  320. package/generator/api/bin/src/emit/navigation.js +56 -0
  321. package/generator/api/bin/src/emit/operations.js +122 -0
  322. package/generator/api/bin/src/emit/public-api.js +54 -0
  323. package/generator/api/bin/src/emit/services.js +87 -0
  324. package/generator/api/bin/src/engine.js +65 -0
  325. package/generator/api/bin/src/layout/per-domain.js +359 -0
  326. package/generator/api/bin/src/parser/bundle.js +25 -0
  327. package/generator/api/bin/src/parser/ir.js +320 -0
  328. package/generator/api/bin/src/parser/types.js +7 -0
  329. package/generator/api/bin/src/render/template.js +58 -0
  330. package/generator/api/bin/src/writer/index.js +278 -0
  331. package/generator/api/package.json +4 -0
  332. package/generator/api/schematics/init/schema.json +19 -0
  333. package/generator/api/schematics/ng-add/schema.json +14 -0
  334. package/generator/api/schematics/sdk/schema.json +19 -0
  335. package/generator/api/sdk.config.example.json +24 -0
  336. package/generator/guide/README.md +84 -0
  337. package/generator/guide/bin/package.json +3 -0
  338. package/generator/guide/bin/schematics/build/index.js +36 -0
  339. package/generator/guide/bin/schematics/init/index.js +70 -0
  340. package/generator/guide/bin/src/config/loader.js +50 -0
  341. package/generator/guide/bin/src/config/schema.js +12 -0
  342. package/generator/guide/bin/src/engine/component.js +74 -0
  343. package/generator/guide/bin/src/engine/frontmatter.js +42 -0
  344. package/generator/guide/bin/src/engine/index.js +42 -0
  345. package/generator/guide/bin/src/engine/naming.js +39 -0
  346. package/generator/guide/bin/src/engine/render.js +36 -0
  347. package/generator/guide/bin/src/engine/routes.js +106 -0
  348. package/generator/guide/bin/src/engine/walk.js +35 -0
  349. package/generator/guide/guide.config.example.json +9 -0
  350. package/generator/guide/schematics/build/schema.json +14 -0
  351. package/generator/guide/schematics/init/schema.json +19 -0
  352. package/layout/component/package.json +4 -0
  353. package/layout/package.json +4 -0
  354. package/layout/provider/package.json +4 -0
  355. package/layout/services/package.json +4 -0
  356. package/layout/shell/package.json +4 -0
  357. package/layout/token/directive/package.json +4 -0
  358. package/layout/token/package.json +4 -0
  359. package/layout/type/empty/package.json +4 -0
  360. package/layout/type/horizontal/package.json +4 -0
  361. package/layout/type/vertical/package.json +4 -0
  362. package/navigation/demo-data/package.json +4 -0
  363. package/navigation/icon/package.json +4 -0
  364. package/navigation/item/package.json +4 -0
  365. package/navigation/service/package.json +4 -0
  366. package/navigation/sidebar/package.json +4 -0
  367. package/navigation/topbar/README.md +196 -0
  368. package/navigation/topbar/package.json +4 -0
  369. package/navigation/types/package.json +4 -0
  370. package/package.json +433 -18
  371. package/theme/README.md +174 -0
  372. package/theme/package.json +4 -0
  373. package/theme/provider/package.json +4 -0
  374. package/theme/services/package.json +4 -0
  375. package/theme/styles/foundation/components.css +81 -0
  376. package/theme/styles/foundation/layers.css +15 -0
  377. package/theme/styles/foundation/tokens.css +55 -0
  378. package/theme/styles/index.css +37 -0
  379. package/theme/styles/integrations/material/autocomplete.css +178 -0
  380. package/theme/styles/integrations/material/button.css +468 -0
  381. package/theme/styles/integrations/material/dialog.css +152 -0
  382. package/theme/styles/integrations/material/select.css +175 -0
  383. package/theme/styles/integrations/material/slide-toggle.css +234 -0
  384. package/theme/styles/integrations/material/slider.css +194 -0
  385. package/theme/styles/integrations/material/tabs.css +229 -0
  386. package/theme/styles/integrations/material.css +264 -0
  387. package/theme/styles/integrations/tailwind.css +114 -0
  388. package/theme/styles/variants/color/amber.css +31 -0
  389. package/theme/styles/variants/color/base.css +36 -0
  390. package/theme/styles/variants/color/blue.css +31 -0
  391. package/theme/styles/variants/color/cyan.css +31 -0
  392. package/theme/styles/variants/color/emerald.css +31 -0
  393. package/theme/styles/variants/color/fuchsia.css +31 -0
  394. package/theme/styles/variants/color/green.css +31 -0
  395. package/theme/styles/variants/color/index.css +22 -0
  396. package/theme/styles/variants/color/indigo.css +31 -0
  397. package/theme/styles/variants/color/lime.css +31 -0
  398. package/theme/styles/variants/color/orange.css +31 -0
  399. package/theme/styles/variants/color/pink.css +31 -0
  400. package/theme/styles/variants/color/purple.css +31 -0
  401. package/theme/styles/variants/color/red.css +31 -0
  402. package/theme/styles/variants/color/rose.css +31 -0
  403. package/theme/styles/variants/color/sky.css +31 -0
  404. package/theme/styles/variants/color/teal.css +31 -0
  405. package/theme/styles/variants/color/violet.css +31 -0
  406. package/theme/styles/variants/color/yellow.css +31 -0
  407. package/theme/styles/variants/mode/dark.css +20 -0
  408. package/theme/styles/variants/mode/index.css +6 -0
  409. package/theme/styles/variants/mode/light.css +24 -0
  410. package/theme/styles/variants/style/brutal.css +50 -0
  411. package/theme/styles/variants/style/default.css +54 -0
  412. package/theme/styles/variants/style/index.css +8 -0
  413. package/theme/styles/variants/style/sharp.css +50 -0
  414. package/theme/styles/variants/style/soft.css +50 -0
  415. package/theme/token/package.json +4 -0
  416. package/types/ojiepermana-angular-component-accordion.d.ts +51 -0
  417. package/types/ojiepermana-angular-component-alert-dialog.d.ts +93 -0
  418. package/types/ojiepermana-angular-component-alert.d.ts +37 -0
  419. package/types/ojiepermana-angular-component-aspect-ratio.d.ts +12 -0
  420. package/types/ojiepermana-angular-component-avatar.d.ts +51 -0
  421. package/types/ojiepermana-angular-component-badge.d.ts +19 -0
  422. package/types/ojiepermana-angular-component-breadcrumb.d.ts +46 -0
  423. package/types/ojiepermana-angular-component-button-group.d.ts +26 -0
  424. package/types/ojiepermana-angular-component-button.d.ts +22 -0
  425. package/types/ojiepermana-angular-component-calendar.d.ts +33 -0
  426. package/types/ojiepermana-angular-component-card.d.ts +60 -0
  427. package/types/ojiepermana-angular-component-carousel.d.ts +86 -0
  428. package/types/ojiepermana-angular-component-chart-area.d.ts +1 -0
  429. package/types/ojiepermana-angular-component-chart-bar.d.ts +1 -0
  430. package/types/ojiepermana-angular-component-chart-line.d.ts +1 -0
  431. package/types/ojiepermana-angular-component-chart-pie.d.ts +1 -0
  432. package/types/ojiepermana-angular-component-chart-radar.d.ts +1 -0
  433. package/types/ojiepermana-angular-component-chart-radial.d.ts +1 -0
  434. package/types/ojiepermana-angular-component-chart-scatter.d.ts +1 -0
  435. package/types/ojiepermana-angular-component-chart.d.ts +1094 -0
  436. package/types/ojiepermana-angular-component-checkbox.d.ts +35 -0
  437. package/types/ojiepermana-angular-component-collapsible.d.ts +42 -0
  438. package/types/ojiepermana-angular-component-combobox.d.ts +50 -0
  439. package/types/ojiepermana-angular-component-command.d.ts +99 -0
  440. package/types/ojiepermana-angular-component-composer.d.ts +90 -0
  441. package/types/ojiepermana-angular-component-context-menu.d.ts +35 -0
  442. package/types/ojiepermana-angular-component-date-picker.d.ts +41 -0
  443. package/types/ojiepermana-angular-component-dialog.d.ts +87 -0
  444. package/types/ojiepermana-angular-component-drawer.d.ts +1 -0
  445. package/types/ojiepermana-angular-component-dropdown-menu.d.ts +137 -0
  446. package/types/ojiepermana-angular-component-editor.d.ts +123 -0
  447. package/types/ojiepermana-angular-component-empty.d.ts +50 -0
  448. package/types/ojiepermana-angular-component-form.d.ts +141 -0
  449. package/types/ojiepermana-angular-component-hover-card.d.ts +74 -0
  450. package/types/ojiepermana-angular-component-input-group.d.ts +51 -0
  451. package/types/ojiepermana-angular-component-input-otp.d.ts +136 -0
  452. package/types/ojiepermana-angular-component-input.d.ts +16 -0
  453. package/types/ojiepermana-angular-component-item.d.ts +88 -0
  454. package/types/ojiepermana-angular-component-kanban.d.ts +70 -0
  455. package/types/ojiepermana-angular-component-kbd.d.ts +16 -0
  456. package/types/ojiepermana-angular-component-label.d.ts +11 -0
  457. package/types/ojiepermana-angular-component-menubar.d.ts +67 -0
  458. package/types/ojiepermana-angular-component-native-select.d.ts +26 -0
  459. package/types/ojiepermana-angular-component-navigation-menu.d.ts +96 -0
  460. package/types/ojiepermana-angular-component-pagination.d.ts +33 -0
  461. package/types/ojiepermana-angular-component-pillbox.d.ts +157 -0
  462. package/types/ojiepermana-angular-component-popover.d.ts +43 -0
  463. package/types/ojiepermana-angular-component-progress.d.ts +17 -0
  464. package/types/ojiepermana-angular-component-radio.d.ts +40 -0
  465. package/types/ojiepermana-angular-component-resizable.d.ts +99 -0
  466. package/types/ojiepermana-angular-component-scroll-area.d.ts +19 -0
  467. package/types/ojiepermana-angular-component-select.d.ts +57 -0
  468. package/types/ojiepermana-angular-component-separator.d.ts +14 -0
  469. package/types/ojiepermana-angular-component-sheet.d.ts +76 -0
  470. package/types/ojiepermana-angular-component-skeleton.d.ts +10 -0
  471. package/types/ojiepermana-angular-component-slider.d.ts +74 -0
  472. package/types/ojiepermana-angular-component-spinner.d.ts +13 -0
  473. package/types/ojiepermana-angular-component-switch.d.ts +40 -0
  474. package/types/ojiepermana-angular-component-table.d.ts +52 -0
  475. package/types/ojiepermana-angular-component-tabs.d.ts +92 -0
  476. package/types/ojiepermana-angular-component-textarea.d.ts +12 -0
  477. package/types/ojiepermana-angular-component-timeline.d.ts +63 -0
  478. package/types/ojiepermana-angular-component-toast.d.ts +38 -0
  479. package/types/ojiepermana-angular-component-toggle-group.d.ts +89 -0
  480. package/types/ojiepermana-angular-component-toggle.d.ts +25 -0
  481. package/types/ojiepermana-angular-component-tooltip.d.ts +89 -0
  482. package/types/ojiepermana-angular-component-utils.d.ts +5 -0
  483. package/types/ojiepermana-angular-generator-api.d.ts +86 -0
  484. package/types/ojiepermana-angular-layout-component.d.ts +205 -0
  485. package/types/ojiepermana-angular-layout-provider.d.ts +6 -0
  486. package/types/ojiepermana-angular-layout-services.d.ts +25 -0
  487. package/types/ojiepermana-angular-layout-shell.d.ts +8 -0
  488. package/types/ojiepermana-angular-layout-token-directive.d.ts +13 -0
  489. package/types/ojiepermana-angular-layout-token.d.ts +36 -0
  490. package/types/ojiepermana-angular-layout-type-empty.d.ts +22 -0
  491. package/types/ojiepermana-angular-layout-type-horizontal.d.ts +36 -0
  492. package/types/ojiepermana-angular-layout-type-vertical.d.ts +38 -0
  493. package/types/ojiepermana-angular-layout.d.ts +164 -0
  494. package/types/ojiepermana-angular-navigation-demo-data.d.ts +5 -0
  495. package/types/ojiepermana-angular-navigation-icon.d.ts +17 -0
  496. package/types/ojiepermana-angular-navigation-item.d.ts +54 -0
  497. package/types/ojiepermana-angular-navigation-service.d.ts +77 -0
  498. package/types/ojiepermana-angular-navigation-sidebar.d.ts +75 -0
  499. package/types/ojiepermana-angular-navigation-topbar.d.ts +74 -0
  500. package/types/ojiepermana-angular-navigation-types.d.ts +135 -0
  501. package/types/ojiepermana-angular-theme-provider.d.ts +11 -0
  502. package/types/ojiepermana-angular-theme-services.d.ts +55 -0
  503. package/types/ojiepermana-angular-theme-token.d.ts +57 -0
  504. package/types/ojiepermana-angular-theme.d.ts +116 -0
  505. package/types/ojiepermana-angular.d.ts +3 -0
  506. package/fesm2022/edsis-angular-block-shell.mjs +0 -698
  507. package/fesm2022/edsis-angular-block-shell.mjs.map +0 -1
  508. package/fesm2022/edsis-angular-module-auth.mjs +0 -1317
  509. package/fesm2022/edsis-angular-module-auth.mjs.map +0 -1
  510. package/fesm2022/edsis-angular.mjs +0 -8
  511. package/fesm2022/edsis-angular.mjs.map +0 -1
  512. package/types/edsis-angular-block-shell.d.ts +0 -111
  513. package/types/edsis-angular-module-auth.d.ts +0 -132
  514. package/types/edsis-angular.d.ts +0 -2
@@ -1,1317 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, makeEnvironmentProviders, ChangeDetectionStrategy, Component, DestroyRef, signal, computed, input, effect } from '@angular/core';
3
- import { HttpContextToken, HttpErrorResponse, provideHttpClient, withFetch, withInterceptors } from '@angular/common/http';
4
- import { ApiConfiguration, provideApiConfiguration } from '@edsis/sdk/shared';
5
- import { DOCUMENT, Location } from '@angular/common';
6
- import { AuthService } from '@edsis/sdk/auth';
7
- import { firstValueFrom, throwError, from, startWith, finalize } from 'rxjs';
8
- import { switchMap, catchError } from 'rxjs/operators';
9
- import { Router, RouterOutlet, RouterLink, ActivatedRoute } from '@angular/router';
10
- import { UiLayoutComponent, UiLayoutFluidComponent } from '@edsis/ui/layout';
11
- import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
12
- import * as i1 from '@angular/forms';
13
- import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
14
- import { AspectRatioComponent } from '@edsis/ui/aspect-ratio';
15
- import { ButtonComponent } from '@edsis/ui/button';
16
- import { CardActionComponent, CardComponent, CardContentComponent, CardDescriptionComponent, CardHeaderComponent, CardTitleComponent, CardFooterComponent } from '@edsis/ui/card';
17
- import { InputGroupAddonComponent, InputGroupButtonComponent, InputGroupComponent, InputGroupInputComponent } from '@edsis/ui/input-group';
18
- import { LabelComponent } from '@edsis/ui/label';
19
- import { SeparatorComponent } from '@edsis/ui/separator';
20
- import { AlertComponent, AlertDescriptionComponent } from '@edsis/ui/alert';
21
- import { SpinnerComponent } from '@edsis/ui/spinner';
22
-
23
- const DEFAULT_LOGIN_PATH = '/login';
24
- const DEFAULT_LOGOUT_PATH = '/logout';
25
- const DEFAULT_VERIFY_PATH = '/verify';
26
- const DEFAULT_AUTHENTICATED_HOME_PATH = '/dashboard';
27
- const EDSIS_AUTH_CONFIG = new InjectionToken('EDSIS_AUTH_CONFIG');
28
- function resolveEdsisAuthConfig(config) {
29
- const loginPath = normalizePath(config.loginPath, DEFAULT_LOGIN_PATH);
30
- return {
31
- apiUrl: normalizeAbsoluteUrl(config.apiUrl, 'apiUrl'),
32
- appUrl: normalizeAbsoluteUrl(config.appUrl, 'appUrl'),
33
- loginPath,
34
- logoutPath: normalizePath(config.logoutPath, DEFAULT_LOGOUT_PATH),
35
- verifyPath: normalizePath(config.verifyPath, DEFAULT_VERIFY_PATH),
36
- authenticatedHomePath: normalizePath(config.authenticatedHomePath, DEFAULT_AUTHENTICATED_HOME_PATH),
37
- guestHomePath: normalizePath(config.guestHomePath, loginPath),
38
- };
39
- }
40
- function normalizeAbsoluteUrl(value, label) {
41
- const normalizedValue = value.trim();
42
- if (!normalizedValue) {
43
- throw new Error(`Edsis auth requires a non-empty ${label}.`);
44
- }
45
- const normalizedUrl = new URL(normalizedValue);
46
- return normalizedUrl.toString().replace(/\/$/, '');
47
- }
48
- function normalizePath(value, fallback) {
49
- const normalizedValue = value?.trim();
50
- if (!normalizedValue) {
51
- return fallback;
52
- }
53
- return (normalizedValue.startsWith('/') ? normalizedValue : `/${normalizedValue}`);
54
- }
55
-
56
- const AUTH_SESSION_STORAGE_KEYS = ['access_token', 'user_id', 'role', 'name'];
57
- const AUTH_SESSION_METADATA_STORAGE_KEYS = ['access_token_trusted'];
58
- const AUTH_SESSION_CHANGE_EVENT = 'edsis-auth-session-change';
59
- const EMPTY_SESSION_FINGERPRINT = '__empty_session__';
60
- const JWT_PART_COUNT = 3;
61
- const TOKEN_EXPIRY_SKEW_MS = 30_000;
62
- let validatedAccessToken = '';
63
- let validatedUntilEpochMs = 0;
64
- let failedSessionFingerprint = null;
65
- let pendingSessionValidation = null;
66
- function ɵresetAuthSessionModuleState() {
67
- clearValidatedSession();
68
- clearFailedSessionFingerprint();
69
- pendingSessionValidation = null;
70
- }
71
- function getSessionStorage(documentRef) {
72
- return documentRef.defaultView?.sessionStorage ?? null;
73
- }
74
- function readSessionStorageValue(documentRef, storageKey) {
75
- return getSessionStorage(documentRef)?.getItem(storageKey)?.trim() ?? '';
76
- }
77
- function readSessionDataValue(sessionData, storageKey) {
78
- const value = sessionData?.[storageKey];
79
- return typeof value === 'string' ? value.trim() : '';
80
- }
81
- function notifySessionChange(documentRef) {
82
- documentRef.defaultView?.dispatchEvent(new Event(AUTH_SESSION_CHANGE_EVENT));
83
- }
84
- function clearValidatedSession() {
85
- validatedAccessToken = '';
86
- validatedUntilEpochMs = 0;
87
- }
88
- function clearFailedSessionFingerprint() {
89
- failedSessionFingerprint = null;
90
- }
91
- function readSessionFingerprint(documentRef) {
92
- return readStoredAccessToken(documentRef) || EMPTY_SESSION_FINGERPRINT;
93
- }
94
- function hasFailedSessionFingerprint(documentRef) {
95
- return failedSessionFingerprint === readSessionFingerprint(documentRef);
96
- }
97
- function markFailedSessionFingerprint(documentRef) {
98
- failedSessionFingerprint = readSessionFingerprint(documentRef);
99
- }
100
- function readTrustedAccessToken(documentRef) {
101
- return readSessionStorageValue(documentRef, 'access_token_trusted');
102
- }
103
- function getTokenExpiryEpochMs(documentRef, accessToken) {
104
- const windowRef = documentRef.defaultView;
105
- const tokenParts = accessToken.split('.');
106
- if (!windowRef?.atob || tokenParts.length !== JWT_PART_COUNT) {
107
- return null;
108
- }
109
- const normalizedPayload = tokenParts[1].replace(/-/g, '+').replace(/_/g, '/');
110
- const paddedPayload = normalizedPayload.padEnd(Math.ceil(normalizedPayload.length / 4) * 4, '=');
111
- try {
112
- const parsedPayload = JSON.parse(windowRef.atob(paddedPayload));
113
- return typeof parsedPayload.exp === 'number' ? parsedPayload.exp * 1000 : null;
114
- }
115
- catch {
116
- return null;
117
- }
118
- }
119
- function markValidatedSession(documentRef) {
120
- const accessToken = readStoredAccessToken(documentRef);
121
- if (!accessToken) {
122
- clearValidatedSession();
123
- return;
124
- }
125
- const tokenExpiryEpochMs = getTokenExpiryEpochMs(documentRef, accessToken);
126
- if (!tokenExpiryEpochMs) {
127
- if (readTrustedAccessToken(documentRef) !== accessToken) {
128
- clearValidatedSession();
129
- return;
130
- }
131
- validatedAccessToken = accessToken;
132
- validatedUntilEpochMs = Number.MAX_SAFE_INTEGER;
133
- return;
134
- }
135
- validatedAccessToken = accessToken;
136
- validatedUntilEpochMs = tokenExpiryEpochMs;
137
- }
138
- function hasValidatedSession(documentRef) {
139
- const accessToken = readStoredAccessToken(documentRef);
140
- if (!accessToken) {
141
- clearValidatedSession();
142
- return false;
143
- }
144
- if (accessToken !== validatedAccessToken) {
145
- markValidatedSession(documentRef);
146
- }
147
- if (!validatedAccessToken) {
148
- clearValidatedSession();
149
- return false;
150
- }
151
- return validatedUntilEpochMs > Date.now() + TOKEN_EXPIRY_SKEW_MS;
152
- }
153
- function hasStoredSession(documentRef) {
154
- return Boolean(readStoredAccessToken(documentRef));
155
- }
156
- function readStoredAccessToken(documentRef) {
157
- return readSessionStorageValue(documentRef, 'access_token');
158
- }
159
- function readStoredSession(documentRef) {
160
- const accessToken = readStoredAccessToken(documentRef);
161
- if (!accessToken) {
162
- return null;
163
- }
164
- const userId = readSessionStorageValue(documentRef, 'user_id');
165
- const role = readSessionStorageValue(documentRef, 'role');
166
- const name = readSessionStorageValue(documentRef, 'name');
167
- return {
168
- accessToken,
169
- userId: userId || undefined,
170
- role: role || undefined,
171
- name: name || undefined,
172
- };
173
- }
174
- function persistSession(documentRef, sessionData) {
175
- const sessionStorageRef = getSessionStorage(documentRef);
176
- if (!sessionStorageRef) {
177
- clearValidatedSession();
178
- notifySessionChange(documentRef);
179
- return null;
180
- }
181
- const nextAccessToken = readSessionDataValue(sessionData, 'access_token');
182
- if (!nextAccessToken) {
183
- for (const storageKey of AUTH_SESSION_STORAGE_KEYS) {
184
- sessionStorageRef.removeItem(storageKey);
185
- }
186
- for (const storageKey of AUTH_SESSION_METADATA_STORAGE_KEYS) {
187
- sessionStorageRef.removeItem(storageKey);
188
- }
189
- clearValidatedSession();
190
- clearFailedSessionFingerprint();
191
- notifySessionChange(documentRef);
192
- return null;
193
- }
194
- sessionStorageRef.setItem('access_token', nextAccessToken);
195
- sessionStorageRef.setItem('access_token_trusted', nextAccessToken);
196
- for (const storageKey of AUTH_SESSION_STORAGE_KEYS.slice(1)) {
197
- if (!sessionData || !Object.hasOwn(sessionData, storageKey)) {
198
- continue;
199
- }
200
- const nextValue = readSessionDataValue(sessionData, storageKey);
201
- if (nextValue) {
202
- sessionStorageRef.setItem(storageKey, nextValue);
203
- continue;
204
- }
205
- sessionStorageRef.removeItem(storageKey);
206
- }
207
- markValidatedSession(documentRef);
208
- clearFailedSessionFingerprint();
209
- notifySessionChange(documentRef);
210
- return readStoredSession(documentRef);
211
- }
212
- function clearStoredSession(documentRef, options) {
213
- const sessionStorageRef = getSessionStorage(documentRef);
214
- for (const storageKey of AUTH_SESSION_STORAGE_KEYS) {
215
- sessionStorageRef?.removeItem(storageKey);
216
- }
217
- for (const storageKey of AUTH_SESSION_METADATA_STORAGE_KEYS) {
218
- sessionStorageRef?.removeItem(storageKey);
219
- }
220
- clearValidatedSession();
221
- if (!options?.preserveFailedSessionFingerprint) {
222
- clearFailedSessionFingerprint();
223
- }
224
- notifySessionChange(documentRef);
225
- }
226
- async function validateStoredSession(documentRef, authService, options) {
227
- if (!options?.forceRefresh && hasValidatedSession(documentRef)) {
228
- return true;
229
- }
230
- if (hasFailedSessionFingerprint(documentRef)) {
231
- return false;
232
- }
233
- if (pendingSessionValidation) {
234
- return pendingSessionValidation;
235
- }
236
- pendingSessionValidation = (async () => {
237
- try {
238
- const response = await firstValueFrom(authService.refreshAuthToken());
239
- persistSession(documentRef, response.data);
240
- return hasValidatedSession(documentRef);
241
- }
242
- catch {
243
- clearStoredSession(documentRef, { preserveFailedSessionFingerprint: true });
244
- markFailedSessionFingerprint(documentRef);
245
- return false;
246
- }
247
- finally {
248
- pendingSessionValidation = null;
249
- }
250
- })();
251
- return pendingSessionValidation;
252
- }
253
- function injectSessionState() {
254
- const documentRef = inject(DOCUMENT);
255
- const authService = inject(AuthService);
256
- return validateStoredSession(documentRef, authService);
257
- }
258
- function injectSessionRefresh() {
259
- const documentRef = inject(DOCUMENT);
260
- const authService = inject(AuthService);
261
- return validateStoredSession(documentRef, authService, { forceRefresh: true });
262
- }
263
- function injectSessionClear() {
264
- clearStoredSession(inject(DOCUMENT));
265
- }
266
-
267
- const PROTECTED_API_PATH_PREFIX = '/v1/';
268
- const AUTH_PATH_PREFIX = '/v1/auth/';
269
- const HEALTH_PATH = '/health';
270
- const EDSIS_SKIP_AUTH = new HttpContextToken(() => false);
271
- const EDSIS_AUTH_RETRY = new HttpContextToken(() => false);
272
- function normalizeUrl(url) {
273
- try {
274
- return new URL(url);
275
- }
276
- catch {
277
- return null;
278
- }
279
- }
280
- function resolveApiPath(url, rootUrl) {
281
- const normalizedUrl = normalizeUrl(url);
282
- const normalizedRootUrl = normalizeUrl(rootUrl);
283
- if (normalizedUrl && normalizedRootUrl) {
284
- if (normalizedUrl.origin !== normalizedRootUrl.origin) {
285
- return null;
286
- }
287
- if (!normalizedUrl.pathname.startsWith(normalizedRootUrl.pathname)) {
288
- return null;
289
- }
290
- const apiPath = normalizedUrl.pathname.slice(normalizedRootUrl.pathname.length) || '/';
291
- return apiPath.startsWith('/') ? apiPath : `/${apiPath}`;
292
- }
293
- if (url.startsWith(rootUrl)) {
294
- const apiPath = url.slice(rootUrl.length).split(/[?#]/, 1)[0] ?? '/';
295
- return apiPath.startsWith('/') ? apiPath : `/${apiPath}`;
296
- }
297
- if (url.startsWith('/')) {
298
- return url.split(/[?#]/, 1)[0] ?? url;
299
- }
300
- return null;
301
- }
302
- function isAuthRequest(apiPath) {
303
- return apiPath.startsWith(AUTH_PATH_PREFIX);
304
- }
305
- function isProtectedApiRequest(apiPath) {
306
- return apiPath.startsWith(PROTECTED_API_PATH_PREFIX) && !isAuthRequest(apiPath);
307
- }
308
- function isHealthRequest(apiPath) {
309
- return apiPath === HEALTH_PATH;
310
- }
311
- function isHandledRequest(apiPath) {
312
- return isProtectedApiRequest(apiPath) || isAuthRequest(apiPath) || isHealthRequest(apiPath);
313
- }
314
- function applyCookieCredentials(request, apiPath) {
315
- return isAuthRequest(apiPath) && !request.withCredentials ? request.clone({ withCredentials: true }) : request;
316
- }
317
- function applyBearerToken(request, accessToken, isRetry = false) {
318
- return request.clone({
319
- context: isRetry ? request.context.set(EDSIS_AUTH_RETRY, true) : request.context,
320
- setHeaders: {
321
- Authorization: `Bearer ${accessToken}`,
322
- },
323
- });
324
- }
325
- async function resolveAccessToken(documentRef, authService, options) {
326
- const isSessionValid = await validateStoredSession(documentRef, authService, options);
327
- return isSessionValid ? readStoredAccessToken(documentRef) : '';
328
- }
329
- function handleUnauthorizedError(error, request, next, documentRef, authService) {
330
- if (!(error instanceof HttpErrorResponse) || error.status !== 401 || request.context.get(EDSIS_AUTH_RETRY)) {
331
- return throwError(() => error);
332
- }
333
- return from(resolveAccessToken(documentRef, authService, { forceRefresh: true })).pipe(switchMap((refreshedAccessToken) => {
334
- if (!refreshedAccessToken) {
335
- clearStoredSession(documentRef);
336
- return throwError(() => error);
337
- }
338
- return next(applyBearerToken(request, refreshedAccessToken, true));
339
- }), catchError(() => {
340
- clearStoredSession(documentRef);
341
- return throwError(() => error);
342
- }));
343
- }
344
- const edsisAuthInterceptor = (request, next) => {
345
- const documentRef = inject(DOCUMENT);
346
- const apiConfiguration = inject(ApiConfiguration);
347
- const authService = inject(AuthService);
348
- if (request.context.get(EDSIS_SKIP_AUTH)) {
349
- return next(request);
350
- }
351
- const apiPath = resolveApiPath(request.url, apiConfiguration.rootUrl);
352
- if (!apiPath || !isHandledRequest(apiPath)) {
353
- return next(request);
354
- }
355
- const preparedRequest = applyCookieCredentials(request, apiPath);
356
- if (isAuthRequest(apiPath) || isHealthRequest(apiPath)) {
357
- return next(preparedRequest);
358
- }
359
- return from(resolveAccessToken(documentRef, authService)).pipe(switchMap((accessToken) => {
360
- const authorizedRequest = accessToken ? applyBearerToken(preparedRequest, accessToken) : preparedRequest;
361
- return next(authorizedRequest).pipe(catchError((error) => handleUnauthorizedError(error, preparedRequest, next, documentRef, authService)));
362
- }));
363
- };
364
-
365
- function provideEdsisAuth(config) {
366
- const resolvedConfig = resolveEdsisAuthConfig(config);
367
- return makeEnvironmentProviders([
368
- provideApiConfiguration(resolvedConfig.apiUrl),
369
- provideHttpClient(withFetch(), withInterceptors([edsisAuthInterceptor])),
370
- {
371
- provide: EDSIS_AUTH_CONFIG,
372
- useValue: resolvedConfig,
373
- },
374
- ]);
375
- }
376
-
377
- const authenticatedGuard = async () => {
378
- const router = inject(Router);
379
- const authConfig = inject(EDSIS_AUTH_CONFIG);
380
- if (await injectSessionState()) {
381
- return true;
382
- }
383
- return router.parseUrl(authConfig.guestHomePath);
384
- };
385
- const homeRedirectGuard = async () => {
386
- const router = inject(Router);
387
- const authConfig = inject(EDSIS_AUTH_CONFIG);
388
- return router.parseUrl((await injectSessionState()) ? authConfig.authenticatedHomePath : authConfig.guestHomePath);
389
- };
390
- const guestOnlyGuard = async () => {
391
- const router = inject(Router);
392
- const authConfig = inject(EDSIS_AUTH_CONFIG);
393
- if (!(await injectSessionState())) {
394
- return true;
395
- }
396
- return router.parseUrl(authConfig.authenticatedHomePath);
397
- };
398
-
399
- class AuthShellPage {
400
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthShellPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
401
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.15", type: AuthShellPage, isStandalone: true, selector: "edsis-auth-shell-page", host: { classAttribute: "contents" }, ngImport: i0, template: `
402
- <ui-layout surface="grid" appearance="border-rail" width="fluid">
403
- <ui-layout-fluid>
404
- <div class="w-full max-w-xl">
405
- <router-outlet />
406
- </div>
407
- </ui-layout-fluid>
408
- </ui-layout>
409
- `, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: UiLayoutComponent, selector: "ui-layout", inputs: ["surface", "appearance", "layout-style", "width", "class"] }, { kind: "component", type: UiLayoutFluidComponent, selector: "ui-layout-fluid", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
410
- }
411
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthShellPage, decorators: [{
412
- type: Component,
413
- args: [{
414
- selector: 'edsis-auth-shell-page',
415
- imports: [RouterOutlet, UiLayoutComponent, UiLayoutFluidComponent],
416
- host: {
417
- class: 'contents',
418
- },
419
- template: `
420
- <ui-layout surface="grid" appearance="border-rail" width="fluid">
421
- <ui-layout-fluid>
422
- <div class="w-full max-w-xl">
423
- <router-outlet />
424
- </div>
425
- </ui-layout-fluid>
426
- </ui-layout>
427
- `,
428
- changeDetection: ChangeDetectionStrategy.OnPush,
429
- }]
430
- }] });
431
-
432
- function buildVerifyUrl(config) {
433
- const baseUrl = typeof window !== 'undefined' && window.location.origin ? window.location.origin : config.appUrl;
434
- return new URL(config.verifyPath, `${baseUrl}/`).toString();
435
- }
436
- function extractMagicToken(queryToken, fragment) {
437
- const tokenFromQuery = normalizeText(queryToken);
438
- if (tokenFromQuery) {
439
- return tokenFromQuery;
440
- }
441
- const normalizedFragment = normalizeText(fragment?.startsWith('#') ? fragment.slice(1) : fragment);
442
- if (!normalizedFragment) {
443
- return null;
444
- }
445
- const fragmentParams = new URLSearchParams(normalizedFragment);
446
- const tokenFromFragment = normalizeText(fragmentParams.get('token')) ??
447
- normalizeText(fragmentParams.get('magic_token')) ??
448
- normalizeText(fragmentParams.get('value'));
449
- if (tokenFromFragment) {
450
- return tokenFromFragment;
451
- }
452
- return normalizedFragment.includes('=') ? null : normalizedFragment;
453
- }
454
- function getResponseMessage(response, fallback) {
455
- if (!hasMessage(response)) {
456
- return fallback;
457
- }
458
- return normalizeText(response.message) ?? fallback;
459
- }
460
- function getErrorMessage(error, fallback) {
461
- if (error instanceof HttpErrorResponse) {
462
- const errorBody = error.error;
463
- if (typeof errorBody === 'string') {
464
- return normalizeText(errorBody) ?? fallback;
465
- }
466
- if (hasMessage(errorBody)) {
467
- return normalizeText(errorBody.message) ?? fallback;
468
- }
469
- return normalizeText(error.message) ?? fallback;
470
- }
471
- if (error instanceof Error) {
472
- return normalizeText(error.message) ?? fallback;
473
- }
474
- return fallback;
475
- }
476
- function hasMessage(value) {
477
- return typeof value === 'object' && value !== null && 'message' in value;
478
- }
479
- function normalizeText(value) {
480
- if (typeof value !== 'string') {
481
- return null;
482
- }
483
- const normalizedValue = value.trim();
484
- return normalizedValue.length > 0 ? normalizedValue : null;
485
- }
486
-
487
- class AuthLoginPage {
488
- destroyRef = inject(DestroyRef);
489
- formBuilder = inject(FormBuilder);
490
- authService = inject(AuthService);
491
- form = this.formBuilder.nonNullable.group({
492
- email: ['', [Validators.required, Validators.email, Validators.maxLength(255)]],
493
- });
494
- isSubmitting = signal(false, ...(ngDevMode ? [{ debugName: "isSubmitting" }] : /* istanbul ignore next */ []));
495
- responseMessage = signal(null, ...(ngDevMode ? [{ debugName: "responseMessage" }] : /* istanbul ignore next */ []));
496
- errorMessage = signal(null, ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
497
- emailControl = this.form.controls.email;
498
- emailFeedbackId = 'email-feedback';
499
- emailControlState = toSignal(this.emailControl.events.pipe(startWith(null)), {
500
- initialValue: null,
501
- });
502
- hasInlineError = computed(() => {
503
- this.emailControlState();
504
- return this.emailControl.invalid && (this.emailControl.dirty || this.emailControl.touched);
505
- }, ...(ngDevMode ? [{ debugName: "hasInlineError" }] : /* istanbul ignore next */ []));
506
- inlineErrorMessage = computed(() => {
507
- if (!this.hasInlineError()) {
508
- return null;
509
- }
510
- return this.emailControl.hasError('required')
511
- ? 'Email wajib diisi.'
512
- : 'Gunakan format email yang valid dengan panjang maksimal 255 karakter.';
513
- }, ...(ngDevMode ? [{ debugName: "inlineErrorMessage" }] : /* istanbul ignore next */ []));
514
- feedbackMessage = computed(() => this.inlineErrorMessage() ?? this.responseMessage() ?? this.errorMessage(), ...(ngDevMode ? [{ debugName: "feedbackMessage" }] : /* istanbul ignore next */ []));
515
- feedbackTone = computed(() => {
516
- if (this.inlineErrorMessage() || this.errorMessage()) {
517
- return 'error';
518
- }
519
- if (this.responseMessage()) {
520
- return 'success';
521
- }
522
- return null;
523
- }, ...(ngDevMode ? [{ debugName: "feedbackTone" }] : /* istanbul ignore next */ []));
524
- fieldTone = computed(() => {
525
- if (this.hasInlineError() || this.errorMessage()) {
526
- return 'error';
527
- }
528
- if (this.responseMessage()) {
529
- return 'success';
530
- }
531
- return 'idle';
532
- }, ...(ngDevMode ? [{ debugName: "fieldTone" }] : /* istanbul ignore next */ []));
533
- emailFieldClasses = computed(() => {
534
- const baseClasses = 'flex-nowrap bg-background/70 shadow-sm [&>[data-slot=input-group-control]]:h-12! [&>[data-slot=input-group-control]]:px-4! [&>[data-slot=input-group-control]]:text-base!';
535
- switch (this.fieldTone()) {
536
- case 'error':
537
- return `${baseClasses} border-destructive focus-within:border-destructive focus-within:ring-destructive/20`;
538
- case 'success':
539
- return `${baseClasses} border-emerald-500 focus-within:border-emerald-500 focus-within:ring-emerald-500/20`;
540
- default:
541
- return baseClasses;
542
- }
543
- }, ...(ngDevMode ? [{ debugName: "emailFieldClasses" }] : /* istanbul ignore next */ []));
544
- submit() {
545
- if (this.form.invalid) {
546
- this.form.markAllAsTouched();
547
- return;
548
- }
549
- this.isSubmitting.set(true);
550
- this.responseMessage.set(null);
551
- this.errorMessage.set(null);
552
- const email = this.emailControl.getRawValue().trim().toLowerCase();
553
- this.emailControl.setValue(email);
554
- this.authService
555
- .requestMagicLoginLink({
556
- body: {
557
- email,
558
- },
559
- })
560
- .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.isSubmitting.set(false)))
561
- .subscribe({
562
- next: (response) => {
563
- this.responseMessage.set(getResponseMessage(response, 'Magic link berhasil dikirim.'));
564
- },
565
- error: (error) => {
566
- this.errorMessage.set(getErrorMessage(error, 'Gagal mengirim magic link.'));
567
- },
568
- });
569
- }
570
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthLoginPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
571
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: AuthLoginPage, isStandalone: true, selector: "edsis-auth-login-page", host: { classAttribute: "block" }, ngImport: i0, template: `
572
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
573
- <ui-card-header
574
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
575
- <div class="w-16 shrink-0 sm:w-20">
576
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
577
- <div
578
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
579
- style="font-family: 'Arial Black', Arial, sans-serif;">
580
- ETOS
581
- </div>
582
- </ui-aspect-ratio>
583
- </div>
584
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
585
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Etos Account Center</ui-card-title>
586
- <p ui-card-description class="max-w-xl leading-6">
587
- Masukkan email yang terdaftar. Kami akan mengirimkan tautan verifikasi untuk masuk ke aplikasi.
588
- </p>
589
- </div>
590
- <ui-card-action
591
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
592
- LOGIN
593
- </ui-card-action>
594
- </ui-card-header>
595
-
596
- <ui-card-content class="pt-4 sm:pt-5">
597
- <form class="space-y-6" [formGroup]="form" (ngSubmit)="submit()">
598
- <div class="space-y-3">
599
- <label ui-label for="email" class="sr-only">Alamat email</label>
600
- <ui-input-group [class]="emailFieldClasses()">
601
- <ui-input-group-addon
602
- aria-hidden="true"
603
- class="min-h-12 px-4 bg-transparent text-primary [&_svg]:size-6!">
604
- <svg
605
- viewBox="0 0 24 24"
606
- class="fill-none stroke-current"
607
- stroke-width="1.8"
608
- stroke-linecap="round"
609
- stroke-linejoin="round">
610
- <path d="M4 7.5h16" />
611
- <path d="M5 6h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Z" />
612
- <path d="m5 8 7 5 7-5" />
613
- </svg>
614
- </ui-input-group-addon>
615
-
616
- <input
617
- ui-input-group-input
618
- class="h-12! px-4! text-base!"
619
- id="email"
620
- type="email"
621
- inputmode="email"
622
- autocomplete="email"
623
- [attr.aria-describedby]="feedbackMessage() ? emailFeedbackId : null"
624
- [attr.aria-invalid]="fieldTone() === 'error' ? 'true' : null"
625
- formControlName="email"
626
- placeholder="your@email.com" />
627
-
628
- <button
629
- ui-input-group-button
630
- type="submit"
631
- variant="default"
632
- size="sm"
633
- [disabled]="form.invalid || isSubmitting()"
634
- class="order-30 h-12! min-w-24 rounded-none px-5 text-sm font-medium">
635
- {{ isSubmitting() ? 'Mengirim...' : 'Kirim' }}
636
- </button>
637
- </ui-input-group>
638
-
639
- @if (feedbackMessage(); as feedback) {
640
- <p
641
- [id]="emailFeedbackId"
642
- class="text-sm"
643
- [class.text-destructive]="feedbackTone() === 'error'"
644
- [class.text-emerald-700]="feedbackTone() === 'success'"
645
- [attr.role]="feedbackTone() === 'error' ? 'alert' : 'status'"
646
- [attr.aria-live]="feedbackTone() === 'error' ? 'assertive' : 'polite'">
647
- {{ feedback }}
648
- </p>
649
- }
650
- </div>
651
-
652
- <div class="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 pt-2">
653
- <ui-separator class="w-full" />
654
- <span class="min-w-14 text-center text-sm font-medium uppercase tracking-[0.18em] text-muted-foreground">
655
- Atau
656
- </span>
657
- <ui-separator class="w-full" />
658
- </div>
659
-
660
- <div class="grid gap-3 pt-2 sm:grid-cols-3">
661
- <button
662
- ui-button
663
- type="button"
664
- variant="outline"
665
- size="lg"
666
- disabled
667
- aria-label="Login dengan Google segera hadir"
668
- title="Segera hadir"
669
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
670
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
671
- <svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
672
- <path
673
- fill="#EA4335"
674
- d="M12.24 10.285v3.965h5.514c-.24 1.285-.96 2.374-2.045 3.105l3.305 2.565c1.925-1.775 3.03-4.39 3.03-7.49 0-.73-.065-1.43-.185-2.145z" />
675
- <path
676
- fill="#34A853"
677
- d="M12 22c2.7 0 4.965-.895 6.62-2.425l-3.305-2.565c-.915.615-2.085.985-3.315.985-2.545 0-4.7-1.72-5.47-4.03H3.115v2.53A9.996 9.996 0 0 0 12 22" />
678
- <path
679
- fill="#4A90E2"
680
- d="M6.53 13.965A5.996 5.996 0 0 1 6.24 12c0-.68.115-1.34.29-1.965v-2.53H3.115A9.996 9.996 0 0 0 2 12c0 1.61.385 3.135 1.115 4.495z" />
681
- <path
682
- fill="#FBBC05"
683
- d="M12 6.005c1.47 0 2.79.505 3.83 1.495l2.87-2.87C16.96 3.01 14.695 2 12 2a9.996 9.996 0 0 0-8.885 5.505l3.415 2.53c.77-2.31 2.925-4.03 5.47-4.03" />
684
- </svg>
685
- </span>
686
- Google
687
- </button>
688
- <button
689
- ui-button
690
- type="button"
691
- variant="outline"
692
- size="lg"
693
- disabled
694
- aria-label="Login dengan Microsoft segera hadir"
695
- title="Segera hadir"
696
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
697
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
698
- <svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
699
- <path fill="#F25022" d="M2 2h9.5v9.5H2z" />
700
- <path fill="#7FBA00" d="M12.5 2H22v9.5h-9.5z" />
701
- <path fill="#00A4EF" d="M2 12.5h9.5V22H2z" />
702
- <path fill="#FFB900" d="M12.5 12.5H22V22h-9.5z" />
703
- </svg>
704
- </span>
705
- Microsoft
706
- </button>
707
- <button
708
- ui-button
709
- type="button"
710
- variant="outline"
711
- size="lg"
712
- disabled
713
- aria-label="Login dengan Apple segera hadir"
714
- title="Segera hadir"
715
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
716
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
717
- <svg viewBox="0 0 24 24" class="size-5 fill-current" xmlns="http://www.w3.org/2000/svg">
718
- <path
719
- d="M15.482 2c.13 1.25-.31 2.19-.84 2.81-.55.65-1.47 1.15-2.39 1.08-.12-1.21.38-2.17.92-2.79.6-.68 1.61-1.17 2.31-1.1Zm3.94 16.85c-.41.94-.91 1.8-1.54 2.59-.86 1.07-1.57 1.8-2.39 1.8-.59 0-.99-.17-1.44-.36-.47-.2-.95-.4-1.63-.4-.71 0-1.22.2-1.7.4-.46.19-.85.35-1.38.37-.79.03-1.55-.8-2.42-1.87-1.86-2.28-3.3-6.43-1.38-9.77.96-1.66 2.68-2.72 4.55-2.75.71-.01 1.39.21 1.98.41.45.15.86.29 1.19.29.3 0 .73-.15 1.19-.31.68-.23 1.46-.49 2.28-.42 1.14.09 2.17.55 2.98 1.38-2.66 1.45-2.23 5.2.71 6.54Z" />
720
- </svg>
721
- </span>
722
- Apple
723
- </button>
724
- </div>
725
- </form>
726
- </ui-card-content>
727
- </ui-card>
728
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: AspectRatioComponent, selector: "ui-aspect-ratio", inputs: ["ratio", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: CardActionComponent, selector: "ui-card-action", inputs: ["class"] }, { kind: "component", type: CardComponent, selector: "ui-card", inputs: ["size", "class"] }, { kind: "component", type: CardContentComponent, selector: "ui-card-content", inputs: ["class"] }, { kind: "component", type: CardDescriptionComponent, selector: "ui-card-description, p[ui-card-description]", inputs: ["class"] }, { kind: "component", type: CardHeaderComponent, selector: "ui-card-header", inputs: ["class"] }, { kind: "component", type: CardTitleComponent, selector: "ui-card-title, h3[ui-card-title]", inputs: ["class"] }, { kind: "component", type: InputGroupAddonComponent, selector: "ui-input-group-addon", inputs: ["align", "class"] }, { kind: "component", type: InputGroupButtonComponent, selector: "button[ui-input-group-button], a[ui-input-group-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: InputGroupComponent, selector: "ui-input-group", inputs: ["class"] }, { kind: "component", type: InputGroupInputComponent, selector: "input[ui-input-group-input]", inputs: ["class"] }, { kind: "component", type: LabelComponent, selector: "ui-label, label[ui-label]", inputs: ["for", "class"] }, { kind: "component", type: SeparatorComponent, selector: "ui-separator", inputs: ["orientation", "decorative", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
729
- }
730
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthLoginPage, decorators: [{
731
- type: Component,
732
- args: [{
733
- selector: 'edsis-auth-login-page',
734
- imports: [
735
- ReactiveFormsModule,
736
- AspectRatioComponent,
737
- ButtonComponent,
738
- CardActionComponent,
739
- CardComponent,
740
- CardContentComponent,
741
- CardDescriptionComponent,
742
- CardHeaderComponent,
743
- CardTitleComponent,
744
- InputGroupAddonComponent,
745
- InputGroupButtonComponent,
746
- InputGroupComponent,
747
- InputGroupInputComponent,
748
- LabelComponent,
749
- SeparatorComponent,
750
- ],
751
- host: {
752
- class: 'block',
753
- },
754
- template: `
755
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
756
- <ui-card-header
757
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
758
- <div class="w-16 shrink-0 sm:w-20">
759
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
760
- <div
761
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
762
- style="font-family: 'Arial Black', Arial, sans-serif;">
763
- ETOS
764
- </div>
765
- </ui-aspect-ratio>
766
- </div>
767
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
768
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Etos Account Center</ui-card-title>
769
- <p ui-card-description class="max-w-xl leading-6">
770
- Masukkan email yang terdaftar. Kami akan mengirimkan tautan verifikasi untuk masuk ke aplikasi.
771
- </p>
772
- </div>
773
- <ui-card-action
774
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
775
- LOGIN
776
- </ui-card-action>
777
- </ui-card-header>
778
-
779
- <ui-card-content class="pt-4 sm:pt-5">
780
- <form class="space-y-6" [formGroup]="form" (ngSubmit)="submit()">
781
- <div class="space-y-3">
782
- <label ui-label for="email" class="sr-only">Alamat email</label>
783
- <ui-input-group [class]="emailFieldClasses()">
784
- <ui-input-group-addon
785
- aria-hidden="true"
786
- class="min-h-12 px-4 bg-transparent text-primary [&_svg]:size-6!">
787
- <svg
788
- viewBox="0 0 24 24"
789
- class="fill-none stroke-current"
790
- stroke-width="1.8"
791
- stroke-linecap="round"
792
- stroke-linejoin="round">
793
- <path d="M4 7.5h16" />
794
- <path d="M5 6h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Z" />
795
- <path d="m5 8 7 5 7-5" />
796
- </svg>
797
- </ui-input-group-addon>
798
-
799
- <input
800
- ui-input-group-input
801
- class="h-12! px-4! text-base!"
802
- id="email"
803
- type="email"
804
- inputmode="email"
805
- autocomplete="email"
806
- [attr.aria-describedby]="feedbackMessage() ? emailFeedbackId : null"
807
- [attr.aria-invalid]="fieldTone() === 'error' ? 'true' : null"
808
- formControlName="email"
809
- placeholder="your@email.com" />
810
-
811
- <button
812
- ui-input-group-button
813
- type="submit"
814
- variant="default"
815
- size="sm"
816
- [disabled]="form.invalid || isSubmitting()"
817
- class="order-30 h-12! min-w-24 rounded-none px-5 text-sm font-medium">
818
- {{ isSubmitting() ? 'Mengirim...' : 'Kirim' }}
819
- </button>
820
- </ui-input-group>
821
-
822
- @if (feedbackMessage(); as feedback) {
823
- <p
824
- [id]="emailFeedbackId"
825
- class="text-sm"
826
- [class.text-destructive]="feedbackTone() === 'error'"
827
- [class.text-emerald-700]="feedbackTone() === 'success'"
828
- [attr.role]="feedbackTone() === 'error' ? 'alert' : 'status'"
829
- [attr.aria-live]="feedbackTone() === 'error' ? 'assertive' : 'polite'">
830
- {{ feedback }}
831
- </p>
832
- }
833
- </div>
834
-
835
- <div class="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 pt-2">
836
- <ui-separator class="w-full" />
837
- <span class="min-w-14 text-center text-sm font-medium uppercase tracking-[0.18em] text-muted-foreground">
838
- Atau
839
- </span>
840
- <ui-separator class="w-full" />
841
- </div>
842
-
843
- <div class="grid gap-3 pt-2 sm:grid-cols-3">
844
- <button
845
- ui-button
846
- type="button"
847
- variant="outline"
848
- size="lg"
849
- disabled
850
- aria-label="Login dengan Google segera hadir"
851
- title="Segera hadir"
852
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
853
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
854
- <svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
855
- <path
856
- fill="#EA4335"
857
- d="M12.24 10.285v3.965h5.514c-.24 1.285-.96 2.374-2.045 3.105l3.305 2.565c1.925-1.775 3.03-4.39 3.03-7.49 0-.73-.065-1.43-.185-2.145z" />
858
- <path
859
- fill="#34A853"
860
- d="M12 22c2.7 0 4.965-.895 6.62-2.425l-3.305-2.565c-.915.615-2.085.985-3.315.985-2.545 0-4.7-1.72-5.47-4.03H3.115v2.53A9.996 9.996 0 0 0 12 22" />
861
- <path
862
- fill="#4A90E2"
863
- d="M6.53 13.965A5.996 5.996 0 0 1 6.24 12c0-.68.115-1.34.29-1.965v-2.53H3.115A9.996 9.996 0 0 0 2 12c0 1.61.385 3.135 1.115 4.495z" />
864
- <path
865
- fill="#FBBC05"
866
- d="M12 6.005c1.47 0 2.79.505 3.83 1.495l2.87-2.87C16.96 3.01 14.695 2 12 2a9.996 9.996 0 0 0-8.885 5.505l3.415 2.53c.77-2.31 2.925-4.03 5.47-4.03" />
867
- </svg>
868
- </span>
869
- Google
870
- </button>
871
- <button
872
- ui-button
873
- type="button"
874
- variant="outline"
875
- size="lg"
876
- disabled
877
- aria-label="Login dengan Microsoft segera hadir"
878
- title="Segera hadir"
879
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
880
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
881
- <svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
882
- <path fill="#F25022" d="M2 2h9.5v9.5H2z" />
883
- <path fill="#7FBA00" d="M12.5 2H22v9.5h-9.5z" />
884
- <path fill="#00A4EF" d="M2 12.5h9.5V22H2z" />
885
- <path fill="#FFB900" d="M12.5 12.5H22V22h-9.5z" />
886
- </svg>
887
- </span>
888
- Microsoft
889
- </button>
890
- <button
891
- ui-button
892
- type="button"
893
- variant="outline"
894
- size="lg"
895
- disabled
896
- aria-label="Login dengan Apple segera hadir"
897
- title="Segera hadir"
898
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
899
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
900
- <svg viewBox="0 0 24 24" class="size-5 fill-current" xmlns="http://www.w3.org/2000/svg">
901
- <path
902
- d="M15.482 2c.13 1.25-.31 2.19-.84 2.81-.55.65-1.47 1.15-2.39 1.08-.12-1.21.38-2.17.92-2.79.6-.68 1.61-1.17 2.31-1.1Zm3.94 16.85c-.41.94-.91 1.8-1.54 2.59-.86 1.07-1.57 1.8-2.39 1.8-.59 0-.99-.17-1.44-.36-.47-.2-.95-.4-1.63-.4-.71 0-1.22.2-1.7.4-.46.19-.85.35-1.38.37-.79.03-1.55-.8-2.42-1.87-1.86-2.28-3.3-6.43-1.38-9.77.96-1.66 2.68-2.72 4.55-2.75.71-.01 1.39.21 1.98.41.45.15.86.29 1.19.29.3 0 .73-.15 1.19-.31.68-.23 1.46-.49 2.28-.42 1.14.09 2.17.55 2.98 1.38-2.66 1.45-2.23 5.2.71 6.54Z" />
903
- </svg>
904
- </span>
905
- Apple
906
- </button>
907
- </div>
908
- </form>
909
- </ui-card-content>
910
- </ui-card>
911
- `,
912
- changeDetection: ChangeDetectionStrategy.OnPush,
913
- }]
914
- }] });
915
-
916
- class AuthLogoutPage {
917
- destroyRef = inject(DestroyRef);
918
- documentRef = inject(DOCUMENT);
919
- router = inject(Router);
920
- authService = inject(AuthService);
921
- authConfig = inject(EDSIS_AUTH_CONFIG);
922
- guestHomePath = this.authConfig.guestHomePath;
923
- authenticatedHomePath = this.authConfig.authenticatedHomePath;
924
- state = signal('pending', ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
925
- message = signal('Mengakhiri sesi...', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
926
- ngOnInit() {
927
- clearStoredSession(this.documentRef);
928
- this.authService
929
- .logoutAuthSession()
930
- .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => {
931
- if (this.state() === 'pending') {
932
- this.state.set('success');
933
- }
934
- }))
935
- .subscribe({
936
- next: (response) => {
937
- this.state.set('success');
938
- this.message.set(getResponseMessage(response, 'Sesi berhasil diakhiri.'));
939
- void this.router.navigateByUrl(this.guestHomePath, { replaceUrl: true });
940
- },
941
- error: (error) => {
942
- this.state.set('error');
943
- this.message.set(getErrorMessage(error, 'Sesi lokal sudah dihapus, tetapi request logout gagal.'));
944
- },
945
- });
946
- }
947
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthLogoutPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
948
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: AuthLogoutPage, isStandalone: true, selector: "edsis-auth-logout-page", host: { classAttribute: "block" }, ngImport: i0, template: `
949
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
950
- <ui-card-header
951
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
952
- <div class="w-16 shrink-0 sm:w-20">
953
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
954
- <div
955
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
956
- style="font-family: 'Arial Black', Arial, sans-serif;">
957
- ETOS
958
- </div>
959
- </ui-aspect-ratio>
960
- </div>
961
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
962
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Mengakhiri sesi Edsis.</ui-card-title>
963
- <p ui-card-description class="max-w-xl leading-6">
964
- Halaman ini membersihkan sesi lokal lalu memanggil endpoint logout untuk merevoke refresh-token cookie pada
965
- backend.
966
- </p>
967
- </div>
968
- <ui-card-action
969
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
970
- LOGOUT
971
- </ui-card-action>
972
- </ui-card-header>
973
-
974
- <ui-card-content class="space-y-4 pt-6 sm:pt-7">
975
- <ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
976
- @if (state() === 'pending') {
977
- <ui-spinner class="mt-0.5 size-4" aria-label="Mengakhiri sesi" />
978
- }
979
-
980
- <ui-alert-description>
981
- {{ message() }}
982
- </ui-alert-description>
983
- </ui-alert>
984
-
985
- @if (state() === 'error') {
986
- <ui-alert variant="destructive" class="shadow-sm">
987
- <ui-alert-description>
988
- Backend tidak mengonfirmasi logout, tetapi sesi lokal sudah dihapus.
989
- </ui-alert-description>
990
- </ui-alert>
991
- }
992
- </ui-card-content>
993
-
994
- <ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
995
- <a ui-button [routerLink]="guestHomePath" variant="default"> Kembali ke login </a>
996
- <a ui-button [routerLink]="authenticatedHomePath" variant="outline"> Buka dashboard </a>
997
- </ui-card-footer>
998
- </ui-card>
999
- `, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: AlertComponent, selector: "ui-alert", inputs: ["variant", "class"] }, { kind: "component", type: AlertDescriptionComponent, selector: "ui-alert-description", inputs: ["class"] }, { kind: "component", type: AspectRatioComponent, selector: "ui-aspect-ratio", inputs: ["ratio", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: CardActionComponent, selector: "ui-card-action", inputs: ["class"] }, { kind: "component", type: CardComponent, selector: "ui-card", inputs: ["size", "class"] }, { kind: "component", type: CardContentComponent, selector: "ui-card-content", inputs: ["class"] }, { kind: "component", type: CardDescriptionComponent, selector: "ui-card-description, p[ui-card-description]", inputs: ["class"] }, { kind: "component", type: CardFooterComponent, selector: "ui-card-footer", inputs: ["class"] }, { kind: "component", type: CardHeaderComponent, selector: "ui-card-header", inputs: ["class"] }, { kind: "component", type: CardTitleComponent, selector: "ui-card-title, h3[ui-card-title]", inputs: ["class"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "decorative", "aria-label", "aria-labelledby"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1000
- }
1001
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthLogoutPage, decorators: [{
1002
- type: Component,
1003
- args: [{
1004
- selector: 'edsis-auth-logout-page',
1005
- imports: [
1006
- RouterLink,
1007
- AlertComponent,
1008
- AlertDescriptionComponent,
1009
- AspectRatioComponent,
1010
- ButtonComponent,
1011
- CardActionComponent,
1012
- CardComponent,
1013
- CardContentComponent,
1014
- CardDescriptionComponent,
1015
- CardFooterComponent,
1016
- CardHeaderComponent,
1017
- CardTitleComponent,
1018
- SpinnerComponent,
1019
- ],
1020
- host: {
1021
- class: 'block',
1022
- },
1023
- template: `
1024
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
1025
- <ui-card-header
1026
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
1027
- <div class="w-16 shrink-0 sm:w-20">
1028
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
1029
- <div
1030
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
1031
- style="font-family: 'Arial Black', Arial, sans-serif;">
1032
- ETOS
1033
- </div>
1034
- </ui-aspect-ratio>
1035
- </div>
1036
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
1037
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Mengakhiri sesi Edsis.</ui-card-title>
1038
- <p ui-card-description class="max-w-xl leading-6">
1039
- Halaman ini membersihkan sesi lokal lalu memanggil endpoint logout untuk merevoke refresh-token cookie pada
1040
- backend.
1041
- </p>
1042
- </div>
1043
- <ui-card-action
1044
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
1045
- LOGOUT
1046
- </ui-card-action>
1047
- </ui-card-header>
1048
-
1049
- <ui-card-content class="space-y-4 pt-6 sm:pt-7">
1050
- <ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
1051
- @if (state() === 'pending') {
1052
- <ui-spinner class="mt-0.5 size-4" aria-label="Mengakhiri sesi" />
1053
- }
1054
-
1055
- <ui-alert-description>
1056
- {{ message() }}
1057
- </ui-alert-description>
1058
- </ui-alert>
1059
-
1060
- @if (state() === 'error') {
1061
- <ui-alert variant="destructive" class="shadow-sm">
1062
- <ui-alert-description>
1063
- Backend tidak mengonfirmasi logout, tetapi sesi lokal sudah dihapus.
1064
- </ui-alert-description>
1065
- </ui-alert>
1066
- }
1067
- </ui-card-content>
1068
-
1069
- <ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
1070
- <a ui-button [routerLink]="guestHomePath" variant="default"> Kembali ke login </a>
1071
- <a ui-button [routerLink]="authenticatedHomePath" variant="outline"> Buka dashboard </a>
1072
- </ui-card-footer>
1073
- </ui-card>
1074
- `,
1075
- changeDetection: ChangeDetectionStrategy.OnPush,
1076
- }]
1077
- }] });
1078
-
1079
- class AuthVerifyPage {
1080
- documentRef = inject(DOCUMENT);
1081
- destroyRef = inject(DestroyRef);
1082
- route = inject(ActivatedRoute);
1083
- router = inject(Router);
1084
- location = inject(Location);
1085
- authService = inject(AuthService);
1086
- authConfig = inject(EDSIS_AUTH_CONFIG);
1087
- queryParamMap = toSignal(this.route.queryParamMap, {
1088
- initialValue: this.route.snapshot.queryParamMap,
1089
- });
1090
- fragment = toSignal(this.route.fragment, {
1091
- initialValue: this.route.snapshot.fragment,
1092
- });
1093
- handledToken = undefined;
1094
- verifySubscription = null;
1095
- guestHomePath = this.authConfig.guestHomePath;
1096
- authenticatedHomePath = this.authConfig.authenticatedHomePath;
1097
- state = signal('pending', ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
1098
- message = signal('Memverifikasi magic link...', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
1099
- token = input(undefined, ...(ngDevMode ? [{ debugName: "token" }] : /* istanbul ignore next */ []));
1100
- constructor() {
1101
- this.destroyRef.onDestroy(() => this.verifySubscription?.unsubscribe());
1102
- effect(() => {
1103
- const token = extractMagicToken(this.token() ?? this.queryParamMap().get('token'), this.fragment());
1104
- if (!token) {
1105
- if (this.handledToken === null) {
1106
- return;
1107
- }
1108
- this.handledToken = null;
1109
- this.clearTokenFromAddressBar();
1110
- this.state.set('error');
1111
- this.message.set('Token magic link tidak ditemukan pada URL yang dibuka.');
1112
- return;
1113
- }
1114
- if (token === this.handledToken) {
1115
- return;
1116
- }
1117
- this.handledToken = token;
1118
- this.clearTokenFromAddressBar();
1119
- this.state.set('pending');
1120
- this.message.set('Memverifikasi magic link...');
1121
- this.verify(token);
1122
- });
1123
- }
1124
- clearTokenFromAddressBar() {
1125
- this.location.replaceState(this.authConfig.verifyPath);
1126
- }
1127
- verify(token) {
1128
- this.verifySubscription?.unsubscribe();
1129
- this.verifySubscription = this.authService
1130
- .verifyMagicLink({
1131
- body: {
1132
- token,
1133
- device_type: 'web',
1134
- },
1135
- })
1136
- .subscribe({
1137
- next: (response) => {
1138
- const session = persistSession(this.documentRef, response.data);
1139
- if (!session) {
1140
- this.state.set('error');
1141
- this.message.set('Verifikasi berhasil, tetapi access token tidak ditemukan di respons backend.');
1142
- return;
1143
- }
1144
- this.state.set('success');
1145
- this.message.set(getResponseMessage(response, 'Verifikasi berhasil. Mengarahkan ke dashboard...'));
1146
- void this.router.navigateByUrl(this.authenticatedHomePath, { replaceUrl: true });
1147
- },
1148
- error: (error) => {
1149
- this.state.set('error');
1150
- this.message.set(getErrorMessage(error, 'Magic link tidak valid atau sudah kedaluwarsa.'));
1151
- },
1152
- });
1153
- }
1154
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthVerifyPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
1155
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: AuthVerifyPage, isStandalone: true, selector: "edsis-auth-verify-page", inputs: { token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, ngImport: i0, template: `
1156
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
1157
- <ui-card-header
1158
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
1159
- <div class="w-16 shrink-0 sm:w-20">
1160
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
1161
- <div
1162
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
1163
- style="font-family: 'Arial Black', Arial, sans-serif;">
1164
- ETOS
1165
- </div>
1166
- </ui-aspect-ratio>
1167
- </div>
1168
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
1169
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Memverifikasi magic link.</ui-card-title>
1170
- <p ui-card-description class="max-w-xl leading-6">
1171
- Token akan dikonsumsi satu kali, sesi refresh cookie dibentuk di backend, lalu access token disimpan secara
1172
- lokal untuk aplikasi.
1173
- </p>
1174
- </div>
1175
- <ui-card-action
1176
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
1177
- VERIFY
1178
- </ui-card-action>
1179
- </ui-card-header>
1180
-
1181
- <ui-card-content class="space-y-4 pt-6 sm:pt-7">
1182
- <ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
1183
- @if (state() === 'pending') {
1184
- <ui-spinner class="mt-0.5 size-4" aria-label="Memverifikasi magic link" />
1185
- }
1186
-
1187
- <ui-alert-description>
1188
- {{ message() }}
1189
- </ui-alert-description>
1190
- </ui-alert>
1191
-
1192
- @if (state() === 'error') {
1193
- <ui-alert variant="destructive" class="shadow-sm">
1194
- <ui-alert-description>
1195
- Pastikan Anda membuka link terbaru dari email dan token belum pernah dipakai sebelumnya.
1196
- </ui-alert-description>
1197
- </ui-alert>
1198
- }
1199
- </ui-card-content>
1200
-
1201
- <ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
1202
- <a ui-button [routerLink]="guestHomePath" variant="outline"> Minta link baru </a>
1203
- <a ui-button [routerLink]="authenticatedHomePath" variant="default"> Buka dashboard </a>
1204
- </ui-card-footer>
1205
- </ui-card>
1206
- `, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: AlertComponent, selector: "ui-alert", inputs: ["variant", "class"] }, { kind: "component", type: AlertDescriptionComponent, selector: "ui-alert-description", inputs: ["class"] }, { kind: "component", type: AspectRatioComponent, selector: "ui-aspect-ratio", inputs: ["ratio", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: CardActionComponent, selector: "ui-card-action", inputs: ["class"] }, { kind: "component", type: CardComponent, selector: "ui-card", inputs: ["size", "class"] }, { kind: "component", type: CardContentComponent, selector: "ui-card-content", inputs: ["class"] }, { kind: "component", type: CardDescriptionComponent, selector: "ui-card-description, p[ui-card-description]", inputs: ["class"] }, { kind: "component", type: CardFooterComponent, selector: "ui-card-footer", inputs: ["class"] }, { kind: "component", type: CardHeaderComponent, selector: "ui-card-header", inputs: ["class"] }, { kind: "component", type: CardTitleComponent, selector: "ui-card-title, h3[ui-card-title]", inputs: ["class"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "decorative", "aria-label", "aria-labelledby"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1207
- }
1208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthVerifyPage, decorators: [{
1209
- type: Component,
1210
- args: [{
1211
- selector: 'edsis-auth-verify-page',
1212
- imports: [
1213
- RouterLink,
1214
- AlertComponent,
1215
- AlertDescriptionComponent,
1216
- AspectRatioComponent,
1217
- ButtonComponent,
1218
- CardActionComponent,
1219
- CardComponent,
1220
- CardContentComponent,
1221
- CardDescriptionComponent,
1222
- CardFooterComponent,
1223
- CardHeaderComponent,
1224
- CardTitleComponent,
1225
- SpinnerComponent,
1226
- ],
1227
- host: {
1228
- class: 'block',
1229
- },
1230
- template: `
1231
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
1232
- <ui-card-header
1233
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
1234
- <div class="w-16 shrink-0 sm:w-20">
1235
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
1236
- <div
1237
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
1238
- style="font-family: 'Arial Black', Arial, sans-serif;">
1239
- ETOS
1240
- </div>
1241
- </ui-aspect-ratio>
1242
- </div>
1243
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
1244
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Memverifikasi magic link.</ui-card-title>
1245
- <p ui-card-description class="max-w-xl leading-6">
1246
- Token akan dikonsumsi satu kali, sesi refresh cookie dibentuk di backend, lalu access token disimpan secara
1247
- lokal untuk aplikasi.
1248
- </p>
1249
- </div>
1250
- <ui-card-action
1251
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
1252
- VERIFY
1253
- </ui-card-action>
1254
- </ui-card-header>
1255
-
1256
- <ui-card-content class="space-y-4 pt-6 sm:pt-7">
1257
- <ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
1258
- @if (state() === 'pending') {
1259
- <ui-spinner class="mt-0.5 size-4" aria-label="Memverifikasi magic link" />
1260
- }
1261
-
1262
- <ui-alert-description>
1263
- {{ message() }}
1264
- </ui-alert-description>
1265
- </ui-alert>
1266
-
1267
- @if (state() === 'error') {
1268
- <ui-alert variant="destructive" class="shadow-sm">
1269
- <ui-alert-description>
1270
- Pastikan Anda membuka link terbaru dari email dan token belum pernah dipakai sebelumnya.
1271
- </ui-alert-description>
1272
- </ui-alert>
1273
- }
1274
- </ui-card-content>
1275
-
1276
- <ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
1277
- <a ui-button [routerLink]="guestHomePath" variant="outline"> Minta link baru </a>
1278
- <a ui-button [routerLink]="authenticatedHomePath" variant="default"> Buka dashboard </a>
1279
- </ui-card-footer>
1280
- </ui-card>
1281
- `,
1282
- changeDetection: ChangeDetectionStrategy.OnPush,
1283
- }]
1284
- }], ctorParameters: () => [], propDecorators: { token: [{ type: i0.Input, args: [{ isSignal: true, alias: "token", required: false }] }] } });
1285
-
1286
- const authRoutes = [
1287
- {
1288
- path: '',
1289
- component: AuthShellPage,
1290
- children: [
1291
- {
1292
- path: 'login',
1293
- title: 'Login',
1294
- canActivate: [guestOnlyGuard],
1295
- component: AuthLoginPage,
1296
- },
1297
- {
1298
- path: 'logout',
1299
- title: 'Logout',
1300
- component: AuthLogoutPage,
1301
- },
1302
- {
1303
- path: 'verify',
1304
- title: 'Verify',
1305
- canActivate: [guestOnlyGuard],
1306
- component: AuthVerifyPage,
1307
- },
1308
- ],
1309
- },
1310
- ];
1311
-
1312
- /**
1313
- * Generated bundle index. Do not edit.
1314
- */
1315
-
1316
- export { AUTH_SESSION_CHANGE_EVENT, AuthLoginPage, AuthLogoutPage, AuthShellPage, AuthVerifyPage, EDSIS_AUTH_CONFIG, EDSIS_SKIP_AUTH, authRoutes, authenticatedGuard, clearStoredSession, edsisAuthInterceptor, guestOnlyGuard, hasStoredSession, homeRedirectGuard, injectSessionClear, injectSessionRefresh, injectSessionState, persistSession, provideEdsisAuth, readStoredAccessToken, readStoredSession, resolveEdsisAuthConfig, validateStoredSession, ɵresetAuthSessionModuleState };
1317
- //# sourceMappingURL=edsis-angular-module-auth.mjs.map