@acorex/platform 19.1.3 → 19.1.4

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.
Files changed (145) hide show
  1. package/common/index.d.ts +1 -0
  2. package/common/lib/app/application.types.d.ts +2 -2
  3. package/common/lib/file-storage/file-storage.service.d.ts +13 -0
  4. package/common/lib/file-storage/file-storage.types.d.ts +143 -0
  5. package/common/lib/file-storage/index.d.ts +2 -0
  6. package/common/lib/filters/filters.types.d.ts +2 -1
  7. package/common/lib/settings/setting-definition.provider.d.ts +12 -5
  8. package/common/lib/settings/setting.builder.d.ts +4 -3
  9. package/common/lib/settings/settings.provider.d.ts +2 -7
  10. package/common/lib/settings/settings.service.d.ts +19 -7
  11. package/common/lib/settings/settings.types.d.ts +15 -2
  12. package/core/utils/highlighter.d.ts +1 -1
  13. package/fesm2022/acorex-platform-common.mjs +194 -74
  14. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-core.mjs +2 -2
  16. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-builder.mjs +245 -444
  18. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-designer.mjs +13 -13
  20. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-layout-entity.mjs +59 -54
  22. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-layout-filters.mjs +82 -5
  24. package/fesm2022/acorex-platform-layout-filters.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-layout-setting.mjs +73 -91
  26. package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
  27. package/fesm2022/acorex-platform-layouts.mjs +3 -4
  28. package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
  29. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-K9B_-q_K.mjs +108 -0
  30. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-K9B_-q_K.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DAmHq1bt.mjs +369 -0
  32. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DAmHq1bt.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Cd2gxLZt.mjs +87 -0
  34. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Cd2gxLZt.mjs.map +1 -0
  35. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-6sZdw013.mjs +130 -0
  36. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-6sZdw013.mjs.map +1 -0
  37. package/fesm2022/acorex-platform-themes-default-setting-page.component-BYpCgHZb.mjs +74 -0
  38. package/fesm2022/acorex-platform-themes-default-setting-page.component-BYpCgHZb.mjs.map +1 -0
  39. package/fesm2022/acorex-platform-themes-default-setting-view.component-CdmIphX1.mjs +73 -0
  40. package/fesm2022/acorex-platform-themes-default-setting-view.component-CdmIphX1.mjs.map +1 -0
  41. package/fesm2022/acorex-platform-themes-default.mjs +20 -20
  42. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  43. package/fesm2022/acorex-platform-themes-shared.mjs +288 -81
  44. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  45. package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-05nKV-UV.mjs → acorex-platform-widgets-checkbox-widget-column.component-jeZBOEhl.mjs} +18 -14
  46. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-jeZBOEhl.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs → acorex-platform-widgets-checkbox-widget-designer.component-RCi5IJOR.mjs} +4 -4
  48. package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs.map → acorex-platform-widgets-checkbox-widget-designer.component-RCi5IJOR.mjs.map} +1 -1
  49. package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-DU1niJES.mjs +64 -0
  50. package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-DU1niJES.mjs.map +1 -0
  51. package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-B2g0ct24.mjs → acorex-platform-widgets-color-box-widget-designer.component-CWhbgmDV.mjs} +4 -4
  52. package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CWhbgmDV.mjs.map +1 -0
  53. package/fesm2022/acorex-platform-widgets.mjs +1309 -334
  54. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  55. package/fesm2022/acorex-platform-workflow.mjs +9 -3
  56. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  57. package/layout/builder/lib/builder/builder.module.d.ts +6 -7
  58. package/layout/builder/lib/builder/builder.service.d.ts +9 -10
  59. package/layout/builder/lib/builder/context-store.service.d.ts +33 -0
  60. package/layout/builder/lib/builder/index.d.ts +4 -2
  61. package/layout/builder/lib/builder/widget-catalog.d.ts +1 -1
  62. package/layout/builder/lib/builder/widget-container.component.d.ts +34 -9
  63. package/layout/builder/lib/builder/widget-groups.d.ts +1 -0
  64. package/layout/builder/lib/builder/widget-map.d.ts +43 -0
  65. package/layout/builder/lib/builder/{widget-renderer.component.directive.d.ts → widget-renderer.directive.d.ts} +26 -0
  66. package/layout/builder/lib/builder/widget-status.types.d.ts +14 -0
  67. package/layout/builder/lib/builder/widget.types.d.ts +41 -55
  68. package/layout/designer/lib/preview/preview-viewer.component.d.ts +2 -2
  69. package/layout/designer/lib/property-viewer/widget-property-viewer.component.d.ts +2 -2
  70. package/layout/entity/lib/entity-master-list.viewmodel.d.ts +7 -2
  71. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +0 -1
  72. package/layout/filters/lib/filters.viewmodel.d.ts +13 -3
  73. package/layout/setting/lib/convert-setting-data.d.ts +0 -20
  74. package/layout/setting/lib/setting.viewmodel.d.ts +65 -4
  75. package/layouts/lib/admin/entity-layout/entity-details-view/entity-details-view.component.d.ts +15 -5
  76. package/package.json +15 -15
  77. package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +15 -5
  78. package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +15 -5
  79. package/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.d.ts +2 -1
  80. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +17 -6
  81. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-filters/list-view-option-filters.component.d.ts +6 -3
  82. package/themes/default/lib/layouts/entity-layouts/entity-master-modify-view/entity-master-modify-view.component.d.ts +2 -1
  83. package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +15 -5
  84. package/themes/default/lib/layouts/filters-layout/simple-filter-builder/filters-view.component.d.ts +6 -5
  85. package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +15 -5
  86. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +15 -5
  87. package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +0 -47
  88. package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +19 -5
  89. package/themes/shared/index.d.ts +3 -1
  90. package/themes/shared/lib/components/theme-slot.component.d.ts +23 -13
  91. package/themes/shared/lib/palette.provider.d.ts +9 -0
  92. package/themes/shared/lib/setting.keys.d.ts +7 -2
  93. package/themes/shared/lib/setting.provider.d.ts +1 -0
  94. package/themes/shared/lib/shared.module.d.ts +2 -1
  95. package/themes/shared/lib/{services/theme.service.d.ts → theme.service.d.ts} +16 -24
  96. package/themes/shared/lib/theme.types.d.ts +25 -0
  97. package/themes/shared/lib/widgets/theme-color-selection/index.d.ts +2 -0
  98. package/themes/shared/lib/widgets/theme-color-selection/theme-color-selection-widget-edit.component.d.ts +6 -0
  99. package/themes/shared/lib/widgets/theme-color-selection/theme-color-selection-widget.config.d.ts +7 -0
  100. package/widgets/lib/properties/layout.props.d.ts +1 -0
  101. package/widgets/lib/widgets/advance/avatar/avatar-widget-column.component.d.ts +6 -0
  102. package/widgets/lib/widgets/advance/avatar/avatar-widget-designer.component.d.ts +6 -0
  103. package/widgets/lib/widgets/advance/avatar/avatar-widget-edit.component.d.ts +18 -0
  104. package/widgets/lib/widgets/advance/avatar/avatar-widget-print.component.d.ts +6 -0
  105. package/widgets/lib/widgets/advance/avatar/avatar-widget-view.component.d.ts +6 -0
  106. package/widgets/lib/widgets/advance/avatar/avatar-widget.config.d.ts +7 -0
  107. package/widgets/lib/widgets/advance/avatar/index.d.ts +6 -0
  108. package/widgets/lib/widgets/advance/map/map-box-widget-edit.component.d.ts +9 -5
  109. package/widgets/lib/widgets/advance/map/map-box-widget-view.component.d.ts +6 -4
  110. package/widgets/lib/widgets/editors/number/number-box-widget-edit.component.d.ts +1 -7
  111. package/widgets/lib/widgets/editors/toggle/toggle-widget-edit.component.d.ts +0 -2
  112. package/widgets/lib/widgets/filters/operations/operations.component.d.ts +9 -0
  113. package/widgets/lib/widgets/filters/string-filter/index.d.ts +2 -0
  114. package/widgets/lib/widgets/filters/string-filter/string-filter-widget-edit.component.d.ts +11 -0
  115. package/widgets/lib/widgets/filters/string-filter/string-filter-widget.config.d.ts +7 -0
  116. package/widgets/lib/widgets/index.d.ts +5 -1
  117. package/widgets/lib/widgets/property-editors/border/border-widget-editor.component.d.ts +29 -7
  118. package/widgets/lib/widgets/property-editors/border/index.d.ts +0 -1
  119. package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget-editor.component.d.ts +31 -0
  120. package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget.config.d.ts +7 -0
  121. package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget.type.d.ts +15 -0
  122. package/widgets/lib/widgets/property-editors/flex-options/index.d.ts +3 -0
  123. package/widgets/lib/widgets/property-editors/property-editor-helper.d.ts +72 -0
  124. package/widgets/lib/widgets/property-editors/property-editor.type.d.ts +35 -0
  125. package/widgets/lib/widgets/property-editors/spacing/index.d.ts +0 -1
  126. package/widgets/lib/widgets/property-editors/spacing/spacing-widget-editor.component.d.ts +11 -9
  127. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs +0 -108
  128. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs.map +0 -1
  129. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs +0 -368
  130. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs.map +0 -1
  131. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs +0 -87
  132. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs.map +0 -1
  133. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs +0 -130
  134. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs.map +0 -1
  135. package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs +0 -78
  136. package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs.map +0 -1
  137. package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs +0 -58
  138. package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs.map +0 -1
  139. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-05nKV-UV.mjs.map +0 -1
  140. package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-BkWcZ4K9.mjs +0 -72
  141. package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-BkWcZ4K9.mjs.map +0 -1
  142. package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-B2g0ct24.mjs.map +0 -1
  143. package/layout/builder/lib/builder/widget-renderer.component.d.ts +0 -48
  144. package/widgets/lib/widgets/property-editors/border/border-widget-type.d.ts +0 -18
  145. 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, get, set } from 'lodash-es';
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: 'secondary', icon: 'fa-solid fa-print' };
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 ?? {}, { label: setting.widget.options?.['label'] ?? setting.title }),
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(scope) {
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 && (!scope || setting.scope === scope)) {
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
- collectDefaults(this.cache);
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 new AXPSettingValueProviderDefault();
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
- constructor() {
1027
+ get scope() {
1028
+ return this._scope;
1029
+ }
1030
+ constructor(_scope) {
1031
+ this._scope = _scope;
998
1032
  this.cache = new Map();
999
- this.localStorageKey = 'AXP_SETTINGS';
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,84 @@ class AXPSettingValueProviderDefault {
1034
1068
 
1035
1069
  class AXPSettingValueProviderService {
1036
1070
  constructor() {
1037
- this.settingsProvider = inject(AXP_SETTING_VALUE_PROVIDER);
1038
- this.settingsCache = new Map();
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 = await this.settingsProvider.load();
1044
- this.settingsCache.clear();
1045
- settingsList.forEach((setting) => {
1046
- this.settingsCache.set(setting.key, setting.value);
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; // Re-throw or handle it appropriately
1098
+ throw error;
1053
1099
  }
1054
1100
  }
1055
1101
  async get(key) {
1056
- if (this.settingsCache.size == 0) {
1102
+ if (this.scopedSettingsCache.size === 0) {
1057
1103
  await this.load();
1058
1104
  }
1059
- return cloneDeep(this.settingsCache.get(key));
1060
- }
1061
- async all() {
1062
- if (this.settingsCache.size == 0) {
1063
- await this.load();
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
- return Object.fromEntries(this.settingsCache);
1115
+ const defaults = await this.definitionService.defaultValues();
1116
+ return get(defaults, key); // Fallback if no value is found
1117
+ }
1118
+ async defaultValues(scope) {
1119
+ // TODO: not work properly
1120
+ debugger;
1121
+ const scopeOrder = [AXPSettingScope.Environment, AXPSettingScope.Global, AXPSettingScope.Tenant, AXPSettingScope.User].reverse();
1122
+ const scopeIndex = scopeOrder.indexOf(scope);
1123
+ if (scopeIndex === -1) {
1124
+ throw new Error(`Invalid scope: ${scope}`);
1125
+ }
1126
+ // Accumulate defaults from the current scope and higher scopes
1127
+ const accumulatedDefaults = {};
1128
+ for (let i = scopeIndex; i < scopeOrder.length; i++) {
1129
+ const currentScope = scopeOrder[i];
1130
+ const scopeCache = this.scopedSettingsCache.get(currentScope);
1131
+ if (scopeCache) {
1132
+ scopeCache.forEach((value, key) => {
1133
+ if (!(key in accumulatedDefaults)) {
1134
+ accumulatedDefaults[key] = value;
1135
+ }
1136
+ });
1137
+ }
1138
+ }
1139
+ // Merge with global default values from the definition service
1140
+ const globalDefaults = await this.definitionService.defaultValues();
1141
+ return { ...globalDefaults, ...accumulatedDefaults };
1066
1142
  }
1067
- // Implementation
1068
- async set(keyOrValues, value) {
1069
- const changes = {};
1070
- if (typeof keyOrValues === 'string') {
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
1143
+ scope(scope) {
1144
+ const provider = this.providers.find((p) => p.scope === scope);
1145
+ if (!provider) {
1146
+ throw new Error(`No provider found for scope: ${scope}`);
1076
1147
  }
1077
- else {
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
- });
1148
+ return new ScopedSettingService(this, provider, this.onChanged, this.scopedSettingsCache.get(scope));
1095
1149
  }
1096
1150
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingValueProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1097
1151
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingValueProviderService, providedIn: 'root' }); }
@@ -1101,7 +1155,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
1101
1155
  args: [{
1102
1156
  providedIn: 'root',
1103
1157
  }]
1104
- }] });
1158
+ }], ctorParameters: () => [] });
1159
+ class ScopedSettingService {
1160
+ constructor(parent, provider, onChanged, scopeCache) {
1161
+ this.parent = parent;
1162
+ this.provider = provider;
1163
+ this.onChanged = onChanged;
1164
+ this.scopeCache = scopeCache;
1165
+ }
1166
+ async get(key) {
1167
+ const settings = await this.provider.load();
1168
+ const setting = settings.find((s) => s.key === key);
1169
+ return setting ? cloneDeep(setting.value) : undefined;
1170
+ }
1171
+ async all() {
1172
+ const settings = await this.provider.load();
1173
+ return Object.fromEntries(settings.map((s) => [s.key, cloneDeep(s.value)]));
1174
+ }
1175
+ async defaultValues() {
1176
+ return this.parent.defaultValues(this.provider.scope);
1177
+ }
1178
+ async set(keyOrValues, value) {
1179
+ if (typeof keyOrValues === 'string') {
1180
+ // Single key-value pair
1181
+ await this.provider.set(keyOrValues, value);
1182
+ this.scopeCache.set(keyOrValues, value); // Sync the cache
1183
+ this.onChanged.next({
1184
+ scope: this.provider.scope,
1185
+ keys: [keyOrValues],
1186
+ values: { [keyOrValues]: value },
1187
+ entries: [{ key: keyOrValues, value }],
1188
+ });
1189
+ }
1190
+ else {
1191
+ // Multiple key-value pairs
1192
+ await this.provider.set(keyOrValues);
1193
+ Object.entries(keyOrValues).forEach(([key, val]) => this.scopeCache.set(key, val)); // Sync the cache
1194
+ const entries = Object.entries(keyOrValues).map(([key, val]) => ({ key, value: val }));
1195
+ this.onChanged.next({
1196
+ scope: this.provider.scope,
1197
+ keys: Object.keys(keyOrValues),
1198
+ values: keyOrValues,
1199
+ entries,
1200
+ });
1201
+ }
1202
+ }
1203
+ }
1105
1204
 
1106
1205
  const AXPNavigateAction = createAction('[Navigate] Action', props());
1107
1206
  const AXPSignOutAction = createAction('[SignOut] Action');
@@ -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
- // Determine the minimum number of segments to compare
1960
- const minLength = Math.min(itemSegments.length, pathSegments.length);
1961
- // Compare segments until we find a mismatch
1962
- let commonBaseLength = 0;
1963
- for (let i = 0; i < minLength; i++) {
1964
- if (itemSegments[i] === pathSegments[i]) {
1965
- commonBaseLength++;
1966
- }
1967
- else {
1968
- break; // Stop at the first mismatch
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
- // Determine if we have a common base of at least 5 segments
1972
- const isPartialMatch = commonBaseLength >= 5 && commonBaseLength < itemSegments.length;
1973
- const isExactMatch = commonBaseLength === itemSegments.length && itemSegments.length === pathSegments.length;
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: isPartialMatch || isExactMatch,
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 ax-text-neutral-400" [innerHTML]="text"></small>
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 ax-text-neutral-400" [innerHTML]="text"></small>
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, 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