@acorex/platform 21.0.0-next.45 → 21.0.0-next.47

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.
@@ -52,6 +52,30 @@ class AXPCommonSettingProvider {
52
52
  },
53
53
  },
54
54
  description: `${I18N}.general.entity.filter-apply-mode.description`,
55
+ })
56
+ .addSetting({
57
+ key: AXPCommonSettings.EntityListPersistenceMode,
58
+ title: `${I18N}.general.entity.list-persistence-mode.title`,
59
+ scope: AXPPlatformScope.User,
60
+ isInherited: true,
61
+ defaultValue: 'persistent',
62
+ widget: {
63
+ type: AXPWidgetsCatalog.select,
64
+ options: {
65
+ label: null,
66
+ valueField: 'value',
67
+ textField: 'text',
68
+ dataSource: [
69
+ { value: 'none', text: `${I18N}.general.entity.list-persistence-mode.options.none` },
70
+ {
71
+ value: 'persistent',
72
+ text: `${I18N}.general.entity.list-persistence-mode.options.persistent`,
73
+ },
74
+ { value: 'route', text: `${I18N}.general.entity.list-persistence-mode.options.route` },
75
+ ],
76
+ },
77
+ },
78
+ description: `${I18N}.general.entity.list-persistence-mode.description`,
55
79
  })
56
80
  .addSetting({
57
81
  key: AXPCommonSettings.ShowCategoryColumnsByDefault,
@@ -136,4 +160,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
136
160
  }], ctorParameters: () => [{ type: i0.Injector }] });
137
161
 
138
162
  export { AXPCommonSettingProvider };
139
- //# sourceMappingURL=acorex-platform-common-common-settings.provider-CsOyxClO.mjs.map
163
+ //# sourceMappingURL=acorex-platform-common-common-settings.provider-Bi1RYif5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-common-common-settings.provider-Bi1RYif5.mjs","sources":["../../../../libs/platform/common/src/lib/configs/common-settings.provider.ts"],"sourcesContent":["import { AXPPlatformScope } from '@acorex/platform/core';\nimport { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';\nimport { Injectable, Injector } from '@angular/core';\nimport { AXPSettingDefinitionProvider, AXPSettingDefinitionProviderContext } from '../settings';\nimport { AXPCommonSettings } from './common-settings.key';\n\nconst I18N = '@general:settings';\n\n@Injectable()\nexport class AXPCommonSettingProvider implements AXPSettingDefinitionProvider {\n constructor(private _injector: Injector) {}\n\n async provide(context: AXPSettingDefinitionProviderContext): Promise<void> {\n // Define the 'General Settings' group\n context\n .group('general')\n ?.addSection('notifications', `${I18N}.general.notifications.title`, `${I18N}.general.notifications.description`)\n // Add the 'Enable Operation Toasts' setting\n .addSetting({\n key: AXPCommonSettings.EnableOperationToasts,\n title: `${I18N}.general.notifications.enable-operation-toasts.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n\n description: `${I18N}.general.notifications.enable-operation-toasts.description`,\n })\n\n // End the 'Notifications' section\n .endSection()\n .addSection('entity', `${I18N}.general.entity.title`, `${I18N}.general.entity.description`)\n // Add the 'Enable Operation Toasts' setting\n .addSetting({\n key: AXPCommonSettings.EntityFilterApplyMode,\n title: `${I18N}.general.entity.filter-apply-mode.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: 'auto',\n widget: {\n type: AXPWidgetsCatalog.select,\n options: {\n label: null,\n valueField: 'value',\n textField: 'text',\n dataSource: [\n { value: 'auto', text: `${I18N}.general.entity.filter-apply-mode.options.auto` },\n { value: 'manual', text: `${I18N}.general.entity.filter-apply-mode.options.manual` },\n ],\n },\n },\n\n description: `${I18N}.general.entity.filter-apply-mode.description`,\n })\n .addSetting({\n key: AXPCommonSettings.EntityListPersistenceMode,\n title: `${I18N}.general.entity.list-persistence-mode.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: 'persistent',\n widget: {\n type: AXPWidgetsCatalog.select,\n options: {\n label: null,\n valueField: 'value',\n textField: 'text',\n dataSource: [\n { value: 'none', text: `${I18N}.general.entity.list-persistence-mode.options.none` },\n {\n value: 'persistent',\n text: `${I18N}.general.entity.list-persistence-mode.options.persistent`,\n },\n { value: 'route', text: `${I18N}.general.entity.list-persistence-mode.options.route` },\n ],\n },\n },\n description: `${I18N}.general.entity.list-persistence-mode.description`,\n })\n .addSetting({\n key: AXPCommonSettings.ShowCategoryColumnsByDefault,\n title: `${I18N}.general.entity.show-category-columns-by-default.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: false,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.show-category-columns-by-default.description`,\n })\n .addSetting({\n key: AXPCommonSettings.ApplyLayoutOrdering,\n title: `${I18N}.general.entity.apply-layout-ordering.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.apply-layout-ordering.description`,\n })\n .addSetting({\n key: AXPCommonSettings.RedirectToDetailsAfterCreate,\n title: `${I18N}.general.entity.redirect-to-details-after-create.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.redirect-to-details-after-create.description`,\n })\n .addSetting({\n key: AXPCommonSettings.ShowPageBadge,\n title: `${I18N}.general.entity.show-page-badge.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.show-page-badge.description`,\n })\n .addSetting({\n key: AXPCommonSettings.ShowRowIndexColumn,\n title: `${I18N}.general.entity.show-row-index-column.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: false,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.show-row-index-column.description`,\n })\n\n // End the 'Entity Settings' section\n .endSection()\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from 'lodash-es';
4
4
  import { Router, ROUTES, RouterModule } from '@angular/router';
