@acorex/modules 19.2.20 → 19.3.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/application-management/lib/layouts/module-entity-detail-view/module-entity-detail-view.component.d.ts +2 -2
  2. package/auth/lib/setting.provider.d.ts +4 -0
  3. package/common/index.d.ts +1 -0
  4. package/common/lib/entities/dashboard/dashboard.types.d.ts +1 -1
  5. package/common/lib/features/{dashboard-home/dashboard-home.d.ts → home-dashboard/dashboard-home/home-dashboard.d.ts} +72 -52
  6. package/common/lib/features/{dashboard-home/dashboard-home.store.d.ts → home-dashboard/dashboard-home/home-dashboard.store.d.ts} +9 -4
  7. package/common/lib/features/home-dashboard/dashboard-home/index.d.ts +3 -0
  8. package/common/lib/features/{dashboard-popups → home-dashboard/dashboard-popups}/add-dashboard-popup.d.ts +7 -5
  9. package/common/lib/features/home-dashboard/dashboard-popups/configuration-popup.d.ts +14 -0
  10. package/common/lib/features/{dashboard-popups → home-dashboard/dashboard-popups}/dashboard-popup.service.d.ts +5 -4
  11. package/common/lib/features/home-dashboard/setrting.keys.d.ts +3 -0
  12. package/common/lib/features/{widget-wrapper → home-dashboard/widget-wrapper}/dashboard-widget-wrapper.d.ts +2 -1
  13. package/common/lib/menu.provider.d.ts +1 -1
  14. package/conversation/lib/entities/chat/pages/chat/chat.component.d.ts +1 -1
  15. package/conversation/lib/entities/comments/comments.service.d.ts +4 -4
  16. package/conversation/lib/entities/comments/comments.type.d.ts +1 -1
  17. package/document-management/lib/badge.provider.d.ts +11 -0
  18. package/document-management/lib/entities/document/document.service.d.ts +1 -1
  19. package/document-management/lib/entities/document/document.types.d.ts +2 -0
  20. package/document-management/lib/entities/document-type/document-type.service.d.ts +3 -3
  21. package/document-management/lib/entities/folder/folder.service.d.ts +2 -7
  22. package/document-management/lib/entities/folder/folder.types.d.ts +2 -1
  23. package/document-management/lib/features/document-explorer/components/create-folder-dialog/create-folder-dialog.component.d.ts +6 -0
  24. package/document-management/lib/features/document-explorer/document-explorer.component.d.ts +18 -8
  25. package/document-management/lib/features/document-explorer/document-explorer.viewmodel.d.ts +10 -6
  26. package/document-management/lib/features/document-explorer/views/detail-panel/detail-panel.component.d.ts +40 -36
  27. package/document-management/lib/features/document-explorer/views/details/details-view.component.d.ts +40 -36
  28. package/document-management/lib/features/document-explorer/views/large-icons/large-icons-view.component.d.ts +40 -36
  29. package/document-management/lib/features/document-explorer/views/large-tiles/large-tiles-view.component.d.ts +40 -36
  30. package/document-management/lib/features/document-explorer/views/list/list-view.component.d.ts +40 -36
  31. package/document-management/lib/features/document-explorer/views/small-icons/small-icons-view.component.d.ts +40 -36
  32. package/document-management/lib/features/document-explorer/views/small-tiles/small-tiles-view.component.d.ts +40 -36
  33. package/document-management/lib/features/drive/drive.component.d.ts +15 -9
  34. package/document-management/lib/features/drive/index.d.ts +3 -0
  35. package/document-management/lib/features/drive-choose/drive-choose.component.d.ts +16 -8
  36. package/document-management/lib/features/shared/components/document-type-choose-file/document-type-choose-file.component.d.ts +16 -0
  37. package/document-management/lib/features/shared/components/file-viewer-popup/file-viewer-popup.component.d.ts +5 -1
  38. package/document-management/lib/features/shared/components/folder-path-breadcrumbs/folder-path-breadcrumbs.component.d.ts +10 -6
  39. package/document-management/lib/features/shared/components/index.d.ts +1 -0
  40. package/document-management/lib/features/shared/components/link-dialog/link-dialog.component.d.ts +24 -0
  41. package/document-management/lib/features/shared/components/lock-dialog/lock-dialog.component.d.ts +16 -0
  42. package/document-management/lib/features/shared/components/share-dialog/share-dialog.component.d.ts +22 -0
  43. package/document-management/lib/features/shared/components/share-email-dialog/share-email-dialog.component.d.ts +17 -0
  44. package/document-management/lib/features/shared/components/unlock-dialog/unlock-dialog.component.d.ts +10 -0
  45. package/document-management/lib/features/shared/document-manager.service.d.ts +43 -22
  46. package/document-management/lib/features/shared/document-manager.types.d.ts +5 -7
  47. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-column.component.d.ts +1 -1
  48. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-edit.component.d.ts +66 -44
  49. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-print.component.d.ts +1 -1
  50. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-view.component.d.ts +1 -1
  51. package/document-management/lib/features/widgets/document-attachment/index.d.ts +0 -1
  52. package/fesm2022/acorex-modules-application-management.mjs +0 -1
  53. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  54. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-DrcL7GCj.mjs → acorex-modules-auth-acorex-modules-auth-5o4GqqVA.mjs} +15 -19
  55. package/fesm2022/acorex-modules-auth-acorex-modules-auth-5o4GqqVA.mjs.map +1 -0
  56. package/fesm2022/{acorex-modules-auth-app-chooser.component-CbJb1P_k.mjs → acorex-modules-auth-app-chooser.component-NuQzP5DC.mjs} +2 -2
  57. package/fesm2022/{acorex-modules-auth-app-chooser.component-CbJb1P_k.mjs.map → acorex-modules-auth-app-chooser.component-NuQzP5DC.mjs.map} +1 -1
  58. package/fesm2022/{acorex-modules-auth-login.module-DFCB1l7W.mjs → acorex-modules-auth-login.module-B_WrZQJx.mjs} +4 -4
  59. package/fesm2022/{acorex-modules-auth-login.module-DFCB1l7W.mjs.map → acorex-modules-auth-login.module-B_WrZQJx.mjs.map} +1 -1
  60. package/fesm2022/{acorex-modules-auth-master.layout-CuKXvY0o.mjs → acorex-modules-auth-master.layout-hDbrFbwO.mjs} +2 -2
  61. package/fesm2022/{acorex-modules-auth-master.layout-CuKXvY0o.mjs.map → acorex-modules-auth-master.layout-hDbrFbwO.mjs.map} +1 -1
  62. package/fesm2022/{acorex-modules-auth-password.component-DacOjakT.mjs → acorex-modules-auth-password.component-BnT_IaqN.mjs} +2 -2
  63. package/fesm2022/{acorex-modules-auth-password.component-DacOjakT.mjs.map → acorex-modules-auth-password.component-BnT_IaqN.mjs.map} +1 -1
  64. package/fesm2022/{acorex-modules-auth-password.component-5gwz30CZ.mjs → acorex-modules-auth-password.component-DDE0M5GE.mjs} +2 -2
  65. package/fesm2022/{acorex-modules-auth-password.component-5gwz30CZ.mjs.map → acorex-modules-auth-password.component-DDE0M5GE.mjs.map} +1 -1
  66. package/fesm2022/{acorex-modules-auth-routes-D018Lg-b.mjs → acorex-modules-auth-routes-Da02kID6.mjs} +2 -2
  67. package/fesm2022/{acorex-modules-auth-routes-D018Lg-b.mjs.map → acorex-modules-auth-routes-Da02kID6.mjs.map} +1 -1
  68. package/fesm2022/acorex-modules-auth-setting.provider-D3A0WUgJ.mjs +271 -0
  69. package/fesm2022/acorex-modules-auth-setting.provider-D3A0WUgJ.mjs.map +1 -0
  70. package/fesm2022/{acorex-modules-auth-two-factor.module-DiEB7VWl.mjs → acorex-modules-auth-two-factor.module-BrDpX4X1.mjs} +2 -2
  71. package/fesm2022/{acorex-modules-auth-two-factor.module-DiEB7VWl.mjs.map → acorex-modules-auth-two-factor.module-BrDpX4X1.mjs.map} +1 -1
  72. package/fesm2022/acorex-modules-auth.mjs +1 -1
  73. package/fesm2022/acorex-modules-common-index-rvP9ISgL.mjs +717 -0
  74. package/fesm2022/acorex-modules-common-index-rvP9ISgL.mjs.map +1 -0
  75. package/fesm2022/acorex-modules-common.mjs +34 -24
  76. package/fesm2022/acorex-modules-common.mjs.map +1 -1
  77. package/fesm2022/acorex-modules-conversation.mjs +4 -2
  78. package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
  79. package/fesm2022/{acorex-modules-document-management-acorex-modules-document-management-_BOVaDOq.mjs → acorex-modules-document-management-acorex-modules-document-management-CI0m4lpX.mjs} +1015 -260
  80. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-CI0m4lpX.mjs.map +1 -0
  81. package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-D8anTs3Q.mjs +117 -0
  82. package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-D8anTs3Q.mjs.map +1 -0
  83. package/fesm2022/{acorex-modules-document-management-details-view.component-BHcu_gYH.mjs → acorex-modules-document-management-details-view.component-z05RykKt.mjs} +2 -2
  84. package/fesm2022/{acorex-modules-document-management-details-view.component-BHcu_gYH.mjs.map → acorex-modules-document-management-details-view.component-z05RykKt.mjs.map} +1 -1
  85. package/fesm2022/{acorex-modules-document-management-drive-choose.component-WoZfDyLK.mjs → acorex-modules-document-management-drive-choose.component-BeiXQNAw.mjs} +22 -16
  86. package/fesm2022/acorex-modules-document-management-drive-choose.component-BeiXQNAw.mjs.map +1 -0
  87. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-DvriE0YR.mjs → acorex-modules-document-management-large-icons-view.component-DctO0SZ7.mjs} +2 -2
  88. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-DvriE0YR.mjs.map → acorex-modules-document-management-large-icons-view.component-DctO0SZ7.mjs.map} +1 -1
  89. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-ByWrKvZe.mjs → acorex-modules-document-management-large-tiles-view.component-CtCdVI_p.mjs} +2 -2
  90. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-ByWrKvZe.mjs.map → acorex-modules-document-management-large-tiles-view.component-CtCdVI_p.mjs.map} +1 -1
  91. package/fesm2022/acorex-modules-document-management-link-dialog.component-1iPUnhr1.mjs +70 -0
  92. package/fesm2022/acorex-modules-document-management-link-dialog.component-1iPUnhr1.mjs.map +1 -0
  93. package/fesm2022/{acorex-modules-document-management-list-view.component-B6J6Tokv.mjs → acorex-modules-document-management-list-view.component-Cz2wNqhM.mjs} +2 -2
  94. package/fesm2022/{acorex-modules-document-management-list-view.component-B6J6Tokv.mjs.map → acorex-modules-document-management-list-view.component-Cz2wNqhM.mjs.map} +1 -1
  95. package/fesm2022/acorex-modules-document-management-lock-dialog.component-BwKdUUcf.mjs +52 -0
  96. package/fesm2022/acorex-modules-document-management-lock-dialog.component-BwKdUUcf.mjs.map +1 -0
  97. package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-Dae6RWb8.mjs → acorex-modules-document-management-rename-node-dialog.component-DB868l1X.mjs} +10 -10
  98. package/fesm2022/acorex-modules-document-management-rename-node-dialog.component-DB868l1X.mjs.map +1 -0
  99. package/fesm2022/acorex-modules-document-management-share-dialog.component-BiNdRpqs.mjs +143 -0
  100. package/fesm2022/acorex-modules-document-management-share-dialog.component-BiNdRpqs.mjs.map +1 -0
  101. package/fesm2022/acorex-modules-document-management-share-email-dialog.component-BvR5OuCV.mjs +55 -0
  102. package/fesm2022/acorex-modules-document-management-share-email-dialog.component-BvR5OuCV.mjs.map +1 -0
  103. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-TrYeB22e.mjs → acorex-modules-document-management-small-icons-view.component-B_O5Qpmi.mjs} +2 -2
  104. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-TrYeB22e.mjs.map → acorex-modules-document-management-small-icons-view.component-B_O5Qpmi.mjs.map} +1 -1
  105. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-DDKdWg8I.mjs → acorex-modules-document-management-small-tiles-view.component-b2lauUIY.mjs} +2 -2
  106. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-DDKdWg8I.mjs.map → acorex-modules-document-management-small-tiles-view.component-b2lauUIY.mjs.map} +1 -1
  107. package/fesm2022/acorex-modules-document-management-unlock-dialog.component-DkZQ84kg.mjs +37 -0
  108. package/fesm2022/acorex-modules-document-management-unlock-dialog.component-DkZQ84kg.mjs.map +1 -0
  109. package/fesm2022/acorex-modules-document-management.mjs +1 -1
  110. package/fesm2022/{acorex-modules-form-template-management-acorex-modules-form-template-management-CJYrDtq6.mjs → acorex-modules-form-template-management-acorex-modules-form-template-management-HYqIufS1.mjs} +30 -24
  111. package/fesm2022/acorex-modules-form-template-management-acorex-modules-form-template-management-HYqIufS1.mjs.map +1 -0
  112. package/fesm2022/{acorex-modules-form-template-management-category.entity-BdiYytzK.mjs → acorex-modules-form-template-management-category.entity-CLFAo0Cn.mjs} +7 -3
  113. package/fesm2022/acorex-modules-form-template-management-category.entity-CLFAo0Cn.mjs.map +1 -0
  114. package/fesm2022/{acorex-modules-form-template-management-setting.provider-CoETMkEC.mjs → acorex-modules-form-template-management-setting.provider-DgHwqlhz.mjs} +20 -17
  115. package/fesm2022/acorex-modules-form-template-management-setting.provider-DgHwqlhz.mjs.map +1 -0
  116. package/fesm2022/{acorex-modules-form-template-management-template-picker.component-0JfGxdMv.mjs → acorex-modules-form-template-management-template-picker.component-M-R2U9CH.mjs} +5 -4
  117. package/fesm2022/acorex-modules-form-template-management-template-picker.component-M-R2U9CH.mjs.map +1 -0
  118. package/fesm2022/{acorex-modules-form-template-management-template-widget-edit.component-BkJ3ieIg.mjs → acorex-modules-form-template-management-template-widget-edit.component-CYAyug_g.mjs} +2 -2
  119. package/fesm2022/{acorex-modules-form-template-management-template-widget-edit.component-BkJ3ieIg.mjs.map → acorex-modules-form-template-management-template-widget-edit.component-CYAyug_g.mjs.map} +1 -1
  120. package/fesm2022/{acorex-modules-form-template-management-template.entity-ByE2p0Mu.mjs → acorex-modules-form-template-management-template.entity-DGU1QNSN.mjs} +53 -33
  121. package/fesm2022/acorex-modules-form-template-management-template.entity-DGU1QNSN.mjs.map +1 -0
  122. package/fesm2022/{acorex-modules-form-template-management-viewer-popup.component-CThcXWpt.mjs → acorex-modules-form-template-management-viewer-popup.component-DXJxzTfM.mjs} +2 -2
  123. package/fesm2022/{acorex-modules-form-template-management-viewer-popup.component-CThcXWpt.mjs.map → acorex-modules-form-template-management-viewer-popup.component-DXJxzTfM.mjs.map} +1 -1
  124. package/fesm2022/acorex-modules-form-template-management.mjs +1 -1
  125. package/fesm2022/acorex-modules-notification-management.mjs +43 -35
  126. package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
  127. package/fesm2022/{acorex-modules-organization-management-org-chart-configuration.page-JKQwYEPq.mjs → acorex-modules-organization-management-org-chart-configuration.page-BFu7TUGC.mjs} +3 -3
  128. package/fesm2022/{acorex-modules-organization-management-org-chart-configuration.page-JKQwYEPq.mjs.map → acorex-modules-organization-management-org-chart-configuration.page-BFu7TUGC.mjs.map} +1 -1
  129. package/fesm2022/{acorex-modules-organization-management-org-chart-configuration.service-QLdDEdqL.mjs → acorex-modules-organization-management-org-chart-configuration.service-B4ohp4o5.mjs} +5 -4
  130. package/fesm2022/acorex-modules-organization-management-org-chart-configuration.service-B4ohp4o5.mjs.map +1 -0
  131. package/fesm2022/{acorex-modules-organization-management-org-chart.page-C2ZtUVKI.mjs → acorex-modules-organization-management-org-chart.page-BIytyLYP.mjs} +3 -4
  132. package/fesm2022/acorex-modules-organization-management-org-chart.page-BIytyLYP.mjs.map +1 -0
  133. package/fesm2022/{acorex-modules-organization-management-setting.provider-CMDpwkG2.mjs → acorex-modules-organization-management-setting.provider-BPjFNA5E.mjs} +44 -23
  134. package/fesm2022/acorex-modules-organization-management-setting.provider-BPjFNA5E.mjs.map +1 -0
  135. package/fesm2022/acorex-modules-organization-management.mjs +6 -6
  136. package/fesm2022/acorex-modules-organization-management.mjs.map +1 -1
  137. package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-DNUdH0N9.mjs +4703 -0
  138. package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-DNUdH0N9.mjs.map +1 -0
  139. package/fesm2022/{acorex-modules-platform-management-list-version.component-C9764yzu.mjs → acorex-modules-platform-management-list-version.component-D3yLcmjw.mjs} +2 -2
  140. package/fesm2022/{acorex-modules-platform-management-list-version.component-C9764yzu.mjs.map → acorex-modules-platform-management-list-version.component-D3yLcmjw.mjs.map} +1 -1
  141. package/fesm2022/acorex-modules-platform-management-setting.provider-CQCoLwHW.mjs +335 -0
  142. package/fesm2022/acorex-modules-platform-management-setting.provider-CQCoLwHW.mjs.map +1 -0
  143. package/fesm2022/acorex-modules-platform-management.mjs +1 -4866
  144. package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
  145. package/fesm2022/acorex-modules-security-management.mjs +18 -12
  146. package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
  147. package/form-template-management/lib/entities/category/category.service.d.ts +2 -2
  148. package/form-template-management/lib/entities/category/category.types.d.ts +2 -1
  149. package/form-template-management/lib/entities/template/template.service.d.ts +2 -2
  150. package/form-template-management/lib/entities/template/template.types.d.ts +38 -5
  151. package/form-template-management/lib/features/designer/template.provider.d.ts +1 -1
  152. package/form-template-management/lib/features/designer/widgets/template-picker/template.provider.d.ts +3 -3
  153. package/form-template-management/lib/setting.provider.d.ts +4 -0
  154. package/notification-management/lib/setting.provider.d.ts +4 -0
  155. package/organization-management/lib/features/organization-chart/org-chart-configuration.page.d.ts +2 -2
  156. package/organization-management/lib/features/organization-chart/org-chart.page.d.ts +2 -2
  157. package/organization-management/lib/setting.provider.d.ts +5 -3
  158. package/package.json +1 -1
  159. package/platform-management/lib/common/regional/setting.keys.d.ts +3 -1
  160. package/platform-management/lib/common/regional/setting.provider.d.ts +4 -1
  161. package/security-management/lib/entities/users/users.service.d.ts +4 -4
  162. package/security-management/lib/entities/users/users.types.d.ts +0 -4
  163. package/common/lib/features/dashboard-home/index.d.ts +0 -1
  164. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-filter.component.d.ts +0 -6
  165. package/fesm2022/acorex-modules-auth-acorex-modules-auth-DrcL7GCj.mjs.map +0 -1
  166. package/fesm2022/acorex-modules-auth-setting.provider-DDl3OHw6.mjs +0 -59
  167. package/fesm2022/acorex-modules-auth-setting.provider-DDl3OHw6.mjs.map +0 -1
  168. package/fesm2022/acorex-modules-common-index-D90SN6SH.mjs +0 -507
  169. package/fesm2022/acorex-modules-common-index-D90SN6SH.mjs.map +0 -1
  170. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-_BOVaDOq.mjs.map +0 -1
  171. package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-D66KoQNb.mjs +0 -92
  172. package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-D66KoQNb.mjs.map +0 -1
  173. package/fesm2022/acorex-modules-document-management-drive-choose.component-WoZfDyLK.mjs.map +0 -1
  174. package/fesm2022/acorex-modules-document-management-drive.component-B3BCzdVv.mjs +0 -305
  175. package/fesm2022/acorex-modules-document-management-drive.component-B3BCzdVv.mjs.map +0 -1
  176. package/fesm2022/acorex-modules-document-management-rename-node-dialog.component-Dae6RWb8.mjs.map +0 -1
  177. package/fesm2022/acorex-modules-form-template-management-acorex-modules-form-template-management-CJYrDtq6.mjs.map +0 -1
  178. package/fesm2022/acorex-modules-form-template-management-category.entity-BdiYytzK.mjs.map +0 -1
  179. package/fesm2022/acorex-modules-form-template-management-setting.provider-CoETMkEC.mjs.map +0 -1
  180. package/fesm2022/acorex-modules-form-template-management-template-picker.component-0JfGxdMv.mjs.map +0 -1
  181. package/fesm2022/acorex-modules-form-template-management-template.entity-ByE2p0Mu.mjs.map +0 -1
  182. package/fesm2022/acorex-modules-organization-management-org-chart-configuration.service-QLdDEdqL.mjs.map +0 -1
  183. package/fesm2022/acorex-modules-organization-management-org-chart.page-C2ZtUVKI.mjs.map +0 -1
  184. package/fesm2022/acorex-modules-organization-management-setting.provider-CMDpwkG2.mjs.map +0 -1
  185. /package/common/lib/features/{dashboard-home/dashboard.type.d.ts → home-dashboard/dashboard-home/home-dashboard.type.d.ts} +0 -0
