@acorex/platform 0.0.0-ACOREX
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/README.md +7 -0
- package/auth/README.md +3 -0
- package/common/README.md +3 -0
- package/core/README.md +4 -0
- package/fesm2022/acorex-platform-auth.mjs +1362 -0
- package/fesm2022/acorex-platform-auth.mjs.map +1 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-G9XcXXOG.mjs +127 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-G9XcXXOG.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +4601 -0
- package/fesm2022/acorex-platform-common.mjs.map +1 -0
- package/fesm2022/acorex-platform-core.mjs +4374 -0
- package/fesm2022/acorex-platform-core.mjs.map +1 -0
- package/fesm2022/acorex-platform-domain.mjs +3234 -0
- package/fesm2022/acorex-platform-domain.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-builder.mjs +2847 -0
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs +121 -0
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-components.mjs +8583 -0
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-designer.mjs +2474 -0
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-entity.mjs +19150 -0
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-views.mjs +1468 -0
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widget-core.mjs +2950 -0
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs +72 -0
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs +158 -0
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs +29 -0
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs +172 -0
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGQqY5Mw.mjs +111 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGQqY5Mw.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs +274 -0
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs +64 -0
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs +34 -0
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +29791 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -0
- package/fesm2022/acorex-platform-native.mjs +155 -0
- package/fesm2022/acorex-platform-native.mjs.map +1 -0
- package/fesm2022/acorex-platform-runtime-catalog-command-definition.mjs +20 -0
- package/fesm2022/acorex-platform-runtime-catalog-command-definition.mjs.map +1 -0
- package/fesm2022/acorex-platform-runtime-catalog-query-definition.mjs +20 -0
- package/fesm2022/acorex-platform-runtime-catalog-query-definition.mjs.map +1 -0
- package/fesm2022/acorex-platform-runtime.mjs +899 -0
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs +160 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs +120 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs +237 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs +31 -0
- package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs +25 -0
- package/fesm2022/acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +2589 -0
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs +55 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs +57 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs +168 -0
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-CHfrTtol.mjs +65 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-CHfrTtol.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BSmvnUVq.mjs +64 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BSmvnUVq.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +2125 -0
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -0
- package/fesm2022/acorex-platform-workflow.mjs +2501 -0
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -0
- package/fesm2022/acorex-platform.mjs +6 -0
- package/fesm2022/acorex-platform.mjs.map +1 -0
- package/layout/builder/README.md +1578 -0
- package/layout/components/README.md +3 -0
- package/layout/designer/README.md +4 -0
- package/layout/entity/README.md +4 -0
- package/layout/views/README.md +3 -0
- package/layout/widget-core/README.md +4 -0
- package/layout/widgets/README.md +3 -0
- package/native/README.md +4 -0
- package/package.json +103 -0
- package/runtime/README.md +3 -0
- package/themes/default/README.md +3 -0
- package/themes/shared/README.md +3 -0
- package/types/acorex-platform-auth.d.ts +680 -0
- package/types/acorex-platform-common.d.ts +2926 -0
- package/types/acorex-platform-core.d.ts +2896 -0
- package/types/acorex-platform-domain.d.ts +2353 -0
- package/types/acorex-platform-layout-builder.d.ts +926 -0
- package/types/acorex-platform-layout-components.d.ts +2903 -0
- package/types/acorex-platform-layout-designer.d.ts +422 -0
- package/types/acorex-platform-layout-entity.d.ts +3189 -0
- package/types/acorex-platform-layout-views.d.ts +667 -0
- package/types/acorex-platform-layout-widget-core.d.ts +1086 -0
- package/types/acorex-platform-layout-widgets.d.ts +5478 -0
- package/types/acorex-platform-native.d.ts +28 -0
- package/types/acorex-platform-runtime-catalog-command-definition.d.ts +137 -0
- package/types/acorex-platform-runtime-catalog-query-definition.d.ts +125 -0
- package/types/acorex-platform-runtime.d.ts +470 -0
- package/types/acorex-platform-themes-default.d.ts +573 -0
- package/types/acorex-platform-themes-shared.d.ts +170 -0
- package/types/acorex-platform-workflow.d.ts +1806 -0
- package/types/acorex-platform.d.ts +2 -0
- package/workflow/README.md +4 -0
|
@@ -0,0 +1,2589 @@
|
|
|
1
|
+
import * as i1 from '@acorex/components/action-sheet';
|
|
2
|
+
import { AXActionSheetModule } from '@acorex/components/action-sheet';
|
|
3
|
+
import * as i4 from '@acorex/components/badge';
|
|
4
|
+
import { AXBadgeModule } from '@acorex/components/badge';
|
|
5
|
+
import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
|
|
6
|
+
import * as i3 from '@acorex/components/button';
|
|
7
|
+
import { AXButtonModule } from '@acorex/components/button';
|
|
8
|
+
import * as i7 from '@acorex/components/data-table';
|
|
9
|
+
import { AXDataTableModule } from '@acorex/components/data-table';
|
|
10
|
+
import * as i2$1 from '@acorex/components/decorators';
|
|
11
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
12
|
+
import { AXDialogModule } from '@acorex/components/dialog';
|
|
13
|
+
import * as i3$2 from '@acorex/components/drawer';
|
|
14
|
+
import { AXDrawerModule } from '@acorex/components/drawer';
|
|
15
|
+
import * as i5 from '@acorex/components/dropdown';
|
|
16
|
+
import { AXDropdownModule } from '@acorex/components/dropdown';
|
|
17
|
+
import { AXFormModule } from '@acorex/components/form';
|
|
18
|
+
import { AXLoadingModule } from '@acorex/components/loading';
|
|
19
|
+
import * as i3$1 from '@acorex/components/popover';
|
|
20
|
+
import { AXPopoverModule } from '@acorex/components/popover';
|
|
21
|
+
import * as i6 from '@acorex/components/search-box';
|
|
22
|
+
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
|
23
|
+
import { AXTabsModule } from '@acorex/components/tabs';
|
|
24
|
+
import { AXTooltipModule } from '@acorex/components/tooltip';
|
|
25
|
+
import * as i10 from '@acorex/core/translation';
|
|
26
|
+
import { AXTranslationModule, AXTranslationService, translateSync } from '@acorex/core/translation';
|
|
27
|
+
import * as i2 from '@acorex/core/utils';
|
|
28
|
+
import { AXUnsubscriber } from '@acorex/core/utils';
|
|
29
|
+
import { AXPAuthModule, AXPSessionService, AXPSessionStatus, AXPAuthGuard } from '@acorex/platform/auth';
|
|
30
|
+
import { AXPRefreshEvent, AXPSettingsService, AXPCommonSettings, AXP_PLATFORM_CONFIG_TOKEN, AXPMenuService, AXPMenuVisibilityService, AXPCommonModule } from '@acorex/platform/common';
|
|
31
|
+
import * as i1$3 from '@acorex/platform/core';
|
|
32
|
+
import { AXPDeviceService, AXHighlightService, AXPResolveMultiLanguageStringPipe, AXPComponentSlotModule, AXPPlatformScope, AXPBroadcastEventService, AXPContextStore } from '@acorex/platform/core';
|
|
33
|
+
import { AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY, AXPEntityDefinitionRegistryService, AXPCategoryTreeService, AXPEntityListViewColumnViewModel, AXP_ENTITY_CONFIG_TOKEN } from '@acorex/platform/layout/entity';
|
|
34
|
+
import * as i7$1 from '@acorex/platform/layout/widget-core';
|
|
35
|
+
import { AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
|
|
36
|
+
import { AXPWidgetsModule } from '@acorex/platform/layout/widgets';
|
|
37
|
+
import { AXPLayoutThemeService, AXPThemeLayoutSetting, AXPThemesSharedModule } from '@acorex/platform/themes/shared';
|
|
38
|
+
import { AXPWorkflowService, ofType } from '@acorex/platform/workflow';
|
|
39
|
+
import * as i1$1 from '@angular/common';
|
|
40
|
+
import { CommonModule } from '@angular/common';
|
|
41
|
+
import * as i0 from '@angular/core';
|
|
42
|
+
import { inject, signal, computed, effect, ViewChild, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, input, viewChild, afterNextRender, NgModule } from '@angular/core';
|
|
43
|
+
import { FormsModule } from '@angular/forms';
|
|
44
|
+
import * as i1$4 from '@angular/router';
|
|
45
|
+
import { RouterModule, Router, ActivatedRoute, NavigationEnd, RouteReuseStrategy, ROUTES } from '@angular/router';
|
|
46
|
+
import { Subject, takeUntil, filter, firstValueFrom } from 'rxjs';
|
|
47
|
+
import * as i1$2 from '@acorex/core/platform';
|
|
48
|
+
import { AXPThemeLayoutBlockComponent, AXPThemeLayoutHeaderComponent, AXPThemeLayoutToolbarComponent, AXPStateMessageComponent, AXPQueryFiltersComponent, AXPQuerySortsComponent, AXPQueryViewsComponent, AXPQueryColumnsComponent, AXPThemeLayoutStartSideComponent, AXPTaskBadgeService, AXPMenuBadgeHelper, AXPTaskBadgeDirective, AXPLogoComponent } from '@acorex/platform/layout/components';
|
|
49
|
+
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
50
|
+
import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
|
|
51
|
+
import { AXPPageLayoutBaseComponent, AXPPageLayoutComponent, AXPPageLayoutBase } from '@acorex/platform/layout/views';
|
|
52
|
+
import * as i2$2 from '@acorex/components/skeleton';
|
|
53
|
+
import { AXSkeletonModule } from '@acorex/components/skeleton';
|
|
54
|
+
import { AXTreeViewModule, AXTreeViewComponent } from '@acorex/components/tree-view';
|
|
55
|
+
import { AXPCommandService } from '@acorex/platform/runtime';
|
|
56
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
57
|
+
import { isEqual, sortBy } from 'lodash-es';
|
|
58
|
+
import * as i2$3 from '@acorex/components/side-menu';
|
|
59
|
+
import { AXSideMenuModule } from '@acorex/components/side-menu';
|
|
60
|
+
import { AXAvatarModule } from '@acorex/components/avatar';
|
|
61
|
+
import { AXImageModule } from '@acorex/components/image';
|
|
62
|
+
import * as i4$1 from '@acorex/components/menu';
|
|
63
|
+
import { AXMenuModule } from '@acorex/components/menu';
|
|
64
|
+
import sortBy$1 from 'lodash-es/sortBy';
|
|
65
|
+
import { AXResizableDirective } from '@acorex/cdk/resizable';
|
|
66
|
+
|
|
67
|
+
class AXPEntityDetailListViewComponent {
|
|
68
|
+
constructor(actionSheetService, unsubscriber) {
|
|
69
|
+
this.actionSheetService = actionSheetService;
|
|
70
|
+
this.unsubscriber = unsubscriber;
|
|
71
|
+
this.workflow = inject(AXPWorkflowService);
|
|
72
|
+
this.store = inject(AXPLayoutThemeService);
|
|
73
|
+
this.deviceService = inject(AXPDeviceService);
|
|
74
|
+
this.toolbarPrimaryActions = signal([], ...(ngDevMode ? [{ debugName: "toolbarPrimaryActions" }] : /* istanbul ignore next */ []));
|
|
75
|
+
this.toolbarSecondaryActions = signal([], ...(ngDevMode ? [{ debugName: "toolbarSecondaryActions" }] : /* istanbul ignore next */ []));
|
|
76
|
+
this.destroyed = new Subject();
|
|
77
|
+
this.dropdownRowItems = computed(() => {
|
|
78
|
+
return this.vm.secondaryRowActions().map((c) => ({
|
|
79
|
+
icon: c.icon,
|
|
80
|
+
name: c.name,
|
|
81
|
+
text: c.title,
|
|
82
|
+
color: c.color,
|
|
83
|
+
}));
|
|
84
|
+
}, ...(ngDevMode ? [{ debugName: "dropdownRowItems" }] : /* istanbul ignore next */ []));
|
|
85
|
+
this.commandRowItems = computed(() => {
|
|
86
|
+
return this.vm.primaryRowActions().map((c) => {
|
|
87
|
+
return {
|
|
88
|
+
icon: c.icon,
|
|
89
|
+
name: c.name,
|
|
90
|
+
text: c.title,
|
|
91
|
+
color: c.color,
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
}, ...(ngDevMode ? [{ debugName: "commandRowItems" }] : /* istanbul ignore next */ []));
|
|
95
|
+
this.getCommandRowItems = () => {
|
|
96
|
+
return this.commandRowItems();
|
|
97
|
+
};
|
|
98
|
+
this.getDropdownRowItems = (rowData) => {
|
|
99
|
+
return Promise.resolve(this.dropdownRowItems());
|
|
100
|
+
};
|
|
101
|
+
effect(() => {
|
|
102
|
+
this.grid.selectedRows = this.vm.selectedItems();
|
|
103
|
+
// Re-evaluate toolbar actions whenever selection changes
|
|
104
|
+
this.refreshToolbarActions();
|
|
105
|
+
});
|
|
106
|
+
this.subscribeActionEvents();
|
|
107
|
+
}
|
|
108
|
+
handleChangeSearchValue(e) {
|
|
109
|
+
if (e.isUserInteraction) {
|
|
110
|
+
this.vm.applyInlineFilter(e.value);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
subscribeActionEvents() {
|
|
114
|
+
this.workflow.events$
|
|
115
|
+
.pipe(ofType(AXPRefreshEvent))
|
|
116
|
+
.pipe(takeUntil(this.destroyed))
|
|
117
|
+
.subscribe((event) => {
|
|
118
|
+
console.log(event);
|
|
119
|
+
this.grid.refresh({
|
|
120
|
+
reset: false,
|
|
121
|
+
});
|
|
122
|
+
// Re-evaluate toolbar actions after refresh events
|
|
123
|
+
this.refreshToolbarActions();
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
ngAfterViewInit() {
|
|
127
|
+
// this.grid.refresh();
|
|
128
|
+
this.refreshToolbarActions();
|
|
129
|
+
}
|
|
130
|
+
async handleRowDbClick(e) {
|
|
131
|
+
const allItems = [...this.commandRowItems(), ...this.dropdownRowItems()];
|
|
132
|
+
// const defaultAction = allItems.find((c) => (c as any).default) || allItems[0];
|
|
133
|
+
const defaultAction = allItems.find((c) => c.default);
|
|
134
|
+
if (!defaultAction) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const d = {
|
|
138
|
+
component: e.component,
|
|
139
|
+
name: defaultAction.name,
|
|
140
|
+
data: e.data,
|
|
141
|
+
};
|
|
142
|
+
this.handleRowCommandClick(d);
|
|
143
|
+
}
|
|
144
|
+
async handleSelectedRowsChange(rows) {
|
|
145
|
+
this.vm.selectedItems.set(rows);
|
|
146
|
+
}
|
|
147
|
+
async handleRowCommandClick(e) {
|
|
148
|
+
this.vm.executeCommand(e.name, e.data);
|
|
149
|
+
}
|
|
150
|
+
async refreshToolbarActions() {
|
|
151
|
+
const [primary, secondary] = await Promise.all([this.vm.getPrimaryActions(), this.vm.getSecondaryActions()]);
|
|
152
|
+
this.toolbarPrimaryActions.set(primary);
|
|
153
|
+
this.toolbarSecondaryActions.set(secondary);
|
|
154
|
+
}
|
|
155
|
+
destroy() {
|
|
156
|
+
this.destroyed.next();
|
|
157
|
+
this.destroyed.complete();
|
|
158
|
+
}
|
|
159
|
+
ngOnDestroy() {
|
|
160
|
+
this.destroy();
|
|
161
|
+
}
|
|
162
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityDetailListViewComponent, deps: [{ token: i1.AXActionSheetService }, { token: i2.AXUnsubscriber }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
163
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPEntityDetailListViewComponent, isStandalone: true, selector: "axp-entity-detail-list-view", inputs: { vm: ["viewModel", "vm"] }, providers: [AXUnsubscriber], viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"ax-flex ax-p-2\">\n <div class=\"ax-flex ax-flex-col ax-items-end ax-gap-3 ax-flex-1 ax-overflow-auto ax-min-h-72\">\n <div class=\"ax-flex ax-justify-between ax-items-center ax-w-full\">\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <div class=\"ax-flex ax-justify-start ax-items-center ax-gap-4\">\n @if (vm.hasSelectedItems()) {\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-h-10\">\n <span class=\"ax-text-xl ax-font-bold\">\n {{ vm.selectedItems().length }}\n {{ '@general:terms.items-selected' | translate | async }}\n </span>\n <span\n (click)=\"vm.clearSelection()\"\n class=\"ax-text-sm ax-text-primary-500 ax-underline ax-cursor-pointer\"\n >{{ '@general:actions.unselect.title' | translate | async }}</span\n >\n </div>\n } @else {\n @if (vm.hasInlineFilters() && !deviceService.isSmall()) {\n <div class=\"ax-w-72\">\n <ax-search-box\n [placeholder]=\"\n ('@general:widgets.lookup.search' | translate | async) + vm.inlineFiltersPlaceholders().join(', ')\n \"\n (onValueChanged)=\"handleChangeSearchValue($event)\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n }\n }\n </div>\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n @for (tr of toolbarPrimaryActions(); track $index) {\n <ax-button\n [text]=\"(tr.title | translate | async)!\"\n [color]=\"tr.color\"\n [disabled]=\"tr.disabled\"\n (onClick)=\"vm.executeCommand(tr.name)\"\n >\n <ax-prefix>\n <ax-icon [icon]=\"tr.icon\"> </ax-icon>\n </ax-prefix>\n </ax-button>\n }\n @if (toolbarSecondaryActions().length) {\n <ax-button\n [text]=\"deviceService.isSmall() ? null : ('@general:terms.interface.actions' | translate | async)\"\n [color]=\"'default'\"\n >\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel>\n <ax-button-item-list>\n @for (tr of toolbarSecondaryActions(); track $index) {\n <ng-container>\n @if (tr.separated && !$first) {\n <ax-divider></ax-divider>\n }\n <ax-button-item\n [text]=\"(tr.title | translate | async)!\"\n class=\"ax-font-semibold ax-text-{{ tr.color }}\"\n (onClick)=\"vm.executeCommand(tr.name)\"\n >\n <ax-prefix>\n <ax-icon [icon]=\"tr.icon\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ng-container>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n </div>\n\n <div class=\"ax-flex ax-flex-1 ax-pt-0 ax-overflow-auto ax-max-w-full\">\n <ax-data-table\n #grid\n [showFooter]=\"false\"\n class=\"ax-flex-1\"\n [paging]=\"true\"\n [fetchDataMode]=\"'manual'\"\n [parentField]=\"vm.parentKey()\"\n [loading]=\"{ enabled: true, animation: true }\"\n [dataSource]=\"vm.dataSource\"\n (selectedRowsChange)=\"handleSelectedRowsChange($event)\"\n (onRowDbClick)=\"handleRowDbClick($event)\"\n >\n <ax-index-column fixed=\"start\" [width]=\"'80px'\" [padZero]=\"true\"></ax-index-column>\n @if (vm.selectedScopeActionsCount()) {\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n }\n @for (col of vm.columns(); track col.name) {\n @if (col.visible) {\n <axp-widget-column-renderer\n [expandHandler]=\"$index === 0 && vm.parentKey() ? true : false\"\n [caption]=\"(col.title | translate | async)!\"\n [node]=\"col.node()\"\n ></axp-widget-column-renderer>\n }\n }\n @if (getCommandRowItems().length) {\n <ax-command-column\n fixed=\"end\"\n [width]=\"getCommandRowItems().length * 60 + 'px'\"\n [items]=\"getCommandRowItems()\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-command-column>\n }\n @if (dropdownRowItems().length) {\n <ax-dropdown-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n }\n </ax-data-table>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items", "closeParentOnClick", "lockOnLoading"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2$1.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i2$1.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: AXBadgeModule }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i5.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXActionSheetModule }, { kind: "ngmodule", type: AXDrawerModule }, { kind: "ngmodule", type: AXDialogModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTabsModule }, { kind: "ngmodule", type: AXTooltipModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i6.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i7.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "selectedRows", "parentField", "hasChildrenField", "rowDetailsTemplate", "title", "rowTemplate", "emptyTemplate", "noDataTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged", "onPageChanged"] }, { kind: "component", type: i7.AXRowIndexColumnComponent, selector: "ax-index-column", inputs: ["width", "caption", "fixed", "footerTemplate", "padZero"] }, { kind: "component", type: i7.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "component", type: i7.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i7.AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "emptyStateTemplate", "emptyStateText", "items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type:
|
|
164
|
+
//
|
|
165
|
+
AXPWidgetCoreModule }, { kind: "component", type: i7$1.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "customExpandIcon", "customCollapseIcon", "customWidth", "node", "footerTemplate", "expandHandler", "cellTemplate", "headerTemplate"] }, { kind: "ngmodule", type: AXPWidgetsModule }, { kind: "ngmodule", type: AXPAuthModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
166
|
+
}
|
|
167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityDetailListViewComponent, decorators: [{
|
|
168
|
+
type: Component,
|
|
169
|
+
args: [{ selector: 'axp-entity-detail-list-view', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [AXUnsubscriber], imports: [
|
|
170
|
+
CommonModule,
|
|
171
|
+
FormsModule,
|
|
172
|
+
RouterModule,
|
|
173
|
+
AXButtonModule,
|
|
174
|
+
AXDecoratorModule,
|
|
175
|
+
AXBadgeModule,
|
|
176
|
+
AXDropdownModule,
|
|
177
|
+
AXPopoverModule,
|
|
178
|
+
AXFormModule,
|
|
179
|
+
AXActionSheetModule,
|
|
180
|
+
AXDrawerModule,
|
|
181
|
+
AXDialogModule,
|
|
182
|
+
AXLoadingModule,
|
|
183
|
+
AXTabsModule,
|
|
184
|
+
AXTooltipModule,
|
|
185
|
+
AXBreadcrumbsModule,
|
|
186
|
+
AXSearchBoxModule,
|
|
187
|
+
AXDataTableModule,
|
|
188
|
+
//
|
|
189
|
+
AXPWidgetCoreModule,
|
|
190
|
+
AXPWidgetsModule,
|
|
191
|
+
AXPAuthModule,
|
|
192
|
+
AXTranslationModule,
|
|
193
|
+
], template: "<div class=\"ax-flex ax-p-2\">\n <div class=\"ax-flex ax-flex-col ax-items-end ax-gap-3 ax-flex-1 ax-overflow-auto ax-min-h-72\">\n <div class=\"ax-flex ax-justify-between ax-items-center ax-w-full\">\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <div class=\"ax-flex ax-justify-start ax-items-center ax-gap-4\">\n @if (vm.hasSelectedItems()) {\n <div class=\"ax-flex ax-gap-3 ax-items-center ax-h-10\">\n <span class=\"ax-text-xl ax-font-bold\">\n {{ vm.selectedItems().length }}\n {{ '@general:terms.items-selected' | translate | async }}\n </span>\n <span\n (click)=\"vm.clearSelection()\"\n class=\"ax-text-sm ax-text-primary-500 ax-underline ax-cursor-pointer\"\n >{{ '@general:actions.unselect.title' | translate | async }}</span\n >\n </div>\n } @else {\n @if (vm.hasInlineFilters() && !deviceService.isSmall()) {\n <div class=\"ax-w-72\">\n <ax-search-box\n [placeholder]=\"\n ('@general:widgets.lookup.search' | translate | async) + vm.inlineFiltersPlaceholders().join(', ')\n \"\n (onValueChanged)=\"handleChangeSearchValue($event)\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </div>\n }\n }\n </div>\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-3\">\n @for (tr of toolbarPrimaryActions(); track $index) {\n <ax-button\n [text]=\"(tr.title | translate | async)!\"\n [color]=\"tr.color\"\n [disabled]=\"tr.disabled\"\n (onClick)=\"vm.executeCommand(tr.name)\"\n >\n <ax-prefix>\n <ax-icon [icon]=\"tr.icon\"> </ax-icon>\n </ax-prefix>\n </ax-button>\n }\n @if (toolbarSecondaryActions().length) {\n <ax-button\n [text]=\"deviceService.isSmall() ? null : ('@general:terms.interface.actions' | translate | async)\"\n [color]=\"'default'\"\n >\n <ax-prefix>\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n </ax-prefix>\n <ax-dropdown-panel>\n <ax-button-item-list>\n @for (tr of toolbarSecondaryActions(); track $index) {\n <ng-container>\n @if (tr.separated && !$first) {\n <ax-divider></ax-divider>\n }\n <ax-button-item\n [text]=\"(tr.title | translate | async)!\"\n class=\"ax-font-semibold ax-text-{{ tr.color }}\"\n (onClick)=\"vm.executeCommand(tr.name)\"\n >\n <ax-prefix>\n <ax-icon [icon]=\"tr.icon\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ng-container>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n </div>\n </div>\n\n <div class=\"ax-flex ax-flex-1 ax-pt-0 ax-overflow-auto ax-max-w-full\">\n <ax-data-table\n #grid\n [showFooter]=\"false\"\n class=\"ax-flex-1\"\n [paging]=\"true\"\n [fetchDataMode]=\"'manual'\"\n [parentField]=\"vm.parentKey()\"\n [loading]=\"{ enabled: true, animation: true }\"\n [dataSource]=\"vm.dataSource\"\n (selectedRowsChange)=\"handleSelectedRowsChange($event)\"\n (onRowDbClick)=\"handleRowDbClick($event)\"\n >\n <ax-index-column fixed=\"start\" [width]=\"'80px'\" [padZero]=\"true\"></ax-index-column>\n @if (vm.selectedScopeActionsCount()) {\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n }\n @for (col of vm.columns(); track col.name) {\n @if (col.visible) {\n <axp-widget-column-renderer\n [expandHandler]=\"$index === 0 && vm.parentKey() ? true : false\"\n [caption]=\"(col.title | translate | async)!\"\n [node]=\"col.node()\"\n ></axp-widget-column-renderer>\n }\n }\n @if (getCommandRowItems().length) {\n <ax-command-column\n fixed=\"end\"\n [width]=\"getCommandRowItems().length * 60 + 'px'\"\n [items]=\"getCommandRowItems()\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-command-column>\n }\n @if (dropdownRowItems().length) {\n <ax-dropdown-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n }\n </ax-data-table>\n </div>\n </div>\n</div>\n" }]
|
|
194
|
+
}], ctorParameters: () => [{ type: i1.AXActionSheetService }, { type: i2.AXUnsubscriber }], propDecorators: { vm: [{
|
|
195
|
+
type: Input,
|
|
196
|
+
args: ['viewModel']
|
|
197
|
+
}], grid: [{
|
|
198
|
+
type: ViewChild,
|
|
199
|
+
args: ['grid', { static: true }]
|
|
200
|
+
}] } });
|
|
201
|
+
|
|
202
|
+
//#region ---- Constants ----
|
|
203
|
+
const ROOT_NODE_ID = 'all';
|
|
204
|
+
const LOADING_DELAY_MS = 300;
|
|
205
|
+
const DEFAULT_TEXT_FIELD = 'title';
|
|
206
|
+
const DEFAULT_VALUE_FIELD = 'id';
|
|
207
|
+
//#endregion
|
|
208
|
+
class AXPEntityCategoryComponent {
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region ---- Constructor & Lifecycle ----
|
|
211
|
+
constructor() {
|
|
212
|
+
//#region ---- Services & Dependencies ----
|
|
213
|
+
/** i18n key for the synthetic "all items" root row; resolved in the template with the translate pipe. */
|
|
214
|
+
this.categoryTreeRootTitleI18nKey = AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY;
|
|
215
|
+
this.translate = inject(AXTranslationService);
|
|
216
|
+
this.workflow = inject(AXPWorkflowService);
|
|
217
|
+
this.commandService = inject(AXPCommandService);
|
|
218
|
+
this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
|
|
219
|
+
this.categoryTreeService = inject(AXPCategoryTreeService);
|
|
220
|
+
this.highlightService = inject(AXHighlightService);
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region ---- Component Inputs & View Queries ----
|
|
223
|
+
this.vm = input.required(...(ngDevMode ? [{ debugName: "vm" }] : /* istanbul ignore next */ []));
|
|
224
|
+
this.tree = viewChild('tree', ...(ngDevMode ? [{ debugName: "tree" }] : /* istanbul ignore next */ []));
|
|
225
|
+
this.searchValue = input('', ...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
|
|
226
|
+
// Tree view inputs with defaults
|
|
227
|
+
this.selectMode = input('single', ...(ngDevMode ? [{ debugName: "selectMode" }] : /* istanbul ignore next */ []));
|
|
228
|
+
this.selectionBehavior = input('intermediate', ...(ngDevMode ? [{ debugName: "selectionBehavior" }] : /* istanbul ignore next */ []));
|
|
229
|
+
this.dragArea = input('handler', ...(ngDevMode ? [{ debugName: "dragArea" }] : /* istanbul ignore next */ []));
|
|
230
|
+
this.dragBehavior = input('none', ...(ngDevMode ? [{ debugName: "dragBehavior" }] : /* istanbul ignore next */ []));
|
|
231
|
+
this.showIcons = input(true, ...(ngDevMode ? [{ debugName: "showIcons" }] : /* istanbul ignore next */ []));
|
|
232
|
+
this.showChildrenBadge = input(false, ...(ngDevMode ? [{ debugName: "showChildrenBadge" }] : /* istanbul ignore next */ []));
|
|
233
|
+
this.expandedIcon = input('fa-solid fa-chevron-down', ...(ngDevMode ? [{ debugName: "expandedIcon" }] : /* istanbul ignore next */ []));
|
|
234
|
+
this.collapsedIcon = input('fa-solid fa-chevron-right', ...(ngDevMode ? [{ debugName: "collapsedIcon" }] : /* istanbul ignore next */ []));
|
|
235
|
+
this.indentSize = input(16, ...(ngDevMode ? [{ debugName: "indentSize" }] : /* istanbul ignore next */ []));
|
|
236
|
+
this.look = input('default', ...(ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []));
|
|
237
|
+
this.searchWithChildren = input(true, ...(ngDevMode ? [{ debugName: "searchWithChildren" }] : /* istanbul ignore next */ [])); // Include children of search results
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region ---- Component State ----
|
|
240
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
241
|
+
this.isSearching = signal(false, ...(ngDevMode ? [{ debugName: "isSearching" }] : /* istanbul ignore next */ []));
|
|
242
|
+
this.searchResultCount = signal(0, ...(ngDevMode ? [{ debugName: "searchResultCount" }] : /* istanbul ignore next */ []));
|
|
243
|
+
this.currentSearchValue = signal('', ...(ngDevMode ? [{ debugName: "currentSearchValue" }] : /* istanbul ignore next */ []));
|
|
244
|
+
this.resultsFoundText = signal('', ...(ngDevMode ? [{ debugName: "resultsFoundText" }] : /* istanbul ignore next */ []));
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region ---- Private Properties ----
|
|
247
|
+
this.loadingTimeoutId = null;
|
|
248
|
+
this.treeData = null;
|
|
249
|
+
this.treeConfig = null;
|
|
250
|
+
this.matchingNodeIds = new Set();
|
|
251
|
+
this.relevantNodeIds = new Set(); // For search filtering
|
|
252
|
+
this.nodeDataCache = new Map(); // Cache parent data from search results
|
|
253
|
+
this.expandedNodesBeforeSearch = [];
|
|
254
|
+
this.nodesExpandedDuringSearch = [];
|
|
255
|
+
this.currentSearchTerm = null;
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region ---- Computed Properties ----
|
|
258
|
+
this.textField = computed(() => this.vm().entityDef.category?.textField || DEFAULT_TEXT_FIELD, ...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
259
|
+
this.valueField = computed(() => this.vm().entityDef.category?.valueField || DEFAULT_VALUE_FIELD, ...(ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
260
|
+
/** When true, add/edit/delete category actions are hidden (from category plugin readonly option). */
|
|
261
|
+
this.categoryReadonly = computed(() => this.vm().entityDef?.extensions?.category?.readonly === true, ...(ngDevMode ? [{ debugName: "categoryReadonly" }] : /* istanbul ignore next */ []));
|
|
262
|
+
/**
|
|
263
|
+
* Computed property to check if we should show the "no search results" empty state.
|
|
264
|
+
* Returns true when search is active, not searching, and no results found.
|
|
265
|
+
*/
|
|
266
|
+
this.showNoSearchResults = computed(() => {
|
|
267
|
+
const searchValue = this.currentSearchValue().trim();
|
|
268
|
+
const isSearching = this.isSearching();
|
|
269
|
+
const resultCount = this.searchResultCount();
|
|
270
|
+
return searchValue.length > 0 && !isSearching && resultCount === 0;
|
|
271
|
+
}, ...(ngDevMode ? [{ debugName: "showNoSearchResults" }] : /* istanbul ignore next */ []));
|
|
272
|
+
this.categoryEntityKey = computed(() => {
|
|
273
|
+
const key = this.vm().entityDef.category?.entity;
|
|
274
|
+
if (!key) {
|
|
275
|
+
throw new Error('Category entity is not configured');
|
|
276
|
+
}
|
|
277
|
+
return key;
|
|
278
|
+
}, ...(ngDevMode ? [{ debugName: "categoryEntityKey" }] : /* istanbul ignore next */ []));
|
|
279
|
+
// protected toggleExpand(e: AXTreeViewNodeDoubleClickEvent) {
|
|
280
|
+
// (e.component as AXTreeViewComponent).toggleNodeExpansion(String(e.node[this.valueField()] ?? ''));
|
|
281
|
+
// }
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region ---- Tree Data Source ----
|
|
284
|
+
/**
|
|
285
|
+
* Datasource callback for tree-view component.
|
|
286
|
+
* Provides lazy loading support for tree nodes.
|
|
287
|
+
*/
|
|
288
|
+
this.datasource = async (parentId) => {
|
|
289
|
+
if (!this.isTreeInitialized()) {
|
|
290
|
+
return [];
|
|
291
|
+
}
|
|
292
|
+
// Load root nodes if no parent ID provided
|
|
293
|
+
if (!parentId) {
|
|
294
|
+
return await this.loadRootNodes();
|
|
295
|
+
}
|
|
296
|
+
// Load children for the specified parent
|
|
297
|
+
return await this.loadChildNodes(parentId);
|
|
298
|
+
};
|
|
299
|
+
afterNextRender(() => {
|
|
300
|
+
this.initializeTree();
|
|
301
|
+
});
|
|
302
|
+
this.workflow.events$
|
|
303
|
+
.pipe(ofType(AXPRefreshEvent))
|
|
304
|
+
.pipe(takeUntilDestroyed())
|
|
305
|
+
.subscribe((event) => {
|
|
306
|
+
this.tree()?.reloadData();
|
|
307
|
+
// this.tree()?.refresh();
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region ---- Public Methods ----
|
|
312
|
+
/**
|
|
313
|
+
* Handles category search input changes - Uses server-side search for efficiency and reliability
|
|
314
|
+
*/
|
|
315
|
+
async handleCategorySearchChange(event) {
|
|
316
|
+
if (!this.isTreeInitialized()) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const searchTerm = (event.value ?? '').trim().toLowerCase();
|
|
320
|
+
const previousSearchTerm = this.currentSearchValue();
|
|
321
|
+
// If search is cleared, reset tree
|
|
322
|
+
if (!searchTerm) {
|
|
323
|
+
if (previousSearchTerm || this.matchingNodeIds.size > 0) {
|
|
324
|
+
this.currentSearchValue.set('');
|
|
325
|
+
this.currentSearchTerm = null;
|
|
326
|
+
await this.resetSearch();
|
|
327
|
+
}
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
// For non-empty search, only process user interactions
|
|
331
|
+
if (!event.isUserInteraction) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
// Prevent concurrent searches
|
|
335
|
+
if (this.isSearching() && this.currentSearchTerm !== null) {
|
|
336
|
+
if (this.currentSearchTerm === searchTerm) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
this.currentSearchValue.set(event.value ?? '');
|
|
341
|
+
this.currentSearchTerm = searchTerm;
|
|
342
|
+
const treeComponent = this.tree();
|
|
343
|
+
if (!treeComponent) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
// Store expanded nodes before starting a new search (only on first search)
|
|
347
|
+
if (!previousSearchTerm && this.expandedNodesBeforeSearch.length === 0) {
|
|
348
|
+
const expandedNodes = treeComponent.getExpandedNodes();
|
|
349
|
+
this.expandedNodesBeforeSearch = expandedNodes
|
|
350
|
+
.map((node) => String(node['id'] ?? ''))
|
|
351
|
+
.filter((id) => id && id !== ROOT_NODE_ID);
|
|
352
|
+
}
|
|
353
|
+
// Collapse nodes from previous search before starting new search
|
|
354
|
+
if (previousSearchTerm && this.nodesExpandedDuringSearch.length > 0) {
|
|
355
|
+
const nodesToCollapse = [...this.nodesExpandedDuringSearch].reverse();
|
|
356
|
+
this.nodesExpandedDuringSearch = [];
|
|
357
|
+
for (const nodeId of nodesToCollapse) {
|
|
358
|
+
// Only collapse if it wasn't originally expanded before search
|
|
359
|
+
if (!this.expandedNodesBeforeSearch.includes(nodeId)) {
|
|
360
|
+
try {
|
|
361
|
+
treeComponent.collapseNode(nodeId);
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
// Node might not exist anymore, ignore
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
this.isSearching.set(true);
|
|
370
|
+
try {
|
|
371
|
+
// Step 1: Use server-side search to get matching items
|
|
372
|
+
const searchResults = await this.categoryTreeService.searchCategories(searchTerm, this.treeData, this.treeConfig);
|
|
373
|
+
// Check if search term changed during the API call
|
|
374
|
+
if (this.currentSearchTerm !== searchTerm) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
if (!searchResults || searchResults.length === 0) {
|
|
378
|
+
this.matchingNodeIds.clear();
|
|
379
|
+
this.relevantNodeIds.clear();
|
|
380
|
+
this.searchResultCount.set(0);
|
|
381
|
+
await this.updateTranslatedMessages(0);
|
|
382
|
+
// Clear highlighting and reload tree to show all nodes
|
|
383
|
+
this.highlightService.clear();
|
|
384
|
+
await treeComponent.reloadData();
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
// Store matching node IDs from search results
|
|
388
|
+
this.matchingNodeIds.clear();
|
|
389
|
+
const valueField = this.valueField();
|
|
390
|
+
searchResults.forEach((item) => {
|
|
391
|
+
const nodeId = String(item[valueField] ?? '');
|
|
392
|
+
if (nodeId) {
|
|
393
|
+
this.matchingNodeIds.add(nodeId);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
const resultCount = searchResults.length;
|
|
397
|
+
this.searchResultCount.set(resultCount);
|
|
398
|
+
// Update translated messages
|
|
399
|
+
await this.updateTranslatedMessages(resultCount);
|
|
400
|
+
// Step 2: Collect parent IDs (builds relevantNodeIds for filtering)
|
|
401
|
+
const parentsToExpand = await this.collectParentIds(searchResults);
|
|
402
|
+
// Step 2.5: Collect children IDs if searchWithChildren is enabled
|
|
403
|
+
if (this.searchWithChildren()) {
|
|
404
|
+
await this.collectChildrenIds(searchResults);
|
|
405
|
+
}
|
|
406
|
+
// Step 3: Reload tree to apply filtering
|
|
407
|
+
await treeComponent.reloadData();
|
|
408
|
+
// Step 4: Expand root node
|
|
409
|
+
if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
|
|
410
|
+
try {
|
|
411
|
+
await treeComponent.expandNode(ROOT_NODE_ID);
|
|
412
|
+
this.nodesExpandedDuringSearch.push(ROOT_NODE_ID);
|
|
413
|
+
}
|
|
414
|
+
catch {
|
|
415
|
+
// Root might not exist
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
// Step 4: Expand all parent nodes in order (from root to leaves)
|
|
419
|
+
// Sort parents by their depth to expand in correct order
|
|
420
|
+
const sortedParents = await this.sortParentsByDepth(Array.from(parentsToExpand));
|
|
421
|
+
for (const parentId of sortedParents) {
|
|
422
|
+
// Only expand if not already expanded
|
|
423
|
+
if (!treeComponent.isNodeExpanded(parentId)) {
|
|
424
|
+
try {
|
|
425
|
+
await treeComponent.expandNode(parentId);
|
|
426
|
+
this.nodesExpandedDuringSearch.push(parentId);
|
|
427
|
+
// Small delay to prevent overwhelming the tree component
|
|
428
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
429
|
+
}
|
|
430
|
+
catch {
|
|
431
|
+
// Node might not exist, ignore
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
// Step 5: Apply highlighting after tree is rendered
|
|
436
|
+
// Use setTimeout to ensure DOM is updated after tree reload
|
|
437
|
+
setTimeout(() => {
|
|
438
|
+
if (this.currentSearchValue().trim()) {
|
|
439
|
+
this.highlightService.highlight('ax-tree-view .ax-truncate', this.currentSearchValue().trim());
|
|
440
|
+
}
|
|
441
|
+
}, 100);
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
console.error('Error searching categories:', error);
|
|
445
|
+
this.matchingNodeIds.clear();
|
|
446
|
+
this.relevantNodeIds.clear();
|
|
447
|
+
this.searchResultCount.set(0);
|
|
448
|
+
this.highlightService.clear();
|
|
449
|
+
// Reload tree to clear any filters
|
|
450
|
+
const treeComponent = this.tree();
|
|
451
|
+
if (treeComponent) {
|
|
452
|
+
await treeComponent.reloadData();
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
finally {
|
|
456
|
+
if (this.currentSearchTerm === searchTerm) {
|
|
457
|
+
this.currentSearchTerm = null;
|
|
458
|
+
}
|
|
459
|
+
this.isSearching.set(false);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Collects all parent IDs for the given search results
|
|
464
|
+
* Handles both nested 'parent' object and 'parentId' field in search results
|
|
465
|
+
* Recursively fetches parent nodes to build the full parent chain
|
|
466
|
+
*/
|
|
467
|
+
async collectParentIds(items) {
|
|
468
|
+
const parentsToExpand = new Set();
|
|
469
|
+
const valueField = this.valueField();
|
|
470
|
+
const parentKey = this.treeData?.categoryEntityDef?.parentKey || 'parentId';
|
|
471
|
+
// Build relevantNodeIds = matching nodes + all parents
|
|
472
|
+
this.relevantNodeIds.clear();
|
|
473
|
+
this.matchingNodeIds.forEach((id) => this.relevantNodeIds.add(id));
|
|
474
|
+
// Recursively extract all parent IDs
|
|
475
|
+
const extractParentIds = async (item) => {
|
|
476
|
+
// First, try to get parent from nested 'parent' object (if available)
|
|
477
|
+
const parent = item['parent'];
|
|
478
|
+
if (parent) {
|
|
479
|
+
const parentId = String(parent[valueField] ?? parent['id'] ?? '');
|
|
480
|
+
if (parentId && parentId !== ROOT_NODE_ID) {
|
|
481
|
+
parentsToExpand.add(parentId);
|
|
482
|
+
this.relevantNodeIds.add(parentId); // Add to filter set
|
|
483
|
+
this.nodeDataCache.set(parentId, parent);
|
|
484
|
+
await extractParentIds(parent);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
// Fallback: use parentId field and fetch parent from server
|
|
489
|
+
// Try both parentKey from entity definition and common 'parentId' field
|
|
490
|
+
const parentIdValue = item[parentKey] ?? item['parentId'];
|
|
491
|
+
if (parentIdValue) {
|
|
492
|
+
const parentId = String(parentIdValue);
|
|
493
|
+
if (parentId && parentId !== ROOT_NODE_ID) {
|
|
494
|
+
// Add to sets first
|
|
495
|
+
parentsToExpand.add(parentId);
|
|
496
|
+
this.relevantNodeIds.add(parentId);
|
|
497
|
+
// Fetch parent from server if not already cached
|
|
498
|
+
if (!this.nodeDataCache.has(parentId)) {
|
|
499
|
+
const parentItem = await this.fetchItemById(parentId);
|
|
500
|
+
if (parentItem) {
|
|
501
|
+
this.nodeDataCache.set(parentId, parentItem);
|
|
502
|
+
// Recursively fetch parent's parent
|
|
503
|
+
await extractParentIds(parentItem);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
// Parent already in cache, recursively process it
|
|
508
|
+
const cachedParent = this.nodeDataCache.get(parentId);
|
|
509
|
+
if (cachedParent) {
|
|
510
|
+
await extractParentIds(cachedParent);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
// Process all items
|
|
518
|
+
for (const item of items) {
|
|
519
|
+
await extractParentIds(item);
|
|
520
|
+
}
|
|
521
|
+
return parentsToExpand;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Collects children IDs for matching search results recursively
|
|
525
|
+
* Adds all descendants (children, grandchildren, etc.) to relevantNodeIds so they appear in the filtered tree
|
|
526
|
+
*/
|
|
527
|
+
async collectChildrenIds(items) {
|
|
528
|
+
if (!this.treeData?.categoryEntityQueryFunc || !this.treeConfig) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
const valueField = this.valueField();
|
|
532
|
+
const parentKey = this.treeData.categoryEntityDef?.parentKey;
|
|
533
|
+
if (!parentKey) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
// For each matching node, recursively fetch all its descendants
|
|
537
|
+
for (const item of items) {
|
|
538
|
+
const nodeId = String(item[valueField] ?? '');
|
|
539
|
+
if (!nodeId || nodeId === ROOT_NODE_ID) {
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
542
|
+
await this.collectChildrenRecursively(nodeId, valueField, parentKey);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Recursively collects all descendant IDs for a given node
|
|
547
|
+
*/
|
|
548
|
+
async collectChildrenRecursively(nodeId, valueField, parentKey) {
|
|
549
|
+
if (!this.treeData?.categoryEntityQueryFunc) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
try {
|
|
553
|
+
// Fetch children for this node
|
|
554
|
+
const event = {
|
|
555
|
+
...this.treeData.basicQueryEvent,
|
|
556
|
+
filter: {
|
|
557
|
+
field: parentKey,
|
|
558
|
+
value: nodeId,
|
|
559
|
+
operator: { type: 'equal' },
|
|
560
|
+
},
|
|
561
|
+
};
|
|
562
|
+
const res = await this.treeData.categoryEntityQueryFunc(event);
|
|
563
|
+
if (res?.items && res.items.length > 0) {
|
|
564
|
+
// Add children IDs to relevantNodeIds so they appear in filtered tree
|
|
565
|
+
for (const child of res.items) {
|
|
566
|
+
const childId = String(child[valueField] ?? '');
|
|
567
|
+
if (childId && childId !== ROOT_NODE_ID) {
|
|
568
|
+
this.relevantNodeIds.add(childId);
|
|
569
|
+
// Cache child data
|
|
570
|
+
this.nodeDataCache.set(childId, child);
|
|
571
|
+
// Recursively fetch children of this child
|
|
572
|
+
await this.collectChildrenRecursively(childId, valueField, parentKey);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
catch (error) {
|
|
578
|
+
console.error(`Error fetching children for node ${nodeId}:`, error);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Fetches a single item by ID from the server
|
|
583
|
+
*/
|
|
584
|
+
async fetchItemById(id) {
|
|
585
|
+
if (!this.treeData?.categoryEntityQueryFunc) {
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
try {
|
|
589
|
+
const valueField = this.valueField();
|
|
590
|
+
const event = {
|
|
591
|
+
...this.treeData.basicQueryEvent,
|
|
592
|
+
filter: {
|
|
593
|
+
field: valueField,
|
|
594
|
+
value: id,
|
|
595
|
+
operator: { type: 'equal' },
|
|
596
|
+
},
|
|
597
|
+
};
|
|
598
|
+
const res = await this.treeData.categoryEntityQueryFunc(event);
|
|
599
|
+
return res?.items?.[0] ?? null;
|
|
600
|
+
}
|
|
601
|
+
catch (error) {
|
|
602
|
+
console.error('Error fetching item by ID:', error);
|
|
603
|
+
return null;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Sorts parent IDs by their depth (root first, leaves last)
|
|
608
|
+
* Uses cached data from collectParentIds
|
|
609
|
+
*/
|
|
610
|
+
async sortParentsByDepth(parentIds) {
|
|
611
|
+
const parentKey = this.treeData?.categoryEntityDef?.parentKey;
|
|
612
|
+
if (!parentKey || parentIds.length === 0) {
|
|
613
|
+
return parentIds;
|
|
614
|
+
}
|
|
615
|
+
// Build depth map using cached data
|
|
616
|
+
const depthMap = new Map();
|
|
617
|
+
for (const parentId of parentIds) {
|
|
618
|
+
if (depthMap.has(parentId)) {
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
let depth = 0;
|
|
622
|
+
let currentId = parentId;
|
|
623
|
+
const visited = new Set();
|
|
624
|
+
while (currentId && currentId !== ROOT_NODE_ID && !visited.has(currentId)) {
|
|
625
|
+
visited.add(currentId);
|
|
626
|
+
depth++;
|
|
627
|
+
// Use nodeDataCache which was populated by collectParentIds
|
|
628
|
+
const item = this.nodeDataCache.get(currentId);
|
|
629
|
+
if (item) {
|
|
630
|
+
currentId = item[parentKey] ? String(item[parentKey]) : null;
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
depthMap.set(parentId, depth);
|
|
637
|
+
}
|
|
638
|
+
// Sort by depth (lower depth = closer to root = expand first)
|
|
639
|
+
return parentIds.sort((a, b) => {
|
|
640
|
+
const depthA = depthMap.get(a) ?? 0;
|
|
641
|
+
const depthB = depthMap.get(b) ?? 0;
|
|
642
|
+
return depthA - depthB;
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Updates translated messages for search results
|
|
647
|
+
*/
|
|
648
|
+
async updateTranslatedMessages(resultCount) {
|
|
649
|
+
if (resultCount > 0) {
|
|
650
|
+
const key = resultCount === 1
|
|
651
|
+
? '@general:terms.interface.category.search.results-found.singular'
|
|
652
|
+
: '@general:terms.interface.category.search.results-found.plural';
|
|
653
|
+
const text = await this.translate.translateAsync(key, { params: { count: resultCount } });
|
|
654
|
+
this.resultsFoundText.set(text);
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
this.resultsFoundText.set('');
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Resets search state and restores tree to original expanded state
|
|
662
|
+
*/
|
|
663
|
+
async resetSearch() {
|
|
664
|
+
this.searchResultCount.set(0);
|
|
665
|
+
this.resultsFoundText.set('');
|
|
666
|
+
this.currentSearchTerm = null;
|
|
667
|
+
this.isSearching.set(false);
|
|
668
|
+
this.matchingNodeIds.clear();
|
|
669
|
+
this.relevantNodeIds.clear();
|
|
670
|
+
this.nodeDataCache.clear();
|
|
671
|
+
// Clear highlighting
|
|
672
|
+
this.highlightService.clear();
|
|
673
|
+
const treeComponent = this.tree();
|
|
674
|
+
if (!treeComponent) {
|
|
675
|
+
this.expandedNodesBeforeSearch = [];
|
|
676
|
+
this.nodesExpandedDuringSearch = [];
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
// Reload tree to show all nodes (no filtering)
|
|
680
|
+
await treeComponent.reloadData();
|
|
681
|
+
// Collapse nodes that were expanded during search (in reverse order - leaves first)
|
|
682
|
+
const nodesToCollapse = [...this.nodesExpandedDuringSearch].reverse();
|
|
683
|
+
this.nodesExpandedDuringSearch = [];
|
|
684
|
+
for (const nodeId of nodesToCollapse) {
|
|
685
|
+
// Only collapse if it wasn't originally expanded before search
|
|
686
|
+
if (!this.expandedNodesBeforeSearch.includes(nodeId)) {
|
|
687
|
+
try {
|
|
688
|
+
treeComponent.collapseNode(nodeId);
|
|
689
|
+
}
|
|
690
|
+
catch {
|
|
691
|
+
// Node might not exist anymore, ignore
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
// Clear the stored expanded nodes
|
|
696
|
+
this.expandedNodesBeforeSearch = [];
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Checks if a node matches the current search term
|
|
700
|
+
*/
|
|
701
|
+
isMatchingNode(nodeId) {
|
|
702
|
+
return this.matchingNodeIds.has(nodeId);
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Handles node click events to apply category filters and track selected category for create command
|
|
706
|
+
*/
|
|
707
|
+
handleNodeClick(node) {
|
|
708
|
+
const nodeData = this.extractNodeData(node);
|
|
709
|
+
const applyConditions = this.vm().entityDef.category?.applyConditions || [];
|
|
710
|
+
const valueField = this.valueField();
|
|
711
|
+
const textField = this.textField();
|
|
712
|
+
const nodeId = String(nodeData[valueField] ?? node['id'] ?? '');
|
|
713
|
+
// Track selected category for default category when creating new entities
|
|
714
|
+
if (nodeId === 'all' || !nodeId) {
|
|
715
|
+
this.vm().setSelectedCategory(null);
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
this.vm().setSelectedCategory({
|
|
719
|
+
id: nodeId,
|
|
720
|
+
title: String(nodeData[textField] ?? node['title'] ?? ''),
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
const categoryFilters = this.buildCategoryFilters(nodeData, applyConditions);
|
|
724
|
+
const viewFilters = this.buildViewFilters();
|
|
725
|
+
this.vm().dataSource.filter({
|
|
726
|
+
filters: [...viewFilters, ...categoryFilters],
|
|
727
|
+
logic: 'and',
|
|
728
|
+
});
|
|
729
|
+
this.vm().dataSource.refresh();
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Handles node toggle events (expansion/collapse)
|
|
733
|
+
*/
|
|
734
|
+
async onNodeToggle(_event) {
|
|
735
|
+
// Tree component handles lazy loading via datasource callback
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region ---- CRUD Operations ----
|
|
739
|
+
/**
|
|
740
|
+
* Creates a new root category node (uses Entity:Create command).
|
|
741
|
+
*/
|
|
742
|
+
async handleCreateRootClick(event) {
|
|
743
|
+
this.preventDefaultAndStopPropagation(event);
|
|
744
|
+
try {
|
|
745
|
+
const result = await this.executeCreateCommand(undefined);
|
|
746
|
+
await this.applyCreateResult(result, undefined);
|
|
747
|
+
}
|
|
748
|
+
catch (error) {
|
|
749
|
+
console.error('Error creating root category:', error);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Creates a new child category under the given parent node (uses Entity:Create command).
|
|
754
|
+
*/
|
|
755
|
+
async handleCreateChildClick(node, event) {
|
|
756
|
+
this.preventDefaultAndStopPropagation(event);
|
|
757
|
+
try {
|
|
758
|
+
const parentId = this.extractNodeId(node);
|
|
759
|
+
const result = await this.executeCreateCommand(parentId);
|
|
760
|
+
await this.applyCreateResult(result, parentId);
|
|
761
|
+
}
|
|
762
|
+
catch (error) {
|
|
763
|
+
console.error('Error creating child category:', error);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Updates an existing category node (uses Entity:Update command).
|
|
768
|
+
*/
|
|
769
|
+
async handleEditNodeClick(node, event) {
|
|
770
|
+
this.preventDefaultAndStopPropagation(event);
|
|
771
|
+
try {
|
|
772
|
+
const nodeData = this.extractNodeData(node);
|
|
773
|
+
const result = await this.executeUpdateCommand(nodeData);
|
|
774
|
+
await this.applyUpdateResult(result, node);
|
|
775
|
+
}
|
|
776
|
+
catch (error) {
|
|
777
|
+
console.error('Error editing category:', error);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Deletes a category node
|
|
782
|
+
*/
|
|
783
|
+
async handleDeleteNodeClick(node, event) {
|
|
784
|
+
this.preventDefaultAndStopPropagation(event);
|
|
785
|
+
try {
|
|
786
|
+
const nodeData = this.extractNodeData(node);
|
|
787
|
+
const context = await this.executeDeleteWorkflow(nodeData);
|
|
788
|
+
await this.handleDeleteResult(context, node);
|
|
789
|
+
}
|
|
790
|
+
catch (error) {
|
|
791
|
+
console.error('Error deleting category:', error);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
//#endregion
|
|
795
|
+
//#region ---- Private Tree Management Methods ----
|
|
796
|
+
/**
|
|
797
|
+
* Initializes the category tree data structure
|
|
798
|
+
*/
|
|
799
|
+
async initializeTree() {
|
|
800
|
+
this.setLoadingWithDelay(true);
|
|
801
|
+
try {
|
|
802
|
+
const entityKey = this.categoryEntityKey();
|
|
803
|
+
this.treeConfig = {
|
|
804
|
+
entityKey,
|
|
805
|
+
textField: this.textField(),
|
|
806
|
+
valueField: this.valueField(),
|
|
807
|
+
};
|
|
808
|
+
this.treeData = await this.categoryTreeService.initializeCategoryTree(this.treeConfig);
|
|
809
|
+
if (!this.treeData) {
|
|
810
|
+
this.clearLoadingState();
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
// Set parent key from entity definition
|
|
814
|
+
if (this.treeData.categoryEntityDef?.parentKey) {
|
|
815
|
+
this.treeConfig.parentKey = this.treeData.categoryEntityDef.parentKey;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
catch (error) {
|
|
819
|
+
console.error('Error loading categories:', error);
|
|
820
|
+
}
|
|
821
|
+
finally {
|
|
822
|
+
this.clearLoadingState();
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Loads root nodes for the tree
|
|
827
|
+
*/
|
|
828
|
+
async loadRootNodes() {
|
|
829
|
+
if (!this.isTreeInitialized()) {
|
|
830
|
+
return [];
|
|
831
|
+
}
|
|
832
|
+
// Load root categories
|
|
833
|
+
const items = await this.categoryTreeService.loadRootCategories(this.treeData, this.treeConfig);
|
|
834
|
+
if (!items) {
|
|
835
|
+
return [];
|
|
836
|
+
}
|
|
837
|
+
const rootNode = await this.categoryTreeService.createRootNode(items, this.treeConfig);
|
|
838
|
+
// Filter root's children when search is active
|
|
839
|
+
if (this.relevantNodeIds.size > 0 && rootNode['children']) {
|
|
840
|
+
rootNode['children'] = rootNode['children'].filter((child) => {
|
|
841
|
+
const childId = String(child['id'] ?? '');
|
|
842
|
+
return this.relevantNodeIds.has(childId);
|
|
843
|
+
});
|
|
844
|
+
rootNode['childrenCount'] = rootNode['children'].length;
|
|
845
|
+
}
|
|
846
|
+
return [rootNode];
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Loads child nodes for a given parent ID
|
|
850
|
+
*/
|
|
851
|
+
async loadChildNodes(parentId) {
|
|
852
|
+
if (!this.isTreeInitialized()) {
|
|
853
|
+
return [];
|
|
854
|
+
}
|
|
855
|
+
// Create minimal node object - loadChildren only needs node.id
|
|
856
|
+
const targetNode = {
|
|
857
|
+
id: parentId,
|
|
858
|
+
};
|
|
859
|
+
let children = await this.categoryTreeService.loadChildren(targetNode, this.treeData, this.treeConfig);
|
|
860
|
+
// Filter children when search is active
|
|
861
|
+
if (this.relevantNodeIds.size > 0) {
|
|
862
|
+
children = children.filter((child) => {
|
|
863
|
+
const childId = String(child['id'] ?? '');
|
|
864
|
+
return this.relevantNodeIds.has(childId);
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
return children;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Refreshes the tree view component
|
|
871
|
+
*/
|
|
872
|
+
refreshTree() {
|
|
873
|
+
const treeComponent = this.tree();
|
|
874
|
+
if (treeComponent) {
|
|
875
|
+
treeComponent.refresh();
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Refreshes tree after CRUD operations
|
|
880
|
+
*/
|
|
881
|
+
async refreshAfterChange(parentId) {
|
|
882
|
+
this.refreshTree();
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Adds a new node to the tree after create operation
|
|
886
|
+
*/
|
|
887
|
+
async addNodeToTree(entityData, parentId) {
|
|
888
|
+
if (!this.isTreeInitialized()) {
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
const treeComponent = this.tree();
|
|
892
|
+
if (!treeComponent) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
const newNode = this.categoryTreeService.convertToTreeNode(entityData, this.treeConfig);
|
|
896
|
+
if (parentId) {
|
|
897
|
+
await this.addChildNode(treeComponent, parentId, newNode);
|
|
898
|
+
}
|
|
899
|
+
else {
|
|
900
|
+
await this.addRootNode(treeComponent, newNode);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* Adds a child node to a parent node
|
|
905
|
+
*/
|
|
906
|
+
async addChildNode(treeComponent, parentId, newNode) {
|
|
907
|
+
const parentNode = treeComponent.findNode(parentId);
|
|
908
|
+
if (!parentNode) {
|
|
909
|
+
await this.refreshAfterChange(parentId);
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
if (!treeComponent.isNodeExpanded(parentId)) {
|
|
913
|
+
await treeComponent.expandNode(parentId);
|
|
914
|
+
}
|
|
915
|
+
treeComponent.addChild(parentId, newNode);
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Adds a root node to the tree
|
|
919
|
+
*/
|
|
920
|
+
async addRootNode(treeComponent, newNode) {
|
|
921
|
+
const rootNode = treeComponent.findNode(ROOT_NODE_ID);
|
|
922
|
+
if (!rootNode) {
|
|
923
|
+
await this.refreshAfterChange();
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
|
|
927
|
+
await treeComponent.expandNode(ROOT_NODE_ID);
|
|
928
|
+
}
|
|
929
|
+
treeComponent.addChild(ROOT_NODE_ID, newNode);
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Updates an existing node in the tree after edit operation
|
|
933
|
+
*/
|
|
934
|
+
async updateNodeInTree(nodeId, entityData) {
|
|
935
|
+
if (!this.isTreeInitialized()) {
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
const treeComponent = this.tree();
|
|
939
|
+
if (!treeComponent) {
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
const existingNode = treeComponent.findNode(nodeId);
|
|
943
|
+
if (!existingNode) {
|
|
944
|
+
await this.refreshNodeParent(entityData);
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
// Check if parent changed
|
|
948
|
+
const parentKey = this.treeData?.categoryEntityDef?.parentKey;
|
|
949
|
+
let newParentId = undefined;
|
|
950
|
+
if (parentKey && entityData[parentKey]) {
|
|
951
|
+
const parentValue = String(entityData[parentKey]);
|
|
952
|
+
// 'all' means root, so treat it as undefined
|
|
953
|
+
newParentId = parentValue !== 'all' && parentValue !== '' ? parentValue : undefined;
|
|
954
|
+
}
|
|
955
|
+
const currentParent = treeComponent.getParent(nodeId);
|
|
956
|
+
const currentParentId = currentParent ? String(currentParent['id'] ?? '') : undefined;
|
|
957
|
+
// Normalize current parent: 'all' means root (undefined)
|
|
958
|
+
const normalizedCurrentParentId = currentParentId === 'all' || currentParentId === '' ? undefined : currentParentId;
|
|
959
|
+
// Handle parent change: move node to new parent if parent changed
|
|
960
|
+
if (newParentId !== normalizedCurrentParentId) {
|
|
961
|
+
// If parent changed, move the node first
|
|
962
|
+
const moved = treeComponent.moveNode(nodeId, newParentId);
|
|
963
|
+
if (!moved) {
|
|
964
|
+
// If move failed, refresh the tree to ensure consistency
|
|
965
|
+
await this.refreshNodeParent(entityData);
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
// After moving, we need to ensure the new parent is expanded
|
|
969
|
+
if (newParentId) {
|
|
970
|
+
if (!treeComponent.isNodeExpanded(newParentId)) {
|
|
971
|
+
await treeComponent.expandNode(newParentId);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
else {
|
|
975
|
+
// Moving to root - ensure root is expanded
|
|
976
|
+
if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
|
|
977
|
+
await treeComponent.expandNode(ROOT_NODE_ID);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
// Update node properties (title, data, etc.)
|
|
982
|
+
const updatedNode = this.categoryTreeService.convertToTreeNode(entityData, this.treeConfig);
|
|
983
|
+
const updates = {
|
|
984
|
+
['title']: updatedNode['title'],
|
|
985
|
+
['data']: updatedNode['data'],
|
|
986
|
+
['childrenCount']: updatedNode['childrenCount'],
|
|
987
|
+
['icon']: updatedNode['icon'],
|
|
988
|
+
};
|
|
989
|
+
treeComponent.editNode(nodeId, updates);
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Removes a node from the tree after delete operation
|
|
993
|
+
*/
|
|
994
|
+
async removeNodeFromTree(nodeId) {
|
|
995
|
+
const treeComponent = this.tree();
|
|
996
|
+
if (!treeComponent) {
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
const nodeToDelete = treeComponent.findNode(nodeId);
|
|
1000
|
+
if (!nodeToDelete) {
|
|
1001
|
+
await this.refreshAfterChange();
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
treeComponent.removeNode(nodeId);
|
|
1005
|
+
}
|
|
1006
|
+
//#endregion
|
|
1007
|
+
//#region ---- Entity CRUD (Commands) ----
|
|
1008
|
+
/**
|
|
1009
|
+
* Executes Entity:Create command for category (standard command-based create).
|
|
1010
|
+
*/
|
|
1011
|
+
async executeCreateCommand(parentId) {
|
|
1012
|
+
const entityKey = this.categoryEntityKey();
|
|
1013
|
+
const [moduleName, entityName] = entityKey.split('.');
|
|
1014
|
+
const entityRef = await this.entityRegistry.resolve(moduleName, entityName);
|
|
1015
|
+
const data = {};
|
|
1016
|
+
if (parentId && this.treeData?.categoryEntityDef?.parentKey) {
|
|
1017
|
+
data[this.treeData.categoryEntityDef.parentKey] = parentId;
|
|
1018
|
+
}
|
|
1019
|
+
const createCategoryTitle = await this.translate.translateAsync('@general:actions.create-category.title');
|
|
1020
|
+
const result = await this.commandService.execute('Entity:Create', {
|
|
1021
|
+
__context__: {
|
|
1022
|
+
entity: entityKey,
|
|
1023
|
+
entityInfo: {
|
|
1024
|
+
name: entityRef.name,
|
|
1025
|
+
module: entityRef.module,
|
|
1026
|
+
title: entityRef.title ?? entityRef.formats?.individual ?? '',
|
|
1027
|
+
parentKey: entityRef.parentKey,
|
|
1028
|
+
},
|
|
1029
|
+
data: Object.keys(data).length > 0 ? data : undefined,
|
|
1030
|
+
options: {
|
|
1031
|
+
process: { redirect: false, canCreateNewOne: !!parentId },
|
|
1032
|
+
decoration: { header: { title: createCategoryTitle } },
|
|
1033
|
+
},
|
|
1034
|
+
},
|
|
1035
|
+
});
|
|
1036
|
+
return result ?? { success: false };
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Executes Entity:Update command for category (standard command-based update).
|
|
1040
|
+
*/
|
|
1041
|
+
async executeUpdateCommand(nodeData) {
|
|
1042
|
+
const entityKey = this.categoryEntityKey();
|
|
1043
|
+
const [moduleName, entityName] = entityKey.split('.');
|
|
1044
|
+
const entityRef = await this.entityRegistry.resolve(moduleName, entityName);
|
|
1045
|
+
const result = await this.commandService.execute('Entity:Update', {
|
|
1046
|
+
__context__: {
|
|
1047
|
+
entity: entityKey,
|
|
1048
|
+
entityInfo: {
|
|
1049
|
+
name: entityRef.name,
|
|
1050
|
+
module: entityRef.module,
|
|
1051
|
+
title: entityRef.title ?? entityRef.formats?.individual ?? '',
|
|
1052
|
+
parentKey: entityRef.parentKey,
|
|
1053
|
+
},
|
|
1054
|
+
data: nodeData,
|
|
1055
|
+
options: { layout: { size: 'md' } },
|
|
1056
|
+
},
|
|
1057
|
+
});
|
|
1058
|
+
return result ?? { success: false };
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Applies create command result to the tree (add node or refresh).
|
|
1062
|
+
*/
|
|
1063
|
+
async applyCreateResult(result, parentId) {
|
|
1064
|
+
if (!result.success || !this.isTreeInitialized()) {
|
|
1065
|
+
await this.refreshAfterChange(parentId);
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
const newEntityData = result.data;
|
|
1069
|
+
if (newEntityData) {
|
|
1070
|
+
await this.addNodeToTree(newEntityData, parentId);
|
|
1071
|
+
}
|
|
1072
|
+
else {
|
|
1073
|
+
await this.refreshAfterChange(parentId);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Applies update command result to the tree (update node or refresh).
|
|
1078
|
+
*/
|
|
1079
|
+
async applyUpdateResult(result, node) {
|
|
1080
|
+
if (!result.success || !this.isTreeInitialized()) {
|
|
1081
|
+
await this.refreshNodeParent(this.extractNodeData(node));
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
const updatedEntityData = result.data;
|
|
1085
|
+
if (updatedEntityData) {
|
|
1086
|
+
await this.updateNodeInTree(this.extractNodeId(node), updatedEntityData);
|
|
1087
|
+
}
|
|
1088
|
+
else {
|
|
1089
|
+
await this.refreshNodeParent(this.extractNodeData(node));
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
//#endregion
|
|
1093
|
+
//#region ---- Delete (Workflow) ----
|
|
1094
|
+
/**
|
|
1095
|
+
* Executes delete-entity workflow (platform has no Entity:Delete command).
|
|
1096
|
+
*/
|
|
1097
|
+
async executeDeleteWorkflow(nodeData) {
|
|
1098
|
+
return await this.workflow.execute('delete-entity', {
|
|
1099
|
+
entity: this.categoryEntityKey(),
|
|
1100
|
+
data: nodeData,
|
|
1101
|
+
options: { process: { showResult: true } },
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Handles the result of a delete operation
|
|
1106
|
+
*/
|
|
1107
|
+
async handleDeleteResult(context, node) {
|
|
1108
|
+
const result = context.getOutput('result');
|
|
1109
|
+
if (result) {
|
|
1110
|
+
await this.removeNodeFromTree(this.extractNodeId(node));
|
|
1111
|
+
}
|
|
1112
|
+
else {
|
|
1113
|
+
await this.refreshNodeParent(this.extractNodeData(node));
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
//#endregion
|
|
1117
|
+
//#region ---- Utility Methods ----
|
|
1118
|
+
/**
|
|
1119
|
+
* Checks if tree data and config are initialized
|
|
1120
|
+
*/
|
|
1121
|
+
isTreeInitialized() {
|
|
1122
|
+
return !!(this.treeData && this.treeConfig);
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Extracts node data from a tree node
|
|
1126
|
+
*/
|
|
1127
|
+
extractNodeData(node) {
|
|
1128
|
+
return (node['data'] || node);
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* Extracts node ID from a tree node
|
|
1132
|
+
*/
|
|
1133
|
+
extractNodeId(node) {
|
|
1134
|
+
return String(node['id'] ?? '');
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Builds category filters from node data and apply conditions
|
|
1138
|
+
*/
|
|
1139
|
+
buildCategoryFilters(nodeData, applyConditions) {
|
|
1140
|
+
return applyConditions
|
|
1141
|
+
.map((condition) => {
|
|
1142
|
+
const value = nodeData[condition.value];
|
|
1143
|
+
if (value === 'all' || value == null) {
|
|
1144
|
+
return null;
|
|
1145
|
+
}
|
|
1146
|
+
return {
|
|
1147
|
+
field: condition.name,
|
|
1148
|
+
value,
|
|
1149
|
+
operator: condition.operator,
|
|
1150
|
+
};
|
|
1151
|
+
})
|
|
1152
|
+
.filter((item) => item !== null);
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Builds view filters from view conditions
|
|
1156
|
+
*/
|
|
1157
|
+
buildViewFilters() {
|
|
1158
|
+
return this.vm()
|
|
1159
|
+
.view()
|
|
1160
|
+
.conditions.map((condition) => ({ ...condition, field: condition.name }));
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* Refreshes the parent node of the given entity data
|
|
1164
|
+
*/
|
|
1165
|
+
async refreshNodeParent(entityData) {
|
|
1166
|
+
const parentKey = this.treeData?.categoryEntityDef?.parentKey;
|
|
1167
|
+
const parentId = parentKey && entityData[parentKey] ? entityData[parentKey] : undefined;
|
|
1168
|
+
await this.refreshAfterChange(parentId);
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Prevents default behavior and stops event propagation
|
|
1172
|
+
*/
|
|
1173
|
+
preventDefaultAndStopPropagation(event) {
|
|
1174
|
+
event.nativeEvent.preventDefault();
|
|
1175
|
+
event.nativeEvent.stopPropagation();
|
|
1176
|
+
}
|
|
1177
|
+
//#endregion
|
|
1178
|
+
//#region ---- Loading State Management ----
|
|
1179
|
+
/**
|
|
1180
|
+
* Sets loading state with delay to avoid flickering for fast responses
|
|
1181
|
+
*/
|
|
1182
|
+
setLoadingWithDelay(loading) {
|
|
1183
|
+
if (!loading) {
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
if (this.loadingTimeoutId) {
|
|
1187
|
+
clearTimeout(this.loadingTimeoutId);
|
|
1188
|
+
}
|
|
1189
|
+
this.loadingTimeoutId = setTimeout(() => {
|
|
1190
|
+
this.isLoading.set(true);
|
|
1191
|
+
this.loadingTimeoutId = null;
|
|
1192
|
+
}, LOADING_DELAY_MS);
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Clears loading state and cancels any pending timeout
|
|
1196
|
+
*/
|
|
1197
|
+
clearLoadingState() {
|
|
1198
|
+
if (this.loadingTimeoutId) {
|
|
1199
|
+
clearTimeout(this.loadingTimeoutId);
|
|
1200
|
+
this.loadingTimeoutId = null;
|
|
1201
|
+
}
|
|
1202
|
+
this.isLoading.set(false);
|
|
1203
|
+
}
|
|
1204
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1205
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPEntityCategoryComponent, isStandalone: true, selector: "axp-entity-category", inputs: { vm: { classPropertyName: "vm", publicName: "vm", isSignal: true, isRequired: true, transformFunction: null }, searchValue: { classPropertyName: "searchValue", publicName: "searchValue", isSignal: true, isRequired: false, transformFunction: null }, selectMode: { classPropertyName: "selectMode", publicName: "selectMode", isSignal: true, isRequired: false, transformFunction: null }, selectionBehavior: { classPropertyName: "selectionBehavior", publicName: "selectionBehavior", isSignal: true, isRequired: false, transformFunction: null }, dragArea: { classPropertyName: "dragArea", publicName: "dragArea", isSignal: true, isRequired: false, transformFunction: null }, dragBehavior: { classPropertyName: "dragBehavior", publicName: "dragBehavior", isSignal: true, isRequired: false, transformFunction: null }, showIcons: { classPropertyName: "showIcons", publicName: "showIcons", isSignal: true, isRequired: false, transformFunction: null }, showChildrenBadge: { classPropertyName: "showChildrenBadge", publicName: "showChildrenBadge", isSignal: true, isRequired: false, transformFunction: null }, expandedIcon: { classPropertyName: "expandedIcon", publicName: "expandedIcon", isSignal: true, isRequired: false, transformFunction: null }, collapsedIcon: { classPropertyName: "collapsedIcon", publicName: "collapsedIcon", isSignal: true, isRequired: false, transformFunction: null }, indentSize: { classPropertyName: "indentSize", publicName: "indentSize", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, searchWithChildren: { classPropertyName: "searchWithChildren", publicName: "searchWithChildren", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "tree", first: true, predicate: ["tree"], descendants: true, isSignal: true }], ngImport: i0, template: "<axp-layout-header>\n <axp-layout-title>{{\n vm().entityDef.category?.title || '@general:terms.classification.category' | translate | async\n }}</axp-layout-title>\n <axp-layout-toolbar>\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-w-full\">\n <ax-search-box (onValueChanged)=\"handleCategorySearchChange($event)\" [delayTime]=\"300\"\n [placeholder]=\"'@general:terms.interface.category.search.placeholder' | translate | async\">\n </ax-search-box>\n @if (isSearching() && currentSearchValue().trim()) {\n <div class=\"ax-text-xs ax-text-muted ax-flex ax-items-center ax-gap-1\">\n <span>{{ '@general:terms.interface.category.search.searching' | translate | async }}</span>\n </div>\n } @else if (currentSearchValue().trim() && !isSearching()) {\n <div class=\"ax-text-xs ax-text-muted ax-flex ax-items-center ax-gap-1\">\n @if (searchResultCount() > 0) {\n <span>{{ resultsFoundText() }}</span>\n }\n </div>\n }\n </div>\n </axp-layout-toolbar>\n</axp-layout-header>\n<axp-layout-content>\n @if (isLoading()) {\n <div class=\"ax-p-4 ax-flex ax-flex-col ax-gap-3\">\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n </div>\n } @else if (showNoSearchResults()) {\n <div class=\"__empty-state\">\n <axp-state-message icon=\"fa-light fa-search\"\n [title]=\"'@general:terms.interface.category.search.no-results-found.title'\"\n [description]=\"'@general:terms.interface.category.search.no-results-found.description'\">\n </axp-state-message>\n </div>\n } @else if (treeData) {\n <div class=\"ax-px-4 ax-max-h-[calc(100vh-250px)] ax-overflow-auto\">\n <ax-tree-view [datasource]=\"datasource\" [selectMode]=\"selectMode()\" [selectionBehavior]=\"selectionBehavior()\"\n [dragArea]=\"dragArea()\" [dragBehavior]=\"dragBehavior()\" [showIcons]=\"showIcons()\"\n [showChildrenBadge]=\"showChildrenBadge()\" [expandedIcon]=\"expandedIcon()\" [collapsedIcon]=\"collapsedIcon()\"\n [indentSize]=\"indentSize()\" [look]=\"look()\" [titleField]=\"textField()\" [idField]=\"valueField()\"\n [expandOnDoubleClick]=\"true\" [nodeTemplate]=\"itemTemplate\" (onNodeToggle)=\"onNodeToggle($event)\"\n (onNodeClick)=\"handleNodeClick($event.node)\" #tree>\n </ax-tree-view>\n </div>\n } @else {\n <div class=\"__empty-state\">\n <axp-state-message icon=\"fa-light fa-folder-open\"\n [title]=\"'@general:terms.interface.category.search.no-records.title'\"\n [description]=\"'@general:terms.interface.category.search.no-records.description'\">\n @if (!categoryReadonly()) {\n <ax-button slot=\"actions\" (onClick)=\"handleCreateRootClick($event)\" look=\"solid\" color=\"primary\"\n [text]=\"'@general:actions.add-new.title' | translate | async\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n }\n </axp-state-message>\n </div>\n }\n\n <ng-template #itemTemplate let-node=\"node\" let-level=\"level\">\n @let item = node.data || node;\n @let textField = vm().entityDef.category?.textField || 'title';\n @let valueField = vm().entityDef.category?.valueField || 'id';\n @let itemId = item[valueField] || node.id;\n @let rawLabel = item[textField] || node.title;\n @let itemTitle = rawLabel | axpResolveMultiLanguageString;\n <div class=\"ax-flex ax-items-center ax-justify-between ax-w-full ax-gap-2 ax-overflow-hidden ax-py-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2 ax-min-w-0\">\n <ax-icon class=\"fas fa-folder\"\n [style.color]=\"item.color ?? 'rgba(var(--ax-sys-color-warning-500), 1)'\"></ax-icon>\n <span class=\"ax-truncate\">\n @if (itemId === 'all') {\n {{ categoryTreeRootTitleI18nKey | translate | async }}\n } @else {\n {{ itemTitle }}\n }\n </span>\n </div>\n @if (itemId && itemId !== 'all' && !categoryReadonly()) {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" color=\"default\" look=\"blank\" (onClick)=\"$event.nativeEvent.stopPropagation()\">\n <ax-icon class=\"fas fa-ellipsis-v\"></ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item (onClick)=\"handleCreateChildClick(node, $event)\" look=\"blank\" color=\"default\"\n [text]=\"('@general:actions.add-new-child.title' | translate | async)!\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleEditNodeClick(node, $event)\" look=\"blank\"\n [text]=\"('@general:actions.edit.title' | translate | async)!\">\n <ax-icon class=\"fas fa-pen\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleDeleteNodeClick(node, $event)\" color=\"danger\" look=\"blank\"\n [text]=\"('@general:actions.delete.title' | translate | async)!\">\n <ax-icon class=\"fas fa-trash\"></ax-icon>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n } @else if (itemId === 'all' && !categoryReadonly()) {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" (onClick)=\"handleCreateRootClick($event)\" look=\"blank\" color=\"default\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </ng-template>\n</axp-layout-content>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXTreeViewModule }, { kind: "component", type: AXTreeViewComponent, selector: "ax-tree-view", inputs: ["datasource", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "nodeTemplate", "idField", "titleField", "tooltipField", "iconField", "expandedField", "selectedField", "indeterminateField", "disabledField", "hiddenField", "childrenField", "childrenCountField", "dataField", "inheritDisabled", "expandOnDoubleClick", "doubleClickDuration", "tooltipDelay"], outputs: ["datasourceChange", "onBeforeDrop", "onNodeToggle", "onNodeSelect", "onNodeDoubleClick", "onNodeClick", "onSelectionChange", "onOrderChange", "onMoveChange", "onItemsChange"] }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i2$2.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer-container, axp-page-footer, axp-page-header, axp-page-header-container, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-page-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title-bar, axp-layout-title, axp-layout-title-actions, axp-layout-nav-button, axp-layout-description, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i6.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "component", type: AXPThemeLayoutHeaderComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPThemeLayoutToolbarComponent, selector: "axp-layout-toolbar" }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items", "closeParentOnClick", "lockOnLoading"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i5.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "variant"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AXPResolveMultiLanguageStringPipe, name: "axpResolveMultiLanguageString" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1206
|
+
}
|
|
1207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityCategoryComponent, decorators: [{
|
|
1208
|
+
type: Component,
|
|
1209
|
+
args: [{ selector: 'axp-entity-category', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
|
|
1210
|
+
CommonModule,
|
|
1211
|
+
AXDecoratorModule,
|
|
1212
|
+
AXTreeViewModule,
|
|
1213
|
+
AXTreeViewComponent,
|
|
1214
|
+
AXSkeletonModule,
|
|
1215
|
+
AXPThemeLayoutBlockComponent,
|
|
1216
|
+
AXSearchBoxModule,
|
|
1217
|
+
AXPThemeLayoutHeaderComponent,
|
|
1218
|
+
AXPThemeLayoutToolbarComponent,
|
|
1219
|
+
AXTranslationModule,
|
|
1220
|
+
AXButtonModule,
|
|
1221
|
+
AXDropdownModule,
|
|
1222
|
+
AXPStateMessageComponent,
|
|
1223
|
+
AXPResolveMultiLanguageStringPipe
|
|
1224
|
+
], template: "<axp-layout-header>\n <axp-layout-title>{{\n vm().entityDef.category?.title || '@general:terms.classification.category' | translate | async\n }}</axp-layout-title>\n <axp-layout-toolbar>\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-w-full\">\n <ax-search-box (onValueChanged)=\"handleCategorySearchChange($event)\" [delayTime]=\"300\"\n [placeholder]=\"'@general:terms.interface.category.search.placeholder' | translate | async\">\n </ax-search-box>\n @if (isSearching() && currentSearchValue().trim()) {\n <div class=\"ax-text-xs ax-text-muted ax-flex ax-items-center ax-gap-1\">\n <span>{{ '@general:terms.interface.category.search.searching' | translate | async }}</span>\n </div>\n } @else if (currentSearchValue().trim() && !isSearching()) {\n <div class=\"ax-text-xs ax-text-muted ax-flex ax-items-center ax-gap-1\">\n @if (searchResultCount() > 0) {\n <span>{{ resultsFoundText() }}</span>\n }\n </div>\n }\n </div>\n </axp-layout-toolbar>\n</axp-layout-header>\n<axp-layout-content>\n @if (isLoading()) {\n <div class=\"ax-p-4 ax-flex ax-flex-col ax-gap-3\">\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n <ax-skeleton class=\"ax-w-full ax-h-6 ax-rounded-md\"></ax-skeleton>\n </div>\n } @else if (showNoSearchResults()) {\n <div class=\"__empty-state\">\n <axp-state-message icon=\"fa-light fa-search\"\n [title]=\"'@general:terms.interface.category.search.no-results-found.title'\"\n [description]=\"'@general:terms.interface.category.search.no-results-found.description'\">\n </axp-state-message>\n </div>\n } @else if (treeData) {\n <div class=\"ax-px-4 ax-max-h-[calc(100vh-250px)] ax-overflow-auto\">\n <ax-tree-view [datasource]=\"datasource\" [selectMode]=\"selectMode()\" [selectionBehavior]=\"selectionBehavior()\"\n [dragArea]=\"dragArea()\" [dragBehavior]=\"dragBehavior()\" [showIcons]=\"showIcons()\"\n [showChildrenBadge]=\"showChildrenBadge()\" [expandedIcon]=\"expandedIcon()\" [collapsedIcon]=\"collapsedIcon()\"\n [indentSize]=\"indentSize()\" [look]=\"look()\" [titleField]=\"textField()\" [idField]=\"valueField()\"\n [expandOnDoubleClick]=\"true\" [nodeTemplate]=\"itemTemplate\" (onNodeToggle)=\"onNodeToggle($event)\"\n (onNodeClick)=\"handleNodeClick($event.node)\" #tree>\n </ax-tree-view>\n </div>\n } @else {\n <div class=\"__empty-state\">\n <axp-state-message icon=\"fa-light fa-folder-open\"\n [title]=\"'@general:terms.interface.category.search.no-records.title'\"\n [description]=\"'@general:terms.interface.category.search.no-records.description'\">\n @if (!categoryReadonly()) {\n <ax-button slot=\"actions\" (onClick)=\"handleCreateRootClick($event)\" look=\"solid\" color=\"primary\"\n [text]=\"'@general:actions.add-new.title' | translate | async\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n }\n </axp-state-message>\n </div>\n }\n\n <ng-template #itemTemplate let-node=\"node\" let-level=\"level\">\n @let item = node.data || node;\n @let textField = vm().entityDef.category?.textField || 'title';\n @let valueField = vm().entityDef.category?.valueField || 'id';\n @let itemId = item[valueField] || node.id;\n @let rawLabel = item[textField] || node.title;\n @let itemTitle = rawLabel | axpResolveMultiLanguageString;\n <div class=\"ax-flex ax-items-center ax-justify-between ax-w-full ax-gap-2 ax-overflow-hidden ax-py-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2 ax-min-w-0\">\n <ax-icon class=\"fas fa-folder\"\n [style.color]=\"item.color ?? 'rgba(var(--ax-sys-color-warning-500), 1)'\"></ax-icon>\n <span class=\"ax-truncate\">\n @if (itemId === 'all') {\n {{ categoryTreeRootTitleI18nKey | translate | async }}\n } @else {\n {{ itemTitle }}\n }\n </span>\n </div>\n @if (itemId && itemId !== 'all' && !categoryReadonly()) {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" color=\"default\" look=\"blank\" (onClick)=\"$event.nativeEvent.stopPropagation()\">\n <ax-icon class=\"fas fa-ellipsis-v\"></ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item (onClick)=\"handleCreateChildClick(node, $event)\" look=\"blank\" color=\"default\"\n [text]=\"('@general:actions.add-new-child.title' | translate | async)!\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleEditNodeClick(node, $event)\" look=\"blank\"\n [text]=\"('@general:actions.edit.title' | translate | async)!\">\n <ax-icon class=\"fas fa-pen\"></ax-icon>\n </ax-button-item>\n <ax-button-item (onClick)=\"handleDeleteNodeClick(node, $event)\" color=\"danger\" look=\"blank\"\n [text]=\"('@general:actions.delete.title' | translate | async)!\">\n <ax-icon class=\"fas fa-trash\"></ax-icon>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </div>\n } @else if (itemId === 'all' && !categoryReadonly()) {\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <ax-button class=\"ax-xs\" (onClick)=\"handleCreateRootClick($event)\" look=\"blank\" color=\"default\">\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button>\n </div>\n }\n </div>\n </ng-template>\n</axp-layout-content>" }]
|
|
1225
|
+
}], ctorParameters: () => [], propDecorators: { vm: [{ type: i0.Input, args: [{ isSignal: true, alias: "vm", required: true }] }], tree: [{ type: i0.ViewChild, args: ['tree', { isSignal: true }] }], searchValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchValue", required: false }] }], selectMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectMode", required: false }] }], selectionBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionBehavior", required: false }] }], dragArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragArea", required: false }] }], dragBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragBehavior", required: false }] }], showIcons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcons", required: false }] }], showChildrenBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "showChildrenBadge", required: false }] }], expandedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIcon", required: false }] }], collapsedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedIcon", required: false }] }], indentSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "indentSize", required: false }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }], searchWithChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchWithChildren", required: false }] }] } });
|
|
1226
|
+
|
|
1227
|
+
class AXPEntityMasterToolbarViewComponent {
|
|
1228
|
+
constructor() {
|
|
1229
|
+
this.layoutService = inject(AXPLayoutThemeService);
|
|
1230
|
+
this.deviceService = inject(AXPDeviceService);
|
|
1231
|
+
this.parent = inject(AXPEntityMasterListViewComponent);
|
|
1232
|
+
this.router = inject(Router);
|
|
1233
|
+
this.activeRoute = inject(ActivatedRoute);
|
|
1234
|
+
this.settingsService = inject(AXPSettingsService);
|
|
1235
|
+
this.isInitializing = false;
|
|
1236
|
+
this.pendingInitialFilters = true;
|
|
1237
|
+
this.pendingInitialSorts = true;
|
|
1238
|
+
this.filterTriggerMode = 'manual';
|
|
1239
|
+
this.previousFilterQueries = signal([], ...(ngDevMode ? [{ debugName: "previousFilterQueries" }] : /* istanbul ignore next */ []));
|
|
1240
|
+
this.initialFilters = signal([], ...(ngDevMode ? [{ debugName: "initialFilters" }] : /* istanbul ignore next */ []));
|
|
1241
|
+
this.filtersDefinitions = signal([], ...(ngDevMode ? [{ debugName: "filtersDefinitions" }] : /* istanbul ignore next */ []));
|
|
1242
|
+
this.viewQueries = computed(() => this.vm.views().map((v) => ({
|
|
1243
|
+
name: v.name,
|
|
1244
|
+
fixed: false,
|
|
1245
|
+
title: v.title,
|
|
1246
|
+
columns: v.columns,
|
|
1247
|
+
conditions: v.conditions.map((c) => ({
|
|
1248
|
+
field: c.name,
|
|
1249
|
+
operator: c.operator,
|
|
1250
|
+
value: c.value,
|
|
1251
|
+
})),
|
|
1252
|
+
sorts: v.sorts,
|
|
1253
|
+
})), ...(ngDevMode ? [{ debugName: "viewQueries" }] : /* istanbul ignore next */ []));
|
|
1254
|
+
this.selectedViewQuery = computed(() => ({
|
|
1255
|
+
name: this.vm.view().name,
|
|
1256
|
+
fixed: false,
|
|
1257
|
+
title: this.vm.view().title,
|
|
1258
|
+
columns: this.vm.view().columns,
|
|
1259
|
+
conditions: this.vm.view().conditions.map((c) => ({
|
|
1260
|
+
field: c.name,
|
|
1261
|
+
operator: c.operator,
|
|
1262
|
+
value: c.value,
|
|
1263
|
+
})),
|
|
1264
|
+
sorts: this.vm.view().sorts,
|
|
1265
|
+
}), ...(ngDevMode ? [{ debugName: "selectedViewQuery" }] : /* istanbul ignore next */ []));
|
|
1266
|
+
this.isFiltersDirty = computed(() => !isEqual(this.vm.filterQueries(), this.previousFilterQueries()), ...(ngDevMode ? [{ debugName: "isFiltersDirty" }] : /* istanbul ignore next */ []));
|
|
1267
|
+
// Debounced apply to coalesce multiple UI changes (filters/sorts/columns)
|
|
1268
|
+
this.applyTimer = null;
|
|
1269
|
+
this.#effect = effect(() => {
|
|
1270
|
+
// Keep definitions up to date; initial filters are set explicitly from settings or view
|
|
1271
|
+
this.filtersDefinitions.set(this.vm.filtersDef);
|
|
1272
|
+
}, ...(ngDevMode ? [{ debugName: "#effect" }] : /* istanbul ignore next */ []));
|
|
1273
|
+
this.sortQueries = computed(() => this.vm
|
|
1274
|
+
.sortedFields()
|
|
1275
|
+
.filter((s) => !!s.dir)
|
|
1276
|
+
.map((s) => ({ name: s.name, dir: s.dir })), ...(ngDevMode ? [{ debugName: "sortQueries" }] : /* istanbul ignore next */ []));
|
|
1277
|
+
this.sortDefinitions = computed(() => this.vm.sortableFields().map((s) => ({
|
|
1278
|
+
name: s.name,
|
|
1279
|
+
title: s.title,
|
|
1280
|
+
dir: s.dir,
|
|
1281
|
+
})), ...(ngDevMode ? [{ debugName: "sortDefinitions" }] : /* istanbul ignore next */ []));
|
|
1282
|
+
}
|
|
1283
|
+
async ngOnInit() {
|
|
1284
|
+
// Prefer saved settings (view/columns/sorts/filters) if available, then apply
|
|
1285
|
+
await this.loadSettings();
|
|
1286
|
+
await this.vm.setView();
|
|
1287
|
+
this.filtersDefinitions.set(this.vm.filtersDef);
|
|
1288
|
+
this.isInitializing = true;
|
|
1289
|
+
// this.pendingInitialFilters = true;
|
|
1290
|
+
// this.pendingInitialSorts = true;
|
|
1291
|
+
this.setInitialFiltersFromSettingsOrView();
|
|
1292
|
+
// Ensure initial load even when filters/sorts are absent
|
|
1293
|
+
setTimeout(() => {
|
|
1294
|
+
this.isInitializing = false;
|
|
1295
|
+
this.scheduleApply();
|
|
1296
|
+
}, 0);
|
|
1297
|
+
}
|
|
1298
|
+
async loadSettings() {
|
|
1299
|
+
const filterTriggerMode = await this.settingsService.get(AXPCommonSettings.EntityFilterApplyMode);
|
|
1300
|
+
this.filterTriggerMode = (filterTriggerMode?.value ?? 'auto');
|
|
1301
|
+
}
|
|
1302
|
+
scheduleApply() {
|
|
1303
|
+
clearTimeout(this.applyTimer);
|
|
1304
|
+
this.applyTimer = setTimeout(() => {
|
|
1305
|
+
this.vm.applyFilterAndSort();
|
|
1306
|
+
}, 50);
|
|
1307
|
+
}
|
|
1308
|
+
async onViewChanged(view) {
|
|
1309
|
+
await this.vm.setView(view.name);
|
|
1310
|
+
// Sync query param immediately on tab change
|
|
1311
|
+
this.router.navigate([], {
|
|
1312
|
+
relativeTo: this.activeRoute,
|
|
1313
|
+
queryParams: { view: view.name },
|
|
1314
|
+
queryParamsHandling: 'merge',
|
|
1315
|
+
replaceUrl: true,
|
|
1316
|
+
});
|
|
1317
|
+
this.isInitializing = true;
|
|
1318
|
+
this.pendingInitialFilters = true;
|
|
1319
|
+
this.pendingInitialSorts = true;
|
|
1320
|
+
this.setInitialFiltersFromSettingsOrView();
|
|
1321
|
+
// Ensure initial load after view change
|
|
1322
|
+
setTimeout(() => {
|
|
1323
|
+
this.isInitializing = false;
|
|
1324
|
+
this.scheduleApply();
|
|
1325
|
+
}, 0);
|
|
1326
|
+
}
|
|
1327
|
+
#effect;
|
|
1328
|
+
setInitialFiltersFromSettingsOrView() {
|
|
1329
|
+
const saved = this.vm.filterQueries();
|
|
1330
|
+
this.previousFilterQueries.set(saved);
|
|
1331
|
+
const viewConditions = this.vm.view().conditions.map((c) => c.name);
|
|
1332
|
+
if (saved && saved.length) {
|
|
1333
|
+
this.initialFilters.set(saved.map((s) => ({ ...s, hidden: viewConditions.includes(s.field) })));
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
this.initialFilters.set(this.vm.view().conditions.map((c) => ({
|
|
1337
|
+
field: c.name,
|
|
1338
|
+
operator: c.operator,
|
|
1339
|
+
value: c.value,
|
|
1340
|
+
hidden: true,
|
|
1341
|
+
})));
|
|
1342
|
+
}
|
|
1343
|
+
onFiltersChanged(filters) {
|
|
1344
|
+
if (this.isInitializing || this.pendingInitialFilters) {
|
|
1345
|
+
this.pendingInitialFilters = false;
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
this.vm.filterQueries.set(filters);
|
|
1349
|
+
if (this.filterTriggerMode === 'auto') {
|
|
1350
|
+
this.applyFilters();
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
applyFilters() {
|
|
1354
|
+
this.previousFilterQueries.set(this.vm.filterQueries());
|
|
1355
|
+
this.vm.saveSettings('filters', this.vm.filterQueries());
|
|
1356
|
+
this.scheduleApply();
|
|
1357
|
+
}
|
|
1358
|
+
onSortQueriesChange(e) {
|
|
1359
|
+
if (this.isInitializing || this.pendingInitialSorts) {
|
|
1360
|
+
this.pendingInitialSorts = false;
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
this.vm.sortedFields.set(e.map((s) => ({
|
|
1364
|
+
name: s.name,
|
|
1365
|
+
title: s.name,
|
|
1366
|
+
dir: s.dir,
|
|
1367
|
+
})));
|
|
1368
|
+
// Persist sorts per module/entity/view
|
|
1369
|
+
this.vm.saveSettings('sorts', e);
|
|
1370
|
+
this.scheduleApply();
|
|
1371
|
+
}
|
|
1372
|
+
onColumnsChange(columns) {
|
|
1373
|
+
const keyOf = (c) => c.column?.options?.dataPath ?? c.name;
|
|
1374
|
+
this.vm.columns.update((prev) => {
|
|
1375
|
+
const byKey = new Map(prev.map((c) => [keyOf(c), c]));
|
|
1376
|
+
return columns.map((newColumn) => {
|
|
1377
|
+
const existing = byKey.get(keyOf(newColumn));
|
|
1378
|
+
return new AXPEntityListViewColumnViewModel(existing.property, {
|
|
1379
|
+
...existing.column,
|
|
1380
|
+
options: {
|
|
1381
|
+
...existing.column.options,
|
|
1382
|
+
visible: newColumn.visible,
|
|
1383
|
+
},
|
|
1384
|
+
});
|
|
1385
|
+
});
|
|
1386
|
+
});
|
|
1387
|
+
// Persist column order/visibility
|
|
1388
|
+
this.vm.onColumnsChanged(this.vm.columns());
|
|
1389
|
+
// Use debounced apply to avoid triple refresh when combined with sorts/filters
|
|
1390
|
+
// this.scheduleApply();
|
|
1391
|
+
}
|
|
1392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1393
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPEntityMasterToolbarViewComponent, isStandalone: true, selector: "axp-entity-master-toolbar-view", inputs: { vm: ["viewModel", "vm"] }, host: { classAttribute: "ax-w-full" }, ngImport: i0, template: "<!-- <axp-entity-view-toolbar [viewModel]=\"vm\"></axp-entity-view-toolbar> -->\n<axp-query-views\n id=\"axp-toolbar-view-selector\"\n [views]=\"viewQueries()\"\n [selectedView]=\"selectedViewQuery()\"\n (selectedViewChange)=\"onViewChanged($event)\"\n></axp-query-views>\n<div class=\"ax-flex ax-items-center ax-gap-2 ax-border-b ax-border-light w-full\">\n <!-- <axp-entity-filter-toolbar [viewModel]=\"vm\"></axp-entity-filter-toolbar> -->\n <axp-query-filters\n id=\"axp-toolbar-filters\"\n [filtersDefinitions]=\"filtersDefinitions()\"\n [initialFilters]=\"initialFilters()\"\n (onFiltersChanged)=\"onFiltersChanged($event)\"\n ></axp-query-filters>\n\n <div class=\"ax-flex ax-items-center ax-gap-2 md:ax-gap-2\">\n @if (filterTriggerMode === 'manual' && isFiltersDirty()) {\n <ax-button\n id=\"axp-toolbar-btn-filter\"\n [title]=\"'@general:actions.apply.title'\"\n [iconOnly]=\"true\"\n #filterButton\n [color]=\"'primary'\"\n (onClick)=\"applyFilters()\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-search\"></i>\n </ax-prefix>\n </ax-button>\n }\n <div>\n <ax-button id=\"axp-toolbar-btn-columns\" [iconOnly]=\"true\" #columnButton [color]=\"'default'\">\n <i class=\"fa-light fa-table-columns\"></i>\n </ax-button>\n <ax-popover\n id=\"axp-popover-columns\"\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"10\"\n [target]=\"columnButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ '@general:terms.common.columns' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <axp-query-columns [columns]=\"vm.columns()\" (columnsChange)=\"onColumnsChange($event)\"></axp-query-columns>\n <!-- <axp-list-view-option-columns [viewModel]=\"vm\"></axp-list-view-option-columns> -->\n </div>\n </div>\n </ax-popover>\n </div>\n\n @if (vm.canSort()) {\n <div>\n <ax-button id=\"axp-toolbar-btn-sort\" [iconOnly]=\"true\" [text]=\"'Sorts'\" #sortButton [color]=\"'default'\">\n <i class=\"fa-light fa-sort-amount-up\"></i>\n </ax-button>\n <ax-popover\n id=\"axp-popover-sort\"\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"10\"\n [target]=\"sortButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ '@general:terms.common.sorts' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <!-- <axp-list-view-option-sorting [viewModel]=\"vm\"></axp-list-view-option-sorting> -->\n <axp-query-sorts\n [sortDefinitions]=\"sortDefinitions()\"\n (sortQueriesChange)=\"onSortQueriesChange($event)\"\n [initialSortQueries]=\"sortQueries()\"\n ></axp-query-sorts>\n </div>\n </div>\n </ax-popover>\n </div>\n }\n @if (deviceService.isSmall()) {\n <ax-button\n id=\"axp-toolbar-btn-category\"\n (onClick)=\"parent.toggleCategoryDrawer()\"\n [iconOnly]=\"true\"\n [color]=\"'default'\"\n >\n <i class=\"fa-light fa-bars\"></i>\n </ax-button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.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: AXTranslationModule }, { kind: "component", type: AXPQueryFiltersComponent, selector: "axp-query-filters", inputs: ["filtersDefinitions", "initialFilters"], outputs: ["onFiltersChanged"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i3$1.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disablePanelClass", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "repositionOnScroll", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXPQuerySortsComponent, selector: "axp-query-sorts", inputs: ["sortDefinitions", "initialSortQueries"], outputs: ["sortDefinitionsChange", "sortQueriesChange"] }, { kind: "component", type: AXPQueryViewsComponent, selector: "axp-query-views", inputs: ["views", "selectedView"], outputs: ["viewsChange", "selectedViewChange"] }, { kind: "component", type: AXPQueryColumnsComponent, selector: "axp-query-columns", inputs: ["columns"], outputs: ["columnsChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1394
|
+
}
|
|
1395
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, decorators: [{
|
|
1396
|
+
type: Component,
|
|
1397
|
+
args: [{ selector: 'axp-entity-master-toolbar-view', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
1398
|
+
CommonModule,
|
|
1399
|
+
AXButtonModule,
|
|
1400
|
+
AXDecoratorModule,
|
|
1401
|
+
AXTranslationModule,
|
|
1402
|
+
AXPQueryFiltersComponent,
|
|
1403
|
+
AXPopoverModule,
|
|
1404
|
+
AXPQuerySortsComponent,
|
|
1405
|
+
AXPQueryViewsComponent,
|
|
1406
|
+
AXPQueryColumnsComponent,
|
|
1407
|
+
], host: {
|
|
1408
|
+
class: 'ax-w-full',
|
|
1409
|
+
}, template: "<!-- <axp-entity-view-toolbar [viewModel]=\"vm\"></axp-entity-view-toolbar> -->\n<axp-query-views\n id=\"axp-toolbar-view-selector\"\n [views]=\"viewQueries()\"\n [selectedView]=\"selectedViewQuery()\"\n (selectedViewChange)=\"onViewChanged($event)\"\n></axp-query-views>\n<div class=\"ax-flex ax-items-center ax-gap-2 ax-border-b ax-border-light w-full\">\n <!-- <axp-entity-filter-toolbar [viewModel]=\"vm\"></axp-entity-filter-toolbar> -->\n <axp-query-filters\n id=\"axp-toolbar-filters\"\n [filtersDefinitions]=\"filtersDefinitions()\"\n [initialFilters]=\"initialFilters()\"\n (onFiltersChanged)=\"onFiltersChanged($event)\"\n ></axp-query-filters>\n\n <div class=\"ax-flex ax-items-center ax-gap-2 md:ax-gap-2\">\n @if (filterTriggerMode === 'manual' && isFiltersDirty()) {\n <ax-button\n id=\"axp-toolbar-btn-filter\"\n [title]=\"'@general:actions.apply.title'\"\n [iconOnly]=\"true\"\n #filterButton\n [color]=\"'primary'\"\n (onClick)=\"applyFilters()\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-search\"></i>\n </ax-prefix>\n </ax-button>\n }\n <div>\n <ax-button id=\"axp-toolbar-btn-columns\" [iconOnly]=\"true\" #columnButton [color]=\"'default'\">\n <i class=\"fa-light fa-table-columns\"></i>\n </ax-button>\n <ax-popover\n id=\"axp-popover-columns\"\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"10\"\n [target]=\"columnButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ '@general:terms.common.columns' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <axp-query-columns [columns]=\"vm.columns()\" (columnsChange)=\"onColumnsChange($event)\"></axp-query-columns>\n <!-- <axp-list-view-option-columns [viewModel]=\"vm\"></axp-list-view-option-columns> -->\n </div>\n </div>\n </ax-popover>\n </div>\n\n @if (vm.canSort()) {\n <div>\n <ax-button id=\"axp-toolbar-btn-sort\" [iconOnly]=\"true\" [text]=\"'Sorts'\" #sortButton [color]=\"'default'\">\n <i class=\"fa-light fa-sort-amount-up\"></i>\n </ax-button>\n <ax-popover\n id=\"axp-popover-sort\"\n [adaptivityEnabled]=\"true\"\n [offsetY]=\"10\"\n [target]=\"sortButton\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n #popover\n >\n <div class=\"ax-lightest-surface ax-shadow-md ax-border md:ax-w-72 ax-w-full ax-rounded-md\">\n <ax-header class=\"ax-border-b ax-lighter-surface ax-rounded-t-md ax-p-4 ax-font-bold\">\n {{ '@general:terms.common.sorts' | translate | async }}\n </ax-header>\n <div class=\"ax-py-2 ax-px-4\">\n <!-- <axp-list-view-option-sorting [viewModel]=\"vm\"></axp-list-view-option-sorting> -->\n <axp-query-sorts\n [sortDefinitions]=\"sortDefinitions()\"\n (sortQueriesChange)=\"onSortQueriesChange($event)\"\n [initialSortQueries]=\"sortQueries()\"\n ></axp-query-sorts>\n </div>\n </div>\n </ax-popover>\n </div>\n }\n @if (deviceService.isSmall()) {\n <ax-button\n id=\"axp-toolbar-btn-category\"\n (onClick)=\"parent.toggleCategoryDrawer()\"\n [iconOnly]=\"true\"\n [color]=\"'default'\"\n >\n <i class=\"fa-light fa-bars\"></i>\n </ax-button>\n }\n </div>\n</div>\n" }]
|
|
1410
|
+
}], propDecorators: { vm: [{
|
|
1411
|
+
type: Input,
|
|
1412
|
+
args: ['viewModel']
|
|
1413
|
+
}] } });
|
|
1414
|
+
|
|
1415
|
+
class AXPEntityMasterListViewComponent extends AXPPageLayoutBaseComponent {
|
|
1416
|
+
constructor(platform) {
|
|
1417
|
+
super();
|
|
1418
|
+
this.platform = platform;
|
|
1419
|
+
this.activeRoute = inject(ActivatedRoute);
|
|
1420
|
+
this.router = inject(Router);
|
|
1421
|
+
this.vm = this.activeRoute.snapshot.data['vm'];
|
|
1422
|
+
//
|
|
1423
|
+
this.store = inject(AXPLayoutThemeService);
|
|
1424
|
+
//
|
|
1425
|
+
this.searchBarShown = signal(true, ...(ngDevMode ? [{ debugName: "searchBarShown" }] : /* istanbul ignore next */ []));
|
|
1426
|
+
this.activeEndSideView = signal('column', ...(ngDevMode ? [{ debugName: "activeEndSideView" }] : /* istanbul ignore next */ []));
|
|
1427
|
+
this.categorySearchValue = signal('', ...(ngDevMode ? [{ debugName: "categorySearchValue" }] : /* istanbul ignore next */ []));
|
|
1428
|
+
// @ViewChild('grid', { static: true}) grid: AXDataTableComponent;
|
|
1429
|
+
this.grid = viewChild('grid', ...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
1430
|
+
this.initializedFromRoute = false;
|
|
1431
|
+
this.commandRowItems = computed(() => {
|
|
1432
|
+
return this.vm.primaryRowActions().map((c) => {
|
|
1433
|
+
return {
|
|
1434
|
+
icon: c.icon,
|
|
1435
|
+
name: c.name,
|
|
1436
|
+
text: translateSync(c.title),
|
|
1437
|
+
color: c.color,
|
|
1438
|
+
disabled: c.disabled,
|
|
1439
|
+
default: c.default,
|
|
1440
|
+
};
|
|
1441
|
+
});
|
|
1442
|
+
}, ...(ngDevMode ? [{ debugName: "commandRowItems" }] : /* istanbul ignore next */ []));
|
|
1443
|
+
this.getDropdownRowItems = (rowData) => {
|
|
1444
|
+
return Promise.resolve(this.dropdownRowItems(rowData));
|
|
1445
|
+
};
|
|
1446
|
+
this.getCommandRowItems = () => {
|
|
1447
|
+
return this.commandRowItems();
|
|
1448
|
+
};
|
|
1449
|
+
effect(() => {
|
|
1450
|
+
if (this.grid()) {
|
|
1451
|
+
this.grid().selectedRows = this.vm.selectedItems();
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
//
|
|
1455
|
+
this.vm.events$.subscribe(async (e) => {
|
|
1456
|
+
const refreshTargetId = e.meta?.refreshTargetId;
|
|
1457
|
+
const resetPagination = e.meta?.resetPagination === true;
|
|
1458
|
+
if (e.action == 'refresh') {
|
|
1459
|
+
if (refreshTargetId) {
|
|
1460
|
+
await this.grid()?.refreshItemChildren(refreshTargetId);
|
|
1461
|
+
this.updateParentHasChildAfterRefresh(refreshTargetId);
|
|
1462
|
+
}
|
|
1463
|
+
else {
|
|
1464
|
+
this.grid()?.refresh({
|
|
1465
|
+
reset: resetPagination,
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
// Keep URL query param `view` in sync with current vm view
|
|
1471
|
+
effect(() => {
|
|
1472
|
+
if (!this.initializedFromRoute) {
|
|
1473
|
+
return;
|
|
1474
|
+
}
|
|
1475
|
+
const currentViewName = this.vm.view().name;
|
|
1476
|
+
const urlView = this.activeRoute.snapshot.queryParamMap.get('view');
|
|
1477
|
+
if (currentViewName && currentViewName !== urlView) {
|
|
1478
|
+
this.router.navigate([], {
|
|
1479
|
+
relativeTo: this.activeRoute,
|
|
1480
|
+
queryParams: { view: currentViewName },
|
|
1481
|
+
queryParamsHandling: 'merge',
|
|
1482
|
+
replaceUrl: true,
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
async ngOnInit() {
|
|
1488
|
+
// React to external URL changes (back/forward navigation or deep links)
|
|
1489
|
+
this.queryParamSub = this.activeRoute.queryParamMap.subscribe(async (qp) => {
|
|
1490
|
+
const viewFromUrl = qp.get('view');
|
|
1491
|
+
await this.vm.setView(viewFromUrl);
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
async ngAfterViewInit() {
|
|
1495
|
+
const viewFromUrl = this.activeRoute.snapshot.queryParamMap.get('view');
|
|
1496
|
+
await this.vm.setView(viewFromUrl);
|
|
1497
|
+
const resolvedView = this.vm.view().name;
|
|
1498
|
+
const currentUrlView = this.activeRoute.snapshot.queryParamMap.get('view');
|
|
1499
|
+
if (currentUrlView !== resolvedView) {
|
|
1500
|
+
this.router.navigate([], {
|
|
1501
|
+
relativeTo: this.activeRoute,
|
|
1502
|
+
queryParams: { view: resolvedView },
|
|
1503
|
+
queryParamsHandling: 'merge',
|
|
1504
|
+
replaceUrl: true,
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
this.initializedFromRoute = true;
|
|
1508
|
+
}
|
|
1509
|
+
onColumnSizeChanged(e) {
|
|
1510
|
+
if (e.isUserInteraction && e.type === 'end') {
|
|
1511
|
+
this.vm.saveSettings('columnSizes', e.data);
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
onPageChanged(e) {
|
|
1515
|
+
if (e.isUserInteraction) {
|
|
1516
|
+
const pageSizeChanged = e.take != this.vm.dataSource.pageSize;
|
|
1517
|
+
if (pageSizeChanged) {
|
|
1518
|
+
this.vm.saveSettings('pageSize', e.take);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
onColumnsOrderChanged(e) {
|
|
1523
|
+
if (e.isUserInteraction) {
|
|
1524
|
+
this.vm.onColumnsOrderChanged(e.data.event);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
async dropdownRowItems(rowData) {
|
|
1528
|
+
return (await this.vm.secondaryRowActions(rowData)).map((c) => ({
|
|
1529
|
+
icon: c.icon,
|
|
1530
|
+
name: c.name,
|
|
1531
|
+
text: c.title,
|
|
1532
|
+
color: c.color,
|
|
1533
|
+
disabled: c.disabled,
|
|
1534
|
+
default: c.default,
|
|
1535
|
+
divided: c.separated,
|
|
1536
|
+
}));
|
|
1537
|
+
}
|
|
1538
|
+
async handleRowDbClick(e) {
|
|
1539
|
+
if (this.grid()?.dataSource.isLoading) {
|
|
1540
|
+
return;
|
|
1541
|
+
}
|
|
1542
|
+
const allItems = [...this.commandRowItems(), ...(await this.dropdownRowItems(e.data))];
|
|
1543
|
+
// const defaultAction = allItems.find((c) => (c as any).default) || allItems[0];
|
|
1544
|
+
const defaultAction = allItems.find((c) => {
|
|
1545
|
+
const commandName = c.name.split('&')[0];
|
|
1546
|
+
return (c.default || commandName === 'open-entity') && !c.disabled;
|
|
1547
|
+
});
|
|
1548
|
+
if (!defaultAction) {
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
const d = {
|
|
1552
|
+
component: e.component,
|
|
1553
|
+
name: defaultAction.name,
|
|
1554
|
+
data: e.data,
|
|
1555
|
+
};
|
|
1556
|
+
this.handleRowCommandClick(d);
|
|
1557
|
+
}
|
|
1558
|
+
async handleRowCommandClick(e) {
|
|
1559
|
+
if (this.grid()?.dataSource.isLoading) {
|
|
1560
|
+
return;
|
|
1561
|
+
}
|
|
1562
|
+
if (e.setLoading) {
|
|
1563
|
+
e.setLoading(true);
|
|
1564
|
+
}
|
|
1565
|
+
await this.vm.executeCommand(e.name, e.data);
|
|
1566
|
+
if (e.setLoading) {
|
|
1567
|
+
e.setLoading(false);
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
async handleSelectedRowsChange(rows) {
|
|
1571
|
+
this.vm.selectedItems.set(rows);
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* After refreshing a row's children (e.g. when a new child was created), update the parent row's
|
|
1575
|
+
* hasChild so the expand icon is shown. The list query sets hasChild from childrenCount only on
|
|
1576
|
+
* initial load; refreshItemChildren does not re-fetch the parent, so we patch it here.
|
|
1577
|
+
*/
|
|
1578
|
+
updateParentHasChildAfterRefresh(parentId) {
|
|
1579
|
+
const gridRef = this.grid();
|
|
1580
|
+
const ds = gridRef?.dataSource;
|
|
1581
|
+
if (!ds?.cachedItems?.length) {
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
const key = ds.config?.key ?? 'id';
|
|
1585
|
+
const parent = this.findItemById(ds.cachedItems, String(parentId), key);
|
|
1586
|
+
if (parent && typeof parent === 'object') {
|
|
1587
|
+
parent['hasChild'] = true;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
findItemById(items, id, key) {
|
|
1591
|
+
for (const item of items) {
|
|
1592
|
+
if (item && typeof item === 'object' && String(item[key]) === id) {
|
|
1593
|
+
return item;
|
|
1594
|
+
}
|
|
1595
|
+
const rec = item;
|
|
1596
|
+
const metaChildren = rec?.['__meta__']?.['children'];
|
|
1597
|
+
const directChildren = rec?.['children'];
|
|
1598
|
+
const childArr = Array.isArray(metaChildren)
|
|
1599
|
+
? metaChildren
|
|
1600
|
+
: Array.isArray(directChildren)
|
|
1601
|
+
? directChildren
|
|
1602
|
+
: null;
|
|
1603
|
+
if (childArr?.length) {
|
|
1604
|
+
const found = this.findItemById(childArr, id, key);
|
|
1605
|
+
if (found)
|
|
1606
|
+
return found;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
return null;
|
|
1610
|
+
}
|
|
1611
|
+
makeResponsive(value) {
|
|
1612
|
+
if (this.platform.is('Mobile') || this.platform.is('SM')) {
|
|
1613
|
+
return '';
|
|
1614
|
+
}
|
|
1615
|
+
else {
|
|
1616
|
+
return value;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
toggleSideBar(sideBar) {
|
|
1620
|
+
this.toggleEndSide();
|
|
1621
|
+
if (sideBar) {
|
|
1622
|
+
this.activeEndSideView.set(sideBar);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
toggleSearchBar() {
|
|
1626
|
+
this.searchBarShown.update((v) => !v);
|
|
1627
|
+
}
|
|
1628
|
+
handleResetClick(sideBar) {
|
|
1629
|
+
switch (sideBar) {
|
|
1630
|
+
case 'filter': {
|
|
1631
|
+
this.vm.resetFilters();
|
|
1632
|
+
break;
|
|
1633
|
+
}
|
|
1634
|
+
case 'sort': {
|
|
1635
|
+
this.vm.resetSorts();
|
|
1636
|
+
break;
|
|
1637
|
+
}
|
|
1638
|
+
case 'column': {
|
|
1639
|
+
this.vm.resetColumns();
|
|
1640
|
+
break;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
// protected handleDiscardClick(sideBar: 'filter' | 'sort' | 'column') {
|
|
1645
|
+
// switch (sideBar) {
|
|
1646
|
+
// case 'filter': {
|
|
1647
|
+
// this.vm.discardFilters();
|
|
1648
|
+
// break;
|
|
1649
|
+
// }
|
|
1650
|
+
// case 'sort': {
|
|
1651
|
+
// this.vm.resetSorts();
|
|
1652
|
+
// break;
|
|
1653
|
+
// }
|
|
1654
|
+
// case 'column': {
|
|
1655
|
+
// this.vm.resetColumns();
|
|
1656
|
+
// break;
|
|
1657
|
+
// }
|
|
1658
|
+
// }
|
|
1659
|
+
// }
|
|
1660
|
+
handleApplyClick(sideBar) {
|
|
1661
|
+
this.vm.applyFilterAndSort();
|
|
1662
|
+
this.toggleEndSide();
|
|
1663
|
+
}
|
|
1664
|
+
ngOnDestroy() {
|
|
1665
|
+
this.queryParamSub?.unsubscribe();
|
|
1666
|
+
this.vm.destroy();
|
|
1667
|
+
}
|
|
1668
|
+
toggleCategoryDrawer() {
|
|
1669
|
+
this.toggleStartSide();
|
|
1670
|
+
}
|
|
1671
|
+
getPageTitle() {
|
|
1672
|
+
return this.vm.title();
|
|
1673
|
+
}
|
|
1674
|
+
async getPageDescription() {
|
|
1675
|
+
const description = this.vm.description();
|
|
1676
|
+
if (description) {
|
|
1677
|
+
return this.translateService.translateAsync(description);
|
|
1678
|
+
}
|
|
1679
|
+
return '';
|
|
1680
|
+
}
|
|
1681
|
+
getPageBreadcrumbs() {
|
|
1682
|
+
return this.vm.beardcrumbs();
|
|
1683
|
+
}
|
|
1684
|
+
async getPrimaryMenuItems() {
|
|
1685
|
+
return (await this.vm.getPrimaryActions())
|
|
1686
|
+
.filter((tr) => !tr.isChild)
|
|
1687
|
+
.map((tr) => ({
|
|
1688
|
+
name: tr.name,
|
|
1689
|
+
title: tr.title,
|
|
1690
|
+
icon: tr.icon,
|
|
1691
|
+
color: tr.color,
|
|
1692
|
+
disabled: tr.disabled,
|
|
1693
|
+
items: tr.items?.map((sub) => ({
|
|
1694
|
+
name: sub.name,
|
|
1695
|
+
title: sub.title,
|
|
1696
|
+
icon: sub.icon,
|
|
1697
|
+
color: sub.color,
|
|
1698
|
+
disabled: sub.disabled,
|
|
1699
|
+
command: {
|
|
1700
|
+
name: sub.name,
|
|
1701
|
+
options: sub.options,
|
|
1702
|
+
metadata: sub.metadata,
|
|
1703
|
+
},
|
|
1704
|
+
})),
|
|
1705
|
+
command: {
|
|
1706
|
+
name: tr.name,
|
|
1707
|
+
options: tr.options,
|
|
1708
|
+
metadata: tr.metadata,
|
|
1709
|
+
},
|
|
1710
|
+
}));
|
|
1711
|
+
}
|
|
1712
|
+
async getSecondaryMenuItems() {
|
|
1713
|
+
return (await this.vm.getSecondaryActions()).map((tr) => ({
|
|
1714
|
+
name: tr.name,
|
|
1715
|
+
title: tr.title,
|
|
1716
|
+
icon: tr.icon,
|
|
1717
|
+
color: tr.color,
|
|
1718
|
+
disabled: tr.disabled,
|
|
1719
|
+
separated: tr.separated,
|
|
1720
|
+
command: {
|
|
1721
|
+
name: tr.name,
|
|
1722
|
+
options: tr.options,
|
|
1723
|
+
metadata: tr.metadata,
|
|
1724
|
+
},
|
|
1725
|
+
}));
|
|
1726
|
+
}
|
|
1727
|
+
async execute(command) {
|
|
1728
|
+
if (command) {
|
|
1729
|
+
this.vm.execute(command);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
handleUnselectAll() {
|
|
1733
|
+
this.vm.selectedItems.set([]);
|
|
1734
|
+
}
|
|
1735
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityMasterListViewComponent, deps: [{ token: i1$2.AXPlatform }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1736
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPEntityMasterListViewComponent, isStandalone: true, selector: "axp-entity-master-list", providers: [
|
|
1737
|
+
{
|
|
1738
|
+
provide: AXPPageLayoutBase,
|
|
1739
|
+
useExisting: AXPEntityMasterListViewComponent,
|
|
1740
|
+
},
|
|
1741
|
+
], viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<axp-page-layout *translate=\"let t\">\n @if (vm.entityDef.category) {\n <axp-layout-start-side id=\"axp-entity-category-drawer\">\n <axp-entity-category id=\"axp-entity-category\" class=\"ax-w-80\" [vm]=\"vm\"\n [searchValue]=\"categorySearchValue()\"></axp-entity-category>\n </axp-layout-start-side>\n }\n <axp-page-toolbar id=\"axp-entity-toolbar\">\n <axp-entity-master-toolbar-view [viewModel]=\"vm\"></axp-entity-master-toolbar-view>\n </axp-page-toolbar>\n <axp-page-content class=\"ax-overflow-auto ax-pt-0\">\n <div class=\"ax-flex ax-items-center ax-justify-between ax-gap-1 ax-pb-1 ax-text-muted ax-text-sm\"\n [class.ax-invisible]=\"!grid.selectedRows.length\">\n <span>{{ grid.selectedRows.length }}\n <span>{{ '@general:terms.interface.items-selected' | translate | async }}</span>\n </span>\n <ax-button text=\"@general:terms.interface.unselect-all\" class=\"ax-xs\" (onClick)=\"handleUnselectAll()\"></ax-button>\n </div>\n <ax-data-table id=\"axp-entity-table\" [allowReordering]=\"true\"\n (onColumnsOrderChanged)=\"onColumnsOrderChanged($event)\" #grid [showFooter]=\"false\" class=\"ax-flex-1\"\n [paging]=\"true\" [fetchDataMode]=\"'manual'\" [parentField]=\"vm.parentKey()\"\n [loading]=\"{ enabled: true, animation: true }\" [dataSource]=\"vm.dataSource\"\n (selectedRowsChange)=\"handleSelectedRowsChange($event)\" (onRowDbClick)=\"handleRowDbClick($event)\"\n (onColumnSizeChanged)=\"onColumnSizeChanged($event)\" (onPageChanged)=\"onPageChanged($event)\">\n @if (vm.view().indexCol === true) {\n <ax-index-column id=\"axp-table-col-index\" fixed=\"start\" [width]=\"'80px'\" [padZero]=\"true\"></ax-index-column>\n }\n @if (vm.selectedScopeActionsCount()) {\n <ax-select-column id=\"axp-table-col-select\" fixed=\"start\" [width]=\"'60px'\"></ax-select-column>\n }\n @for (col of vm.columns(); track col.name) {\n @if (col.visible) {\n <axp-widget-column-renderer [attr.id]=\"'axp-table-col-' + col.name\"\n [expandHandler]=\"$index === 0 && vm.parentKey() ? true : false\" [caption]=\"(col.title | translate | async)!\"\n [node]=\"col.node()\" [customWidth]=\"col.width\"></axp-widget-column-renderer>\n }\n }\n @if (getCommandRowItems().length) {\n <ax-command-column id=\"axp-table-col-commands\" fixed=\"end\" [width]=\"getCommandRowItems().length * 70 + 'px'\"\n [items]=\"getCommandRowItems()\" (onItemClick)=\"handleRowCommandClick($event)\"></ax-command-column>\n }\n <ax-dropdown-command-column id=\"axp-table-col-dropdown-commands\" fixed=\"end\" [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\" (onItemClick)=\"handleRowCommandClick($event)\"></ax-dropdown-command-column>\n </ax-data-table>\n </axp-page-content>\n</axp-page-layout>", styles: ["axp-entity-master-list axp-layout-start-side{min-width:20rem!important;border-inline-end-width:1px;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}axp-entity-master-list axp-layout-header{padding-bottom:.25rem!important}.cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background:rgba(var(--ax-color-on-surface));padding:.5rem;height:max-content!important}.collapsed-search-box{margin-top:0;height:0px;opacity:0}.view-drawer{width:85vw}@media(min-width:768px){.view-drawer{width:45vw}}@media(min-width:1024px){.view-drawer{width:35vw}}@media(min-width:1536px){.view-drawer{width:20vw}}.view-drawer{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lightest-surface),var(--tw-bg-opacity, 1));border-inline-start-width:1px;border-inline-start-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));border-top-width:1px;--tw-border-opacity: 1;border-top-color:rgba(var(--ax-sys-color-primary-600),var(--tw-border-opacity, 1))}.view-drawer ax-header{display:flex;align-items:center;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lighter-surface),var(--tw-bg-opacity, 1));padding:.5rem 1rem}.view-drawer ax-header h2{font-size:1.25rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-lighter-surface),var(--tw-text-opacity, 1))}.view-drawer ax-footer{position:absolute!important;bottom:0!important;width:100%!important;justify-content:flex-start!important;border-top-width:1px!important;--tw-border-opacity: 1 !important;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1))!important;padding:.5rem 1rem!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXActionSheetModule }, { kind: "ngmodule", type: AXDrawerModule }, { kind: "ngmodule", type: AXDialogModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTabsModule }, { kind: "ngmodule", type: AXTooltipModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i7.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "selectedRows", "parentField", "hasChildrenField", "rowDetailsTemplate", "title", "rowTemplate", "emptyTemplate", "noDataTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged", "onPageChanged"] }, { kind: "component", type: i7.AXRowIndexColumnComponent, selector: "ax-index-column", inputs: ["width", "caption", "fixed", "footerTemplate", "padZero"] }, { kind: "component", type: i7.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "component", type: i7.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i7.AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "emptyStateTemplate", "emptyStateText", "items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i10.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type:
|
|
1742
|
+
//
|
|
1743
|
+
AXPWidgetCoreModule }, { kind: "component", type: i7$1.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "customExpandIcon", "customCollapseIcon", "customWidth", "node", "footerTemplate", "expandHandler", "cellTemplate", "headerTemplate"] }, { kind: "ngmodule", type: AXPWidgetsModule }, { kind: "ngmodule", type: AXPAuthModule }, { kind: "component", type:
|
|
1744
|
+
//
|
|
1745
|
+
AXPEntityMasterToolbarViewComponent, selector: "axp-entity-master-toolbar-view", inputs: ["viewModel"] }, { kind: "component", type:
|
|
1746
|
+
//
|
|
1747
|
+
AXPPageLayoutComponent, selector: "axp-page-layout" }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer-container, axp-page-footer, axp-page-header, axp-page-header-container, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-page-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title-bar, axp-layout-title, axp-layout-title-actions, axp-layout-nav-button, axp-layout-description, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "component", type: AXPThemeLayoutStartSideComponent, selector: "axp-layout-page-start-side, axp-layout-start-side" }, { kind: "component", type: AXPEntityCategoryComponent, selector: "axp-entity-category", inputs: ["vm", "searchValue", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "searchWithChildren"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1748
|
+
}
|
|
1749
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityMasterListViewComponent, decorators: [{
|
|
1750
|
+
type: Component,
|
|
1751
|
+
args: [{ selector: 'axp-entity-master-list', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1752
|
+
CommonModule,
|
|
1753
|
+
FormsModule,
|
|
1754
|
+
RouterModule,
|
|
1755
|
+
AXButtonModule,
|
|
1756
|
+
AXDecoratorModule,
|
|
1757
|
+
AXBadgeModule,
|
|
1758
|
+
AXDropdownModule,
|
|
1759
|
+
AXPopoverModule,
|
|
1760
|
+
AXFormModule,
|
|
1761
|
+
AXActionSheetModule,
|
|
1762
|
+
AXDrawerModule,
|
|
1763
|
+
AXDialogModule,
|
|
1764
|
+
AXLoadingModule,
|
|
1765
|
+
AXTabsModule,
|
|
1766
|
+
AXTooltipModule,
|
|
1767
|
+
AXBreadcrumbsModule,
|
|
1768
|
+
AXDropdownButtonModule,
|
|
1769
|
+
AXSearchBoxModule,
|
|
1770
|
+
AXDataTableModule,
|
|
1771
|
+
AXTranslationModule,
|
|
1772
|
+
DragDropModule,
|
|
1773
|
+
//
|
|
1774
|
+
AXPWidgetCoreModule,
|
|
1775
|
+
AXPWidgetsModule,
|
|
1776
|
+
AXPAuthModule,
|
|
1777
|
+
//
|
|
1778
|
+
AXPEntityMasterToolbarViewComponent,
|
|
1779
|
+
//
|
|
1780
|
+
AXPPageLayoutComponent,
|
|
1781
|
+
AXPThemeLayoutBlockComponent,
|
|
1782
|
+
AXDropdownButtonModule,
|
|
1783
|
+
AXPThemeLayoutStartSideComponent,
|
|
1784
|
+
AXPEntityCategoryComponent,
|
|
1785
|
+
], providers: [
|
|
1786
|
+
{
|
|
1787
|
+
provide: AXPPageLayoutBase,
|
|
1788
|
+
useExisting: AXPEntityMasterListViewComponent,
|
|
1789
|
+
},
|
|
1790
|
+
], template: "<axp-page-layout *translate=\"let t\">\n @if (vm.entityDef.category) {\n <axp-layout-start-side id=\"axp-entity-category-drawer\">\n <axp-entity-category id=\"axp-entity-category\" class=\"ax-w-80\" [vm]=\"vm\"\n [searchValue]=\"categorySearchValue()\"></axp-entity-category>\n </axp-layout-start-side>\n }\n <axp-page-toolbar id=\"axp-entity-toolbar\">\n <axp-entity-master-toolbar-view [viewModel]=\"vm\"></axp-entity-master-toolbar-view>\n </axp-page-toolbar>\n <axp-page-content class=\"ax-overflow-auto ax-pt-0\">\n <div class=\"ax-flex ax-items-center ax-justify-between ax-gap-1 ax-pb-1 ax-text-muted ax-text-sm\"\n [class.ax-invisible]=\"!grid.selectedRows.length\">\n <span>{{ grid.selectedRows.length }}\n <span>{{ '@general:terms.interface.items-selected' | translate | async }}</span>\n </span>\n <ax-button text=\"@general:terms.interface.unselect-all\" class=\"ax-xs\" (onClick)=\"handleUnselectAll()\"></ax-button>\n </div>\n <ax-data-table id=\"axp-entity-table\" [allowReordering]=\"true\"\n (onColumnsOrderChanged)=\"onColumnsOrderChanged($event)\" #grid [showFooter]=\"false\" class=\"ax-flex-1\"\n [paging]=\"true\" [fetchDataMode]=\"'manual'\" [parentField]=\"vm.parentKey()\"\n [loading]=\"{ enabled: true, animation: true }\" [dataSource]=\"vm.dataSource\"\n (selectedRowsChange)=\"handleSelectedRowsChange($event)\" (onRowDbClick)=\"handleRowDbClick($event)\"\n (onColumnSizeChanged)=\"onColumnSizeChanged($event)\" (onPageChanged)=\"onPageChanged($event)\">\n @if (vm.view().indexCol === true) {\n <ax-index-column id=\"axp-table-col-index\" fixed=\"start\" [width]=\"'80px'\" [padZero]=\"true\"></ax-index-column>\n }\n @if (vm.selectedScopeActionsCount()) {\n <ax-select-column id=\"axp-table-col-select\" fixed=\"start\" [width]=\"'60px'\"></ax-select-column>\n }\n @for (col of vm.columns(); track col.name) {\n @if (col.visible) {\n <axp-widget-column-renderer [attr.id]=\"'axp-table-col-' + col.name\"\n [expandHandler]=\"$index === 0 && vm.parentKey() ? true : false\" [caption]=\"(col.title | translate | async)!\"\n [node]=\"col.node()\" [customWidth]=\"col.width\"></axp-widget-column-renderer>\n }\n }\n @if (getCommandRowItems().length) {\n <ax-command-column id=\"axp-table-col-commands\" fixed=\"end\" [width]=\"getCommandRowItems().length * 70 + 'px'\"\n [items]=\"getCommandRowItems()\" (onItemClick)=\"handleRowCommandClick($event)\"></ax-command-column>\n }\n <ax-dropdown-command-column id=\"axp-table-col-dropdown-commands\" fixed=\"end\" [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\" (onItemClick)=\"handleRowCommandClick($event)\"></ax-dropdown-command-column>\n </ax-data-table>\n </axp-page-content>\n</axp-page-layout>", styles: ["axp-entity-master-list axp-layout-start-side{min-width:20rem!important;border-inline-end-width:1px;background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}axp-entity-master-list axp-layout-header{padding-bottom:.25rem!important}.cdk-drag-preview{border-radius:.375rem;border-width:1px;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background:rgba(var(--ax-color-on-surface));padding:.5rem;height:max-content!important}.collapsed-search-box{margin-top:0;height:0px;opacity:0}.view-drawer{width:85vw}@media(min-width:768px){.view-drawer{width:45vw}}@media(min-width:1024px){.view-drawer{width:35vw}}@media(min-width:1536px){.view-drawer{width:20vw}}.view-drawer{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lightest-surface),var(--tw-bg-opacity, 1));border-inline-start-width:1px;border-inline-start-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));border-top-width:1px;--tw-border-opacity: 1;border-top-color:rgba(var(--ax-sys-color-primary-600),var(--tw-border-opacity, 1))}.view-drawer ax-header{display:flex;align-items:center;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lighter-surface),var(--tw-bg-opacity, 1));padding:.5rem 1rem}.view-drawer ax-header h2{font-size:1.25rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-lighter-surface),var(--tw-text-opacity, 1))}.view-drawer ax-footer{position:absolute!important;bottom:0!important;width:100%!important;justify-content:flex-start!important;border-top-width:1px!important;--tw-border-opacity: 1 !important;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1))!important;padding:.5rem 1rem!important}\n"] }]
|
|
1791
|
+
}], ctorParameters: () => [{ type: i1$2.AXPlatform }], propDecorators: { grid: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
|
|
1792
|
+
|
|
1793
|
+
var entityMasterListView_component = /*#__PURE__*/Object.freeze({
|
|
1794
|
+
__proto__: null,
|
|
1795
|
+
AXPEntityMasterListViewComponent: AXPEntityMasterListViewComponent
|
|
1796
|
+
});
|
|
1797
|
+
|
|
1798
|
+
class AXPRootLayoutFooterComponent {
|
|
1799
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1800
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: AXPRootLayoutFooterComponent, isStandalone: true, selector: "axp-dashboard-admin-footer", host: { classAttribute: "ax-h-10 ax-flex ax-item-center ax-justify-between ax-bg-lighter ax-border-lighter ax-px-6 ax-border-t" }, providers: [], ngImport: i0, template: "<div class=\"ax-flex ax-items-center ax-justify-start ax-gap-1\">\n <axp-component-slot name=\"root-footer-start\"></axp-component-slot>\n</div>\n<div class=\"ax-flex ax-items-center ax-justify-end ax-gap-1\">\n <axp-component-slot name=\"root-footer-end\"></axp-component-slot>\n</div>\n", dependencies: [{ kind: "ngmodule", type: AXPComponentSlotModule }, { kind: "directive", type: i1$3.AXPComponentSlotDirective, selector: "axp-component-slot", inputs: ["name", "host", "context"], exportAs: ["slot"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1801
|
+
}
|
|
1802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutFooterComponent, decorators: [{
|
|
1803
|
+
type: Component,
|
|
1804
|
+
args: [{ selector: 'axp-dashboard-admin-footer', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [], host: {
|
|
1805
|
+
class: 'ax-h-10 ax-flex ax-item-center ax-justify-between ax-bg-lighter ax-border-lighter ax-px-6 ax-border-t',
|
|
1806
|
+
}, standalone: true, imports: [
|
|
1807
|
+
AXPComponentSlotModule
|
|
1808
|
+
], template: "<div class=\"ax-flex ax-items-center ax-justify-start ax-gap-1\">\n <axp-component-slot name=\"root-footer-start\"></axp-component-slot>\n</div>\n<div class=\"ax-flex ax-items-center ax-justify-end ax-gap-1\">\n <axp-component-slot name=\"root-footer-end\"></axp-component-slot>\n</div>\n" }]
|
|
1809
|
+
}] });
|
|
1810
|
+
|
|
1811
|
+
class AXPRootLayoutHeaderComponent {
|
|
1812
|
+
constructor() {
|
|
1813
|
+
this.config = inject(AXP_PLATFORM_CONFIG_TOKEN);
|
|
1814
|
+
this.store = inject(AXPLayoutThemeService);
|
|
1815
|
+
this.router = inject(Router);
|
|
1816
|
+
this.logo = this.config.logo;
|
|
1817
|
+
}
|
|
1818
|
+
toggleSideMenu() {
|
|
1819
|
+
this.store.toggleSideMenu();
|
|
1820
|
+
}
|
|
1821
|
+
handleLogoClick() {
|
|
1822
|
+
this.router.navigate(['/']);
|
|
1823
|
+
}
|
|
1824
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1825
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPRootLayoutHeaderComponent, isStandalone: true, selector: "axp-dashboard-admin-header", host: { classAttribute: "ax-w-full ax-flex ax-items-center ax-justify-between ax-bg-primary-surface ax-text-primary-on-surface ax-h-14 ax-px-2 ax-light" }, ngImport: i0, template: "<ax-button id=\"axp-menu-toggle\" (onClick)=\"toggleSideMenu()\" color=\"primary\">\n <ax-icon class=\"rtl:ax-rotate-180\">\n <svg width=\"28\" height=\"28\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n @if (store.isSideMenuOpen()) {\n <defs>\n <clipPath id=\"clip1382_20239\">\n <rect width=\"30.000000\" height=\"30.000000\" fill=\"white\" fill-opacity=\"0\"></rect>\n </clipPath>\n </defs>\n <rect width=\"30.000000\" height=\"30.000000\" fill=\"#FFFFFF\" fill-opacity=\"0\"></rect>\n <g clip-path=\"url(#clip1382_20239)\">\n <rect\n id=\"rect\"\n x=\"17.420410\"\n y=\"12.316406\"\n rx=\"1.000947\"\n width=\"5.995172\"\n height=\"2.001895\"\n transform=\"rotate(137.159 17.420410 12.316406)\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n ></rect>\n <rect\n id=\"rect\"\n x=\"12.959473\"\n y=\"13.728516\"\n rx=\"0.995190\"\n width=\"6.002943\"\n height=\"1.990380\"\n transform=\"rotate(40.853 12.959473 13.728516)\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n ></rect>\n <path\n id=\"path\"\n d=\"M20.1 25.5L9.9 25.51C9.48 25.51 9.06 25.47 8.65 25.39C8.24 25.3 7.84 25.18 7.45 25.02C7.06 24.86 6.69 24.66 6.34 24.43C5.99 24.19 5.67 23.92 5.37 23.63C5.07 23.33 4.81 23 4.58 22.65C4.34 22.3 4.15 21.93 3.98 21.54C3.82 21.15 3.7 20.75 3.62 20.34C3.54 19.93 3.5 19.51 3.5 19.09L3.5 10.93C3.5 10.51 3.54 10.1 3.62 9.68C3.7 9.27 3.82 8.87 3.98 8.48C4.15 8.09 4.34 7.72 4.58 7.37C4.81 7.02 5.07 6.69 5.37 6.39C5.67 6.1 5.99 5.83 6.34 5.6C6.69 5.36 7.06 5.16 7.45 5C7.84 4.84 8.24 4.72 8.65 4.64C9.06 4.55 9.48 4.51 9.9 4.51L20.1 4.5C20.52 4.5 20.94 4.54 21.35 4.62C21.76 4.7 22.16 4.83 22.55 4.99C22.94 5.15 23.31 5.35 23.66 5.58C24 5.82 24.33 6.08 24.62 6.38C24.92 6.68 25.19 7 25.42 7.35C25.65 7.7 25.85 8.07 26.01 8.46C26.17 8.85 26.3 9.25 26.38 9.67C26.46 10.08 26.5 10.5 26.5 10.92L26.5 19.07C26.5 19.5 26.46 19.91 26.38 20.32C26.3 20.74 26.17 21.14 26.01 21.53C25.85 21.92 25.65 22.29 25.42 22.64C25.19 22.99 24.92 23.31 24.62 23.61C24.33 23.91 24 24.17 23.66 24.41C23.31 24.64 22.94 24.84 22.55 25C22.16 25.16 21.76 25.29 21.35 25.37C20.94 25.45 20.52 25.5 20.1 25.5ZM9.9 6.6C9.61 6.6 9.33 6.63 9.05 6.69C8.78 6.74 8.51 6.82 8.24 6.93C7.98 7.04 7.73 7.18 7.5 7.33C7.26 7.49 7.04 7.67 6.84 7.87C6.64 8.07 6.46 8.29 6.31 8.53C6.15 8.77 6.02 9.01 5.91 9.28C5.8 9.54 5.72 9.81 5.66 10.09C5.61 10.37 5.58 10.65 5.58 10.93L5.58 19.09C5.58 19.37 5.61 19.65 5.66 19.93C5.72 20.21 5.8 20.48 5.91 20.74C6.02 21.01 6.15 21.26 6.31 21.49C6.46 21.73 6.64 21.95 6.84 22.15C7.04 22.35 7.26 22.53 7.5 22.69C7.73 22.85 7.98 22.98 8.24 23.09C8.51 23.2 8.78 23.28 9.05 23.33C9.33 23.39 9.61 23.42 9.9 23.42L20.1 23.41C20.38 23.41 20.67 23.37 20.94 23.32C21.22 23.26 21.49 23.18 21.75 23.07C22.01 22.96 22.26 22.83 22.5 22.67C22.73 22.51 22.95 22.33 23.15 22.13C23.35 21.93 23.53 21.71 23.69 21.48C23.85 21.24 23.98 20.99 24.09 20.73C24.2 20.47 24.28 20.2 24.33 19.92C24.39 19.64 24.42 19.36 24.42 19.07L24.42 10.92C24.42 10.64 24.39 10.35 24.33 10.07C24.28 9.79 24.2 9.52 24.09 9.26C23.98 9 23.85 8.75 23.69 8.51C23.53 8.28 23.35 8.06 23.15 7.86C22.95 7.66 22.73 7.48 22.5 7.32C22.26 7.16 22.01 7.03 21.75 6.92C21.49 6.81 21.22 6.73 20.94 6.67C20.67 6.62 20.38 6.59 20.1 6.59L9.9 6.6Z\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n fill-rule=\"nonzero\"\n ></path>\n <path\n id=\"rect\"\n d=\"M8.5 5.51L10.54 5.51L10.6 24.43L8.55 24.43L8.5 5.51Z\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n fill-rule=\"evenodd\"\n ></path>\n </g>\n } @else {\n <defs>\n <clipPath id=\"clip1381_20236\">\n <rect id=\"\u6253\u5F00\u8FB9\u680F0730\" width=\"30.000000\" height=\"30.000000\" fill=\"white\" fill-opacity=\"0\"></rect>\n </clipPath>\n </defs>\n <rect id=\"\u6253\u5F00\u8FB9\u680F0730\" width=\"30.000000\" height=\"30.000000\" fill=\"#FFFFFF\" fill-opacity=\"0\"></rect>\n <g clip-path=\"url(#clip1381_20236)\">\n <rect\n id=\"rect\"\n x=\"11.572754\"\n y=\"17.683594\"\n rx=\"1.000947\"\n width=\"5.995172\"\n height=\"2.001895\"\n transform=\"rotate(-42.841 11.572754 17.683594)\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n ></rect>\n <rect\n id=\"rect\"\n x=\"16.033691\"\n y=\"16.271484\"\n rx=\"0.995190\"\n width=\"6.002943\"\n height=\"1.990380\"\n transform=\"rotate(-139.147 16.033691 16.271484)\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n ></rect>\n <path\n id=\"path\"\n d=\"M20.09 25.48L9.89 25.5C9.47 25.5 9.05 25.45 8.64 25.37C8.23 25.29 7.83 25.17 7.44 25C7.05 24.84 6.68 24.64 6.33 24.41C5.98 24.18 5.66 23.91 5.36 23.61C5.07 23.31 4.8 22.99 4.57 22.64C4.34 22.29 4.14 21.92 3.98 21.53C3.82 21.14 3.69 20.74 3.61 20.32C3.53 19.91 3.49 19.49 3.49 19.07L3.49 10.92C3.49 10.5 3.53 10.08 3.61 9.67C3.69 9.25 3.82 8.85 3.98 8.46C4.14 8.07 4.34 7.7 4.57 7.35C4.8 7 5.07 6.68 5.36 6.38C5.66 6.08 5.98 5.81 6.33 5.58C6.68 5.35 7.05 5.15 7.44 4.99C7.83 4.82 8.23 4.7 8.64 4.62C9.05 4.54 9.47 4.5 9.89 4.5L20.09 4.48C20.51 4.48 20.93 4.52 21.34 4.6C21.75 4.69 22.15 4.81 22.54 4.97C22.93 5.13 23.3 5.33 23.65 5.57C24 5.8 24.32 6.06 24.62 6.36C24.92 6.66 25.18 6.98 25.41 7.33C25.65 7.69 25.84 8.06 26.01 8.45C26.17 8.84 26.29 9.24 26.37 9.65C26.45 10.06 26.49 10.48 26.5 10.91L26.5 19.06C26.49 19.48 26.45 19.89 26.37 20.31C26.29 20.72 26.17 21.12 26.01 21.51C25.84 21.9 25.65 22.27 25.41 22.62C25.18 22.97 24.92 23.3 24.62 23.6C24.32 23.89 24 24.16 23.65 24.39C23.3 24.63 22.93 24.83 22.54 24.99C22.15 25.15 21.75 25.27 21.34 25.35C20.93 25.44 20.51 25.48 20.09 25.48ZM9.89 6.59C9.61 6.59 9.32 6.62 9.05 6.67C8.77 6.73 8.5 6.81 8.24 6.92C7.98 7.03 7.73 7.16 7.49 7.32C7.26 7.48 7.04 7.66 6.84 7.86C6.64 8.06 6.46 8.28 6.3 8.51C6.14 8.75 6.01 9 5.9 9.26C5.79 9.52 5.71 9.8 5.66 10.07C5.6 10.35 5.57 10.63 5.57 10.92L5.57 19.07C5.57 19.36 5.6 19.64 5.66 19.92C5.71 20.19 5.79 20.47 5.9 20.73C6.01 20.99 6.14 21.24 6.3 21.48C6.46 21.71 6.64 21.93 6.84 22.13C7.04 22.33 7.26 22.51 7.49 22.67C7.73 22.83 7.98 22.96 8.24 23.07C8.5 23.18 8.77 23.26 9.05 23.32C9.32 23.37 9.61 23.4 9.89 23.4L20.09 23.39C20.38 23.39 20.66 23.36 20.94 23.3C21.21 23.25 21.48 23.17 21.75 23.06C22.01 22.95 22.26 22.81 22.49 22.66C22.73 22.5 22.95 22.32 23.15 22.12C23.35 21.91 23.52 21.7 23.68 21.46C23.84 21.22 23.97 20.98 24.08 20.71C24.19 20.45 24.27 20.18 24.33 19.9C24.38 19.62 24.41 19.34 24.41 19.06L24.41 10.91C24.41 10.62 24.38 10.34 24.33 10.06C24.27 9.78 24.19 9.51 24.08 9.25C23.97 8.98 23.84 8.74 23.68 8.5C23.52 8.26 23.35 8.04 23.15 7.84C22.95 7.64 22.73 7.46 22.49 7.3C22.26 7.15 22.01 7.01 21.75 6.9C21.48 6.79 21.21 6.71 20.94 6.66C20.66 6.6 20.38 6.57 20.09 6.57L9.89 6.59Z\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n fill-rule=\"nonzero\"\n ></path>\n <path\n id=\"rect\"\n d=\"M8.49 5.5L10.53 5.5L10.59 24.41L8.54 24.41L8.49 5.5Z\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n fill-rule=\"evenodd\"\n ></path>\n </g>\n }\n </svg>\n </ax-icon>\n</ax-button>\n<div class=\"ax-flex ax-items-center ax-gap-1 ax-justify-between ax-w-full\">\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <axp-component-slot name=\"root-header-start\"></axp-component-slot>\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <axp-component-slot name=\"root-header-end\"></axp-component-slot>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: AXPComponentSlotModule }, { kind: "directive", type: i1$3.AXPComponentSlotDirective, selector: "axp-component-slot", inputs: ["name", "host", "context"], exportAs: ["slot"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1826
|
+
}
|
|
1827
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutHeaderComponent, decorators: [{
|
|
1828
|
+
type: Component,
|
|
1829
|
+
args: [{ selector: 'axp-dashboard-admin-header', encapsulation: ViewEncapsulation.None, host: { class: 'ax-w-full ax-flex ax-items-center ax-justify-between ax-bg-primary-surface ax-text-primary-on-surface ax-h-14 ax-px-2 ax-light' }, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1830
|
+
AXPComponentSlotModule,
|
|
1831
|
+
AXButtonModule,
|
|
1832
|
+
AXDecoratorModule
|
|
1833
|
+
], template: "<ax-button id=\"axp-menu-toggle\" (onClick)=\"toggleSideMenu()\" color=\"primary\">\n <ax-icon class=\"rtl:ax-rotate-180\">\n <svg width=\"28\" height=\"28\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n @if (store.isSideMenuOpen()) {\n <defs>\n <clipPath id=\"clip1382_20239\">\n <rect width=\"30.000000\" height=\"30.000000\" fill=\"white\" fill-opacity=\"0\"></rect>\n </clipPath>\n </defs>\n <rect width=\"30.000000\" height=\"30.000000\" fill=\"#FFFFFF\" fill-opacity=\"0\"></rect>\n <g clip-path=\"url(#clip1382_20239)\">\n <rect\n id=\"rect\"\n x=\"17.420410\"\n y=\"12.316406\"\n rx=\"1.000947\"\n width=\"5.995172\"\n height=\"2.001895\"\n transform=\"rotate(137.159 17.420410 12.316406)\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n ></rect>\n <rect\n id=\"rect\"\n x=\"12.959473\"\n y=\"13.728516\"\n rx=\"0.995190\"\n width=\"6.002943\"\n height=\"1.990380\"\n transform=\"rotate(40.853 12.959473 13.728516)\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n ></rect>\n <path\n id=\"path\"\n d=\"M20.1 25.5L9.9 25.51C9.48 25.51 9.06 25.47 8.65 25.39C8.24 25.3 7.84 25.18 7.45 25.02C7.06 24.86 6.69 24.66 6.34 24.43C5.99 24.19 5.67 23.92 5.37 23.63C5.07 23.33 4.81 23 4.58 22.65C4.34 22.3 4.15 21.93 3.98 21.54C3.82 21.15 3.7 20.75 3.62 20.34C3.54 19.93 3.5 19.51 3.5 19.09L3.5 10.93C3.5 10.51 3.54 10.1 3.62 9.68C3.7 9.27 3.82 8.87 3.98 8.48C4.15 8.09 4.34 7.72 4.58 7.37C4.81 7.02 5.07 6.69 5.37 6.39C5.67 6.1 5.99 5.83 6.34 5.6C6.69 5.36 7.06 5.16 7.45 5C7.84 4.84 8.24 4.72 8.65 4.64C9.06 4.55 9.48 4.51 9.9 4.51L20.1 4.5C20.52 4.5 20.94 4.54 21.35 4.62C21.76 4.7 22.16 4.83 22.55 4.99C22.94 5.15 23.31 5.35 23.66 5.58C24 5.82 24.33 6.08 24.62 6.38C24.92 6.68 25.19 7 25.42 7.35C25.65 7.7 25.85 8.07 26.01 8.46C26.17 8.85 26.3 9.25 26.38 9.67C26.46 10.08 26.5 10.5 26.5 10.92L26.5 19.07C26.5 19.5 26.46 19.91 26.38 20.32C26.3 20.74 26.17 21.14 26.01 21.53C25.85 21.92 25.65 22.29 25.42 22.64C25.19 22.99 24.92 23.31 24.62 23.61C24.33 23.91 24 24.17 23.66 24.41C23.31 24.64 22.94 24.84 22.55 25C22.16 25.16 21.76 25.29 21.35 25.37C20.94 25.45 20.52 25.5 20.1 25.5ZM9.9 6.6C9.61 6.6 9.33 6.63 9.05 6.69C8.78 6.74 8.51 6.82 8.24 6.93C7.98 7.04 7.73 7.18 7.5 7.33C7.26 7.49 7.04 7.67 6.84 7.87C6.64 8.07 6.46 8.29 6.31 8.53C6.15 8.77 6.02 9.01 5.91 9.28C5.8 9.54 5.72 9.81 5.66 10.09C5.61 10.37 5.58 10.65 5.58 10.93L5.58 19.09C5.58 19.37 5.61 19.65 5.66 19.93C5.72 20.21 5.8 20.48 5.91 20.74C6.02 21.01 6.15 21.26 6.31 21.49C6.46 21.73 6.64 21.95 6.84 22.15C7.04 22.35 7.26 22.53 7.5 22.69C7.73 22.85 7.98 22.98 8.24 23.09C8.51 23.2 8.78 23.28 9.05 23.33C9.33 23.39 9.61 23.42 9.9 23.42L20.1 23.41C20.38 23.41 20.67 23.37 20.94 23.32C21.22 23.26 21.49 23.18 21.75 23.07C22.01 22.96 22.26 22.83 22.5 22.67C22.73 22.51 22.95 22.33 23.15 22.13C23.35 21.93 23.53 21.71 23.69 21.48C23.85 21.24 23.98 20.99 24.09 20.73C24.2 20.47 24.28 20.2 24.33 19.92C24.39 19.64 24.42 19.36 24.42 19.07L24.42 10.92C24.42 10.64 24.39 10.35 24.33 10.07C24.28 9.79 24.2 9.52 24.09 9.26C23.98 9 23.85 8.75 23.69 8.51C23.53 8.28 23.35 8.06 23.15 7.86C22.95 7.66 22.73 7.48 22.5 7.32C22.26 7.16 22.01 7.03 21.75 6.92C21.49 6.81 21.22 6.73 20.94 6.67C20.67 6.62 20.38 6.59 20.1 6.59L9.9 6.6Z\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n fill-rule=\"nonzero\"\n ></path>\n <path\n id=\"rect\"\n d=\"M8.5 5.51L10.54 5.51L10.6 24.43L8.55 24.43L8.5 5.51Z\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n fill-rule=\"evenodd\"\n ></path>\n </g>\n } @else {\n <defs>\n <clipPath id=\"clip1381_20236\">\n <rect id=\"\u6253\u5F00\u8FB9\u680F0730\" width=\"30.000000\" height=\"30.000000\" fill=\"white\" fill-opacity=\"0\"></rect>\n </clipPath>\n </defs>\n <rect id=\"\u6253\u5F00\u8FB9\u680F0730\" width=\"30.000000\" height=\"30.000000\" fill=\"#FFFFFF\" fill-opacity=\"0\"></rect>\n <g clip-path=\"url(#clip1381_20236)\">\n <rect\n id=\"rect\"\n x=\"11.572754\"\n y=\"17.683594\"\n rx=\"1.000947\"\n width=\"5.995172\"\n height=\"2.001895\"\n transform=\"rotate(-42.841 11.572754 17.683594)\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n ></rect>\n <rect\n id=\"rect\"\n x=\"16.033691\"\n y=\"16.271484\"\n rx=\"0.995190\"\n width=\"6.002943\"\n height=\"1.990380\"\n transform=\"rotate(-139.147 16.033691 16.271484)\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n ></rect>\n <path\n id=\"path\"\n d=\"M20.09 25.48L9.89 25.5C9.47 25.5 9.05 25.45 8.64 25.37C8.23 25.29 7.83 25.17 7.44 25C7.05 24.84 6.68 24.64 6.33 24.41C5.98 24.18 5.66 23.91 5.36 23.61C5.07 23.31 4.8 22.99 4.57 22.64C4.34 22.29 4.14 21.92 3.98 21.53C3.82 21.14 3.69 20.74 3.61 20.32C3.53 19.91 3.49 19.49 3.49 19.07L3.49 10.92C3.49 10.5 3.53 10.08 3.61 9.67C3.69 9.25 3.82 8.85 3.98 8.46C4.14 8.07 4.34 7.7 4.57 7.35C4.8 7 5.07 6.68 5.36 6.38C5.66 6.08 5.98 5.81 6.33 5.58C6.68 5.35 7.05 5.15 7.44 4.99C7.83 4.82 8.23 4.7 8.64 4.62C9.05 4.54 9.47 4.5 9.89 4.5L20.09 4.48C20.51 4.48 20.93 4.52 21.34 4.6C21.75 4.69 22.15 4.81 22.54 4.97C22.93 5.13 23.3 5.33 23.65 5.57C24 5.8 24.32 6.06 24.62 6.36C24.92 6.66 25.18 6.98 25.41 7.33C25.65 7.69 25.84 8.06 26.01 8.45C26.17 8.84 26.29 9.24 26.37 9.65C26.45 10.06 26.49 10.48 26.5 10.91L26.5 19.06C26.49 19.48 26.45 19.89 26.37 20.31C26.29 20.72 26.17 21.12 26.01 21.51C25.84 21.9 25.65 22.27 25.41 22.62C25.18 22.97 24.92 23.3 24.62 23.6C24.32 23.89 24 24.16 23.65 24.39C23.3 24.63 22.93 24.83 22.54 24.99C22.15 25.15 21.75 25.27 21.34 25.35C20.93 25.44 20.51 25.48 20.09 25.48ZM9.89 6.59C9.61 6.59 9.32 6.62 9.05 6.67C8.77 6.73 8.5 6.81 8.24 6.92C7.98 7.03 7.73 7.16 7.49 7.32C7.26 7.48 7.04 7.66 6.84 7.86C6.64 8.06 6.46 8.28 6.3 8.51C6.14 8.75 6.01 9 5.9 9.26C5.79 9.52 5.71 9.8 5.66 10.07C5.6 10.35 5.57 10.63 5.57 10.92L5.57 19.07C5.57 19.36 5.6 19.64 5.66 19.92C5.71 20.19 5.79 20.47 5.9 20.73C6.01 20.99 6.14 21.24 6.3 21.48C6.46 21.71 6.64 21.93 6.84 22.13C7.04 22.33 7.26 22.51 7.49 22.67C7.73 22.83 7.98 22.96 8.24 23.07C8.5 23.18 8.77 23.26 9.05 23.32C9.32 23.37 9.61 23.4 9.89 23.4L20.09 23.39C20.38 23.39 20.66 23.36 20.94 23.3C21.21 23.25 21.48 23.17 21.75 23.06C22.01 22.95 22.26 22.81 22.49 22.66C22.73 22.5 22.95 22.32 23.15 22.12C23.35 21.91 23.52 21.7 23.68 21.46C23.84 21.22 23.97 20.98 24.08 20.71C24.19 20.45 24.27 20.18 24.33 19.9C24.38 19.62 24.41 19.34 24.41 19.06L24.41 10.91C24.41 10.62 24.38 10.34 24.33 10.06C24.27 9.78 24.19 9.51 24.08 9.25C23.97 8.98 23.84 8.74 23.68 8.5C23.52 8.26 23.35 8.04 23.15 7.84C22.95 7.64 22.73 7.46 22.49 7.3C22.26 7.15 22.01 7.01 21.75 6.9C21.48 6.79 21.21 6.71 20.94 6.66C20.66 6.6 20.38 6.57 20.09 6.57L9.89 6.59Z\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n fill-rule=\"nonzero\"\n ></path>\n <path\n id=\"rect\"\n d=\"M8.49 5.5L10.53 5.5L10.59 24.41L8.54 24.41L8.49 5.5Z\"\n fill=\"currentColor\"\n fill-opacity=\"1.000000\"\n fill-rule=\"evenodd\"\n ></path>\n </g>\n }\n </svg>\n </ax-icon>\n</ax-button>\n<div class=\"ax-flex ax-items-center ax-gap-1 ax-justify-between ax-w-full\">\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <axp-component-slot name=\"root-header-start\"></axp-component-slot>\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <axp-component-slot name=\"root-header-end\"></axp-component-slot>\n </div>\n</div>\n" }]
|
|
1834
|
+
}] });
|
|
1835
|
+
|
|
1836
|
+
class AXPRootLayoutMenuComponent {
|
|
1837
|
+
constructor() {
|
|
1838
|
+
this.menuStore = inject(AXPMenuService);
|
|
1839
|
+
this.router = inject(Router);
|
|
1840
|
+
this.badgeService = inject(AXPTaskBadgeService);
|
|
1841
|
+
this.settingsService = inject(AXPSettingsService);
|
|
1842
|
+
this.visibilityService = inject(AXPMenuVisibilityService);
|
|
1843
|
+
this.badgeVisible = signal(true, ...(ngDevMode ? [{ debugName: "badgeVisible" }] : /* istanbul ignore next */ []));
|
|
1844
|
+
// Debug: Track menu items changes
|
|
1845
|
+
// effect(() => {
|
|
1846
|
+
// const items = this.menuStore.items();
|
|
1847
|
+
// console.log('🎯 Sidebar menu items updated:', items.map(i => ({ name: i.name, priority: i.priority })));
|
|
1848
|
+
// });
|
|
1849
|
+
}
|
|
1850
|
+
async ngOnInit() {
|
|
1851
|
+
this.badgeVisible.set(await this.settingsService.scope(AXPPlatformScope.User).get(AXPThemeLayoutSetting.MenuBadgeVisible));
|
|
1852
|
+
//subscribe to changes
|
|
1853
|
+
this.settingsService.onChanged.subscribe((setting) => {
|
|
1854
|
+
if (setting.keys.includes(AXPThemeLayoutSetting.MenuBadgeVisible)) {
|
|
1855
|
+
this.badgeVisible.set(setting.values[AXPThemeLayoutSetting.MenuBadgeVisible]);
|
|
1856
|
+
}
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
onMenuItemClick(item, hasRouterLink) {
|
|
1860
|
+
if (hasRouterLink || item.children?.length) {
|
|
1861
|
+
return;
|
|
1862
|
+
}
|
|
1863
|
+
this.menuStore.executeCommand(item);
|
|
1864
|
+
}
|
|
1865
|
+
sort(items) {
|
|
1866
|
+
return sortBy(items, [(c) => c.priority ?? 0, (c) => c.text]);
|
|
1867
|
+
}
|
|
1868
|
+
getMenuBadge(item) {
|
|
1869
|
+
return AXPMenuBadgeHelper.getTotalCount(item, this.badgeService);
|
|
1870
|
+
}
|
|
1871
|
+
//#region ---- Menu Visibility Helpers ----
|
|
1872
|
+
/**
|
|
1873
|
+
* Checks if a menu item should be visible based on permissions and features.
|
|
1874
|
+
*/
|
|
1875
|
+
isItemVisible(item) {
|
|
1876
|
+
return this.visibilityService.isItemVisible(item);
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Determines if a menu item should be rendered.
|
|
1880
|
+
* A menu item should be rendered if:
|
|
1881
|
+
* 1. It has a routerLink, OR
|
|
1882
|
+
* 2. It has visible children, OR
|
|
1883
|
+
* 3. It has a command (for non-router navigation)
|
|
1884
|
+
*/
|
|
1885
|
+
shouldRenderMenuItem(item) {
|
|
1886
|
+
return this.visibilityService.shouldRenderMenuItem(item, (item) => this.getRouterLink(item));
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Checks if an item takes up visual space in the menu (group title or rendered menu item).
|
|
1890
|
+
*/
|
|
1891
|
+
isItemRendered(item) {
|
|
1892
|
+
if (item.type === 'break') {
|
|
1893
|
+
return false;
|
|
1894
|
+
}
|
|
1895
|
+
if (item.type === 'group') {
|
|
1896
|
+
return this.isItemVisible(item);
|
|
1897
|
+
}
|
|
1898
|
+
return this.shouldRenderMenuItem(item);
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* Determines if a divider should be shown. A divider is only shown when there is
|
|
1902
|
+
* visible content on both sides; if before or after is blank, the divider is hidden.
|
|
1903
|
+
*/
|
|
1904
|
+
shouldShowDivider(item, items, index) {
|
|
1905
|
+
if (item.type !== 'break' || !items || index < 0) {
|
|
1906
|
+
return false;
|
|
1907
|
+
}
|
|
1908
|
+
const hasVisibleBefore = items.slice(0, index).some((i) => this.isItemRendered(i));
|
|
1909
|
+
const hasVisibleAfter = items.slice(index + 1).some((i) => this.isItemRendered(i));
|
|
1910
|
+
return hasVisibleBefore && hasVisibleAfter;
|
|
1911
|
+
}
|
|
1912
|
+
//#endregion
|
|
1913
|
+
//#region ---- Menu Navigation Helpers ----
|
|
1914
|
+
/**
|
|
1915
|
+
* Builds a UrlTree that can be consumed by the routerLink directive when the menu item targets
|
|
1916
|
+
* an internal route. When the item does not represent an internal route, null is returned so the
|
|
1917
|
+
* command execution pipeline remains responsible for navigation.
|
|
1918
|
+
*/
|
|
1919
|
+
getRouterLink(item) {
|
|
1920
|
+
const navigation = this.extractRouterNavigation(item);
|
|
1921
|
+
if (!navigation) {
|
|
1922
|
+
return null;
|
|
1923
|
+
}
|
|
1924
|
+
if (!this.isRouterLinkCompatible(navigation)) {
|
|
1925
|
+
return null;
|
|
1926
|
+
}
|
|
1927
|
+
const normalizedPath = this.normalizeRouterPath(navigation.path);
|
|
1928
|
+
try {
|
|
1929
|
+
return this.router.parseUrl(normalizedPath);
|
|
1930
|
+
}
|
|
1931
|
+
catch (error) {
|
|
1932
|
+
console.warn('Failed to create router link for menu item.', { item, error });
|
|
1933
|
+
return null;
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Extracts internal navigation data regardless of whether it is provided via the legacy `path`
|
|
1938
|
+
* property, a direct navigate command, or the execution command wrapper.
|
|
1939
|
+
*/
|
|
1940
|
+
extractRouterNavigation(item) {
|
|
1941
|
+
if (item.path) {
|
|
1942
|
+
return { path: item.path };
|
|
1943
|
+
}
|
|
1944
|
+
const command = item.command;
|
|
1945
|
+
if (!command) {
|
|
1946
|
+
return null;
|
|
1947
|
+
}
|
|
1948
|
+
const navigateCommand = command;
|
|
1949
|
+
if (navigateCommand?.type === 'router' && typeof navigateCommand.options?.path === 'string') {
|
|
1950
|
+
return {
|
|
1951
|
+
path: navigateCommand.options.path,
|
|
1952
|
+
extras: navigateCommand.options.extras,
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1955
|
+
const executeCommand = command;
|
|
1956
|
+
if (executeCommand?.options && typeof executeCommand.options === 'object') {
|
|
1957
|
+
const commandOptions = executeCommand.options;
|
|
1958
|
+
if (commandOptions?.type === 'router') {
|
|
1959
|
+
const routerOptions = commandOptions.options ?? commandOptions;
|
|
1960
|
+
if (typeof routerOptions?.path === 'string') {
|
|
1961
|
+
return {
|
|
1962
|
+
path: routerOptions.path,
|
|
1963
|
+
extras: routerOptions.extras,
|
|
1964
|
+
};
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
if (typeof commandOptions?.path === 'string') {
|
|
1968
|
+
return { path: commandOptions.path };
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
return null;
|
|
1972
|
+
}
|
|
1973
|
+
/**
|
|
1974
|
+
* Determines whether routerLink can safely be used based on the target path and navigation
|
|
1975
|
+
* extras. If the navigation requires additional runtime behaviour (e.g., opening in a new tab),
|
|
1976
|
+
* we fallback to the imperative command pipeline.
|
|
1977
|
+
*/
|
|
1978
|
+
isRouterLinkCompatible(navigation) {
|
|
1979
|
+
if (!navigation.path) {
|
|
1980
|
+
return false;
|
|
1981
|
+
}
|
|
1982
|
+
if (this.isExternalNavigation(navigation.path)) {
|
|
1983
|
+
return false;
|
|
1984
|
+
}
|
|
1985
|
+
const extras = navigation.extras;
|
|
1986
|
+
if (!extras) {
|
|
1987
|
+
return true;
|
|
1988
|
+
}
|
|
1989
|
+
if (extras.target === 'blank') {
|
|
1990
|
+
return false;
|
|
1991
|
+
}
|
|
1992
|
+
const unsupportedKeys = ['skipLocationChange', 'replaceUrl', 'state'];
|
|
1993
|
+
return !unsupportedKeys.some((key) => extras[key] !== undefined);
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
1996
|
+
* Ensures router links include a leading slash while preserving any query parameters or
|
|
1997
|
+
* fragments present in the original path.
|
|
1998
|
+
*/
|
|
1999
|
+
normalizeRouterPath(path) {
|
|
2000
|
+
const trimmed = path.trim();
|
|
2001
|
+
if (!trimmed.length) {
|
|
2002
|
+
return trimmed;
|
|
2003
|
+
}
|
|
2004
|
+
if (trimmed.startsWith('/') || trimmed.startsWith('?') || trimmed.startsWith('#')) {
|
|
2005
|
+
return trimmed;
|
|
2006
|
+
}
|
|
2007
|
+
return `/${trimmed}`;
|
|
2008
|
+
}
|
|
2009
|
+
isExternalNavigation(path) {
|
|
2010
|
+
const lowerPath = path.trim().toLowerCase();
|
|
2011
|
+
return lowerPath.startsWith('http://') || lowerPath.startsWith('https://');
|
|
2012
|
+
}
|
|
2013
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2014
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPRootLayoutMenuComponent, isStandalone: true, selector: "axp-side-menu", ngImport: i0, template: "<ax-side-menu look=\"pills\">\n @let sortedItems = sort(menuStore.items());\n @for (item of sortedItems; track item; let i = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: item, items: sortedItems, index: i }\"> </ng-container>\n }\n</ax-side-menu>\n<ng-template #recursiveMenu let-item=\"item\" let-items=\"items\" let-index=\"index\">\n @if (item.type == 'group') {\n @if (isItemVisible(item)) {\n <ax-title>{{ item.text | translate | async }}</ax-title>\n }\n } @else if (item.type == 'break') {\n @if (shouldShowDivider(item, items, index)) {\n <ax-divider></ax-divider>\n }\n } @else {\n @if (shouldRenderMenuItem(item)) {\n @let routerLinkValue = getRouterLink(item);\n @if (routerLinkValue) {\n <ax-side-menu-item [attr.id]=\"'axp-menu-item-' + (item.name || item.text)\" (onClick)=\"onMenuItemClick(item, true)\"\n [routerLink]=\"routerLinkValue\" [active]=\"item === menuStore.selectedMenuItem().item\"\n [isCollapsed]=\"!menuStore.isItemOpen(item)\">\n <ax-prefix>\n <ax-icon [class]=\"item.icon\" class=\"fa-fw\"></ax-icon>\n </ax-prefix>\n <span>{{ item.text | translate | async }}</span>\n @if (item.children?.length) {\n <ng-container>\n @let sortedChildren = sort(item.children);\n @for (child of sortedChildren; track child; let childIndex = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: child, items: sortedChildren, index: childIndex }\">\n </ng-container>\n }\n </ng-container>\n }\n <ax-suffix>\n @if (badgeVisible()) {\n <ax-badge [axp-task-badge]=\"getMenuBadge(item)()\" color=\"secondary\"></ax-badge>\n }\n </ax-suffix>\n </ax-side-menu-item>\n } @else {\n <ax-side-menu-item [attr.id]=\"'axp-menu-item-' + (item.name || item.text)\" (onClick)=\"onMenuItemClick(item)\"\n [active]=\"item === menuStore.selectedMenuItem().item\" [isCollapsed]=\"!menuStore.isItemOpen(item)\">\n <ax-prefix>\n <ax-icon [class]=\"item.icon\" class=\"fa-fw\"></ax-icon>\n </ax-prefix>\n <span>{{ item.text | translate | async }}</span>\n @if (item.children?.length) {\n <ng-container>\n @let sortedChildren = sort(item.children);\n @for (child of sortedChildren; track child; let childIndex = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: child, items: sortedChildren, index: childIndex }\">\n </ng-container>\n }\n </ng-container>\n }\n <ax-suffix>\n @if (badgeVisible()) {\n <ax-badge [axp-task-badge]=\"getMenuBadge(item)()\" color=\"secondary\"></ax-badge>\n }\n </ax-suffix>\n </ax-side-menu-item>\n }\n }\n }\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: AXSideMenuModule }, { kind: "component", type: i2$3.AXSideMenuComponent, selector: "ax-side-menu", inputs: ["items", "look", "location"], outputs: ["itemsChange"] }, { kind: "component", type: i2$3.AXSideMenuItemComponent, selector: "ax-side-menu-item", inputs: ["disabled", "text", "active", "isLoading", "isCollapsed", "toggleOnClick", "href", "routerLink", "routerLinkActive", "routerLinkActiveOptions", "target"], outputs: ["textChange", "activeChange", "isLoadingChange", "isCollapsedChange", "onClick"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: AXPTaskBadgeDirective, selector: "[axp-task-badge]", inputs: ["badgeKey", "axp-task-badge"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2$1.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: AXBadgeModule }, { kind: "component", type: i4.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2015
|
+
}
|
|
2016
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutMenuComponent, decorators: [{
|
|
2017
|
+
type: Component,
|
|
2018
|
+
args: [{ selector: 'axp-side-menu', encapsulation: ViewEncapsulation.None, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
2019
|
+
CommonModule,
|
|
2020
|
+
AXSideMenuModule,
|
|
2021
|
+
AXTranslationModule,
|
|
2022
|
+
AXPTaskBadgeDirective,
|
|
2023
|
+
AXDecoratorModule,
|
|
2024
|
+
AXBadgeModule,
|
|
2025
|
+
], template: "<ax-side-menu look=\"pills\">\n @let sortedItems = sort(menuStore.items());\n @for (item of sortedItems; track item; let i = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: item, items: sortedItems, index: i }\"> </ng-container>\n }\n</ax-side-menu>\n<ng-template #recursiveMenu let-item=\"item\" let-items=\"items\" let-index=\"index\">\n @if (item.type == 'group') {\n @if (isItemVisible(item)) {\n <ax-title>{{ item.text | translate | async }}</ax-title>\n }\n } @else if (item.type == 'break') {\n @if (shouldShowDivider(item, items, index)) {\n <ax-divider></ax-divider>\n }\n } @else {\n @if (shouldRenderMenuItem(item)) {\n @let routerLinkValue = getRouterLink(item);\n @if (routerLinkValue) {\n <ax-side-menu-item [attr.id]=\"'axp-menu-item-' + (item.name || item.text)\" (onClick)=\"onMenuItemClick(item, true)\"\n [routerLink]=\"routerLinkValue\" [active]=\"item === menuStore.selectedMenuItem().item\"\n [isCollapsed]=\"!menuStore.isItemOpen(item)\">\n <ax-prefix>\n <ax-icon [class]=\"item.icon\" class=\"fa-fw\"></ax-icon>\n </ax-prefix>\n <span>{{ item.text | translate | async }}</span>\n @if (item.children?.length) {\n <ng-container>\n @let sortedChildren = sort(item.children);\n @for (child of sortedChildren; track child; let childIndex = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: child, items: sortedChildren, index: childIndex }\">\n </ng-container>\n }\n </ng-container>\n }\n <ax-suffix>\n @if (badgeVisible()) {\n <ax-badge [axp-task-badge]=\"getMenuBadge(item)()\" color=\"secondary\"></ax-badge>\n }\n </ax-suffix>\n </ax-side-menu-item>\n } @else {\n <ax-side-menu-item [attr.id]=\"'axp-menu-item-' + (item.name || item.text)\" (onClick)=\"onMenuItemClick(item)\"\n [active]=\"item === menuStore.selectedMenuItem().item\" [isCollapsed]=\"!menuStore.isItemOpen(item)\">\n <ax-prefix>\n <ax-icon [class]=\"item.icon\" class=\"fa-fw\"></ax-icon>\n </ax-prefix>\n <span>{{ item.text | translate | async }}</span>\n @if (item.children?.length) {\n <ng-container>\n @let sortedChildren = sort(item.children);\n @for (child of sortedChildren; track child; let childIndex = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: child, items: sortedChildren, index: childIndex }\">\n </ng-container>\n }\n </ng-container>\n }\n <ax-suffix>\n @if (badgeVisible()) {\n <ax-badge [axp-task-badge]=\"getMenuBadge(item)()\" color=\"secondary\"></ax-badge>\n }\n </ax-suffix>\n </ax-side-menu-item>\n }\n }\n }\n</ng-template>" }]
|
|
2026
|
+
}], ctorParameters: () => [] });
|
|
2027
|
+
|
|
2028
|
+
class AXPHorizontalMenuComponent {
|
|
2029
|
+
constructor() {
|
|
2030
|
+
this.platformConfig = inject(AXP_PLATFORM_CONFIG_TOKEN);
|
|
2031
|
+
this.menuStore = inject(AXPMenuService);
|
|
2032
|
+
this.router = inject(Router);
|
|
2033
|
+
this.layoutService = inject(AXPLayoutThemeService);
|
|
2034
|
+
this.badgeService = inject(AXPTaskBadgeService);
|
|
2035
|
+
this.settingsService = inject(AXPSettingsService);
|
|
2036
|
+
this.visibilityService = inject(AXPMenuVisibilityService);
|
|
2037
|
+
this.badgeVisible = signal(true, ...(ngDevMode ? [{ debugName: "badgeVisible" }] : /* istanbul ignore next */ []));
|
|
2038
|
+
}
|
|
2039
|
+
async ngOnInit() {
|
|
2040
|
+
this.badgeVisible.set(await this.settingsService.scope(AXPPlatformScope.User).get(AXPThemeLayoutSetting.MenuBadgeVisible));
|
|
2041
|
+
//subscribe to changes
|
|
2042
|
+
this.settingsService.onChanged.subscribe(setting => {
|
|
2043
|
+
if (setting.keys.includes(AXPThemeLayoutSetting.MenuBadgeVisible)) {
|
|
2044
|
+
this.badgeVisible.set(setting.values[AXPThemeLayoutSetting.MenuBadgeVisible]);
|
|
2045
|
+
}
|
|
2046
|
+
});
|
|
2047
|
+
}
|
|
2048
|
+
onMenuItemClick(item) {
|
|
2049
|
+
if (!item.children?.length) {
|
|
2050
|
+
this.menuStore.executeCommand(item);
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
sort(items) {
|
|
2054
|
+
return sortBy$1(items, [c => c.priority ?? 0, c => c.text]);
|
|
2055
|
+
}
|
|
2056
|
+
getMenuBadge(item) {
|
|
2057
|
+
return AXPMenuBadgeHelper.getTotalCount(item, this.badgeService);
|
|
2058
|
+
}
|
|
2059
|
+
//#region ---- Menu Visibility Helpers ----
|
|
2060
|
+
/**
|
|
2061
|
+
* Checks if a menu item should be visible based on permissions and features.
|
|
2062
|
+
*/
|
|
2063
|
+
isItemVisible(item) {
|
|
2064
|
+
return this.visibilityService.isItemVisible(item);
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* Determines if a menu item should be rendered.
|
|
2068
|
+
* A menu item should be rendered if:
|
|
2069
|
+
* 1. It has a routerLink, OR
|
|
2070
|
+
* 2. It has visible children, OR
|
|
2071
|
+
* 3. It has a command (for non-router navigation)
|
|
2072
|
+
*/
|
|
2073
|
+
shouldRenderMenuItem(item) {
|
|
2074
|
+
return this.visibilityService.shouldRenderMenuItem(item, (item) => this.getRouterLink(item));
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Checks if an item takes up visual space in the menu (group title or rendered menu item).
|
|
2078
|
+
*/
|
|
2079
|
+
isItemRendered(item) {
|
|
2080
|
+
if (item.type === 'break') {
|
|
2081
|
+
return false;
|
|
2082
|
+
}
|
|
2083
|
+
if (item.type === 'group') {
|
|
2084
|
+
return this.isItemVisible(item);
|
|
2085
|
+
}
|
|
2086
|
+
return this.shouldRenderMenuItem(item);
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Determines if a divider should be shown. A divider is only shown when there is
|
|
2090
|
+
* visible content on both sides; if before or after is blank, the divider is hidden.
|
|
2091
|
+
*/
|
|
2092
|
+
shouldShowDivider(item, items, index) {
|
|
2093
|
+
if (item.type !== 'break' || !items || index < 0) {
|
|
2094
|
+
return false;
|
|
2095
|
+
}
|
|
2096
|
+
const hasVisibleBefore = items.slice(0, index).some((i) => this.isItemRendered(i));
|
|
2097
|
+
const hasVisibleAfter = items.slice(index + 1).some((i) => this.isItemRendered(i));
|
|
2098
|
+
return hasVisibleBefore && hasVisibleAfter;
|
|
2099
|
+
}
|
|
2100
|
+
//#endregion
|
|
2101
|
+
//#region ---- Menu Navigation Helpers ----
|
|
2102
|
+
/**
|
|
2103
|
+
* Builds a UrlTree that can be consumed by the routerLink directive when the menu item targets
|
|
2104
|
+
* an internal route. When the item does not represent an internal route, null is returned so the
|
|
2105
|
+
* command execution pipeline remains responsible for navigation.
|
|
2106
|
+
*/
|
|
2107
|
+
getRouterLink(item) {
|
|
2108
|
+
const navigation = this.extractRouterNavigation(item);
|
|
2109
|
+
if (!navigation) {
|
|
2110
|
+
return null;
|
|
2111
|
+
}
|
|
2112
|
+
if (!this.isRouterLinkCompatible(navigation)) {
|
|
2113
|
+
return null;
|
|
2114
|
+
}
|
|
2115
|
+
const normalizedPath = this.normalizeRouterPath(navigation.path);
|
|
2116
|
+
try {
|
|
2117
|
+
return this.router.parseUrl(normalizedPath);
|
|
2118
|
+
}
|
|
2119
|
+
catch (error) {
|
|
2120
|
+
console.warn('Failed to create router link for menu item.', { item, error });
|
|
2121
|
+
return null;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
/**
|
|
2125
|
+
* Extracts internal navigation data regardless of whether it is provided via the legacy `path`
|
|
2126
|
+
* property, a direct navigate command, or the execution command wrapper.
|
|
2127
|
+
*/
|
|
2128
|
+
extractRouterNavigation(item) {
|
|
2129
|
+
if (item.path) {
|
|
2130
|
+
return { path: item.path };
|
|
2131
|
+
}
|
|
2132
|
+
const command = item.command;
|
|
2133
|
+
if (!command) {
|
|
2134
|
+
return null;
|
|
2135
|
+
}
|
|
2136
|
+
const navigateCommand = command;
|
|
2137
|
+
if (navigateCommand?.type === 'router' && typeof navigateCommand.options?.path === 'string') {
|
|
2138
|
+
return {
|
|
2139
|
+
path: navigateCommand.options.path,
|
|
2140
|
+
extras: navigateCommand.options.extras,
|
|
2141
|
+
};
|
|
2142
|
+
}
|
|
2143
|
+
const executeCommand = command;
|
|
2144
|
+
if (executeCommand?.options && typeof executeCommand.options === 'object') {
|
|
2145
|
+
const commandOptions = executeCommand.options;
|
|
2146
|
+
if (commandOptions?.type === 'router') {
|
|
2147
|
+
const routerOptions = commandOptions.options ?? commandOptions;
|
|
2148
|
+
if (typeof routerOptions?.path === 'string') {
|
|
2149
|
+
return {
|
|
2150
|
+
path: routerOptions.path,
|
|
2151
|
+
extras: routerOptions.extras,
|
|
2152
|
+
};
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
if (typeof commandOptions?.path === 'string') {
|
|
2156
|
+
return { path: commandOptions.path };
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
return null;
|
|
2160
|
+
}
|
|
2161
|
+
/**
|
|
2162
|
+
* Determines whether routerLink can safely be used based on the target path and navigation
|
|
2163
|
+
* extras. If the navigation requires additional runtime behaviour (e.g., opening in a new tab),
|
|
2164
|
+
* we fallback to the imperative command pipeline.
|
|
2165
|
+
*/
|
|
2166
|
+
isRouterLinkCompatible(navigation) {
|
|
2167
|
+
if (!navigation.path) {
|
|
2168
|
+
return false;
|
|
2169
|
+
}
|
|
2170
|
+
if (this.isExternalNavigation(navigation.path)) {
|
|
2171
|
+
return false;
|
|
2172
|
+
}
|
|
2173
|
+
const extras = navigation.extras;
|
|
2174
|
+
if (!extras) {
|
|
2175
|
+
return true;
|
|
2176
|
+
}
|
|
2177
|
+
if (extras.target === 'blank') {
|
|
2178
|
+
return false;
|
|
2179
|
+
}
|
|
2180
|
+
const unsupportedKeys = ['skipLocationChange', 'replaceUrl', 'state'];
|
|
2181
|
+
return !unsupportedKeys.some((key) => extras[key] !== undefined);
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Ensures router links include a leading slash while preserving any query parameters or
|
|
2185
|
+
* fragments present in the original path.
|
|
2186
|
+
*/
|
|
2187
|
+
normalizeRouterPath(path) {
|
|
2188
|
+
const trimmed = path.trim();
|
|
2189
|
+
if (!trimmed.length) {
|
|
2190
|
+
return trimmed;
|
|
2191
|
+
}
|
|
2192
|
+
if (trimmed.startsWith('/') || trimmed.startsWith('?') || trimmed.startsWith('#')) {
|
|
2193
|
+
return trimmed;
|
|
2194
|
+
}
|
|
2195
|
+
return `/${trimmed}`;
|
|
2196
|
+
}
|
|
2197
|
+
isExternalNavigation(path) {
|
|
2198
|
+
const lowerPath = path.trim().toLowerCase();
|
|
2199
|
+
return lowerPath.startsWith('http://') || lowerPath.startsWith('https://');
|
|
2200
|
+
}
|
|
2201
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPHorizontalMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2202
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPHorizontalMenuComponent, isStandalone: true, selector: "axp-horizontal-menu", host: { classAttribute: "ax-light" }, ngImport: i0, template: "<div\n class=\"ax-w-full ax-flex ax-items-center ax-justify-between ax-gap-1 ax-bg-primary-surface ax-text-primary-on-surface ax-h-14 ax-px-4\"\n>\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <axp-logo\n [source]=\"platformConfig.logo?.full?.dark\"\n [attr.alt]=\"platformConfig.title\"\n class=\"ax-mx-auto ax-text-2xl\"\n ></axp-logo>\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <axp-component-slot name=\"root-header-start\"></axp-component-slot>\n <axp-component-slot name=\"root-header-end\"></axp-component-slot>\n </div>\n</div>\n\n<div class=\"__menu-bar\">\n <ax-menu [orientation]=\"'horizontal'\" [class.ax-dark]=\"layoutService.isDarkMode()\" [hasArrow]=\"true\">\n @let sortedItems = sort(menuStore.items());\n @for (item of sortedItems; track item; let i = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: item, items: sortedItems, index: i }\"> </ng-container>\n }\n <!-- Item Templates -->\n <ng-template #recursiveMenu let-item=\"item\" let-items=\"items\" let-index=\"index\">\n @if (item.type == 'group') {\n @if (isItemVisible(item)) {\n <ax-title>{{ item.text | translate | async }}</ax-title>\n }\n } @else if (item.type == 'break') {\n @if (shouldShowDivider(item, items, index)) {\n <ax-divider></ax-divider>\n }\n } @else {\n @if (shouldRenderMenuItem(item)) {\n <ax-menu-item (onClick)=\"onMenuItemClick(item)\">\n @if (!item.meta?.isRoot) {\n <ax-prefix>\n <ax-icon [class]=\"item.icon\" class=\"fa-fw\"></ax-icon>\n </ax-prefix>\n }\n <ax-text> {{ item.text | translate | async }}</ax-text>\n @if (item.children?.length) {\n <ng-container>\n @let sortedChildren = sort(item.children);\n @for (child of sortedChildren; track child; let childIndex = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: child, items: sortedChildren, index: childIndex }\">\n </ng-container>\n }\n </ng-container>\n }\n <ax-suffix>\n @if (badgeVisible()) {\n <ax-badge [axp-task-badge]=\"getMenuBadge(item)()\" color=\"secondary\"></ax-badge>\n }\n </ax-suffix>\n </ax-menu-item>\n }\n }\n </ng-template>\n </ax-menu>\n</div>\n<!-- <div class=\"__tab-bar\">\n<div class=\"axp-tabs-item axp-state-active\">\n <span class=\"ax-font-medium\">Account</span>\n <i class=\"fa-light fa-times ax-text-sm\"></i>\n</div>\n<div class=\"axp-tabs-item\">\n <span class=\"ax-font-medium\">Projects</span>\n\n</div>\n</div> -->\n", styles: [".__tab-bar{display:flex;height:3rem;width:100%;align-items:flex-end;gap:.5rem;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-darker-surface),var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-primary-darker-surface),var(--tw-text-opacity, 1))}.__tab-bar .axp-tabs-item{display:flex;height:2.5rem;cursor:pointer;align-items:center;justify-content:space-between;gap:.5rem;border-top-left-radius:.5rem;border-top-right-radius:.5rem;padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;line-height:1}.__tab-bar .axp-tabs-item:hover,.__tab-bar .axp-tabs-item.axp-state-active{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-lightest-surface),var(--tw-text-opacity, 1))}.__menu-bar{display:flex;width:100%;align-items:flex-end;gap:.5rem;overflow-x:auto;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-dark-surface),var(--tw-bg-opacity, 1));padding:.375rem 1rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-primary-dark-surface),var(--tw-text-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: AXPComponentSlotModule }, { kind: "directive", type: i1$3.AXPComponentSlotDirective, selector: "axp-component-slot", inputs: ["name", "host", "context"], exportAs: ["slot"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXPLogoComponent, selector: "axp-logo", inputs: ["source"] }, { kind: "ngmodule", type: AXMenuModule }, { kind: "component", type: i4$1.AXMenuItemComponent, selector: "ax-menu-item", inputs: ["name", "data", "disabled", "color"], outputs: ["onClick"] }, { kind: "component", type: i4$1.AXMenuComponent, selector: "ax-menu", inputs: ["orientation", "openOn", "closeOn", "items", "hasArrow"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: AXPTaskBadgeDirective, selector: "[axp-task-badge]", inputs: ["badgeKey", "axp-task-badge"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2203
|
+
}
|
|
2204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPHorizontalMenuComponent, decorators: [{
|
|
2205
|
+
type: Component,
|
|
2206
|
+
args: [{ selector: 'axp-horizontal-menu', host: { class: 'ax-light' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
2207
|
+
CommonModule,
|
|
2208
|
+
AXPComponentSlotModule,
|
|
2209
|
+
AXDecoratorModule,
|
|
2210
|
+
AXPLogoComponent,
|
|
2211
|
+
AXMenuModule,
|
|
2212
|
+
AXTranslationModule,
|
|
2213
|
+
AXPTaskBadgeDirective,
|
|
2214
|
+
AXBadgeModule,
|
|
2215
|
+
], template: "<div\n class=\"ax-w-full ax-flex ax-items-center ax-justify-between ax-gap-1 ax-bg-primary-surface ax-text-primary-on-surface ax-h-14 ax-px-4\"\n>\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <axp-logo\n [source]=\"platformConfig.logo?.full?.dark\"\n [attr.alt]=\"platformConfig.title\"\n class=\"ax-mx-auto ax-text-2xl\"\n ></axp-logo>\n </div>\n <div class=\"ax-flex ax-items-center ax-gap-1\">\n <axp-component-slot name=\"root-header-start\"></axp-component-slot>\n <axp-component-slot name=\"root-header-end\"></axp-component-slot>\n </div>\n</div>\n\n<div class=\"__menu-bar\">\n <ax-menu [orientation]=\"'horizontal'\" [class.ax-dark]=\"layoutService.isDarkMode()\" [hasArrow]=\"true\">\n @let sortedItems = sort(menuStore.items());\n @for (item of sortedItems; track item; let i = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: item, items: sortedItems, index: i }\"> </ng-container>\n }\n <!-- Item Templates -->\n <ng-template #recursiveMenu let-item=\"item\" let-items=\"items\" let-index=\"index\">\n @if (item.type == 'group') {\n @if (isItemVisible(item)) {\n <ax-title>{{ item.text | translate | async }}</ax-title>\n }\n } @else if (item.type == 'break') {\n @if (shouldShowDivider(item, items, index)) {\n <ax-divider></ax-divider>\n }\n } @else {\n @if (shouldRenderMenuItem(item)) {\n <ax-menu-item (onClick)=\"onMenuItemClick(item)\">\n @if (!item.meta?.isRoot) {\n <ax-prefix>\n <ax-icon [class]=\"item.icon\" class=\"fa-fw\"></ax-icon>\n </ax-prefix>\n }\n <ax-text> {{ item.text | translate | async }}</ax-text>\n @if (item.children?.length) {\n <ng-container>\n @let sortedChildren = sort(item.children);\n @for (child of sortedChildren; track child; let childIndex = $index) {\n <ng-container [ngTemplateOutlet]=\"recursiveMenu\" [ngTemplateOutletContext]=\"{ item: child, items: sortedChildren, index: childIndex }\">\n </ng-container>\n }\n </ng-container>\n }\n <ax-suffix>\n @if (badgeVisible()) {\n <ax-badge [axp-task-badge]=\"getMenuBadge(item)()\" color=\"secondary\"></ax-badge>\n }\n </ax-suffix>\n </ax-menu-item>\n }\n }\n </ng-template>\n </ax-menu>\n</div>\n<!-- <div class=\"__tab-bar\">\n<div class=\"axp-tabs-item axp-state-active\">\n <span class=\"ax-font-medium\">Account</span>\n <i class=\"fa-light fa-times ax-text-sm\"></i>\n</div>\n<div class=\"axp-tabs-item\">\n <span class=\"ax-font-medium\">Projects</span>\n\n</div>\n</div> -->\n", styles: [".__tab-bar{display:flex;height:3rem;width:100%;align-items:flex-end;gap:.5rem;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-darker-surface),var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-primary-darker-surface),var(--tw-text-opacity, 1))}.__tab-bar .axp-tabs-item{display:flex;height:2.5rem;cursor:pointer;align-items:center;justify-content:space-between;gap:.5rem;border-top-left-radius:.5rem;border-top-right-radius:.5rem;padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;line-height:1}.__tab-bar .axp-tabs-item:hover,.__tab-bar .axp-tabs-item.axp-state-active{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lightest-surface),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-lightest-surface),var(--tw-text-opacity, 1))}.__menu-bar{display:flex;width:100%;align-items:flex-end;gap:.5rem;overflow-x:auto;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-dark-surface),var(--tw-bg-opacity, 1));padding:.375rem 1rem;--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-primary-dark-surface),var(--tw-text-opacity, 1))}\n"] }]
|
|
2216
|
+
}] });
|
|
2217
|
+
|
|
2218
|
+
class AXPRootHorizontalLayoutComponent {
|
|
2219
|
+
constructor() {
|
|
2220
|
+
this.config = inject(AXP_PLATFORM_CONFIG_TOKEN);
|
|
2221
|
+
this.logo = this.config.logo;
|
|
2222
|
+
this.store = inject(AXPLayoutThemeService);
|
|
2223
|
+
}
|
|
2224
|
+
handleCollapsedChange(value) {
|
|
2225
|
+
if (value) {
|
|
2226
|
+
this.store.closeSideMenu();
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
handleResizingEnded(e) {
|
|
2230
|
+
if (e.isUserInteraction) {
|
|
2231
|
+
this.store.setSideMenuWidth(e.value);
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootHorizontalLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2235
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPRootHorizontalLayoutComponent, isStandalone: true, selector: "axp-root-horizontal-layout", viewQueries: [{ propertyName: "drawer", first: true, predicate: ["drawer"], descendants: true }], ngImport: i0, template: "<div class=\"axp-root-layout\">\n <ax-drawer-container>\n <ax-content class=\"ax-flex ax-flex-col ax-relative ax-bg-lightest dark:ax-bg-lighter\">\n @if(store.isNavigationLoading()) {\n <div class=\"axp-navigating-progress\">\n <div></div>\n </div>\n }\n <axp-horizontal-menu></axp-horizontal-menu>\n <div class=\"ax-flex-1 ax-overflow-auto ax-relative\">\n <router-outlet></router-outlet>\n </div>\n </ax-content>\n </ax-drawer-container>\n <axp-dashboard-admin-footer></axp-dashboard-admin-footer>\n</div>", styles: [".axp-root-layout{display:flex;height:100%;width:100%;flex-direction:column;justify-content:space-between}.axp-navigating-progress{position:absolute;top:0;height:.25rem;width:100%;overflow:hidden;background-color:rgba(var(--ax-sys-color-primary-200),.4)}.axp-navigating-progress>div{height:100%;width:100%;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));animation:indeterminateAnimation 1.5s infinite cubic-bezier(.65,.815,.735,.395);transform-origin:0% 50%}@keyframes indeterminateAnimation{0%{transform:translate(-100%) scaleX(.2)}50%{transform:translate(50%) scaleX(.6)}to{transform:translate(100%) scaleX(.4)}}axp-dashboard-admin-header{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-primary-surface),var(--tw-text-opacity, 1))}axp-dashboard-admin-header ax-button{--ax-comp-button-normal-bg-color: 0, 0, 0, 0 !important;--ax-comp-button-border-width: 0 !important;--ax-comp-button-normal-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-hover-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-focus-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-pressed-text-color: var(--axp-on-brand-color) !important}.resize-handle{background-color:transparent!important}.resize-handle:hover{background-color:rgba(var(--ax-sys-color-primary-surface))!important}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$4.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "ngmodule", type: AXImageModule }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXTabsModule }, { kind: "ngmodule", type: AXDrawerModule }, { kind: "component", type: i3$2.AXDrawerContainerComponent, selector: "ax-drawer-container" }, { kind: "ngmodule", type: AXSideMenuModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXPAuthModule }, { kind: "component", type: AXPRootLayoutFooterComponent, selector: "axp-dashboard-admin-footer" }, { kind: "component", type: AXPHorizontalMenuComponent, selector: "axp-horizontal-menu" }, { kind: "ngmodule", type: AXPComponentSlotModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2236
|
+
}
|
|
2237
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootHorizontalLayoutComponent, decorators: [{
|
|
2238
|
+
type: Component,
|
|
2239
|
+
args: [{ selector: 'axp-root-horizontal-layout', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2240
|
+
RouterModule,
|
|
2241
|
+
AXButtonModule,
|
|
2242
|
+
AXTranslationModule,
|
|
2243
|
+
AXDecoratorModule,
|
|
2244
|
+
AXDropdownModule,
|
|
2245
|
+
AXAvatarModule,
|
|
2246
|
+
AXImageModule,
|
|
2247
|
+
AXImageModule,
|
|
2248
|
+
AXPopoverModule,
|
|
2249
|
+
AXBadgeModule,
|
|
2250
|
+
AXTabsModule,
|
|
2251
|
+
AXDrawerModule,
|
|
2252
|
+
AXSideMenuModule,
|
|
2253
|
+
AXLoadingModule,
|
|
2254
|
+
AXPAuthModule,
|
|
2255
|
+
AXPRootLayoutFooterComponent,
|
|
2256
|
+
AXPHorizontalMenuComponent,
|
|
2257
|
+
AXPComponentSlotModule
|
|
2258
|
+
], template: "<div class=\"axp-root-layout\">\n <ax-drawer-container>\n <ax-content class=\"ax-flex ax-flex-col ax-relative ax-bg-lightest dark:ax-bg-lighter\">\n @if(store.isNavigationLoading()) {\n <div class=\"axp-navigating-progress\">\n <div></div>\n </div>\n }\n <axp-horizontal-menu></axp-horizontal-menu>\n <div class=\"ax-flex-1 ax-overflow-auto ax-relative\">\n <router-outlet></router-outlet>\n </div>\n </ax-content>\n </ax-drawer-container>\n <axp-dashboard-admin-footer></axp-dashboard-admin-footer>\n</div>", styles: [".axp-root-layout{display:flex;height:100%;width:100%;flex-direction:column;justify-content:space-between}.axp-navigating-progress{position:absolute;top:0;height:.25rem;width:100%;overflow:hidden;background-color:rgba(var(--ax-sys-color-primary-200),.4)}.axp-navigating-progress>div{height:100%;width:100%;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));animation:indeterminateAnimation 1.5s infinite cubic-bezier(.65,.815,.735,.395);transform-origin:0% 50%}@keyframes indeterminateAnimation{0%{transform:translate(-100%) scaleX(.2)}50%{transform:translate(50%) scaleX(.6)}to{transform:translate(100%) scaleX(.4)}}axp-dashboard-admin-header{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-primary-surface),var(--tw-text-opacity, 1))}axp-dashboard-admin-header ax-button{--ax-comp-button-normal-bg-color: 0, 0, 0, 0 !important;--ax-comp-button-border-width: 0 !important;--ax-comp-button-normal-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-hover-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-focus-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-pressed-text-color: var(--axp-on-brand-color) !important}.resize-handle{background-color:transparent!important}.resize-handle:hover{background-color:rgba(var(--ax-sys-color-primary-surface))!important}\n"] }]
|
|
2259
|
+
}], propDecorators: { drawer: [{
|
|
2260
|
+
type: ViewChild,
|
|
2261
|
+
args: ['drawer']
|
|
2262
|
+
}] } });
|
|
2263
|
+
|
|
2264
|
+
class AXPRootVerticalLayoutComponent {
|
|
2265
|
+
constructor() {
|
|
2266
|
+
this.config = inject(AXP_PLATFORM_CONFIG_TOKEN);
|
|
2267
|
+
this.logo = this.config.logo;
|
|
2268
|
+
this.store = inject(AXPLayoutThemeService);
|
|
2269
|
+
this.deviceService = inject(AXPDeviceService);
|
|
2270
|
+
this.router = inject(Router);
|
|
2271
|
+
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
|
|
2272
|
+
if (this.deviceService.isSmall() || this.deviceService.isMedium()) {
|
|
2273
|
+
this.store.closeSideMenu();
|
|
2274
|
+
}
|
|
2275
|
+
});
|
|
2276
|
+
}
|
|
2277
|
+
handleResizingEnded(e) {
|
|
2278
|
+
//console.log('handleResizingEnded', e.value);
|
|
2279
|
+
if (e.isUserInteraction) {
|
|
2280
|
+
this.store.setSideMenuWidth(e.value);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootVerticalLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2284
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPRootVerticalLayoutComponent, isStandalone: true, selector: "axp-root-vertical-layout", viewQueries: [{ propertyName: "drawer", first: true, predicate: ["drawer"], descendants: true }], ngImport: i0, template: "<div id=\"axp-root-layout\" class=\"axp-root-layout\">\n <ax-drawer-container>\n <ax-drawer id=\"axp-side-menu-drawer\" [axResizable]=\"deviceService.isLarge()\" #drawer\n class=\"ax-w-[75%] lg:ax-w-72 ax-border-lighter ax-bg-lighter dark:ax-border-darkest dark:ax-bg-darkest ax-h-full !ax-flex ax-flex-col\"\n [width]=\"(deviceService.isLarge() ? store.sideMenuWidth() : null)!\" location=\"start\"\n [collapsed]=\"!store.isSideMenuOpen()\" [closeOnBackdropClick]=\"false\" [defaultWidth]=\"288\"\n [mode]=\"deviceService.isSmall() || deviceService.isMedium() ? 'overlay' : 'push'\" [dblClickAction]=\"'fit'\"\n (onResizingEnded)=\"handleResizingEnded($event)\" (onResizingDblClick)=\"handleResizingEnded($event)\"\n (onBackdropClick)=\"store.closeSideMenu()\" backdropClass=\"ax-bg-black/50\">\n <ax-header id=\"axp-side-menu-header\"\n class=\"ax-light ax-h-14 ax-flex ax-items-center ax-justify-center ax-bg-primary-500 ax-text-primary-on-surface ax-border-e ax-border-primary-600\">\n <axp-logo [source]=\"logo?.full?.dark\"></axp-logo>\n </ax-header>\n <ax-content class=\"ax-flex ax-flex-col ax-border-e ax-h-full ax-overflow-auto\">\n <axp-component-slot name=\"root-side-menu-header\"></axp-component-slot>\n <div class=\"ax-overflow-auto ax-flex-1\">\n <axp-side-menu id=\"axp-side-menu\" class=\"ax-p-4 ax-block\"></axp-side-menu>\n </div>\n <axp-component-slot name=\"root-side-menu-footer\"></axp-component-slot>\n </ax-content>\n </ax-drawer>\n <ax-content class=\"ax-flex ax-flex-col ax-relative ax-bg-lightest dark:ax-bg-lighter ax-overflow-auto\">\n @if (store.isNavigationLoading()) {\n <div class=\"axp-navigating-progress\">\n <div></div>\n </div>\n }\n <axp-dashboard-admin-header id=\"axp-main-header\" class=\"ax-light\"></axp-dashboard-admin-header>\n\n <div class=\"ax-flex-1 ax-overflow-auto ax-relative\">\n <router-outlet></router-outlet>\n </div>\n </ax-content>\n </ax-drawer-container>\n <axp-dashboard-admin-footer id=\"axp-main-footer\"></axp-dashboard-admin-footer>\n</div>", styles: [".axp-root-layout{display:flex;height:100%;width:100%;flex-direction:column;justify-content:space-between}.axp-navigating-progress{position:absolute;top:0;height:.25rem;width:100%;overflow:hidden;background-color:rgba(var(--ax-sys-color-primary-200),.4)}.axp-navigating-progress>div{height:100%;width:100%;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));animation:indeterminateAnimation 1.5s infinite cubic-bezier(.65,.815,.735,.395);transform-origin:0% 50%}@keyframes indeterminateAnimation{0%{transform:translate(-100%) scaleX(.2)}50%{transform:translate(50%) scaleX(.6)}to{transform:translate(100%) scaleX(.4)}}axp-dashboard-admin-header{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-primary-surface),var(--tw-text-opacity, 1))}axp-dashboard-admin-header ax-button{--ax-comp-button-normal-bg-color: 0, 0, 0, 0 !important;--ax-comp-button-border-width: 0 !important;--ax-comp-button-normal-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-hover-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-focus-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-pressed-text-color: var(--axp-on-brand-color) !important}.resize-handle{background-color:transparent!important}.resize-handle:hover{background-color:rgba(var(--ax-sys-color-primary-surface))!important}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$4.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "ngmodule", type: AXImageModule }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXTabsModule }, { kind: "ngmodule", type: AXDrawerModule }, { kind: "component", type: i3$2.AXDrawerComponent, selector: "ax-drawer", inputs: ["location", "showBackdrop", "mode", "transition", "closeOnBackdropClick", "backdropClass", "collapsed", "singleOpenMode"], outputs: ["onBackdropClick", "collapsedStateChanged"] }, { kind: "component", type: i3$2.AXDrawerContainerComponent, selector: "ax-drawer-container" }, { kind: "ngmodule", type: AXSideMenuModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: AXPLogoComponent, selector: "axp-logo", inputs: ["source"] }, { kind: "ngmodule", type: AXPAuthModule }, { kind: "directive", type: AXResizableDirective, selector: "[axResizable]", inputs: ["axResizable", "minWidth", "maxWidth", "dblClickAction", "width", "defaultWidth"], outputs: ["axResizableChange", "minWidthChange", "maxWidthChange", "dblClickActionChange", "widthChange", "defaultWidthChange", "onResizingStarted", "onResizingEnded", "onResizingDblClick"] }, { kind: "component", type: AXPRootLayoutFooterComponent, selector: "axp-dashboard-admin-footer" }, { kind: "component", type: AXPRootLayoutHeaderComponent, selector: "axp-dashboard-admin-header" }, { kind: "component", type: AXPRootLayoutMenuComponent, selector: "axp-side-menu" }, { kind: "ngmodule", type: AXPComponentSlotModule }, { kind: "directive", type: i1$3.AXPComponentSlotDirective, selector: "axp-component-slot", inputs: ["name", "host", "context"], exportAs: ["slot"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2285
|
+
}
|
|
2286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootVerticalLayoutComponent, decorators: [{
|
|
2287
|
+
type: Component,
|
|
2288
|
+
args: [{ selector: 'axp-root-vertical-layout', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2289
|
+
RouterModule,
|
|
2290
|
+
AXButtonModule,
|
|
2291
|
+
AXTranslationModule,
|
|
2292
|
+
AXDecoratorModule,
|
|
2293
|
+
AXDropdownModule,
|
|
2294
|
+
AXAvatarModule,
|
|
2295
|
+
AXImageModule,
|
|
2296
|
+
AXImageModule,
|
|
2297
|
+
AXPopoverModule,
|
|
2298
|
+
AXBadgeModule,
|
|
2299
|
+
AXTabsModule,
|
|
2300
|
+
AXDrawerModule,
|
|
2301
|
+
AXDrawerModule,
|
|
2302
|
+
AXSideMenuModule,
|
|
2303
|
+
AXLoadingModule,
|
|
2304
|
+
AXPLogoComponent,
|
|
2305
|
+
AXPAuthModule,
|
|
2306
|
+
AXResizableDirective,
|
|
2307
|
+
AXPRootLayoutFooterComponent,
|
|
2308
|
+
AXPRootLayoutHeaderComponent,
|
|
2309
|
+
AXPRootLayoutMenuComponent,
|
|
2310
|
+
AXPComponentSlotModule,
|
|
2311
|
+
], template: "<div id=\"axp-root-layout\" class=\"axp-root-layout\">\n <ax-drawer-container>\n <ax-drawer id=\"axp-side-menu-drawer\" [axResizable]=\"deviceService.isLarge()\" #drawer\n class=\"ax-w-[75%] lg:ax-w-72 ax-border-lighter ax-bg-lighter dark:ax-border-darkest dark:ax-bg-darkest ax-h-full !ax-flex ax-flex-col\"\n [width]=\"(deviceService.isLarge() ? store.sideMenuWidth() : null)!\" location=\"start\"\n [collapsed]=\"!store.isSideMenuOpen()\" [closeOnBackdropClick]=\"false\" [defaultWidth]=\"288\"\n [mode]=\"deviceService.isSmall() || deviceService.isMedium() ? 'overlay' : 'push'\" [dblClickAction]=\"'fit'\"\n (onResizingEnded)=\"handleResizingEnded($event)\" (onResizingDblClick)=\"handleResizingEnded($event)\"\n (onBackdropClick)=\"store.closeSideMenu()\" backdropClass=\"ax-bg-black/50\">\n <ax-header id=\"axp-side-menu-header\"\n class=\"ax-light ax-h-14 ax-flex ax-items-center ax-justify-center ax-bg-primary-500 ax-text-primary-on-surface ax-border-e ax-border-primary-600\">\n <axp-logo [source]=\"logo?.full?.dark\"></axp-logo>\n </ax-header>\n <ax-content class=\"ax-flex ax-flex-col ax-border-e ax-h-full ax-overflow-auto\">\n <axp-component-slot name=\"root-side-menu-header\"></axp-component-slot>\n <div class=\"ax-overflow-auto ax-flex-1\">\n <axp-side-menu id=\"axp-side-menu\" class=\"ax-p-4 ax-block\"></axp-side-menu>\n </div>\n <axp-component-slot name=\"root-side-menu-footer\"></axp-component-slot>\n </ax-content>\n </ax-drawer>\n <ax-content class=\"ax-flex ax-flex-col ax-relative ax-bg-lightest dark:ax-bg-lighter ax-overflow-auto\">\n @if (store.isNavigationLoading()) {\n <div class=\"axp-navigating-progress\">\n <div></div>\n </div>\n }\n <axp-dashboard-admin-header id=\"axp-main-header\" class=\"ax-light\"></axp-dashboard-admin-header>\n\n <div class=\"ax-flex-1 ax-overflow-auto ax-relative\">\n <router-outlet></router-outlet>\n </div>\n </ax-content>\n </ax-drawer-container>\n <axp-dashboard-admin-footer id=\"axp-main-footer\"></axp-dashboard-admin-footer>\n</div>", styles: [".axp-root-layout{display:flex;height:100%;width:100%;flex-direction:column;justify-content:space-between}.axp-navigating-progress{position:absolute;top:0;height:.25rem;width:100%;overflow:hidden;background-color:rgba(var(--ax-sys-color-primary-200),.4)}.axp-navigating-progress>div{height:100%;width:100%;--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));animation:indeterminateAnimation 1.5s infinite cubic-bezier(.65,.815,.735,.395);transform-origin:0% 50%}@keyframes indeterminateAnimation{0%{transform:translate(-100%) scaleX(.2)}50%{transform:translate(50%) scaleX(.6)}to{transform:translate(100%) scaleX(.4)}}axp-dashboard-admin-header{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-500),var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-on-primary-surface),var(--tw-text-opacity, 1))}axp-dashboard-admin-header ax-button{--ax-comp-button-normal-bg-color: 0, 0, 0, 0 !important;--ax-comp-button-border-width: 0 !important;--ax-comp-button-normal-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-hover-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-focus-text-color: var(--axp-on-brand-color) !important;--ax-comp-button-pressed-text-color: var(--axp-on-brand-color) !important}.resize-handle{background-color:transparent!important}.resize-handle:hover{background-color:rgba(var(--ax-sys-color-primary-surface))!important}\n"] }]
|
|
2312
|
+
}], ctorParameters: () => [], propDecorators: { drawer: [{
|
|
2313
|
+
type: ViewChild,
|
|
2314
|
+
args: ['drawer']
|
|
2315
|
+
}] } });
|
|
2316
|
+
|
|
2317
|
+
class AXPRootLayoutComponent {
|
|
2318
|
+
constructor() {
|
|
2319
|
+
this.layout = inject(AXPLayoutThemeService);
|
|
2320
|
+
this.menuStore = inject(AXPMenuService);
|
|
2321
|
+
this.router = inject(Router);
|
|
2322
|
+
this.eventService = inject(AXPBroadcastEventService);
|
|
2323
|
+
this.sessionService = inject(AXPSessionService);
|
|
2324
|
+
this.unsubscriber = inject(AXUnsubscriber);
|
|
2325
|
+
this.contextStore = inject(AXPContextStore);
|
|
2326
|
+
}
|
|
2327
|
+
ngOnInit() {
|
|
2328
|
+
// Select the menu item based on the current route when the page loads
|
|
2329
|
+
this.menuStore.selectMenuItemByRoute(this.router.url);
|
|
2330
|
+
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe((event) => {
|
|
2331
|
+
// Update the selected menu item whenever the route changes
|
|
2332
|
+
this.menuStore.selectMenuItemByRoute(event.urlAfterRedirects);
|
|
2333
|
+
// Reset the context store
|
|
2334
|
+
this.contextStore.reset();
|
|
2335
|
+
});
|
|
2336
|
+
this.eventService.listen(AXPSessionStatus.SignedOut).subscribe(() => {
|
|
2337
|
+
console.log('signed out in root layout');
|
|
2338
|
+
this.router.navigate(['/auth/login']);
|
|
2339
|
+
});
|
|
2340
|
+
//
|
|
2341
|
+
this.sessionService.status$.pipe(this.unsubscriber.takeUntilDestroy).subscribe(async (status) => {
|
|
2342
|
+
// Don't redirect if still loading
|
|
2343
|
+
const isLoading = await firstValueFrom(this.sessionService.isLoading$);
|
|
2344
|
+
if (isLoading) {
|
|
2345
|
+
console.log('Session is still loading, skipping redirect check');
|
|
2346
|
+
return;
|
|
2347
|
+
}
|
|
2348
|
+
const redirectKeys = [AXPSessionStatus.SignedOut, AXPSessionStatus.Unauthenticated, AXPSessionStatus.Expired];
|
|
2349
|
+
if (redirectKeys.includes(status)) {
|
|
2350
|
+
console.log('Redirecting to login due to status:', status);
|
|
2351
|
+
this.router.navigate(['/auth/login']);
|
|
2352
|
+
}
|
|
2353
|
+
});
|
|
2354
|
+
}
|
|
2355
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2356
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPRootLayoutComponent, isStandalone: true, selector: "ng-component", providers: [AXUnsubscriber, AXPContextStore], ngImport: i0, template: `
|
|
2357
|
+
@if(layout.isMenuHorizontal()){
|
|
2358
|
+
<axp-root-horizontal-layout></axp-root-horizontal-layout>
|
|
2359
|
+
}@else{
|
|
2360
|
+
<axp-root-vertical-layout></axp-root-vertical-layout>
|
|
2361
|
+
}
|
|
2362
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AXPRootHorizontalLayoutComponent, selector: "axp-root-horizontal-layout" }, { kind: "component", type: AXPRootVerticalLayoutComponent, selector: "axp-root-vertical-layout" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2363
|
+
}
|
|
2364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutComponent, decorators: [{
|
|
2365
|
+
type: Component,
|
|
2366
|
+
args: [{
|
|
2367
|
+
template: `
|
|
2368
|
+
@if(layout.isMenuHorizontal()){
|
|
2369
|
+
<axp-root-horizontal-layout></axp-root-horizontal-layout>
|
|
2370
|
+
}@else{
|
|
2371
|
+
<axp-root-vertical-layout></axp-root-vertical-layout>
|
|
2372
|
+
}
|
|
2373
|
+
`,
|
|
2374
|
+
encapsulation: ViewEncapsulation.None,
|
|
2375
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2376
|
+
standalone: true,
|
|
2377
|
+
imports: [AXPRootHorizontalLayoutComponent, AXPRootVerticalLayoutComponent],
|
|
2378
|
+
providers: [AXUnsubscriber, AXPContextStore],
|
|
2379
|
+
}]
|
|
2380
|
+
}] });
|
|
2381
|
+
|
|
2382
|
+
var rootLayout_component = /*#__PURE__*/Object.freeze({
|
|
2383
|
+
__proto__: null,
|
|
2384
|
+
AXPRootLayoutComponent: AXPRootLayoutComponent
|
|
2385
|
+
});
|
|
2386
|
+
|
|
2387
|
+
class AXPEntityReuseStrategy {
|
|
2388
|
+
shouldDetach(route) {
|
|
2389
|
+
return false;
|
|
2390
|
+
}
|
|
2391
|
+
store(route, detachedTree) { }
|
|
2392
|
+
shouldAttach(route) {
|
|
2393
|
+
return false;
|
|
2394
|
+
}
|
|
2395
|
+
retrieve(route) {
|
|
2396
|
+
return null;
|
|
2397
|
+
}
|
|
2398
|
+
shouldReuseRoute(future, curr) {
|
|
2399
|
+
// If paths are different, never reuse
|
|
2400
|
+
if (future.routeConfig?.path !== curr.routeConfig?.path) {
|
|
2401
|
+
return false;
|
|
2402
|
+
}
|
|
2403
|
+
const reuseConfig = future.data?.['reuse'];
|
|
2404
|
+
// If reuse is explicitly false, don't reuse
|
|
2405
|
+
if (reuseConfig === false) {
|
|
2406
|
+
return false;
|
|
2407
|
+
}
|
|
2408
|
+
// If reuse is explicitly true, always reuse (same path)
|
|
2409
|
+
if (reuseConfig === true) {
|
|
2410
|
+
return true;
|
|
2411
|
+
}
|
|
2412
|
+
// Handle string-based reuse strategies
|
|
2413
|
+
if (typeof reuseConfig === 'string') {
|
|
2414
|
+
const paramsChanged = this.haveParamsChanged(future, curr);
|
|
2415
|
+
const queryParamsChanged = this.haveQueryParamsChanged(future, curr);
|
|
2416
|
+
switch (reuseConfig) {
|
|
2417
|
+
case 'paramsChange':
|
|
2418
|
+
// Reuse when params change, but destroy if queryParams change
|
|
2419
|
+
return !queryParamsChanged;
|
|
2420
|
+
case 'queryParamsChange':
|
|
2421
|
+
// Reuse when queryParams change, but destroy if params change
|
|
2422
|
+
return !paramsChanged;
|
|
2423
|
+
case 'paramsOrQueryParamsChange':
|
|
2424
|
+
// Reuse when either params or queryParams change
|
|
2425
|
+
return true;
|
|
2426
|
+
default:
|
|
2427
|
+
// Unknown strategy, use default behavior
|
|
2428
|
+
return true;
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
// Default behavior: reuse if paths are the same
|
|
2432
|
+
return true;
|
|
2433
|
+
}
|
|
2434
|
+
//#region ---- Helper Methods ----
|
|
2435
|
+
/**
|
|
2436
|
+
* Check if route params have changed between current and future routes
|
|
2437
|
+
*/
|
|
2438
|
+
haveParamsChanged(future, curr) {
|
|
2439
|
+
const futureParams = future.params;
|
|
2440
|
+
const currParams = curr.params;
|
|
2441
|
+
const futureKeys = Object.keys(futureParams);
|
|
2442
|
+
const currKeys = Object.keys(currParams);
|
|
2443
|
+
if (futureKeys.length !== currKeys.length) {
|
|
2444
|
+
return true;
|
|
2445
|
+
}
|
|
2446
|
+
for (const key of futureKeys) {
|
|
2447
|
+
if (futureParams[key] !== currParams[key]) {
|
|
2448
|
+
return true;
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
return false;
|
|
2452
|
+
}
|
|
2453
|
+
/**
|
|
2454
|
+
* Check if query params have changed between current and future routes
|
|
2455
|
+
*/
|
|
2456
|
+
haveQueryParamsChanged(future, curr) {
|
|
2457
|
+
const futureQueryParams = future.queryParams;
|
|
2458
|
+
const currQueryParams = curr.queryParams;
|
|
2459
|
+
const futureKeys = Object.keys(futureQueryParams);
|
|
2460
|
+
const currKeys = Object.keys(currQueryParams);
|
|
2461
|
+
if (futureKeys.length !== currKeys.length) {
|
|
2462
|
+
return true;
|
|
2463
|
+
}
|
|
2464
|
+
for (const key of futureKeys) {
|
|
2465
|
+
if (futureQueryParams[key] !== currQueryParams[key]) {
|
|
2466
|
+
return true;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
return false;
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
function routesFacory() {
|
|
2474
|
+
const config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
2475
|
+
let routes = [
|
|
2476
|
+
{
|
|
2477
|
+
path: ':app/modules/:module/:entity',
|
|
2478
|
+
canActivate: [AXPAuthGuard],
|
|
2479
|
+
loadComponent: () => {
|
|
2480
|
+
return config.viewers.root();
|
|
2481
|
+
},
|
|
2482
|
+
// children: [
|
|
2483
|
+
// {
|
|
2484
|
+
// path: 'details/:id',
|
|
2485
|
+
// loadComponent: () => import('@acorex/platform/layout/views').then((c) => c.AXPLayoutDetailsViewComponent),
|
|
2486
|
+
// data: { reuse: true },
|
|
2487
|
+
// resolve: {
|
|
2488
|
+
// adapter: AXPLayoutDetailsViewRouteResolver,
|
|
2489
|
+
// },
|
|
2490
|
+
// },
|
|
2491
|
+
// ],
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
path: 'error',
|
|
2495
|
+
children: [
|
|
2496
|
+
{
|
|
2497
|
+
path: 'offline',
|
|
2498
|
+
loadComponent: () => import('./acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs').then((c) => c.AXPErrorOfflineComponent),
|
|
2499
|
+
},
|
|
2500
|
+
{
|
|
2501
|
+
path: '404',
|
|
2502
|
+
loadComponent: () => import('./acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs').then((c) => c.AXPError404Component),
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
path: '401',
|
|
2506
|
+
loadComponent: () => import('./acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs').then((c) => c.AXPError401Component),
|
|
2507
|
+
},
|
|
2508
|
+
],
|
|
2509
|
+
},
|
|
2510
|
+
];
|
|
2511
|
+
return routes;
|
|
2512
|
+
}
|
|
2513
|
+
class AXPDefaultThemeModule {
|
|
2514
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDefaultThemeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2515
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXPDefaultThemeModule, imports: [AXPCommonModule, AXPThemesSharedModule] }); }
|
|
2516
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDefaultThemeModule, providers: [
|
|
2517
|
+
{
|
|
2518
|
+
provide: AXP_ENTITY_CONFIG_TOKEN,
|
|
2519
|
+
useFactory: () => {
|
|
2520
|
+
const config = {
|
|
2521
|
+
viewers: {
|
|
2522
|
+
root: () => Promise.resolve().then(function () { return rootLayout_component; }).then((c) => c.AXPRootLayoutComponent),
|
|
2523
|
+
master: {
|
|
2524
|
+
single: () => import('./acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs').then((c) => c.AXPEntityMasterSingleViewComponent),
|
|
2525
|
+
details: () => import('@acorex/platform/layout/views').then((c) => c.AXPLayoutDetailsViewComponent),
|
|
2526
|
+
///
|
|
2527
|
+
create: () => import('./acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs').then((c) => c.AXPEntityMasterCreateViewComponent),
|
|
2528
|
+
///
|
|
2529
|
+
modify: () => import('./acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs').then((c) => c.AXPEntityMasterModifyViewComponent),
|
|
2530
|
+
//
|
|
2531
|
+
list: () => Promise.resolve().then(function () { return entityMasterListView_component; }).then((c) => c.AXPEntityMasterListViewComponent),
|
|
2532
|
+
},
|
|
2533
|
+
},
|
|
2534
|
+
};
|
|
2535
|
+
return config;
|
|
2536
|
+
},
|
|
2537
|
+
},
|
|
2538
|
+
{ provide: RouteReuseStrategy, useClass: AXPEntityReuseStrategy },
|
|
2539
|
+
{
|
|
2540
|
+
provide: ROUTES,
|
|
2541
|
+
multi: true,
|
|
2542
|
+
useFactory: routesFacory,
|
|
2543
|
+
},
|
|
2544
|
+
], imports: [AXPCommonModule, AXPThemesSharedModule] }); }
|
|
2545
|
+
}
|
|
2546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDefaultThemeModule, decorators: [{
|
|
2547
|
+
type: NgModule,
|
|
2548
|
+
args: [{
|
|
2549
|
+
imports: [AXPCommonModule, AXPThemesSharedModule],
|
|
2550
|
+
exports: [],
|
|
2551
|
+
declarations: [],
|
|
2552
|
+
providers: [
|
|
2553
|
+
{
|
|
2554
|
+
provide: AXP_ENTITY_CONFIG_TOKEN,
|
|
2555
|
+
useFactory: () => {
|
|
2556
|
+
const config = {
|
|
2557
|
+
viewers: {
|
|
2558
|
+
root: () => Promise.resolve().then(function () { return rootLayout_component; }).then((c) => c.AXPRootLayoutComponent),
|
|
2559
|
+
master: {
|
|
2560
|
+
single: () => import('./acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs').then((c) => c.AXPEntityMasterSingleViewComponent),
|
|
2561
|
+
details: () => import('@acorex/platform/layout/views').then((c) => c.AXPLayoutDetailsViewComponent),
|
|
2562
|
+
///
|
|
2563
|
+
create: () => import('./acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs').then((c) => c.AXPEntityMasterCreateViewComponent),
|
|
2564
|
+
///
|
|
2565
|
+
modify: () => import('./acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs').then((c) => c.AXPEntityMasterModifyViewComponent),
|
|
2566
|
+
//
|
|
2567
|
+
list: () => Promise.resolve().then(function () { return entityMasterListView_component; }).then((c) => c.AXPEntityMasterListViewComponent),
|
|
2568
|
+
},
|
|
2569
|
+
},
|
|
2570
|
+
};
|
|
2571
|
+
return config;
|
|
2572
|
+
},
|
|
2573
|
+
},
|
|
2574
|
+
{ provide: RouteReuseStrategy, useClass: AXPEntityReuseStrategy },
|
|
2575
|
+
{
|
|
2576
|
+
provide: ROUTES,
|
|
2577
|
+
multi: true,
|
|
2578
|
+
useFactory: routesFacory,
|
|
2579
|
+
},
|
|
2580
|
+
],
|
|
2581
|
+
}]
|
|
2582
|
+
}] });
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* Generated bundle index. Do not edit.
|
|
2586
|
+
*/
|
|
2587
|
+
|
|
2588
|
+
export { AXPDefaultThemeModule, AXPEntityDetailListViewComponent, AXPEntityMasterListViewComponent, AXPRootHorizontalLayoutComponent, AXPRootLayoutComponent, AXPRootLayoutFooterComponent, AXPRootLayoutHeaderComponent, AXPRootLayoutMenuComponent, AXPRootVerticalLayoutComponent };
|
|
2589
|
+
//# sourceMappingURL=acorex-platform-themes-default.mjs.map
|