@acorex/modules 19.2.4 → 19.2.6

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 (100) hide show
  1. package/auth/lib/store/auth.effects.d.ts +2 -2
  2. package/fesm2022/{acorex-modules-application-management-module-designer.component-uLfQYtpy.mjs → acorex-modules-application-management-module-designer.component-DPJ4qpK3.mjs} +5 -5
  3. package/fesm2022/acorex-modules-application-management-module-designer.component-DPJ4qpK3.mjs.map +1 -0
  4. package/fesm2022/acorex-modules-application-management.mjs +3 -3
  5. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  6. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-C-qPiQhk.mjs → acorex-modules-auth-acorex-modules-auth-D75igkfc.mjs} +25 -25
  7. package/fesm2022/acorex-modules-auth-acorex-modules-auth-D75igkfc.mjs.map +1 -0
  8. package/fesm2022/acorex-modules-auth-app-chooser.component-BZb8n5Ag.mjs +64 -0
  9. package/fesm2022/acorex-modules-auth-app-chooser.component-BZb8n5Ag.mjs.map +1 -0
  10. package/fesm2022/{acorex-modules-auth-login.module-nqFBpUaE.mjs → acorex-modules-auth-login.module-DAtJYcHZ.mjs} +4 -4
  11. package/fesm2022/{acorex-modules-auth-login.module-nqFBpUaE.mjs.map → acorex-modules-auth-login.module-DAtJYcHZ.mjs.map} +1 -1
  12. package/fesm2022/acorex-modules-auth-master.layout-qeAQTygT.mjs +23 -0
  13. package/fesm2022/acorex-modules-auth-master.layout-qeAQTygT.mjs.map +1 -0
  14. package/fesm2022/{acorex-modules-auth-password.component-DZ6TiNI-.mjs → acorex-modules-auth-password.component-20Ofs9FL.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-auth-password.component-DZ6TiNI-.mjs.map → acorex-modules-auth-password.component-20Ofs9FL.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-auth-password.component-3t_WqB4c.mjs → acorex-modules-auth-password.component-CRvI9sIa.mjs} +4 -4
  17. package/fesm2022/acorex-modules-auth-password.component-CRvI9sIa.mjs.map +1 -0
  18. package/fesm2022/{acorex-modules-auth-routes-nnrAlvkD.mjs → acorex-modules-auth-routes-BDED-qaZ.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-auth-routes-nnrAlvkD.mjs.map → acorex-modules-auth-routes-BDED-qaZ.mjs.map} +1 -1
  20. package/fesm2022/acorex-modules-auth-tenant-chooser.component-CKsbiOUX.mjs +83 -0
  21. package/fesm2022/acorex-modules-auth-tenant-chooser.component-CKsbiOUX.mjs.map +1 -0
  22. package/fesm2022/{acorex-modules-auth-two-factor.module-DWtEYnHW.mjs → acorex-modules-auth-two-factor.module-B0C2aBWh.mjs} +2 -2
  23. package/fesm2022/{acorex-modules-auth-two-factor.module-DWtEYnHW.mjs.map → acorex-modules-auth-two-factor.module-B0C2aBWh.mjs.map} +1 -1
  24. package/fesm2022/acorex-modules-auth.mjs +1 -1
  25. package/fesm2022/acorex-modules-conversation.mjs +10 -10
  26. package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
  27. package/fesm2022/acorex-modules-form-template-management-template-picker.component-xiRKc4FF.mjs +126 -0
  28. package/fesm2022/acorex-modules-form-template-management-template-picker.component-xiRKc4FF.mjs.map +1 -0
  29. package/fesm2022/acorex-modules-form-template-management.mjs +1 -1
  30. package/fesm2022/acorex-modules-notification-management.mjs +417 -4
  31. package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
  32. package/fesm2022/{acorex-modules-organization-managment-employee.entity-oo5Tyyp2.mjs → acorex-modules-organization-managment-employee.entity-D4BSxGAW.mjs} +40 -2
  33. package/fesm2022/acorex-modules-organization-managment-employee.entity-D4BSxGAW.mjs.map +1 -0
  34. package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs +92 -0
  35. package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs.map +1 -0
  36. package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs +145 -0
  37. package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs.map +1 -0
  38. package/fesm2022/acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs +597 -0
  39. package/fesm2022/acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs.map +1 -0
  40. package/fesm2022/acorex-modules-organization-managment-setting.keys-CF6Giykz.mjs +22 -0
  41. package/fesm2022/acorex-modules-organization-managment-setting.keys-CF6Giykz.mjs.map +1 -0
  42. package/fesm2022/{acorex-modules-organization-managment-setting.provider-BtkaTjLS.mjs → acorex-modules-organization-managment-setting.provider-nKs53GcA.mjs} +2 -20
  43. package/fesm2022/acorex-modules-organization-managment-setting.provider-nKs53GcA.mjs.map +1 -0
  44. package/fesm2022/acorex-modules-organization-managment.mjs +44 -27
  45. package/fesm2022/acorex-modules-organization-managment.mjs.map +1 -1
  46. package/fesm2022/acorex-modules-platform-management.mjs +404 -145
  47. package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
  48. package/fesm2022/acorex-modules-security-management.mjs +12 -1
  49. package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
  50. package/notification-management/lib/components/promotion-slot/promotion-slot.component.d.ts +11 -0
  51. package/notification-management/lib/entities/channel/channel.types.d.ts +11 -1
  52. package/organization-managment/lib/const.d.ts +12 -0
  53. package/organization-managment/lib/features/organization-chart/org-chart-configuration.page.d.ts +141 -0
  54. package/organization-managment/lib/features/organization-chart/org-chart-configuration.service.d.ts +24 -0
  55. package/organization-managment/lib/features/organization-chart/org-chart-print.service.d.ts +22 -0
  56. package/organization-managment/lib/features/organization-chart/org-chart.page.d.ts +162 -0
  57. package/organization-managment/lib/features/organization-chart/org-chart.service.d.ts +19 -0
  58. package/organization-managment/lib/features/organization-chart/org-chart.type.d.ts +25 -0
  59. package/organization-managment/lib/setting.keys.d.ts +2 -1
  60. package/package.json +5 -5
  61. package/platform-management/index.d.ts +1 -0
  62. package/platform-management/lib/const.d.ts +2 -0
  63. package/platform-management/lib/entities/app-term/app-term.types.d.ts +12 -2
  64. package/platform-management/lib/entities/app-term/components/notify-app/notify-app.component.d.ts +16 -0
  65. package/platform-management/lib/entities/app-term/index.d.ts +2 -0
  66. package/platform-management/lib/entities/app-term/pages/index.d.ts +1 -0
  67. package/platform-management/lib/entities/app-term/pages/list/list-terms.component.d.ts +20 -0
  68. package/platform-management/lib/entities/app-term/workflows/index.d.ts +1 -0
  69. package/platform-management/lib/entities/app-term/workflows/notify-new-term.workflow.d.ts +15 -0
  70. package/platform-management/lib/entities/app-version/app-version.types.d.ts +7 -0
  71. package/platform-management/lib/entities/app-version/components/index.d.ts +2 -0
  72. package/platform-management/lib/entities/app-version/components/list-versions/list-version.component.d.ts +13 -0
  73. package/platform-management/lib/entities/app-version/{workflow/test/test.component.d.ts → components/notify-app/notify-app.component.d.ts} +3 -3
  74. package/platform-management/lib/entities/app-version/components/slots/app-version-slot.component.d.ts +12 -0
  75. package/platform-management/lib/entities/app-version/index.d.ts +2 -1
  76. package/platform-management/lib/entities/app-version/{workflow → workflows}/index.d.ts +0 -1
  77. package/platform-management/lib/entities/check-version.d.ts +12 -0
  78. package/platform-management/lib/entities/index.d.ts +1 -0
  79. package/platform-management/lib/platform-management.module.d.ts +2 -2
  80. package/security-management/index.d.ts +1 -0
  81. package/security-management/lib/menu.keys.d.ts +5 -0
  82. package/fesm2022/acorex-modules-application-management-module-designer.component-uLfQYtpy.mjs.map +0 -1
  83. package/fesm2022/acorex-modules-auth-acorex-modules-auth-C-qPiQhk.mjs.map +0 -1
  84. package/fesm2022/acorex-modules-auth-app-chooser.component-j3JgxtBC.mjs +0 -64
  85. package/fesm2022/acorex-modules-auth-app-chooser.component-j3JgxtBC.mjs.map +0 -1
  86. package/fesm2022/acorex-modules-auth-master.layout-C9eKuJgU.mjs +0 -23
  87. package/fesm2022/acorex-modules-auth-master.layout-C9eKuJgU.mjs.map +0 -1
  88. package/fesm2022/acorex-modules-auth-password.component-3t_WqB4c.mjs.map +0 -1
  89. package/fesm2022/acorex-modules-auth-tenant-chooser.component-Cx3fK__H.mjs +0 -83
  90. package/fesm2022/acorex-modules-auth-tenant-chooser.component-Cx3fK__H.mjs.map +0 -1
  91. package/fesm2022/acorex-modules-form-template-management-template-picker.component-DW0iMqAA.mjs +0 -126
  92. package/fesm2022/acorex-modules-form-template-management-template-picker.component-DW0iMqAA.mjs.map +0 -1
  93. package/fesm2022/acorex-modules-organization-managment-employee.entity-oo5Tyyp2.mjs.map +0 -1
  94. package/fesm2022/acorex-modules-organization-managment-org-chart.page-fOxjGb8i.mjs +0 -297
  95. package/fesm2022/acorex-modules-organization-managment-org-chart.page-fOxjGb8i.mjs.map +0 -1
  96. package/fesm2022/acorex-modules-organization-managment-setting.provider-BtkaTjLS.mjs.map +0 -1
  97. package/organization-managment/lib/pages/org-chart/org-chart.page.d.ts +0 -28
  98. package/organization-managment/lib/pages/org-chart/org-chart.type.d.ts +0 -9
  99. package/platform-management/lib/entities/app-version/check-version.d.ts +0 -11
  100. /package/platform-management/lib/entities/app-version/{workflow → workflows}/change-log.workflow.d.ts +0 -0
