@acorex/modules 19.2.6 → 19.2.8

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 (197) hide show
  1. package/application-management/lib/layouts/module-entity-detail-view/module-entity-detail-view.component.d.ts +2 -2
  2. package/fesm2022/acorex-modules-application-management.mjs +2 -2
  3. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  4. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-D75igkfc.mjs → acorex-modules-auth-acorex-modules-auth-HwJJs-3A.mjs} +12 -12
  5. package/fesm2022/acorex-modules-auth-acorex-modules-auth-HwJJs-3A.mjs.map +1 -0
  6. package/fesm2022/{acorex-modules-auth-app-chooser.component-BZb8n5Ag.mjs → acorex-modules-auth-app-chooser.component-BvxMkXPp.mjs} +2 -2
  7. package/fesm2022/{acorex-modules-auth-app-chooser.component-BZb8n5Ag.mjs.map → acorex-modules-auth-app-chooser.component-BvxMkXPp.mjs.map} +1 -1
  8. package/fesm2022/{acorex-modules-auth-login.module-DAtJYcHZ.mjs → acorex-modules-auth-login.module-CDvLUxls.mjs} +4 -4
  9. package/fesm2022/{acorex-modules-auth-login.module-DAtJYcHZ.mjs.map → acorex-modules-auth-login.module-CDvLUxls.mjs.map} +1 -1
  10. package/fesm2022/acorex-modules-auth-master.layout-CnKBnl8W.mjs +23 -0
  11. package/fesm2022/acorex-modules-auth-master.layout-CnKBnl8W.mjs.map +1 -0
  12. package/fesm2022/{acorex-modules-auth-password.component-20Ofs9FL.mjs → acorex-modules-auth-password.component-1FnIjiZ8.mjs} +2 -2
  13. package/fesm2022/{acorex-modules-auth-password.component-20Ofs9FL.mjs.map → acorex-modules-auth-password.component-1FnIjiZ8.mjs.map} +1 -1
  14. package/fesm2022/{acorex-modules-auth-password.component-CRvI9sIa.mjs → acorex-modules-auth-password.component-C16jeHuJ.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-auth-password.component-CRvI9sIa.mjs.map → acorex-modules-auth-password.component-C16jeHuJ.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-auth-routes-BDED-qaZ.mjs → acorex-modules-auth-routes-ZDDUhAWd.mjs} +2 -2
  17. package/fesm2022/{acorex-modules-auth-routes-BDED-qaZ.mjs.map → acorex-modules-auth-routes-ZDDUhAWd.mjs.map} +1 -1
  18. package/fesm2022/{acorex-modules-auth-setting.provider-GJeEbIRd.mjs → acorex-modules-auth-setting.provider-DDl3OHw6.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-auth-setting.provider-GJeEbIRd.mjs.map → acorex-modules-auth-setting.provider-DDl3OHw6.mjs.map} +1 -1
  20. package/fesm2022/{acorex-modules-auth-two-factor.module-B0C2aBWh.mjs → acorex-modules-auth-two-factor.module-C32MVGby.mjs} +2 -2
  21. package/fesm2022/{acorex-modules-auth-two-factor.module-B0C2aBWh.mjs.map → acorex-modules-auth-two-factor.module-C32MVGby.mjs.map} +1 -1
  22. package/fesm2022/acorex-modules-auth.mjs +1 -1
  23. package/fesm2022/acorex-modules-form-template-management-acorex-modules-form-template-management-CUQ-GAN5.mjs +932 -0
  24. package/fesm2022/acorex-modules-form-template-management-acorex-modules-form-template-management-CUQ-GAN5.mjs.map +1 -0
  25. package/fesm2022/{acorex-modules-form-template-management-category.entity-BcfMw_wb.mjs → acorex-modules-form-template-management-category.entity-WtgUidaW.mjs} +2 -2
  26. package/fesm2022/{acorex-modules-form-template-management-category.entity-BcfMw_wb.mjs.map → acorex-modules-form-template-management-category.entity-WtgUidaW.mjs.map} +1 -1
  27. package/fesm2022/acorex-modules-form-template-management-designer.page-BLbPLLdP.mjs.map +1 -1
  28. package/fesm2022/{acorex-modules-form-template-management-setting.provider-ceq0ZtxA.mjs → acorex-modules-form-template-management-setting.provider-u7Jv1myU.mjs} +2 -2
  29. package/fesm2022/{acorex-modules-form-template-management-setting.provider-ceq0ZtxA.mjs.map → acorex-modules-form-template-management-setting.provider-u7Jv1myU.mjs.map} +1 -1
  30. package/fesm2022/acorex-modules-form-template-management-template-picker.component-xiRKc4FF.mjs.map +1 -1
  31. package/fesm2022/{acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs → acorex-modules-form-template-management-template-widget-edit.component-DPdPjZGi.mjs} +2 -2
  32. package/fesm2022/acorex-modules-form-template-management-template-widget-edit.component-DPdPjZGi.mjs.map +1 -0
  33. package/fesm2022/{acorex-modules-form-template-management-template.entity-BpApQcvG.mjs → acorex-modules-form-template-management-template.entity-BnctQkm6.mjs} +2 -2
  34. package/fesm2022/{acorex-modules-form-template-management-template.entity-BpApQcvG.mjs.map → acorex-modules-form-template-management-template.entity-BnctQkm6.mjs.map} +1 -1
  35. package/fesm2022/acorex-modules-form-template-management.mjs +1 -907
  36. package/fesm2022/acorex-modules-form-template-management.mjs.map +1 -1
  37. package/fesm2022/acorex-modules-notification-management.mjs +49 -66
  38. package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
  39. package/fesm2022/acorex-modules-organization-management-add-item.component-DsWqdz8M.mjs +86 -0
  40. package/fesm2022/acorex-modules-organization-management-add-item.component-DsWqdz8M.mjs.map +1 -0
  41. package/fesm2022/{acorex-modules-organization-managment-branch.entity-kuZxLStS.mjs → acorex-modules-organization-management-branch.entity-CxxFiBPd.mjs} +49 -5
  42. package/fesm2022/acorex-modules-organization-management-branch.entity-CxxFiBPd.mjs.map +1 -0
  43. package/fesm2022/{acorex-modules-organization-managment-chart.entity-BqUE8fbV.mjs → acorex-modules-organization-management-chart.entity-Bk4WgsYr.mjs} +2 -2
  44. package/fesm2022/acorex-modules-organization-management-chart.entity-Bk4WgsYr.mjs.map +1 -0
  45. package/fesm2022/{acorex-modules-organization-managment-company.entity-DJt8tCqO.mjs → acorex-modules-organization-management-company.entity-d7GaCVei.mjs} +2 -2
  46. package/fesm2022/acorex-modules-organization-management-company.entity-d7GaCVei.mjs.map +1 -0
  47. package/fesm2022/{acorex-modules-organization-managment-department.entity-C1PxLx6p.mjs → acorex-modules-organization-management-department.entity-BxyeK3lU.mjs} +49 -5
  48. package/fesm2022/acorex-modules-organization-management-department.entity-BxyeK3lU.mjs.map +1 -0
  49. package/fesm2022/{acorex-modules-organization-managment-division.entity-DHVnrP38.mjs → acorex-modules-organization-management-division.entity-Dh54R4es.mjs} +49 -5
  50. package/fesm2022/acorex-modules-organization-management-division.entity-Dh54R4es.mjs.map +1 -0
  51. package/fesm2022/{acorex-modules-organization-managment-employee.entity-D4BSxGAW.mjs → acorex-modules-organization-management-employee.entity-PwlBjkYo.mjs} +2 -2
  52. package/fesm2022/acorex-modules-organization-management-employee.entity-PwlBjkYo.mjs.map +1 -0
  53. package/fesm2022/{acorex-modules-organization-managment-employment-type.entity-Cgbezwio.mjs → acorex-modules-organization-management-employment-type.entity-aNkt-l_e.mjs} +49 -5
  54. package/fesm2022/acorex-modules-organization-management-employment-type.entity-aNkt-l_e.mjs.map +1 -0
  55. package/fesm2022/{acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs → acorex-modules-organization-management-org-chart-configuration.page-DBc6gISy.mjs} +6 -6
  56. package/fesm2022/acorex-modules-organization-management-org-chart-configuration.page-DBc6gISy.mjs.map +1 -0
  57. package/fesm2022/{acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs → acorex-modules-organization-management-org-chart-configuration.service-QLdDEdqL.mjs} +5 -4
  58. package/fesm2022/acorex-modules-organization-management-org-chart-configuration.service-QLdDEdqL.mjs.map +1 -0
  59. package/fesm2022/acorex-modules-organization-management-org-chart.page-e-N7Ql80.mjs +890 -0
  60. package/fesm2022/acorex-modules-organization-management-org-chart.page-e-N7Ql80.mjs.map +1 -0
  61. package/fesm2022/{acorex-modules-organization-managment-position.entity-Bbb5KAkm.mjs → acorex-modules-organization-management-position.entity-B7ceEEbu.mjs} +50 -6
  62. package/fesm2022/acorex-modules-organization-management-position.entity-B7ceEEbu.mjs.map +1 -0
  63. package/fesm2022/{acorex-modules-organization-managment-setting.keys-CF6Giykz.mjs → acorex-modules-organization-management-setting.keys-CF6Giykz.mjs} +1 -1
  64. package/fesm2022/acorex-modules-organization-management-setting.keys-CF6Giykz.mjs.map +1 -0
  65. package/fesm2022/{acorex-modules-organization-managment-setting.provider-nKs53GcA.mjs → acorex-modules-organization-management-setting.provider-eLv_qnmE.mjs} +3 -3
  66. package/fesm2022/acorex-modules-organization-management-setting.provider-eLv_qnmE.mjs.map +1 -0
  67. package/fesm2022/{acorex-modules-organization-managment.mjs → acorex-modules-organization-management.mjs} +59 -22
  68. package/fesm2022/acorex-modules-organization-management.mjs.map +1 -0
  69. package/fesm2022/acorex-modules-platform-management-countries-0S6HdpYF.mjs +500 -0
  70. package/fesm2022/acorex-modules-platform-management-countries-0S6HdpYF.mjs.map +1 -0
  71. package/fesm2022/acorex-modules-platform-management.mjs +1445 -127
  72. package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
  73. package/fesm2022/acorex-modules-security-management.mjs +3 -3
  74. package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
  75. package/form-template-management/index.d.ts +0 -1
  76. package/form-template-management/lib/features/designer/index.d.ts +5 -0
  77. package/form-template-management/lib/{services → features/designer}/template.provider.d.ts +1 -1
  78. package/form-template-management/lib/features/index.d.ts +1 -0
  79. package/notification-management/lib/entities/channel/channel.types.d.ts +3 -1
  80. package/organization-management/README.md +3 -0
  81. package/organization-management/index.d.ts +4 -0
  82. package/{organization-managment → organization-management}/lib/entities/branch/branch.types.d.ts +1 -0
  83. package/{organization-managment → organization-management}/lib/entities/chart/chart.types.d.ts +10 -5
  84. package/{organization-managment → organization-management}/lib/entities/department/department.types.d.ts +1 -0
  85. package/{organization-managment → organization-management}/lib/entities/division/division.types.d.ts +1 -0
  86. package/{organization-managment → organization-management}/lib/entities/employment-type/employment-type.types.d.ts +1 -0
  87. package/{organization-managment → organization-management}/lib/entities/position/position.types.d.ts +1 -0
  88. package/organization-management/lib/features/index.d.ts +1 -0
  89. package/organization-management/lib/features/organization-chart/add-item/add-item.component.d.ts +22 -0
  90. package/organization-management/lib/features/organization-chart/index.d.ts +1 -0
  91. package/{organization-managment → organization-management}/lib/features/organization-chart/org-chart-configuration.page.d.ts +2 -2
  92. package/{organization-managment → organization-management}/lib/features/organization-chart/org-chart-configuration.service.d.ts +3 -6
  93. package/organization-management/lib/features/organization-chart/org-chart-print.service.d.ts +45 -0
  94. package/{organization-managment → organization-management}/lib/features/organization-chart/org-chart.page.d.ts +78 -7
  95. package/organization-management/lib/features/organization-chart/org-chart.service.d.ts +64 -0
  96. package/organization-management/lib/features/organization-chart/org-chart.type.d.ts +46 -0
  97. package/{organization-managment/lib/organization-managment.module.d.ts → organization-management/lib/organization-management.module.d.ts} +4 -4
  98. package/package.json +5 -5
  99. package/platform-management/lib/common/index.d.ts +1 -0
  100. package/platform-management/lib/common/regional/index.d.ts +3 -0
  101. package/platform-management/lib/common/regional/regional.types.d.ts +16 -1
  102. package/platform-management/lib/const.d.ts +12 -0
  103. package/platform-management/lib/entities/app-term/components/notify-app/notify-app.component.d.ts +1 -2
  104. package/platform-management/lib/entities/data-source/coulmn-def.widget.d.ts +67 -0
  105. package/platform-management/lib/entities/data-source/data-source.entity.d.ts +3 -0
  106. package/platform-management/lib/entities/data-source/data-source.service.d.ts +10 -0
  107. package/platform-management/lib/entities/data-source/data-source.types.d.ts +7 -0
  108. package/platform-management/lib/entities/data-source/datasource-provider.dynamic.d.ts +6 -0
  109. package/platform-management/lib/entities/data-source/index.d.ts +3 -0
  110. package/platform-management/lib/entities/index.d.ts +2 -0
  111. package/platform-management/lib/entities/promotion/components/index.d.ts +1 -0
  112. package/{notification-management/lib → platform-management/lib/entities/promotion}/components/promotion-slot/promotion-slot.component.d.ts +5 -3
  113. package/platform-management/lib/entities/promotion/index.d.ts +4 -0
  114. package/platform-management/lib/entities/promotion/promotion.entity.d.ts +3 -0
  115. package/platform-management/lib/entities/promotion/promotion.service.d.ts +10 -0
  116. package/platform-management/lib/entities/promotion/promotion.types.d.ts +15 -0
  117. package/platform-management/lib/platform-management.module.d.ts +2 -1
  118. package/fesm2022/acorex-modules-auth-acorex-modules-auth-D75igkfc.mjs.map +0 -1
  119. package/fesm2022/acorex-modules-auth-master.layout-qeAQTygT.mjs +0 -23
  120. package/fesm2022/acorex-modules-auth-master.layout-qeAQTygT.mjs.map +0 -1
  121. package/fesm2022/acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs.map +0 -1
  122. package/fesm2022/acorex-modules-organization-managment-branch.entity-kuZxLStS.mjs.map +0 -1
  123. package/fesm2022/acorex-modules-organization-managment-chart.entity-BqUE8fbV.mjs.map +0 -1
  124. package/fesm2022/acorex-modules-organization-managment-company.entity-DJt8tCqO.mjs.map +0 -1
  125. package/fesm2022/acorex-modules-organization-managment-department.entity-C1PxLx6p.mjs.map +0 -1
  126. package/fesm2022/acorex-modules-organization-managment-division.entity-DHVnrP38.mjs.map +0 -1
  127. package/fesm2022/acorex-modules-organization-managment-employee.entity-D4BSxGAW.mjs.map +0 -1
  128. package/fesm2022/acorex-modules-organization-managment-employment-type.entity-Cgbezwio.mjs.map +0 -1
  129. package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs.map +0 -1
  130. package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs.map +0 -1
  131. package/fesm2022/acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs +0 -597
  132. package/fesm2022/acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs.map +0 -1
  133. package/fesm2022/acorex-modules-organization-managment-position.entity-Bbb5KAkm.mjs.map +0 -1
  134. package/fesm2022/acorex-modules-organization-managment-setting.keys-CF6Giykz.mjs.map +0 -1
  135. package/fesm2022/acorex-modules-organization-managment-setting.provider-nKs53GcA.mjs.map +0 -1
  136. package/fesm2022/acorex-modules-organization-managment.mjs.map +0 -1
  137. package/fesm2022/acorex-modules-platform-management-countries-CuJVdPLt.mjs +0 -19
  138. package/fesm2022/acorex-modules-platform-management-countries-CuJVdPLt.mjs.map +0 -1
  139. package/organization-managment/README.md +0 -3
  140. package/organization-managment/index.d.ts +0 -3
  141. package/organization-managment/lib/features/organization-chart/org-chart-print.service.d.ts +0 -22
  142. package/organization-managment/lib/features/organization-chart/org-chart.service.d.ts +0 -19
  143. package/organization-managment/lib/features/organization-chart/org-chart.type.d.ts +0 -25
  144. /package/form-template-management/lib/{services → features/designer}/designer-connector.service.d.ts +0 -0
  145. /package/form-template-management/lib/{pages → features}/designer/designer.page.d.ts +0 -0
  146. /package/form-template-management/lib/{components → features/designer}/widgets/template/index.d.ts +0 -0
  147. /package/form-template-management/lib/{components → features/designer}/widgets/template/template-widget-designer.component.d.ts +0 -0
  148. /package/form-template-management/lib/{components → features/designer}/widgets/template/template-widget-edit.component.d.ts +0 -0
  149. /package/form-template-management/lib/{components → features/designer}/widgets/template/template-widget-view.component.d.ts +0 -0
  150. /package/form-template-management/lib/{components → features/designer}/widgets/template/template-widget.config.d.ts +0 -0
  151. /package/form-template-management/lib/{components → features/designer}/widgets/template-designer/index.d.ts +0 -0
  152. /package/form-template-management/lib/{components → features/designer}/widgets/template-designer/template-designer-widget-view.component.d.ts +0 -0
  153. /package/form-template-management/lib/{components → features/designer}/widgets/template-designer/template-designer-widget.config.d.ts +0 -0
  154. /package/form-template-management/lib/{components → features/designer}/widgets/template-picker/template-picker.component.d.ts +0 -0
  155. /package/form-template-management/lib/{components → features/designer}/widgets/template-picker/template.provider.d.ts +0 -0
  156. /package/form-template-management/lib/{workflows → features/designer/workflows}/create-template.workflow.d.ts +0 -0
  157. /package/form-template-management/lib/{workflows → features/designer/workflows}/design-template.workflow.d.ts +0 -0
  158. /package/{organization-managment → organization-management}/lib/const.d.ts +0 -0
  159. /package/{organization-managment → organization-management}/lib/entities/branch/branch.entity.d.ts +0 -0
  160. /package/{organization-managment → organization-management}/lib/entities/branch/branch.module.d.ts +0 -0
  161. /package/{organization-managment → organization-management}/lib/entities/branch/branch.service.d.ts +0 -0
  162. /package/{organization-managment → organization-management}/lib/entities/branch/index.d.ts +0 -0
  163. /package/{organization-managment → organization-management}/lib/entities/chart/chart.entity.d.ts +0 -0
  164. /package/{organization-managment → organization-management}/lib/entities/chart/chart.module.d.ts +0 -0
  165. /package/{organization-managment → organization-management}/lib/entities/chart/chart.service.d.ts +0 -0
  166. /package/{organization-managment → organization-management}/lib/entities/chart/index.d.ts +0 -0
  167. /package/{organization-managment → organization-management}/lib/entities/company/company.entity.d.ts +0 -0
  168. /package/{organization-managment → organization-management}/lib/entities/company/company.module.d.ts +0 -0
  169. /package/{organization-managment → organization-management}/lib/entities/company/company.service.d.ts +0 -0
  170. /package/{organization-managment → organization-management}/lib/entities/company/company.types.d.ts +0 -0
  171. /package/{organization-managment → organization-management}/lib/entities/company/index.d.ts +0 -0
  172. /package/{organization-managment → organization-management}/lib/entities/department/department.entity.d.ts +0 -0
  173. /package/{organization-managment → organization-management}/lib/entities/department/department.module.d.ts +0 -0
  174. /package/{organization-managment → organization-management}/lib/entities/department/department.service.d.ts +0 -0
  175. /package/{organization-managment → organization-management}/lib/entities/department/index.d.ts +0 -0
  176. /package/{organization-managment → organization-management}/lib/entities/division/division.entity.d.ts +0 -0
  177. /package/{organization-managment → organization-management}/lib/entities/division/division.module.d.ts +0 -0
  178. /package/{organization-managment → organization-management}/lib/entities/division/division.service.d.ts +0 -0
  179. /package/{organization-managment → organization-management}/lib/entities/division/index.d.ts +0 -0
  180. /package/{organization-managment → organization-management}/lib/entities/employee/employee.entity.d.ts +0 -0
  181. /package/{organization-managment → organization-management}/lib/entities/employee/employee.module.d.ts +0 -0
  182. /package/{organization-managment → organization-management}/lib/entities/employee/employee.service.d.ts +0 -0
  183. /package/{organization-managment → organization-management}/lib/entities/employee/employee.types.d.ts +0 -0
  184. /package/{organization-managment → organization-management}/lib/entities/employee/index.d.ts +0 -0
  185. /package/{organization-managment → organization-management}/lib/entities/employment-type/employment-type.entity.d.ts +0 -0
  186. /package/{organization-managment → organization-management}/lib/entities/employment-type/employment-type.module.d.ts +0 -0
  187. /package/{organization-managment → organization-management}/lib/entities/employment-type/employment-type.service.d.ts +0 -0
  188. /package/{organization-managment → organization-management}/lib/entities/employment-type/index.d.ts +0 -0
  189. /package/{organization-managment → organization-management}/lib/entities/index.d.ts +0 -0
  190. /package/{organization-managment → organization-management}/lib/entities/position/index.d.ts +0 -0
  191. /package/{organization-managment → organization-management}/lib/entities/position/position.entity.d.ts +0 -0
  192. /package/{organization-managment → organization-management}/lib/entities/position/position.module.d.ts +0 -0
  193. /package/{organization-managment → organization-management}/lib/entities/position/position.service.d.ts +0 -0
  194. /package/{organization-managment → organization-management}/lib/entity.provider.d.ts +0 -0
  195. /package/{organization-managment → organization-management}/lib/menu.provider.d.ts +0 -0
  196. /package/{organization-managment → organization-management}/lib/setting.keys.d.ts +0 -0
  197. /package/{organization-managment → organization-management}/lib/setting.provider.d.ts +0 -0
