{"version":3,"file":"acorex-platform-common-common-settings.provider-DilV4dql.mjs","sources":["../../../../libs/platform/common/src/lib/configs/common-settings.provider.ts"],"sourcesContent":["\n\nimport { AXPPlatformScope, AXPWidgetsCatalog } from '@acorex/platform/contracts';\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.HighlightAfterCreateInList,\n        title: `${I18N}.general.entity.highlight-after-create-in-list.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.highlight-after-create-in-list.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.ConfirmUnsavedChanges,\n        title: `${I18N}.general.entity.confirm-unsaved-changes.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.confirm-unsaved-changes.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()\n      // End the 'General Settings' group\n      .endGroup();\n  }\n}\n"],"names":[],"mappings":";;;;;AAOA,MAAM,IAAI,GAAG,mBAAmB;MAGnB,wBAAwB,CAAA;AACnC,IAAA,WAAA,CAAoB,SAAmB,EAAA;QAAnB,IAAA,CAAA,SAAS,GAAT,SAAS;IAAa;IAE1C,MAAM,OAAO,CAAC,OAA4C,EAAA;;QAExD;aACG,KAAK,CAAC,SAAS;cACd,UAAU,CAAC,eAAe,EAAE,CAAA,EAAG,IAAI,CAAA,4BAAA,CAA8B,EAAE,CAAA,EAAG,IAAI,CAAA,kCAAA,CAAoC;;AAE/G,aAAA,UAAU,CAAC;YACV,GAAG,EAAE,iB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