@acorex/platform 21.0.0-next.5 → 21.0.0-next.51
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/fesm2022/acorex-platform-auth.mjs +281 -23
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common-common-settings.provider-Bi1RYif5.mjs +163 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-Bi1RYif5.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +1047 -263
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +1138 -510
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +557 -826
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +804 -186
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- 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 +6208 -2344
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +456 -204
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +18632 -10286
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +538 -168
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +720 -456
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs → acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs} +10 -10
- 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-CDYAGBku.mjs +103 -0
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs → acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs} +6 -7
- 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-BtZMBxYp.mjs → acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs} +12 -12
- 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-BGO75IMz.mjs +116 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGO75IMz.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs} +6 -6
- 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-y8vjUiVs.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs} +5 -5
- 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-Df1BFkSa.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +8728 -4269
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-native.mjs +8 -7
- package/fesm2022/acorex-platform-native.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +391 -166
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs +160 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs +120 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs → acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs} +19 -26
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-401.component-cfREo88K.mjs → acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs → acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs} +4 -4
- 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 +1836 -67
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs → acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs} +6 -6
- 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-9W52W6Nu.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs} +6 -6
- 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 → acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs} +24 -25
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs +94 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs +86 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +674 -573
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +1715 -535
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/fesm2022/acorex-platform.mjs.map +1 -1
- package/package.json +37 -37
- package/{auth/index.d.ts → types/acorex-platform-auth.d.ts} +241 -4
- package/{common/index.d.ts → types/acorex-platform-common.d.ts} +598 -80
- package/{core/index.d.ts → types/acorex-platform-core.d.ts} +595 -132
- package/{domain/index.d.ts → types/acorex-platform-domain.d.ts} +744 -412
- package/{layout/builder/index.d.ts → types/acorex-platform-layout-builder.d.ts} +193 -48
- package/types/acorex-platform-layout-components.d.ts +2979 -0
- package/{layout/designer/index.d.ts → types/acorex-platform-layout-designer.d.ts} +96 -18
- package/{layout/entity/index.d.ts → types/acorex-platform-layout-entity.d.ts} +1601 -261
- package/{layout/views/index.d.ts → types/acorex-platform-layout-views.d.ts} +116 -55
- package/{layout/widget-core/index.d.ts → types/acorex-platform-layout-widget-core.d.ts} +272 -124
- package/{layout/widgets/index.d.ts → types/acorex-platform-layout-widgets.d.ts} +1055 -157
- package/{native/index.d.ts → types/acorex-platform-native.d.ts} +0 -7
- package/types/acorex-platform-runtime.d.ts +571 -0
- package/{themes/default/index.d.ts → types/acorex-platform-themes-default.d.ts} +122 -5
- package/{themes/shared/index.d.ts → types/acorex-platform-themes-shared.d.ts} +1 -1
- package/types/acorex-platform-workflow.d.ts +1884 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs +0 -71
- package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs +0 -135
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +0 -157
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs +0 -1542
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs +0 -19
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs +0 -65
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs +0 -64
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map +0 -1
- package/layout/components/index.d.ts +0 -1669
- package/runtime/index.d.ts +0 -307
- package/workflow/index.d.ts +0 -1808
- /package/{index.d.ts → types/acorex-platform.d.ts} +0 -0
|
@@ -10,25 +10,27 @@ import { AXDataTableModule } from '@acorex/components/data-table';
|
|
|
10
10
|
import * as i2$1 from '@acorex/components/decorators';
|
|
11
11
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
12
12
|
import { AXDialogModule } from '@acorex/components/dialog';
|
|
13
|
-
import * as i3$
|
|
13
|
+
import * as i3$2 from '@acorex/components/drawer';
|
|
14
14
|
import { AXDrawerModule } from '@acorex/components/drawer';
|
|
15
15
|
import * as i5 from '@acorex/components/dropdown';
|
|
16
16
|
import { AXDropdownModule } from '@acorex/components/dropdown';
|
|
17
17
|
import { AXFormModule } from '@acorex/components/form';
|
|
18
18
|
import { AXLoadingModule } from '@acorex/components/loading';
|
|
19
|
+
import * as i3$1 from '@acorex/components/popover';
|
|
19
20
|
import { AXPopoverModule } from '@acorex/components/popover';
|
|
20
21
|
import * as i6 from '@acorex/components/search-box';
|
|
21
22
|
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
|
22
23
|
import { AXTabsModule } from '@acorex/components/tabs';
|
|
23
24
|
import { AXTooltipModule } from '@acorex/components/tooltip';
|
|
24
25
|
import * as i10 from '@acorex/core/translation';
|
|
25
|
-
import { AXTranslationModule } from '@acorex/core/translation';
|
|
26
|
+
import { AXTranslationModule, AXTranslationService, translateSync } from '@acorex/core/translation';
|
|
26
27
|
import * as i2 from '@acorex/core/utils';
|
|
27
28
|
import { AXUnsubscriber } from '@acorex/core/utils';
|
|
28
29
|
import { AXPAuthModule, AXPSessionService, AXPSessionStatus, AXPAuthGuard } from '@acorex/platform/auth';
|
|
29
|
-
import { AXPRefreshEvent, AXP_PLATFORM_CONFIG_TOKEN, AXPMenuService,
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
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, AXPComponentSlotModule, AXPPlatformScope, AXPBroadcastEventService, AXPContextStore } from '@acorex/platform/core';
|
|
33
|
+
import { AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY, AXPEntityDefinitionRegistryService, AXPCategoryTreeService, AXPEntityListViewColumnViewModel, getDataSourcePageIndex, restoreEntityListExpandedRows, AXP_ENTITY_CONFIG_TOKEN } from '@acorex/platform/layout/entity';
|
|
32
34
|
import * as i7$1 from '@acorex/platform/layout/widget-core';
|
|
33
35
|
import { AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
|
|
34
36
|
import { AXPWidgetsModule } from '@acorex/platform/layout/widgets';
|
|
@@ -37,16 +39,24 @@ import { AXPWorkflowService, ofType } from '@acorex/platform/workflow';
|
|
|
37
39
|
import * as i1$1 from '@angular/common';
|
|
38
40
|
import { CommonModule } from '@angular/common';
|
|
39
41
|
import * as i0 from '@angular/core';
|
|
40
|
-
import { inject, signal, computed, effect, ViewChild, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
42
|
+
import { inject, signal, computed, effect, ViewChild, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, input, viewChild, afterNextRender, NgModule } from '@angular/core';
|
|
41
43
|
import { FormsModule } from '@angular/forms';
|
|
42
|
-
import * as i1$
|
|
43
|
-
import { RouterModule, Router, NavigationEnd, RouteReuseStrategy, ROUTES } from '@angular/router';
|
|
44
|
+
import * as i1$4 from '@angular/router';
|
|
45
|
+
import { RouterModule, Router, ActivatedRoute, NavigationEnd, RouteReuseStrategy, ROUTES } from '@angular/router';
|
|
44
46
|
import { Subject, takeUntil, filter, firstValueFrom } from 'rxjs';
|
|
45
|
-
import * as i1$2 from '@acorex/platform
|
|
46
|
-
import {
|
|
47
|
-
import
|
|
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';
|
|
48
59
|
import { AXSideMenuModule } from '@acorex/components/side-menu';
|
|
49
|
-
import { sortBy } from 'lodash-es';
|
|
50
60
|
import { AXAvatarModule } from '@acorex/components/avatar';
|
|
51
61
|
import { AXImageModule } from '@acorex/components/image';
|
|
52
62
|
import * as i4$1 from '@acorex/components/menu';
|
|
@@ -61,8 +71,8 @@ class AXPEntityDetailListViewComponent {
|
|
|
61
71
|
this.workflow = inject(AXPWorkflowService);
|
|
62
72
|
this.store = inject(AXPLayoutThemeService);
|
|
63
73
|
this.deviceService = inject(AXPDeviceService);
|
|
64
|
-
this.toolbarPrimaryActions = signal([], ...(ngDevMode ? [{ debugName: "toolbarPrimaryActions" }] : []));
|
|
65
|
-
this.toolbarSecondaryActions = signal([], ...(ngDevMode ? [{ debugName: "toolbarSecondaryActions" }] : []));
|
|
74
|
+
this.toolbarPrimaryActions = signal([], ...(ngDevMode ? [{ debugName: "toolbarPrimaryActions" }] : /* istanbul ignore next */ []));
|
|
75
|
+
this.toolbarSecondaryActions = signal([], ...(ngDevMode ? [{ debugName: "toolbarSecondaryActions" }] : /* istanbul ignore next */ []));
|
|
66
76
|
this.destroyed = new Subject();
|
|
67
77
|
this.dropdownRowItems = computed(() => {
|
|
68
78
|
return this.vm.secondaryRowActions().map((c) => ({
|
|
@@ -71,7 +81,7 @@ class AXPEntityDetailListViewComponent {
|
|
|
71
81
|
text: c.title,
|
|
72
82
|
color: c.color,
|
|
73
83
|
}));
|
|
74
|
-
}, ...(ngDevMode ? [{ debugName: "dropdownRowItems" }] : []));
|
|
84
|
+
}, ...(ngDevMode ? [{ debugName: "dropdownRowItems" }] : /* istanbul ignore next */ []));
|
|
75
85
|
this.commandRowItems = computed(() => {
|
|
76
86
|
return this.vm.primaryRowActions().map((c) => {
|
|
77
87
|
return {
|
|
@@ -81,7 +91,7 @@ class AXPEntityDetailListViewComponent {
|
|
|
81
91
|
color: c.color,
|
|
82
92
|
};
|
|
83
93
|
});
|
|
84
|
-
}, ...(ngDevMode ? [{ debugName: "commandRowItems" }] : []));
|
|
94
|
+
}, ...(ngDevMode ? [{ debugName: "commandRowItems" }] : /* istanbul ignore next */ []));
|
|
85
95
|
this.getCommandRowItems = () => {
|
|
86
96
|
return this.commandRowItems();
|
|
87
97
|
};
|
|
@@ -147,14 +157,15 @@ class AXPEntityDetailListViewComponent {
|
|
|
147
157
|
this.destroyed.complete();
|
|
148
158
|
}
|
|
149
159
|
ngOnDestroy() {
|
|
160
|
+
this.vm?.destroy();
|
|
150
161
|
this.destroy();
|
|
151
162
|
}
|
|
152
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
153
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
163
|
+
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 }); }
|
|
164
|
+
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 @if (vm.showIndexColumn()) {\n <ax-index-column\n [caption]=\"('@general:terms.common.row-number' | translate | async)!\"\n fixed=\"start\"\n [width]=\"'80px'\"\n [padZero]=\"false\"\n ></ax-index-column>\n }\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:
|
|
154
165
|
//
|
|
155
166
|
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 }); }
|
|
156
167
|
}
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityDetailListViewComponent, decorators: [{
|
|
158
169
|
type: Component,
|
|
159
170
|
args: [{ selector: 'axp-entity-detail-list-view', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [AXUnsubscriber], imports: [
|
|
160
171
|
CommonModule,
|
|
@@ -180,7 +191,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
180
191
|
AXPWidgetsModule,
|
|
181
192
|
AXPAuthModule,
|
|
182
193
|
AXTranslationModule,
|
|
183
|
-
], 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\"
|
|
194
|
+
], 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 @if (vm.showIndexColumn()) {\n <ax-index-column\n [caption]=\"('@general:terms.common.row-number' | translate | async)!\"\n fixed=\"start\"\n [width]=\"'80px'\"\n [padZero]=\"false\"\n ></ax-index-column>\n }\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" }]
|
|
184
195
|
}], ctorParameters: () => [{ type: i1.AXActionSheetService }, { type: i2.AXUnsubscriber }], propDecorators: { vm: [{
|
|
185
196
|
type: Input,
|
|
186
197
|
args: ['viewModel']
|
|
@@ -189,13 +200,1726 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
189
200
|
args: ['grid', { static: true }]
|
|
190
201
|
}] } });
|
|
191
202
|
|
|
203
|
+
//#region ---- Constants ----
|
|
204
|
+
const ROOT_NODE_ID = 'all';
|
|
205
|
+
const LOADING_DELAY_MS = 300;
|
|
206
|
+
const DEFAULT_TEXT_FIELD = 'title';
|
|
207
|
+
const DEFAULT_VALUE_FIELD = 'id';
|
|
208
|
+
//#endregion
|
|
209
|
+
class AXPEntityCategoryComponent {
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region ---- Constructor & Lifecycle ----
|
|
212
|
+
constructor() {
|
|
213
|
+
//#region ---- Services & Dependencies ----
|
|
214
|
+
/** i18n key for the synthetic "all items" root row; resolved in the template with the translate pipe. */
|
|
215
|
+
this.categoryTreeRootTitleI18nKey = AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY;
|
|
216
|
+
this.translate = inject(AXTranslationService);
|
|
217
|
+
this.workflow = inject(AXPWorkflowService);
|
|
218
|
+
this.commandService = inject(AXPCommandService);
|
|
219
|
+
this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
|
|
220
|
+
this.categoryTreeService = inject(AXPCategoryTreeService);
|
|
221
|
+
this.highlightService = inject(AXHighlightService);
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region ---- Component Inputs & View Queries ----
|
|
224
|
+
this.vm = input.required(...(ngDevMode ? [{ debugName: "vm" }] : /* istanbul ignore next */ []));
|
|
225
|
+
this.tree = viewChild('tree', ...(ngDevMode ? [{ debugName: "tree" }] : /* istanbul ignore next */ []));
|
|
226
|
+
this.searchValue = input('', ...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
|
|
227
|
+
// Tree view inputs with defaults
|
|
228
|
+
this.selectMode = input('single', ...(ngDevMode ? [{ debugName: "selectMode" }] : /* istanbul ignore next */ []));
|
|
229
|
+
this.selectionBehavior = input('intermediate', ...(ngDevMode ? [{ debugName: "selectionBehavior" }] : /* istanbul ignore next */ []));
|
|
230
|
+
this.dragArea = input('handler', ...(ngDevMode ? [{ debugName: "dragArea" }] : /* istanbul ignore next */ []));
|
|
231
|
+
this.dragBehavior = input('none', ...(ngDevMode ? [{ debugName: "dragBehavior" }] : /* istanbul ignore next */ []));
|
|
232
|
+
this.showIcons = input(true, ...(ngDevMode ? [{ debugName: "showIcons" }] : /* istanbul ignore next */ []));
|
|
233
|
+
this.showChildrenBadge = input(false, ...(ngDevMode ? [{ debugName: "showChildrenBadge" }] : /* istanbul ignore next */ []));
|
|
234
|
+
this.expandedIcon = input('fa-solid fa-chevron-down', ...(ngDevMode ? [{ debugName: "expandedIcon" }] : /* istanbul ignore next */ []));
|
|
235
|
+
this.collapsedIcon = input('fa-solid fa-chevron-right', ...(ngDevMode ? [{ debugName: "collapsedIcon" }] : /* istanbul ignore next */ []));
|
|
236
|
+
this.indentSize = input(16, ...(ngDevMode ? [{ debugName: "indentSize" }] : /* istanbul ignore next */ []));
|
|
237
|
+
this.look = input('default', ...(ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []));
|
|
238
|
+
this.searchWithChildren = input(true, ...(ngDevMode ? [{ debugName: "searchWithChildren" }] : /* istanbul ignore next */ [])); // Include children of search results
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region ---- Component State ----
|
|
241
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
242
|
+
this.isSearching = signal(false, ...(ngDevMode ? [{ debugName: "isSearching" }] : /* istanbul ignore next */ []));
|
|
243
|
+
this.searchResultCount = signal(0, ...(ngDevMode ? [{ debugName: "searchResultCount" }] : /* istanbul ignore next */ []));
|
|
244
|
+
this.currentSearchValue = signal('', ...(ngDevMode ? [{ debugName: "currentSearchValue" }] : /* istanbul ignore next */ []));
|
|
245
|
+
this.resultsFoundText = signal('', ...(ngDevMode ? [{ debugName: "resultsFoundText" }] : /* istanbul ignore next */ []));
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region ---- Private Properties ----
|
|
248
|
+
this.loadingTimeoutId = null;
|
|
249
|
+
this.treeData = null;
|
|
250
|
+
this.treeConfig = null;
|
|
251
|
+
this.matchingNodeIds = new Set();
|
|
252
|
+
this.relevantNodeIds = new Set(); // For search filtering
|
|
253
|
+
this.nodeDataCache = new Map(); // Cache parent data from search results
|
|
254
|
+
this.expandedNodesBeforeSearch = [];
|
|
255
|
+
this.nodesExpandedDuringSearch = [];
|
|
256
|
+
this.currentSearchTerm = null;
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region ---- Computed Properties ----
|
|
259
|
+
this.textField = computed(() => this.vm().entityDef.category?.textField || DEFAULT_TEXT_FIELD, ...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
260
|
+
this.valueField = computed(() => this.vm().entityDef.category?.valueField || DEFAULT_VALUE_FIELD, ...(ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
261
|
+
/** When true, add/edit/delete category actions are hidden (from category plugin readonly option). */
|
|
262
|
+
this.categoryReadonly = computed(() => this.vm().entityDef?.extensions?.category?.readonly === true, ...(ngDevMode ? [{ debugName: "categoryReadonly" }] : /* istanbul ignore next */ []));
|
|
263
|
+
/**
|
|
264
|
+
* Computed property to check if we should show the "no search results" empty state.
|
|
265
|
+
* Returns true when search is active, not searching, and no results found.
|
|
266
|
+
*/
|
|
267
|
+
this.showNoSearchResults = computed(() => {
|
|
268
|
+
const searchValue = this.currentSearchValue().trim();
|
|
269
|
+
const isSearching = this.isSearching();
|
|
270
|
+
const resultCount = this.searchResultCount();
|
|
271
|
+
return searchValue.length > 0 && !isSearching && resultCount === 0;
|
|
272
|
+
}, ...(ngDevMode ? [{ debugName: "showNoSearchResults" }] : /* istanbul ignore next */ []));
|
|
273
|
+
this.categoryEntityKey = computed(() => {
|
|
274
|
+
const key = this.vm().entityDef.category?.entity;
|
|
275
|
+
if (!key) {
|
|
276
|
+
throw new Error('Category entity is not configured');
|
|
277
|
+
}
|
|
278
|
+
return key;
|
|
279
|
+
}, ...(ngDevMode ? [{ debugName: "categoryEntityKey" }] : /* istanbul ignore next */ []));
|
|
280
|
+
// protected toggleExpand(e: AXTreeViewNodeDoubleClickEvent) {
|
|
281
|
+
// (e.component as AXTreeViewComponent).toggleNodeExpansion(String(e.node[this.valueField()] ?? ''));
|
|
282
|
+
// }
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region ---- Tree Data Source ----
|
|
285
|
+
/**
|
|
286
|
+
* Datasource callback for tree-view component.
|
|
287
|
+
* Provides lazy loading support for tree nodes.
|
|
288
|
+
*/
|
|
289
|
+
this.datasource = async (parentId) => {
|
|
290
|
+
if (!this.isTreeInitialized()) {
|
|
291
|
+
return [];
|
|
292
|
+
}
|
|
293
|
+
// Load root nodes if no parent ID provided
|
|
294
|
+
if (!parentId) {
|
|
295
|
+
return await this.loadRootNodes();
|
|
296
|
+
}
|
|
297
|
+
// Load children for the specified parent
|
|
298
|
+
return await this.loadChildNodes(parentId);
|
|
299
|
+
};
|
|
300
|
+
afterNextRender(() => {
|
|
301
|
+
this.initializeTree();
|
|
302
|
+
});
|
|
303
|
+
this.workflow.events$
|
|
304
|
+
.pipe(ofType(AXPRefreshEvent))
|
|
305
|
+
.pipe(takeUntilDestroyed())
|
|
306
|
+
.subscribe((event) => {
|
|
307
|
+
this.tree()?.reloadData();
|
|
308
|
+
// this.tree()?.refresh();
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region ---- Public Methods ----
|
|
313
|
+
/**
|
|
314
|
+
* Handles category search input changes - Uses server-side search for efficiency and reliability
|
|
315
|
+
*/
|
|
316
|
+
async handleCategorySearchChange(event) {
|
|
317
|
+
if (!this.isTreeInitialized()) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
const searchTerm = (event.value ?? '').trim().toLowerCase();
|
|
321
|
+
const previousSearchTerm = this.currentSearchValue();
|
|
322
|
+
// If search is cleared, reset tree
|
|
323
|
+
if (!searchTerm) {
|
|
324
|
+
if (previousSearchTerm || this.matchingNodeIds.size > 0) {
|
|
325
|
+
this.currentSearchValue.set('');
|
|
326
|
+
this.currentSearchTerm = null;
|
|
327
|
+
await this.resetSearch();
|
|
328
|
+
}
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
// For non-empty search, only process user interactions
|
|
332
|
+
if (!event.isUserInteraction) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
// Prevent concurrent searches
|
|
336
|
+
if (this.isSearching() && this.currentSearchTerm !== null) {
|
|
337
|
+
if (this.currentSearchTerm === searchTerm) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
this.currentSearchValue.set(event.value ?? '');
|
|
342
|
+
this.currentSearchTerm = searchTerm;
|
|
343
|
+
const treeComponent = this.tree();
|
|
344
|
+
if (!treeComponent) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
// Store expanded nodes before starting a new search (only on first search)
|
|
348
|
+
if (!previousSearchTerm && this.expandedNodesBeforeSearch.length === 0) {
|
|
349
|
+
const expandedNodes = treeComponent.getExpandedNodes();
|
|
350
|
+
this.expandedNodesBeforeSearch = expandedNodes
|
|
351
|
+
.map((node) => String(node['id'] ?? ''))
|
|
352
|
+
.filter((id) => id && id !== ROOT_NODE_ID);
|
|
353
|
+
}
|
|
354
|
+
// Collapse nodes from previous search before starting new search
|
|
355
|
+
if (previousSearchTerm && this.nodesExpandedDuringSearch.length > 0) {
|
|
356
|
+
const nodesToCollapse = [...this.nodesExpandedDuringSearch].reverse();
|
|
357
|
+
this.nodesExpandedDuringSearch = [];
|
|
358
|
+
for (const nodeId of nodesToCollapse) {
|
|
359
|
+
// Only collapse if it wasn't originally expanded before search
|
|
360
|
+
if (!this.expandedNodesBeforeSearch.includes(nodeId)) {
|
|
361
|
+
try {
|
|
362
|
+
treeComponent.collapseNode(nodeId);
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
// Node might not exist anymore, ignore
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
this.isSearching.set(true);
|
|
371
|
+
try {
|
|
372
|
+
// Step 1: Use server-side search to get matching items
|
|
373
|
+
const searchResults = await this.categoryTreeService.searchCategories(searchTerm, this.treeData, this.treeConfig);
|
|
374
|
+
// Check if search term changed during the API call
|
|
375
|
+
if (this.currentSearchTerm !== searchTerm) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
if (!searchResults || searchResults.length === 0) {
|
|
379
|
+
this.matchingNodeIds.clear();
|
|
380
|
+
this.relevantNodeIds.clear();
|
|
381
|
+
this.searchResultCount.set(0);
|
|
382
|
+
await this.updateTranslatedMessages(0);
|
|
383
|
+
// Clear highlighting and reload tree to show all nodes
|
|
384
|
+
this.highlightService.clear();
|
|
385
|
+
await treeComponent.reloadData();
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
// Store matching node IDs from search results
|
|
389
|
+
this.matchingNodeIds.clear();
|
|
390
|
+
const valueField = this.valueField();
|
|
391
|
+
searchResults.forEach((item) => {
|
|
392
|
+
const nodeId = String(item[valueField] ?? '');
|
|
393
|
+
if (nodeId) {
|
|
394
|
+
this.matchingNodeIds.add(nodeId);
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
const resultCount = searchResults.length;
|
|
398
|
+
this.searchResultCount.set(resultCount);
|
|
399
|
+
// Update translated messages
|
|
400
|
+
await this.updateTranslatedMessages(resultCount);
|
|
401
|
+
// Step 2: Collect parent IDs (builds relevantNodeIds for filtering)
|
|
402
|
+
const parentsToExpand = await this.collectParentIds(searchResults);
|
|
403
|
+
// Step 2.5: Collect children IDs if searchWithChildren is enabled
|
|
404
|
+
if (this.searchWithChildren()) {
|
|
405
|
+
await this.collectChildrenIds(searchResults);
|
|
406
|
+
}
|
|
407
|
+
// Step 3: Reload tree to apply filtering
|
|
408
|
+
await treeComponent.reloadData();
|
|
409
|
+
// Step 4: Expand root node
|
|
410
|
+
if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
|
|
411
|
+
try {
|
|
412
|
+
await treeComponent.expandNode(ROOT_NODE_ID);
|
|
413
|
+
this.nodesExpandedDuringSearch.push(ROOT_NODE_ID);
|
|
414
|
+
}
|
|
415
|
+
catch {
|
|
416
|
+
// Root might not exist
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
// Step 4: Expand all parent nodes in order (from root to leaves)
|
|
420
|
+
// Sort parents by their depth to expand in correct order
|
|
421
|
+
const sortedParents = await this.sortParentsByDepth(Array.from(parentsToExpand));
|
|
422
|
+
for (const parentId of sortedParents) {
|
|
423
|
+
// Only expand if not already expanded
|
|
424
|
+
if (!treeComponent.isNodeExpanded(parentId)) {
|
|
425
|
+
try {
|
|
426
|
+
await treeComponent.expandNode(parentId);
|
|
427
|
+
this.nodesExpandedDuringSearch.push(parentId);
|
|
428
|
+
// Small delay to prevent overwhelming the tree component
|
|
429
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
430
|
+
}
|
|
431
|
+
catch {
|
|
432
|
+
// Node might not exist, ignore
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
// Step 5: Apply highlighting after tree is rendered
|
|
437
|
+
// Use setTimeout to ensure DOM is updated after tree reload
|
|
438
|
+
setTimeout(() => {
|
|
439
|
+
if (this.currentSearchValue().trim()) {
|
|
440
|
+
this.highlightService.highlight('ax-tree-view .ax-truncate', this.currentSearchValue().trim());
|
|
441
|
+
}
|
|
442
|
+
}, 100);
|
|
443
|
+
}
|
|
444
|
+
catch (error) {
|
|
445
|
+
console.error('Error searching categories:', error);
|
|
446
|
+
this.matchingNodeIds.clear();
|
|
447
|
+
this.relevantNodeIds.clear();
|
|
448
|
+
this.searchResultCount.set(0);
|
|
449
|
+
this.highlightService.clear();
|
|
450
|
+
// Reload tree to clear any filters
|
|
451
|
+
const treeComponent = this.tree();
|
|
452
|
+
if (treeComponent) {
|
|
453
|
+
await treeComponent.reloadData();
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
finally {
|
|
457
|
+
if (this.currentSearchTerm === searchTerm) {
|
|
458
|
+
this.currentSearchTerm = null;
|
|
459
|
+
}
|
|
460
|
+
this.isSearching.set(false);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Collects all parent IDs for the given search results
|
|
465
|
+
* Handles both nested 'parent' object and 'parentId' field in search results
|
|
466
|
+
* Recursively fetches parent nodes to build the full parent chain
|
|
467
|
+
*/
|
|
468
|
+
async collectParentIds(items) {
|
|
469
|
+
const parentsToExpand = new Set();
|
|
470
|
+
const valueField = this.valueField();
|
|
471
|
+
const parentKey = this.treeData?.categoryEntityDef?.parentKey || 'parentId';
|
|
472
|
+
// Build relevantNodeIds = matching nodes + all parents
|
|
473
|
+
this.relevantNodeIds.clear();
|
|
474
|
+
this.matchingNodeIds.forEach((id) => this.relevantNodeIds.add(id));
|
|
475
|
+
// Recursively extract all parent IDs
|
|
476
|
+
const extractParentIds = async (item) => {
|
|
477
|
+
// First, try to get parent from nested 'parent' object (if available)
|
|
478
|
+
const parent = item['parent'];
|
|
479
|
+
if (parent) {
|
|
480
|
+
const parentId = String(parent[valueField] ?? parent['id'] ?? '');
|
|
481
|
+
if (parentId && parentId !== ROOT_NODE_ID) {
|
|
482
|
+
parentsToExpand.add(parentId);
|
|
483
|
+
this.relevantNodeIds.add(parentId); // Add to filter set
|
|
484
|
+
this.nodeDataCache.set(parentId, parent);
|
|
485
|
+
await extractParentIds(parent);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
// Fallback: use parentId field and fetch parent from server
|
|
490
|
+
// Try both parentKey from entity definition and common 'parentId' field
|
|
491
|
+
const parentIdValue = item[parentKey] ?? item['parentId'];
|
|
492
|
+
if (parentIdValue) {
|
|
493
|
+
const parentId = String(parentIdValue);
|
|
494
|
+
if (parentId && parentId !== ROOT_NODE_ID) {
|
|
495
|
+
// Add to sets first
|
|
496
|
+
parentsToExpand.add(parentId);
|
|
497
|
+
this.relevantNodeIds.add(parentId);
|
|
498
|
+
// Fetch parent from server if not already cached
|
|
499
|
+
if (!this.nodeDataCache.has(parentId)) {
|
|
500
|
+
const parentItem = await this.fetchItemById(parentId);
|
|
501
|
+
if (parentItem) {
|
|
502
|
+
this.nodeDataCache.set(parentId, parentItem);
|
|
503
|
+
// Recursively fetch parent's parent
|
|
504
|
+
await extractParentIds(parentItem);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
// Parent already in cache, recursively process it
|
|
509
|
+
const cachedParent = this.nodeDataCache.get(parentId);
|
|
510
|
+
if (cachedParent) {
|
|
511
|
+
await extractParentIds(cachedParent);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
// Process all items
|
|
519
|
+
for (const item of items) {
|
|
520
|
+
await extractParentIds(item);
|
|
521
|
+
}
|
|
522
|
+
return parentsToExpand;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Collects children IDs for matching search results recursively
|
|
526
|
+
* Adds all descendants (children, grandchildren, etc.) to relevantNodeIds so they appear in the filtered tree
|
|
527
|
+
*/
|
|
528
|
+
async collectChildrenIds(items) {
|
|
529
|
+
if (!this.treeData?.categoryEntityQueryFunc || !this.treeConfig) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
const valueField = this.valueField();
|
|
533
|
+
const parentKey = this.treeData.categoryEntityDef?.parentKey;
|
|
534
|
+
if (!parentKey) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
// For each matching node, recursively fetch all its descendants
|
|
538
|
+
for (const item of items) {
|
|
539
|
+
const nodeId = String(item[valueField] ?? '');
|
|
540
|
+
if (!nodeId || nodeId === ROOT_NODE_ID) {
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
await this.collectChildrenRecursively(nodeId, valueField, parentKey);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Recursively collects all descendant IDs for a given node
|
|
548
|
+
*/
|
|
549
|
+
async collectChildrenRecursively(nodeId, valueField, parentKey) {
|
|
550
|
+
if (!this.treeData?.categoryEntityQueryFunc) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
try {
|
|
554
|
+
// Fetch children for this node
|
|
555
|
+
const event = {
|
|
556
|
+
...this.treeData.basicQueryEvent,
|
|
557
|
+
filter: {
|
|
558
|
+
field: parentKey,
|
|
559
|
+
value: nodeId,
|
|
560
|
+
operator: { type: 'equal' },
|
|
561
|
+
},
|
|
562
|
+
};
|
|
563
|
+
const res = await this.treeData.categoryEntityQueryFunc(event);
|
|
564
|
+
if (res?.items && res.items.length > 0) {
|
|
565
|
+
// Add children IDs to relevantNodeIds so they appear in filtered tree
|
|
566
|
+
for (const child of res.items) {
|
|
567
|
+
const childId = String(child[valueField] ?? '');
|
|
568
|
+
if (childId && childId !== ROOT_NODE_ID) {
|
|
569
|
+
this.relevantNodeIds.add(childId);
|
|
570
|
+
// Cache child data
|
|
571
|
+
this.nodeDataCache.set(childId, child);
|
|
572
|
+
// Recursively fetch children of this child
|
|
573
|
+
await this.collectChildrenRecursively(childId, valueField, parentKey);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
catch (error) {
|
|
579
|
+
console.error(`Error fetching children for node ${nodeId}:`, error);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Fetches a single item by ID from the server
|
|
584
|
+
*/
|
|
585
|
+
async fetchItemById(id) {
|
|
586
|
+
if (!this.treeData?.categoryEntityQueryFunc) {
|
|
587
|
+
return null;
|
|
588
|
+
}
|
|
589
|
+
try {
|
|
590
|
+
const valueField = this.valueField();
|
|
591
|
+
const event = {
|
|
592
|
+
...this.treeData.basicQueryEvent,
|
|
593
|
+
filter: {
|
|
594
|
+
field: valueField,
|
|
595
|
+
value: id,
|
|
596
|
+
operator: { type: 'equal' },
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
const res = await this.treeData.categoryEntityQueryFunc(event);
|
|
600
|
+
return res?.items?.[0] ?? null;
|
|
601
|
+
}
|
|
602
|
+
catch (error) {
|
|
603
|
+
console.error('Error fetching item by ID:', error);
|
|
604
|
+
return null;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Sorts parent IDs by their depth (root first, leaves last)
|
|
609
|
+
* Uses cached data from collectParentIds
|
|
610
|
+
*/
|
|
611
|
+
async sortParentsByDepth(parentIds) {
|
|
612
|
+
const parentKey = this.treeData?.categoryEntityDef?.parentKey;
|
|
613
|
+
if (!parentKey || parentIds.length === 0) {
|
|
614
|
+
return parentIds;
|
|
615
|
+
}
|
|
616
|
+
// Build depth map using cached data
|
|
617
|
+
const depthMap = new Map();
|
|
618
|
+
for (const parentId of parentIds) {
|
|
619
|
+
if (depthMap.has(parentId)) {
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
622
|
+
let depth = 0;
|
|
623
|
+
let currentId = parentId;
|
|
624
|
+
const visited = new Set();
|
|
625
|
+
while (currentId && currentId !== ROOT_NODE_ID && !visited.has(currentId)) {
|
|
626
|
+
visited.add(currentId);
|
|
627
|
+
depth++;
|
|
628
|
+
// Use nodeDataCache which was populated by collectParentIds
|
|
629
|
+
const item = this.nodeDataCache.get(currentId);
|
|
630
|
+
if (item) {
|
|
631
|
+
currentId = item[parentKey] ? String(item[parentKey]) : null;
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
depthMap.set(parentId, depth);
|
|
638
|
+
}
|
|
639
|
+
// Sort by depth (lower depth = closer to root = expand first)
|
|
640
|
+
return parentIds.sort((a, b) => {
|
|
641
|
+
const depthA = depthMap.get(a) ?? 0;
|
|
642
|
+
const depthB = depthMap.get(b) ?? 0;
|
|
643
|
+
return depthA - depthB;
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Updates translated messages for search results
|
|
648
|
+
*/
|
|
649
|
+
async updateTranslatedMessages(resultCount) {
|
|
650
|
+
if (resultCount > 0) {
|
|
651
|
+
const key = resultCount === 1
|
|
652
|
+
? '@general:terms.interface.category.search.results-found.singular'
|
|
653
|
+
: '@general:terms.interface.category.search.results-found.plural';
|
|
654
|
+
const text = await this.translate.translateAsync(key, { params: { count: resultCount } });
|
|
655
|
+
this.resultsFoundText.set(text);
|
|
656
|
+
}
|
|
657
|
+
else {
|
|
658
|
+
this.resultsFoundText.set('');
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Resets search state and restores tree to original expanded state
|
|
663
|
+
*/
|
|
664
|
+
async resetSearch() {
|
|
665
|
+
this.searchResultCount.set(0);
|
|
666
|
+
this.resultsFoundText.set('');
|
|
667
|
+
this.currentSearchTerm = null;
|
|
668
|
+
this.isSearching.set(false);
|
|
669
|
+
this.matchingNodeIds.clear();
|
|
670
|
+
this.relevantNodeIds.clear();
|
|
671
|
+
this.nodeDataCache.clear();
|
|
672
|
+
// Clear highlighting
|
|
673
|
+
this.highlightService.clear();
|
|
674
|
+
const treeComponent = this.tree();
|
|
675
|
+
if (!treeComponent) {
|
|
676
|
+
this.expandedNodesBeforeSearch = [];
|
|
677
|
+
this.nodesExpandedDuringSearch = [];
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
// Reload tree to show all nodes (no filtering)
|
|
681
|
+
await treeComponent.reloadData();
|
|
682
|
+
// Collapse nodes that were expanded during search (in reverse order - leaves first)
|
|
683
|
+
const nodesToCollapse = [...this.nodesExpandedDuringSearch].reverse();
|
|
684
|
+
this.nodesExpandedDuringSearch = [];
|
|
685
|
+
for (const nodeId of nodesToCollapse) {
|
|
686
|
+
// Only collapse if it wasn't originally expanded before search
|
|
687
|
+
if (!this.expandedNodesBeforeSearch.includes(nodeId)) {
|
|
688
|
+
try {
|
|
689
|
+
treeComponent.collapseNode(nodeId);
|
|
690
|
+
}
|
|
691
|
+
catch {
|
|
692
|
+
// Node might not exist anymore, ignore
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
// Clear the stored expanded nodes
|
|
697
|
+
this.expandedNodesBeforeSearch = [];
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Checks if a node matches the current search term
|
|
701
|
+
*/
|
|
702
|
+
isMatchingNode(nodeId) {
|
|
703
|
+
return this.matchingNodeIds.has(nodeId);
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Handles node click events to apply category filters and track selected category for create command
|
|
707
|
+
*/
|
|
708
|
+
handleNodeClick(node) {
|
|
709
|
+
const nodeData = this.extractNodeData(node);
|
|
710
|
+
const applyConditions = this.vm().entityDef.category?.applyConditions || [];
|
|
711
|
+
const valueField = this.valueField();
|
|
712
|
+
const textField = this.textField();
|
|
713
|
+
const nodeId = String(nodeData[valueField] ?? node['id'] ?? '');
|
|
714
|
+
// Track selected category for default category when creating new entities
|
|
715
|
+
if (nodeId === 'all' || !nodeId) {
|
|
716
|
+
this.vm().setSelectedCategory(null);
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
this.vm().setSelectedCategory({
|
|
720
|
+
id: nodeId,
|
|
721
|
+
title: String(nodeData[textField] ?? node['title'] ?? ''),
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
const categoryFilters = this.buildCategoryFilters(nodeData, applyConditions);
|
|
725
|
+
const viewFilters = this.buildViewFilters();
|
|
726
|
+
this.vm().dataSource.filter({
|
|
727
|
+
filters: [...viewFilters, ...categoryFilters],
|
|
728
|
+
logic: 'and',
|
|
729
|
+
});
|
|
730
|
+
this.vm().dataSource.refresh();
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Handles node toggle events (expansion/collapse)
|
|
734
|
+
*/
|
|
735
|
+
async onNodeToggle(_event) {
|
|
736
|
+
// Tree component handles lazy loading via datasource callback
|
|
737
|
+
}
|
|
738
|
+
//#endregion
|
|
739
|
+
//#region ---- CRUD Operations ----
|
|
740
|
+
/**
|
|
741
|
+
* Creates a new root category node (uses Entity:Create command).
|
|
742
|
+
*/
|
|
743
|
+
async handleCreateRootClick(event) {
|
|
744
|
+
this.preventDefaultAndStopPropagation(event);
|
|
745
|
+
try {
|
|
746
|
+
const result = await this.executeCreateCommand(undefined);
|
|
747
|
+
await this.applyCreateResult(result, undefined);
|
|
748
|
+
}
|
|
749
|
+
catch (error) {
|
|
750
|
+
console.error('Error creating root category:', error);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Creates a new child category under the given parent node (uses Entity:Create command).
|
|
755
|
+
*/
|
|
756
|
+
async handleCreateChildClick(node, event) {
|
|
757
|
+
this.preventDefaultAndStopPropagation(event);
|
|
758
|
+
try {
|
|
759
|
+
const parentId = this.extractNodeId(node);
|
|
760
|
+
const result = await this.executeCreateCommand(parentId);
|
|
761
|
+
await this.applyCreateResult(result, parentId);
|
|
762
|
+
}
|
|
763
|
+
catch (error) {
|
|
764
|
+
console.error('Error creating child category:', error);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Updates an existing category node (uses Entity:Update command).
|
|
769
|
+
*/
|
|
770
|
+
async handleEditNodeClick(node, event) {
|
|
771
|
+
this.preventDefaultAndStopPropagation(event);
|
|
772
|
+
try {
|
|
773
|
+
const nodeData = this.extractNodeData(node);
|
|
774
|
+
const result = await this.executeUpdateCommand(nodeData);
|
|
775
|
+
await this.applyUpdateResult(result, node);
|
|
776
|
+
}
|
|
777
|
+
catch (error) {
|
|
778
|
+
console.error('Error editing category:', error);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Deletes a category node
|
|
783
|
+
*/
|
|
784
|
+
async handleDeleteNodeClick(node, event) {
|
|
785
|
+
this.preventDefaultAndStopPropagation(event);
|
|
786
|
+
try {
|
|
787
|
+
const nodeData = this.extractNodeData(node);
|
|
788
|
+
const context = await this.executeDeleteWorkflow(nodeData);
|
|
789
|
+
await this.handleDeleteResult(context, node);
|
|
790
|
+
}
|
|
791
|
+
catch (error) {
|
|
792
|
+
console.error('Error deleting category:', error);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
//#endregion
|
|
796
|
+
//#region ---- Private Tree Management Methods ----
|
|
797
|
+
/**
|
|
798
|
+
* Initializes the category tree data structure
|
|
799
|
+
*/
|
|
800
|
+
async initializeTree() {
|
|
801
|
+
this.setLoadingWithDelay(true);
|
|
802
|
+
try {
|
|
803
|
+
const entityKey = this.categoryEntityKey();
|
|
804
|
+
this.treeConfig = {
|
|
805
|
+
entityKey,
|
|
806
|
+
textField: this.textField(),
|
|
807
|
+
valueField: this.valueField(),
|
|
808
|
+
};
|
|
809
|
+
this.treeData = await this.categoryTreeService.initializeCategoryTree(this.treeConfig);
|
|
810
|
+
if (!this.treeData) {
|
|
811
|
+
this.clearLoadingState();
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
// Set parent key from entity definition
|
|
815
|
+
if (this.treeData.categoryEntityDef?.parentKey) {
|
|
816
|
+
this.treeConfig.parentKey = this.treeData.categoryEntityDef.parentKey;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
catch (error) {
|
|
820
|
+
console.error('Error loading categories:', error);
|
|
821
|
+
}
|
|
822
|
+
finally {
|
|
823
|
+
this.clearLoadingState();
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Loads root nodes for the tree
|
|
828
|
+
*/
|
|
829
|
+
async loadRootNodes() {
|
|
830
|
+
if (!this.isTreeInitialized()) {
|
|
831
|
+
return [];
|
|
832
|
+
}
|
|
833
|
+
// Load root categories
|
|
834
|
+
const items = await this.categoryTreeService.loadRootCategories(this.treeData, this.treeConfig);
|
|
835
|
+
if (!items) {
|
|
836
|
+
return [];
|
|
837
|
+
}
|
|
838
|
+
const rootNode = await this.categoryTreeService.createRootNode(items, this.treeConfig);
|
|
839
|
+
// Filter root's children when search is active
|
|
840
|
+
if (this.relevantNodeIds.size > 0 && rootNode['children']) {
|
|
841
|
+
rootNode['children'] = rootNode['children'].filter((child) => {
|
|
842
|
+
const childId = String(child['id'] ?? '');
|
|
843
|
+
return this.relevantNodeIds.has(childId);
|
|
844
|
+
});
|
|
845
|
+
rootNode['childrenCount'] = rootNode['children'].length;
|
|
846
|
+
}
|
|
847
|
+
return [rootNode];
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Loads child nodes for a given parent ID
|
|
851
|
+
*/
|
|
852
|
+
async loadChildNodes(parentId) {
|
|
853
|
+
if (!this.isTreeInitialized()) {
|
|
854
|
+
return [];
|
|
855
|
+
}
|
|
856
|
+
// Create minimal node object - loadChildren only needs node.id
|
|
857
|
+
const targetNode = {
|
|
858
|
+
id: parentId,
|
|
859
|
+
};
|
|
860
|
+
let children = await this.categoryTreeService.loadChildren(targetNode, this.treeData, this.treeConfig);
|
|
861
|
+
// Filter children when search is active
|
|
862
|
+
if (this.relevantNodeIds.size > 0) {
|
|
863
|
+
children = children.filter((child) => {
|
|
864
|
+
const childId = String(child['id'] ?? '');
|
|
865
|
+
return this.relevantNodeIds.has(childId);
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
return children;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Refreshes the tree view component
|
|
872
|
+
*/
|
|
873
|
+
refreshTree() {
|
|
874
|
+
const treeComponent = this.tree();
|
|
875
|
+
if (treeComponent) {
|
|
876
|
+
treeComponent.refresh();
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Refreshes tree after CRUD operations
|
|
881
|
+
*/
|
|
882
|
+
async refreshAfterChange(parentId) {
|
|
883
|
+
this.refreshTree();
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Adds a new node to the tree after create operation
|
|
887
|
+
*/
|
|
888
|
+
async addNodeToTree(entityData, parentId) {
|
|
889
|
+
if (!this.isTreeInitialized()) {
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
const treeComponent = this.tree();
|
|
893
|
+
if (!treeComponent) {
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
const newNode = this.categoryTreeService.convertToTreeNode(entityData, this.treeConfig);
|
|
897
|
+
if (parentId) {
|
|
898
|
+
await this.addChildNode(treeComponent, parentId, newNode);
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
await this.addRootNode(treeComponent, newNode);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Adds a child node to a parent node
|
|
906
|
+
*/
|
|
907
|
+
async addChildNode(treeComponent, parentId, newNode) {
|
|
908
|
+
const parentNode = treeComponent.findNode(parentId);
|
|
909
|
+
if (!parentNode) {
|
|
910
|
+
await this.refreshAfterChange(parentId);
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
if (!treeComponent.isNodeExpanded(parentId)) {
|
|
914
|
+
await treeComponent.expandNode(parentId);
|
|
915
|
+
}
|
|
916
|
+
treeComponent.addChild(parentId, newNode);
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Adds a root node to the tree
|
|
920
|
+
*/
|
|
921
|
+
async addRootNode(treeComponent, newNode) {
|
|
922
|
+
const rootNode = treeComponent.findNode(ROOT_NODE_ID);
|
|
923
|
+
if (!rootNode) {
|
|
924
|
+
await this.refreshAfterChange();
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
|
|
928
|
+
await treeComponent.expandNode(ROOT_NODE_ID);
|
|
929
|
+
}
|
|
930
|
+
treeComponent.addChild(ROOT_NODE_ID, newNode);
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Updates an existing node in the tree after edit operation
|
|
934
|
+
*/
|
|
935
|
+
async updateNodeInTree(nodeId, entityData) {
|
|
936
|
+
if (!this.isTreeInitialized()) {
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
const treeComponent = this.tree();
|
|
940
|
+
if (!treeComponent) {
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
const existingNode = treeComponent.findNode(nodeId);
|
|
944
|
+
if (!existingNode) {
|
|
945
|
+
await this.refreshNodeParent(entityData);
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
// Check if parent changed
|
|
949
|
+
const parentKey = this.treeData?.categoryEntityDef?.parentKey;
|
|
950
|
+
let newParentId = undefined;
|
|
951
|
+
if (parentKey && entityData[parentKey]) {
|
|
952
|
+
const parentValue = String(entityData[parentKey]);
|
|
953
|
+
// 'all' means root, so treat it as undefined
|
|
954
|
+
newParentId = parentValue !== 'all' && parentValue !== '' ? parentValue : undefined;
|
|
955
|
+
}
|
|
956
|
+
const currentParent = treeComponent.getParent(nodeId);
|
|
957
|
+
const currentParentId = currentParent ? String(currentParent['id'] ?? '') : undefined;
|
|
958
|
+
// Normalize current parent: 'all' means root (undefined)
|
|
959
|
+
const normalizedCurrentParentId = currentParentId === 'all' || currentParentId === '' ? undefined : currentParentId;
|
|
960
|
+
// Handle parent change: move node to new parent if parent changed
|
|
961
|
+
if (newParentId !== normalizedCurrentParentId) {
|
|
962
|
+
// If parent changed, move the node first
|
|
963
|
+
const moved = treeComponent.moveNode(nodeId, newParentId);
|
|
964
|
+
if (!moved) {
|
|
965
|
+
// If move failed, refresh the tree to ensure consistency
|
|
966
|
+
await this.refreshNodeParent(entityData);
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
// After moving, we need to ensure the new parent is expanded
|
|
970
|
+
if (newParentId) {
|
|
971
|
+
if (!treeComponent.isNodeExpanded(newParentId)) {
|
|
972
|
+
await treeComponent.expandNode(newParentId);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
else {
|
|
976
|
+
// Moving to root - ensure root is expanded
|
|
977
|
+
if (!treeComponent.isNodeExpanded(ROOT_NODE_ID)) {
|
|
978
|
+
await treeComponent.expandNode(ROOT_NODE_ID);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
// Update node properties (title, data, etc.)
|
|
983
|
+
const updatedNode = this.categoryTreeService.convertToTreeNode(entityData, this.treeConfig);
|
|
984
|
+
const updates = {
|
|
985
|
+
['title']: updatedNode['title'],
|
|
986
|
+
['data']: updatedNode['data'],
|
|
987
|
+
['childrenCount']: updatedNode['childrenCount'],
|
|
988
|
+
['icon']: updatedNode['icon'],
|
|
989
|
+
};
|
|
990
|
+
treeComponent.editNode(nodeId, updates);
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Removes a node from the tree after delete operation
|
|
994
|
+
*/
|
|
995
|
+
async removeNodeFromTree(nodeId) {
|
|
996
|
+
const treeComponent = this.tree();
|
|
997
|
+
if (!treeComponent) {
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
const nodeToDelete = treeComponent.findNode(nodeId);
|
|
1001
|
+
if (!nodeToDelete) {
|
|
1002
|
+
await this.refreshAfterChange();
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
treeComponent.removeNode(nodeId);
|
|
1006
|
+
}
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region ---- Entity CRUD (Commands) ----
|
|
1009
|
+
/**
|
|
1010
|
+
* Executes Entity:Create command for category (standard command-based create).
|
|
1011
|
+
*/
|
|
1012
|
+
async executeCreateCommand(parentId) {
|
|
1013
|
+
const entityKey = this.categoryEntityKey();
|
|
1014
|
+
const [moduleName, entityName] = entityKey.split('.');
|
|
1015
|
+
const entityRef = await this.entityRegistry.resolve(moduleName, entityName);
|
|
1016
|
+
const data = {};
|
|
1017
|
+
if (parentId && this.treeData?.categoryEntityDef?.parentKey) {
|
|
1018
|
+
data[this.treeData.categoryEntityDef.parentKey] = parentId;
|
|
1019
|
+
}
|
|
1020
|
+
const createCategoryTitle = await this.translate.translateAsync('@general:actions.create-category.title');
|
|
1021
|
+
const result = await this.commandService.execute('Entity:Create', {
|
|
1022
|
+
__context__: {
|
|
1023
|
+
entity: entityKey,
|
|
1024
|
+
entityInfo: {
|
|
1025
|
+
name: entityRef.name,
|
|
1026
|
+
module: entityRef.module,
|
|
1027
|
+
title: entityRef.title ?? entityRef.formats?.individual ?? '',
|
|
1028
|
+
parentKey: entityRef.parentKey,
|
|
1029
|
+
},
|
|
1030
|
+
data: Object.keys(data).length > 0 ? data : undefined,
|
|
1031
|
+
options: {
|
|
1032
|
+
process: { redirect: false, canCreateNewOne: !!parentId },
|
|
1033
|
+
decoration: { header: { title: createCategoryTitle } },
|
|
1034
|
+
},
|
|
1035
|
+
},
|
|
1036
|
+
});
|
|
1037
|
+
return result ?? { success: false };
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Executes Entity:Update command for category (standard command-based update).
|
|
1041
|
+
*/
|
|
1042
|
+
async executeUpdateCommand(nodeData) {
|
|
1043
|
+
const entityKey = this.categoryEntityKey();
|
|
1044
|
+
const [moduleName, entityName] = entityKey.split('.');
|
|
1045
|
+
const entityRef = await this.entityRegistry.resolve(moduleName, entityName);
|
|
1046
|
+
const result = await this.commandService.execute('Entity:Update', {
|
|
1047
|
+
__context__: {
|
|
1048
|
+
entity: entityKey,
|
|
1049
|
+
entityInfo: {
|
|
1050
|
+
name: entityRef.name,
|
|
1051
|
+
module: entityRef.module,
|
|
1052
|
+
title: entityRef.title ?? entityRef.formats?.individual ?? '',
|
|
1053
|
+
parentKey: entityRef.parentKey,
|
|
1054
|
+
},
|
|
1055
|
+
data: nodeData,
|
|
1056
|
+
options: { layout: { size: 'md' } },
|
|
1057
|
+
},
|
|
1058
|
+
});
|
|
1059
|
+
return result ?? { success: false };
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Applies create command result to the tree (add node or refresh).
|
|
1063
|
+
*/
|
|
1064
|
+
async applyCreateResult(result, parentId) {
|
|
1065
|
+
if (!result.success || !this.isTreeInitialized()) {
|
|
1066
|
+
await this.refreshAfterChange(parentId);
|
|
1067
|
+
return;
|
|
1068
|
+
}
|
|
1069
|
+
const newEntityData = result.data;
|
|
1070
|
+
if (newEntityData) {
|
|
1071
|
+
await this.addNodeToTree(newEntityData, parentId);
|
|
1072
|
+
}
|
|
1073
|
+
else {
|
|
1074
|
+
await this.refreshAfterChange(parentId);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Applies update command result to the tree (update node or refresh).
|
|
1079
|
+
*/
|
|
1080
|
+
async applyUpdateResult(result, node) {
|
|
1081
|
+
if (!result.success || !this.isTreeInitialized()) {
|
|
1082
|
+
await this.refreshNodeParent(this.extractNodeData(node));
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
const updatedEntityData = result.data;
|
|
1086
|
+
if (updatedEntityData) {
|
|
1087
|
+
await this.updateNodeInTree(this.extractNodeId(node), updatedEntityData);
|
|
1088
|
+
}
|
|
1089
|
+
else {
|
|
1090
|
+
await this.refreshNodeParent(this.extractNodeData(node));
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
//#endregion
|
|
1094
|
+
//#region ---- Delete (Workflow) ----
|
|
1095
|
+
/**
|
|
1096
|
+
* Executes delete-entity workflow (platform has no Entity:Delete command).
|
|
1097
|
+
*/
|
|
1098
|
+
async executeDeleteWorkflow(nodeData) {
|
|
1099
|
+
return await this.workflow.execute('delete-entity', {
|
|
1100
|
+
entity: this.categoryEntityKey(),
|
|
1101
|
+
data: nodeData,
|
|
1102
|
+
options: { process: { showResult: true } },
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Handles the result of a delete operation
|
|
1107
|
+
*/
|
|
1108
|
+
async handleDeleteResult(context, node) {
|
|
1109
|
+
const result = context.getOutput('result');
|
|
1110
|
+
if (result) {
|
|
1111
|
+
await this.removeNodeFromTree(this.extractNodeId(node));
|
|
1112
|
+
}
|
|
1113
|
+
else {
|
|
1114
|
+
await this.refreshNodeParent(this.extractNodeData(node));
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
//#endregion
|
|
1118
|
+
//#region ---- Utility Methods ----
|
|
1119
|
+
/**
|
|
1120
|
+
* Checks if tree data and config are initialized
|
|
1121
|
+
*/
|
|
1122
|
+
isTreeInitialized() {
|
|
1123
|
+
return !!(this.treeData && this.treeConfig);
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* Extracts node data from a tree node
|
|
1127
|
+
*/
|
|
1128
|
+
extractNodeData(node) {
|
|
1129
|
+
return (node['data'] || node);
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Extracts node ID from a tree node
|
|
1133
|
+
*/
|
|
1134
|
+
extractNodeId(node) {
|
|
1135
|
+
return String(node['id'] ?? '');
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* Builds category filters from node data and apply conditions
|
|
1139
|
+
*/
|
|
1140
|
+
buildCategoryFilters(nodeData, applyConditions) {
|
|
1141
|
+
return applyConditions
|
|
1142
|
+
.map((condition) => {
|
|
1143
|
+
const value = nodeData[condition.value];
|
|
1144
|
+
if (value === 'all' || value == null) {
|
|
1145
|
+
return null;
|
|
1146
|
+
}
|
|
1147
|
+
return {
|
|
1148
|
+
field: condition.name,
|
|
1149
|
+
value,
|
|
1150
|
+
operator: condition.operator,
|
|
1151
|
+
};
|
|
1152
|
+
})
|
|
1153
|
+
.filter((item) => item !== null);
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Builds view filters from view conditions
|
|
1157
|
+
*/
|
|
1158
|
+
buildViewFilters() {
|
|
1159
|
+
return this.vm()
|
|
1160
|
+
.view()
|
|
1161
|
+
.conditions.map((condition) => ({ ...condition, field: condition.name }));
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* Refreshes the parent node of the given entity data
|
|
1165
|
+
*/
|
|
1166
|
+
async refreshNodeParent(entityData) {
|
|
1167
|
+
const parentKey = this.treeData?.categoryEntityDef?.parentKey;
|
|
1168
|
+
const parentId = parentKey && entityData[parentKey] ? entityData[parentKey] : undefined;
|
|
1169
|
+
await this.refreshAfterChange(parentId);
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Prevents default behavior and stops event propagation
|
|
1173
|
+
*/
|
|
1174
|
+
preventDefaultAndStopPropagation(event) {
|
|
1175
|
+
event.nativeEvent.preventDefault();
|
|
1176
|
+
event.nativeEvent.stopPropagation();
|
|
1177
|
+
}
|
|
1178
|
+
//#endregion
|
|
1179
|
+
//#region ---- Loading State Management ----
|
|
1180
|
+
/**
|
|
1181
|
+
* Sets loading state with delay to avoid flickering for fast responses
|
|
1182
|
+
*/
|
|
1183
|
+
setLoadingWithDelay(loading) {
|
|
1184
|
+
if (!loading) {
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
if (this.loadingTimeoutId) {
|
|
1188
|
+
clearTimeout(this.loadingTimeoutId);
|
|
1189
|
+
}
|
|
1190
|
+
this.loadingTimeoutId = setTimeout(() => {
|
|
1191
|
+
this.isLoading.set(true);
|
|
1192
|
+
this.loadingTimeoutId = null;
|
|
1193
|
+
}, LOADING_DELAY_MS);
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* Clears loading state and cancels any pending timeout
|
|
1197
|
+
*/
|
|
1198
|
+
clearLoadingState() {
|
|
1199
|
+
if (this.loadingTimeoutId) {
|
|
1200
|
+
clearTimeout(this.loadingTimeoutId);
|
|
1201
|
+
this.loadingTimeoutId = null;
|
|
1202
|
+
}
|
|
1203
|
+
this.isLoading.set(false);
|
|
1204
|
+
}
|
|
1205
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1206
|
+
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\n (onValueChanged)=\"handleCategorySearchChange($event)\"\n [delayTime]=\"300\"\n [placeholder]=\"'@general:terms.interface.category.search.placeholder' | translate | async\"\n >\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\n 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 >\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\n [datasource]=\"datasource\"\n [selectMode]=\"selectMode()\"\n [selectionBehavior]=\"selectionBehavior()\"\n [dragArea]=\"dragArea()\"\n [dragBehavior]=\"dragBehavior()\"\n [showIcons]=\"showIcons()\"\n [showChildrenBadge]=\"showChildrenBadge()\"\n [expandedIcon]=\"expandedIcon()\"\n [collapsedIcon]=\"collapsedIcon()\"\n [indentSize]=\"indentSize()\"\n [look]=\"look()\"\n [titleField]=\"textField()\"\n [idField]=\"valueField()\"\n [expandOnDoubleClick]=\"true\"\n [nodeTemplate]=\"itemTemplate\"\n (onNodeToggle)=\"onNodeToggle($event)\"\n (onNodeClick)=\"handleNodeClick($event.node)\"\n #tree\n >\n </ax-tree-view>\n </div>\n } @else {\n <div class=\"__empty-state\">\n <axp-state-message\n 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 >\n @if (!categoryReadonly()) {\n <ax-button\n slot=\"actions\"\n (onClick)=\"handleCreateRootClick($event)\"\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.add-new.title' | translate | async\"\n >\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 | translate | async;\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\n class=\"fas fa-folder\"\n [style.color]=\"item.color ?? 'rgba(var(--ax-sys-color-warning-500), 1)'\"\n ></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\n (onClick)=\"handleCreateChildClick(node, $event)\"\n look=\"blank\"\n color=\"default\"\n [text]=\"('@general:actions.add-new-child.title' | translate | async)!\"\n >\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button-item>\n <ax-button-item\n (onClick)=\"handleEditNodeClick(node, $event)\"\n look=\"blank\"\n [text]=\"('@general:actions.edit.title' | translate | async)!\"\n >\n <ax-icon class=\"fas fa-pen\"></ax-icon>\n </ax-button-item>\n <ax-button-item\n (onClick)=\"handleDeleteNodeClick(node, $event)\"\n color=\"danger\"\n look=\"blank\"\n [text]=\"('@general:actions.delete.title' | translate | async)!\"\n >\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>\n", 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", "look"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1207
|
+
}
|
|
1208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityCategoryComponent, decorators: [{
|
|
1209
|
+
type: Component,
|
|
1210
|
+
args: [{ selector: 'axp-entity-category', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
|
|
1211
|
+
CommonModule,
|
|
1212
|
+
AXDecoratorModule,
|
|
1213
|
+
AXTreeViewModule,
|
|
1214
|
+
AXTreeViewComponent,
|
|
1215
|
+
AXSkeletonModule,
|
|
1216
|
+
AXPThemeLayoutBlockComponent,
|
|
1217
|
+
AXSearchBoxModule,
|
|
1218
|
+
AXPThemeLayoutHeaderComponent,
|
|
1219
|
+
AXPThemeLayoutToolbarComponent,
|
|
1220
|
+
AXTranslationModule,
|
|
1221
|
+
AXButtonModule,
|
|
1222
|
+
AXDropdownModule,
|
|
1223
|
+
AXPStateMessageComponent,
|
|
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\n (onValueChanged)=\"handleCategorySearchChange($event)\"\n [delayTime]=\"300\"\n [placeholder]=\"'@general:terms.interface.category.search.placeholder' | translate | async\"\n >\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\n 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 >\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\n [datasource]=\"datasource\"\n [selectMode]=\"selectMode()\"\n [selectionBehavior]=\"selectionBehavior()\"\n [dragArea]=\"dragArea()\"\n [dragBehavior]=\"dragBehavior()\"\n [showIcons]=\"showIcons()\"\n [showChildrenBadge]=\"showChildrenBadge()\"\n [expandedIcon]=\"expandedIcon()\"\n [collapsedIcon]=\"collapsedIcon()\"\n [indentSize]=\"indentSize()\"\n [look]=\"look()\"\n [titleField]=\"textField()\"\n [idField]=\"valueField()\"\n [expandOnDoubleClick]=\"true\"\n [nodeTemplate]=\"itemTemplate\"\n (onNodeToggle)=\"onNodeToggle($event)\"\n (onNodeClick)=\"handleNodeClick($event.node)\"\n #tree\n >\n </ax-tree-view>\n </div>\n } @else {\n <div class=\"__empty-state\">\n <axp-state-message\n 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 >\n @if (!categoryReadonly()) {\n <ax-button\n slot=\"actions\"\n (onClick)=\"handleCreateRootClick($event)\"\n look=\"solid\"\n color=\"primary\"\n [text]=\"'@general:actions.add-new.title' | translate | async\"\n >\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 | translate | async;\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\n class=\"fas fa-folder\"\n [style.color]=\"item.color ?? 'rgba(var(--ax-sys-color-warning-500), 1)'\"\n ></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\n (onClick)=\"handleCreateChildClick(node, $event)\"\n look=\"blank\"\n color=\"default\"\n [text]=\"('@general:actions.add-new-child.title' | translate | async)!\"\n >\n <ax-icon class=\"fas fa-plus\"></ax-icon>\n </ax-button-item>\n <ax-button-item\n (onClick)=\"handleEditNodeClick(node, $event)\"\n look=\"blank\"\n [text]=\"('@general:actions.edit.title' | translate | async)!\"\n >\n <ax-icon class=\"fas fa-pen\"></ax-icon>\n </ax-button-item>\n <ax-button-item\n (onClick)=\"handleDeleteNodeClick(node, $event)\"\n color=\"danger\"\n look=\"blank\"\n [text]=\"('@general:actions.delete.title' | translate | async)!\"\n >\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>\n" }]
|
|
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) => ({
|
|
1277
|
+
name: s.name,
|
|
1278
|
+
dir: s.dir,
|
|
1279
|
+
})), ...(ngDevMode ? [{ debugName: "sortQueries" }] : /* istanbul ignore next */ []));
|
|
1280
|
+
this.sortDefinitions = computed(() => this.vm.sortableFields().map((s) => ({
|
|
1281
|
+
name: s.name,
|
|
1282
|
+
title: s.title,
|
|
1283
|
+
dir: s.dir,
|
|
1284
|
+
})), ...(ngDevMode ? [{ debugName: "sortDefinitions" }] : /* istanbul ignore next */ []));
|
|
1285
|
+
}
|
|
1286
|
+
async ngOnInit() {
|
|
1287
|
+
// Prefer saved settings (view/columns/sorts/filters) if available, then apply
|
|
1288
|
+
await this.loadSettings();
|
|
1289
|
+
await this.vm.setView();
|
|
1290
|
+
await this.vm.ensureListPagingResolved();
|
|
1291
|
+
this.filtersDefinitions.set(this.vm.filtersDef);
|
|
1292
|
+
this.isInitializing = true;
|
|
1293
|
+
// this.pendingInitialFilters = true;
|
|
1294
|
+
// this.pendingInitialSorts = true;
|
|
1295
|
+
this.setInitialFiltersFromSettingsOrView();
|
|
1296
|
+
// Ensure initial load even when filters/sorts are absent
|
|
1297
|
+
setTimeout(() => {
|
|
1298
|
+
this.isInitializing = false;
|
|
1299
|
+
this.scheduleApply();
|
|
1300
|
+
}, 0);
|
|
1301
|
+
}
|
|
1302
|
+
async loadSettings() {
|
|
1303
|
+
const filterTriggerMode = await this.settingsService.get(AXPCommonSettings.EntityFilterApplyMode);
|
|
1304
|
+
this.filterTriggerMode = (filterTriggerMode?.value ?? 'auto');
|
|
1305
|
+
}
|
|
1306
|
+
scheduleApply() {
|
|
1307
|
+
clearTimeout(this.applyTimer);
|
|
1308
|
+
this.applyTimer = setTimeout(() => {
|
|
1309
|
+
this.vm.applyFilterAndSort();
|
|
1310
|
+
}, 50);
|
|
1311
|
+
}
|
|
1312
|
+
async onViewChanged(view) {
|
|
1313
|
+
await this.vm.setView(view.name);
|
|
1314
|
+
// Sync query param immediately on tab change
|
|
1315
|
+
this.router.navigate([], {
|
|
1316
|
+
relativeTo: this.activeRoute,
|
|
1317
|
+
queryParams: { view: view.name },
|
|
1318
|
+
queryParamsHandling: 'merge',
|
|
1319
|
+
replaceUrl: true,
|
|
1320
|
+
});
|
|
1321
|
+
this.isInitializing = true;
|
|
1322
|
+
this.pendingInitialFilters = true;
|
|
1323
|
+
this.pendingInitialSorts = true;
|
|
1324
|
+
this.setInitialFiltersFromSettingsOrView();
|
|
1325
|
+
// Ensure initial load after view change
|
|
1326
|
+
setTimeout(() => {
|
|
1327
|
+
this.isInitializing = false;
|
|
1328
|
+
this.scheduleApply();
|
|
1329
|
+
}, 0);
|
|
1330
|
+
}
|
|
1331
|
+
#effect;
|
|
1332
|
+
setInitialFiltersFromSettingsOrView() {
|
|
1333
|
+
const saved = this.vm.filterQueries();
|
|
1334
|
+
this.previousFilterQueries.set(saved);
|
|
1335
|
+
const viewConditions = this.vm.view().conditions.map((c) => c.name);
|
|
1336
|
+
if (saved && saved.length) {
|
|
1337
|
+
this.initialFilters.set(saved.map((s) => ({ ...s, hidden: viewConditions.includes(s.field) })));
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
this.initialFilters.set(this.vm.view().conditions.map((c) => ({
|
|
1341
|
+
field: c.name,
|
|
1342
|
+
operator: c.operator,
|
|
1343
|
+
value: c.value,
|
|
1344
|
+
hidden: true,
|
|
1345
|
+
})));
|
|
1346
|
+
}
|
|
1347
|
+
onFiltersChanged(filters) {
|
|
1348
|
+
if (this.isInitializing || this.pendingInitialFilters) {
|
|
1349
|
+
this.pendingInitialFilters = false;
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
this.vm.filterQueries.set(filters);
|
|
1353
|
+
if (this.filterTriggerMode === 'auto') {
|
|
1354
|
+
this.applyFilters();
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
applyFilters() {
|
|
1358
|
+
this.previousFilterQueries.set(this.vm.filterQueries());
|
|
1359
|
+
this.vm.saveSettings('filters', this.vm.filterQueries());
|
|
1360
|
+
this.scheduleApply();
|
|
1361
|
+
}
|
|
1362
|
+
onSortQueriesChange(e) {
|
|
1363
|
+
if (this.isInitializing || this.pendingInitialSorts) {
|
|
1364
|
+
this.pendingInitialSorts = false;
|
|
1365
|
+
return;
|
|
1366
|
+
}
|
|
1367
|
+
this.vm.sortedFields.set(e.map((s) => ({
|
|
1368
|
+
name: s.name,
|
|
1369
|
+
title: s.name,
|
|
1370
|
+
dir: s.dir,
|
|
1371
|
+
})));
|
|
1372
|
+
// Persist sorts per module/entity/view
|
|
1373
|
+
this.vm.saveSettings('sorts', e);
|
|
1374
|
+
this.scheduleApply();
|
|
1375
|
+
}
|
|
1376
|
+
onColumnsChange(columns) {
|
|
1377
|
+
const keyOf = (c) => c.column?.options?.dataPath ?? c.name;
|
|
1378
|
+
this.vm.columns.update((prev) => {
|
|
1379
|
+
const byKey = new Map(prev.map((c) => [keyOf(c), c]));
|
|
1380
|
+
return columns.map((newColumn) => {
|
|
1381
|
+
const existing = byKey.get(keyOf(newColumn));
|
|
1382
|
+
if (!existing) {
|
|
1383
|
+
return null;
|
|
1384
|
+
}
|
|
1385
|
+
return new AXPEntityListViewColumnViewModel(existing.property, {
|
|
1386
|
+
...existing.column,
|
|
1387
|
+
options: {
|
|
1388
|
+
...existing.column.options,
|
|
1389
|
+
visible: newColumn.visible,
|
|
1390
|
+
},
|
|
1391
|
+
});
|
|
1392
|
+
}).filter((c) => c != null);
|
|
1393
|
+
});
|
|
1394
|
+
// Persist column order/visibility
|
|
1395
|
+
this.vm.onColumnsChanged(this.vm.columns());
|
|
1396
|
+
// Use debounced apply to avoid triple refresh when combined with sorts/filters
|
|
1397
|
+
// this.scheduleApply();
|
|
1398
|
+
}
|
|
1399
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1400
|
+
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 }); }
|
|
1401
|
+
}
|
|
1402
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityMasterToolbarViewComponent, decorators: [{
|
|
1403
|
+
type: Component,
|
|
1404
|
+
args: [{ selector: 'axp-entity-master-toolbar-view', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
1405
|
+
CommonModule,
|
|
1406
|
+
AXButtonModule,
|
|
1407
|
+
AXDecoratorModule,
|
|
1408
|
+
AXTranslationModule,
|
|
1409
|
+
AXPQueryFiltersComponent,
|
|
1410
|
+
AXPopoverModule,
|
|
1411
|
+
AXPQuerySortsComponent,
|
|
1412
|
+
AXPQueryViewsComponent,
|
|
1413
|
+
AXPQueryColumnsComponent,
|
|
1414
|
+
], host: {
|
|
1415
|
+
class: 'ax-w-full',
|
|
1416
|
+
}, 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" }]
|
|
1417
|
+
}], propDecorators: { vm: [{
|
|
1418
|
+
type: Input,
|
|
1419
|
+
args: ['viewModel']
|
|
1420
|
+
}] } });
|
|
1421
|
+
|
|
1422
|
+
class AXPEntityMasterListViewComponent extends AXPPageLayoutBaseComponent {
|
|
1423
|
+
constructor(platform) {
|
|
1424
|
+
super();
|
|
1425
|
+
this.platform = platform;
|
|
1426
|
+
this.activeRoute = inject(ActivatedRoute);
|
|
1427
|
+
this.router = inject(Router);
|
|
1428
|
+
this.vm = this.activeRoute.snapshot.data['vm'];
|
|
1429
|
+
//
|
|
1430
|
+
this.store = inject(AXPLayoutThemeService);
|
|
1431
|
+
//
|
|
1432
|
+
this.searchBarShown = signal(true, ...(ngDevMode ? [{ debugName: "searchBarShown" }] : /* istanbul ignore next */ []));
|
|
1433
|
+
this.activeEndSideView = signal('column', ...(ngDevMode ? [{ debugName: "activeEndSideView" }] : /* istanbul ignore next */ []));
|
|
1434
|
+
this.categorySearchValue = signal('', ...(ngDevMode ? [{ debugName: "categorySearchValue" }] : /* istanbul ignore next */ []));
|
|
1435
|
+
// @ViewChild('grid', { static: true}) grid: AXDataTableComponent;
|
|
1436
|
+
this.grid = viewChild('grid', ...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
1437
|
+
this.initializedFromRoute = false;
|
|
1438
|
+
this.lastEvaluatedViewName = null;
|
|
1439
|
+
this.componentDestroyed = new Subject();
|
|
1440
|
+
this.isRestoringExpandedRows = false;
|
|
1441
|
+
this.restoreExpandedRowsScheduled = false;
|
|
1442
|
+
this.commandRowItems = computed(() => {
|
|
1443
|
+
return this.vm.primaryRowActions().map((c) => {
|
|
1444
|
+
return {
|
|
1445
|
+
icon: c.icon,
|
|
1446
|
+
name: c.name,
|
|
1447
|
+
text: translateSync(c.title),
|
|
1448
|
+
color: c.color,
|
|
1449
|
+
disabled: c.disabled,
|
|
1450
|
+
default: c.default,
|
|
1451
|
+
};
|
|
1452
|
+
});
|
|
1453
|
+
}, ...(ngDevMode ? [{ debugName: "commandRowItems" }] : /* istanbul ignore next */ []));
|
|
1454
|
+
this.getDropdownRowItems = (rowData) => {
|
|
1455
|
+
return Promise.resolve(this.dropdownRowItems(rowData));
|
|
1456
|
+
};
|
|
1457
|
+
this.getCommandRowItems = () => {
|
|
1458
|
+
return this.commandRowItems();
|
|
1459
|
+
};
|
|
1460
|
+
effect(() => {
|
|
1461
|
+
if (this.grid()) {
|
|
1462
|
+
this.grid().selectedRows = this.vm.selectedItems();
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
//
|
|
1466
|
+
this.vm.events$.subscribe(async (e) => {
|
|
1467
|
+
const refreshTargetId = e.meta?.refreshTargetId;
|
|
1468
|
+
const resetPagination = e.meta?.resetPagination === true;
|
|
1469
|
+
if (e.action == 'refresh') {
|
|
1470
|
+
if (refreshTargetId) {
|
|
1471
|
+
await this.grid()?.refreshItemChildren(refreshTargetId);
|
|
1472
|
+
this.updateParentHasChildAfterRefresh(refreshTargetId);
|
|
1473
|
+
}
|
|
1474
|
+
else {
|
|
1475
|
+
if (!resetPagination) {
|
|
1476
|
+
await this.vm.ensureListPagingResolved();
|
|
1477
|
+
this.vm.applyPagingToDataSourceWithoutLoad();
|
|
1478
|
+
}
|
|
1479
|
+
this.grid()?.refresh({
|
|
1480
|
+
reset: resetPagination,
|
|
1481
|
+
});
|
|
1482
|
+
if (!resetPagination) {
|
|
1483
|
+
this.scheduleSyncGridPagerUi();
|
|
1484
|
+
}
|
|
1485
|
+
this.scheduleRestoreExpandedRows();
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
// Keep URL query param `view` in sync with current vm view
|
|
1490
|
+
effect(() => {
|
|
1491
|
+
if (!this.initializedFromRoute) {
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
const currentViewName = this.vm.view().name;
|
|
1495
|
+
const urlView = this.activeRoute.snapshot.queryParamMap.get('view');
|
|
1496
|
+
if (currentViewName && currentViewName !== urlView) {
|
|
1497
|
+
this.router.navigate([], {
|
|
1498
|
+
relativeTo: this.activeRoute,
|
|
1499
|
+
queryParams: { view: currentViewName },
|
|
1500
|
+
queryParamsHandling: 'merge',
|
|
1501
|
+
replaceUrl: true,
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
// Recompute page actions/title/etc. when view changes (expressions may depend on list.view()).
|
|
1506
|
+
effect(() => {
|
|
1507
|
+
const currentViewName = this.vm.view().name;
|
|
1508
|
+
if (!this.initializedFromRoute) {
|
|
1509
|
+
this.lastEvaluatedViewName = currentViewName;
|
|
1510
|
+
return;
|
|
1511
|
+
}
|
|
1512
|
+
if (this.lastEvaluatedViewName !== currentViewName) {
|
|
1513
|
+
this.lastEvaluatedViewName = currentViewName;
|
|
1514
|
+
this.recompute();
|
|
1515
|
+
this.scheduleRestoreExpandedRows();
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
async ngOnInit() {
|
|
1520
|
+
// React to external URL changes (back/forward navigation or deep links)
|
|
1521
|
+
this.queryParamSub = this.activeRoute.queryParamMap.subscribe(async (qp) => {
|
|
1522
|
+
const viewFromUrl = qp.get('view');
|
|
1523
|
+
await this.vm.setView(viewFromUrl);
|
|
1524
|
+
this.scheduleRestoreExpandedRows();
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
async ngAfterViewInit() {
|
|
1528
|
+
const viewFromUrl = this.activeRoute.snapshot.queryParamMap.get('view');
|
|
1529
|
+
await this.vm.setView(viewFromUrl);
|
|
1530
|
+
const resolvedView = this.vm.view().name;
|
|
1531
|
+
const currentUrlView = this.activeRoute.snapshot.queryParamMap.get('view');
|
|
1532
|
+
if (currentUrlView !== resolvedView) {
|
|
1533
|
+
this.router.navigate([], {
|
|
1534
|
+
relativeTo: this.activeRoute,
|
|
1535
|
+
queryParams: { view: resolvedView },
|
|
1536
|
+
queryParamsHandling: 'merge',
|
|
1537
|
+
replaceUrl: true,
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
this.initializedFromRoute = true;
|
|
1541
|
+
this.bindExpandedRowPersistence();
|
|
1542
|
+
this.scheduleRestoreExpandedRows();
|
|
1543
|
+
}
|
|
1544
|
+
onColumnSizeChanged(e) {
|
|
1545
|
+
if (e.isUserInteraction && e.type === 'end') {
|
|
1546
|
+
this.vm.saveSettings('columnSizes', e.data);
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
onPageChanged(e) {
|
|
1550
|
+
if (e.isUserInteraction && !this.vm.skipListPagingPersistence) {
|
|
1551
|
+
this.vm.saveListPaging(e.take, e.skip);
|
|
1552
|
+
}
|
|
1553
|
+
this.scheduleRestoreExpandedRows();
|
|
1554
|
+
}
|
|
1555
|
+
onColumnsOrderChanged(e) {
|
|
1556
|
+
if (e.isUserInteraction) {
|
|
1557
|
+
this.vm.onColumnsOrderChanged(e.data.event);
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
async dropdownRowItems(rowData) {
|
|
1561
|
+
return (await this.vm.secondaryRowActions(rowData)).map((c) => ({
|
|
1562
|
+
icon: c.icon,
|
|
1563
|
+
name: c.name,
|
|
1564
|
+
text: c.title,
|
|
1565
|
+
color: c.color,
|
|
1566
|
+
disabled: c.disabled,
|
|
1567
|
+
default: c.default,
|
|
1568
|
+
divided: c.separated,
|
|
1569
|
+
}));
|
|
1570
|
+
}
|
|
1571
|
+
async handleRowDbClick(e) {
|
|
1572
|
+
if (this.grid()?.dataSource.isLoading) {
|
|
1573
|
+
return;
|
|
1574
|
+
}
|
|
1575
|
+
const allItems = [...this.commandRowItems(), ...(await this.dropdownRowItems(e.data))];
|
|
1576
|
+
// const defaultAction = allItems.find((c) => (c as any).default) || allItems[0];
|
|
1577
|
+
const defaultAction = allItems.find((c) => {
|
|
1578
|
+
const commandName = c.name.split('&')[0];
|
|
1579
|
+
return (c.default || commandName === 'open-entity') && !c.disabled;
|
|
1580
|
+
});
|
|
1581
|
+
if (!defaultAction) {
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
const d = {
|
|
1585
|
+
component: e.component,
|
|
1586
|
+
name: defaultAction.name,
|
|
1587
|
+
data: e.data,
|
|
1588
|
+
};
|
|
1589
|
+
this.handleRowCommandClick(d);
|
|
1590
|
+
}
|
|
1591
|
+
async handleRowCommandClick(e) {
|
|
1592
|
+
if (this.grid()?.dataSource.isLoading) {
|
|
1593
|
+
return;
|
|
1594
|
+
}
|
|
1595
|
+
if (e.setLoading) {
|
|
1596
|
+
e.setLoading(true);
|
|
1597
|
+
}
|
|
1598
|
+
await this.vm.executeCommand(e.name, e.data);
|
|
1599
|
+
if (e.setLoading) {
|
|
1600
|
+
e.setLoading(false);
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
async handleSelectedRowsChange(rows) {
|
|
1604
|
+
this.vm.selectedItems.set(rows);
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* After refreshing a row's children (e.g. when a new child was created), update the parent row's
|
|
1608
|
+
* hasChild so the expand icon is shown. The list query sets hasChild from childrenCount only on
|
|
1609
|
+
* initial load; refreshItemChildren does not re-fetch the parent, so we patch it here.
|
|
1610
|
+
*/
|
|
1611
|
+
updateParentHasChildAfterRefresh(parentId) {
|
|
1612
|
+
const gridRef = this.grid();
|
|
1613
|
+
const ds = gridRef?.dataSource;
|
|
1614
|
+
if (!ds?.cachedItems?.length) {
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
const key = ds.config?.key ?? 'id';
|
|
1618
|
+
const parent = this.findItemById(ds.cachedItems, String(parentId), key);
|
|
1619
|
+
if (parent && typeof parent === 'object') {
|
|
1620
|
+
parent['hasChild'] = true;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
findItemById(items, id, key) {
|
|
1624
|
+
for (const item of items) {
|
|
1625
|
+
if (item && typeof item === 'object' && String(item[key]) === id) {
|
|
1626
|
+
return item;
|
|
1627
|
+
}
|
|
1628
|
+
const rec = item;
|
|
1629
|
+
const metaChildren = rec?.['__meta__']?.['children'];
|
|
1630
|
+
const directChildren = rec?.['children'];
|
|
1631
|
+
const childArr = Array.isArray(metaChildren)
|
|
1632
|
+
? metaChildren
|
|
1633
|
+
: Array.isArray(directChildren)
|
|
1634
|
+
? directChildren
|
|
1635
|
+
: null;
|
|
1636
|
+
if (childArr?.length) {
|
|
1637
|
+
const found = this.findItemById(childArr, id, key);
|
|
1638
|
+
if (found)
|
|
1639
|
+
return found;
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
return null;
|
|
1643
|
+
}
|
|
1644
|
+
makeResponsive(value) {
|
|
1645
|
+
if (this.platform.is('Mobile') || this.platform.is('SM')) {
|
|
1646
|
+
return '';
|
|
1647
|
+
}
|
|
1648
|
+
else {
|
|
1649
|
+
return value;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
toggleSideBar(sideBar) {
|
|
1653
|
+
this.toggleEndSide();
|
|
1654
|
+
if (sideBar) {
|
|
1655
|
+
this.activeEndSideView.set(sideBar);
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
toggleSearchBar() {
|
|
1659
|
+
this.searchBarShown.update((v) => !v);
|
|
1660
|
+
}
|
|
1661
|
+
handleResetClick(sideBar) {
|
|
1662
|
+
switch (sideBar) {
|
|
1663
|
+
case 'filter': {
|
|
1664
|
+
this.vm.resetFilters();
|
|
1665
|
+
break;
|
|
1666
|
+
}
|
|
1667
|
+
case 'sort': {
|
|
1668
|
+
this.vm.resetSorts();
|
|
1669
|
+
break;
|
|
1670
|
+
}
|
|
1671
|
+
case 'column': {
|
|
1672
|
+
this.vm.resetColumns();
|
|
1673
|
+
break;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
// protected handleDiscardClick(sideBar: 'filter' | 'sort' | 'column') {
|
|
1678
|
+
// switch (sideBar) {
|
|
1679
|
+
// case 'filter': {
|
|
1680
|
+
// this.vm.discardFilters();
|
|
1681
|
+
// break;
|
|
1682
|
+
// }
|
|
1683
|
+
// case 'sort': {
|
|
1684
|
+
// this.vm.resetSorts();
|
|
1685
|
+
// break;
|
|
1686
|
+
// }
|
|
1687
|
+
// case 'column': {
|
|
1688
|
+
// this.vm.resetColumns();
|
|
1689
|
+
// break;
|
|
1690
|
+
// }
|
|
1691
|
+
// }
|
|
1692
|
+
// }
|
|
1693
|
+
handleApplyClick(sideBar) {
|
|
1694
|
+
this.vm.applyFilterAndSort();
|
|
1695
|
+
this.toggleEndSide();
|
|
1696
|
+
}
|
|
1697
|
+
ngOnDestroy() {
|
|
1698
|
+
this.componentDestroyed.next();
|
|
1699
|
+
this.componentDestroyed.complete();
|
|
1700
|
+
this.queryParamSub?.unsubscribe();
|
|
1701
|
+
this.vm.destroy();
|
|
1702
|
+
}
|
|
1703
|
+
bindExpandedRowPersistence() {
|
|
1704
|
+
if (!this.vm.parentKey()) {
|
|
1705
|
+
return;
|
|
1706
|
+
}
|
|
1707
|
+
this.vm.dataSource.onItemExpanded.pipe(takeUntil(this.componentDestroyed)).subscribe((event) => {
|
|
1708
|
+
const expandedItem = event?.expandedItem;
|
|
1709
|
+
if (expandedItem && typeof expandedItem === 'object') {
|
|
1710
|
+
this.vm.handleRowExpandChange(expandedItem);
|
|
1711
|
+
}
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
scheduleSyncGridPagerUi() {
|
|
1715
|
+
queueMicrotask(() => {
|
|
1716
|
+
this.syncGridPagerUi();
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
syncGridPagerUi() {
|
|
1720
|
+
const gridRef = this.grid();
|
|
1721
|
+
if (!gridRef) {
|
|
1722
|
+
return;
|
|
1723
|
+
}
|
|
1724
|
+
const pageIndex = getDataSourcePageIndex(this.vm.dataSource);
|
|
1725
|
+
const take = this.vm.dataSource.config.pageSize;
|
|
1726
|
+
const pagerPage = pageIndex + 1;
|
|
1727
|
+
const grid = gridRef;
|
|
1728
|
+
this.vm.skipListPagingPersistence = true;
|
|
1729
|
+
try {
|
|
1730
|
+
if (grid.page() !== pageIndex) {
|
|
1731
|
+
grid.page.set(pageIndex);
|
|
1732
|
+
}
|
|
1733
|
+
grid.pageSize.set(take);
|
|
1734
|
+
const pager = grid.dataPager;
|
|
1735
|
+
if (pager && pager.value !== pagerPage) {
|
|
1736
|
+
pager.goToPage(pagerPage);
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
finally {
|
|
1740
|
+
this.vm.skipListPagingPersistence = false;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
scheduleRestoreExpandedRows() {
|
|
1744
|
+
if (!this.vm.parentKey() || this.restoreExpandedRowsScheduled) {
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1747
|
+
this.restoreExpandedRowsScheduled = true;
|
|
1748
|
+
queueMicrotask(() => {
|
|
1749
|
+
this.restoreExpandedRowsScheduled = false;
|
|
1750
|
+
void this.restoreExpandedRows();
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
async restoreExpandedRows() {
|
|
1754
|
+
if (!this.vm.parentKey() || this.isRestoringExpandedRows) {
|
|
1755
|
+
return;
|
|
1756
|
+
}
|
|
1757
|
+
const expandedRowIds = this.vm.getExpandedRowIds();
|
|
1758
|
+
if (!expandedRowIds.length) {
|
|
1759
|
+
return;
|
|
1760
|
+
}
|
|
1761
|
+
const gridRef = this.grid();
|
|
1762
|
+
if (!gridRef || gridRef.dataSource.isLoading) {
|
|
1763
|
+
return;
|
|
1764
|
+
}
|
|
1765
|
+
const gridWithDisplayedRows = gridRef;
|
|
1766
|
+
const displayedRows = gridWithDisplayedRows.displayedRows?.() ?? [];
|
|
1767
|
+
if (!displayedRows.length) {
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
this.isRestoringExpandedRows = true;
|
|
1771
|
+
this.vm.skipExpandedRowPersistence = true;
|
|
1772
|
+
try {
|
|
1773
|
+
const rowKey = this.vm.dataSource.config?.key ?? 'id';
|
|
1774
|
+
await restoreEntityListExpandedRows({
|
|
1775
|
+
expandedRowIds,
|
|
1776
|
+
rowKey,
|
|
1777
|
+
getDisplayedRows: () => gridWithDisplayedRows.displayedRows?.() ?? [],
|
|
1778
|
+
expandRow: (row) => gridRef.expandRow(row),
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
finally {
|
|
1782
|
+
this.vm.skipExpandedRowPersistence = false;
|
|
1783
|
+
this.isRestoringExpandedRows = false;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
toggleCategoryDrawer() {
|
|
1787
|
+
this.toggleStartSide();
|
|
1788
|
+
}
|
|
1789
|
+
getPageTitle() {
|
|
1790
|
+
return this.vm.title();
|
|
1791
|
+
}
|
|
1792
|
+
async getPageDescription() {
|
|
1793
|
+
const description = this.vm.description();
|
|
1794
|
+
if (description) {
|
|
1795
|
+
return this.translateService.translateAsync(description);
|
|
1796
|
+
}
|
|
1797
|
+
return '';
|
|
1798
|
+
}
|
|
1799
|
+
getPageBreadcrumbs() {
|
|
1800
|
+
return this.vm.beardcrumbs();
|
|
1801
|
+
}
|
|
1802
|
+
async getPrimaryMenuItems() {
|
|
1803
|
+
return (await this.vm.getPrimaryActions())
|
|
1804
|
+
.filter((tr) => !tr.isChild)
|
|
1805
|
+
.map((tr) => ({
|
|
1806
|
+
name: tr.name,
|
|
1807
|
+
title: tr.title,
|
|
1808
|
+
icon: tr.icon,
|
|
1809
|
+
color: tr.color,
|
|
1810
|
+
disabled: tr.disabled,
|
|
1811
|
+
items: tr.items?.map((sub) => ({
|
|
1812
|
+
name: sub.name,
|
|
1813
|
+
title: sub.title,
|
|
1814
|
+
icon: sub.icon,
|
|
1815
|
+
color: sub.color,
|
|
1816
|
+
disabled: sub.disabled,
|
|
1817
|
+
command: {
|
|
1818
|
+
name: sub.name,
|
|
1819
|
+
options: sub.options,
|
|
1820
|
+
metadata: sub.metadata,
|
|
1821
|
+
},
|
|
1822
|
+
})),
|
|
1823
|
+
command: {
|
|
1824
|
+
name: tr.name,
|
|
1825
|
+
options: tr.options,
|
|
1826
|
+
metadata: tr.metadata,
|
|
1827
|
+
},
|
|
1828
|
+
}));
|
|
1829
|
+
}
|
|
1830
|
+
async getSecondaryMenuItems() {
|
|
1831
|
+
return (await this.vm.getSecondaryActions()).map((tr) => ({
|
|
1832
|
+
name: tr.name,
|
|
1833
|
+
title: tr.title,
|
|
1834
|
+
icon: tr.icon,
|
|
1835
|
+
color: tr.color,
|
|
1836
|
+
disabled: tr.disabled,
|
|
1837
|
+
separated: tr.separated,
|
|
1838
|
+
command: {
|
|
1839
|
+
name: tr.name,
|
|
1840
|
+
options: tr.options,
|
|
1841
|
+
metadata: tr.metadata,
|
|
1842
|
+
},
|
|
1843
|
+
}));
|
|
1844
|
+
}
|
|
1845
|
+
async execute(command) {
|
|
1846
|
+
if (command) {
|
|
1847
|
+
this.vm.execute(command);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
handleUnselectAll() {
|
|
1851
|
+
this.vm.selectedItems.set([]);
|
|
1852
|
+
}
|
|
1853
|
+
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 }); }
|
|
1854
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPEntityMasterListViewComponent, isStandalone: true, selector: "axp-entity-master-list", providers: [
|
|
1855
|
+
{
|
|
1856
|
+
provide: AXPPageLayoutBase,
|
|
1857
|
+
useExisting: AXPEntityMasterListViewComponent,
|
|
1858
|
+
},
|
|
1859
|
+
], 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\n id=\"axp-entity-category\"\n class=\"ax-w-80\"\n [vm]=\"vm\"\n [searchValue]=\"categorySearchValue()\"\n ></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\n 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 >\n <span\n >{{ 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\n id=\"axp-entity-table\"\n [allowReordering]=\"true\"\n (onColumnsOrderChanged)=\"onColumnsOrderChanged($event)\"\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 (onColumnSizeChanged)=\"onColumnSizeChanged($event)\"\n (onPageChanged)=\"onPageChanged($event)\"\n >\n @if (vm.showIndexColumn()) {\n <ax-index-column\n id=\"axp-table-col-index\"\n [caption]=\"('@general:terms.common.row-number' | translate | async)!\"\n fixed=\"start\"\n [width]=\"'80px'\"\n [padZero]=\"false\"\n ></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\n [attr.id]=\"'axp-table-col-' + col.name\"\n [expandHandler]=\"$index === 0 && vm.parentKey() ? true : false\"\n [caption]=\"(col.title | translate | async)!\"\n [node]=\"col.node()\"\n [customWidth]=\"col.width\"\n ></axp-widget-column-renderer>\n }\n }\n @if (getCommandRowItems().length) {\n <ax-command-column\n id=\"axp-table-col-commands\"\n fixed=\"end\"\n [width]=\"getCommandRowItems().length * 70 + 'px'\"\n [items]=\"getCommandRowItems()\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-command-column>\n }\n <ax-dropdown-command-column\n id=\"axp-table-col-dropdown-commands\"\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n </ax-data-table>\n </axp-page-content>\n</axp-page-layout>\n", 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:
|
|
1860
|
+
//
|
|
1861
|
+
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:
|
|
1862
|
+
//
|
|
1863
|
+
AXPEntityMasterToolbarViewComponent, selector: "axp-entity-master-toolbar-view", inputs: ["viewModel"] }, { kind: "component", type:
|
|
1864
|
+
//
|
|
1865
|
+
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 }); }
|
|
1866
|
+
}
|
|
1867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityMasterListViewComponent, decorators: [{
|
|
1868
|
+
type: Component,
|
|
1869
|
+
args: [{ selector: 'axp-entity-master-list', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1870
|
+
CommonModule,
|
|
1871
|
+
FormsModule,
|
|
1872
|
+
RouterModule,
|
|
1873
|
+
AXButtonModule,
|
|
1874
|
+
AXDecoratorModule,
|
|
1875
|
+
AXBadgeModule,
|
|
1876
|
+
AXDropdownModule,
|
|
1877
|
+
AXPopoverModule,
|
|
1878
|
+
AXFormModule,
|
|
1879
|
+
AXActionSheetModule,
|
|
1880
|
+
AXDrawerModule,
|
|
1881
|
+
AXDialogModule,
|
|
1882
|
+
AXLoadingModule,
|
|
1883
|
+
AXTabsModule,
|
|
1884
|
+
AXTooltipModule,
|
|
1885
|
+
AXBreadcrumbsModule,
|
|
1886
|
+
AXDropdownButtonModule,
|
|
1887
|
+
AXSearchBoxModule,
|
|
1888
|
+
AXDataTableModule,
|
|
1889
|
+
AXTranslationModule,
|
|
1890
|
+
DragDropModule,
|
|
1891
|
+
//
|
|
1892
|
+
AXPWidgetCoreModule,
|
|
1893
|
+
AXPWidgetsModule,
|
|
1894
|
+
AXPAuthModule,
|
|
1895
|
+
//
|
|
1896
|
+
AXPEntityMasterToolbarViewComponent,
|
|
1897
|
+
//
|
|
1898
|
+
AXPPageLayoutComponent,
|
|
1899
|
+
AXPThemeLayoutBlockComponent,
|
|
1900
|
+
AXDropdownButtonModule,
|
|
1901
|
+
AXPThemeLayoutStartSideComponent,
|
|
1902
|
+
AXPEntityCategoryComponent,
|
|
1903
|
+
], providers: [
|
|
1904
|
+
{
|
|
1905
|
+
provide: AXPPageLayoutBase,
|
|
1906
|
+
useExisting: AXPEntityMasterListViewComponent,
|
|
1907
|
+
},
|
|
1908
|
+
], 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\n id=\"axp-entity-category\"\n class=\"ax-w-80\"\n [vm]=\"vm\"\n [searchValue]=\"categorySearchValue()\"\n ></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\n 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 >\n <span\n >{{ 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\n id=\"axp-entity-table\"\n [allowReordering]=\"true\"\n (onColumnsOrderChanged)=\"onColumnsOrderChanged($event)\"\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 (onColumnSizeChanged)=\"onColumnSizeChanged($event)\"\n (onPageChanged)=\"onPageChanged($event)\"\n >\n @if (vm.showIndexColumn()) {\n <ax-index-column\n id=\"axp-table-col-index\"\n [caption]=\"('@general:terms.common.row-number' | translate | async)!\"\n fixed=\"start\"\n [width]=\"'80px'\"\n [padZero]=\"false\"\n ></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\n [attr.id]=\"'axp-table-col-' + col.name\"\n [expandHandler]=\"$index === 0 && vm.parentKey() ? true : false\"\n [caption]=\"(col.title | translate | async)!\"\n [node]=\"col.node()\"\n [customWidth]=\"col.width\"\n ></axp-widget-column-renderer>\n }\n }\n @if (getCommandRowItems().length) {\n <ax-command-column\n id=\"axp-table-col-commands\"\n fixed=\"end\"\n [width]=\"getCommandRowItems().length * 70 + 'px'\"\n [items]=\"getCommandRowItems()\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-command-column>\n }\n <ax-dropdown-command-column\n id=\"axp-table-col-dropdown-commands\"\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"getDropdownRowItems\"\n (onItemClick)=\"handleRowCommandClick($event)\"\n ></ax-dropdown-command-column>\n </ax-data-table>\n </axp-page-content>\n</axp-page-layout>\n", 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"] }]
|
|
1909
|
+
}], ctorParameters: () => [{ type: i1$2.AXPlatform }], propDecorators: { grid: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
|
|
1910
|
+
|
|
1911
|
+
var entityMasterListView_component = /*#__PURE__*/Object.freeze({
|
|
1912
|
+
__proto__: null,
|
|
1913
|
+
AXPEntityMasterListViewComponent: AXPEntityMasterListViewComponent
|
|
1914
|
+
});
|
|
1915
|
+
|
|
192
1916
|
class AXPRootLayoutFooterComponent {
|
|
193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
194
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1917
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1918
|
+
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 }); }
|
|
195
1919
|
}
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1920
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutFooterComponent, decorators: [{
|
|
197
1921
|
type: Component,
|
|
198
|
-
args: [{ selector: 'axp-dashboard-admin-footer', encapsulation: ViewEncapsulation.None, providers: [], host: {
|
|
1922
|
+
args: [{ selector: 'axp-dashboard-admin-footer', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [], host: {
|
|
199
1923
|
class: 'ax-h-10 ax-flex ax-item-center ax-justify-between ax-bg-lighter ax-border-lighter ax-px-6 ax-border-t',
|
|
200
1924
|
}, standalone: true, imports: [
|
|
201
1925
|
AXPComponentSlotModule
|
|
@@ -215,12 +1939,12 @@ class AXPRootLayoutHeaderComponent {
|
|
|
215
1939
|
handleLogoClick() {
|
|
216
1940
|
this.router.navigate(['/']);
|
|
217
1941
|
}
|
|
218
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
219
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1942
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1943
|
+
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 }); }
|
|
220
1944
|
}
|
|
221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutHeaderComponent, decorators: [{
|
|
222
1946
|
type: Component,
|
|
223
|
-
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, imports: [
|
|
1947
|
+
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: [
|
|
224
1948
|
AXPComponentSlotModule,
|
|
225
1949
|
AXButtonModule,
|
|
226
1950
|
AXDecoratorModule
|
|
@@ -234,7 +1958,7 @@ class AXPRootLayoutMenuComponent {
|
|
|
234
1958
|
this.badgeService = inject(AXPTaskBadgeService);
|
|
235
1959
|
this.settingsService = inject(AXPSettingsService);
|
|
236
1960
|
this.visibilityService = inject(AXPMenuVisibilityService);
|
|
237
|
-
this.badgeVisible = signal(true, ...(ngDevMode ? [{ debugName: "badgeVisible" }] : []));
|
|
1961
|
+
this.badgeVisible = signal(true, ...(ngDevMode ? [{ debugName: "badgeVisible" }] : /* istanbul ignore next */ []));
|
|
238
1962
|
// Debug: Track menu items changes
|
|
239
1963
|
// effect(() => {
|
|
240
1964
|
// const items = this.menuStore.items();
|
|
@@ -279,6 +2003,30 @@ class AXPRootLayoutMenuComponent {
|
|
|
279
2003
|
shouldRenderMenuItem(item) {
|
|
280
2004
|
return this.visibilityService.shouldRenderMenuItem(item, (item) => this.getRouterLink(item));
|
|
281
2005
|
}
|
|
2006
|
+
/**
|
|
2007
|
+
* Checks if an item takes up visual space in the menu (group title or rendered menu item).
|
|
2008
|
+
*/
|
|
2009
|
+
isItemRendered(item) {
|
|
2010
|
+
if (item.type === 'break') {
|
|
2011
|
+
return false;
|
|
2012
|
+
}
|
|
2013
|
+
if (item.type === 'group') {
|
|
2014
|
+
return this.isItemVisible(item);
|
|
2015
|
+
}
|
|
2016
|
+
return this.shouldRenderMenuItem(item);
|
|
2017
|
+
}
|
|
2018
|
+
/**
|
|
2019
|
+
* Determines if a divider should be shown. A divider is only shown when there is
|
|
2020
|
+
* visible content on both sides; if before or after is blank, the divider is hidden.
|
|
2021
|
+
*/
|
|
2022
|
+
shouldShowDivider(item, items, index) {
|
|
2023
|
+
if (item.type !== 'break' || !items || index < 0) {
|
|
2024
|
+
return false;
|
|
2025
|
+
}
|
|
2026
|
+
const hasVisibleBefore = items.slice(0, index).some((i) => this.isItemRendered(i));
|
|
2027
|
+
const hasVisibleAfter = items.slice(index + 1).some((i) => this.isItemRendered(i));
|
|
2028
|
+
return hasVisibleBefore && hasVisibleAfter;
|
|
2029
|
+
}
|
|
282
2030
|
//#endregion
|
|
283
2031
|
//#region ---- Menu Navigation Helpers ----
|
|
284
2032
|
/**
|
|
@@ -380,10 +2128,10 @@ class AXPRootLayoutMenuComponent {
|
|
|
380
2128
|
const lowerPath = path.trim().toLowerCase();
|
|
381
2129
|
return lowerPath.startsWith('http://') || lowerPath.startsWith('https://');
|
|
382
2130
|
}
|
|
383
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
384
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2132
|
+
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 }); }
|
|
385
2133
|
}
|
|
386
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutMenuComponent, decorators: [{
|
|
387
2135
|
type: Component,
|
|
388
2136
|
args: [{ selector: 'axp-side-menu', encapsulation: ViewEncapsulation.None, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
389
2137
|
CommonModule,
|
|
@@ -392,7 +2140,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
392
2140
|
AXPTaskBadgeDirective,
|
|
393
2141
|
AXDecoratorModule,
|
|
394
2142
|
AXBadgeModule,
|
|
395
|
-
], template: "<ax-side-menu look=\"pills\">\n @
|
|
2143
|
+
], 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>" }]
|
|
396
2144
|
}], ctorParameters: () => [] });
|
|
397
2145
|
|
|
398
2146
|
class AXPHorizontalMenuComponent {
|
|
@@ -404,7 +2152,7 @@ class AXPHorizontalMenuComponent {
|
|
|
404
2152
|
this.badgeService = inject(AXPTaskBadgeService);
|
|
405
2153
|
this.settingsService = inject(AXPSettingsService);
|
|
406
2154
|
this.visibilityService = inject(AXPMenuVisibilityService);
|
|
407
|
-
this.badgeVisible = signal(true, ...(ngDevMode ? [{ debugName: "badgeVisible" }] : []));
|
|
2155
|
+
this.badgeVisible = signal(true, ...(ngDevMode ? [{ debugName: "badgeVisible" }] : /* istanbul ignore next */ []));
|
|
408
2156
|
}
|
|
409
2157
|
async ngOnInit() {
|
|
410
2158
|
this.badgeVisible.set(await this.settingsService.scope(AXPPlatformScope.User).get(AXPThemeLayoutSetting.MenuBadgeVisible));
|
|
@@ -443,6 +2191,30 @@ class AXPHorizontalMenuComponent {
|
|
|
443
2191
|
shouldRenderMenuItem(item) {
|
|
444
2192
|
return this.visibilityService.shouldRenderMenuItem(item, (item) => this.getRouterLink(item));
|
|
445
2193
|
}
|
|
2194
|
+
/**
|
|
2195
|
+
* Checks if an item takes up visual space in the menu (group title or rendered menu item).
|
|
2196
|
+
*/
|
|
2197
|
+
isItemRendered(item) {
|
|
2198
|
+
if (item.type === 'break') {
|
|
2199
|
+
return false;
|
|
2200
|
+
}
|
|
2201
|
+
if (item.type === 'group') {
|
|
2202
|
+
return this.isItemVisible(item);
|
|
2203
|
+
}
|
|
2204
|
+
return this.shouldRenderMenuItem(item);
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* Determines if a divider should be shown. A divider is only shown when there is
|
|
2208
|
+
* visible content on both sides; if before or after is blank, the divider is hidden.
|
|
2209
|
+
*/
|
|
2210
|
+
shouldShowDivider(item, items, index) {
|
|
2211
|
+
if (item.type !== 'break' || !items || index < 0) {
|
|
2212
|
+
return false;
|
|
2213
|
+
}
|
|
2214
|
+
const hasVisibleBefore = items.slice(0, index).some((i) => this.isItemRendered(i));
|
|
2215
|
+
const hasVisibleAfter = items.slice(index + 1).some((i) => this.isItemRendered(i));
|
|
2216
|
+
return hasVisibleBefore && hasVisibleAfter;
|
|
2217
|
+
}
|
|
446
2218
|
//#endregion
|
|
447
2219
|
//#region ---- Menu Navigation Helpers ----
|
|
448
2220
|
/**
|
|
@@ -544,10 +2316,10 @@ class AXPHorizontalMenuComponent {
|
|
|
544
2316
|
const lowerPath = path.trim().toLowerCase();
|
|
545
2317
|
return lowerPath.startsWith('http://') || lowerPath.startsWith('https://');
|
|
546
2318
|
}
|
|
547
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
548
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2319
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPHorizontalMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2320
|
+
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 }); }
|
|
549
2321
|
}
|
|
550
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPHorizontalMenuComponent, decorators: [{
|
|
551
2323
|
type: Component,
|
|
552
2324
|
args: [{ selector: 'axp-horizontal-menu', host: { class: 'ax-light' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
553
2325
|
CommonModule,
|
|
@@ -558,7 +2330,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
558
2330
|
AXTranslationModule,
|
|
559
2331
|
AXPTaskBadgeDirective,
|
|
560
2332
|
AXBadgeModule,
|
|
561
|
-
], 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 @
|
|
2333
|
+
], 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"] }]
|
|
562
2334
|
}] });
|
|
563
2335
|
|
|
564
2336
|
class AXPRootHorizontalLayoutComponent {
|
|
@@ -577,10 +2349,10 @@ class AXPRootHorizontalLayoutComponent {
|
|
|
577
2349
|
this.store.setSideMenuWidth(e.value);
|
|
578
2350
|
}
|
|
579
2351
|
}
|
|
580
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
581
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2352
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootHorizontalLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2353
|
+
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 }); }
|
|
582
2354
|
}
|
|
583
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootHorizontalLayoutComponent, decorators: [{
|
|
584
2356
|
type: Component,
|
|
585
2357
|
args: [{ selector: 'axp-root-horizontal-layout', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
586
2358
|
RouterModule,
|
|
@@ -626,10 +2398,10 @@ class AXPRootVerticalLayoutComponent {
|
|
|
626
2398
|
this.store.setSideMenuWidth(e.value);
|
|
627
2399
|
}
|
|
628
2400
|
}
|
|
629
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
630
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2401
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootVerticalLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2402
|
+
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 }); }
|
|
631
2403
|
}
|
|
632
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootVerticalLayoutComponent, decorators: [{
|
|
633
2405
|
type: Component,
|
|
634
2406
|
args: [{ selector: 'axp-root-vertical-layout', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
635
2407
|
RouterModule,
|
|
@@ -668,7 +2440,6 @@ class AXPRootLayoutComponent {
|
|
|
668
2440
|
this.eventService = inject(AXPBroadcastEventService);
|
|
669
2441
|
this.sessionService = inject(AXPSessionService);
|
|
670
2442
|
this.unsubscriber = inject(AXUnsubscriber);
|
|
671
|
-
this.workflowService = inject(AXPWorkflowService);
|
|
672
2443
|
this.contextStore = inject(AXPContextStore);
|
|
673
2444
|
}
|
|
674
2445
|
ngOnInit() {
|
|
@@ -698,11 +2469,9 @@ class AXPRootLayoutComponent {
|
|
|
698
2469
|
this.router.navigate(['/auth/login']);
|
|
699
2470
|
}
|
|
700
2471
|
});
|
|
701
|
-
//
|
|
702
|
-
this.workflowService.execute('check-new-version');
|
|
703
2472
|
}
|
|
704
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
705
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2473
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2474
|
+
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: `
|
|
706
2475
|
@if(layout.isMenuHorizontal()){
|
|
707
2476
|
<axp-root-horizontal-layout></axp-root-horizontal-layout>
|
|
708
2477
|
}@else{
|
|
@@ -710,7 +2479,7 @@ class AXPRootLayoutComponent {
|
|
|
710
2479
|
}
|
|
711
2480
|
`, 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 }); }
|
|
712
2481
|
}
|
|
713
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPRootLayoutComponent, decorators: [{
|
|
714
2483
|
type: Component,
|
|
715
2484
|
args: [{
|
|
716
2485
|
template: `
|
|
@@ -724,7 +2493,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
724
2493
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
725
2494
|
standalone: true,
|
|
726
2495
|
imports: [AXPRootHorizontalLayoutComponent, AXPRootVerticalLayoutComponent],
|
|
727
|
-
providers: [AXUnsubscriber],
|
|
2496
|
+
providers: [AXUnsubscriber, AXPContextStore],
|
|
728
2497
|
}]
|
|
729
2498
|
}] });
|
|
730
2499
|
|
|
@@ -844,15 +2613,15 @@ function routesFacory() {
|
|
|
844
2613
|
children: [
|
|
845
2614
|
{
|
|
846
2615
|
path: 'offline',
|
|
847
|
-
loadComponent: () => import('./acorex-platform-themes-default-error-offline.component-
|
|
2616
|
+
loadComponent: () => import('./acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs').then((c) => c.AXPErrorOfflineComponent),
|
|
848
2617
|
},
|
|
849
2618
|
{
|
|
850
2619
|
path: '404',
|
|
851
|
-
loadComponent: () => import('./acorex-platform-themes-default-error-404.component-
|
|
2620
|
+
loadComponent: () => import('./acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs').then((c) => c.AXPError404Component),
|
|
852
2621
|
},
|
|
853
2622
|
{
|
|
854
2623
|
path: '401',
|
|
855
|
-
loadComponent: () => import('./acorex-platform-themes-default-error-401.component-
|
|
2624
|
+
loadComponent: () => import('./acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs').then((c) => c.AXPError401Component),
|
|
856
2625
|
},
|
|
857
2626
|
],
|
|
858
2627
|
},
|
|
@@ -860,9 +2629,9 @@ function routesFacory() {
|
|
|
860
2629
|
return routes;
|
|
861
2630
|
}
|
|
862
2631
|
class AXPDefaultThemeModule {
|
|
863
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
864
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
865
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2632
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDefaultThemeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2633
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXPDefaultThemeModule, imports: [AXPCommonModule, AXPThemesSharedModule] }); }
|
|
2634
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDefaultThemeModule, providers: [
|
|
866
2635
|
{
|
|
867
2636
|
provide: AXP_ENTITY_CONFIG_TOKEN,
|
|
868
2637
|
useFactory: () => {
|
|
@@ -870,14 +2639,14 @@ class AXPDefaultThemeModule {
|
|
|
870
2639
|
viewers: {
|
|
871
2640
|
root: () => Promise.resolve().then(function () { return rootLayout_component; }).then((c) => c.AXPRootLayoutComponent),
|
|
872
2641
|
master: {
|
|
873
|
-
single: () => import('./acorex-platform-themes-default-entity-master-single-view.component-
|
|
2642
|
+
single: () => import('./acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs').then((c) => c.AXPEntityMasterSingleViewComponent),
|
|
874
2643
|
details: () => import('@acorex/platform/layout/views').then((c) => c.AXPLayoutDetailsViewComponent),
|
|
875
2644
|
///
|
|
876
|
-
create: () => import('./acorex-platform-themes-default-entity-master-create-view.component-
|
|
2645
|
+
create: () => import('./acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs').then((c) => c.AXPEntityMasterCreateViewComponent),
|
|
877
2646
|
///
|
|
878
|
-
modify: () => import('./acorex-platform-themes-default-entity-master-modify-view.component-
|
|
2647
|
+
modify: () => import('./acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs').then((c) => c.AXPEntityMasterModifyViewComponent),
|
|
879
2648
|
//
|
|
880
|
-
list: () =>
|
|
2649
|
+
list: () => Promise.resolve().then(function () { return entityMasterListView_component; }).then((c) => c.AXPEntityMasterListViewComponent),
|
|
881
2650
|
},
|
|
882
2651
|
},
|
|
883
2652
|
};
|
|
@@ -892,7 +2661,7 @@ class AXPDefaultThemeModule {
|
|
|
892
2661
|
},
|
|
893
2662
|
], imports: [AXPCommonModule, AXPThemesSharedModule] }); }
|
|
894
2663
|
}
|
|
895
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDefaultThemeModule, decorators: [{
|
|
896
2665
|
type: NgModule,
|
|
897
2666
|
args: [{
|
|
898
2667
|
imports: [AXPCommonModule, AXPThemesSharedModule],
|
|
@@ -906,14 +2675,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
906
2675
|
viewers: {
|
|
907
2676
|
root: () => Promise.resolve().then(function () { return rootLayout_component; }).then((c) => c.AXPRootLayoutComponent),
|
|
908
2677
|
master: {
|
|
909
|
-
single: () => import('./acorex-platform-themes-default-entity-master-single-view.component-
|
|
2678
|
+
single: () => import('./acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs').then((c) => c.AXPEntityMasterSingleViewComponent),
|
|
910
2679
|
details: () => import('@acorex/platform/layout/views').then((c) => c.AXPLayoutDetailsViewComponent),
|
|
911
2680
|
///
|
|
912
|
-
create: () => import('./acorex-platform-themes-default-entity-master-create-view.component-
|
|
2681
|
+
create: () => import('./acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs').then((c) => c.AXPEntityMasterCreateViewComponent),
|
|
913
2682
|
///
|
|
914
|
-
modify: () => import('./acorex-platform-themes-default-entity-master-modify-view.component-
|
|
2683
|
+
modify: () => import('./acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs').then((c) => c.AXPEntityMasterModifyViewComponent),
|
|
915
2684
|
//
|
|
916
|
-
list: () =>
|
|
2685
|
+
list: () => Promise.resolve().then(function () { return entityMasterListView_component; }).then((c) => c.AXPEntityMasterListViewComponent),
|
|
917
2686
|
},
|
|
918
2687
|
},
|
|
919
2688
|
};
|
|
@@ -934,5 +2703,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
934
2703
|
* Generated bundle index. Do not edit.
|
|
935
2704
|
*/
|
|
936
2705
|
|
|
937
|
-
export { AXPDefaultThemeModule, AXPEntityDetailListViewComponent, AXPRootHorizontalLayoutComponent, AXPRootLayoutComponent, AXPRootLayoutFooterComponent, AXPRootLayoutHeaderComponent, AXPRootLayoutMenuComponent, AXPRootVerticalLayoutComponent };
|
|
2706
|
+
export { AXPDefaultThemeModule, AXPEntityDetailListViewComponent, AXPEntityMasterListViewComponent, AXPRootHorizontalLayoutComponent, AXPRootLayoutComponent, AXPRootLayoutFooterComponent, AXPRootLayoutHeaderComponent, AXPRootLayoutMenuComponent, AXPRootVerticalLayoutComponent };
|
|
938
2707
|
//# sourceMappingURL=acorex-platform-themes-default.mjs.map
|