@@ -0,0 +1,890 @@
1
+ import { AXPanViewDirective } from '@acorex/cdk/pan-view';
2
+ import { AXBadgeModule } from '@acorex/components/badge';
3
+ import * as i6 from '@acorex/components/breadcrumbs';
4
+ import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
5
+ import * as i3 from '@acorex/components/button';
6
+ import { AXButtonModule } from '@acorex/components/button';
7
+ import * as i5 from '@acorex/components/decorators';
8
+ import { AXDecoratorModule } from '@acorex/components/decorators';
9
+ import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
10
+ import { AXLoadingModule } from '@acorex/components/loading';
11
+ import * as i2 from '@acorex/components/menu';
12
+ import { AXContextMenuComponent, AXMenuModule } from '@acorex/components/menu';
13
+ import * as i4 from '@acorex/core/translation';
14
+ import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
15
+ import { AXPSimplePageLayout } from '@acorex/platform/themes/default';
16
+ import { AXPLayoutThemeService, AXPThemeLayoutBlockComponent, AXPThemeLayoutHeaderTemplateComponent, AXPThemeLayoutActionsComponent, AXPThemeLayoutPageSecondaryActionsComponent, AXPThemeLayoutPagePrimaryActionsComponent, AXPThemeLayoutFooterComponent } from '@acorex/platform/themes/shared';
17
+ import * as i1 from '@angular/common';
18
+ import { CommonModule } from '@angular/common';
19
+ import * as i0 from '@angular/core';
20
+ import { inject, Injectable, signal, viewChild, NgZone, ViewContainerRef, afterNextRender, Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
21
+ import { RouterModule } from '@angular/router';
22
+ import get from 'lodash-es/get';
23
+ import { AXMOrganizationManagementDepartmentEntityService, AXMOrganizationManagementDivisionEntityService, AXMOrganizationManagementBranchEntityService, AXMOrganizationManagementEmployeeEntityService, AXMOrganizationManagementPositionEntityService, AXMOrganizationManagementChartEntityService, AXMOrganizationNodeType, AXM_ORG_CHART_NODE_TYPE_ENTITY_MAPPINGS, RootConfig, AXMOrganizationNodeTypeCategory } from './acorex-modules-organization-management.mjs';
24
+ import { A as AXMOrgChartConfigService } from './acorex-modules-organization-management-org-chart-configuration.service-QLdDEdqL.mjs';
25
+ import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
26
+ import { AXPExportService, AXPDataGenerator } from '@acorex/platform/common';
27
+ import { AXPSessionService } from '@acorex/platform/auth';
28
+ import { cloneDeep } from 'lodash-es';
29
+ import { AXPopupService } from '@acorex/components/popup';
30
+ import { AXPRegionalService } from '@acorex/modules/platform-management';
31
+ import { applyFilterArray } from '@acorex/platform/core';
32
+ import set from 'lodash-es/set';
33
+
34
+ /**
35
+ * Service for printing organization charts.
36
+ */
37
+ class AXMOrgChartPrintService {
38
+ constructor() {
39
+ this.loadingDialog = inject(AXLoadingDialogService);
40
+ this.exportService = inject(AXPExportService);
41
+ this.translationService = inject(AXTranslationService);
42
+ }
43
+ /**
44
+ * Prints the organization chart.
45
+ * @param element - The HTMLElement representing the chart to be printed.
46
+ * @returns A promise that resolves when the print process is complete.
47
+ */
48
+ async printChart(element) {
49
+ const d = this.loadingDialog.show({
50
+ title: 'Printing Organization Chart...',
51
+ mode: 'determinate',
52
+ progressColor: 'primary',
53
+ progressValue: 0,
54
+ status: '0/10',
55
+ text: 'Initializing print process...',
56
+ buttons: [
57
+ {
58
+ text: 'Cancel',
59
+ color: 'danger',
60
+ onClick: () => {
61
+ d.close();
62
+ },
63
+ },
64
+ ],
65
+ });
66
+ try {
67
+ await this.HandleStep(d, await this.translateStatements('preparing-document'), 10, '1/10');
68
+ const chartElement = element;
69
+ const { originalStyles, modifiedStyles } = this.expandChart(chartElement);
70
+ await this.HandleStep(d, await this.translateStatements('rendering-chart-image'), 25, '2.5/10');
71
+ const canvasBlob = await this.exportService.generateBlobFromElement(chartElement, {
72
+ popup: true,
73
+ filter: (node) => {
74
+ if (node instanceof Element && node.classList.contains('--toggle')) {
75
+ return false;
76
+ }
77
+ return true;
78
+ },
79
+ bgcolor: 'transparent',
80
+ scale: 2,
81
+ quality: 1,
82
+ height: Number.parseInt(modifiedStyles.modifiedHeight),
83
+ width: Number.parseInt(modifiedStyles.modifiedWidth),
84
+ });
85
+ await this.HandleStep(d, await this.translateStatements('finalizing-image-processing'), 50, '5/10');
86
+ this.restoreChartStyles(chartElement, originalStyles);
87
+ await this.HandleStep(d, await this.translateStatements('downloading-image'), 75, '7.5/10');
88
+ this.exportService.download(canvasBlob, 'org-chart.png');
89
+ await this.HandleStep(d, await this.translateStatements('process-complete'), 100, '10/10');
90
+ setTimeout(() => d.close(), 1500);
91
+ }
92
+ catch (err) {
93
+ console.error('Error capturing chart:', err);
94
+ await this.HandleStep(d, await this.translateStatements('failed-to-generate-chart-image'), 100, 'Error', 'danger');
95
+ d.close();
96
+ }
97
+ }
98
+ /**
99
+ * Expands the chart temporarily to capture the full view.
100
+ * @param chartElement - The HTMLElement representing the chart.
101
+ * @returns An object containing the original and modified styles of the chart.
102
+ */
103
+ expandChart(chartElement) {
104
+ const originalStyles = {
105
+ originalOverflow: chartElement.style.overflow,
106
+ originalWidth: chartElement.style.width,
107
+ originalHeight: chartElement.style.height,
108
+ };
109
+ const modifiedStyles = {
110
+ modifiedOverflow: 'visible',
111
+ modifiedWidth: `${chartElement.scrollWidth}px`,
112
+ modifiedHeight: `${chartElement.scrollHeight}px`,
113
+ };
114
+ chartElement.style.overflow = modifiedStyles.modifiedOverflow;
115
+ chartElement.style.width = modifiedStyles.modifiedWidth;
116
+ chartElement.style.height = modifiedStyles.modifiedHeight;
117
+ return { originalStyles, modifiedStyles };
118
+ }
119
+ /**
120
+ * Restores chart styles after capturing.
121
+ * @param chartElement - The HTMLElement representing the chart.
122
+ * @param originalStyles - The original styles to be restored.
123
+ */
124
+ restoreChartStyles(chartElement, originalStyles) {
125
+ chartElement.style.overflow = originalStyles.originalOverflow;
126
+ chartElement.style.width = originalStyles.originalWidth;
127
+ chartElement.style.height = originalStyles.originalHeight;
128
+ }
129
+ /**
130
+ * Handles updating the progress dialog step.
131
+ * @param dialog - The dialog reference.
132
+ * @param text - The text to display in the dialog.
133
+ * @param progress - The progress value to set.
134
+ * @param status - The status to display.
135
+ * @param color - The color of the progress bar.
136
+ * @returns A promise that resolves when the dialog is updated.
137
+ */
138
+ async HandleStep(dialog, text, progress, status, color = 'primary') {
139
+ return new Promise((resolve) => {
140
+ dialog.setProgressColor(color);
141
+ dialog.setProgressText(text);
142
+ dialog.setProgressValue(progress);
143
+ dialog.setProgressStatus(status);
144
+ resolve();
145
+ });
146
+ }
147
+ /**
148
+ * Translates a statement using the translation service.
149
+ * @param key - The translation key.
150
+ * @returns A promise that resolves to the translated string.
151
+ */
152
+ async translateStatements(key) {
153
+ return (await this.translationService.translateAsync(key, { scope: 'organization-management' })) + '...';
154
+ }
155
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
156
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService }); }
157
+ }
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService, decorators: [{
159
+ type: Injectable
160
+ }] });
161
+
162
+ class AXMOrgChartService {
163
+ constructor() {
164
+ this.departmentService = inject(AXMOrganizationManagementDepartmentEntityService);
165
+ this.divisionService = inject(AXMOrganizationManagementDivisionEntityService);
166
+ this.branchService = inject(AXMOrganizationManagementBranchEntityService);
167
+ this.employmentService = inject(AXMOrganizationManagementEmployeeEntityService);
168
+ this.positionService = inject(AXMOrganizationManagementPositionEntityService);
169
+ this.chartService = inject(AXMOrganizationManagementChartEntityService);
170
+ this.sessionService = inject(AXPSessionService);
171
+ this.configService = inject(AXMOrgChartConfigService);
172
+ this.popupService = inject(AXPopupService);
173
+ this.layoutService = inject(AXPLayoutThemeService);
174
+ this.regionalService = inject(AXPRegionalService);
175
+ this._rootNode = signal({ id: AXPDataGenerator.uuid(), title: "Company" });
176
+ this.rootNode = this._rootNode.asReadonly();
177
+ // The clipboard holds the node being cut or copied.
178
+ this.clipboard = signal(null);
179
+ }
180
+ //#region Load/Save
181
+ async load() {
182
+ const first = (await this.chartService.query({
183
+ skip: 0,
184
+ take: 1,
185
+ sort: [
186
+ { field: 'version', dir: 'desc' }
187
+ ]
188
+ })).items[0];
189
+ //
190
+ if (first) {
191
+ const data = first.data;
192
+ this._rootNode.set(data);
193
+ }
194
+ else {
195
+ await this.createNew();
196
+ await this.load();
197
+ }
198
+ }
199
+ async createNew() {
200
+ const tenant = this.sessionService.tenant;
201
+ const record = {
202
+ id: AXPDataGenerator.uuid(),
203
+ createAt: new Date(),
204
+ updateAt: new Date(),
205
+ version: '0.0.0',
206
+ data: {
207
+ id: AXPDataGenerator.uuid(),
208
+ title: tenant.name,
209
+ type: AXMOrganizationNodeType.Company,
210
+ entity: {
211
+ id: tenant.id,
212
+ source: 'tenant',
213
+ },
214
+ children: []
215
+ },
216
+ };
217
+ await this.chartService.insertOne({ data: record.data, version: record.version });
218
+ }
219
+ async save() {
220
+ const first = (await this.chartService.query()).items[0];
221
+ await this.chartService.updateOne(first.id, { version: first.version, data: this._rootNode(), updateAt: new Date() });
222
+ }
223
+ //#endregion
224
+ //#region Context Menu
225
+ async getAllowedAddMenuItems(node) {
226
+ const allowedTypes = await this.getAllowedChildCategoriesForParent(node);
227
+ const allowedMenuItems = [];
228
+ // Group items by category for visual breaks.
229
+ const groupedMenuItems = {
230
+ Company: [],
231
+ Location: [],
232
+ BusinessUnit: [],
233
+ Role: [],
234
+ Employee: []
235
+ };
236
+ Object.entries(AXM_ORG_CHART_NODE_TYPE_ENTITY_MAPPINGS).forEach(([entitySource, config]) => {
237
+ if (allowedTypes.includes(config.type)) {
238
+ groupedMenuItems[config.category].push({
239
+ name: 'add',
240
+ text: `${config.title}`,
241
+ icon: config.icon,
242
+ data: {
243
+ node,
244
+ config,
245
+ source: entitySource
246
+ },
247
+ });
248
+ }
249
+ });
250
+ Object.values(groupedMenuItems).forEach(group => {
251
+ if (group.length > 0) {
252
+ allowedMenuItems.push(...group);
253
+ group[group.length - 1].break = true;
254
+ }
255
+ });
256
+ if (allowedMenuItems.length > 0) {
257
+ allowedMenuItems[allowedMenuItems.length - 1].break = false;
258
+ }
259
+ return allowedMenuItems;
260
+ }
261
+ //#endregion
262
+ //#region Check Permission
263
+ async getAllowedChildCategoriesForParent(parent) {
264
+ await this.configService.load();
265
+ const types = this.configService.types;
266
+ const currentType = parent.type;
267
+ if (!parent || !currentType) {
268
+ return [];
269
+ }
270
+ const allowedTypes = new Set();
271
+ Object.entries(AXM_ORG_CHART_NODE_TYPE_ENTITY_MAPPINGS).forEach(([entitySource, config]) => {
272
+ if (this.configService.isAllowed(currentType, config.type) && types.includes(config.type)) {
273
+ allowedTypes.add(config.type);
274
+ }
275
+ });
276
+ return Array.from(allowedTypes);
277
+ }
278
+ //#endregion
279
+ //#region Remove/Cut/Copy/Past
280
+ async removeNode(id) {
281
+ this._rootNode.update((node) => this.removeNodeRecursively(node, id));
282
+ await this.save();
283
+ }
284
+ removeNodeRecursively(node, id) {
285
+ // If the node itself is the one to be deleted, return null
286
+ if (node.id === id) {
287
+ return null;
288
+ }
289
+ // Otherwise, recursively check children
290
+ if (node.children) {
291
+ node.children = node.children.filter(child => child.id !== id)
292
+ .map(child => {
293
+ return { ...child, children: this.removeNodeRecursively(child, id)?.children };
294
+ });
295
+ }
296
+ return node;
297
+ }
298
+ isPasteAvailable() {
299
+ return this.clipboard() != null && this.clipboard()?.node != null;
300
+ }
301
+ async allowPaste(target) {
302
+ if (!this.isPasteAvailable()) {
303
+ return false;
304
+ }
305
+ const allowedTypes = await this.getAllowedChildCategoriesForParent(target);
306
+ // Compare using the clipboard node's category.
307
+ return allowedTypes.includes(this.clipboard()?.node.type);
308
+ }
309
+ /**
310
+ * Cuts the node with the given id.
311
+ * The node is removed from the tree and stored in the clipboard.
312
+ * Cutting the root node is not allowed.
313
+ */
314
+ async cutNode(id) {
315
+ const tree = this._rootNode();
316
+ if (tree.id === id) {
317
+ throw new Error("Cannot cut the root node.");
318
+ }
319
+ const result = this.findNodeAndParent(tree, id);
320
+ if (!result) {
321
+ throw new Error("Node not found.");
322
+ }
323
+ // Set the clipboard signal with mode 'cut'
324
+ this.clipboard.set({ mode: 'cut', node: result.node });
325
+ // Remove the node from the tree.
326
+ const newTree = this.removeNodeRecursively(tree, id);
327
+ this._rootNode.set(newTree);
328
+ await this.save();
329
+ }
330
+ /**
331
+ * Copies the node with the given id.
332
+ * A deep clone of the node is stored in the clipboard.
333
+ */
334
+ copyNode(id) {
335
+ const tree = this._rootNode();
336
+ const result = this.findNodeAndParent(tree, id);
337
+ if (!result) {
338
+ throw new Error("Node not found.");
339
+ }
340
+ // Use lodash's cloneDeep to create a deep clone.
341
+ const copiedNode = cloneDeep(result.node);
342
+ this.clipboard.set({ mode: 'copy', node: copiedNode });
343
+ }
344
+ /**
345
+ * Pastes the node in the clipboard as a child of the node with the given parentId.
346
+ * For a cut, the node is moved; for a copy, new IDs are generated so the pasted node is unique.
347
+ */
348
+ async pasteNode(parentId) {
349
+ const clipboardValue = this.clipboard();
350
+ if (!clipboardValue) {
351
+ throw new Error("Clipboard is empty.");
352
+ }
353
+ const tree = this._rootNode();
354
+ const parentResult = this.findNodeAndParent(tree, parentId);
355
+ if (!parentResult) {
356
+ throw new Error("Parent node not found.");
357
+ }
358
+ let nodeToPaste;
359
+ if (clipboardValue.mode === 'cut') {
360
+ nodeToPaste = clipboardValue.node;
361
+ // Clear the clipboard after pasting.
362
+ this.clipboard.set(null);
363
+ }
364
+ else {
365
+ nodeToPaste = this.cloneNodeWithNewIds(clipboardValue.node);
366
+ }
367
+ const newTree = this.insertNodeRecursively(tree, parentId, nodeToPaste);
368
+ this._rootNode.set(newTree);
369
+ await this.save();
370
+ }
371
+ /**
372
+ * Recursively searches the tree for the node with the given id,
373
+ * returning both the node and its parent.
374
+ */
375
+ findNodeAndParent(node, id, parent = null) {
376
+ if (node.id === id) {
377
+ return { node, parent };
378
+ }
379
+ if (node.children) {
380
+ for (const child of node.children) {
381
+ const result = this.findNodeAndParent(child, id, node);
382
+ if (result) {
383
+ return result;
384
+ }
385
+ }
386
+ }
387
+ return null;
388
+ }
389
+ /**
390
+ * Clones a node recursively and generates new IDs for the node and its children.
391
+ */
392
+ cloneNodeWithNewIds(node) {
393
+ // First, clone the node using lodash.
394
+ const newNode = cloneDeep(node);
395
+ // Then, assign new IDs recursively.
396
+ this.assignNewIds(newNode);
397
+ return newNode;
398
+ }
399
+ /**
400
+ * Recursively assigns new unique IDs to the given node and its children.
401
+ */
402
+ assignNewIds(node) {
403
+ node.id = AXPDataGenerator.uuid();
404
+ if (node.children) {
405
+ node.children.forEach(child => this.assignNewIds(child));
406
+ }
407
+ }
408
+ /**
409
+ * Recursively traverses the tree to insert newNode as a child of the node with parentId.
410
+ */
411
+ insertNodeRecursively(node, parentId, newNode) {
412
+ if (node.id === parentId) {
413
+ const newChildren = node.children ? [...node.children, newNode] : [newNode];
414
+ return { ...node, children: newChildren };
415
+ }
416
+ if (node.children) {
417
+ return {
418
+ ...node,
419
+ children: node.children.map(child => this.insertNodeRecursively(child, parentId, newNode))
420
+ };
421
+ }
422
+ return node;
423
+ }
424
+ //#endregion
425
+ //#region Add Node
426
+ async addNode(data) {
427
+ this.layoutService.setNavigationLoading(true);
428
+ const comp = (await import('./acorex-modules-organization-management-add-item.component-DsWqdz8M.mjs')).AddItemComponent;
429
+ const node = get(data, 'node');
430
+ const type = get(data, 'config.type');
431
+ const icon = get(data, 'config.icon');
432
+ const source = get(data, 'source');
433
+ let query;
434
+ const countrySource = async (request) => {
435
+ let list = await this.regionalService.getCountries();
436
+ if (request.filter) {
437
+ list = applyFilterArray(list, [request.filter]);
438
+ }
439
+ const items = list.map((c) => ({
440
+ id: c.code,
441
+ title: c.title
442
+ }));
443
+ return {
444
+ items,
445
+ total: items.length
446
+ };
447
+ };
448
+ let valueField = 'id';
449
+ let titleField = 'title';
450
+ let subtitleField = null;
451
+ let descriptionField = 'description';
452
+ switch (type) {
453
+ case AXMOrganizationNodeType.Country:
454
+ query = countrySource;
455
+ break;
456
+ case AXMOrganizationNodeType.Department:
457
+ query = this.departmentService.query.bind(this.departmentService);
458
+ break;
459
+ case AXMOrganizationNodeType.Division:
460
+ query = this.divisionService.query.bind(this.divisionService);
461
+ break;
462
+ case AXMOrganizationNodeType.Branch:
463
+ query = this.branchService.query.bind(this.branchService);
464
+ break;
465
+ case AXMOrganizationNodeType.Position:
466
+ query = this.positionService.query.bind(this.positionService);
467
+ break;
468
+ case AXMOrganizationNodeType.Employee:
469
+ query = this.employmentService.query.bind(this.employmentService);
470
+ break;
471
+ default:
472
+ break;
473
+ }
474
+ const result = await this.popupService.open(comp, {
475
+ title: `Add ${get(data, 'config.title')}`,
476
+ size: 'md',
477
+ data: {
478
+ config: {
479
+ valueField,
480
+ titleField,
481
+ subtitleField,
482
+ descriptionField,
483
+ query: query
484
+ }
485
+ }
486
+ });
487
+ const newNode = {
488
+ id: AXPDataGenerator.uuid(),
489
+ title: result.data.title,
490
+ description: result.data.description,
491
+ subtitle: result.data.subtitle,
492
+ type: type,
493
+ parentId: node.id,
494
+ icon,
495
+ entity: {
496
+ id: result.data.id,
497
+ source: source
498
+ }
499
+ };
500
+ const tree = this._rootNode();
501
+ const newTree = this.insertNodeRecursively(tree, node.id, newNode);
502
+ this._rootNode.set(newTree);
503
+ await this.save();
504
+ this.layoutService.setNavigationLoading(false);
505
+ return result.data != null;
506
+ }
507
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
508
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService }); }
509
+ }
510
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService, decorators: [{
511
+ type: Injectable
512
+ }] });
513
+
514
+ /**
515
+ * Component for displaying and interacting with an organizational chart.
516
+ */
517
+ class AXMOrgChartPage {
518
+ constructor() {
519
+ this.layout = inject(AXPLayoutThemeService);
520
+ this.rootConfig = RootConfig;
521
+ this.nodeTemplate = viewChild.required('nodeTemplate');
522
+ this.treeContainer = viewChild.required('chart');
523
+ this.parent = viewChild.required('parent');
524
+ this.contextMenu = viewChild(AXContextMenuComponent);
525
+ this.panView = viewChild(AXPanViewDirective);
526
+ this.ngzone = inject(NgZone);
527
+ this.viewContainerRef = inject(ViewContainerRef);
528
+ this.chartPrintService = inject(AXMOrgChartPrintService);
529
+ this.chartService = inject(AXMOrgChartService);
530
+ this.NODE_STROKE_COLOR = 'rgba(var(--ax-sys-color-primary-400))';
531
+ this.LINK_STROKE_WIDTH = 1;
532
+ this.NodeTypes = AXMOrganizationNodeTypeCategory;
533
+ this.isFullscreen = signal(false);
534
+ this.panX = signal(0);
535
+ this.panY = signal(0);
536
+ this.panZoomLevel = signal(100);
537
+ this.isChartRendered = false;
538
+ this.nodeTypes = Object.entries(AXM_ORG_CHART_NODE_TYPE_ENTITY_MAPPINGS).map(c => ({
539
+ title: c[1].title,
540
+ color: c[1].color,
541
+ icon: c[1].icon,
542
+ category: c[1].category
543
+ }));
544
+ this.#initialize = afterNextRender(async () => {
545
+ this.d3 = await import('d3');
546
+ await this.chartService.load();
547
+ await this.refreshChart();
548
+ });
549
+ }
550
+ #initialize;
551
+ /**
552
+ * Zooms in the chart.
553
+ */
554
+ zoomIn() {
555
+ this.panZoomLevel.update((prev) => prev + 5);
556
+ }
557
+ /**
558
+ * Zooms out the chart.
559
+ */
560
+ zoomOut() {
561
+ this.panZoomLevel.update((prev) => prev - 5);
562
+ }
563
+ /**
564
+ * Resets the zoom level and pan position of the chart.
565
+ */
566
+ zoomReset() {
567
+ this.panView()?.resetPosition();
568
+ }
569
+ /**
570
+ * Toggles fullscreen mode for the chart.
571
+ */
572
+ toggleFullscreen() {
573
+ if (this.isFullscreen()) {
574
+ document.exitFullscreen();
575
+ this.isFullscreen.set(false);
576
+ }
577
+ else {
578
+ this.parent().nativeElement.requestFullscreen();
579
+ this.isFullscreen.set(true);
580
+ }
581
+ document.querySelector(`foreignObject[node="node-${this.chartService.rootNode().id}"]`)?.scrollIntoView({
582
+ behavior: 'smooth',
583
+ block: 'start',
584
+ inline: 'center',
585
+ });
586
+ }
587
+ /**
588
+ * Calculates the maximum depth of the organizational chart.
589
+ * @param node - The root node of the chart.
590
+ * @returns The maximum depth of the chart.
591
+ */
592
+ calculateMaxDepth(node) {
593
+ if (!node.children || node.children.length === 0 || node.isExpanded === false) {
594
+ return 1;
595
+ }
596
+ return 1 + Math.max(...node.children.map((child) => this.calculateMaxDepth(child)));
597
+ }
598
+ /**
599
+ * Calculates the maximum breadth of the organizational chart.
600
+ * @param node - The root node of the chart.
601
+ * @returns The maximum breadth of the chart.
602
+ */
603
+ calculateMaxBreadth(node) {
604
+ if (!node.children || node.children.length === 0 || node.isExpanded === false) {
605
+ return 1;
606
+ }
607
+ return node.children.reduce((acc, child) => acc + this.calculateMaxBreadth(child), 0);
608
+ }
609
+ /**
610
+ * Creates and renders the organizational chart.
611
+ * @param el - The container element for the chart.
612
+ * @param data - The root node of the organizational chart.
613
+ */
614
+ createChart(el, data) {
615
+ if (!this.d3) {
616
+ return;
617
+ }
618
+ this.ngzone.runOutsideAngular(() => {
619
+ const NODE_WIDTH_BASE = 260;
620
+ const NODE_HEIGHT_BASE = 180;
621
+ const HORIZONTAL_SPACING = 20;
622
+ const VERTICAL_SPACING = 40;
623
+ this.clearChart(el);
624
+ const newSvg = this.d3.select(el).append('svg');
625
+ const root = this.d3.hierarchy(data);
626
+ root.descendants().forEach((node) => {
627
+ if (node.data.isExpanded === false) {
628
+ node.children = undefined;
629
+ }
630
+ });
631
+ const treeLayout = this.d3
632
+ .tree()
633
+ .nodeSize([NODE_WIDTH_BASE + HORIZONTAL_SPACING, NODE_HEIGHT_BASE + VERTICAL_SPACING]);
634
+ treeLayout(root);
635
+ let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
636
+ root.descendants().forEach((d) => {
637
+ if (d.x < minX)
638
+ minX = d.x;
639
+ if (d.x > maxX)
640
+ maxX = d.x;
641
+ if (d.y < minY)
642
+ minY = d.y;
643
+ if (d.y > maxY)
644
+ maxY = d.y;
645
+ });
646
+ const CONTAINER_WIDTH = maxX - minX + NODE_WIDTH_BASE + 2 * HORIZONTAL_SPACING;
647
+ const CONTAINER_HEIGHT = maxY - minY + NODE_HEIGHT_BASE + 2 * VERTICAL_SPACING;
648
+ newSvg.attr('width', CONTAINER_WIDTH).attr('height', CONTAINER_HEIGHT);
649
+ const g = newSvg
650
+ .append('g')
651
+ .attr('transform', `translate(${-minX + NODE_WIDTH_BASE / 2 + HORIZONTAL_SPACING / 2}, ${-minY + NODE_HEIGHT_BASE / 2 + VERTICAL_SPACING / 2})`);
652
+ const link = g
653
+ .selectAll('.link')
654
+ .data(root.links())
655
+ .enter()
656
+ .append('path')
657
+ .attr('class', 'link')
658
+ .attr('d', (d) => {
659
+ const source = d.source;
660
+ const target = d.target;
661
+ return `M${source.x},${source.y}V${(source.y + target.y) / 2}H${target.x}V${target.y - 10}`;
662
+ })
663
+ .attr('fill', 'none')
664
+ .attr('stroke', this.NODE_STROKE_COLOR)
665
+ .attr('stroke-width', this.LINK_STROKE_WIDTH)
666
+ .attr('from', (d) => `node-${d.source.data.id}`)
667
+ .attr('to', (d) => `node-${d.target.data.id}`);
668
+ const node = g
669
+ .selectAll('.axp-chart-node')
670
+ .data(root.descendants())
671
+ .enter()
672
+ .append('foreignObject')
673
+ .attr('class', 'axp-chart-node')
674
+ .attr('node', (d) => `node-${d.data.id}`)
675
+ .attr('x', (d) => d.x - NODE_WIDTH_BASE / 2)
676
+ .attr('y', (d) => d.y - NODE_HEIGHT_BASE / 2 + 10)
677
+ .attr('width', NODE_WIDTH_BASE)
678
+ .attr('height', NODE_HEIGHT_BASE)
679
+ .each((d) => this.renderNodeTemplate(d.data, d.x, d.y));
680
+ this.contextMenu()?.refresh();
681
+ });
682
+ if (!this.isChartRendered) {
683
+ // document.querySelector(`foreignObject[node="node-${data.id}"] .--heading-container`)?.scrollIntoView({
684
+ // behavior: 'smooth',
685
+ // block: 'center',
686
+ // inline: 'center',
687
+ // });
688
+ this.isChartRendered = true;
689
+ this.panView()?.resetPosition();
690
+ }
691
+ }
692
+ /**
693
+ * Renders the node template for a given organizational node.
694
+ * @param data - The node data.
695
+ * @param x - The x-coordinate of the node.
696
+ * @param y - The y-coordinate of the node.
697
+ */
698
+ renderNodeTemplate(data, x, y) {
699
+ // Find the key that matches the node type
700
+ const entityKey = Object.keys(AXM_ORG_CHART_NODE_TYPE_ENTITY_MAPPINGS).find(key => {
701
+ const keyName = key.split('.').pop(); // Get the last part after splitting by '.'
702
+ return keyName === data.type; // Compare with data.type
703
+ });
704
+ if (entityKey) {
705
+ const categoryMapping = AXM_ORG_CHART_NODE_TYPE_ENTITY_MAPPINGS[entityKey];
706
+ // Add the category to the data object
707
+ set(data, 'category', categoryMapping.category);
708
+ }
709
+ const viewRef = this.viewContainerRef.createEmbeddedView(this.nodeTemplate(), {
710
+ $implicit: data,
711
+ });
712
+ const nodeElement = this.d3.select(this.treeContainer().nativeElement).select(`[node="node-${data.id}"]`);
713
+ const element = nodeElement.node();
714
+ if (element) {
715
+ element.appendChild(viewRef.rootNodes[0]);
716
+ }
717
+ }
718
+ /**
719
+ * Toggles the expansion state of a node.
720
+ * @param data - The node data.
721
+ * @param el - The HTML element representing the node.
722
+ */
723
+ toggleNode(data, el) {
724
+ data.isExpanded = data.isExpanded === undefined ? false : !data.isExpanded;
725
+ this.createChart(this.treeContainer().nativeElement, this.chartService.rootNode());
726
+ // el.scrollIntoView({
727
+ // behavior: 'smooth',
728
+ // });
729
+ }
730
+ /**
731
+ * Clears the chart from the container element.
732
+ * @param el - The container element.
733
+ */
734
+ clearChart(el) {
735
+ if (this.d3) {
736
+ this.d3.select(el).select('svg').remove();
737
+ this.viewContainerRef.clear();
738
+ }
739
+ }
740
+ async refreshChart() {
741
+ if (this.d3) {
742
+ this.createChart(this.treeContainer().nativeElement, this.chartService.rootNode());
743
+ }
744
+ }
745
+ //#region Context Menu
746
+ async handleContextMenuOnOpening(e) {
747
+ const node = get(e.targetElement, '__data__.data');
748
+ const allowedAddItems = await this.chartService.getAllowedAddMenuItems(node);
749
+ const allowDelete = node.type != AXMOrganizationNodeType.Company;
750
+ const isPasteAvailable = await this.chartService.isPasteAvailable();
751
+ const allowPaste = await this.chartService.allowPaste(node);
752
+ //
753
+ if (allowedAddItems.length) {
754
+ e.items.push({
755
+ text: 'Add New',
756
+ icon: 'fa-light fa-plus',
757
+ items: allowedAddItems,
758
+ break: allowDelete,
759
+ });
760
+ }
761
+ //
762
+ if (allowDelete) {
763
+ e.items.push({
764
+ name: 'cut',
765
+ text: 'Cut',
766
+ icon: 'fa-light fa-cut',
767
+ data: node
768
+ });
769
+ e.items.push({
770
+ name: 'copy',
771
+ text: 'Copy',
772
+ icon: 'fa-light fa-copy',
773
+ data: node,
774
+ break: !isPasteAvailable
775
+ });
776
+ }
777
+ if (isPasteAvailable) {
778
+ e.items.push({
779
+ name: 'paste',
780
+ text: 'Paste',
781
+ icon: 'fa-light fa-paste',
782
+ data: node,
783
+ break: true,
784
+ disabled: !allowPaste
785
+ });
786
+ }
787
+ //
788
+ if (allowDelete) {
789
+ e.items.push({
790
+ name: 'remove',
791
+ text: 'Remove',
792
+ color: 'danger',
793
+ icon: 'fa-light fa-trash-can',
794
+ data: node,
795
+ });
796
+ }
797
+ //
798
+ if (e.items.length == 0) {
799
+ e.canceled = true;
800
+ }
801
+ }
802
+ async handleContextMenuItemClick(e) {
803
+ //
804
+ if (e.item.name == 'add') {
805
+ if (await this.chartService.addNode(e.item.data)) {
806
+ await this.refreshChart();
807
+ }
808
+ }
809
+ //
810
+ else if (e.item.name == 'remove') {
811
+ await this.chartService.removeNode(e.item.data.id);
812
+ await this.refreshChart();
813
+ }
814
+ //
815
+ else if (e.item.name == 'copy') {
816
+ await this.chartService.copyNode(e.item.data.id);
817
+ }
818
+ else if (e.item.name == 'cut') {
819
+ await this.chartService.cutNode(e.item.data.id);
820
+ await this.refreshChart();
821
+ }
822
+ else if (e.item.name == 'paste') {
823
+ await this.chartService.pasteNode(e.item.data.id);
824
+ await this.refreshChart();
825
+ }
826
+ }
827
+ //#endregion
828
+ /**
829
+ * Prints the organizational chart.
830
+ */
831
+ async printChart() {
832
+ let [panX, panY, panZoomLevel] = [this.panX(), this.panY(), this.panZoomLevel()];
833
+ this.panX.set(0), this.panY.set(0), this.panZoomLevel.set(100);
834
+ await this.chartPrintService.printChart(this.treeContainer().nativeElement);
835
+ this.panX.set(panX), this.panY.set(panY), this.panZoomLevel.set(panZoomLevel);
836
+ }
837
+ /**
838
+ * Gets the node colors based on the provided color.
839
+ * @param color - The color to use for the node.
840
+ * @returns An object containing the node's background, text, and border colors.
841
+ */
842
+ getNodeColors(color) {
843
+ if (color.includes('surface')) {
844
+ return {
845
+ '--node-bg-color': `var(--ax-sys-color-${color})`,
846
+ '--node-text-color': `var(--ax-sys-color-on-${color})`,
847
+ '--node-border-color': `var(--ax-sys-color-border-${color})`,
848
+ };
849
+ }
850
+ return {
851
+ '--node-bg-color': `var(--ax-sys-color-${color}-surface)`,
852
+ '--node-text-color': `var(--ax-sys-color-on-${color}-surface)`,
853
+ '--node-border-color': `var(--ax-sys-color-border-${color}-surface)`,
854
+ };
855
+ }
856
+ updateVar(oldValue, newValue) {
857
+ oldValue.cat = newValue;
858
+ }
859
+ ngOnDestroy() {
860
+ this.clearChart(this.treeContainer().nativeElement);
861
+ }
862
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
863
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMOrgChartPage, isStandalone: true, selector: "ng-component", providers: [AXMOrgChartConfigService, AXMOrgChartService, AXMOrgChartPrintService], viewQueries: [{ propertyName: "nodeTemplate", first: true, predicate: ["nodeTemplate"], descendants: true, isSignal: true }, { propertyName: "treeContainer", first: true, predicate: ["chart"], descendants: true, isSignal: true }, { propertyName: "parent", first: true, predicate: ["parent"], descendants: true, isSignal: true }, { propertyName: "contextMenu", first: true, predicate: AXContextMenuComponent, descendants: true, isSignal: true }, { propertyName: "panView", first: true, predicate: AXPanViewDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<axp-layout-simple-page *translate=\"let t\">\n <axp-layout-header>\n <axp-layout-title> {{t(rootConfig.entities.chart.title) | async}} </axp-layout-title>\n\n <axp-layout-description> Clear and dynamic view of your organization's structure </axp-layout-description>\n\n <axp-layout-actions>\n <axp-layout-actions-primary> </axp-layout-actions-primary>\n\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('print') | async)!\" (onClick)=\"printChart()\">\n <ax-prefix>\n <ax-icon [icon]=\"'fa-solid fa-print'\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </axp-layout-actions-secondary>\n </axp-layout-actions>\n\n <axp-layout-breadcrumbs>\n <ax-breadcrumbs [class.ax-hidden]=\"layout.isSmall()\">\n <ng-template #divider>\n <i class=\"fa-regular fa-slash-forward\"></i>\n </ng-template>\n <ax-breadcrumbs-item> {{(t('home') | async)}} </ax-breadcrumbs-item>\n <ax-breadcrumbs-item> Organization </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n </axp-layout-header>\n\n <axp-layout-content class=\"ax-overflow-hidden\">\n <div class=\"ax-h-[calc(100vh-290px)]\" #parent id=\"parent\">\n <div #chart axPanView [(panX)]=\"panX\" [(panY)]=\"panY\" [(zoom)]=\"panZoomLevel\" [fitContent]=\"true\"\n wrapperClasses=\"h\" class=\"ax-light\"></div>\n <ax-context-menu [target]=\"'.axp-chart-node'\" [orientation]=\"'vertical'\" [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\" (onOpening)=\"handleContextMenuOnOpening($event)\">\n </ax-context-menu>\n </div>\n </axp-layout-content>\n <axp-layout-footer>\n <axp-layout-prefix>\n <div class=\"ax-flex ax-gap-1 ax-light ax-flex-wrap ax-justify-center\">\n @let v = {cat:'Company'};\n @for (item of nodeTypes; track $index) {\n <div class=\"axp-node-hint\" [style]=\"getNodeColors(item.color)\" [class.ax-ms-4]=\"v.cat!=item.category\">\n <div class=\"--badge\">\n </div>\n {{item.title}}\n </div>\n {{updateVar(v,item.category)}}\n }\n </div>\n </axp-layout-prefix>\n <axp-layout-suffix>\n <div class=\"ax-flex ax-gap-2 \">\n <ax-button (onClick)=\"zoomOut()\">\n <ax-icon class=\"fa-solid fa-minus\"> </ax-icon>\n </ax-button>\n <ax-button [text]=\"panZoomLevel()\" (onClick)=\"zoomReset()\"></ax-button>\n <ax-button (onClick)=\"zoomIn()\">\n <ax-icon class=\"fa-solid fa-add\"> </ax-icon>\n </ax-button>\n <ax-button (onClick)=\"toggleFullscreen()\">\n <ax-icon>\n <i class=\"fa-solid\" [class]=\"isFullscreen()? 'fa-compress' : 'fa-expand'\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </axp-layout-suffix>\n </axp-layout-footer>\n</axp-layout-simple-page>\n\n<ng-template #nodeTemplate let-data>\n <div>\n @switch (data.category) {\n <!-- Company -->\n @case (NodeTypes.Company) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'primary' }\"></ng-container>\n }\n <!-- Location -->\n @case (NodeTypes.Location) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'accent1' }\"></ng-container>\n }\n <!-- BusinessUnit -->\n @case (NodeTypes.BusinessUnit) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'accent2' }\"></ng-container>\n }\n <!-- Role -->\n @case (NodeTypes.Role) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'accent3' }\"></ng-container>\n }\n <!-- Employee -->\n @case (NodeTypes.Employee) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'surface' }\"></ng-container>\n }\n }\n </div>\n</ng-template>\n\n<!----------------------------------- General Node Template ----------------------------------->\n<ng-template #generalTemplate let-data=\"data\" let-color=\"color\">\n <div #node class=\"--node-container\" [style]=\"getNodeColors(color)\">\n <div class=\"--container\">\n <div class=\"--heading-container\">\n <div class=\"--content\">\n <div class=\"--icon\">\n <i class=\"fa-light fa-xl fa-fw\" [class]=\"data.icon\"></i>\n </div>\n <div class=\"--titles\">\n <span class=\"--title\">{{data.title}}</span>\n @if(data.subtitle)\n {\n <span class=\"--sub-title\">{{data.subtitle}}</span>\n }\n </div>\n @if(data?.children?.length){\n <div class=\"--badge\">\n <span>{{data?.children?.length ?? 0}}</span>\n </div>\n }\n </div>\n </div>\n @if(data.description)\n {\n <div class=\"--body-container\">\n <div class=\"--description\" [class.ax-pb-3]=\"data.children && data.children.length > 0\">\n {{data.description}}\n </div>\n </div>\n }\n @if(data.children && data.children.length > 0){\n <div class=\"--toggle\">\n <ax-button class=\"ax-xs ax-rounded-sm\" (onClick)=\"toggleNode(data,node)\">\n <ax-icon icon=\"fa-solid\" [class]=\"data.isExpanded === false ? 'fa-chevron-down' : 'fa-chevron-up'\"></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </div>\n</ng-template>", styles: [".axp-node-hint{display:flex;align-items:center;justify-content:center;gap:.25rem;font-size:.75rem;line-height:1rem}.axp-node-hint>div.--badge{background-color:rgba(var(--node-bg-color));color:rgba(var(--node-text-color));display:flex;width:.75rem;height:.75rem;align-items:center;justify-content:center;border-radius:.125rem}.axp-chart-node{display:flex;align-items:center;justify-content:center}.axp-chart-node .--node-container{position:relative;cursor:pointer;--node-bg-color: var(--ax-sys-color-primary-surface);--node-text-color: var(--ax-sys-color-on-primary-surface);--node-border-color: var(--ax-sys-color-border-primary-surface)}.axp-chart-node .--node-container .--container{display:flex;max-height:100%;width:100%;flex-direction:column;overflow:hidden;border-radius:.375rem;border-width:1px;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);border-color:rgba(var(--node-border-color))}.axp-chart-node .--node-container .--container .--heading-container{background-color:rgba(var(--node-bg-color));color:rgba(var(--node-text-color));width:100%;padding:.5rem .75rem}.axp-chart-node .--node-container .--container .--heading-container .--content{display:flex;width:100%;align-items:center;justify-content:center;gap:.5rem;overflow:hidden}.axp-chart-node .--node-container .--container .--heading-container .--content .--icon{background-color:color-mix(in srgb,rgba(var(--node-bg-color),1) 85%,black);display:flex;width:2.75rem;height:2.75rem;flex:none;align-items:center;justify-content:center;border-radius:.5rem}.axp-chart-node .--node-container .--container .--heading-container .--content .--badge{background-color:color-mix(in srgb,rgba(var(--node-bg-color),1) 85%,black);display:flex;width:1.5rem;height:1.5rem;flex:none;align-items:center;justify-content:center;border-radius:.375rem;line-height:1}.axp-chart-node .--node-container .--container .--heading-container .--content .--badge>span{font-size:.75rem;line-height:1rem}.axp-chart-node .--node-container .--container .--heading-container .--content .--titles{display:flex;width:100%;flex:1 1 0%;flex-direction:column;gap:.25rem;overflow:hidden}.axp-chart-node .--node-container .--container .--heading-container .--content .--titles .--title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1.125rem;line-height:1.75rem;font-weight:600;line-height:1}.axp-chart-node .--node-container .--container .--heading-container .--content .--titles .--sub-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.75rem;line-height:1rem;opacity:.85}.axp-chart-node .--node-container .--container .--body-container{width:100%;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lightest-surface),var(--tw-bg-opacity, 1));padding:.5rem .75rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-lightest-surface),var(--tw-text-opacity, 1))}.axp-chart-node .--node-container .--container .--body-container .--description{text-align:center;font-size:.875rem;line-height:1rem;opacity:.85}.axp-chart-node .--node-container .--container .--toggle{position:absolute;left:0;right:0;bottom:-.75rem;display:flex;width:100%;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none;align-items:center;justify-content:center}#parent:fullscreen{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: AXPSimplePageLayout, selector: "axp-layout-simple-page" }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-layout-content, axp-layout-header-container, axp-layout-side-container, axp-layout-sections, axp-layout-section-container, axp-layout-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title, axp-layout-nav-button, axp-layout-description, axp-layout-toolbar, axp-layout-title-bar, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "component", type: AXPThemeLayoutHeaderTemplateComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPThemeLayoutActionsComponent, selector: "axp-layout-actions" }, { kind: "component", type: AXPThemeLayoutPageSecondaryActionsComponent, selector: "axp-layout-actions-secondary" }, { kind: "component", type: AXPThemeLayoutPagePrimaryActionsComponent, selector: "axp-layout-actions-primary" }, { kind: "component", type: AXPThemeLayoutFooterComponent, selector: "axp-layout-footer" }, { kind: "ngmodule", type: AXMenuModule }, { kind: "component", type: i2.AXContextMenuComponent, selector: "ax-context-menu", inputs: ["orientation", "openOn", "closeOn", "items", "target"], outputs: ["onItemClick", "onOpening"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i4.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i5.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i5.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: "directive", type: AXPanViewDirective, selector: "[axPanView]", inputs: ["minZoom", "maxZoom", "zoomStep", "fitContent", "disablePan", "disableZoom", "wrapperClasses", "panX", "panY", "zoom"], outputs: ["panXChange", "panYChange", "zoomChange", "positionChange"], exportAs: ["axPanView"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "component", type: i6.AXBreadCrumbsComponent, selector: "ax-breadcrumbs" }, { kind: "component", type: i6.AXBreadCrumbsItemComponent, selector: "ax-breadcrumbs-item", inputs: ["disabled", "active"] }, { kind: "ngmodule", type: AXBadgeModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
864
+ }
865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPage, decorators: [{
866
+ type: Component,
867
+ args: [{ imports: [
868
+ CommonModule,
869
+ RouterModule,
870
+ AXPSimplePageLayout,
871
+ AXPThemeLayoutBlockComponent,
872
+ AXPThemeLayoutHeaderTemplateComponent,
873
+ AXPThemeLayoutActionsComponent,
874
+ AXPThemeLayoutPageSecondaryActionsComponent,
875
+ AXPThemeLayoutPagePrimaryActionsComponent,
876
+ AXPThemeLayoutFooterComponent,
877
+ AXMenuModule,
878
+ AXButtonModule,
879
+ AXDropdownButtonModule,
880
+ AXTranslationModule,
881
+ AXDecoratorModule,
882
+ AXPanViewDirective,
883
+ AXLoadingModule,
884
+ AXBreadcrumbsModule,
885
+ AXBadgeModule,
886
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [AXMOrgChartConfigService, AXMOrgChartService, AXMOrgChartPrintService], template: "<axp-layout-simple-page *translate=\"let t\">\n <axp-layout-header>\n <axp-layout-title> {{t(rootConfig.entities.chart.title) | async}} </axp-layout-title>\n\n <axp-layout-description> Clear and dynamic view of your organization's structure </axp-layout-description>\n\n <axp-layout-actions>\n <axp-layout-actions-primary> </axp-layout-actions-primary>\n\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('print') | async)!\" (onClick)=\"printChart()\">\n <ax-prefix>\n <ax-icon [icon]=\"'fa-solid fa-print'\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </axp-layout-actions-secondary>\n </axp-layout-actions>\n\n <axp-layout-breadcrumbs>\n <ax-breadcrumbs [class.ax-hidden]=\"layout.isSmall()\">\n <ng-template #divider>\n <i class=\"fa-regular fa-slash-forward\"></i>\n </ng-template>\n <ax-breadcrumbs-item> {{(t('home') | async)}} </ax-breadcrumbs-item>\n <ax-breadcrumbs-item> Organization </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n </axp-layout-header>\n\n <axp-layout-content class=\"ax-overflow-hidden\">\n <div class=\"ax-h-[calc(100vh-290px)]\" #parent id=\"parent\">\n <div #chart axPanView [(panX)]=\"panX\" [(panY)]=\"panY\" [(zoom)]=\"panZoomLevel\" [fitContent]=\"true\"\n wrapperClasses=\"h\" class=\"ax-light\"></div>\n <ax-context-menu [target]=\"'.axp-chart-node'\" [orientation]=\"'vertical'\" [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\" (onOpening)=\"handleContextMenuOnOpening($event)\">\n </ax-context-menu>\n </div>\n </axp-layout-content>\n <axp-layout-footer>\n <axp-layout-prefix>\n <div class=\"ax-flex ax-gap-1 ax-light ax-flex-wrap ax-justify-center\">\n @let v = {cat:'Company'};\n @for (item of nodeTypes; track $index) {\n <div class=\"axp-node-hint\" [style]=\"getNodeColors(item.color)\" [class.ax-ms-4]=\"v.cat!=item.category\">\n <div class=\"--badge\">\n </div>\n {{item.title}}\n </div>\n {{updateVar(v,item.category)}}\n }\n </div>\n </axp-layout-prefix>\n <axp-layout-suffix>\n <div class=\"ax-flex ax-gap-2 \">\n <ax-button (onClick)=\"zoomOut()\">\n <ax-icon class=\"fa-solid fa-minus\"> </ax-icon>\n </ax-button>\n <ax-button [text]=\"panZoomLevel()\" (onClick)=\"zoomReset()\"></ax-button>\n <ax-button (onClick)=\"zoomIn()\">\n <ax-icon class=\"fa-solid fa-add\"> </ax-icon>\n </ax-button>\n <ax-button (onClick)=\"toggleFullscreen()\">\n <ax-icon>\n <i class=\"fa-solid\" [class]=\"isFullscreen()? 'fa-compress' : 'fa-expand'\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </axp-layout-suffix>\n </axp-layout-footer>\n</axp-layout-simple-page>\n\n<ng-template #nodeTemplate let-data>\n <div>\n @switch (data.category) {\n <!-- Company -->\n @case (NodeTypes.Company) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'primary' }\"></ng-container>\n }\n <!-- Location -->\n @case (NodeTypes.Location) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'accent1' }\"></ng-container>\n }\n <!-- BusinessUnit -->\n @case (NodeTypes.BusinessUnit) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'accent2' }\"></ng-container>\n }\n <!-- Role -->\n @case (NodeTypes.Role) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'accent3' }\"></ng-container>\n }\n <!-- Employee -->\n @case (NodeTypes.Employee) {\n <ng-container *ngTemplateOutlet=\"generalTemplate; context: { data,color:'surface' }\"></ng-container>\n }\n }\n </div>\n</ng-template>\n\n<!----------------------------------- General Node Template ----------------------------------->\n<ng-template #generalTemplate let-data=\"data\" let-color=\"color\">\n <div #node class=\"--node-container\" [style]=\"getNodeColors(color)\">\n <div class=\"--container\">\n <div class=\"--heading-container\">\n <div class=\"--content\">\n <div class=\"--icon\">\n <i class=\"fa-light fa-xl fa-fw\" [class]=\"data.icon\"></i>\n </div>\n <div class=\"--titles\">\n <span class=\"--title\">{{data.title}}</span>\n @if(data.subtitle)\n {\n <span class=\"--sub-title\">{{data.subtitle}}</span>\n }\n </div>\n @if(data?.children?.length){\n <div class=\"--badge\">\n <span>{{data?.children?.length ?? 0}}</span>\n </div>\n }\n </div>\n </div>\n @if(data.description)\n {\n <div class=\"--body-container\">\n <div class=\"--description\" [class.ax-pb-3]=\"data.children && data.children.length > 0\">\n {{data.description}}\n </div>\n </div>\n }\n @if(data.children && data.children.length > 0){\n <div class=\"--toggle\">\n <ax-button class=\"ax-xs ax-rounded-sm\" (onClick)=\"toggleNode(data,node)\">\n <ax-icon icon=\"fa-solid\" [class]=\"data.isExpanded === false ? 'fa-chevron-down' : 'fa-chevron-up'\"></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </div>\n</ng-template>", styles: [".axp-node-hint{display:flex;align-items:center;justify-content:center;gap:.25rem;font-size:.75rem;line-height:1rem}.axp-node-hint>div.--badge{background-color:rgba(var(--node-bg-color));color:rgba(var(--node-text-color));display:flex;width:.75rem;height:.75rem;align-items:center;justify-content:center;border-radius:.125rem}.axp-chart-node{display:flex;align-items:center;justify-content:center}.axp-chart-node .--node-container{position:relative;cursor:pointer;--node-bg-color: var(--ax-sys-color-primary-surface);--node-text-color: var(--ax-sys-color-on-primary-surface);--node-border-color: var(--ax-sys-color-border-primary-surface)}.axp-chart-node .--node-container .--container{display:flex;max-height:100%;width:100%;flex-direction:column;overflow:hidden;border-radius:.375rem;border-width:1px;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);border-color:rgba(var(--node-border-color))}.axp-chart-node .--node-container .--container .--heading-container{background-color:rgba(var(--node-bg-color));color:rgba(var(--node-text-color));width:100%;padding:.5rem .75rem}.axp-chart-node .--node-container .--container .--heading-container .--content{display:flex;width:100%;align-items:center;justify-content:center;gap:.5rem;overflow:hidden}.axp-chart-node .--node-container .--container .--heading-container .--content .--icon{background-color:color-mix(in srgb,rgba(var(--node-bg-color),1) 85%,black);display:flex;width:2.75rem;height:2.75rem;flex:none;align-items:center;justify-content:center;border-radius:.5rem}.axp-chart-node .--node-container .--container .--heading-container .--content .--badge{background-color:color-mix(in srgb,rgba(var(--node-bg-color),1) 85%,black);display:flex;width:1.5rem;height:1.5rem;flex:none;align-items:center;justify-content:center;border-radius:.375rem;line-height:1}.axp-chart-node .--node-container .--container .--heading-container .--content .--badge>span{font-size:.75rem;line-height:1rem}.axp-chart-node .--node-container .--container .--heading-container .--content .--titles{display:flex;width:100%;flex:1 1 0%;flex-direction:column;gap:.25rem;overflow:hidden}.axp-chart-node .--node-container .--container .--heading-container .--content .--titles .--title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1.125rem;line-height:1.75rem;font-weight:600;line-height:1}.axp-chart-node .--node-container .--container .--heading-container .--content .--titles .--sub-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.75rem;line-height:1rem;opacity:.85}.axp-chart-node .--node-container .--container .--body-container{width:100%;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lightest-surface),var(--tw-bg-opacity, 1));padding:.5rem .75rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-lightest-surface),var(--tw-text-opacity, 1))}.axp-chart-node .--node-container .--container .--body-container .--description{text-align:center;font-size:.875rem;line-height:1rem;opacity:.85}.axp-chart-node .--node-container .--container .--toggle{position:absolute;left:0;right:0;bottom:-.75rem;display:flex;width:100%;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none;align-items:center;justify-content:center}#parent:fullscreen{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}\n"] }]
887
+ }] });
888
+
889
+ export { AXMOrgChartPage };
890
+ //# sourceMappingURL=acorex-modules-organization-management-org-chart.page-e-N7Ql80.mjs.map