@@ -0,0 +1,717 @@
1
+ import * as i5 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { output, input, ChangeDetectionStrategy, Component, model, signal, inject, Injectable, computed, effect, ViewEncapsulation } from '@angular/core';
5
+ import { Router, ActivatedRoute } from '@angular/router';
6
+ import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
7
+ import * as i1 from '@acorex/components/button';
8
+ import { AXButtonModule } from '@acorex/components/button';
9
+ import { AXButtonGroupModule } from '@acorex/components/button-group';
10
+ import * as i2 from '@acorex/components/decorators';
11
+ import { AXDecoratorModule } from '@acorex/components/decorators';
12
+ import { AXDialogService } from '@acorex/components/dialog';
13
+ import * as i3 from '@acorex/components/dropdown';
14
+ import { AXDropdownModule } from '@acorex/components/dropdown';
15
+ import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
16
+ import * as i3$2 from '@acorex/components/grid-layout-builder';
17
+ import { AXGridLayoutBuilderModule } from '@acorex/components/grid-layout-builder';
18
+ import * as i4 from '@acorex/core/translation';
19
+ import { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';
20
+ import * as i2$1 from '@acorex/platform/layout/builder';
21
+ import { AXPWidgetGroupEnum, AXPLayoutBuilderModule } from '@acorex/platform/layout/builder';
22
+ import { AXPWidgetPropertyViewerComponent, AXPWidgetPickerService, AXPDesignerService } from '@acorex/platform/layout/designer';
23
+ import { AXPBasePageComponent, AXPPageLayoutComponent, AXPBasePage } from '@acorex/platform/themes/default';
24
+ import { AXPLayoutThemeService, AXPThemeLayoutBlockComponent } from '@acorex/platform/themes/shared';
25
+ import { AXPopupService } from '@acorex/components/popup';
26
+ import { AXMDashboardService, RootConfig } from './acorex-modules-common.mjs';
27
+ import { AXPSettingService } from '@acorex/platform/common';
28
+ import { AXPPlatformScope, AXPDataGenerator } from '@acorex/platform/core';
29
+ import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
30
+ import * as i4$1 from '@acorex/components/label';
31
+ import { AXLabelModule } from '@acorex/components/label';
32
+ import { AXBasePageComponent } from '@acorex/components/page';
33
+ import * as i3$1 from '@acorex/components/text-box';
34
+ import { AXTextBoxModule } from '@acorex/components/text-box';
35
+ import * as i1$1 from '@angular/forms';
36
+ import { FormsModule } from '@angular/forms';
37
+
38
+ class AXCDashboardWidgetWrapperComponent {
39
+ constructor() {
40
+ this.onDelete = output();
41
+ this.onConfiguration = output();
42
+ this.hasOptions = input(true);
43
+ }
44
+ handleOnItemClick(event) {
45
+ switch (event.item.data) {
46
+ case 'delete':
47
+ this.onDelete.emit();
48
+ break;
49
+ case 'configuration':
50
+ this.onConfiguration.emit();
51
+ break;
52
+ default:
53
+ break;
54
+ }
55
+ }
56
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCDashboardWidgetWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
57
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXCDashboardWidgetWrapperComponent, isStandalone: true, selector: "axc-dashboard-widget-wrapper", inputs: { hasOptions: { classPropertyName: "hasOptions", publicName: "hasOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDelete: "onDelete", onConfiguration: "onConfiguration" }, ngImport: i0, template: "<section class=\"ax-relative ax-size-full ax-flex ax-justify-center ax-items-center ax-group\">\n @if(hasOptions()){\n <div class=\"ax-p-1 ax-absolute ax-top-0 ax-left-0 ax-z-[9999] ax-invisible group-hover:ax-visible\">\n <ax-button class=\"ax-sm\" [look]=\"'blank'\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-ellipsis-h\"></ax-icon>\n </ax-prefix>\n <ax-dropdown-panel>\n <ng-container *translate=\"let t\">\n <ax-button-item-list (onItemClick)=\"handleOnItemClick($event)\">\n <ax-button-item\n [data]=\"'configuration'\"\n [text]=\"(t('configuration', { scope: 'dashboard' }) | async) || 'configuration'\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-cog\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-divider></ax-divider>\n <ax-button-item\n [data]=\"'delete'\"\n [text]=\"(t('delete', { scope: 'dashboard' }) | async) || 'delete'\"\n color=\"danger\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ng-container>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }\n <ng-content></ng-content>\n</section>\n", styles: [":host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i3.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i4.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
58
+ }
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCDashboardWidgetWrapperComponent, decorators: [{
60
+ type: Component,
61
+ args: [{ selector: 'axc-dashboard-widget-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXButtonModule, AXDecoratorModule, AXDropdownModule, AXTranslationModule, CommonModule], standalone: true, template: "<section class=\"ax-relative ax-size-full ax-flex ax-justify-center ax-items-center ax-group\">\n @if(hasOptions()){\n <div class=\"ax-p-1 ax-absolute ax-top-0 ax-left-0 ax-z-[9999] ax-invisible group-hover:ax-visible\">\n <ax-button class=\"ax-sm\" [look]=\"'blank'\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-ellipsis-h\"></ax-icon>\n </ax-prefix>\n <ax-dropdown-panel>\n <ng-container *translate=\"let t\">\n <ax-button-item-list (onItemClick)=\"handleOnItemClick($event)\">\n <ax-button-item\n [data]=\"'configuration'\"\n [text]=\"(t('configuration', { scope: 'dashboard' }) | async) || 'configuration'\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-cog\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-divider></ax-divider>\n <ax-button-item\n [data]=\"'delete'\"\n [text]=\"(t('delete', { scope: 'dashboard' }) | async) || 'delete'\"\n color=\"danger\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-trash-can\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ng-container>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n }\n <ng-content></ng-content>\n</section>\n", styles: [":host{display:block;width:100%;height:100%}\n"] }]
62
+ }] });
63
+
64
+ class AXCAddDashboardPopup extends AXBasePageComponent {
65
+ constructor() {
66
+ super(...arguments);
67
+ this.title = model('');
68
+ this.description = model('');
69
+ }
70
+ get isValid() {
71
+ return !!this.title()?.trim();
72
+ }
73
+ ngOnInit() {
74
+ this.title.set(this.data?.title || '');
75
+ this.description.set(this.data?.description || '');
76
+ }
77
+ async handleClose(isCanceled = false) {
78
+ this.close({
79
+ title: this.title()?.trim(),
80
+ description: this.description()?.trim(),
81
+ isCanceled,
82
+ });
83
+ }
84
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAddDashboardPopup, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
85
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.3", type: AXCAddDashboardPopup, isStandalone: true, selector: "ng-component", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { title: "titleChange", description: "descriptionChange" }, usesInheritance: true, ngImport: i0, template: `
86
+ <div class="ax-grid ax-grid-cols-[auto_18rem] ax-gap-4 ax-justify-center ax-p-4 ax-items-center">
87
+ <ax-label>Title</ax-label>
88
+ <ax-text-box [(ngModel)]="title" name="title" placeholder="Enter dashboard title"> </ax-text-box>
89
+
90
+ <ax-label>Description</ax-label>
91
+ <ax-text-box [(ngModel)]="description" name="description" placeholder="Enter dashboard description">
92
+ </ax-text-box>
93
+ </div>
94
+
95
+ <ax-footer>
96
+ <ax-prefix></ax-prefix>
97
+ <ax-suffix>
98
+ <ax-button text="Cancel" look="solid" (onClick)="handleClose(true)"> </ax-button>
99
+ <ax-button text="Save" look="solid" color="primary" [disabled]="!isValid" (onClick)="handleClose()">
100
+ <ax-icon class="fa-solid fa-save"></ax-icon>
101
+ </ax-button>
102
+ </ax-suffix>
103
+ </ax-footer>
104
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i3$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i4$1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }] }); }
105
+ }
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCAddDashboardPopup, decorators: [{
107
+ type: Component,
108
+ args: [{
109
+ template: `
110
+ <div class="ax-grid ax-grid-cols-[auto_18rem] ax-gap-4 ax-justify-center ax-p-4 ax-items-center">
111
+ <ax-label>Title</ax-label>
112
+ <ax-text-box [(ngModel)]="title" name="title" placeholder="Enter dashboard title"> </ax-text-box>
113
+
114
+ <ax-label>Description</ax-label>
115
+ <ax-text-box [(ngModel)]="description" name="description" placeholder="Enter dashboard description">
116
+ </ax-text-box>
117
+ </div>
118
+
119
+ <ax-footer>
120
+ <ax-prefix></ax-prefix>
121
+ <ax-suffix>
122
+ <ax-button text="Cancel" look="solid" (onClick)="handleClose(true)"> </ax-button>
123
+ <ax-button text="Save" look="solid" color="primary" [disabled]="!isValid" (onClick)="handleClose()">
124
+ <ax-icon class="fa-solid fa-save"></ax-icon>
125
+ </ax-button>
126
+ </ax-suffix>
127
+ </ax-footer>
128
+ `,
129
+ imports: [FormsModule, AXButtonModule, AXTextBoxModule, AXLabelModule, AXDecoratorModule],
130
+ }]
131
+ }] });
132
+
133
+ class AXCConfigurationPopup extends AXBasePageComponent {
134
+ constructor() {
135
+ super(...arguments);
136
+ this.widgetData = signal(null);
137
+ }
138
+ ngOnInit() {
139
+ this.widgetData.set(this.widget);
140
+ }
141
+ async handleClose(isCanceled = false) {
142
+ this.close({
143
+ isCanceled,
144
+ widget: this.widgetData(),
145
+ });
146
+ }
147
+ handlePropertyChange(event) {
148
+ this.widgetData.set(event.values);
149
+ }
150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCConfigurationPopup, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
151
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXCConfigurationPopup, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
152
+ @if(widget) {
153
+ <div class="ax-px-1">
154
+ <axp-widget-property-viewer (onChanged)="handlePropertyChange($event)" [widget]="widget">
155
+ </axp-widget-property-viewer>
156
+ </div>
157
+ }
158
+ <ax-footer>
159
+ <ax-prefix></ax-prefix>
160
+ <ax-suffix>
161
+ <ax-button text="Cancel" look="solid" (onClick)="handleClose(true)"> </ax-button>
162
+ <ax-button text="Save" look="solid" color="primary" (onClick)="handleClose()">
163
+ <ax-icon class="fa-solid fa-save"></ax-icon>
164
+ </ax-button>
165
+ </ax-suffix>
166
+ </ax-footer>
167
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXPWidgetPropertyViewerComponent, selector: "axp-widget-property-viewer", inputs: ["widget", "mode"], outputs: ["onChanged"] }] }); }
168
+ }
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCConfigurationPopup, decorators: [{
170
+ type: Component,
171
+ args: [{
172
+ template: `
173
+ @if(widget) {
174
+ <div class="ax-px-1">
175
+ <axp-widget-property-viewer (onChanged)="handlePropertyChange($event)" [widget]="widget">
176
+ </axp-widget-property-viewer>
177
+ </div>
178
+ }
179
+ <ax-footer>
180
+ <ax-prefix></ax-prefix>
181
+ <ax-suffix>
182
+ <ax-button text="Cancel" look="solid" (onClick)="handleClose(true)"> </ax-button>
183
+ <ax-button text="Save" look="solid" color="primary" (onClick)="handleClose()">
184
+ <ax-icon class="fa-solid fa-save"></ax-icon>
185
+ </ax-button>
186
+ </ax-suffix>
187
+ </ax-footer>
188
+ `,
189
+ imports: [AXButtonModule, AXDecoratorModule, AXPWidgetPropertyViewerComponent],
190
+ }]
191
+ }] });
192
+
193
+ class AXPDashboardPopupService {
194
+ constructor() {
195
+ this.popupService = inject(AXPopupService);
196
+ }
197
+ async generateDashboardLayout(data) {
198
+ const result = await this.popupService.open(AXCAddDashboardPopup, {
199
+ header: true,
200
+ size: 'fit',
201
+ draggable: true,
202
+ hasBackdrop: true,
203
+ title: 'Dashboard Layout Details',
204
+ data: { data },
205
+ });
206
+ if (!result.data) {
207
+ return;
208
+ }
209
+ const { isCanceled, ...rest } = result.data;
210
+ if (isCanceled) {
211
+ return;
212
+ }
213
+ return rest;
214
+ }
215
+ async handlePopupConfiguration(widget) {
216
+ const result = await this.popupService.open(AXCConfigurationPopup, {
217
+ header: true,
218
+ size: 'sm',
219
+ draggable: true,
220
+ hasBackdrop: true,
221
+ title: 'Widget Configuration',
222
+ data: { widget },
223
+ });
224
+ if (!result.data) {
225
+ return;
226
+ }
227
+ const { isCanceled, ...rest } = result.data;
228
+ if (isCanceled) {
229
+ return;
230
+ }
231
+ return rest.widget;
232
+ }
233
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDashboardPopupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
234
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDashboardPopupService, providedIn: 'root' }); }
235
+ }
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDashboardPopupService, decorators: [{
237
+ type: Injectable,
238
+ args: [{ providedIn: 'root' }]
239
+ }] });
240
+
241
+ const path = 'home:dashboard:';
242
+ var AXPHomeDashboardSetting;
243
+ (function (AXPHomeDashboardSetting) {
244
+ AXPHomeDashboardSetting["CurrentDashboard"] = "home:dashboard:current-dashboard";
245
+ })(AXPHomeDashboardSetting || (AXPHomeDashboardSetting = {}));
246
+
247
+ // Create the SignalStore
248
+ const AXCDashboardStore = signalStore({ providedIn: 'root' },
249
+ // Initial State Definition
250
+ withState(() => {
251
+ // Define initial empty state
252
+ const state = {
253
+ dashboards: [],
254
+ currentDashboardId: null,
255
+ dashboardsOption: { float: true, cellHeight: 75, gap: 5, minRow: 9, column: 12 },
256
+ isLoading: false,
257
+ };
258
+ return state;
259
+ }),
260
+ // Computed Properties
261
+ withComputed((state) => ({
262
+ currentDashboard: computed(() => {
263
+ return state.dashboards().find((dashboard) => dashboard.id === state.currentDashboardId()) || null;
264
+ }),
265
+ })),
266
+ // Methods for State Management
267
+ withMethods((store, dashboardPopup = inject(AXPDashboardPopupService), dialogService = inject(AXDialogService), translationService = inject(AXTranslationService), widgetPickerService = inject(AXPWidgetPickerService), dashboardService = inject(AXMDashboardService), settingService = inject(AXPSettingService)) => {
268
+ // Load dashboards from service - runs on init via effect
269
+ effect(() => {
270
+ loadDashboards();
271
+ });
272
+ // Load dashboards from service
273
+ async function loadDashboards() {
274
+ try {
275
+ patchState(store, { isLoading: true });
276
+ // Get dashboards from service using query method
277
+ const result = await dashboardService.query({ skip: 0, take: 100 });
278
+ const dashboardModels = result.items || [];
279
+ // Convert dashboard models to AXPDashboardLayout
280
+ const dashboards = dashboardModels.map(modelToDashboardLayout);
281
+ // Get current dashboard from settings
282
+ const currentDashboardId = await settingService
283
+ .scope(AXPPlatformScope.User)
284
+ .get(AXPHomeDashboardSetting.CurrentDashboard);
285
+ let newCurrentDashboardId = null;
286
+ if (dashboards.length > 0) {
287
+ // Check if currentDashboardId exists and is valid
288
+ const dashboardExists = currentDashboardId && dashboards.some((d) => d.id === currentDashboardId);
289
+ if (dashboardExists) {
290
+ newCurrentDashboardId = currentDashboardId;
291
+ }
292
+ else {
293
+ // If current dashboard is not valid or not set, use the first one
294
+ newCurrentDashboardId = dashboards[0].id;
295
+ // Save to user settings
296
+ settingService
297
+ .scope(AXPPlatformScope.User)
298
+ .set(AXPHomeDashboardSetting.CurrentDashboard, newCurrentDashboardId);
299
+ }
300
+ }
301
+ patchState(store, {
302
+ dashboards,
303
+ isLoading: false,
304
+ currentDashboardId: newCurrentDashboardId,
305
+ });
306
+ }
307
+ catch (error) {
308
+ console.error('Error loading dashboards:', error);
309
+ patchState(store, { isLoading: false });
310
+ }
311
+ }
312
+ // Convert entity model to dashboard layout
313
+ function modelToDashboardLayout(model) {
314
+ return {
315
+ id: model.id || '',
316
+ title: model.title,
317
+ description: model.description,
318
+ widget: model.widget || [],
319
+ };
320
+ }
321
+ // Convert dashboard layout to entity model
322
+ function dashboardLayoutToModel(layout) {
323
+ return {
324
+ id: layout.id,
325
+ name: layout.title,
326
+ title: layout.title,
327
+ description: layout.description || '',
328
+ widget: layout.widget,
329
+ };
330
+ }
331
+ return {
332
+ // Set current dashboard
333
+ setCurrentDashboard(dashboardId) {
334
+ patchState(store, { currentDashboardId: dashboardId });
335
+ settingService.scope(AXPPlatformScope.User).set(AXPHomeDashboardSetting.CurrentDashboard, dashboardId);
336
+ },
337
+ // Add a new dashboard
338
+ async addDashboard() {
339
+ try {
340
+ const newDashboard = await dashboardPopup.generateDashboardLayout({});
341
+ if (!newDashboard)
342
+ return;
343
+ newDashboard.id = AXPDataGenerator.uuid();
344
+ newDashboard.widget = [];
345
+ // Create dashboard model and save to service
346
+ const dashboardModel = dashboardLayoutToModel(newDashboard);
347
+ await dashboardService.insertOne(dashboardModel);
348
+ // Update local state
349
+ const updatedDashboards = [...store.dashboards(), newDashboard];
350
+ patchState(store, {
351
+ dashboards: updatedDashboards,
352
+ currentDashboardId: newDashboard.id,
353
+ });
354
+ // Save current dashboard to settings
355
+ settingService.scope(AXPPlatformScope.User).set(AXPHomeDashboardSetting.CurrentDashboard, newDashboard.id);
356
+ }
357
+ catch (error) {
358
+ console.error('Error adding dashboard:', error);
359
+ }
360
+ },
361
+ // Add a widget to the current dashboard
362
+ async addWidget() {
363
+ if (!store.currentDashboardId()) {
364
+ console.warn('No current dashboard selected');
365
+ return;
366
+ }
367
+ try {
368
+ const widgets = await widgetPickerService.showPicker({
369
+ groups: [AXPWidgetGroupEnum.DashboardWidget],
370
+ });
371
+ //remove meta from widgets
372
+ const filteredWidgets = widgets.map(({ __meta__, ...rest }) => rest);
373
+ // Step 2: Convert the selected widgets into AXPDashboardWidgetData format
374
+ const convertedWidgets = filteredWidgets.map((widget) => {
375
+ const id = AXPDataGenerator.uuid();
376
+ return {
377
+ config: {
378
+ height: widget?.meta?.dimensions?.height ?? 2,
379
+ width: widget?.meta?.dimensions?.width ?? 2,
380
+ minHeight: widget?.meta?.dimensions?.minHeight,
381
+ minWidth: widget?.meta?.dimensions?.minWidth,
382
+ maxHeight: widget?.meta?.dimensions?.maxHeight,
383
+ maxWidth: widget?.meta?.dimensions?.maxWidth,
384
+ id,
385
+ },
386
+ node: { ...widget, name: id },
387
+ };
388
+ });
389
+ // Step 3: Update the dashboards
390
+ const updatedDashboards = store.dashboards().map((dashboard) => {
391
+ if (dashboard.id === store.currentDashboardId()) {
392
+ return {
393
+ ...dashboard,
394
+ widget: [...dashboard.widget, ...convertedWidgets],
395
+ };
396
+ }
397
+ return dashboard;
398
+ });
399
+ // Step 4: Save the updated dashboard to the service
400
+ const currentDashboard = updatedDashboards.find((d) => d.id === store.currentDashboardId());
401
+ if (currentDashboard) {
402
+ await dashboardService.updateOne(currentDashboard.id, dashboardLayoutToModel(currentDashboard));
403
+ }
404
+ patchState(store, { dashboards: updatedDashboards });
405
+ }
406
+ catch (error) {
407
+ console.error('Error adding widget:', error);
408
+ }
409
+ },
410
+ // Remove a dashboard
411
+ async removeDashboard(id) {
412
+ if (!id) {
413
+ console.warn('No dashboard ID provided for removal');
414
+ return;
415
+ }
416
+ try {
417
+ const dialogResult = await dialogService.confirm(await translationService.translateAsync('workflow.warning'), await translationService.translateAsync('workflow.confirm-delete'), 'danger', 'horizontal');
418
+ if (dialogResult.result) {
419
+ // Delete from service
420
+ await dashboardService.deleteOne(id);
421
+ // Remove the dashboard from local state
422
+ const updatedDashboards = store.dashboards().filter((dashboard) => dashboard.id !== id);
423
+ // Update state and select a new current dashboard if needed
424
+ let newCurrentDashboardId = store.currentDashboardId();
425
+ if (id === store.currentDashboardId()) {
426
+ newCurrentDashboardId = updatedDashboards.length > 0 ? updatedDashboards[0].id : null;
427
+ // Save to settings if we changed the current dashboard
428
+ if (newCurrentDashboardId) {
429
+ settingService
430
+ .scope(AXPPlatformScope.User)
431
+ .set(AXPHomeDashboardSetting.CurrentDashboard, newCurrentDashboardId);
432
+ }
433
+ }
434
+ patchState(store, {
435
+ dashboards: updatedDashboards,
436
+ currentDashboardId: newCurrentDashboardId,
437
+ });
438
+ }
439
+ }
440
+ catch (error) {
441
+ console.error('Error removing dashboard:', error);
442
+ }
443
+ },
444
+ // Remove a widget from a dashboard
445
+ async removeWidget(dashboardId, widgetId) {
446
+ const currentDashboard = store.dashboards().find((d) => d.id === dashboardId);
447
+ if (!currentDashboard)
448
+ return;
449
+ const updatedDashboard = {
450
+ ...currentDashboard,
451
+ widget: currentDashboard.widget.filter((widget) => widget.config.id !== widgetId),
452
+ };
453
+ // Save to service
454
+ await dashboardService.updateOne(dashboardId, dashboardLayoutToModel(updatedDashboard));
455
+ // Update local state
456
+ const updatedDashboards = store
457
+ .dashboards()
458
+ .map((dashboard) => (dashboard.id === dashboardId ? updatedDashboard : dashboard));
459
+ patchState(store, { dashboards: updatedDashboards });
460
+ },
461
+ // Handle configuration changes
462
+ async handleConfigChange(dashboard) {
463
+ // Save to service
464
+ await dashboardService.updateOne(dashboard.id, dashboardLayoutToModel(dashboard));
465
+ // Update local state
466
+ const updatedDashboards = store.dashboards().map((d) => (d.id === dashboard.id ? dashboard : d));
467
+ patchState(store, {
468
+ dashboards: updatedDashboards,
469
+ currentDashboardId: dashboard.id,
470
+ });
471
+ // Save current dashboard to settings
472
+ settingService.scope(AXPPlatformScope.User).set(AXPHomeDashboardSetting.CurrentDashboard, dashboard.id);
473
+ },
474
+ // Handle grid layout changes
475
+ async onGridChange(event) {
476
+ console.log('onGridChange', event);
477
+ if (!store.currentDashboard()) {
478
+ console.warn('No current dashboard for grid change');
479
+ return;
480
+ }
481
+ // Extract nodes from the event and remove the `element` property
482
+ const nodes = event.nodes.map(({ element, ...rest }) => rest);
483
+ // Update the current dashboard
484
+ const currentDashboard = store.currentDashboard();
485
+ const updatedWidgets = currentDashboard.widget.map((widget) => {
486
+ const updatedNode = nodes.find((node) => node.id === widget.config.id);
487
+ if (updatedNode) {
488
+ return {
489
+ ...widget,
490
+ config: updatedNode,
491
+ };
492
+ }
493
+ return widget;
494
+ });
495
+ const updatedDashboard = {
496
+ ...currentDashboard,
497
+ widget: updatedWidgets,
498
+ };
499
+ // Save to service
500
+ await dashboardService.updateOne(updatedDashboard.id, dashboardLayoutToModel(updatedDashboard));
501
+ // Update the dashboards
502
+ const updatedDashboards = store
503
+ .dashboards()
504
+ .map((dashboard) => (dashboard.id === updatedDashboard.id ? updatedDashboard : dashboard));
505
+ patchState(store, { dashboards: updatedDashboards });
506
+ },
507
+ // Handle widget configuration
508
+ async handlePopupConfiguration(widgetNode) {
509
+ if (!store.currentDashboard()) {
510
+ console.warn('No current dashboard selected');
511
+ return;
512
+ }
513
+ try {
514
+ const updatedNode = await dashboardPopup.handlePopupConfiguration(widgetNode);
515
+ if (!updatedNode) {
516
+ return;
517
+ }
518
+ // Update the current dashboard's widget with the new configuration
519
+ const currentDashboard = store.currentDashboard();
520
+ const updatedWidgets = currentDashboard.widget.map((widget) => {
521
+ if (widget.node?.name === widgetNode.name && widget.node?.path === widgetNode.path) {
522
+ return {
523
+ ...widget,
524
+ node: updatedNode,
525
+ };
526
+ }
527
+ return widget;
528
+ });
529
+ const updatedDashboard = {
530
+ ...currentDashboard,
531
+ widget: updatedWidgets,
532
+ };
533
+ // Save to service
534
+ await dashboardService.updateOne(updatedDashboard.id, dashboardLayoutToModel(updatedDashboard));
535
+ // Update the dashboards state
536
+ const updatedDashboards = store
537
+ .dashboards()
538
+ .map((dashboard) => (dashboard.id === updatedDashboard.id ? updatedDashboard : dashboard));
539
+ patchState(store, { dashboards: updatedDashboards });
540
+ }
541
+ catch (error) {
542
+ console.error('Error handling widget configuration:', error);
543
+ }
544
+ },
545
+ // Reload dashboards from service
546
+ async refreshDashboards() {
547
+ await loadDashboards();
548
+ },
549
+ };
550
+ }));
551
+
552
+ class AXPDashboardHomeComponent extends AXPBasePageComponent {
553
+ constructor() {
554
+ super(...arguments);
555
+ //#region ---------------- Services & Dependencies ----------------
556
+ this.rootConfig = RootConfig;
557
+ this.popupService = inject(AXPopupService);
558
+ this.dialogService = inject(AXDialogService);
559
+ this.store = inject(AXCDashboardStore);
560
+ this.router = inject(Router);
561
+ this.activatedRoute = inject(ActivatedRoute);
562
+ this.layoutService = inject(AXPLayoutThemeService);
563
+ //#endregion
564
+ //#region ---------------- View Properties ----------------
565
+ this.isEdited = signal(false);
566
+ this.context = signal({});
567
+ //#endregion
568
+ //#region ---------------- Effects ----------------
569
+ this.#loadingEffect = effect(() => {
570
+ const isLoading = false; // Since store doesn't have isLoading, we'll default to false
571
+ this.layoutService.setNavigationLoading(isLoading);
572
+ });
573
+ }
574
+ //#endregion
575
+ //#region ---------------- Effects ----------------
576
+ #loadingEffect;
577
+ //#endregion
578
+ //#region ---------------- Event Handlers ----------------
579
+ toggleEdit() {
580
+ this.isEdited.update((value) => !value);
581
+ }
582
+ async confirmWidgetDelete(dashboardId, widgetId) {
583
+ try {
584
+ const dialogResult = await this.dialogService.confirm(await this.translateService.translateAsync('workflow.warning'), await this.translateService.translateAsync('workflow.confirm-delete'), 'danger', 'horizontal');
585
+ if (dialogResult.result) {
586
+ this.store.removeWidget(dashboardId, widgetId);
587
+ }
588
+ }
589
+ catch (error) {
590
+ console.error('Error confirming widget deletion:', error);
591
+ }
592
+ }
593
+ //#endregion
594
+ getPageTitle() {
595
+ return this.store.currentDashboard()?.title || 'Dashboard';
596
+ }
597
+ async getPageDescription() {
598
+ return this.store.currentDashboard()?.description || '';
599
+ }
600
+ getTitleActions() {
601
+ return [
602
+ ...this.store.dashboards().map((i) => ({
603
+ title: i.title,
604
+ command: { name: i.id, metadata: { isDashboard: true, dashboard: i } },
605
+ icon: i.id === this.store.currentDashboardId() ? 'fa-solid fa-check' : '',
606
+ })),
607
+ ];
608
+ }
609
+ async getPrimaryMenuItems() {
610
+ const scope = this.rootConfig.config.i18n;
611
+ return [
612
+ {
613
+ title: 't("add-item")',
614
+ icon: 'fa-light fa-square-plus',
615
+ color: 'primary',
616
+ items: [
617
+ {
618
+ title: await this.translateService.translateAsync('dashboard', { scope: 'dashboard' }),
619
+ icon: 'fa-light fa-gauge-high',
620
+ break: true,
621
+ command: {
622
+ name: 'new-dashboard',
623
+ },
624
+ },
625
+ {
626
+ title: await this.translateService.translateAsync('widget', { scope: 'dashboard' }),
627
+ icon: 'fa-light fa-window-restore',
628
+ command: {
629
+ name: 'new-widget',
630
+ },
631
+ },
632
+ ],
633
+ },
634
+ ];
635
+ }
636
+ async getSecondaryMenuItems() {
637
+ const scope = this.rootConfig.config.i18n;
638
+ return [
639
+ {
640
+ title: await this.translateService.translateAsync('delete-current-dashboard', { scope: 'dashboard' }),
641
+ icon: 'fa-light fa-trash-can',
642
+ color: 'danger',
643
+ disabled: this.store.dashboards().length <= 1,
644
+ command: {
645
+ name: 'delete',
646
+ },
647
+ },
648
+ ];
649
+ }
650
+ getPageBreadcrumbs() {
651
+ return [
652
+ {
653
+ title: this.translateService.translateSync('entity.home'),
654
+ icon: 'fa-solid fa-home ax-text-xs ax-me-2',
655
+ },
656
+ ];
657
+ }
658
+ async execute(command) {
659
+ if (command.metadata?.['isDashboard']) {
660
+ this.store.handleConfigChange(command.metadata?.['dashboard']);
661
+ this.recompute();
662
+ }
663
+ else {
664
+ switch (command.name) {
665
+ case 'new-dashboard':
666
+ await this.store.addDashboard();
667
+ this.recompute();
668
+ break;
669
+ case 'new-widget':
670
+ await this.store.addWidget();
671
+ this.recompute();
672
+ break;
673
+ case 'delete':
674
+ await this.store.removeDashboard(this.store.currentDashboard()?.id);
675
+ this.recompute();
676
+ break;
677
+ }
678
+ }
679
+ }
680
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDashboardHomeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
681
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPDashboardHomeComponent, isStandalone: true, selector: "axp-dashboard-home", providers: [
682
+ AXPDesignerService,
683
+ AXCDashboardStore,
684
+ {
685
+ provide: AXPBasePage,
686
+ useExisting: AXPDashboardHomeComponent,
687
+ },
688
+ ], usesInheritance: true, ngImport: i0, template: "<axp-page-layout *translate=\"let t\">\n <!-- Content Section -->\n\n <axp-page-content class=\"ax-relative\">\n <ax-grid-layout-container [options]=\"store.dashboardsOption()\" (onChange)=\"store.onGridChange($event)\">\n @for(widget of store.currentDashboard()?.widget; track widget.config.id) {\n <ax-grid-layout-widget [options]=\"widget.config\">\n <axc-dashboard-widget-wrapper\n [hasOptions]=\"widget.node?.options?.['hasOptions'] ?? true\"\n (onDelete)=\"confirmWidgetDelete(store.currentDashboard()?.id!, widget.config.id!)\"\n (onConfiguration)=\"store.handlePopupConfiguration(widget.node!)\"\n >\n @if(widget.node) {\n <axp-widgets-container [context]=\"context()\">\n <ng-container axp-widget-renderer [node]=\"widget.node\" [mode]=\"'view'\"></ng-container>\n </axp-widgets-container>\n }\n </axc-dashboard-widget-wrapper>\n </ax-grid-layout-widget>\n } @empty {\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center ax-h-full ax-bg-gray-50 ax-p-4\">\n <ax-icon icon=\"fa-light fa-shapes\" class=\"ax-text-4xl ax-text-gray-400 ax-mb-4\"></ax-icon>\n <h2 class=\"ax-text-xl ax-font-semibold ax-text-gray-700 ax-mb-2\">\n {{ t('no-widgets', { scope: 'dashboard' }) | async }}\n </h2>\n <p class=\"ax-text-gray-500 ax-text-center ax-mb-6\">\n {{ t('add-first-widget', { scope: 'dashboard' }) | async }}\n </p>\n </div>\n }\n </ax-grid-layout-container>\n </axp-page-content>\n</axp-page-layout>\n", styles: ["axp-dashboard-home{background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}axp-dashboard-home .placeholder-content{border-radius:.5rem!important;border-width:1px!important;border-style:dashed!important;--tw-border-opacity: 1 !important;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1))!important;background-color:rgba(var(--ax-sys-color-primary-lightest-surface),.5)!important}axp-dashboard-home ax-grid-layout-widget .grid-stack-item-content{border-style:none!important;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important;background-color:rgb(var(--ax-sys-color-lightest-surface))!important;color:rgb(var(--ax-sys-color-on-lightest-surface))!important;border-color:rgb(var(--ax-sys-color-border-lightest-surface))!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i2$1.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i2$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXButtonGroupModule }, { kind: "ngmodule", type: AXGridLayoutBuilderModule }, { kind: "component", type: i3$2.AXGridLayoutContainerComponent, selector: "ax-grid-layout-container", inputs: ["options", "isEmpty"], outputs: ["onAdded", "onRemoved", "onWidgetChange", "onChange", "isLayoutRendered", "isEmptyChange"] }, { kind: "component", type: i3$2.AXGridLayoutWidgetComponent, selector: "ax-grid-layout-widget", inputs: ["options"] }, { kind: "component", type: AXPPageLayoutComponent, selector: "axp-page-layout" }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer, axp-page-header, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-container, axp-layout-page-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title-bar, axp-layout-title, axp-layout-title-actions, axp-layout-nav-button, axp-layout-description, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i4.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "component", type: AXCDashboardWidgetWrapperComponent, selector: "axc-dashboard-widget-wrapper", inputs: ["hasOptions"], outputs: ["onDelete", "onConfiguration"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
689
+ }
690
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPDashboardHomeComponent, decorators: [{
691
+ type: Component,
692
+ args: [{ selector: 'axp-dashboard-home', standalone: true, imports: [
693
+ CommonModule,
694
+ AXPLayoutBuilderModule,
695
+ AXButtonModule,
696
+ AXButtonGroupModule,
697
+ AXGridLayoutBuilderModule,
698
+ AXPPageLayoutComponent,
699
+ AXPThemeLayoutBlockComponent,
700
+ AXDropdownButtonModule,
701
+ AXDropdownModule,
702
+ AXDecoratorModule,
703
+ AXTranslationModule,
704
+ AXBreadcrumbsModule,
705
+ AXCDashboardWidgetWrapperComponent,
706
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
707
+ AXPDesignerService,
708
+ AXCDashboardStore,
709
+ {
710
+ provide: AXPBasePage,
711
+ useExisting: AXPDashboardHomeComponent,
712
+ },
713
+ ], template: "<axp-page-layout *translate=\"let t\">\n <!-- Content Section -->\n\n <axp-page-content class=\"ax-relative\">\n <ax-grid-layout-container [options]=\"store.dashboardsOption()\" (onChange)=\"store.onGridChange($event)\">\n @for(widget of store.currentDashboard()?.widget; track widget.config.id) {\n <ax-grid-layout-widget [options]=\"widget.config\">\n <axc-dashboard-widget-wrapper\n [hasOptions]=\"widget.node?.options?.['hasOptions'] ?? true\"\n (onDelete)=\"confirmWidgetDelete(store.currentDashboard()?.id!, widget.config.id!)\"\n (onConfiguration)=\"store.handlePopupConfiguration(widget.node!)\"\n >\n @if(widget.node) {\n <axp-widgets-container [context]=\"context()\">\n <ng-container axp-widget-renderer [node]=\"widget.node\" [mode]=\"'view'\"></ng-container>\n </axp-widgets-container>\n }\n </axc-dashboard-widget-wrapper>\n </ax-grid-layout-widget>\n } @empty {\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center ax-h-full ax-bg-gray-50 ax-p-4\">\n <ax-icon icon=\"fa-light fa-shapes\" class=\"ax-text-4xl ax-text-gray-400 ax-mb-4\"></ax-icon>\n <h2 class=\"ax-text-xl ax-font-semibold ax-text-gray-700 ax-mb-2\">\n {{ t('no-widgets', { scope: 'dashboard' }) | async }}\n </h2>\n <p class=\"ax-text-gray-500 ax-text-center ax-mb-6\">\n {{ t('add-first-widget', { scope: 'dashboard' }) | async }}\n </p>\n </div>\n }\n </ax-grid-layout-container>\n </axp-page-content>\n</axp-page-layout>\n", styles: ["axp-dashboard-home{background-color:rgb(var(--ax-sys-color-lighter-surface));color:rgb(var(--ax-sys-color-on-lighter-surface));border-color:rgb(var(--ax-sys-color-border-lighter-surface))}axp-dashboard-home .placeholder-content{border-radius:.5rem!important;border-width:1px!important;border-style:dashed!important;--tw-border-opacity: 1 !important;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1))!important;background-color:rgba(var(--ax-sys-color-primary-lightest-surface),.5)!important}axp-dashboard-home ax-grid-layout-widget .grid-stack-item-content{border-style:none!important;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important;background-color:rgb(var(--ax-sys-color-lightest-surface))!important;color:rgb(var(--ax-sys-color-on-lightest-surface))!important;border-color:rgb(var(--ax-sys-color-border-lightest-surface))!important}\n"] }]
714
+ }] });
715
+
716
+ export { AXCDashboardStore, AXPDashboardHomeComponent };
717
+ //# sourceMappingURL=acorex-modules-common-index-rvP9ISgL.mjs.map