@acorex/modules 20.8.4 → 20.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
|
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
7
|
import { Injectable, inject, NgModule, computed, effect, signal, ChangeDetectionStrategy, Component, ViewEncapsulation, viewChild, DestroyRef, input, untracked } from '@angular/core';
|
|
8
8
|
import { ROUTES, ActivatedRoute, Router } from '@angular/router';
|
|
9
|
-
import { AXP_MENU_PROVIDER } from '@acorex/platform/common';
|
|
9
|
+
import { AXP_MENU_PROVIDER, AXPCommonSettings, AXPSettingsService } from '@acorex/platform/common';
|
|
10
10
|
import * as i1 from '@acorex/core/translation';
|
|
11
11
|
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
12
12
|
import { AXBadgeModule } from '@acorex/components/badge';
|
|
@@ -26,6 +26,7 @@ import { CommonModule } from '@angular/common';
|
|
|
26
26
|
import { AXLocaleService } from '@acorex/core/locale';
|
|
27
27
|
import * as i2 from '@acorex/platform/layout/widget-core';
|
|
28
28
|
import { AXPPageStatus, AXPWidgetRegistryService, AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
|
|
29
|
+
import { Subscription } from 'rxjs';
|
|
29
30
|
import { signalStore, withState, withComputed, withMethods, patchState, withHooks } from '@ngrx/signals';
|
|
30
31
|
import { AXBarChartComponent } from '@acorex/charts/bar-chart';
|
|
31
32
|
import { AXChartLegendComponent } from '@acorex/charts/chart-legend';
|
|
@@ -1007,6 +1008,7 @@ const AXPReportViewerViewModel = signalStore(withState(() => ({
|
|
|
1007
1008
|
hasBeenExecuted: false, // Track if report has been executed at least once
|
|
1008
1009
|
status: AXPPageStatus.Idle,
|
|
1009
1010
|
error: null,
|
|
1011
|
+
showRowIndexColumn: false,
|
|
1010
1012
|
})), withComputed((store, widgetRegistryService = inject(AXPWidgetRegistryService)) => ({
|
|
1011
1013
|
//#region ---- Layout Management ----
|
|
1012
1014
|
availableLayouts: computed(() => {
|
|
@@ -1376,20 +1378,34 @@ const AXPReportViewerViewModel = signalStore(withState(() => ({
|
|
|
1376
1378
|
},
|
|
1377
1379
|
//#endregion
|
|
1378
1380
|
};
|
|
1379
|
-
}), withHooks((store, translationService = inject(AXTranslationService), localeService = inject(AXLocaleService)) =>
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1381
|
+
}), withHooks((store, translationService = inject(AXTranslationService), localeService = inject(AXLocaleService), settingsService = inject(AXPSettingsService)) => {
|
|
1382
|
+
const settingSubs = new Subscription();
|
|
1383
|
+
const syncShowRowIndexColumn = async () => {
|
|
1384
|
+
try {
|
|
1385
|
+
const value = await settingsService.get(AXPCommonSettings.ShowRowIndexColumn);
|
|
1386
|
+
patchState(store, { showRowIndexColumn: value ?? false });
|
|
1387
|
+
}
|
|
1388
|
+
catch {
|
|
1389
|
+
patchState(store, { showRowIndexColumn: false });
|
|
1390
|
+
}
|
|
1391
|
+
};
|
|
1392
|
+
return {
|
|
1393
|
+
async onInit() {
|
|
1394
|
+
translationService.langChanges$.subscribe(() => {
|
|
1395
|
+
// Handle language change if needed
|
|
1396
|
+
});
|
|
1397
|
+
localeService.profileChanged$.subscribe(() => {
|
|
1398
|
+
// Handle locale change if needed
|
|
1399
|
+
});
|
|
1400
|
+
void syncShowRowIndexColumn();
|
|
1401
|
+
settingSubs.add(settingsService.onLoaded.subscribe(() => void syncShowRowIndexColumn()));
|
|
1402
|
+
settingSubs.add(settingsService.onChanged.subscribe(() => void syncShowRowIndexColumn()));
|
|
1403
|
+
},
|
|
1404
|
+
onDestroy() {
|
|
1405
|
+
settingSubs.unsubscribe();
|
|
1406
|
+
},
|
|
1407
|
+
};
|
|
1408
|
+
}));
|
|
1393
1409
|
|
|
1394
1410
|
class AXPReportChartViewComponent {
|
|
1395
1411
|
constructor() {
|
|
@@ -1923,7 +1939,7 @@ class AXPReportTableViewComponent {
|
|
|
1923
1939
|
};
|
|
1924
1940
|
}
|
|
1925
1941
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXPReportTableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1926
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AXPReportTableViewComponent, isStandalone: true, selector: "axp-report-table-view", viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, isSignal: true }], ngImport: i0, template: "<ax-data-table\n #grid\n [dataSource]=\"dataSource\"\n [paging]=\"true\"\n (onRowDbClick)=\"handleDbRowClick($event)\"\n class=\"ax-flex-1\"\n>\n <!-- Dynamic columns based on configuration -->\n <ax-index-column\n
|
|
1942
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AXPReportTableViewComponent, isStandalone: true, selector: "axp-report-table-view", viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, isSignal: true }], ngImport: i0, template: "<ax-data-table\n #grid\n [dataSource]=\"dataSource\"\n [paging]=\"true\"\n (onRowDbClick)=\"handleDbRowClick($event)\"\n class=\"ax-flex-1\"\n>\n <!-- Dynamic columns based on configuration -->\n @if (vm.showRowIndexColumn()) {\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.canSelectRows()) {\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n }\n @for (column of columns(); track column.field) {\n @if (column.visible) {\n <axp-widget-column-renderer\n [customWidth]=\"column.width == 'auto' ? 'auto' : column.width + 'px'\"\n [caption]=\"(column.title | translate | async)!\"\n [node]=\"column.widget!\"\n ></axp-widget-column-renderer>\n }\n }\n @if (hasPrimaryRowAction()) {\n <ax-command-column\n fixed=\"end\"\n [width]=\"primaryRowAction().length * 70 + 'px'\"\n [items]=\"primaryRowAction()\"\n (onItemClick)=\"handleRowClick($event)\"\n ></ax-command-column>\n }\n @if (hasSecondaryRowAction()) {\n <ax-dropdown-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"secondaryRowAction()\"\n (onItemClick)=\"handleRowClick($event)\"\n ></ax-dropdown-command-column>\n }\n</ax-data-table>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i1$2.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: i1$2.AXRowIndexColumnComponent, selector: "ax-index-column", inputs: ["width", "caption", "fixed", "footerTemplate", "padZero"] }, { kind: "component", type: i1$2.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "component", type: i1$2.AXRowCommandColumnComponent, selector: "ax-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "items"], outputs: ["onItemClick"] }, { kind: "component", type: i1$2.AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: ["width", "caption", "fixed", "footerTemplate", "emptyStateTemplate", "emptyStateText", "items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "component", type: i2.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "customExpandIcon", "customCollapseIcon", "customWidth", "node", "footerTemplate", "expandHandler", "cellTemplate", "headerTemplate"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1927
1943
|
}
|
|
1928
1944
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXPReportTableViewComponent, decorators: [{
|
|
1929
1945
|
type: Component,
|
|
@@ -1934,7 +1950,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1934
1950
|
AXDecoratorModule,
|
|
1935
1951
|
AXTranslationModule,
|
|
1936
1952
|
AXPWidgetCoreModule
|
|
1937
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ax-data-table\n #grid\n [dataSource]=\"dataSource\"\n [paging]=\"true\"\n (onRowDbClick)=\"handleDbRowClick($event)\"\n class=\"ax-flex-1\"\n>\n <!-- Dynamic columns based on configuration -->\n <ax-index-column\n
|
|
1953
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ax-data-table\n #grid\n [dataSource]=\"dataSource\"\n [paging]=\"true\"\n (onRowDbClick)=\"handleDbRowClick($event)\"\n class=\"ax-flex-1\"\n>\n <!-- Dynamic columns based on configuration -->\n @if (vm.showRowIndexColumn()) {\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.canSelectRows()) {\n <ax-select-column fixed=\"start\" [width]=\"'50px'\"></ax-select-column>\n }\n @for (column of columns(); track column.field) {\n @if (column.visible) {\n <axp-widget-column-renderer\n [customWidth]=\"column.width == 'auto' ? 'auto' : column.width + 'px'\"\n [caption]=\"(column.title | translate | async)!\"\n [node]=\"column.widget!\"\n ></axp-widget-column-renderer>\n }\n }\n @if (hasPrimaryRowAction()) {\n <ax-command-column\n fixed=\"end\"\n [width]=\"primaryRowAction().length * 70 + 'px'\"\n [items]=\"primaryRowAction()\"\n (onItemClick)=\"handleRowClick($event)\"\n ></ax-command-column>\n }\n @if (hasSecondaryRowAction()) {\n <ax-dropdown-command-column\n fixed=\"end\"\n [width]=\"'60px'\"\n [items]=\"secondaryRowAction()\"\n (onItemClick)=\"handleRowClick($event)\"\n ></ax-dropdown-command-column>\n }\n</ax-data-table>\n" }]
|
|
1938
1954
|
}], propDecorators: { grid: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
|
|
1939
1955
|
|
|
1940
1956
|
class AXPReportViewerPageComponent extends AXPPageLayoutBaseComponent {
|