@acorex/modules 19.2.5 → 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.
- package/auth/lib/store/auth.effects.d.ts +2 -2
- package/fesm2022/{acorex-modules-application-management-module-designer.component-kMtkkid-.mjs → acorex-modules-application-management-module-designer.component-DPJ4qpK3.mjs} +4 -4
- package/fesm2022/acorex-modules-application-management-module-designer.component-DPJ4qpK3.mjs.map +1 -0
- package/fesm2022/acorex-modules-application-management.mjs +3 -3
- package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-auth-acorex-modules-auth-CcRRSTGN.mjs → acorex-modules-auth-acorex-modules-auth-D75igkfc.mjs} +22 -22
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-D75igkfc.mjs.map +1 -0
- package/fesm2022/acorex-modules-auth-app-chooser.component-BZb8n5Ag.mjs +64 -0
- package/fesm2022/acorex-modules-auth-app-chooser.component-BZb8n5Ag.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-login.module-ua9uEgUG.mjs → acorex-modules-auth-login.module-DAtJYcHZ.mjs} +4 -4
- package/fesm2022/{acorex-modules-auth-login.module-ua9uEgUG.mjs.map → acorex-modules-auth-login.module-DAtJYcHZ.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-master.layout-qeAQTygT.mjs +23 -0
- package/fesm2022/acorex-modules-auth-master.layout-qeAQTygT.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-password.component-BVoPZUG9.mjs → acorex-modules-auth-password.component-20Ofs9FL.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-password.component-BVoPZUG9.mjs.map → acorex-modules-auth-password.component-20Ofs9FL.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-CIwOjQRh.mjs → acorex-modules-auth-password.component-CRvI9sIa.mjs} +4 -4
- package/fesm2022/acorex-modules-auth-password.component-CRvI9sIa.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-routes-hR3jePok.mjs → acorex-modules-auth-routes-BDED-qaZ.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-routes-hR3jePok.mjs.map → acorex-modules-auth-routes-BDED-qaZ.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-CKsbiOUX.mjs +83 -0
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-CKsbiOUX.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-two-factor.module-CKe_H_-u.mjs → acorex-modules-auth-two-factor.module-B0C2aBWh.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-two-factor.module-CKe_H_-u.mjs.map → acorex-modules-auth-two-factor.module-B0C2aBWh.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth.mjs +1 -1
- package/fesm2022/acorex-modules-conversation.mjs +4 -4
- package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-xiRKc4FF.mjs +126 -0
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-xiRKc4FF.mjs.map +1 -0
- package/fesm2022/acorex-modules-form-template-management.mjs +1 -1
- package/fesm2022/acorex-modules-notification-management.mjs +279 -8
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs +92 -0
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs +145 -0
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-managment-org-chart.page-CTHNSn2n.mjs → acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs} +111 -19
- package/fesm2022/acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment.mjs +2 -2
- package/fesm2022/acorex-modules-platform-management.mjs +12 -0
- package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-security-management.mjs +12 -1
- package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
- package/notification-management/lib/components/promotion-slot/promotion-slot.component.d.ts +11 -0
- package/notification-management/lib/entities/channel/channel.types.d.ts +11 -1
- package/organization-managment/lib/features/organization-chart/org-chart-configuration.page.d.ts +2 -2
- package/organization-managment/lib/features/organization-chart/org-chart-configuration.service.d.ts +24 -0
- package/organization-managment/lib/features/organization-chart/org-chart.page.d.ts +1 -1
- package/organization-managment/lib/features/organization-chart/org-chart.service.d.ts +3 -19
- package/package.json +1 -1
- package/security-management/index.d.ts +1 -0
- package/security-management/lib/menu.keys.d.ts +5 -0
- package/fesm2022/acorex-modules-application-management-module-designer.component-kMtkkid-.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-CcRRSTGN.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-app-chooser.component-DuRnQda8.mjs +0 -64
- package/fesm2022/acorex-modules-auth-app-chooser.component-DuRnQda8.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-master.layout-KNzdjwP6.mjs +0 -23
- package/fesm2022/acorex-modules-auth-master.layout-KNzdjwP6.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-password.component-CIwOjQRh.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-Cx3fK__H.mjs +0 -83
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-Cx3fK__H.mjs.map +0 -1
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-CG-_1tWi.mjs +0 -126
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-CG-_1tWi.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-Dc6c7GmB.mjs +0 -310
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-Dc6c7GmB.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-managment-org-chart.page-CTHNSn2n.mjs.map +0 -1
package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
import * as i3 from '@acorex/components/button';
|
2
|
+
import { AXButtonModule } from '@acorex/components/button';
|
3
|
+
import * as i5 from '@acorex/components/decorators';
|
4
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
5
|
+
import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
|
6
|
+
import * as i5$1 from '@acorex/components/loading';
|
7
|
+
import { AXLoadingModule } from '@acorex/components/loading';
|
8
|
+
import { AXMenuModule } from '@acorex/components/menu';
|
9
|
+
import * as i4 from '@acorex/core/translation';
|
10
|
+
import { AXTranslationModule } from '@acorex/core/translation';
|
11
|
+
import { AXPSimplePageLayout } from '@acorex/platform/themes/default';
|
12
|
+
import { AXPLayoutThemeService, AXPThemeLayoutBlockComponent, AXPThemeLayoutHeaderTemplateComponent, AXPThemeLayoutActionsComponent, AXPThemeLayoutPageSecondaryActionsComponent, AXPThemeLayoutPagePrimaryActionsComponent } from '@acorex/platform/themes/shared';
|
13
|
+
import * as i1 from '@angular/common';
|
14
|
+
import { CommonModule } from '@angular/common';
|
15
|
+
import * as i0 from '@angular/core';
|
16
|
+
import { inject, signal, Component, ChangeDetectionStrategy } from '@angular/core';
|
17
|
+
import { RouterModule } from '@angular/router';
|
18
|
+
import { RootConfig } from './acorex-modules-organization-managment.mjs';
|
19
|
+
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
20
|
+
import { FormsModule } from '@angular/forms';
|
21
|
+
import * as i6 from '@acorex/components/breadcrumbs';
|
22
|
+
import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
|
23
|
+
import * as i7 from '@acorex/components/alert';
|
24
|
+
import { AXAlertModule } from '@acorex/components/alert';
|
25
|
+
import { A as AXMOrgChartConfigService } from './acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs';
|
26
|
+
|
27
|
+
class AXMOrgChartConfigurationPage {
|
28
|
+
constructor() {
|
29
|
+
this.layout = inject(AXPLayoutThemeService);
|
30
|
+
this.chartService = inject(AXMOrgChartConfigService);
|
31
|
+
this.loadingStates = signal({});
|
32
|
+
this.rootConfig = RootConfig;
|
33
|
+
}
|
34
|
+
async ngOnInit() {
|
35
|
+
await this.chartService.load();
|
36
|
+
}
|
37
|
+
async togglePermission(parent, child) {
|
38
|
+
//TODO: Check the async and loading
|
39
|
+
// Set the loading state for this cell to true.
|
40
|
+
this.loadingStates.update((states) => {
|
41
|
+
if (!states[parent]) {
|
42
|
+
states[parent] = {};
|
43
|
+
}
|
44
|
+
states[parent][child] = true;
|
45
|
+
return states;
|
46
|
+
});
|
47
|
+
this.chartService.set(parent, child, !this.chartService.get(parent, child));
|
48
|
+
await this.chartService.update();
|
49
|
+
// Turn off the loading state.
|
50
|
+
this.loadingStates.update((states) => {
|
51
|
+
if (!states[parent]) {
|
52
|
+
states[parent] = {};
|
53
|
+
}
|
54
|
+
states[parent][child] = false;
|
55
|
+
return states;
|
56
|
+
});
|
57
|
+
}
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartConfigurationPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
59
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMOrgChartConfigurationPage, isStandalone: true, selector: "ng-component", providers: [AXMOrgChartConfigService], ngImport: i0, template: "<axp-layout-simple-page *translate=\"let t\">\n <axp-layout-header>\n <axp-layout-title> {{t(rootConfig.entities.structure.title) | async}} </axp-layout-title>\n\n <axp-layout-description>Customize your organization's hierarchical relationships</axp-layout-description>\n\n <axp-layout-actions>\n <axp-layout-actions-primary> </axp-layout-actions-primary>\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('reset') | async)!\">\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\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>\n Home\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n Organization\n </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n </axp-layout-header>\n\n <axp-layout-content>\n <div class=\"ax-flex ax-flex-col ax-gap-6 ax-w-full 2xl:ax-w-3/4 3xl:ax-w-1/2\">\n <div>\n <h3 class=\"ax-font-semibold ax-text-xl\">Relations Permissions</h3>\n <p class=\"ax-text-sm ax-opacity-85\">\n This matrix sets the relationships between nodes in your organization chart. Click a cell to toggle the\n relation between <span class=\"ax-text-danger-500\">Allowed</span> and <span\n class=\"ax-text-success-500\">Denied</span>.\n </p>\n </div>\n <div class=\"ax-rounded-md ax-overflow-hidden ax-w-full\">\n <table class=\" ax-table-auto ax-border-collapse ax-w-full ax-border-primary-darkest ax-rounded-md\">\n <thead>\n <tr class=\"ax-bg-primary-light ax-text-on-primary-light\">\n <!-- Top-left empty cell -->\n <th class=\"ax-border ax-border-primary-darkest ax-p-4 ax-min-w-44 ax-font-semibold ax-text-start\">Parent\n \\\n Child</th>\n <!-- Horizontal headers -->\n @for ( type of chartService.types; track $index) {\n <th class=\"ax-border ax-border-primary-darkest ax-p-4 ax-min-w-44 ax-text-center ax-font-semibold\">\n {{ type }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <!-- For each parent type, render a row with alternating backgrounds -->\n @for ( parent of chartService.types; track $index) {\n <tr>\n <!-- Vertical header cell with custom header colors -->\n <td\n class=\"ax-border ax-border-primary-darkest ax-p-4 ax-font-semibold ax-bg-primary-light ax-text-on-primary-light ax-text-start\">\n {{ parent }}\n </td>\n <!-- Render a cell for each potential child type -->\n @for ( child of chartService.types; track $index) {\n <td class=\"ax-border ax-border-primary-darkest ax-p-2 \">\n <div class=\"ax-flex ax-justify-center ax-cursor-pointer ax-sm\">\n @let isLoading = loadingStates()[parent]?.[child];\n <ax-button look=\"twotone\" [color]=\"chartService.isAllowed(parent, child) ? 'success' : 'danger'\"\n [text]=\"chartService.isAllowed(parent, child) ? 'Allowed' : 'Denied'\" [disabled]=\"isLoading\"\n (onClick)=\"togglePermission(parent, child)\">\n @if(isLoading)\n {\n <ax-loading></ax-loading>\n }\n </ax-button>\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <div>\n <ax-alert [color]=\"'warning'\">\n <ax-icon></ax-icon>\n <ax-title>Attention</ax-title>\n <ax-content>\n Changes made here will not update your current organization chart. They will only affect future charts or\n updates.\n </ax-content>\n </ax-alert>\n </div>\n </div>\n\n </axp-layout-content>\n</axp-layout-simple-page>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type:
|
60
|
+
//
|
61
|
+
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:
|
62
|
+
//
|
63
|
+
AXMenuModule }, { 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: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i5$1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { 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: AXAlertModule }, { kind: "component", type: i7.AXAlertComponent, selector: "ax-alert", inputs: ["color", "timeOut"], outputs: ["colorChange", "onClosed", "timeOutChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
64
|
+
}
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartConfigurationPage, decorators: [{
|
66
|
+
type: Component,
|
67
|
+
args: [{ imports: [
|
68
|
+
CommonModule,
|
69
|
+
RouterModule,
|
70
|
+
FormsModule,
|
71
|
+
//
|
72
|
+
AXPSimplePageLayout,
|
73
|
+
AXPThemeLayoutBlockComponent,
|
74
|
+
AXPThemeLayoutHeaderTemplateComponent,
|
75
|
+
AXPThemeLayoutActionsComponent,
|
76
|
+
AXPThemeLayoutPageSecondaryActionsComponent,
|
77
|
+
AXPThemeLayoutPagePrimaryActionsComponent,
|
78
|
+
//
|
79
|
+
AXMenuModule,
|
80
|
+
AXButtonModule,
|
81
|
+
AXDropdownButtonModule,
|
82
|
+
AXTranslationModule,
|
83
|
+
AXDecoratorModule,
|
84
|
+
AXLoadingModule,
|
85
|
+
AXCheckBoxModule,
|
86
|
+
AXBreadcrumbsModule,
|
87
|
+
AXAlertModule
|
88
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [AXMOrgChartConfigService], template: "<axp-layout-simple-page *translate=\"let t\">\n <axp-layout-header>\n <axp-layout-title> {{t(rootConfig.entities.structure.title) | async}} </axp-layout-title>\n\n <axp-layout-description>Customize your organization's hierarchical relationships</axp-layout-description>\n\n <axp-layout-actions>\n <axp-layout-actions-primary> </axp-layout-actions-primary>\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('reset') | async)!\">\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\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>\n Home\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n Organization\n </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n </axp-layout-header>\n\n <axp-layout-content>\n <div class=\"ax-flex ax-flex-col ax-gap-6 ax-w-full 2xl:ax-w-3/4 3xl:ax-w-1/2\">\n <div>\n <h3 class=\"ax-font-semibold ax-text-xl\">Relations Permissions</h3>\n <p class=\"ax-text-sm ax-opacity-85\">\n This matrix sets the relationships between nodes in your organization chart. Click a cell to toggle the\n relation between <span class=\"ax-text-danger-500\">Allowed</span> and <span\n class=\"ax-text-success-500\">Denied</span>.\n </p>\n </div>\n <div class=\"ax-rounded-md ax-overflow-hidden ax-w-full\">\n <table class=\" ax-table-auto ax-border-collapse ax-w-full ax-border-primary-darkest ax-rounded-md\">\n <thead>\n <tr class=\"ax-bg-primary-light ax-text-on-primary-light\">\n <!-- Top-left empty cell -->\n <th class=\"ax-border ax-border-primary-darkest ax-p-4 ax-min-w-44 ax-font-semibold ax-text-start\">Parent\n \\\n Child</th>\n <!-- Horizontal headers -->\n @for ( type of chartService.types; track $index) {\n <th class=\"ax-border ax-border-primary-darkest ax-p-4 ax-min-w-44 ax-text-center ax-font-semibold\">\n {{ type }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <!-- For each parent type, render a row with alternating backgrounds -->\n @for ( parent of chartService.types; track $index) {\n <tr>\n <!-- Vertical header cell with custom header colors -->\n <td\n class=\"ax-border ax-border-primary-darkest ax-p-4 ax-font-semibold ax-bg-primary-light ax-text-on-primary-light ax-text-start\">\n {{ parent }}\n </td>\n <!-- Render a cell for each potential child type -->\n @for ( child of chartService.types; track $index) {\n <td class=\"ax-border ax-border-primary-darkest ax-p-2 \">\n <div class=\"ax-flex ax-justify-center ax-cursor-pointer ax-sm\">\n @let isLoading = loadingStates()[parent]?.[child];\n <ax-button look=\"twotone\" [color]=\"chartService.isAllowed(parent, child) ? 'success' : 'danger'\"\n [text]=\"chartService.isAllowed(parent, child) ? 'Allowed' : 'Denied'\" [disabled]=\"isLoading\"\n (onClick)=\"togglePermission(parent, child)\">\n @if(isLoading)\n {\n <ax-loading></ax-loading>\n }\n </ax-button>\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <div>\n <ax-alert [color]=\"'warning'\">\n <ax-icon></ax-icon>\n <ax-title>Attention</ax-title>\n <ax-content>\n Changes made here will not update your current organization chart. They will only affect future charts or\n updates.\n </ax-content>\n </ax-alert>\n </div>\n </div>\n\n </axp-layout-content>\n</axp-layout-simple-page>" }]
|
89
|
+
}] });
|
90
|
+
|
91
|
+
export { AXMOrgChartConfigurationPage };
|
92
|
+
//# sourceMappingURL=acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs.map
|
package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs","sources":["../../../../libs/modules/organization-managment/src/lib/features/organization-chart/org-chart-configuration.page.ts","../../../../libs/modules/organization-managment/src/lib/features/organization-chart/org-chart-configuration.page.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXDropdownButtonModule } from '@acorex/components/dropdown-button';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXMenuModule } from '@acorex/components/menu';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPSimplePageLayout } from '@acorex/platform/themes/default';\nimport {\n AXPLayoutThemeService,\n AXPThemeLayoutActionsComponent,\n AXPThemeLayoutBlockComponent,\n AXPThemeLayoutHeaderTemplateComponent,\n AXPThemeLayoutPagePrimaryActionsComponent,\n AXPThemeLayoutPageSecondaryActionsComponent,\n} from '@acorex/platform/themes/shared';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n signal,\n} from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { RootConfig } from '../../const';\nimport { AXCheckBoxModule } from '@acorex/components/check-box';\nimport { FormsModule } from '@angular/forms';\nimport { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';\nimport { AXAlertModule } from '@acorex/components/alert';\nimport { AXMOrgChartConfigService } from './org-chart-configuration.service';\n\n@Component({\n templateUrl: './org-chart-configuration.page.html',\n imports: [\n CommonModule,\n RouterModule,\n FormsModule,\n //\n AXPSimplePageLayout,\n AXPThemeLayoutBlockComponent,\n AXPThemeLayoutHeaderTemplateComponent,\n AXPThemeLayoutActionsComponent,\n AXPThemeLayoutPageSecondaryActionsComponent,\n AXPThemeLayoutPagePrimaryActionsComponent,\n //\n AXMenuModule,\n AXButtonModule,\n AXDropdownButtonModule,\n AXTranslationModule,\n AXDecoratorModule,\n AXLoadingModule,\n AXCheckBoxModule,\n AXBreadcrumbsModule,\n AXAlertModule\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [AXMOrgChartConfigService],\n})\nexport class AXMOrgChartConfigurationPage {\n\n protected readonly layout = inject(AXPLayoutThemeService);\n protected readonly chartService = inject(AXMOrgChartConfigService);\n\n protected loadingStates = signal<{ [parent: string]: { [child: string]: boolean } | undefined }>({});\n\n protected readonly rootConfig = RootConfig;\n\n\n async ngOnInit() {\n await this.chartService.load();\n }\n\n\n protected async togglePermission(parent: string, child: string) {\n //TODO: Check the async and loading\n\n // Set the loading state for this cell to true.\n this.loadingStates.update((states) => {\n if (!states[parent]) {\n states[parent] = {};\n }\n states[parent][child] = true;\n return states;\n });\n\n\n\n this.chartService.set(parent, child, !this.chartService.get(parent, child));\n\n await this.chartService.update();\n\n // Turn off the loading state.\n this.loadingStates.update((states) => {\n if (!states[parent]) {\n states[parent] = {};\n }\n states[parent][child] = false;\n return states;\n });\n }\n\n\n}\n","<axp-layout-simple-page *translate=\"let t\">\n <axp-layout-header>\n <axp-layout-title> {{t(rootConfig.entities.structure.title) | async}} </axp-layout-title>\n\n <axp-layout-description>Customize your organization's hierarchical relationships</axp-layout-description>\n\n <axp-layout-actions>\n <axp-layout-actions-primary> </axp-layout-actions-primary>\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('reset') | async)!\">\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\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>\n Home\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n Organization\n </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n </axp-layout-header>\n\n <axp-layout-content>\n <div class=\"ax-flex ax-flex-col ax-gap-6 ax-w-full 2xl:ax-w-3/4 3xl:ax-w-1/2\">\n <div>\n <h3 class=\"ax-font-semibold ax-text-xl\">Relations Permissions</h3>\n <p class=\"ax-text-sm ax-opacity-85\">\n This matrix sets the relationships between nodes in your organization chart. Click a cell to toggle the\n relation between <span class=\"ax-text-danger-500\">Allowed</span> and <span\n class=\"ax-text-success-500\">Denied</span>.\n </p>\n </div>\n <div class=\"ax-rounded-md ax-overflow-hidden ax-w-full\">\n <table class=\" ax-table-auto ax-border-collapse ax-w-full ax-border-primary-darkest ax-rounded-md\">\n <thead>\n <tr class=\"ax-bg-primary-light ax-text-on-primary-light\">\n <!-- Top-left empty cell -->\n <th class=\"ax-border ax-border-primary-darkest ax-p-4 ax-min-w-44 ax-font-semibold ax-text-start\">Parent\n \\\n Child</th>\n <!-- Horizontal headers -->\n @for ( type of chartService.types; track $index) {\n <th class=\"ax-border ax-border-primary-darkest ax-p-4 ax-min-w-44 ax-text-center ax-font-semibold\">\n {{ type }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <!-- For each parent type, render a row with alternating backgrounds -->\n @for ( parent of chartService.types; track $index) {\n <tr>\n <!-- Vertical header cell with custom header colors -->\n <td\n class=\"ax-border ax-border-primary-darkest ax-p-4 ax-font-semibold ax-bg-primary-light ax-text-on-primary-light ax-text-start\">\n {{ parent }}\n </td>\n <!-- Render a cell for each potential child type -->\n @for ( child of chartService.types; track $index) {\n <td class=\"ax-border ax-border-primary-darkest ax-p-2 \">\n <div class=\"ax-flex ax-justify-center ax-cursor-pointer ax-sm\">\n @let isLoading = loadingStates()[parent]?.[child];\n <ax-button look=\"twotone\" [color]=\"chartService.isAllowed(parent, child) ? 'success' : 'danger'\"\n [text]=\"chartService.isAllowed(parent, child) ? 'Allowed' : 'Denied'\" [disabled]=\"isLoading\"\n (onClick)=\"togglePermission(parent, child)\">\n @if(isLoading)\n {\n <ax-loading></ax-loading>\n }\n </ax-button>\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <div>\n <ax-alert [color]=\"'warning'\">\n <ax-icon></ax-icon>\n <ax-title>Attention</ax-title>\n <ax-content>\n Changes made here will not update your current organization chart. They will only affect future charts or\n updates.\n </ax-content>\n </ax-alert>\n </div>\n </div>\n\n </axp-layout-content>\n</axp-layout-simple-page>"],"names":["i2","i3","i4","i5"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MAyDa,4BAA4B,CAAA;AA3BzC,IAAA,WAAA,GAAA;AA6BqB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACtC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAExD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAiE,EAAE,CAAC;QAEjF,IAAU,CAAA,UAAA,GAAG,UAAU;AAqC3C;AAlCC,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;;AAItB,IAAA,MAAM,gBAAgB,CAAC,MAAc,EAAE,KAAa,EAAA;;;QAI5D,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,KAAI;AACnC,YAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;AACnB,gBAAA,M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Z,WAAW;;wBAEX,mBAAmB;wBACnB,4BAA4B;wBAC5B,qCAAqC;wBACrC,8BAA8B;wBAC9B,2CAA2C;wBAC3C,yCAAyC;;wBAEzC,YAAY;wBACZ,cAAc;wBACd,sBAAsB;wBACtB,mBAAmB;wBACnB,iBAAiB;wBACjB,eAAe;wBACf,gBAAgB;wBAChB,mBAAmB;wBACnB;AACD,qBAAA,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA,CAAC,wBAAwB,CAAC,EAAA,QAAA,EAAA,0wIAAA,EAAA;;;;;"}
|
package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { inject, signal, Injectable } from '@angular/core';
|
3
|
+
import { AXPSettingService, AXPSettingScope } from '@acorex/platform/common';
|
4
|
+
import { A as AXPOrganizationSetting } from './acorex-modules-organization-managment-setting.keys-CF6Giykz.mjs';
|
5
|
+
|
6
|
+
class AXMOrgChartConfigService {
|
7
|
+
constructor() {
|
8
|
+
this.settingService = inject(AXPSettingService);
|
9
|
+
//
|
10
|
+
this._types = ['Company', 'Location', 'BusinessUnit', 'Role', 'Employee'];
|
11
|
+
this._defaultPermissioEncoded = '0111001110001100001100001';
|
12
|
+
this.permissions = signal(this.defaultPermissions());
|
13
|
+
}
|
14
|
+
get types() {
|
15
|
+
return this._types;
|
16
|
+
}
|
17
|
+
defaultPermissions() {
|
18
|
+
return this.decode(this._defaultPermissioEncoded);
|
19
|
+
}
|
20
|
+
encode(permissions) {
|
21
|
+
let str = '';
|
22
|
+
for (const parent of this.types) {
|
23
|
+
for (const child of this.types) {
|
24
|
+
str += (permissions[parent]?.[child] ?? 0).toString();
|
25
|
+
}
|
26
|
+
}
|
27
|
+
return str;
|
28
|
+
}
|
29
|
+
decode(encoded) {
|
30
|
+
const result = {};
|
31
|
+
const expectedLength = this.types.length * this.types.length;
|
32
|
+
if (encoded.length !== expectedLength) {
|
33
|
+
throw new Error(`Invalid permissions string length. Expected ${expectedLength} but got ${encoded.length}`);
|
34
|
+
}
|
35
|
+
let index = 0;
|
36
|
+
for (const parent of this.types) {
|
37
|
+
result[parent] = {};
|
38
|
+
for (const child of this.types) {
|
39
|
+
const char = encoded.charAt(index);
|
40
|
+
result[parent][child] = parseInt(char, 10);
|
41
|
+
index++;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return result;
|
45
|
+
}
|
46
|
+
decodeMatrix(matrix) {
|
47
|
+
const newPermissions = {};
|
48
|
+
this.types.forEach((parent, rowIndex) => {
|
49
|
+
newPermissions[parent] = {};
|
50
|
+
this.types.forEach((child, colIndex) => {
|
51
|
+
newPermissions[parent][child] = matrix[rowIndex][colIndex];
|
52
|
+
});
|
53
|
+
});
|
54
|
+
return newPermissions;
|
55
|
+
}
|
56
|
+
validateEncodedValue(storedValue) {
|
57
|
+
try {
|
58
|
+
if (typeof storedValue === 'string') {
|
59
|
+
const expectedLength = this.types.length * this.types.length;
|
60
|
+
// Check that the string is the correct length and only contains 0s and 1s.
|
61
|
+
if (storedValue.length === expectedLength && /^[01]+$/.test(storedValue)) {
|
62
|
+
return this.decode(storedValue);
|
63
|
+
}
|
64
|
+
}
|
65
|
+
else if (Array.isArray(storedValue)) {
|
66
|
+
// Validate the 2D array dimensions and values.
|
67
|
+
if (storedValue.length === this.types.length &&
|
68
|
+
storedValue.every(row => Array.isArray(row) &&
|
69
|
+
row.length === this.types.length &&
|
70
|
+
row.every(val => val === 0 || val === 1))) {
|
71
|
+
return this.decodeMatrix(storedValue);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
else if (typeof storedValue === 'object' && storedValue !== null) {
|
75
|
+
// Validate that the object has all the required keys and that their values are 0 or 1.
|
76
|
+
let valid = true;
|
77
|
+
for (const parent of this.types) {
|
78
|
+
if (!(parent in storedValue)) {
|
79
|
+
valid = false;
|
80
|
+
break;
|
81
|
+
}
|
82
|
+
const childPermissions = storedValue[parent];
|
83
|
+
for (const child of this.types) {
|
84
|
+
if (!(child in childPermissions) || (childPermissions[child] !== 0 && childPermissions[child] !== 1)) {
|
85
|
+
valid = false;
|
86
|
+
break;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
if (!valid)
|
90
|
+
break;
|
91
|
+
}
|
92
|
+
if (valid) {
|
93
|
+
return storedValue;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
catch (error) {
|
98
|
+
// In case of any errors during validation, fall back to default permissions.
|
99
|
+
}
|
100
|
+
// Return the default permissions if validation fails.
|
101
|
+
return this.defaultPermissions();
|
102
|
+
}
|
103
|
+
isAllowed(parent, child) {
|
104
|
+
return (this.permissions()[parent]?.[child] ?? 0) === 1;
|
105
|
+
}
|
106
|
+
set(parent, child, value) {
|
107
|
+
this.permissions.update((p) => {
|
108
|
+
if (!p[parent]) {
|
109
|
+
p[parent] = {};
|
110
|
+
}
|
111
|
+
p[parent][child] = value ? 1 : 0;
|
112
|
+
return p;
|
113
|
+
});
|
114
|
+
}
|
115
|
+
get(parent, child) {
|
116
|
+
return this.permissions()[parent]?.[child] === 1;
|
117
|
+
}
|
118
|
+
async load() {
|
119
|
+
const storedValue = await this.settingService
|
120
|
+
.scope(AXPSettingScope.Tenant)
|
121
|
+
.get(AXPOrganizationSetting.Relations);
|
122
|
+
// Use the validation method to ensure the stored value is correct.
|
123
|
+
if (storedValue) {
|
124
|
+
const validatedPermissions = this.validateEncodedValue(storedValue);
|
125
|
+
this.permissions.set(validatedPermissions);
|
126
|
+
}
|
127
|
+
else {
|
128
|
+
this.permissions.set(this.defaultPermissions());
|
129
|
+
}
|
130
|
+
}
|
131
|
+
async update() {
|
132
|
+
const matrix = this.encode(this.permissions());
|
133
|
+
await this.settingService
|
134
|
+
.scope(AXPSettingScope.Tenant)
|
135
|
+
.set(AXPOrganizationSetting.Relations, matrix);
|
136
|
+
}
|
137
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
138
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartConfigService }); }
|
139
|
+
}
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartConfigService, decorators: [{
|
141
|
+
type: Injectable
|
142
|
+
}] });
|
143
|
+
|
144
|
+
export { AXMOrgChartConfigService as A };
|
145
|
+
//# sourceMappingURL=acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs","sources":["../../../../libs/modules/organization-managment/src/lib/features/organization-chart/org-chart-configuration.service.ts"],"sourcesContent":["import { inject, Injectable, signal } from '@angular/core';\nimport { AXPSettingScope, AXPSettingService } from '@acorex/platform/common';\nimport { AXPOrganizationSetting } from '../../setting.keys';\n\n\n@Injectable()\nexport class AXMOrgChartConfigService {\n\n private readonly settingService = inject(AXPSettingService);\n //\n protected _types = ['Company', 'Location', 'BusinessUnit', 'Role', 'Employee'];\n\n public get types(): string[] {\n return this._types;\n }\n\n private _defaultPermissioEncoded = '0111001110001100001100001';\n\n protected permissions = signal<{ [parent: string]: { [child: string]: number } }>(this.defaultPermissions());\n\n\n private defaultPermissions() {\n return this.decode(this._defaultPermissioEncoded);\n }\n\n\n private encode(\n permissions: { [parent: string]: { [child: string]: number } }\n ): string {\n let str = '';\n for (const parent of this.types) {\n for (const child of this.types) {\n str += (permissions[parent]?.[child] ?? 0).toString();\n }\n }\n return str;\n }\n\n\n private decode(encoded: string): { [parent: string]: { [child: string]: number } } {\n const result: { [parent: string]: { [child: string]: number } } = {};\n const expectedLength = this.types.length * this.types.length;\n if (encoded.length !== expectedLength) {\n throw new Error(`Invalid permissions string length. Expected ${expectedLength} but got ${encoded.length}`);\n }\n let index = 0;\n for (const parent of this.types) {\n result[parent] = {};\n for (const child of this.types) {\n const char = encoded.charAt(index);\n result[parent][child] = parseInt(char, 10);\n index++;\n }\n }\n return result;\n }\n\n\n private decodeMatrix(matrix: number[][]): { [parent: string]: { [child: string]: number } } {\n const newPermissions: { [parent: string]: { [child: string]: number } } = {};\n this.types.forEach((parent, rowIndex) => {\n newPermissions[parent] = {};\n this.types.forEach((child, colIndex) => {\n newPermissions[parent][child] = matrix[rowIndex][colIndex];\n });\n });\n return newPermissions;\n }\n\n private validateEncodedValue(storedValue: unknown): { [parent: string]: { [child: string]: number } } {\n try {\n if (typeof storedValue === 'string') {\n const expectedLength = this.types.length * this.types.length;\n // Check that the string is the correct length and only contains 0s and 1s.\n if (storedValue.length === expectedLength && /^[01]+$/.test(storedValue)) {\n return this.decode(storedValue);\n }\n } else if (Array.isArray(storedValue)) {\n // Validate the 2D array dimensions and values.\n if (\n storedValue.length === this.types.length &&\n storedValue.every(\n row =>\n Array.isArray(row) &&\n row.length === this.types.length &&\n row.every(val => val === 0 || val === 1)\n )\n ) {\n return this.decodeMatrix(storedValue);\n }\n } else if (typeof storedValue === 'object' && storedValue !== null) {\n // Validate that the object has all the required keys and that their values are 0 or 1.\n let valid = true;\n for (const parent of this.types) {\n if (!(parent in storedValue)) {\n valid = false;\n break;\n }\n const childPermissions = (storedValue as any)[parent];\n for (const child of this.types) {\n if (!(child in childPermissions) || (childPermissions[child] !== 0 && childPermissions[child] !== 1)) {\n valid = false;\n break;\n }\n }\n if (!valid) break;\n }\n if (valid) {\n return storedValue as { [parent: string]: { [child: string]: number } };\n }\n }\n } catch (error) {\n // In case of any errors during validation, fall back to default permissions.\n }\n // Return the default permissions if validation fails.\n return this.defaultPermissions();\n }\n\n\n public isAllowed(parent: string, child: string): boolean {\n return (this.permissions()[parent]?.[child] ?? 0) === 1;\n }\n\n\n public set(parent: string, child: string, value: boolean) {\n this.permissions.update((p) => {\n if (!p[parent]) {\n p[parent] = {};\n }\n p[parent][child] = value ? 1 : 0;\n return p;\n });\n }\n\n public get(parent: string, child: string): boolean {\n return this.permissions()[parent]?.[child] === 1;\n }\n\n\n public async load() {\n const storedValue = await this.settingService\n .scope(AXPSettingScope.Tenant)\n .get(AXPOrganizationSetting.Relations);\n\n // Use the validation method to ensure the stored value is correct.\n if (storedValue) {\n const validatedPermissions = this.validateEncodedValue(storedValue);\n this.permissions.set(validatedPermissions);\n } else {\n this.permissions.set(this.defaultPermissions());\n }\n }\n\n public async update() {\n const matrix = this.encode(this.permissions());\n await this.settingService\n .scope(AXPSettingScope.Tenant)\n .set(AXPOrganizationSetting.Relations, matrix);\n }\n\n}\n"],"names":[],"mappings":";;;;;MAMa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;AAGqB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;AAEjD,QAAA,IAAA,CAAA,MAAM,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,CAAC;QAMtE,IAAwB,CAAA,wBAAA,GAAG,2BAA2B;QAEpD,IAAW,CAAA,WAAA,GAAG,MAAM,CAAoD,IAAI,CAAC,kBAAkB,EAAE,CAAC;AA8I/G;AApJG,IAAA,IAAW,KAAK,GAAA;QACZ,OAAO,IAAI,CAAC,MAAM;;IAQd,kBAAkB,GAAA;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC;;AAI7C,IAAA,MAAM,CACV,WAA8D,EAAA;QAE9D,IAAI,GAAG,GAAG,EAAE;AACZ,QAAA,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE;AAC7B,YAAA,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE;AAC5B,gBAAA,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,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,CAAC,WAAW,CAAC,GAAG,CAAC,oBAAoB,CAAC;;aACvC;YACH,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;;;AAIhD,IAAA,MAAM,MAAM,GAAA;QACf,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,IAAI,CAAC;AACN,aAAA,KAAK,CAAC,eAAe,CAAC,MAAM;AAC5B,aAAA,GAAG,CAAC,sBAAsB,CAAC,SAAS,EAAE,MAAM,CAAC;;8GAvJ7C,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAxB,wBAAwB,EAAA,CAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC;;;;;"}
|
@@ -1,4 +1,7 @@
|
|
1
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';
|
2
5
|
import * as i3 from '@acorex/components/button';
|
3
6
|
import { AXButtonModule } from '@acorex/components/button';
|
4
7
|
import * as i5 from '@acorex/components/decorators';
|
@@ -16,11 +19,11 @@ import { CommonModule } from '@angular/common';
|
|
16
19
|
import * as i0 from '@angular/core';
|
17
20
|
import { inject, Injectable, viewChild, NgZone, ViewContainerRef, signal, afterNextRender, Component, ChangeDetectionStrategy } from '@angular/core';
|
18
21
|
import { RouterModule } from '@angular/router';
|
22
|
+
import { AXMOrganizationManagementCompanyEntityService, AXMOrganizationManagementDepartmentEntityService, AXMOrganizationManagementEmployeeEntityService, AXMOrganizationManagementPositionEntityService, AXMOrganizationManagementChartEntityService, RootConfig } from './acorex-modules-organization-managment.mjs';
|
19
23
|
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
20
|
-
import { AXPExportService } from '@acorex/platform/common';
|
21
|
-
import
|
22
|
-
import {
|
23
|
-
import { RootConfig } from './acorex-modules-organization-managment.mjs';
|
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';
|
24
27
|
|
25
28
|
class AXMOrgChartPrintService {
|
26
29
|
constructor() {
|
@@ -121,13 +124,100 @@ class AXMOrgChartPrintService {
|
|
121
124
|
return (await this.translationService.translateAsync(key, { scope: 'organization-management' })) + '...';
|
122
125
|
}
|
123
126
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
124
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService
|
127
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService }); }
|
125
128
|
}
|
126
129
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPrintService, decorators: [{
|
127
|
-
type: Injectable
|
128
|
-
|
129
|
-
|
130
|
-
|
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
|
131
221
|
}] });
|
132
222
|
|
133
223
|
var AXMOrganizationNodeType;
|
@@ -360,10 +450,10 @@ class AXMOrgChartPage {
|
|
360
450
|
createChart(el, data) {
|
361
451
|
this.ngzone.runOutsideAngular(() => {
|
362
452
|
// Constants for node dimensions and spacing
|
363
|
-
const NODE_WIDTH_BASE =
|
364
|
-
const NODE_HEIGHT_BASE =
|
365
|
-
const HORIZONTAL_SPACING =
|
366
|
-
const VERTICAL_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
|
367
457
|
// Clear existing SVG and create a new one
|
368
458
|
this.clearChart(el);
|
369
459
|
const newSvg = this.d3.select(el).append('svg');
|
@@ -447,9 +537,10 @@ class AXMOrgChartPage {
|
|
447
537
|
element.appendChild(viewRef.rootNodes[0]);
|
448
538
|
}
|
449
539
|
}
|
450
|
-
toggleNode(data) {
|
540
|
+
toggleNode(data, el) {
|
451
541
|
data.isExpanded = data.isExpanded === undefined ? false : !data.isExpanded;
|
452
542
|
this.createChart(this.treeContainer().nativeElement, this.DATA); // Re-render the chart
|
543
|
+
el.scrollIntoView({ behavior: 'smooth' });
|
453
544
|
}
|
454
545
|
clearChart(el) {
|
455
546
|
this.d3.select(el).select('svg').remove();
|
@@ -471,11 +562,11 @@ class AXMOrgChartPage {
|
|
471
562
|
this.chartPrintService.printChart(this.treeContainer().nativeElement);
|
472
563
|
}
|
473
564
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
474
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMOrgChartPage, isStandalone: true, selector: "ng-component", providers: [], 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\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>\n Home\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n Organization\n </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 [target]=\"'.axp-org-chart-node'\" [orientation]=\"'vertical'\" [closeOn]=\"'leave'\"\n (onOpening)=\"handleContextMenuOnOpening($event)\">\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 <div 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\" (dblclick)=\"toggleNode(data)\">\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></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>", 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))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type:
|
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:
|
475
566
|
//
|
476
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:
|
477
568
|
//
|
478
|
-
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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
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 }); }
|
479
570
|
}
|
480
571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartPage, decorators: [{
|
481
572
|
type: Component,
|
@@ -497,9 +588,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
497
588
|
AXDecoratorModule,
|
498
589
|
AXPanViewDirective,
|
499
590
|
AXLoadingModule,
|
500
|
-
AXBreadcrumbsModule
|
501
|
-
|
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"] }]
|
502
594
|
}] });
|
503
595
|
|
504
596
|
export { AXMOrgChartPage };
|
505
|
-
//# sourceMappingURL=acorex-modules-organization-managment-org-chart.page-
|
597
|
+
//# sourceMappingURL=acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs.map
|