@acorex/modules 19.3.2 → 19.3.3-next.0
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/common/index.d.ts +1 -0
- package/common/lib/common.module.d.ts +3 -2
- package/common/lib/features/global-search/index.d.ts +3 -0
- package/common/lib/features/global-search/search-popup.component.d.ts +22 -0
- package/common/lib/features/global-search/search-slot.component.d.ts +9 -0
- package/common/lib/features/global-search/search.config.d.ts +5 -0
- package/common/lib/features/global-search/search.module.d.ts +11 -0
- package/common/lib/features/global-search/search.viewmodel.d.ts +34 -0
- package/common/lib/features/global-search/workflows/search.workflow.d.ts +11 -0
- package/document-management/lib/features/document-explorer/document-explorer.component.d.ts +1 -0
- package/document-management/lib/features/document-explorer/document-explorer.viewmodel.d.ts +1 -0
- package/document-management/lib/features/document-explorer/views/detail-panel/detail-panel.component.d.ts +1 -0
- package/document-management/lib/features/document-explorer/views/details/details-view.component.d.ts +1 -0
- package/document-management/lib/features/document-explorer/views/large-icons/large-icons-view.component.d.ts +1 -0
- package/document-management/lib/features/document-explorer/views/large-tiles/large-tiles-view.component.d.ts +1 -0
- package/document-management/lib/features/document-explorer/views/list/list-view.component.d.ts +1 -0
- package/document-management/lib/features/document-explorer/views/small-icons/small-icons-view.component.d.ts +1 -0
- package/document-management/lib/features/document-explorer/views/small-tiles/small-tiles-view.component.d.ts +1 -0
- package/document-management/lib/features/drive/drive.component.d.ts +1 -0
- package/document-management/lib/features/drive-choose/drive-choose.component.d.ts +1 -0
- package/document-management/lib/features/shared/components/folder-path-breadcrumbs/folder-path-breadcrumbs.component.d.ts +1 -0
- package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-edit.component.d.ts +4 -3
- package/document-management/lib/permission-definition.provider.d.ts +4 -0
- package/document-management/lib/permission.keys.d.ts +19 -0
- package/fesm2022/acorex-modules-common-search-popup.component-C3XUb6pF.mjs +128 -0
- package/fesm2022/acorex-modules-common-search-popup.component-C3XUb6pF.mjs.map +1 -0
- package/fesm2022/acorex-modules-common.mjs +289 -7
- package/fesm2022/acorex-modules-common.mjs.map +1 -1
- package/fesm2022/{acorex-modules-dashboard-management-acorex-modules-dashboard-management-VORBD1g-.mjs → acorex-modules-dashboard-management-acorex-modules-dashboard-management-Ccj2AaJ1.mjs} +3 -3
- package/fesm2022/{acorex-modules-dashboard-management-acorex-modules-dashboard-management-VORBD1g-.mjs.map → acorex-modules-dashboard-management-acorex-modules-dashboard-management-Ccj2AaJ1.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-dashboard-management-home-dashboard-DiPn_RhH.mjs → acorex-modules-dashboard-management-home-dashboard-BXD0g_tp.mjs} +2 -2
- package/fesm2022/{acorex-modules-dashboard-management-home-dashboard-DiPn_RhH.mjs.map → acorex-modules-dashboard-management-home-dashboard-BXD0g_tp.mjs.map} +1 -1
- package/fesm2022/acorex-modules-dashboard-management.mjs +1 -1
- package/fesm2022/{acorex-modules-document-management-acorex-modules-document-management-vYaqbxKs.mjs → acorex-modules-document-management-acorex-modules-document-management-Dw7YKb_h.mjs} +59 -41
- package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-Dw7YKb_h.mjs.map +1 -0
- package/fesm2022/{acorex-modules-document-management-create-folder-dialog.component-Bc_IX3gT.mjs → acorex-modules-document-management-create-folder-dialog.component-Ty5V60Tu.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-create-folder-dialog.component-Bc_IX3gT.mjs.map → acorex-modules-document-management-create-folder-dialog.component-Ty5V60Tu.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-details-view.component-_9f5TQJi.mjs → acorex-modules-document-management-details-view.component-BuUJq8WU.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-details-view.component-_9f5TQJi.mjs.map → acorex-modules-document-management-details-view.component-BuUJq8WU.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-drive-choose.component-CFOb0_MF.mjs → acorex-modules-document-management-drive-choose.component-DSCIj1X_.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-drive-choose.component-CFOb0_MF.mjs.map → acorex-modules-document-management-drive-choose.component-DSCIj1X_.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-large-icons-view.component-D9es4CBl.mjs → acorex-modules-document-management-large-icons-view.component-DvrdSkIZ.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-large-icons-view.component-D9es4CBl.mjs.map → acorex-modules-document-management-large-icons-view.component-DvrdSkIZ.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-Q1Sjg47F.mjs → acorex-modules-document-management-large-tiles-view.component-rIxsD8sE.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-Q1Sjg47F.mjs.map → acorex-modules-document-management-large-tiles-view.component-rIxsD8sE.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-list-view.component-BUu5vrul.mjs → acorex-modules-document-management-list-view.component-BrutZLAU.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-list-view.component-BUu5vrul.mjs.map → acorex-modules-document-management-list-view.component-BrutZLAU.mjs.map} +1 -1
- package/fesm2022/acorex-modules-document-management-permission-definition.provider-CQOLEctF.mjs +31 -0
- package/fesm2022/acorex-modules-document-management-permission-definition.provider-CQOLEctF.mjs.map +1 -0
- package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-BMRmdslE.mjs → acorex-modules-document-management-rename-node-dialog.component-zSY0PShA.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-BMRmdslE.mjs.map → acorex-modules-document-management-rename-node-dialog.component-zSY0PShA.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-small-icons-view.component-ChSS7z9z.mjs → acorex-modules-document-management-small-icons-view.component-CFB6g5r6.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-small-icons-view.component-ChSS7z9z.mjs.map → acorex-modules-document-management-small-icons-view.component-CFB6g5r6.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-Ci33qbBY.mjs → acorex-modules-document-management-small-tiles-view.component-Dp2Lnb3c.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-Ci33qbBY.mjs.map → acorex-modules-document-management-small-tiles-view.component-Dp2Lnb3c.mjs.map} +1 -1
- package/fesm2022/acorex-modules-document-management.mjs +1 -1
- package/fesm2022/{acorex-modules-form-template-management-acorex-modules-form-template-management-Cv92x_9Z.mjs → acorex-modules-form-template-management-acorex-modules-form-template-management-CJ2Qoott.mjs} +33 -15
- package/fesm2022/acorex-modules-form-template-management-acorex-modules-form-template-management-CJ2Qoott.mjs.map +1 -0
- package/fesm2022/{acorex-modules-form-template-management-category.entity-DPVwQW4X.mjs → acorex-modules-form-template-management-category.entity-BjNsUAZq.mjs} +2 -2
- package/fesm2022/{acorex-modules-form-template-management-category.entity-DPVwQW4X.mjs.map → acorex-modules-form-template-management-category.entity-BjNsUAZq.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-form-template-management-permission-definition.provider-BrWbwKTK.mjs → acorex-modules-form-template-management-permission-definition.provider-CqZ8ytjA.mjs} +2 -21
- package/fesm2022/acorex-modules-form-template-management-permission-definition.provider-CqZ8ytjA.mjs.map +1 -0
- package/fesm2022/{acorex-modules-form-template-management-settings.provider-iwOUp0iw.mjs → acorex-modules-form-template-management-settings.provider-LrzsYkiL.mjs} +2 -2
- package/fesm2022/{acorex-modules-form-template-management-settings.provider-iwOUp0iw.mjs.map → acorex-modules-form-template-management-settings.provider-LrzsYkiL.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-form-template-management-template-widget-edit.component-BkR3x74p.mjs → acorex-modules-form-template-management-template-widget-edit.component-BP75i9zU.mjs} +2 -2
- package/fesm2022/{acorex-modules-form-template-management-template-widget-edit.component-BkR3x74p.mjs.map → acorex-modules-form-template-management-template-widget-edit.component-BP75i9zU.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-form-template-management-template.entity-NgmH7r8R.mjs → acorex-modules-form-template-management-template.entity-CCaHPkWq.mjs} +2 -2
- package/fesm2022/{acorex-modules-form-template-management-template.entity-NgmH7r8R.mjs.map → acorex-modules-form-template-management-template.entity-CCaHPkWq.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-form-template-management-viewer-popup.component-Cq33xA62.mjs → acorex-modules-form-template-management-viewer-popup.component-CUOsh6e5.mjs} +2 -2
- package/fesm2022/{acorex-modules-form-template-management-viewer-popup.component-Cq33xA62.mjs.map → acorex-modules-form-template-management-viewer-popup.component-CUOsh6e5.mjs.map} +1 -1
- package/fesm2022/acorex-modules-form-template-management.mjs +1 -1
- package/fesm2022/{acorex-modules-issue-management-acorex-modules-issue-management-U5EJyG5e.mjs → acorex-modules-issue-management-acorex-modules-issue-management-DcmAnBue.mjs} +2 -3
- package/fesm2022/{acorex-modules-issue-management-acorex-modules-issue-management-U5EJyG5e.mjs.map → acorex-modules-issue-management-acorex-modules-issue-management-DcmAnBue.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-issue-management-capture-screen.component-3ZAOJBfn.mjs → acorex-modules-issue-management-capture-screen.component-BMpafdHr.mjs} +2 -2
- package/fesm2022/{acorex-modules-issue-management-capture-screen.component-3ZAOJBfn.mjs.map → acorex-modules-issue-management-capture-screen.component-BMpafdHr.mjs.map} +1 -1
- package/fesm2022/acorex-modules-issue-management.mjs +1 -1
- package/fesm2022/acorex-modules-log-management.mjs +3 -8
- package/fesm2022/acorex-modules-log-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-organization-management-add-item.component-DW0TneoX.mjs → acorex-modules-organization-management-add-item.component-DE0Ek0dk.mjs} +3 -3
- package/fesm2022/{acorex-modules-organization-management-add-item.component-DW0TneoX.mjs.map → acorex-modules-organization-management-add-item.component-DE0Ek0dk.mjs.map} +1 -1
- package/fesm2022/acorex-modules-organization-management-org-chart-configuration.page-RuvkSheN.mjs +124 -0
- package/fesm2022/acorex-modules-organization-management-org-chart-configuration.page-RuvkSheN.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-management-org-chart.page-DnRbGIWN.mjs → acorex-modules-organization-management-org-chart.page-C2qYJxpY.mjs} +59 -19
- package/fesm2022/acorex-modules-organization-management-org-chart.page-C2qYJxpY.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-management.mjs +7 -7
- package/fesm2022/acorex-modules-organization-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-platform-management-acorex-modules-platform-management-5lToZD6T.mjs → acorex-modules-platform-management-acorex-modules-platform-management-BaYlXX3M.mjs} +44 -51
- package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-BaYlXX3M.mjs.map +1 -0
- package/fesm2022/{acorex-modules-platform-management-list-version.component-BElZjmXr.mjs → acorex-modules-platform-management-list-version.component-DB8pe9so.mjs} +2 -2
- package/fesm2022/{acorex-modules-platform-management-list-version.component-BElZjmXr.mjs.map → acorex-modules-platform-management-list-version.component-DB8pe9so.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-platform-management-settings.provider-CemrvnbH.mjs → acorex-modules-platform-management-settings.provider-BQzM-lyt.mjs} +2 -2
- package/fesm2022/{acorex-modules-platform-management-settings.provider-CemrvnbH.mjs.map → acorex-modules-platform-management-settings.provider-BQzM-lyt.mjs.map} +1 -1
- package/fesm2022/acorex-modules-platform-management.mjs +1 -1
- package/fesm2022/acorex-modules-settings-management-setting-page.component-XDFtTqft.mjs +219 -0
- package/fesm2022/acorex-modules-settings-management-setting-page.component-XDFtTqft.mjs.map +1 -0
- package/fesm2022/acorex-modules-settings-management-setting-view.component-B_6RIU9e.mjs +103 -0
- package/fesm2022/acorex-modules-settings-management-setting-view.component-B_6RIU9e.mjs.map +1 -0
- package/fesm2022/acorex-modules-settings-management.mjs +442 -0
- package/fesm2022/acorex-modules-settings-management.mjs.map +1 -0
- package/fesm2022/acorex-modules-training-management.mjs +0 -2
- package/fesm2022/acorex-modules-training-management.mjs.map +1 -1
- package/organization-management/lib/features/organization-chart/org-chart-configuration.page.d.ts +7 -61
- package/organization-management/lib/features/organization-chart/org-chart.page.d.ts +8 -61
- package/package.json +5 -1
- package/platform-management/lib/const.d.ts +2 -6
- package/platform-management/lib/features/app-terms/pages/list/list-terms.component.d.ts +11 -13
- package/settings-management/README.md +3 -0
- package/settings-management/index.d.ts +2 -0
- package/settings-management/lib/features/settings/convert-setting-data.d.ts +2 -0
- package/settings-management/lib/features/settings/search-definition.provider.d.ts +4 -0
- package/settings-management/lib/features/settings/search.provider.d.ts +9 -0
- package/settings-management/lib/features/settings/setting-page/setting-page.component.d.ts +65 -0
- package/settings-management/lib/features/settings/setting-view/setting-view.component.d.ts +135 -0
- package/settings-management/lib/features/settings/settings.viewmodel.d.ts +46 -0
- package/settings-management/lib/settings-management.module.d.ts +9 -0
- package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-vYaqbxKs.mjs.map +0 -1
- package/fesm2022/acorex-modules-form-template-management-acorex-modules-form-template-management-Cv92x_9Z.mjs.map +0 -1
- package/fesm2022/acorex-modules-form-template-management-permission-definition.provider-BrWbwKTK.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-management-org-chart-configuration.page-DFqOS0So.mjs +0 -92
- package/fesm2022/acorex-modules-organization-management-org-chart-configuration.page-DFqOS0So.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-management-org-chart.page-DnRbGIWN.mjs.map +0 -1
- package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-5lToZD6T.mjs.map +0 -1
@@ -0,0 +1,103 @@
|
|
1
|
+
import { AXBadgeModule } from '@acorex/components/badge';
|
2
|
+
import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
|
3
|
+
import { AXButtonModule } from '@acorex/components/button';
|
4
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
5
|
+
import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
|
6
|
+
import * as i3 from '@acorex/components/form';
|
7
|
+
import { AXFormComponent, AXFormModule } from '@acorex/components/form';
|
8
|
+
import { AXLoadingModule } from '@acorex/components/loading';
|
9
|
+
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
10
|
+
import * as i6 from '@acorex/core/translation';
|
11
|
+
import { AXTranslationModule } from '@acorex/core/translation';
|
12
|
+
import { AXValidationModule } from '@acorex/core/validation';
|
13
|
+
import { AXPGridLayoutDirective } from '@acorex/platform/common';
|
14
|
+
import * as i4 from '@acorex/platform/layout/builder';
|
15
|
+
import { AXPWidgetContainerComponent, AXPLayoutBuilderModule } from '@acorex/platform/layout/builder';
|
16
|
+
import { AXPLayoutThemeService, AXPThemeLayoutBlockComponent, AXPThemeLayoutHeaderComponent, AXPThemeLayoutSectionComponent } from '@acorex/platform/themes/shared';
|
17
|
+
import * as i1 from '@angular/common';
|
18
|
+
import { CommonModule } from '@angular/common';
|
19
|
+
import * as i0 from '@angular/core';
|
20
|
+
import { inject, Injector, viewChild, computed, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
21
|
+
import { FormsModule } from '@angular/forms';
|
22
|
+
import { AXPSettingsViewModel } from './acorex-modules-settings-management.mjs';
|
23
|
+
|
24
|
+
class AXPSettingsViewComponent {
|
25
|
+
constructor() {
|
26
|
+
this.vm = inject(AXPSettingsViewModel);
|
27
|
+
this.injector = inject(Injector);
|
28
|
+
this.layoutService = inject(AXPLayoutThemeService);
|
29
|
+
this.form = viewChild(AXFormComponent);
|
30
|
+
this.container = viewChild(AXPWidgetContainerComponent);
|
31
|
+
this.defaultLayout = computed(() => {
|
32
|
+
return {
|
33
|
+
positions: {
|
34
|
+
default: {
|
35
|
+
colSpan: 12,
|
36
|
+
},
|
37
|
+
md: {
|
38
|
+
colSpan: 8,
|
39
|
+
},
|
40
|
+
lg: {
|
41
|
+
colSpan: 6,
|
42
|
+
},
|
43
|
+
xl: {
|
44
|
+
colSpan: this.layoutService.isSideMenuOpen() ? 5 : 4,
|
45
|
+
},
|
46
|
+
xxl: {
|
47
|
+
colSpan: 4,
|
48
|
+
},
|
49
|
+
},
|
50
|
+
};
|
51
|
+
});
|
52
|
+
this.#effect1 = effect(() => {
|
53
|
+
this.container()?.builderService.setStatus(this.vm.status());
|
54
|
+
});
|
55
|
+
}
|
56
|
+
ngOnInit() {
|
57
|
+
this.vm.registerForm(this.form());
|
58
|
+
}
|
59
|
+
#effect1;
|
60
|
+
handleContextChanged(e) {
|
61
|
+
if (e.state == 'initiated') {
|
62
|
+
this.vm.updatePreviousContext(e.data);
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
this.vm.updateContext(e.data);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
69
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPSettingsViewComponent, isStandalone: true, selector: "ng-component", host: { classAttribute: "ax-w-full" }, viewQueries: [{ propertyName: "form", first: true, predicate: AXFormComponent, descendants: true, isSignal: true }, { propertyName: "container", first: true, predicate: AXPWidgetContainerComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ax-form>\n <axp-widgets-container [context]=\"vm.context()\" (onContextChanged)=\"handleContextChanged($event)\" *translate=\"let t\">\n @if(vm.isSearching() && vm.searchResults()!.length>0) {\n <!-- Search Result -->\n @for(group of vm.searchResults(); track group.name;let first=$first) {\n <p class=\"ax-text-lg md:ax-text-xl ax-font-semibold ax-py-3 ax-text-neutral-500\" [class.ax-pt-0]=\"first\">\n {{ group.title | translate | async }}\n </p>\n <axp-layout-sections>\n @for (section of group.sections; track section.name) {\n <ng-container [ngTemplateOutlet]=\"sectionTpl\" [ngTemplateOutletContext]=\"{ section }\"\n [ngTemplateOutletInjector]=\"injector\"></ng-container>\n }\n </axp-layout-sections>\n } }\n <!-- Not Found -->\n @else if(vm.isSearching() && vm.searchResults()!.length===0) {\n <div class=\"ax-p-2\">\n <div\n class=\"ax-mt-3 ax-flex ax-flex-col ax-justify-center ax-h-[calc(100vh-236px)] ax-items-center ax-p-10 ax-gap-10\">\n <p class=\"ax-text-xl md:ax-text-2xl ax-font-bold\">\n {{ t('search.not-found', { scope: 'settings' }) | async }}\n </p>\n </div>\n </div>\n }\n <!-- Group -->\n @else if(vm.activateGroup()?.sections) {\n <axp-layout-sections>\n @for(section of vm.activateGroup()?.sections; track section.name) {\n <ng-container [ngTemplateOutlet]=\"sectionTpl\" [ngTemplateOutletContext]=\"{ section }\"\n [ngTemplateOutletInjector]=\"injector\"></ng-container>\n }\n </axp-layout-sections>\n }\n <ng-template #sectionTpl let-section=\"section\">\n <axp-layout-section>\n <axp-layout-header>\n <axp-layout-title>\n {{ section.title | translate | async }}\n </axp-layout-title>\n @if(section.description) {\n <axp-layout-description>\n {{ section.description | translate | async }}\n </axp-layout-description>\n }\n </axp-layout-header>\n <axp-layout-content>\n <!-- Settings Item -->\n @for(j of section.settings; track j.name){\n <div class=\"--item-container\" [class.!ax-hidden]=\"widget.options()['visibility'] == false\">\n <!-- Title and Description Section -->\n <div class=\"ax-col-span-12 md:ax-col-span-4 lg:ax-col-span-4 2xl:ax-col-span-3 \">\n @if(j.title) {\n <axp-layout-title>{{ j.title | translate | async }}</axp-layout-title>\n } @if(j.description) {\n <axp-layout-description>{{ j.description | translate | async }}</axp-layout-description>\n }\n </div>\n <ax-form-field class=\"ax-flex ax-w-full\" [gridLayout]=\"j.layout ?? defaultLayout()\">\n <ng-container axp-widget-renderer [node]=\"j.widget\" [mode]=\"'edit'\" #widget=\"widgetRenderer\">\n </ng-container>\n </ax-form-field>\n </div>\n }\n </axp-layout-content>\n </axp-layout-section>\n </ng-template>\n </axp-widgets-container>\n</ax-form>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type:
|
70
|
+
//
|
71
|
+
AXDecoratorModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }, { kind: "directive", type: i6.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i3.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "component", type: i3.AXFormComponent, selector: "ax-form", inputs: ["labelMode", "look", "messageStyle", "updateOn"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type:
|
72
|
+
//
|
73
|
+
AXPLayoutBuilderModule }, { kind: "component", type: i4.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i4.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer, axp-page-header, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-container, 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: AXPThemeLayoutHeaderComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPThemeLayoutSectionComponent, selector: "axp-layout-section" }, { kind: "directive", type: AXPGridLayoutDirective, selector: "[gridLayout]", inputs: ["gridLayout"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
74
|
+
}
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewComponent, decorators: [{
|
76
|
+
type: Component,
|
77
|
+
args: [{ imports: [
|
78
|
+
CommonModule,
|
79
|
+
FormsModule,
|
80
|
+
//
|
81
|
+
AXDecoratorModule,
|
82
|
+
AXBreadcrumbsModule,
|
83
|
+
AXButtonModule,
|
84
|
+
AXBadgeModule,
|
85
|
+
AXTranslationModule,
|
86
|
+
AXSearchBoxModule,
|
87
|
+
AXDropdownButtonModule,
|
88
|
+
AXLoadingModule,
|
89
|
+
AXFormModule,
|
90
|
+
AXValidationModule,
|
91
|
+
//
|
92
|
+
AXPLayoutBuilderModule,
|
93
|
+
AXPThemeLayoutBlockComponent,
|
94
|
+
AXPThemeLayoutHeaderComponent,
|
95
|
+
AXPThemeLayoutSectionComponent,
|
96
|
+
AXPGridLayoutDirective
|
97
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
98
|
+
class: 'ax-w-full',
|
99
|
+
}, template: "<ax-form>\n <axp-widgets-container [context]=\"vm.context()\" (onContextChanged)=\"handleContextChanged($event)\" *translate=\"let t\">\n @if(vm.isSearching() && vm.searchResults()!.length>0) {\n <!-- Search Result -->\n @for(group of vm.searchResults(); track group.name;let first=$first) {\n <p class=\"ax-text-lg md:ax-text-xl ax-font-semibold ax-py-3 ax-text-neutral-500\" [class.ax-pt-0]=\"first\">\n {{ group.title | translate | async }}\n </p>\n <axp-layout-sections>\n @for (section of group.sections; track section.name) {\n <ng-container [ngTemplateOutlet]=\"sectionTpl\" [ngTemplateOutletContext]=\"{ section }\"\n [ngTemplateOutletInjector]=\"injector\"></ng-container>\n }\n </axp-layout-sections>\n } }\n <!-- Not Found -->\n @else if(vm.isSearching() && vm.searchResults()!.length===0) {\n <div class=\"ax-p-2\">\n <div\n class=\"ax-mt-3 ax-flex ax-flex-col ax-justify-center ax-h-[calc(100vh-236px)] ax-items-center ax-p-10 ax-gap-10\">\n <p class=\"ax-text-xl md:ax-text-2xl ax-font-bold\">\n {{ t('search.not-found', { scope: 'settings' }) | async }}\n </p>\n </div>\n </div>\n }\n <!-- Group -->\n @else if(vm.activateGroup()?.sections) {\n <axp-layout-sections>\n @for(section of vm.activateGroup()?.sections; track section.name) {\n <ng-container [ngTemplateOutlet]=\"sectionTpl\" [ngTemplateOutletContext]=\"{ section }\"\n [ngTemplateOutletInjector]=\"injector\"></ng-container>\n }\n </axp-layout-sections>\n }\n <ng-template #sectionTpl let-section=\"section\">\n <axp-layout-section>\n <axp-layout-header>\n <axp-layout-title>\n {{ section.title | translate | async }}\n </axp-layout-title>\n @if(section.description) {\n <axp-layout-description>\n {{ section.description | translate | async }}\n </axp-layout-description>\n }\n </axp-layout-header>\n <axp-layout-content>\n <!-- Settings Item -->\n @for(j of section.settings; track j.name){\n <div class=\"--item-container\" [class.!ax-hidden]=\"widget.options()['visibility'] == false\">\n <!-- Title and Description Section -->\n <div class=\"ax-col-span-12 md:ax-col-span-4 lg:ax-col-span-4 2xl:ax-col-span-3 \">\n @if(j.title) {\n <axp-layout-title>{{ j.title | translate | async }}</axp-layout-title>\n } @if(j.description) {\n <axp-layout-description>{{ j.description | translate | async }}</axp-layout-description>\n }\n </div>\n <ax-form-field class=\"ax-flex ax-w-full\" [gridLayout]=\"j.layout ?? defaultLayout()\">\n <ng-container axp-widget-renderer [node]=\"j.widget\" [mode]=\"'edit'\" #widget=\"widgetRenderer\">\n </ng-container>\n </ax-form-field>\n </div>\n }\n </axp-layout-content>\n </axp-layout-section>\n </ng-template>\n </axp-widgets-container>\n</ax-form>" }]
|
100
|
+
}] });
|
101
|
+
|
102
|
+
export { AXPSettingsViewComponent };
|
103
|
+
//# sourceMappingURL=acorex-modules-settings-management-setting-view.component-B_6RIU9e.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acorex-modules-settings-management-setting-view.component-B_6RIU9e.mjs","sources":["../../../../libs/modules/settings-management/src/lib/features/settings/setting-view/setting-view.component.ts","../../../../libs/modules/settings-management/src/lib/features/settings/setting-view/setting-view.component.html"],"sourcesContent":["import { AXBadgeModule } from '@acorex/components/badge';\nimport { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXDropdownButtonModule } from '@acorex/components/dropdown-button';\nimport { AXFormComponent, AXFormModule } from '@acorex/components/form';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXSearchBoxModule } from '@acorex/components/search-box';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXValidationModule } from '@acorex/core/validation';\nimport { AXPGridLayoutDirective } from '@acorex/platform/common';\nimport { AXPLayoutBuilderModule, AXPLayoutContextChangeEvent, AXPWidgetContainerComponent } from '@acorex/platform/layout/builder';\nimport {\n AXPLayoutThemeService,\n AXPThemeLayoutBlockComponent,\n AXPThemeLayoutHeaderComponent,\n AXPThemeLayoutSectionComponent,\n} from '@acorex/platform/themes/shared';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n Injector,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AXPSettingsViewModel } from '../settings.viewmodel';\n\n@Component({\n templateUrl: 'setting-view.component.html',\n imports: [\n CommonModule,\n FormsModule,\n //\n AXDecoratorModule,\n AXBreadcrumbsModule,\n AXButtonModule,\n AXBadgeModule,\n AXTranslationModule,\n AXSearchBoxModule,\n AXDropdownButtonModule,\n AXLoadingModule,\n AXFormModule,\n AXValidationModule,\n //\n AXPLayoutBuilderModule,\n AXPThemeLayoutBlockComponent,\n AXPThemeLayoutHeaderComponent,\n AXPThemeLayoutSectionComponent,\n AXPGridLayoutDirective\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'ax-w-full',\n },\n})\nexport class AXPSettingsViewComponent {\n protected vm = inject(AXPSettingsViewModel);\n protected injector = inject(Injector);\n protected layoutService = inject(AXPLayoutThemeService);\n private form = viewChild(AXFormComponent);\n private container = viewChild(AXPWidgetContainerComponent);\n\n protected defaultLayout = computed(() => {\n return {\n positions: {\n default: {\n colSpan: 12,\n },\n md: {\n colSpan: 8,\n },\n lg: {\n colSpan: 6,\n },\n xl: {\n colSpan: this.layoutService.isSideMenuOpen() ? 5 : 4,\n },\n xxl: {\n colSpan: 4,\n },\n },\n };\n });\n\n ngOnInit(): void {\n this.vm.registerForm(this.form()!);\n }\n\n #effect1 = effect(() => {\n this.container()?.builderService.setStatus(this.vm.status());\n });\n\n\n protected handleContextChanged(e: AXPLayoutContextChangeEvent) {\n if (e.state == 'initiated') {\n this.vm.updatePreviousContext(e.data);\n } else {\n this.vm.updateContext(e.data);\n }\n }\n}\n","<ax-form>\n <axp-widgets-container [context]=\"vm.context()\" (onContextChanged)=\"handleContextChanged($event)\" *translate=\"let t\">\n @if(vm.isSearching() && vm.searchResults()!.length>0) {\n <!-- Search Result -->\n @for(group of vm.searchResults(); track group.name;let first=$first) {\n <p class=\"ax-text-lg md:ax-text-xl ax-font-semibold ax-py-3 ax-text-neutral-500\" [class.ax-pt-0]=\"first\">\n {{ group.title | translate | async }}\n </p>\n <axp-layout-sections>\n @for (section of group.sections; track section.name) {\n <ng-container [ngTemplateOutlet]=\"sectionTpl\" [ngTemplateOutletContext]=\"{ section }\"\n [ngTemplateOutletInjector]=\"injector\"></ng-container>\n }\n </axp-layout-sections>\n } }\n <!-- Not Found -->\n @else if(vm.isSearching() && vm.searchResults()!.length===0) {\n <div class=\"ax-p-2\">\n <div\n class=\"ax-mt-3 ax-flex ax-flex-col ax-justify-center ax-h-[calc(100vh-236px)] ax-items-center ax-p-10 ax-gap-10\">\n <p class=\"ax-text-xl md:ax-text-2xl ax-font-bold\">\n {{ t('search.not-found', { scope: 'settings' }) | async }}\n </p>\n </div>\n </div>\n }\n <!-- Group -->\n @else if(vm.activateGroup()?.sections) {\n <axp-layout-sections>\n @for(section of vm.activateGroup()?.sections; track section.name) {\n <ng-container [ngTemplateOutlet]=\"sectionTpl\" [ngTemplateOutletContext]=\"{ section }\"\n [ngTemplateOutletInjector]=\"injector\"></ng-container>\n }\n </axp-layout-sections>\n }\n <ng-template #sectionTpl let-section=\"section\">\n <axp-layout-section>\n <axp-layout-header>\n <axp-layout-title>\n {{ section.title | translate | async }}\n </axp-layout-title>\n @if(section.description) {\n <axp-layout-description>\n {{ section.description | translate | async }}\n </axp-layout-description>\n }\n </axp-layout-header>\n <axp-layout-content>\n <!-- Settings Item -->\n @for(j of section.settings; track j.name){\n <div class=\"--item-container\" [class.!ax-hidden]=\"widget.options()['visibility'] == false\">\n <!-- Title and Description Section -->\n <div class=\"ax-col-span-12 md:ax-col-span-4 lg:ax-col-span-4 2xl:ax-col-span-3 \">\n @if(j.title) {\n <axp-layout-title>{{ j.title | translate | async }}</axp-layout-title>\n } @if(j.description) {\n <axp-layout-description>{{ j.description | translate | async }}</axp-layout-description>\n }\n </div>\n <ax-form-field class=\"ax-flex ax-w-full\" [gridLayout]=\"j.layout ?? defaultLayout()\">\n <ng-container axp-widget-renderer [node]=\"j.widget\" [mode]=\"'edit'\" #widget=\"widgetRenderer\">\n </ng-container>\n </ax-form-field>\n </div>\n }\n </axp-layout-content>\n </axp-layout-section>\n </ng-template>\n </axp-widgets-container>\n</ax-form>"],"names":["i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MA6Da,wBAAwB,CAAA;AA7BrC,IAAA,WAAA,GAAA;AA8BY,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAA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EAAE,WAAW;AACnB,qBAAA,EAAA,QAAA,EAAA,+iGAAA,EAAA;;;;;"}
|
@@ -0,0 +1,442 @@
|
|
1
|
+
import { AXPSettingDefinitionProviderService, AXPSettingService, AXP_SEARCH_PROVIDER, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
|
2
|
+
import { AXPPageStatus } from '@acorex/platform/layout/builder';
|
3
|
+
import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
|
4
|
+
import * as i0 from '@angular/core';
|
5
|
+
import { computed, inject, NgModule } from '@angular/core';
|
6
|
+
import { signalStore, withState, withComputed, withMethods, patchState, withHooks } from '@ngrx/signals';
|
7
|
+
import { get, isEqual, isNil, isEmpty, sortBy } from 'lodash-es';
|
8
|
+
import { filter, merge } from 'rxjs';
|
9
|
+
import { AXToastService } from '@acorex/components/toast';
|
10
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
11
|
+
import * as i1 from '@acorex/platform/core';
|
12
|
+
import { resolvePlatformScopeName, AXPPlatformScope } from '@acorex/platform/core';
|
13
|
+
import { AXLocaleService } from '@acorex/core/locale';
|
14
|
+
import { ROUTES } from '@angular/router';
|
15
|
+
import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
|
16
|
+
import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
|
17
|
+
|
18
|
+
function searchSettings(groups, search) {
|
19
|
+
const sectionMatchResult = [];
|
20
|
+
const settingMatchResult = [];
|
21
|
+
const processedGroups = new Set();
|
22
|
+
const createGroupIdentifier = (group) => `${group.name}-${group.title}`;
|
23
|
+
const addGroupToResult = (group, sections, resultArray) => {
|
24
|
+
const groupId = createGroupIdentifier(group);
|
25
|
+
if (!processedGroups.has(groupId)) {
|
26
|
+
resultArray.push({
|
27
|
+
...group,
|
28
|
+
sections,
|
29
|
+
groups: [], // Exclude nested groups
|
30
|
+
});
|
31
|
+
processedGroups.add(groupId);
|
32
|
+
}
|
33
|
+
};
|
34
|
+
const processSections = (group, filterFn) => {
|
35
|
+
const matchedSections = group.sections.filter(filterFn);
|
36
|
+
if (matchedSections.length > 0) {
|
37
|
+
addGroupToResult(group, matchedSections, sectionMatchResult);
|
38
|
+
}
|
39
|
+
};
|
40
|
+
const processSettings = (group, filterFn) => {
|
41
|
+
const matchedSections = group.sections
|
42
|
+
.map(filterFn)
|
43
|
+
.filter((section) => section !== null);
|
44
|
+
if (matchedSections.length > 0) {
|
45
|
+
addGroupToResult(group, matchedSections, settingMatchResult);
|
46
|
+
}
|
47
|
+
};
|
48
|
+
const sectionMatches = (section) => section.name.toLowerCase().includes(search.toLowerCase()) ||
|
49
|
+
section.title.toLowerCase().includes(search.toLowerCase());
|
50
|
+
const filterSettings = (section) => {
|
51
|
+
const matchedSettings = section.settings.filter((setting) => setting.name.toLowerCase().includes(search.toLowerCase()) ||
|
52
|
+
setting.title.toLowerCase().includes(search.toLowerCase()));
|
53
|
+
return matchedSettings.length > 0 ? { ...section, settings: matchedSettings } : null;
|
54
|
+
};
|
55
|
+
const processGroupRecursively = (group) => {
|
56
|
+
processSections(group, sectionMatches); // Match sections with all settings
|
57
|
+
processSettings(group, filterSettings); // Match settings within sections
|
58
|
+
group.groups.forEach(processGroupRecursively); // Recurse into nested groups
|
59
|
+
};
|
60
|
+
groups.forEach(processGroupRecursively);
|
61
|
+
return [...sectionMatchResult, ...settingMatchResult];
|
62
|
+
}
|
63
|
+
|
64
|
+
const AXPSettingsViewModel = signalStore(withState(() => ({
|
65
|
+
groups: [],
|
66
|
+
activateGroup: undefined,
|
67
|
+
scope: 'U',
|
68
|
+
//
|
69
|
+
searchExpression: null,
|
70
|
+
//
|
71
|
+
previousContext: {},
|
72
|
+
context: {},
|
73
|
+
//
|
74
|
+
status: AXPPageStatus.Processing,
|
75
|
+
form: null,
|
76
|
+
})), withComputed((store, layout = inject(AXPLayoutThemeService)) => ({
|
77
|
+
searchResults: computed(() => searchSettings(store.groups(), store.searchExpression())),
|
78
|
+
hasActivateGroup: computed(() => store.activateGroup() != null),
|
79
|
+
showGroups: computed(() => store.activateGroup() != null && layout.isLarge()),
|
80
|
+
scopeTitle: computed(() => {
|
81
|
+
return `${resolvePlatformScopeName(store.scope())}.title`;
|
82
|
+
}),
|
83
|
+
scopeDescription: computed(() => {
|
84
|
+
return `${resolvePlatformScopeName(store.scope())}.description`;
|
85
|
+
}),
|
86
|
+
isSearching: computed(() => store.searchExpression() != null),
|
87
|
+
isBusy: computed(() => store.status() == AXPPageStatus.Processing),
|
88
|
+
isSaving: computed(() => store.status() == AXPPageStatus.Submitting),
|
89
|
+
isLoaded: computed(() => store.groups().length > 0),
|
90
|
+
})), withMethods((store, settingDefinitionService = inject(AXPSettingDefinitionProviderService), settingValueService = inject(AXPSettingService), toastService = inject(AXToastService), translateService = inject(AXTranslationService)) => ({
|
91
|
+
registerForm(form) {
|
92
|
+
patchState(store, {
|
93
|
+
form: form,
|
94
|
+
});
|
95
|
+
},
|
96
|
+
async load(scope) {
|
97
|
+
patchState(store, {
|
98
|
+
scope: scope,
|
99
|
+
status: AXPPageStatus.Processing,
|
100
|
+
});
|
101
|
+
//
|
102
|
+
const groups = await settingDefinitionService.getListAsync(scope);
|
103
|
+
patchState(store, {
|
104
|
+
groups: groups,
|
105
|
+
});
|
106
|
+
const currentContext = await settingValueService.scope(scope).all();
|
107
|
+
const defaults = await settingValueService.scope(scope).defaultValues();
|
108
|
+
patchState(store, {
|
109
|
+
context: { ...defaults, ...currentContext },
|
110
|
+
});
|
111
|
+
patchState(store, {
|
112
|
+
previousContext: store.context(),
|
113
|
+
status: AXPPageStatus.Rendered,
|
114
|
+
});
|
115
|
+
},
|
116
|
+
async reload() {
|
117
|
+
await settingDefinitionService.reload();
|
118
|
+
const groups = await settingDefinitionService.getListAsync(store.scope());
|
119
|
+
const oldActivateGroupName = store.activateGroup()?.name;
|
120
|
+
patchState(store, {
|
121
|
+
groups: groups,
|
122
|
+
activateGroup: undefined,
|
123
|
+
});
|
124
|
+
if (oldActivateGroupName) {
|
125
|
+
this.setActivateGroupByName(oldActivateGroupName);
|
126
|
+
}
|
127
|
+
},
|
128
|
+
updateContext(context) {
|
129
|
+
patchState(store, {
|
130
|
+
context: { ...store.context(), ...context },
|
131
|
+
});
|
132
|
+
},
|
133
|
+
updatePreviousContext(context) {
|
134
|
+
patchState(store, {
|
135
|
+
previousContext: { ...store.previousContext(), ...context },
|
136
|
+
});
|
137
|
+
},
|
138
|
+
setActivateGroup(group) {
|
139
|
+
patchState(store, {
|
140
|
+
activateGroup: group,
|
141
|
+
});
|
142
|
+
},
|
143
|
+
unloadActivateGroup() {
|
144
|
+
patchState(store, {
|
145
|
+
activateGroup: undefined,
|
146
|
+
});
|
147
|
+
},
|
148
|
+
setActivateGroupByName(name) {
|
149
|
+
const group = store.groups().find(g => g.name === name);
|
150
|
+
if (group) {
|
151
|
+
patchState(store, {
|
152
|
+
activateGroup: group,
|
153
|
+
});
|
154
|
+
}
|
155
|
+
},
|
156
|
+
//
|
157
|
+
async search(expression) {
|
158
|
+
if (!isNil(expression) && !isEmpty(expression)) {
|
159
|
+
patchState(store, {
|
160
|
+
searchExpression: expression,
|
161
|
+
});
|
162
|
+
}
|
163
|
+
else {
|
164
|
+
patchState(store, {
|
165
|
+
searchExpression: null,
|
166
|
+
});
|
167
|
+
}
|
168
|
+
},
|
169
|
+
clearSearch() {
|
170
|
+
patchState(store, {
|
171
|
+
searchExpression: null,
|
172
|
+
});
|
173
|
+
},
|
174
|
+
isDirty() {
|
175
|
+
return store.groups()?.some((group) => group.sections.some((sec) => sec.settings.some((setting) => {
|
176
|
+
const currentValue = get(store.context(), setting.name);
|
177
|
+
const previousValue = get(store.previousContext(), setting.name);
|
178
|
+
return !isEqual(currentValue, previousValue);
|
179
|
+
}))) || false;
|
180
|
+
},
|
181
|
+
async apply() {
|
182
|
+
const i18nScope = "settings";
|
183
|
+
try {
|
184
|
+
if (await store.form() && this.isDirty()) {
|
185
|
+
const form = store.form();
|
186
|
+
form.resetErrors();
|
187
|
+
//
|
188
|
+
patchState(store, {
|
189
|
+
status: AXPPageStatus.Submitting,
|
190
|
+
});
|
191
|
+
const formResult = await form.validate();
|
192
|
+
if (!formResult.result) {
|
193
|
+
toastService.show({
|
194
|
+
color: 'danger',
|
195
|
+
title: await translateService.translateAsync('actions.apply.invalid.title', { scope: i18nScope }),
|
196
|
+
content: await translateService.translateAsync('actions.apply.invalid.message', { scope: i18nScope }),
|
197
|
+
location: 'bottom-center',
|
198
|
+
closeButton: true,
|
199
|
+
timeOut: 3000,
|
200
|
+
timeOutProgress: true,
|
201
|
+
});
|
202
|
+
patchState(store, {
|
203
|
+
status: AXPPageStatus.Error,
|
204
|
+
});
|
205
|
+
return false;
|
206
|
+
}
|
207
|
+
await settingValueService.scope(store.scope()).set(store.context());
|
208
|
+
// Show success notification
|
209
|
+
toastService.show({
|
210
|
+
color: 'success',
|
211
|
+
title: await translateService.translateAsync('actions.apply.success.title', { scope: i18nScope }),
|
212
|
+
content: await translateService.translateAsync('actions.apply.success.message', { scope: i18nScope }),
|
213
|
+
location: 'bottom-center',
|
214
|
+
closeButton: true,
|
215
|
+
timeOut: 3000,
|
216
|
+
timeOutProgress: true,
|
217
|
+
});
|
218
|
+
patchState(store, {
|
219
|
+
status: AXPPageStatus.Submitted,
|
220
|
+
});
|
221
|
+
return true;
|
222
|
+
}
|
223
|
+
return false;
|
224
|
+
}
|
225
|
+
catch (error) {
|
226
|
+
toastService.show({
|
227
|
+
color: 'danger',
|
228
|
+
title: await translateService.translateAsync('actions.apply.error.title', { scope: i18nScope }),
|
229
|
+
content: await translateService.translateAsync('actions.apply.error.message', { scope: i18nScope }),
|
230
|
+
location: 'bottom-center',
|
231
|
+
closeButton: true,
|
232
|
+
timeOut: 3000,
|
233
|
+
timeOutProgress: true,
|
234
|
+
});
|
235
|
+
patchState(store, {
|
236
|
+
status: AXPPageStatus.Error,
|
237
|
+
});
|
238
|
+
return false;
|
239
|
+
}
|
240
|
+
},
|
241
|
+
async discard() {
|
242
|
+
const form = store.form();
|
243
|
+
form.resetErrors();
|
244
|
+
//
|
245
|
+
patchState(store, {
|
246
|
+
status: AXPPageStatus.Rendered,
|
247
|
+
});
|
248
|
+
patchState(store, {
|
249
|
+
context: store.previousContext(),
|
250
|
+
});
|
251
|
+
},
|
252
|
+
async resetToDefault() {
|
253
|
+
// Update the context with the defaults
|
254
|
+
const defaults = await settingValueService.scope(store.scope()).defaultValues();
|
255
|
+
patchState(store, {
|
256
|
+
context: defaults,
|
257
|
+
});
|
258
|
+
//
|
259
|
+
const result = await this.apply();
|
260
|
+
if (!result) {
|
261
|
+
this.discard();
|
262
|
+
}
|
263
|
+
},
|
264
|
+
})), withHooks((store, settingValueService = inject(AXPSettingService), translationService = inject(AXTranslationService), localeService = inject(AXLocaleService)) => ({
|
265
|
+
async onInit() {
|
266
|
+
//
|
267
|
+
settingValueService.onChanged.pipe(filter((c) => c.scope == store.scope())).subscribe((e) => {
|
268
|
+
e.keys.forEach((k) => {
|
269
|
+
const currentValue = e.values[k];
|
270
|
+
const contextValue = get(store.context(), k);
|
271
|
+
const previousValue = get(store.previousContext(), k);
|
272
|
+
// Update only if there are actual changes
|
273
|
+
if (!isEqual(previousValue, currentValue) || !isEqual(currentValue, contextValue)) {
|
274
|
+
patchState(store, {
|
275
|
+
previousContext: {
|
276
|
+
...store.previousContext(),
|
277
|
+
[k]: currentValue,
|
278
|
+
}
|
279
|
+
});
|
280
|
+
patchState(store, {
|
281
|
+
context: {
|
282
|
+
...store.context(),
|
283
|
+
[k]: currentValue,
|
284
|
+
}
|
285
|
+
});
|
286
|
+
}
|
287
|
+
});
|
288
|
+
});
|
289
|
+
//
|
290
|
+
merge(translationService.langChanges$, localeService.profileChanged$).subscribe(async () => {
|
291
|
+
await store.reload();
|
292
|
+
});
|
293
|
+
},
|
294
|
+
onDestroy() { },
|
295
|
+
})));
|
296
|
+
|
297
|
+
class AXPSettingSearchProvider {
|
298
|
+
constructor() {
|
299
|
+
this.settingService = inject(AXPSettingDefinitionProviderService);
|
300
|
+
this.sessionService = inject(AXPSessionService);
|
301
|
+
}
|
302
|
+
async search(text) {
|
303
|
+
const groupsSetting = this.settingService.getList(AXPPlatformScope.User);
|
304
|
+
if (groupsSetting.length == 0) {
|
305
|
+
groupsSetting.push(...(await this.settingService.getListAsync(AXPPlatformScope.User)));
|
306
|
+
}
|
307
|
+
// Step 2: Flatten settings from groups
|
308
|
+
const allSettings = [];
|
309
|
+
const extractSettings = (group) => {
|
310
|
+
for (const section of group.sections) {
|
311
|
+
allSettings.push(...section.settings.map((x) => ({ ...x, group })));
|
312
|
+
}
|
313
|
+
for (const subGroup of group.groups) {
|
314
|
+
extractSettings(subGroup); // Recursive extraction
|
315
|
+
}
|
316
|
+
};
|
317
|
+
for (const group of groupsSetting) {
|
318
|
+
extractSettings(group);
|
319
|
+
}
|
320
|
+
// Step 3: Search settings by title
|
321
|
+
const searchResults = allSettings.filter((setting) => setting.title.toLowerCase().includes(text.toLowerCase()));
|
322
|
+
return sortBy(searchResults.map((setting) => ({
|
323
|
+
title: setting.title,
|
324
|
+
description: setting.description,
|
325
|
+
group: 'setting',
|
326
|
+
data: setting,
|
327
|
+
command: {
|
328
|
+
name: 'navigate',
|
329
|
+
options: {
|
330
|
+
type: 'router',
|
331
|
+
options: {
|
332
|
+
path: `/${this.sessionService.application?.name}/settings/user/${setting.group.name}#${setting.title}`,
|
333
|
+
},
|
334
|
+
}
|
335
|
+
},
|
336
|
+
parent: setting.group
|
337
|
+
? {
|
338
|
+
title: setting.group.title,
|
339
|
+
data: setting.group,
|
340
|
+
}
|
341
|
+
: undefined,
|
342
|
+
})), ['title']);
|
343
|
+
}
|
344
|
+
}
|
345
|
+
|
346
|
+
class AXPSettingSearchDefinitionProvider {
|
347
|
+
async provide(context) {
|
348
|
+
context.addDefinition('setting', 'Setting', 'setting', 'fa-solid fa-gear', 3, {
|
349
|
+
format: {
|
350
|
+
id: '{{data.name}}',
|
351
|
+
},
|
352
|
+
actions: [
|
353
|
+
{
|
354
|
+
name: 'navigate',
|
355
|
+
type: 'view',
|
356
|
+
priority: 'primary',
|
357
|
+
},
|
358
|
+
],
|
359
|
+
});
|
360
|
+
}
|
361
|
+
}
|
362
|
+
|
363
|
+
function routesFacory() {
|
364
|
+
let routes = [
|
365
|
+
{
|
366
|
+
path: ':app/settings/:scope',
|
367
|
+
canActivate: [AXPAuthGuard],
|
368
|
+
loadComponent: () => {
|
369
|
+
return AXPRootLayoutComponent;
|
370
|
+
},
|
371
|
+
children: [
|
372
|
+
{
|
373
|
+
path: '',
|
374
|
+
loadComponent: () => import('./acorex-modules-settings-management-setting-page.component-XDFtTqft.mjs').then((c) => c.AXPSettingPageComponent),
|
375
|
+
data: { reuse: true },
|
376
|
+
children: [
|
377
|
+
{
|
378
|
+
path: ':group',
|
379
|
+
loadComponent: () => import('./acorex-modules-settings-management-setting-view.component-B_6RIU9e.mjs').then((c) => c.AXPSettingsViewComponent),
|
380
|
+
},
|
381
|
+
],
|
382
|
+
},
|
383
|
+
],
|
384
|
+
},
|
385
|
+
];
|
386
|
+
return routes;
|
387
|
+
}
|
388
|
+
class AXMSettingsManagementModule {
|
389
|
+
constructor(appInitService, injector) {
|
390
|
+
}
|
391
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMSettingsManagementModule, deps: [{ token: i1.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
392
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXMSettingsManagementModule }); }
|
393
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMSettingsManagementModule, providers: [
|
394
|
+
{
|
395
|
+
provide: AXP_SEARCH_PROVIDER,
|
396
|
+
useClass: AXPSettingSearchProvider,
|
397
|
+
multi: true,
|
398
|
+
},
|
399
|
+
{
|
400
|
+
provide: AXP_SEARCH_DEFINITION_PROVIDER,
|
401
|
+
useClass: AXPSettingSearchDefinitionProvider,
|
402
|
+
multi: true,
|
403
|
+
},
|
404
|
+
{
|
405
|
+
provide: ROUTES,
|
406
|
+
multi: true,
|
407
|
+
useFactory: routesFacory,
|
408
|
+
},
|
409
|
+
] }); }
|
410
|
+
}
|
411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMSettingsManagementModule, decorators: [{
|
412
|
+
type: NgModule,
|
413
|
+
args: [{
|
414
|
+
imports: [],
|
415
|
+
exports: [],
|
416
|
+
declarations: [],
|
417
|
+
providers: [
|
418
|
+
{
|
419
|
+
provide: AXP_SEARCH_PROVIDER,
|
420
|
+
useClass: AXPSettingSearchProvider,
|
421
|
+
multi: true,
|
422
|
+
},
|
423
|
+
{
|
424
|
+
provide: AXP_SEARCH_DEFINITION_PROVIDER,
|
425
|
+
useClass: AXPSettingSearchDefinitionProvider,
|
426
|
+
multi: true,
|
427
|
+
},
|
428
|
+
{
|
429
|
+
provide: ROUTES,
|
430
|
+
multi: true,
|
431
|
+
useFactory: routesFacory,
|
432
|
+
},
|
433
|
+
]
|
434
|
+
}]
|
435
|
+
}], ctorParameters: () => [{ type: i1.AXPAppStartUpService }, { type: i0.Injector }] });
|
436
|
+
|
437
|
+
/**
|
438
|
+
* Generated bundle index. Do not edit.
|
439
|
+
*/
|
440
|
+
|
441
|
+
export { AXMSettingsManagementModule, AXPSettingsViewModel };
|
442
|
+
//# sourceMappingURL=acorex-modules-settings-management.mjs.map
|