5
5
  import { AXPSessionService, AXPSessionStatus } from '@acorex/platform/auth';
6
6
  import { Subject, distinctUntilChanged, merge as merge$1 } from 'rxjs';
7
- import { unwrapValueProperty, coerceUnknownToDate, coerceUnknownToFiniteNumber, coerceUnknownToBoolean, coerceUnknownToTrimmedString, AXPPlatformScope, AXPBroadcastEventService, objectKeyValueTransforms, AXPSystemActionType, AXPModuleManifestModule, AXPAppStartUpProvider, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXPHookService, AXPDataGenerator, AXPModuleManifestRegistry } from '@acorex/platform/core';
7
+ import { unwrapValueProperty, coerceUnknownToDate, coerceUnknownToFiniteNumber, coerceUnknownToBoolean, coerceUnknownToTrimmedString, AXPPlatformScope, AXPBroadcastEventService, objectKeyValueTransforms, AXPSystemActionType, searchInMultiLanguageString, AXPModuleManifestModule, AXPAppStartUpProvider, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXPHookService, AXPDataGenerator, AXPModuleManifestRegistry } from '@acorex/platform/core';
8
8
  import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
9
9
  import { AXPopupModule, AXPopupService } from '@acorex/components/popup';
10
10
  import { AXToastService, AXToastModule } from '@acorex/components/toast';
@@ -2862,21 +2862,23 @@ class AXPMenuSearchProvider {
2862
2862
  title: item.text, // Use `text` for the `title`
2863
2863
  icon: item.icon, // Include the `icon` if present
2864
2864
  data: omit(item, ['parent', 'children']), // Include all data except `parent` and `children`
2865
- command: item.path ? {
2866
- name: 'navigate',
2867
- options: {
2868
- type: 'router',
2865
+ command: item.path
2866
+ ? {
2867
+ name: 'navigate',
2869
2868
  options: {
2870
- path: item.path,
2869
+ type: 'router',
2870
+ options: {
2871
+ path: item.path,
2872
+ },
2871
2873
  },
2872
2874
  }
2873
- } : item.command,
2875
+ : item.command,
2874
2876
  parent: item.parent
2875
2877
  ? {
2876
2878
  title: item.parent.text,
2877
2879
  }
2878
2880
  : undefined,
2879
- })), [(o) => this.translateService.translateSync(o.title)]);
2881
+ })), [(o) => this.translateService.translateSync(String(o.title ?? ''))]);
2880
2882
  }