@@ -0,0 +1,597 @@
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 } 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, viewChild, NgZone, ViewContainerRef, signal, afterNextRender, Component, ChangeDetectionStrategy } from '@angular/core';
21
+ import { RouterModule } from '@angular/router';
22
+ import { AXMOrganizationManagementCompanyEntityService, AXMOrganizationManagementDepartmentEntityService, AXMOrganizationManagementEmployeeEntityService, AXMOrganizationManagementPositionEntityService, AXMOrganizationManagementChartEntityService, RootConfig } from './acorex-modules-organization-managment.mjs';
23
+ import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
24
+ import { AXPExportService, AXPDataGenerator } from '@acorex/platform/common';
25
+ import { AXPSessionService } from '@acorex/platform/auth';
26
+ import { A as AXMOrgChartConfigService } from './acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs';
27
+
28
+ class AXMOrgChartPrintService {
29
+ constructor() {
30
+ this.loadingDialog = inject(AXLoadingDialogService);
31
+ this.exportService = inject(AXPExportService);
32
+ this.translationService = inject(AXTranslationService);
33
+ }
34
+ async printChart(element) {
35
+ const d = this.loadingDialog.show({
36
+ title: 'Printing Organization Chart...',
37
+ mode: 'determinate',
38
+ progressColor: 'primary',
39
+ progressValue: 0,
40
+ status: '0/10',
41
+ text: 'Initializing print process...',
42
+ buttons: [
43
+ {
44
+ text: 'Cancel',
45
+ color: 'danger',
46
+ onClick: () => {
47
+ d.close();
48
+ },
49
+ },
50
+ ],
51
+ });
52
+ try {
53
+ // Step 1: Start Process
54
+ await this.HandleStep(d, await this.translateStatements('preparing-document'), 10, '1/10');
55
+ const chartElement = element;
56
+ const { originalStyles, modifiedStyles } = this.expandChart(chartElement);
57
+ // Step 2: Render the Chart
58
+ await this.HandleStep(d, await this.translateStatements('rendering-chart-image'), 25, '2.5/10');
59
+ const canvasBlob = await this.exportService.generateBlobFromElement(chartElement, {
60
+ popup: true,
61
+ bgcolor: 'transparent',
62
+ scale: 2,
63
+ quality: 1,
64
+ height: Number.parseInt(modifiedStyles.modifiedHeight),
65
+ width: Number.parseInt(modifiedStyles.modifiedWidth),
66
+ });
67
+ // Step 3: Finalizing Image Processing
68
+ await this.HandleStep(d, await this.translateStatements('finalizing-image-processing'), 50, '5/10');
69
+ this.restoreChartStyles(chartElement, originalStyles);
70
+ // Step 4: Download Image
71
+ await this.HandleStep(d, await this.translateStatements('downloading-image'), 75, '7.5/10');
72
+ this.exportService.download(canvasBlob, 'org-chart.png');
73
+ // Step 5: Completion
74
+ await this.HandleStep(d, await this.translateStatements('process-complete'), 100, '10/10');
75
+ // Close the dialog after a short delay
76
+ setTimeout(() => d.close(), 1500);
77
+ }
78
+ catch (err) {
79
+ console.error('Error capturing chart:', err);
80
+ await this.HandleStep(d, await this.translateStatements('failed-to-generate-chart-image'), 100, 'Error', 'danger');
81
+ d.close();
82
+ }
83
+ }
84
+ /**
85
+ * Expands the chart temporarily to capture the full view.
86
+ */
87
+ expandChart(chartElement) {
88
+ const originalStyles = {
89
+ originalOverflow: chartElement.style.overflow,
90
+ originalWidth: chartElement.style.width,
91
+ originalHeight: chartElement.style.height,
92
+ };
93
+ const modifiedStyles = {
94
+ modifiedOverflow: 'visible',
95
+ modifiedWidth: `${chartElement.scrollWidth}px`,
96
+ modifiedHeight: `${chartElement.scrollHeight}px`,
97
+ };
98
+ chartElement.style.overflow = modifiedStyles.modifiedOverflow;
99
+ chartElement.style.width = modifiedStyles.modifiedWidth;
100
+ chartElement.style.height = modifiedStyles.modifiedHeight;
101
+ return { originalStyles, modifiedStyles };
102
+ }
103
+ /**
104
+ * Restores chart styles after capturing.
105
+ */
106
+ restoreChartStyles(chartElement, originalStyles) {
107
+ chartElement.style.overflow = originalStyles.originalOverflow;
108
+ chartElement.style.width = originalStyles.originalWidth;
109
+ chartElement.style.height = originalStyles.originalHeight;
110
+ }
111
+ /**
112
+ * Handles updating the progress dialog step.
113
+ */
114
+ async HandleStep(dialog, text, progress, status, color = 'primary') {
115
+ return new Promise((resolve) => {
116
+ dialog.setProgressColor(color);
117
+ dialog.setProgressText(text);
118
+ dialog.setProgressValue(progress);
119
+ dialog.setProgressStatus(status);
120
+ resolve();
121
+ });
122
+ }
123
+ async translateStatements(key) {
124
+ return (await this.translationService.translateAsync(key, { scope: 'organization-management' })) + '...';
125
+ }
126
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
127
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService }); }
128
+ }
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService, decorators: [{
130
+ type: Injectable
131
+ }] });
132
+
133
+ class AXMOrgChartService {
134
+ constructor() {
135
+ this.companyService = inject(AXMOrganizationManagementCompanyEntityService);
136
+ this.departmentService = inject(AXMOrganizationManagementDepartmentEntityService);
137
+ this.employmentService = inject(AXMOrganizationManagementEmployeeEntityService);
138
+ this.positionService = inject(AXMOrganizationManagementPositionEntityService);
139
+ this.chartService = inject(AXMOrganizationManagementChartEntityService);
140
+ this.sessionService = inject(AXPSessionService);
141
+ this.configService = inject(AXMOrgChartConfigService);
142
+ }
143
+ async load(id) {
144
+ if (id) {
145
+ const item = await this.chartService.getOne(id);
146
+ return item;
147
+ }
148
+ else {
149
+ return await this.createNew();
150
+ }
151
+ }
152
+ async createNew() {
153
+ const tenant = this.sessionService.tenant;
154
+ return {
155
+ //createAt: new Date(),
156
+ //updateAt: new Date(),
157
+ version: '0.0.0',
158
+ nodes: [{
159
+ id: AXPDataGenerator.uuid(),
160
+ title: tenant.name,
161
+ entity: {
162
+ id: tenant.id,
163
+ source: 'tenant',
164
+ },
165
+ }],
166
+ };
167
+ }
168
+ async save(chart) {
169
+ if (chart.id) {
170
+ await this.chartService.updateOne(chart.id, { version: chart.version, nodes: chart.nodes, updateAt: new Date() });
171
+ }
172
+ else {
173
+ await this.chartService.insertOne(chart);
174
+ }
175
+ }
176
+ getContextMenu() {
177
+ const types = this.configService.types;
178
+ return [];
179
+ }
180
+ async listItemType(type, event) {
181
+ switch (type.text.toLowerCase()) {
182
+ case 'company':
183
+ return await this.companyService.query({
184
+ skip: event.skip,
185
+ take: event.take,
186
+ filter: event.filter,
187
+ sort: event.sort,
188
+ });
189
+ case 'country':
190
+ break;
191
+ case 'city':
192
+ break;
193
+ case 'department':
194
+ return (await this.departmentService.query({
195
+ skip: event.skip,
196
+ take: event.take,
197
+ filter: event.filter,
198
+ sort: event.sort,
199
+ }));
200
+ case 'position':
201
+ return (await this.positionService.query({
202
+ skip: event.skip,
203
+ take: event.take,
204
+ filter: event.filter,
205
+ sort: event.sort,
206
+ }));
207
+ case 'employment':
208
+ return (await this.employmentService.query({
209
+ skip: event.skip,
210
+ take: event.take,
211
+ filter: event.filter,
212
+ sort: event.sort,
213
+ }));
214
+ }
215
+ }
216
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
217
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService }); }
218
+ }
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService, decorators: [{
220
+ type: Injectable
221
+ }] });
222
+
223
+ var AXMOrganizationNodeType;
224
+ (function (AXMOrganizationNodeType) {
225
+ AXMOrganizationNodeType["Company"] = "Company";
226
+ AXMOrganizationNodeType["Location"] = "Location";
227
+ AXMOrganizationNodeType["BusinessUnit"] = "BusinessUnit";
228
+ AXMOrganizationNodeType["Role"] = "Role";
229
+ AXMOrganizationNodeType["Person"] = "Person"; // Employee
230
+ })(AXMOrganizationNodeType || (AXMOrganizationNodeType = {}));
231
+ const AXM_ALLOWED_CHILD_NODES = {
232
+ [AXMOrganizationNodeType.Company]: [AXMOrganizationNodeType.Location, AXMOrganizationNodeType.BusinessUnit],
233
+ [AXMOrganizationNodeType.Location]: [AXMOrganizationNodeType.Location, AXMOrganizationNodeType.BusinessUnit],
234
+ [AXMOrganizationNodeType.BusinessUnit]: [AXMOrganizationNodeType.BusinessUnit, AXMOrganizationNodeType.Role],
235
+ [AXMOrganizationNodeType.Role]: [AXMOrganizationNodeType.Person],
236
+ [AXMOrganizationNodeType.Person]: [] // No children allowed
237
+ };
238
+ const AXM_ORGANIZATION_DATA = {
239
+ id: '1',
240
+ title: 'CEO',
241
+ subtitle: 'Chief Executive Officer',
242
+ description: 'Responsible for the overall success of the',
243
+ icon: 'fa-user-tie',
244
+ children: [
245
+ {
246
+ id: '2',
247
+ title: 'CTO',
248
+ subtitle: 'Chief Technology Officer',
249
+ //description: 'Leads the technology team and innovation.',
250
+ icon: 'fa-microchip',
251
+ children: [
252
+ {
253
+ id: '3',
254
+ title: 'Engineering Director',
255
+ subtitle: 'Director of Engineering',
256
+ description: 'Oversees all engineering teams.',
257
+ icon: 'fa-cogs',
258
+ children: [
259
+ {
260
+ id: '4',
261
+ title: 'Dev Manager',
262
+ subtitle: 'Development Manager',
263
+ description: 'Manages the development team.',
264
+ icon: 'fa-code',
265
+ children: [
266
+ {
267
+ id: '5',
268
+ title: 'Frontend Team Lead',
269
+ subtitle: 'Leads frontend developers',
270
+ description: 'Manages the frontend development efforts.',
271
+ icon: 'fa-paint-brush',
272
+ },
273
+ {
274
+ id: '6',
275
+ title: 'Backend Team Lead',
276
+ subtitle: 'Leads backend developers',
277
+ description: 'Manages the backend development efforts.',
278
+ icon: 'fa-database',
279
+ },
280
+ ],
281
+ },
282
+ {
283
+ id: '7',
284
+ title: 'QA Manager',
285
+ subtitle: 'Quality Assurance Manager',
286
+ description: 'Ensures product quality.',
287
+ icon: 'fa-check-circle',
288
+ children: [
289
+ {
290
+ id: '8',
291
+ title: 'QA Engineer',
292
+ subtitle: 'Quality Assurance Engineer',
293
+ description: 'Tests and ensures software quality.',
294
+ icon: 'fa-bug',
295
+ },
296
+ ],
297
+ },
298
+ ],
299
+ },
300
+ {
301
+ id: '9',
302
+ title: 'Security Manager',
303
+ subtitle: 'Security & Compliance',
304
+ description: 'Ensures security policies and compliance.',
305
+ icon: 'fa-shield-alt',
306
+ },
307
+ ],
308
+ },
309
+ {
310
+ id: '10',
311
+ title: 'CFO',
312
+ subtitle: 'Chief Financial Officer',
313
+ description: 'Manages the financial health of the organization.',
314
+ icon: 'fa-chart-line',
315
+ children: [
316
+ {
317
+ id: '11',
318
+ title: 'Finance Manager',
319
+ subtitle: 'Oversees financial operations',
320
+ description: 'Handles budgets, financial planning, and reporting.',
321
+ icon: 'fa-money-bill-wave',
322
+ },
323
+ {
324
+ id: '12',
325
+ title: 'Accounting Manager',
326
+ subtitle: 'Manages accounting team',
327
+ description: 'Ensures financial accuracy and compliance.',
328
+ icon: 'fa-calculator',
329
+ },
330
+ ],
331
+ },
332
+ {
333
+ id: '13',
334
+ title: 'COO',
335
+ subtitle: 'Chief Operating Officer',
336
+ description: 'Oversees daily business operations.',
337
+ icon: 'fa-briefcase',
338
+ children: [
339
+ {
340
+ id: '14',
341
+ title: 'HR Manager',
342
+ subtitle: 'Human Resources Manager',
343
+ description: 'Manages recruitment and employee relations.',
344
+ icon: 'fa-users',
345
+ },
346
+ {
347
+ id: '15',
348
+ title: 'Operations Manager',
349
+ subtitle: 'Leads business operations',
350
+ description: 'Oversees operational efficiency and process improvements.',
351
+ icon: 'fa-industry',
352
+ },
353
+ ],
354
+ },
355
+ {
356
+ id: '16',
357
+ title: 'CMO',
358
+ subtitle: 'Chief Marketing Officer',
359
+ description: 'Leads marketing and brand strategy.',
360
+ icon: 'fa-bullhorn',
361
+ children: [
362
+ {
363
+ id: '17',
364
+ title: 'Marketing Manager',
365
+ subtitle: 'Oversees marketing team',
366
+ description: 'Handles branding, campaigns, and customer engagement.',
367
+ icon: 'fa-ad',
368
+ },
369
+ {
370
+ id: '18',
371
+ title: 'Sales Director',
372
+ subtitle: 'Leads sales initiatives',
373
+ description: 'Drives revenue and sales growth.',
374
+ icon: 'fa-handshake',
375
+ children: [
376
+ {
377
+ id: '19',
378
+ title: 'Sales Manager',
379
+ subtitle: 'Manages sales team',
380
+ description: 'Oversees sales operations and targets.',
381
+ icon: 'fa-shopping-cart',
382
+ },
383
+ ],
384
+ },
385
+ ],
386
+ },
387
+ ],
388
+ };
389
+
390
+ class AXMOrgChartPage {
391
+ constructor() {
392
+ this.layout = inject(AXPLayoutThemeService);
393
+ this.rootConfig = RootConfig;
394
+ this.nodeTemplate = viewChild.required('nodeTemplate');
395
+ this.treeContainer = viewChild.required('chart');
396
+ this.parent = viewChild.required('parent');
397
+ this.contextMenu = viewChild(AXContextMenuComponent);
398
+ this.ngzone = inject(NgZone);
399
+ this.viewContainerRef = inject(ViewContainerRef);
400
+ this.chartPrintService = inject(AXMOrgChartPrintService);
401
+ this.DATA = AXM_ORGANIZATION_DATA;
402
+ this.NODE_STROKE_COLOR = 'rgba(var(--ax-sys-color-primary-400))';
403
+ this.LINK_STROKE_WIDTH = 1;
404
+ this.isFullscreen = signal(false);
405
+ this.panX = signal(0);
406
+ this.panY = signal(0);
407
+ this.panZoomLevel = signal(100);
408
+ this.#initialize = afterNextRender(async () => {
409
+ this.d3 = await import('d3');
410
+ this.createChart(this.treeContainer().nativeElement, this.DATA);
411
+ });
412
+ }
413
+ #initialize;
414
+ // eff = effect(() => console.log(this.panX(), this.panY()));
415
+ zoomIn() {
416
+ this.panZoomLevel.update((prev) => prev + 5);
417
+ }
418
+ zoomOut() {
419
+ this.panZoomLevel.update((prev) => prev - 5);
420
+ }
421
+ zoomReset() {
422
+ this.panX.set(1);
423
+ this.panY.set(1);
424
+ this.panX.set(0);
425
+ this.panY.set(0);
426
+ this.panZoomLevel.set(100);
427
+ }
428
+ toggleFullscreen() {
429
+ if (this.isFullscreen()) {
430
+ document.exitFullscreen();
431
+ this.isFullscreen.set(false);
432
+ }
433
+ else {
434
+ this.parent().nativeElement.requestFullscreen();
435
+ this.isFullscreen.set(true);
436
+ }
437
+ }
438
+ calculateMaxDepth(node) {
439
+ if (!node.children || node.children.length === 0 || node.isExpanded === false) {
440
+ return 1; // Base case: no children or node is collapsed
441
+ }
442
+ return 1 + Math.max(...node.children.map((child) => this.calculateMaxDepth(child)));
443
+ }
444
+ calculateMaxBreadth(node) {
445
+ if (!node.children || node.children.length === 0 || node.isExpanded === false) {
446
+ return 1; // Base case: no children or node is collapsed
447
+ }
448
+ return node.children.reduce((acc, child) => acc + this.calculateMaxBreadth(child), 0);
449
+ }
450
+ createChart(el, data) {
451
+ this.ngzone.runOutsideAngular(() => {
452
+ // Constants for node dimensions and spacing
453
+ const NODE_WIDTH_BASE = 260; // Base width for each node
454
+ const NODE_HEIGHT_BASE = 180; // Base height for each node
455
+ const HORIZONTAL_SPACING = 20; // Horizontal spacing between nodes
456
+ const VERTICAL_SPACING = 40; // Vertical spacing between levels
457
+ // Clear existing SVG and create a new one
458
+ this.clearChart(el);
459
+ const newSvg = this.d3.select(el).append('svg');
460
+ // Create a hierarchy from the data
461
+ const root = this.d3.hierarchy(data);
462
+ // Filter out collapsed nodes and their descendants
463
+ root.descendants().forEach((node) => {
464
+ if (node.data.isExpanded === false) {
465
+ node.children = undefined; // Remove children for collapsed nodes
466
+ }
467
+ });
468
+ // Create a tree layout
469
+ const treeLayout = this.d3
470
+ .tree()
471
+ .nodeSize([NODE_WIDTH_BASE + HORIZONTAL_SPACING, NODE_HEIGHT_BASE + VERTICAL_SPACING]);
472
+ // Generate the tree nodes and links
473
+ treeLayout(root);
474
+ // Calculate the bounds of the tree
475
+ let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
476
+ root.descendants().forEach((d) => {
477
+ if (d.x < minX)
478
+ minX = d.x;
479
+ if (d.x > maxX)
480
+ maxX = d.x;
481
+ if (d.y < minY)
482
+ minY = d.y;
483
+ if (d.y > maxY)
484
+ maxY = d.y;
485
+ });
486
+ // Calculate SVG dimensions based on tree bounds
487
+ const CONTAINER_WIDTH = maxX - minX + NODE_WIDTH_BASE + 2 * HORIZONTAL_SPACING;
488
+ const CONTAINER_HEIGHT = maxY - minY + NODE_HEIGHT_BASE + 2 * VERTICAL_SPACING;
489
+ // Set SVG dimensions
490
+ newSvg.attr('width', CONTAINER_WIDTH).attr('height', CONTAINER_HEIGHT);
491
+ // Adjust the transform of the <g> element to center the tree
492
+ const g = newSvg
493
+ .append('g')
494
+ .attr('transform', `translate(${-minX + NODE_WIDTH_BASE / 2 + HORIZONTAL_SPACING / 2}, ${-minY + NODE_HEIGHT_BASE / 2 + VERTICAL_SPACING / 2})`);
495
+ // Create links (lines with 90-degree angles)
496
+ const link = g
497
+ .selectAll('.link')
498
+ .data(root.links())
499
+ .enter()
500
+ .append('path')
501
+ .attr('class', 'link')
502
+ .attr('d', (d) => {
503
+ const source = d.source;
504
+ const target = d.target;
505
+ return `M${source.x},${source.y}V${(source.y + target.y) / 2}H${target.x}V${target.y - 10}`;
506
+ })
507
+ .attr('fill', 'none')
508
+ .attr('stroke', this.NODE_STROKE_COLOR)
509
+ .attr('stroke-width', this.LINK_STROKE_WIDTH)
510
+ .attr('from', (d) => `node-${d.source.data.id}`)
511
+ .attr('to', (d) => `node-${d.target.data.id}`);
512
+ // Create nodes
513
+ const node = g
514
+ .selectAll('.axp-org-chart-node')
515
+ .data(root.descendants())
516
+ .enter()
517
+ .append('foreignObject')
518
+ .attr('class', 'axp-org-chart-node')
519
+ .attr('node', (d) => `node-${d.data.id}`) // Unique ID for each node
520
+ .attr('x', (d) => d.x - NODE_WIDTH_BASE / 2) // Use d.x (D3 node property)
521
+ .attr('y', (d) => d.y - NODE_HEIGHT_BASE / 2 + 10) // Use d.y (D3 node property)
522
+ .attr('width', NODE_WIDTH_BASE)
523
+ .attr('height', NODE_HEIGHT_BASE)
524
+ .each((d) => this.renderNodeTemplate(d.data, d.x, d.y));
525
+ // Refresh context menu
526
+ this.contextMenu()?.refresh();
527
+ });
528
+ }
529
+ renderNodeTemplate(data, x, y) {
530
+ const viewRef = this.viewContainerRef.createEmbeddedView(this.nodeTemplate(), {
531
+ $implicit: data, // Pass the node data to the template
532
+ });
533
+ // Select node using unique ID
534
+ const nodeElement = this.d3.select(this.treeContainer().nativeElement).select(`[node="node-${data.id}"]`); // Select by unique ID instead of position
535
+ const element = nodeElement.node();
536
+ if (element) {
537
+ element.appendChild(viewRef.rootNodes[0]);
538
+ }
539
+ }
540
+ toggleNode(data, el) {
541
+ data.isExpanded = data.isExpanded === undefined ? false : !data.isExpanded;
542
+ this.createChart(this.treeContainer().nativeElement, this.DATA); // Re-render the chart
543
+ el.scrollIntoView({ behavior: 'smooth' });
544
+ }
545
+ clearChart(el) {
546
+ this.d3.select(el).select('svg').remove();
547
+ this.viewContainerRef.clear();
548
+ }
549
+ handleContextMenuOnOpening(e) {
550
+ const items = [
551
+ { name: 'add', text: 'Add New Departpent', color: 'primary', icon: 'fa-light fa-plus' },
552
+ {
553
+ name: 'remove',
554
+ text: 'Remove',
555
+ color: 'danger',
556
+ icon: 'fa-light fa-trash-can',
557
+ },
558
+ ];
559
+ e.items.push(...items);
560
+ }
561
+ printChart() {
562
+ this.chartPrintService.printChart(this.treeContainer().nativeElement);
563
+ }
564
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
565
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMOrgChartPage, isStandalone: true, selector: "ng-component", providers: [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 }], 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> Home </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>\n <div class=\"ax-h-[calc(100vh-190px)]\" #parent id=\"parent\">\n <div #chart axPanView [(panX)]=\"panX\" [(panY)]=\"panY\" [(zoom)]=\"panZoomLevel\" wrapperClasses=\"h\"></div>\n <div class=\"ax-absolute ax-bottom-2 ax-right-2 ax-z-10 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 </div>\n\n <ax-context-menu\n [target]=\"'.axp-org-chart-node'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onOpening)=\"handleContextMenuOnOpening($event)\"\n >\n </ax-context-menu>\n </axp-layout-content>\n</axp-layout-simple-page>\n<div #chart class=\"chart-container ax-border\"></div>\n\n<!-- <ax-chart nodeTemplate=\"nodeTemplate\" nodes=\"nodes\"></ax-chart> -->\n<!-- \n<ng-template #nodeTemplate let-data>\n <div\n class=\"ax-border ax-select-none ax-shadow-md ax-border-primary-500 ax-text-primary-800 ax-rounded-md ax-bg-white ax-flex ax-flex-col ax-overflow-hidden\"\n >\n <div\n class=\"ax-bg-primary-400 ax-text-on-primary ax-px-4 ax-py-2 ax-h-full ax-cursor-pointer hover:ax-brightness-90\"\n [class.ax-rounded-b-none]=\"data.description\"\n (dblclick)=\"toggleNode(data)\"\n >\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-justify-between ax-h-full\">\n <ax-icon><i class=\"fa-light fa-lg\" [class]=\"data.icon\"></i></ax-icon>\n <div class=\"ax-flex ax-flex-col ax-gap-1\">\n <div class=\"ax-text-xs ax-font-bold\">{{ data.title }}</div>\n @if (data.subtitle) {\n <div class=\"ax-text-xs\">{{ data.subtitle }}</div>\n }\n </div>\n @if (data.children && data.children.length > 0) {\n <div class=\"ax-flex ax-justify-center ax-items-center\" (click)=\"toggleNode(data)\">\n <ax-icon>\n <i class=\"fa-solid\" [class]=\"data.isExpanded === false ? 'fa-chevron-down' : 'fa-chevron-up'\"></i\n ></ax-icon>\n </div>\n }@else {\n <span></span>\n }\n </div>\n </div>\n @if(data.description) {\n <div class=\"ax-text-xs ax-break-words ax-px-4 ax-py-2 ax-text-default dark:ax-text-on-ghost\">\n {{ data.description }}\n </div>\n }\n </div>\n</ng-template> -->\n\n<ng-template #nodeTemplate let-data>\n <div #node class=\"axp-node\" [class]=\"data.children && data.children.length > 0 ? 'ax-pb-3' : ''\">\n <div class=\"axp-node-information\">\n <div class=\"axp-node-information-bar\">\n <div class=\"axp-node-image-bar\">\n @if(false){\n <div class=\"axp-node-image\"></div>\n }@else {\n <div class=\"axp-node-icon\">\n <i\n class=\"fa-light ax-text-2xl ax-size-full ax-flex ax-justify-center ax-items-center\"\n [class]=\"data.icon\"\n ></i>\n </div>\n }\n </div>\n <div class=\"axp-node-title-bar\">\n <span class=\"axp-node-title\">{{data.title}}</span>\n <span class=\"axp-node-subtitle\" [title]=\"data.subtitle\">{{data.subtitle}}</span>\n </div>\n </div>\n\n @if(data?.children?.length){\n <div class=\"axp-badge\">\n <span>{{data?.children?.length ?? 0}}</span>\n </div>\n }\n </div>\n @if(data?.description){\n <div class=\"axp-node-description\"><span> {{data?.description}} </span></div>\n } @if(data.children && data.children.length > 0){\n <div class=\"axp-node-children-toggle\">\n <div class=\"ax-size-4 ax-flex ax-justify-center ax-items-center\">\n <i\n class=\"fa-solid ax-text-sm\"\n [class]=\"data.isExpanded === false ? 'fa-chevron-down' : 'fa-chevron-up'\"\n (click)=\"toggleNode(data,node)\"\n >\n </i>\n </div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".axp-org-chart-node{overflow:visible;white-space:nowrap;display:flex;align-items:center;justify-content:center}#parent:fullscreen{background-color:rgba(var(--axp-brand-color))}.axp-node{position:relative;max-height:100%;border-radius:.375rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--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)}.axp-node:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.axp-node:hover{--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1))}.axp-node:has(.axp-node-description)>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.axp-node .axp-node-information{display:flex;align-items:center;justify-content:space-between;gap:.25rem;overflow:hidden;padding:.75rem}.axp-node .axp-node-information .axp-node-information-bar{display:flex;flex:1 1 0%;align-items:center;gap:.5rem}.axp-node .axp-node-information .axp-node-information-bar .axp-node-image-bar .axp-node-icon{display:flex;width:2.75rem;height:2.75rem;align-items:center;justify-content:center;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-information .axp-node-information-bar .axp-node-image-bar .axp-node-icon:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-information .axp-node-information-bar .axp-node-title-bar{display:flex;flex-direction:column}.axp-node .axp-node-information .axp-node-information-bar .axp-node-title-bar .axp-node-title{font-size:1.125rem;line-height:1.75rem;font-weight:600}.axp-node .axp-node-information .axp-node-information-bar .axp-node-title-bar .axp-node-subtitle{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axp-node .axp-node-information .axp-node-information-bar .axp-node-title-bar .axp-node-subtitle:is(.ax-dark *){--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.axp-node .axp-node-information .axp-badge{display:flex;width:1.25rem;height:1.25rem;align-items:center;justify-content:center;border-radius:.125rem;--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.axp-node .axp-node-description{overflow:hidden;padding:.75rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.axp-node .axp-node-children-toggle{position:absolute;bottom:-.75rem;left:calc(50% - 12px);display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;border-radius:.125rem;border-width:1px!important;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-children-toggle:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-children-toggle:hover{--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-children-toggle:hover:is(.ax-dark *){--tw-border-opacity: 1;border-color:rgb(163 163 163 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(115 115 115 / var(--tw-bg-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type:
566
+ //
567
+ AXPSimplePageLayout, selector: "axp-layout-simple-page" }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-layout-content, axp-layout-header-container, axp-layout-footer-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: "ngmodule", type:
568
+ //
569
+ 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: ["zoomStep", "minZoom", "maxZoom", "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 }); }
570
+ }
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPage, decorators: [{
572
+ type: Component,
573
+ args: [{ imports: [
574
+ CommonModule,
575
+ RouterModule,
576
+ //
577
+ AXPSimplePageLayout,
578
+ AXPThemeLayoutBlockComponent,
579
+ AXPThemeLayoutHeaderTemplateComponent,
580
+ AXPThemeLayoutActionsComponent,
581
+ AXPThemeLayoutPageSecondaryActionsComponent,
582
+ AXPThemeLayoutPagePrimaryActionsComponent,
583
+ //
584
+ AXMenuModule,
585
+ AXButtonModule,
586
+ AXDropdownButtonModule,
587
+ AXTranslationModule,
588
+ AXDecoratorModule,
589
+ AXPanViewDirective,
590
+ AXLoadingModule,
591
+ AXBreadcrumbsModule,
592
+ AXBadgeModule,
593
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [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> Home </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>\n <div class=\"ax-h-[calc(100vh-190px)]\" #parent id=\"parent\">\n <div #chart axPanView [(panX)]=\"panX\" [(panY)]=\"panY\" [(zoom)]=\"panZoomLevel\" wrapperClasses=\"h\"></div>\n <div class=\"ax-absolute ax-bottom-2 ax-right-2 ax-z-10 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 </div>\n\n <ax-context-menu\n [target]=\"'.axp-org-chart-node'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onOpening)=\"handleContextMenuOnOpening($event)\"\n >\n </ax-context-menu>\n </axp-layout-content>\n</axp-layout-simple-page>\n<div #chart class=\"chart-container ax-border\"></div>\n\n<!-- <ax-chart nodeTemplate=\"nodeTemplate\" nodes=\"nodes\"></ax-chart> -->\n<!-- \n<ng-template #nodeTemplate let-data>\n <div\n class=\"ax-border ax-select-none ax-shadow-md ax-border-primary-500 ax-text-primary-800 ax-rounded-md ax-bg-white ax-flex ax-flex-col ax-overflow-hidden\"\n >\n <div\n class=\"ax-bg-primary-400 ax-text-on-primary ax-px-4 ax-py-2 ax-h-full ax-cursor-pointer hover:ax-brightness-90\"\n [class.ax-rounded-b-none]=\"data.description\"\n (dblclick)=\"toggleNode(data)\"\n >\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-justify-between ax-h-full\">\n <ax-icon><i class=\"fa-light fa-lg\" [class]=\"data.icon\"></i></ax-icon>\n <div class=\"ax-flex ax-flex-col ax-gap-1\">\n <div class=\"ax-text-xs ax-font-bold\">{{ data.title }}</div>\n @if (data.subtitle) {\n <div class=\"ax-text-xs\">{{ data.subtitle }}</div>\n }\n </div>\n @if (data.children && data.children.length > 0) {\n <div class=\"ax-flex ax-justify-center ax-items-center\" (click)=\"toggleNode(data)\">\n <ax-icon>\n <i class=\"fa-solid\" [class]=\"data.isExpanded === false ? 'fa-chevron-down' : 'fa-chevron-up'\"></i\n ></ax-icon>\n </div>\n }@else {\n <span></span>\n }\n </div>\n </div>\n @if(data.description) {\n <div class=\"ax-text-xs ax-break-words ax-px-4 ax-py-2 ax-text-default dark:ax-text-on-ghost\">\n {{ data.description }}\n </div>\n }\n </div>\n</ng-template> -->\n\n<ng-template #nodeTemplate let-data>\n <div #node class=\"axp-node\" [class]=\"data.children && data.children.length > 0 ? 'ax-pb-3' : ''\">\n <div class=\"axp-node-information\">\n <div class=\"axp-node-information-bar\">\n <div class=\"axp-node-image-bar\">\n @if(false){\n <div class=\"axp-node-image\"></div>\n }@else {\n <div class=\"axp-node-icon\">\n <i\n class=\"fa-light ax-text-2xl ax-size-full ax-flex ax-justify-center ax-items-center\"\n [class]=\"data.icon\"\n ></i>\n </div>\n }\n </div>\n <div class=\"axp-node-title-bar\">\n <span class=\"axp-node-title\">{{data.title}}</span>\n <span class=\"axp-node-subtitle\" [title]=\"data.subtitle\">{{data.subtitle}}</span>\n </div>\n </div>\n\n @if(data?.children?.length){\n <div class=\"axp-badge\">\n <span>{{data?.children?.length ?? 0}}</span>\n </div>\n }\n </div>\n @if(data?.description){\n <div class=\"axp-node-description\"><span> {{data?.description}} </span></div>\n } @if(data.children && data.children.length > 0){\n <div class=\"axp-node-children-toggle\">\n <div class=\"ax-size-4 ax-flex ax-justify-center ax-items-center\">\n <i\n class=\"fa-solid ax-text-sm\"\n [class]=\"data.isExpanded === false ? 'fa-chevron-down' : 'fa-chevron-up'\"\n (click)=\"toggleNode(data,node)\"\n >\n </i>\n </div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".axp-org-chart-node{overflow:visible;white-space:nowrap;display:flex;align-items:center;justify-content:center}#parent:fullscreen{background-color:rgba(var(--axp-brand-color))}.axp-node{position:relative;max-height:100%;border-radius:.375rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--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)}.axp-node:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.axp-node:hover{--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1))}.axp-node:has(.axp-node-description)>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.axp-node .axp-node-information{display:flex;align-items:center;justify-content:space-between;gap:.25rem;overflow:hidden;padding:.75rem}.axp-node .axp-node-information .axp-node-information-bar{display:flex;flex:1 1 0%;align-items:center;gap:.5rem}.axp-node .axp-node-information .axp-node-information-bar .axp-node-image-bar .axp-node-icon{display:flex;width:2.75rem;height:2.75rem;align-items:center;justify-content:center;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-information .axp-node-information-bar .axp-node-image-bar .axp-node-icon:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-information .axp-node-information-bar .axp-node-title-bar{display:flex;flex-direction:column}.axp-node .axp-node-information .axp-node-information-bar .axp-node-title-bar .axp-node-title{font-size:1.125rem;line-height:1.75rem;font-weight:600}.axp-node .axp-node-information .axp-node-information-bar .axp-node-title-bar .axp-node-subtitle{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.axp-node .axp-node-information .axp-node-information-bar .axp-node-title-bar .axp-node-subtitle:is(.ax-dark *){--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.axp-node .axp-node-information .axp-badge{display:flex;width:1.25rem;height:1.25rem;align-items:center;justify-content:center;border-radius:.125rem;--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.axp-node .axp-node-description{overflow:hidden;padding:.75rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.axp-node .axp-node-children-toggle{position:absolute;bottom:-.75rem;left:calc(50% - 12px);display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;border-radius:.125rem;border-width:1px!important;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-children-toggle:is(.ax-dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-children-toggle:hover{--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.axp-node .axp-node-children-toggle:hover:is(.ax-dark *){--tw-border-opacity: 1;border-color:rgb(163 163 163 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(115 115 115 / var(--tw-bg-opacity, 1))}\n"] }]
594
+ }] });
595
+
596
+ export { AXMOrgChartPage };
597
+ //# sourceMappingURL=acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs.map