@acorex/platform 19.1.3 → 19.1.5
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/app/application.types.d.ts +2 -2
- package/common/lib/file-storage/file-storage.service.d.ts +13 -0
- package/common/lib/file-storage/file-storage.types.d.ts +143 -0
- package/common/lib/file-storage/index.d.ts +2 -0
- package/common/lib/filters/filters.types.d.ts +2 -1
- package/common/lib/settings/setting-definition.provider.d.ts +12 -5
- package/common/lib/settings/setting.builder.d.ts +4 -3
- package/common/lib/settings/settings.provider.d.ts +2 -7
- package/common/lib/settings/settings.service.d.ts +19 -7
- package/common/lib/settings/settings.types.d.ts +15 -2
- package/common/lib/workflows/common.workflow.d.ts +11 -0
- package/core/utils/highlighter.d.ts +1 -1
- package/fesm2022/acorex-platform-common.mjs +194 -74
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +2 -2
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +290 -456
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +13 -13
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +595 -584
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-filters.mjs +82 -6
- package/fesm2022/acorex-platform-layout-filters.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-setting.mjs +73 -91
- package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
- package/fesm2022/acorex-platform-layouts.mjs +3 -4
- package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-K9B_-q_K.mjs +108 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-K9B_-q_K.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xlBBA76O.mjs +369 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xlBBA76O.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Cd2gxLZt.mjs +87 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Cd2gxLZt.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-6sZdw013.mjs +130 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-6sZdw013.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-setting-page.component-BYpCgHZb.mjs +74 -0
- package/fesm2022/acorex-platform-themes-default-setting-page.component-BYpCgHZb.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-CdmIphX1.mjs +73 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-CdmIphX1.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +20 -20
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +288 -81
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-05nKV-UV.mjs → acorex-platform-widgets-checkbox-widget-column.component-jeZBOEhl.mjs} +18 -14
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-jeZBOEhl.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs → acorex-platform-widgets-checkbox-widget-designer.component-D8KErkus.mjs} +3 -3
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs.map → acorex-platform-widgets-checkbox-widget-designer.component-D8KErkus.mjs.map} +1 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-DU1niJES.mjs +64 -0
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-DU1niJES.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +2306 -549
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +9 -3
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/lib/builder/builder.module.d.ts +10 -10
- package/layout/builder/lib/builder/builder.service.d.ts +9 -10
- package/layout/builder/lib/builder/context-store.service.d.ts +33 -0
- package/layout/builder/lib/builder/index.d.ts +4 -2
- package/layout/builder/lib/builder/widget-catalog.d.ts +1 -1
- package/layout/builder/lib/builder/widget-container.component.d.ts +34 -9
- package/layout/builder/lib/builder/widget-groups.d.ts +1 -0
- package/layout/builder/lib/builder/widget-map.d.ts +48 -0
- package/layout/builder/lib/builder/widget-placeholder.component.d.ts +5 -0
- package/layout/builder/lib/builder/{widget-renderer.component.directive.d.ts → widget-renderer.directive.d.ts} +27 -1
- package/layout/builder/lib/builder/widget-status.types.d.ts +14 -0
- package/layout/builder/lib/builder/widget.types.d.ts +45 -55
- package/layout/designer/lib/preview/preview-viewer.component.d.ts +2 -2
- package/layout/designer/lib/property-viewer/widget-property-viewer.component.d.ts +2 -2
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +7 -2
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +0 -1
- package/layout/filters/lib/filters.viewmodel.d.ts +13 -3
- package/layout/setting/lib/convert-setting-data.d.ts +0 -20
- package/layout/setting/lib/setting.viewmodel.d.ts +65 -4
- package/layouts/lib/admin/entity-layout/entity-details-view/entity-details-view.component.d.ts +15 -5
- package/package.json +9 -9
- package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +15 -5
- package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +15 -5
- package/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.d.ts +2 -1
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +17 -6
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-filters/list-view-option-filters.component.d.ts +6 -3
- package/themes/default/lib/layouts/entity-layouts/entity-master-modify-view/entity-master-modify-view.component.d.ts +2 -1
- package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +15 -5
- package/themes/default/lib/layouts/filters-layout/simple-filter-builder/filters-view.component.d.ts +6 -5
- package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +15 -5
- package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +15 -5
- package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +0 -47
- package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +19 -5
- package/themes/shared/index.d.ts +3 -1
- package/themes/shared/lib/components/theme-slot.component.d.ts +23 -13
- package/themes/shared/lib/palette.provider.d.ts +9 -0
- package/themes/shared/lib/setting.keys.d.ts +7 -2
- package/themes/shared/lib/setting.provider.d.ts +1 -0
- package/themes/shared/lib/shared.module.d.ts +2 -1
- package/themes/shared/lib/{services/theme.service.d.ts → theme.service.d.ts} +16 -24
- package/themes/shared/lib/theme.types.d.ts +25 -0
- package/themes/shared/lib/widgets/theme-color-selection/index.d.ts +2 -0
- package/themes/shared/lib/widgets/theme-color-selection/theme-color-selection-widget-edit.component.d.ts +6 -0
- package/themes/shared/lib/widgets/theme-color-selection/theme-color-selection-widget.config.d.ts +7 -0
- package/widgets/lib/properties/layout.props.d.ts +1 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-column.component.d.ts +6 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-designer.component.d.ts +6 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-edit.component.d.ts +18 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-print.component.d.ts +6 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-view.component.d.ts +6 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/advance/avatar/index.d.ts +6 -0
- package/widgets/lib/widgets/advance/map/map-box-widget-edit.component.d.ts +9 -5
- package/widgets/lib/widgets/advance/map/map-box-widget-view.component.d.ts +6 -4
- package/widgets/lib/widgets/editors/number/number-box-widget-edit.component.d.ts +1 -7
- package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/toggle/toggle-widget-edit.component.d.ts +0 -2
- package/widgets/lib/widgets/filters/boolean-filter/boolean-filter-widget-edit.component.d.ts +18 -0
- package/widgets/lib/widgets/filters/boolean-filter/boolean-filter-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/filters/boolean-filter/index.d.ts +2 -0
- package/widgets/lib/widgets/filters/date-time-filter/date-time-filter-widget-edit.component.d.ts +20 -0
- package/widgets/lib/widgets/filters/date-time-filter/date-time-filter-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/filters/date-time-filter/index.d.ts +2 -0
- package/widgets/lib/widgets/filters/number-filter/index.d.ts +2 -0
- package/widgets/lib/widgets/filters/number-filter/number-filter-widget-edit.component.d.ts +12 -0
- package/widgets/lib/widgets/filters/number-filter/number-filter-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/filters/operations/operations.component.d.ts +9 -0
- package/widgets/lib/widgets/filters/select-filter/index.d.ts +2 -0
- package/widgets/lib/widgets/filters/select-filter/select-filter-widget-edit.component.d.ts +16 -0
- package/widgets/lib/widgets/filters/select-filter/select-filter-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/filters/string-filter/index.d.ts +2 -0
- package/widgets/lib/widgets/filters/string-filter/string-filter-widget-edit.component.d.ts +12 -0
- package/widgets/lib/widgets/filters/string-filter/string-filter-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/index.d.ts +5 -1
- package/widgets/lib/widgets/property-editors/border/border-widget-editor.component.d.ts +29 -7
- package/widgets/lib/widgets/property-editors/border/index.d.ts +0 -1
- package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget-editor.component.d.ts +36 -0
- package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget.type.d.ts +18 -0
- package/widgets/lib/widgets/property-editors/flex-options/index.d.ts +3 -0
- package/widgets/lib/widgets/property-editors/property-editor-helper.d.ts +82 -0
- package/widgets/lib/widgets/property-editors/property-editor.type.d.ts +35 -0
- package/widgets/lib/widgets/property-editors/spacing/index.d.ts +0 -1
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-editor.component.d.ts +11 -9
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs +0 -108
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs +0 -368
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs +0 -87
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs +0 -130
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs +0 -78
- package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs +0 -58
- package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-05nKV-UV.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-BkWcZ4K9.mjs +0 -72
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-BkWcZ4K9.mjs.map +0 -1
- package/layout/builder/lib/builder/widget-renderer.component.d.ts +0 -48
- package/widgets/lib/widgets/property-editors/border/border-widget-type.d.ts +0 -18
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-type.d.ts +0 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, provideAppInitializer, inject, RendererFactory2, InjectionToken, Injector, ErrorHandler, NgModule, Inject, Directive, Input, EventEmitter, Output, runInInjectionContext, Optional, Component, ViewEncapsulation, ChangeDetectorRef, ChangeDetectionStrategy, ViewChild } from '@angular/core';
|
|
3
|
-
import { kebabCase, merge, cloneDeep, sortBy, assign, isEqual,
|
|
3
|
+
import { kebabCase, merge, cloneDeep, get, sortBy, assign, isEqual, set } from 'lodash-es';
|
|
4
4
|
import { AXPopupModule } from '@acorex/components/popup';
|
|
5
5
|
import { AXToastService, AXToastModule } from '@acorex/components/toast';
|
|
6
6
|
import { AXDateTimeModule } from '@acorex/core/date-time';
|
|
@@ -115,7 +115,7 @@ function resolveActionLook(tr) {
|
|
|
115
115
|
case 'update':
|
|
116
116
|
return { color: 'primary', icon: 'fa-solid fa-pen-to-square' };
|
|
117
117
|
case 'print':
|
|
118
|
-
return { color: '
|
|
118
|
+
return { color: 'neutral', icon: 'fa-solid fa-print' };
|
|
119
119
|
case 'confirm':
|
|
120
120
|
return { color: 'success', icon: 'fa-solid fa-check' };
|
|
121
121
|
case 'archive':
|
|
@@ -672,7 +672,6 @@ class AXPFilterOperatorMiddlewareServiceImpl extends AXPFilterOperatorMiddleware
|
|
|
672
672
|
return filters.map((filter) => this.transformFilter(filter));
|
|
673
673
|
}
|
|
674
674
|
transformFilter(filter) {
|
|
675
|
-
console.log(filter);
|
|
676
675
|
const { operator, value, filters, field } = filter;
|
|
677
676
|
// Find the operator (either default or custom)
|
|
678
677
|
const filterOperator = this.operators[operator?.type] || null;
|
|
@@ -765,6 +764,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
765
764
|
args: [{ providedIn: 'root' }]
|
|
766
765
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: AXPErrorHandlerRegistryService }] });
|
|
767
766
|
|
|
767
|
+
var AXPSettingScope;
|
|
768
|
+
(function (AXPSettingScope) {
|
|
769
|
+
AXPSettingScope["Environment"] = "C";
|
|
770
|
+
AXPSettingScope["Global"] = "G";
|
|
771
|
+
AXPSettingScope["Tenant"] = "T";
|
|
772
|
+
AXPSettingScope["User"] = "U";
|
|
773
|
+
})(AXPSettingScope || (AXPSettingScope = {}));
|
|
774
|
+
;
|
|
775
|
+
|
|
768
776
|
class AXPSettingDefinitionProviderContext {
|
|
769
777
|
constructor() {
|
|
770
778
|
this.rootGroups = [];
|
|
@@ -863,7 +871,10 @@ class AXPSettingDefinitionSectionBuilder {
|
|
|
863
871
|
name: setting.key,
|
|
864
872
|
path: setting.key,
|
|
865
873
|
defaultValue: setting.defaultValue,
|
|
866
|
-
options: merge(setting.widget.options ?? {}, {
|
|
874
|
+
options: merge(setting.widget.options ?? {}, {
|
|
875
|
+
label: setting.widget.options?.['label'] ?? setting.title,
|
|
876
|
+
validationRules: setting.validationRules ?? [],
|
|
877
|
+
}),
|
|
867
878
|
valueTransforms: setting.valueTransforms,
|
|
868
879
|
triggers: setting.widget.triggers,
|
|
869
880
|
},
|
|
@@ -933,13 +944,13 @@ class AXPSettingDefinitionProviderService {
|
|
|
933
944
|
};
|
|
934
945
|
return filterByScope(this.cache, scope);
|
|
935
946
|
}
|
|
936
|
-
defaultValues(
|
|
947
|
+
async defaultValues() {
|
|
937
948
|
const defaults = {};
|
|
938
949
|
const collectDefaults = (groups) => {
|
|
939
950
|
groups.forEach((group) => {
|
|
940
951
|
group.sections.forEach((section) => {
|
|
941
952
|
section.settings.forEach((setting) => {
|
|
942
|
-
if (setting.defaultValue !== undefined
|
|
953
|
+
if (setting.defaultValue !== undefined) {
|
|
943
954
|
defaults[setting.name] = setting.defaultValue;
|
|
944
955
|
}
|
|
945
956
|
});
|
|
@@ -947,9 +958,10 @@ class AXPSettingDefinitionProviderService {
|
|
|
947
958
|
collectDefaults(group.groups);
|
|
948
959
|
});
|
|
949
960
|
};
|
|
950
|
-
if (this.cache) {
|
|
951
|
-
|
|
961
|
+
if (!this.cache) {
|
|
962
|
+
await this.load();
|
|
952
963
|
}
|
|
964
|
+
collectDefaults(this.cache);
|
|
953
965
|
return defaults;
|
|
954
966
|
}
|
|
955
967
|
findGroup(scope, groupName) {
|
|
@@ -986,17 +998,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
986
998
|
type: Injectable,
|
|
987
999
|
args: [{ providedIn: 'root' }]
|
|
988
1000
|
}] });
|
|
1001
|
+
class AXPSettingDefaultValueProvider {
|
|
1002
|
+
constructor() {
|
|
1003
|
+
this.definitionProvider = inject(AXPSettingDefinitionProviderService);
|
|
1004
|
+
}
|
|
1005
|
+
get scope() {
|
|
1006
|
+
return AXPSettingScope.Global;
|
|
1007
|
+
}
|
|
1008
|
+
async load() {
|
|
1009
|
+
return Object.entries(await this.definitionProvider.defaultValues()).map(c => ({ key: c[0], value: c[1] }));
|
|
1010
|
+
}
|
|
1011
|
+
set(key, value) {
|
|
1012
|
+
throw new Error('Method not implemented.');
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
989
1015
|
|
|
990
1016
|
const AXP_SETTING_VALUE_PROVIDER = new InjectionToken('AXP_SETTING_VALUE_PROVIDER', {
|
|
991
1017
|
providedIn: 'root',
|
|
992
1018
|
factory: () => {
|
|
993
|
-
return
|
|
1019
|
+
return [
|
|
1020
|
+
//new AXPSettingDefaultValueProvider(),
|
|
1021
|
+
new AXPSettingValueProviderDefault(AXPSettingScope.Tenant),
|
|
1022
|
+
new AXPSettingValueProviderDefault(AXPSettingScope.User)
|
|
1023
|
+
];
|
|
994
1024
|
}
|
|
995
1025
|
});
|
|
996
1026
|
class AXPSettingValueProviderDefault {
|
|
997
|
-
|
|
1027
|
+
get scope() {
|
|
1028
|
+
return this._scope;
|
|
1029
|
+
}
|
|
1030
|
+
constructor(_scope) {
|
|
1031
|
+
this._scope = _scope;
|
|
998
1032
|
this.cache = new Map();
|
|
999
|
-
this.localStorageKey =
|
|
1033
|
+
this.localStorageKey = `AXP_SETTINGS_SCOPE(${this.scope})`;
|
|
1000
1034
|
}
|
|
1001
1035
|
async load() {
|
|
1002
1036
|
// Load settings from localStorage as a single key
|
|
@@ -1034,64 +1068,83 @@ class AXPSettingValueProviderDefault {
|
|
|
1034
1068
|
|
|
1035
1069
|
class AXPSettingValueProviderService {
|
|
1036
1070
|
constructor() {
|
|
1037
|
-
this.
|
|
1038
|
-
this.
|
|
1071
|
+
this.providers = inject(AXP_SETTING_VALUE_PROVIDER);
|
|
1072
|
+
this.definitionService = inject(AXPSettingDefinitionProviderService);
|
|
1073
|
+
this.scopedSettingsCache = new Map();
|
|
1039
1074
|
this.onChanged = new Subject();
|
|
1075
|
+
// Initialize scoped caches for dynamic scopes
|
|
1076
|
+
const staticScopes = [AXPSettingScope.Environment, AXPSettingScope.Global, AXPSettingScope.Tenant, AXPSettingScope.User];
|
|
1077
|
+
staticScopes.forEach((scope) => {
|
|
1078
|
+
if (!this.scopedSettingsCache.has(scope)) {
|
|
1079
|
+
this.scopedSettingsCache.set(scope, new Map());
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1040
1082
|
}
|
|
1041
1083
|
async load() {
|
|
1042
1084
|
try {
|
|
1043
|
-
const settingsList =
|
|
1044
|
-
this.
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1085
|
+
const settingsList = [];
|
|
1086
|
+
for (const provider of this.providers) {
|
|
1087
|
+
const scopeCache = this.scopedSettingsCache.get(provider.scope);
|
|
1088
|
+
const providerSettings = await provider.load();
|
|
1089
|
+
providerSettings.forEach((setting) => {
|
|
1090
|
+
scopeCache.set(setting.key, setting.value);
|
|
1091
|
+
});
|
|
1092
|
+
settingsList.push(...providerSettings);
|
|
1093
|
+
}
|
|
1048
1094
|
return settingsList;
|
|
1049
1095
|
}
|
|
1050
1096
|
catch (error) {
|
|
1051
1097
|
console.error('Error loading settings', error);
|
|
1052
|
-
throw error;
|
|
1098
|
+
throw error;
|
|
1053
1099
|
}
|
|
1054
1100
|
}
|
|
1055
1101
|
async get(key) {
|
|
1056
|
-
if (this.
|
|
1102
|
+
if (this.scopedSettingsCache.size === 0) {
|
|
1057
1103
|
await this.load();
|
|
1058
1104
|
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1105
|
+
const scopeOrder = [AXPSettingScope.User, AXPSettingScope.Tenant, AXPSettingScope.Global, AXPSettingScope.Environment];
|
|
1106
|
+
for (const scope of scopeOrder) {
|
|
1107
|
+
const scopeCache = this.scopedSettingsCache.get(scope);
|
|
1108
|
+
if (scopeCache && scopeCache.has(key)) {
|
|
1109
|
+
const value = scopeCache.get(key);
|
|
1110
|
+
if (value !== undefined && value !== null) {
|
|
1111
|
+
return cloneDeep(value);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1064
1114
|
}
|
|
1065
|
-
|
|
1115
|
+
const defaults = await this.definitionService.defaultValues();
|
|
1116
|
+
return get(defaults, key); // Fallback if no value is found
|
|
1117
|
+
}
|
|
1118
|
+
async defaultValues(scope) {
|
|
1119
|
+
let scopeOrder = [AXPSettingScope.Environment, AXPSettingScope.Global, AXPSettingScope.Tenant, AXPSettingScope.User].reverse();
|
|
1120
|
+
const scopeIndex = scopeOrder.indexOf(scope);
|
|
1121
|
+
if (scopeIndex === -1) {
|
|
1122
|
+
throw new Error(`Invalid scope: ${scope}`);
|
|
1123
|
+
}
|
|
1124
|
+
scopeOrder = scopeOrder.slice(scopeIndex + 1);
|
|
1125
|
+
// Accumulate defaults from the current scope and higher scopes
|
|
1126
|
+
const accumulatedDefaults = {};
|
|
1127
|
+
for (let i = scopeIndex; i < scopeOrder.length; i++) {
|
|
1128
|
+
const currentScope = scopeOrder[i];
|
|
1129
|
+
const scopeCache = this.scopedSettingsCache.get(currentScope);
|
|
1130
|
+
if (scopeCache) {
|
|
1131
|
+
scopeCache.forEach((value, key) => {
|
|
1132
|
+
if (!(key in accumulatedDefaults)) {
|
|
1133
|
+
accumulatedDefaults[key] = value;
|
|
1134
|
+
}
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
// Merge with global default values from the definition service
|
|
1139
|
+
const globalDefaults = await this.definitionService.defaultValues();
|
|
1140
|
+
return { ...globalDefaults, ...accumulatedDefaults };
|
|
1066
1141
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
// Single value update
|
|
1072
|
-
const key = keyOrValues;
|
|
1073
|
-
this.settingsCache.set(key, value);
|
|
1074
|
-
changes[key] = value;
|
|
1075
|
-
await this.settingsProvider.set(key, value); // Call single update
|
|
1142
|
+
scope(scope) {
|
|
1143
|
+
const provider = this.providers.find((p) => p.scope === scope);
|
|
1144
|
+
if (!provider) {
|
|
1145
|
+
throw new Error(`No provider found for scope: ${scope}`);
|
|
1076
1146
|
}
|
|
1077
|
-
|
|
1078
|
-
// Bulk update
|
|
1079
|
-
const values = keyOrValues;
|
|
1080
|
-
for (const [key, val] of Object.entries(values)) {
|
|
1081
|
-
this.settingsCache.set(key, val);
|
|
1082
|
-
changes[key] = val;
|
|
1083
|
-
}
|
|
1084
|
-
await this.settingsProvider.set(values); // Call bulk update
|
|
1085
|
-
}
|
|
1086
|
-
// Prepare the detailed change event
|
|
1087
|
-
const keys = Object.keys(changes);
|
|
1088
|
-
const entries = Array.from(this.settingsCache.entries()).map(([key, value]) => ({ key, value }));
|
|
1089
|
-
// Emit the enhanced onChanged event
|
|
1090
|
-
this.onChanged.next({
|
|
1091
|
-
keys,
|
|
1092
|
-
values: changes,
|
|
1093
|
-
entries,
|
|
1094
|
-
});
|
|
1147
|
+
return new ScopedSettingService(this, provider, this.onChanged, this.scopedSettingsCache.get(scope));
|
|
1095
1148
|
}
|
|
1096
1149
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingValueProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1097
1150
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingValueProviderService, providedIn: 'root' }); }
|
|
@@ -1101,7 +1154,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1101
1154
|
args: [{
|
|
1102
1155
|
providedIn: 'root',
|
|
1103
1156
|
}]
|
|
1104
|
-
}] });
|
|
1157
|
+
}], ctorParameters: () => [] });
|
|
1158
|
+
class ScopedSettingService {
|
|
1159
|
+
constructor(parent, provider, onChanged, scopeCache) {
|
|
1160
|
+
this.parent = parent;
|
|
1161
|
+
this.provider = provider;
|
|
1162
|
+
this.onChanged = onChanged;
|
|
1163
|
+
this.scopeCache = scopeCache;
|
|
1164
|
+
}
|
|
1165
|
+
async get(key) {
|
|
1166
|
+
const settings = await this.provider.load();
|
|
1167
|
+
const setting = settings.find((s) => s.key === key);
|
|
1168
|
+
return setting ? cloneDeep(setting.value) : undefined;
|
|
1169
|
+
}
|
|
1170
|
+
async all() {
|
|
1171
|
+
const settings = await this.provider.load();
|
|
1172
|
+
return Object.fromEntries(settings.map((s) => [s.key, cloneDeep(s.value)]));
|
|
1173
|
+
}
|
|
1174
|
+
async defaultValues() {
|
|
1175
|
+
return this.parent.defaultValues(this.provider.scope);
|
|
1176
|
+
}
|
|
1177
|
+
async set(keyOrValues, value) {
|
|
1178
|
+
if (typeof keyOrValues === 'string') {
|
|
1179
|
+
// Single key-value pair
|
|
1180
|
+
await this.provider.set(keyOrValues, value);
|
|
1181
|
+
this.scopeCache.set(keyOrValues, value); // Sync the cache
|
|
1182
|
+
this.onChanged.next({
|
|
1183
|
+
scope: this.provider.scope,
|
|
1184
|
+
keys: [keyOrValues],
|
|
1185
|
+
values: { [keyOrValues]: value },
|
|
1186
|
+
entries: [{ key: keyOrValues, value }],
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
else {
|
|
1190
|
+
// Multiple key-value pairs
|
|
1191
|
+
await this.provider.set(keyOrValues);
|
|
1192
|
+
Object.entries(keyOrValues).forEach(([key, val]) => this.scopeCache.set(key, val)); // Sync the cache
|
|
1193
|
+
const entries = Object.entries(keyOrValues).map(([key, val]) => ({ key, value: val }));
|
|
1194
|
+
this.onChanged.next({
|
|
1195
|
+
scope: this.provider.scope,
|
|
1196
|
+
keys: Object.keys(keyOrValues),
|
|
1197
|
+
values: keyOrValues,
|
|
1198
|
+
entries,
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1105
1203
|
|
|
1106
1204
|
const AXPNavigateAction = createAction('[Navigate] Action', props());
|
|
1107
1205
|
const AXPSignOutAction = createAction('[SignOut] Action');
|
|
@@ -1133,6 +1231,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1133
1231
|
|
|
1134
1232
|
//TODO Loading, Redirect, Drawer, Show toast
|
|
1135
1233
|
const AXPRedirectEvent = createWorkFlowEvent('Redirect Event Fired');
|
|
1234
|
+
const AXPRefreshEvent = createWorkFlowEvent('Refresh Event Fired');
|
|
1136
1235
|
class AXPWorkflowNavigateAction extends AXPWorkflowAction {
|
|
1137
1236
|
constructor() {
|
|
1138
1237
|
super(...arguments);
|
|
@@ -1944,7 +2043,7 @@ withMethods((store, router = inject(Router), globalStore = inject(Store)) => {
|
|
|
1944
2043
|
}
|
|
1945
2044
|
if (item.path) {
|
|
1946
2045
|
// Check if the item path matches the current path
|
|
1947
|
-
const matchResult = pathsMatch(item.path, path);
|
|
2046
|
+
const matchResult = pathsMatch(item.path, path, ["list", "view", "edit", "create"]);
|
|
1948
2047
|
if (matchResult.isMatch) {
|
|
1949
2048
|
return { item, isPartialMatch: matchResult.isPartial };
|
|
1950
2049
|
}
|
|
@@ -1952,27 +2051,31 @@ withMethods((store, router = inject(Router), globalStore = inject(Store)) => {
|
|
|
1952
2051
|
}
|
|
1953
2052
|
return { item: null, isPartialMatch: false };
|
|
1954
2053
|
};
|
|
1955
|
-
const pathsMatch = (itemPath, currentPath) => {
|
|
1956
|
-
// Split both paths into segments
|
|
2054
|
+
const pathsMatch = (itemPath, currentPath, trailingSegmentsToIgnore = []) => {
|
|
1957
2055
|
const itemSegments = itemPath.split('/').filter(segment => segment.length > 0);
|
|
1958
2056
|
const pathSegments = currentPath.split('/').filter(segment => segment.length > 0);
|
|
1959
|
-
|
|
1960
|
-
const
|
|
1961
|
-
//
|
|
1962
|
-
let
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
2057
|
+
const menuLength = itemSegments.length;
|
|
2058
|
+
const pathLength = pathSegments.length;
|
|
2059
|
+
// Identify the effective base length for the menuPath
|
|
2060
|
+
let effectiveMenuLength = menuLength;
|
|
2061
|
+
if (menuLength > 0 &&
|
|
2062
|
+
trailingSegmentsToIgnore.includes(itemSegments[menuLength - 1])) {
|
|
2063
|
+
effectiveMenuLength--; // Exclude trailing non-hierarchical segments
|
|
2064
|
+
}
|
|
2065
|
+
// Check if the menuPath (base segments) is a prefix of browserPath
|
|
2066
|
+
let isPrefix = true;
|
|
2067
|
+
for (let i = 0; i < effectiveMenuLength; i++) {
|
|
2068
|
+
if (itemSegments[i] !== pathSegments[i]) {
|
|
2069
|
+
isPrefix = false;
|
|
2070
|
+
break;
|
|
1969
2071
|
}
|
|
1970
2072
|
}
|
|
1971
|
-
//
|
|
1972
|
-
const isPartialMatch =
|
|
1973
|
-
|
|
2073
|
+
// Partial match: menuPath base is a strict prefix of browserPath
|
|
2074
|
+
const isPartialMatch = isPrefix && effectiveMenuLength < pathLength;
|
|
2075
|
+
// Exact match: all segments match completely
|
|
2076
|
+
const isExactMatch = isPrefix && effectiveMenuLength === pathLength;
|
|
1974
2077
|
return {
|
|
1975
|
-
isMatch:
|
|
2078
|
+
isMatch: isExactMatch || isPartialMatch,
|
|
1976
2079
|
isPartial: isPartialMatch && !isExactMatch,
|
|
1977
2080
|
};
|
|
1978
2081
|
};
|
|
@@ -2017,14 +2120,14 @@ withMethods((store, router = inject(Router), globalStore = inject(Store)) => {
|
|
|
2017
2120
|
class AXPFooterTextSlotComponent {
|
|
2018
2121
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFooterTextSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2019
2122
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: AXPFooterTextSlotComponent, isStandalone: true, selector: "ng-component", inputs: { text: "text" }, ngImport: i0, template: `
|
|
2020
|
-
<small class="ax-text-sm
|
|
2123
|
+
<small class="ax-text-sm" [innerHTML]="text"></small>
|
|
2021
2124
|
`, isInline: true }); }
|
|
2022
2125
|
}
|
|
2023
2126
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFooterTextSlotComponent, decorators: [{
|
|
2024
2127
|
type: Component,
|
|
2025
2128
|
args: [{
|
|
2026
2129
|
template: `
|
|
2027
|
-
<small class="ax-text-sm
|
|
2130
|
+
<small class="ax-text-sm" [innerHTML]="text"></small>
|
|
2028
2131
|
`,
|
|
2029
2132
|
standalone: true
|
|
2030
2133
|
}]
|
|
@@ -3203,9 +3306,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
3203
3306
|
}]
|
|
3204
3307
|
}], ctorParameters: () => [{ type: AXPSchemaRegistryService }] });
|
|
3205
3308
|
|
|
3309
|
+
class AXPFileStorageService {
|
|
3310
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFileStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3311
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFileStorageService }); }
|
|
3312
|
+
}
|
|
3313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFileStorageService, decorators: [{
|
|
3314
|
+
type: Injectable
|
|
3315
|
+
}] });
|
|
3316
|
+
|
|
3317
|
+
var AXPFileStorageStatus;
|
|
3318
|
+
(function (AXPFileStorageStatus) {
|
|
3319
|
+
AXPFileStorageStatus["Temporary"] = "temporary";
|
|
3320
|
+
AXPFileStorageStatus["Committed"] = "committed";
|
|
3321
|
+
AXPFileStorageStatus["PendingDeletion"] = "pendingDeletion";
|
|
3322
|
+
AXPFileStorageStatus["Archived"] = "archived";
|
|
3323
|
+
AXPFileStorageStatus["Error"] = "error";
|
|
3324
|
+
})(AXPFileStorageStatus || (AXPFileStorageStatus = {}));
|
|
3325
|
+
|
|
3206
3326
|
/**
|
|
3207
3327
|
* Generated bundle index. Do not edit.
|
|
3208
3328
|
*/
|
|
3209
3329
|
|
|
3210
|
-
export { ALL_DEFAULT_OPERATORS, AXEntityLoaderDefault, AXMEntityCrudService, AXMEntityCrudServiceImpl, AXMWorkflowErrorHandler, AXPAppStartUpProvider, AXPAppStartUpService, AXPClipBoardService, AXPCommonEffects, AXPCommonModule, AXPCommonWidgetModule, AXPComponentLogoConfig, AXPComponentSlotDirective, AXPComponentSlotLoaderService, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataGenerator, AXPDataProvider, AXPDataSeederService, AXPDexieEntityStorageService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityListViewConfigEmpty, AXPEntityQueryType, AXPEntityRegistryService, AXPEntityStorageService, AXPErrorHandlerRegistryService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFiltersProviderService, AXPFontIconLogoConfig, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPGridLayoutDirective, AXPImageUrlLogoConfig, AXPLogoComponent, AXPMenuProviderService, AXPMenuService, AXPNavBarSlotComponent, AXPNavigateAction, AXPPdfPageSize, AXPPdfService, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRelationshipCardinality, AXPRelationshipKind, AXPSchemaModule, AXPSchemaRegistryService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingValueProviderService, AXPSignInAction, AXPSignOutAction, AXPStickyDirective, AXPTextLogoConfig, AXPToastAction, AXPWidgetBase, AXPWidgetColumnRendererComponent, AXPWidgetEditBase, AXPWidgetFilterBase, AXPWidgetFilterRendererComponent, AXPWidgetRendererComponent, AXPWorkflowNavigateAction, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_LOADER, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_WIDGET_TOKEN, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, configPlatform, convertPropertiesToColumns, convertPropertyToColumn, getEntityInfo, resolveActionLook, widgetSchemas };
|
|
3330
|
+
export { ALL_DEFAULT_OPERATORS, AXEntityLoaderDefault, AXMEntityCrudService, AXMEntityCrudServiceImpl, AXMWorkflowErrorHandler, AXPAppStartUpProvider, AXPAppStartUpService, AXPClipBoardService, AXPCommonEffects, AXPCommonModule, AXPCommonWidgetModule, AXPComponentLogoConfig, AXPComponentSlotDirective, AXPComponentSlotLoaderService, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataGenerator, AXPDataProvider, AXPDataSeederService, AXPDexieEntityStorageService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityListViewConfigEmpty, AXPEntityQueryType, AXPEntityRegistryService, AXPEntityStorageService, AXPErrorHandlerRegistryService, AXPFileStorageService, AXPFileStorageStatus, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFiltersProviderService, AXPFontIconLogoConfig, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPGridLayoutDirective, AXPImageUrlLogoConfig, AXPLogoComponent, AXPMenuProviderService, AXPMenuService, AXPNavBarSlotComponent, AXPNavigateAction, AXPPdfPageSize, AXPPdfService, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRelationshipCardinality, AXPRelationshipKind, AXPSchemaModule, AXPSchemaRegistryService, AXPSettingDefaultValueProvider, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingScope, AXPSettingValueProviderService, AXPSignInAction, AXPSignOutAction, AXPStickyDirective, AXPTextLogoConfig, AXPToastAction, AXPWidgetBase, AXPWidgetColumnRendererComponent, AXPWidgetEditBase, AXPWidgetFilterBase, AXPWidgetFilterRendererComponent, AXPWidgetRendererComponent, AXPWorkflowNavigateAction, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_LOADER, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_WIDGET_TOKEN, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, configPlatform, convertPropertiesToColumns, convertPropertyToColumn, getEntityInfo, resolveActionLook, widgetSchemas };
|
|
3211
3331
|
//# sourceMappingURL=acorex-platform-common.mjs.map
|