2881
2883
  /**
2882
2884
  * Recursively searches AXPMenuItem and its children for a matching text.
@@ -3080,8 +3082,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
3080
3082
  }] });
3081
3083
 
3082
3084
  class AXPSearchCommandProvider {
3085
+ constructor() {
3086
+ this.translationService = inject(AXTranslationService);
3087
+ }
3083
3088
  async search(text) {
3084
- return this.commands.filter((command) => command.title.toLowerCase().includes(text.toLowerCase()));
3089
+ const locale = this.translationService.getActiveLang() ?? 'en-US';
3090
+ return this.commands.filter((command) => searchInMultiLanguageString(command.title, text, locale));
3085
3091
  }
3086
3092
  }
3087
3093
 
@@ -3148,11 +3154,17 @@ class AXPSearchService {
3148
3154
  }
3149
3155
  }
3150
3156
  }
3157
+ const locale = this.translationService.getActiveLang() ?? 'en-US';
3158
+ const normalizedQuery = text.trim();
3159
+ const visibleData = normalizedQuery.length === 0
3160
+ ? mergeData
3161
+ : mergeData.filter((item) => searchInMultiLanguageString(item.title, normalizedQuery, locale) ||
3162
+ searchInMultiLanguageString(item.description, normalizedQuery, locale));
3151
3163
  // Group data
3152
3164
  const groupedData = [];
3153
3165
  const groupMap = {};
3154
3166
  // Create groups
3155
- for (const item of mergeData) {
3167
+ for (const item of visibleData) {
3156
3168
  const groupName = item.definitionName; // Change this to the property you want to group by
3157
3169
  if (!groupMap[groupName]) {
3158
3170
  groupMap[groupName] = {
@@ -3226,6 +3238,7 @@ var AXPCommonSettings;
3226
3238
  AXPCommonSettings["ShowPageBadge"] = "Common:Setting:Entity.ShowPageBadge";
3227
3239
  AXPCommonSettings["DebugMode"] = "PlatformDevTools:Setting:Developer.DebugMode";
3228
3240
  AXPCommonSettings["ShowRowIndexColumn"] = "Common:Setting:Entity.ShowRowIndexColumn";
3241
+ AXPCommonSettings["EntityListPersistenceMode"] = "Common:Setting:Entity.ListPersistenceMode";
3229
3242
  })(AXPCommonSettings || (AXPCommonSettings = {}));
3230
3243
 
3231
3244
  //TODO Loading, Redirect, Drawer, Show toast
@@ -3471,7 +3484,7 @@ class AXPCommonModule {
3471
3484
  provide: AXP_SETTING_DEFINITION_PROVIDER,
3472
3485
  useFactory: async () => {
3473
3486
  const injector = inject(Injector);
3474
- const provider = (await import('./acorex-platform-common-common-settings.provider-CsOyxClO.mjs')).AXPCommonSettingProvider;
3487
+ const provider = (await import('./acorex-platform-common-common-settings.provider-Bi1RYif5.mjs')).AXPCommonSettingProvider;
3475
3488
  return new provider(injector);
3476
3489
  },
3477
3490
  multi: true,
@@ -3551,7 +3564,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
3551
3564
  provide: AXP_SETTING_DEFINITION_PROVIDER,
3552
3565
  useFactory: async () => {
3553
3566
  const injector = inject(Injector);
3554
- const provider = (await import('./acorex-platform-common-common-settings.provider-CsOyxClO.mjs')).AXPCommonSettingProvider;
3567
+ const provider = (await import('./acorex-platform-common-common-settings.provider-Bi1RYif5.mjs')).AXPCommonSettingProvider;
3555
3568
  return new provider(injector);
3556
3569
  },
3557
3570
  multi: true,