@acorex/modules 19.1.2 → 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 (60) hide show
  1. package/application-management/lib/layouts/module-entity-detail-view/module-entity-detail-view.component.d.ts +15 -5
  2. package/auth/lib/account/profile/profile-slot.component.d.ts +1 -0
  3. package/conversation/lib/entities/comments/comment.module.d.ts +4 -3
  4. package/fesm2022/acorex-modules-application-management.mjs +3 -3
  5. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  6. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-D8WcF6Jp.mjs → acorex-modules-auth-acorex-modules-auth-BuSxsqTx.mjs} +38 -26
  7. package/fesm2022/acorex-modules-auth-acorex-modules-auth-BuSxsqTx.mjs.map +1 -0
  8. package/fesm2022/{acorex-modules-auth-app-chooser.component-0TpgRa-v.mjs → acorex-modules-auth-app-chooser.component-B3yFTcfb.mjs} +5 -5
  9. package/fesm2022/{acorex-modules-auth-app-chooser.component-0TpgRa-v.mjs.map → acorex-modules-auth-app-chooser.component-B3yFTcfb.mjs.map} +1 -1
  10. package/fesm2022/{acorex-modules-auth-login.module-CziF_sE7.mjs → acorex-modules-auth-login.module-BwbsBdZm.mjs} +4 -4
  11. package/fesm2022/{acorex-modules-auth-login.module-CziF_sE7.mjs.map → acorex-modules-auth-login.module-BwbsBdZm.mjs.map} +1 -1
  12. package/fesm2022/{acorex-modules-auth-master.layout-Ds4LxKSf.mjs → acorex-modules-auth-master.layout-BIwGGzl9.mjs} +2 -2
  13. package/fesm2022/{acorex-modules-auth-master.layout-Ds4LxKSf.mjs.map → acorex-modules-auth-master.layout-BIwGGzl9.mjs.map} +1 -1
  14. package/fesm2022/{acorex-modules-auth-password.component-9TFb-AHn.mjs → acorex-modules-auth-password.component-Ce57WfMX.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-auth-password.component-9TFb-AHn.mjs.map → acorex-modules-auth-password.component-Ce57WfMX.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-auth-password.component-BVVvl8So.mjs → acorex-modules-auth-password.component-CquAxSV0.mjs} +4 -4
  17. package/fesm2022/{acorex-modules-auth-password.component-BVVvl8So.mjs.map → acorex-modules-auth-password.component-CquAxSV0.mjs.map} +1 -1
  18. package/fesm2022/{acorex-modules-auth-routes-TdAn72Pa.mjs → acorex-modules-auth-routes-CbA94Lwp.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-auth-routes-TdAn72Pa.mjs.map → acorex-modules-auth-routes-CbA94Lwp.mjs.map} +1 -1
  20. package/fesm2022/{acorex-modules-auth-tenant-chooser.component-CorZ4Z7h.mjs → acorex-modules-auth-tenant-chooser.component-CFT3i6iA.mjs} +5 -5
  21. package/fesm2022/{acorex-modules-auth-tenant-chooser.component-CorZ4Z7h.mjs.map → acorex-modules-auth-tenant-chooser.component-CFT3i6iA.mjs.map} +1 -1
  22. package/fesm2022/{acorex-modules-auth-two-factor.module-BE2uEne7.mjs → acorex-modules-auth-two-factor.module-DiN9uKFz.mjs} +2 -2
  23. package/fesm2022/{acorex-modules-auth-two-factor.module-BE2uEne7.mjs.map → acorex-modules-auth-two-factor.module-DiN9uKFz.mjs.map} +1 -1
  24. package/fesm2022/acorex-modules-auth.mjs +1 -1
  25. package/fesm2022/acorex-modules-conversation.mjs +20 -11
  26. package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
  27. package/fesm2022/{acorex-modules-form-template-management-category.entity-xUkZHVgy.mjs → acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs} +50 -2
  28. package/fesm2022/acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs.map +1 -0
  29. package/fesm2022/acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs +126 -0
  30. package/fesm2022/acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs.map +1 -0
  31. package/fesm2022/{acorex-modules-form-template-management-template-widget-edit.component-DQw5qvib.mjs → acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs} +19 -7
  32. package/fesm2022/acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs.map +1 -0
  33. package/fesm2022/acorex-modules-form-template-management.mjs +23 -12
  34. package/fesm2022/acorex-modules-form-template-management.mjs.map +1 -1
  35. package/fesm2022/{acorex-modules-platform-management-regional-formats-BSMV12dQ.mjs → acorex-modules-platform-management-regional-formats-BaHofjWg.mjs} +3 -3
  36. package/fesm2022/{acorex-modules-platform-management-regional-formats-BSMV12dQ.mjs.map → acorex-modules-platform-management-regional-formats-BaHofjWg.mjs.map} +1 -1
  37. package/fesm2022/acorex-modules-platform-management-timezones-BoScbn0h.mjs +15 -0
  38. package/fesm2022/acorex-modules-platform-management-timezones-BoScbn0h.mjs.map +1 -0
  39. package/fesm2022/acorex-modules-platform-management.mjs +355 -122
  40. package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
  41. package/fesm2022/acorex-modules-text-template-management.mjs +3 -3
  42. package/fesm2022/acorex-modules-text-template-management.mjs.map +1 -1
  43. package/form-template-management/lib/components/widgets/template/index.d.ts +1 -1
  44. package/form-template-management/lib/components/widgets/template/template-widget-edit.component.d.ts +2 -0
  45. package/form-template-management/lib/components/widgets/{template/template-picker → template-picker}/template-picker.component.d.ts +2 -2
  46. package/form-template-management/lib/entities/template/template.types.d.ts +1 -0
  47. package/package.json +8 -8
  48. package/platform-management/lib/common/organizarion/setting.keys.d.ts +16 -0
  49. package/platform-management/lib/common/organizarion/settings.provider.d.ts +5 -0
  50. package/platform-management/lib/common/regional/language-slot/language-slot.component.d.ts +2 -7
  51. package/platform-management/lib/common/regional/regional-store.service.d.ts +1 -8
  52. package/platform-management/lib/common/regional/regional-util.service.d.ts +12 -0
  53. package/platform-management/lib/common/regional/setting.provider.d.ts +2 -13
  54. package/platform-management/lib/menu.provider.d.ts +1 -0
  55. package/fesm2022/acorex-modules-auth-acorex-modules-auth-D8WcF6Jp.mjs.map +0 -1
  56. package/fesm2022/acorex-modules-form-template-management-category.entity-xUkZHVgy.mjs.map +0 -1
  57. package/fesm2022/acorex-modules-form-template-management-template-picker.component-BXOyKuAt.mjs +0 -123
  58. package/fesm2022/acorex-modules-form-template-management-template-picker.component-BXOyKuAt.mjs.map +0 -1
  59. package/fesm2022/acorex-modules-form-template-management-template-widget-edit.component-DQw5qvib.mjs.map +0 -1
  60. /package/form-template-management/lib/components/widgets/{template → template-picker}/template.provider.d.ts +0 -0
@@ -1,11 +1,11 @@
1
1
  import * as i1$1 from '@acorex/platform/common';
2
- import { AXPSettingValueProviderService, AXP_SETTING_DEFINITION_PROVIDER, AXPComponentSlotModule, AXMEntityCrudServiceImpl, AXPEntityQueryType, AXPEntityCommandScope, AXP_MENU_PROVIDER } from '@acorex/platform/common';
2
+ import { AXPSettingScope, AXPSettingValueProviderService, AXP_SETTING_DEFINITION_PROVIDER, AXPComponentSlotModule, AXMEntityCrudServiceImpl, AXPEntityQueryType, AXPEntityCommandScope, AXP_MENU_PROVIDER } from '@acorex/platform/common';
3
3
  import { AXP_ENTITY_DEFINITION_LOADER, AXPEntityService } from '@acorex/platform/layout/entity';
4
4
  import * as i0 from '@angular/core';
5
5
  import { inject, Injector, Injectable, signal, Component, NgModule } from '@angular/core';
6
- import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
6
+ import { objectKeyValueTransforms, AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
7
7
  import { AXTranslationService } from '@acorex/core/translation';
8
- import { signalStore, withState, withMethods, patchState } from '@ngrx/signals';
8
+ import { signalStore, withState, withMethods, patchState, withHooks } from '@ngrx/signals';
9
9
  import * as i3 from '@acorex/components/button';
10
10
  import { AXButtonModule } from '@acorex/components/button';
11
11
  import * as i2 from '@acorex/components/decorators';
@@ -14,6 +14,7 @@ import * as i1 from '@acorex/components/dropdown';
14
14
  import { AXDropdownModule } from '@acorex/components/dropdown';
15
15
  import { AXPopoverModule } from '@acorex/components/popover';
16
16
  import { CommonModule } from '@angular/common';
17
+ import { AXPSessionService } from '@acorex/platform/auth';
17
18
 
18
19
  class AXMCommonModuleEntityProvider {
19
20
  constructor() {
@@ -34,7 +35,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
34
35
  type: Injectable
35
36
  }] });
36
37
 
37
- const path = 'settings:regional:';
38
+ const path$1 = 'settings:regional:';
38
39
  var AXPRegionalSetting;
39
40
  (function (AXPRegionalSetting) {
40
41
  AXPRegionalSetting["TimeZone"] = "settings:regional:timezone";
@@ -50,91 +51,51 @@ var AXPRegionalSetting;
50
51
  AXPRegionalSetting["LongTime"] = "settings:regional:long-time";
51
52
  })(AXPRegionalSetting || (AXPRegionalSetting = {}));
52
53
 
53
- // ThemeStore - Manages theme settings and system changes
54
- const AXPRegionalStoreService = signalStore({ providedIn: 'root' },
55
- // Initial State
56
- withState((translationService = inject(AXTranslationService)) => {
57
- const state = {
58
- language: translationService.getDefaultLang(),
59
- };
60
- return state;
61
- }),
62
- // Computed Signals
63
- // withComputed(({ }) => ({
64
- // })),
65
- // Methods for State Management
66
- withMethods((store, settingService = inject(AXPSettingValueProviderService), translationService = inject(AXTranslationService)) => {
67
- return {
68
- changeLanguage(lang) {
69
- settingService.set(AXPRegionalSetting.Language, lang);
70
- translationService.setActiveLang(lang);
71
- patchState(store, { language: lang });
72
- },
73
- async loadSetting() {
74
- const lang = (await settingService.get(AXPRegionalSetting.Language)) ?? translationService.getDefaultLang();
75
- settingService.set(AXPRegionalSetting.Language, lang);
76
- translationService.setActiveLang(lang);
77
- patchState(store, { language: lang });
78
- },
79
- async getCountries() {
80
- const { countries } = await import('./acorex-modules-platform-management-countries-CuJVdPLt.mjs');
81
- return countries;
82
- },
83
- async getTimeZones() {
84
- const { timeZones } = await Promise.resolve().then(function () { return timezones; });
85
- return timeZones;
86
- },
87
- async getCurrencies() {
88
- const { currencies } = await import('./acorex-modules-platform-management-currencies-vgPg4Hj3.mjs');
89
- return currencies;
90
- },
91
- async getRegionalFormats() {
92
- const { regionalFormats } = await import('./acorex-modules-platform-management-regional-formats-BSMV12dQ.mjs');
93
- return regionalFormats;
94
- },
95
- async getLanguages() {
96
- return (await this.getRegionalFormats())
97
- .map(c => ({ code: c.locale, title: c.title }));
98
- },
99
- async getAvailableLanguages() {
100
- return (await this.getLanguages()).filter(c => ['fa-IR', 'en-US'].some(e => e == c.code));
101
- }
102
- };
103
- }));
104
-
105
- const timeZones = [
106
- { code: 'UTC-5', title: 'UTC-5 (Eastern Time)', offset: '-05:00' },
107
- { code: 'UTC+0', title: 'UTC+0 (Greenwich Mean Time)', offset: '+00:00' },
108
- { code: 'UTC+1', title: 'UTC+1 (Central European Time)', offset: '+01:00' },
109
- { code: 'UTC+2', title: 'UTC+2 (Eastern European Time)', offset: '+02:00' },
110
- { code: 'UTC+3', title: 'UTC+3 (Arabian Time)', offset: '+03:00' },
111
- { code: 'UTC+3:30', title: 'UTC+3:30 (Iran Standard Time)', offset: '+03:30' },
112
- { code: 'UTC+4', title: 'UTC+4 (Gulf Standard Time)', offset: '+04:00' },
113
- { code: 'UTC+9', title: 'UTC+9 (Japan Standard Time)', offset: '+09:00' },
114
- { code: 'UTC+10', title: 'UTC+10 (Australian Eastern Time)', offset: '+10:00' },
115
- { code: 'UTC+12', title: 'UTC+12 (New Zealand Standard Time)', offset: '+12:00' }
116
- ];
117
-
118
- var timezones = /*#__PURE__*/Object.freeze({
119
- __proto__: null,
120
- timeZones: timeZones
121
- });
122
-
123
- async function getBrowserTimeZoneCode() {
124
- const now = new Date();
125
- // Calculate offset in hours and minutes
126
- const offsetMinutes = now.getTimezoneOffset();
127
- const offsetHours = Math.floor(-offsetMinutes / 60);
128
- const offsetRemainder = Math.abs(offsetMinutes % 60);
129
- // Format the offset properly
130
- const formattedOffset = `UTC${offsetHours >= 0 ? '+' : ''}${offsetHours}${offsetRemainder ? `:${offsetRemainder.toString().padStart(2, '0')}` : ''}`;
131
- // Find matching time zone
132
- const matchedZone = timeZones.find(zone => zone.code === formattedOffset);
133
- return matchedZone ? matchedZone.code : 'UTC';
54
+ class AXPRegionalService {
55
+ async getCountries() {
56
+ const { countries } = await import('./acorex-modules-platform-management-countries-CuJVdPLt.mjs');
57
+ return countries;
58
+ }
59
+ async getCurrencies() {
60
+ const { currencies } = await import('./acorex-modules-platform-management-currencies-vgPg4Hj3.mjs');
61
+ return currencies;
62
+ }
63
+ async getRegionalFormats() {
64
+ const { regionalFormats } = await import('./acorex-modules-platform-management-regional-formats-BaHofjWg.mjs');
65
+ return regionalFormats;
66
+ }
67
+ async getLanguages() {
68
+ return (await this.getRegionalFormats())
69
+ .map(c => ({ code: c.locale, title: c.title }));
70
+ }
71
+ async getAvailableLanguages() {
72
+ return (await this.getLanguages()).filter(c => ['fa-IR', 'en-US'].some(e => e == c.code));
73
+ }
74
+ async getBrowserTimeZoneCode() {
75
+ const { timeZones } = await import('./acorex-modules-platform-management-timezones-BoScbn0h.mjs');
76
+ const now = new Date();
77
+ // Calculate offset in hours and minutes
78
+ const offsetMinutes = now.getTimezoneOffset();
79
+ const offsetHours = Math.floor(-offsetMinutes / 60);
80
+ const offsetRemainder = Math.abs(offsetMinutes % 60);
81
+ // Format the offset properly
82
+ const formattedOffset = `UTC${offsetHours >= 0 ? '+' : ''}${offsetHours}${offsetRemainder ? `:${offsetRemainder.toString().padStart(2, '0')}` : ''}`;
83
+ // Find matching time zone
84
+ const matchedZone = timeZones.find(zone => zone.code === formattedOffset);
85
+ return matchedZone ? matchedZone.code : 'UTC';
86
+ }
87
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPRegionalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
88
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPRegionalService, providedIn: 'root' }); }
134
89
  }
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPRegionalService, decorators: [{
91
+ type: Injectable,
92
+ args: [{ providedIn: 'root' }]
93
+ }] });
94
+
135
95
  class AXMRegionalSettingProvider {
136
96
  constructor() {
137
- this.store = inject(AXPRegionalStoreService);
97
+ this.translationService = inject(AXTranslationService);
98
+ this.regionalService = inject(AXPRegionalService);
138
99
  }
139
100
  async provide(context) {
140
101
  context
@@ -144,81 +105,85 @@ class AXMRegionalSettingProvider {
144
105
  .addSetting({
145
106
  key: AXPRegionalSetting.TimeZone,
146
107
  title: 'Time Zone',
147
- scope: 'G',
148
- defaultValue: await getBrowserTimeZoneCode(),
108
+ scope: 'T',
109
+ isInherited: true,
110
+ defaultValue: await this.regionalService.getBrowserTimeZoneCode(),
111
+ valueTransforms: objectKeyValueTransforms('code'),
149
112
  widget: {
150
113
  type: AXPWidgetsCatalog.select,
151
114
  options: {
152
115
  valueField: 'code',
153
- dataSource: await this.store.getTimeZones(),
116
+ dataSource: await import('./acorex-modules-platform-management-timezones-BoScbn0h.mjs'),
154
117
  },
155
118
  },
156
119
  description: 'Set the default time zone for the application.',
157
120
  })
158
121
  .endSection()
159
- // Language Section
160
- .addSection('language', 'Language', 'Configure display language settings.')
122
+ // Region Section
123
+ .addSection('region', 'Region', 'Configure regional format and preferences.')
161
124
  .addSetting({
162
125
  key: AXPRegionalSetting.Language,
163
126
  title: 'Display Language',
164
127
  scope: 'U',
128
+ isInherited: true,
165
129
  defaultValue: 'en-US',
130
+ valueTransforms: objectKeyValueTransforms('code'),
166
131
  widget: {
167
132
  type: AXPWidgetsCatalog.select,
168
133
  options: {
169
134
  valueField: 'code',
170
- dataSource: await this.store.getAvailableLanguages(),
135
+ dataSource: await this.regionalService.getAvailableLanguages(),
171
136
  },
172
137
  },
173
138
  description: 'Set the preferred display language for the user.',
174
- })
175
- .endSection()
176
- // Region Section
177
- .addSection('region', 'Region', 'Configure regional format and preferences.')
178
- .addSetting({
179
- key: AXPRegionalSetting.Country,
180
- title: 'Country',
181
- scope: 'G',
182
- defaultValue: 'US',
183
- widget: {
184
- type: AXPWidgetsCatalog.select,
185
- options: {
186
- valueField: 'code',
187
- dataSource: await this.store.getCountries(),
188
- },
189
- },
190
- description: 'Set the default country for the application.',
191
139
  })
192
140
  .addSetting({
193
141
  key: AXPRegionalSetting.Regional,
194
142
  title: 'Regional Format',
195
143
  scope: 'U',
196
- defaultValue: 'English (United States)',
144
+ isInherited: true,
145
+ defaultValue: await this.translationService.getDefaultLang(),
146
+ valueTransforms: objectKeyValueTransforms('locale'),
197
147
  widget: {
198
148
  type: AXPWidgetsCatalog.select,
199
149
  options: {
200
- dataSource: ['English (United States)', 'English (United Kingdom)', 'French (France)', 'German (Germany)'],
150
+ valueField: 'locale',
151
+ dataSource: await import('./acorex-modules-platform-management-regional-formats-BaHofjWg.mjs'),
201
152
  },
153
+ triggers: [
154
+ {
155
+ event: `{{ events.context('${AXPRegionalSetting.Language}') }}`,
156
+ action: `{{ widget.setValue(context.eval('${AXPRegionalSetting.Language}')) }}`,
157
+ },
158
+ ],
202
159
  },
203
160
  description: 'Set the regional format for numbers, dates, and times.',
204
161
  })
205
162
  .addSetting({
206
163
  key: AXPRegionalSetting.Calendar,
207
164
  title: 'Calendar',
208
- scope: 'G',
165
+ scope: 'U',
166
+ isInherited: true,
209
167
  defaultValue: 'Gregorian',
210
168
  widget: {
211
169
  type: AXPWidgetsCatalog.select,
212
170
  options: {
213
171
  dataSource: ['Gregorian', 'Hijri'],
214
172
  },
173
+ triggers: [
174
+ {
175
+ event: `{{ events.context('${AXPRegionalSetting.Regional}') }}`,
176
+ action: `{{ console.log(widget.find('${AXPRegionalSetting.Regional}').output('selectedItems')[0]) }}`,
177
+ },
178
+ ],
215
179
  },
216
180
  description: 'Select the calendar type for the application.',
217
181
  })
218
182
  .addSetting({
219
183
  key: AXPRegionalSetting.FirstDayOfWeek,
220
184
  title: 'First Day of Week',
221
- scope: 'U',
185
+ scope: 'T',
186
+ isInherited: false,
222
187
  defaultValue: 'Monday',
223
188
  widget: {
224
189
  type: AXPWidgetsCatalog.select,
@@ -231,7 +196,8 @@ class AXMRegionalSettingProvider {
231
196
  .addSetting({
232
197
  key: AXPRegionalSetting.WorkDays,
233
198
  title: 'Work Days',
234
- scope: 'U',
199
+ scope: 'T',
200
+ isInherited: false,
235
201
  defaultValue: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
236
202
  widget: {
237
203
  type: AXPWidgetsCatalog.selectionList,
@@ -246,6 +212,7 @@ class AXMRegionalSettingProvider {
246
212
  key: AXPRegionalSetting.ShortDate,
247
213
  title: 'Short Date Format',
248
214
  scope: 'U',
215
+ isInherited: true,
249
216
  defaultValue: 'MM/dd/yyyy',
250
217
  widget: {
251
218
  type: AXPWidgetsCatalog.select,
@@ -259,6 +226,7 @@ class AXMRegionalSettingProvider {
259
226
  key: AXPRegionalSetting.LongDate,
260
227
  title: 'Long Date Format',
261
228
  scope: 'U',
229
+ isInherited: true,
262
230
  defaultValue: 'MMMM dd, yyyy',
263
231
  widget: {
264
232
  type: AXPWidgetsCatalog.select,
@@ -272,6 +240,7 @@ class AXMRegionalSettingProvider {
272
240
  key: AXPRegionalSetting.ShortTime,
273
241
  title: 'Short Time Format',
274
242
  scope: 'U',
243
+ isInherited: true,
275
244
  defaultValue: 'hh:mm a',
276
245
  widget: {
277
246
  type: AXPWidgetsCatalog.select,
@@ -289,6 +258,7 @@ class AXMRegionalSettingProvider {
289
258
  key: AXPRegionalSetting.LongTime,
290
259
  title: 'Long Time Format',
291
260
  scope: 'U',
261
+ isInherited: true,
292
262
  defaultValue: 'hh:mm:ss a',
293
263
  widget: {
294
264
  type: AXPWidgetsCatalog.select,
@@ -307,13 +277,56 @@ class AXMRegionalSettingProvider {
307
277
  }
308
278
  }
309
279
 
280
+ // ThemeStore - Manages theme settings and system changes
281
+ const AXPRegionalStoreService = signalStore({ providedIn: 'root' },
282
+ // Initial State
283
+ withState((translationService = inject(AXTranslationService)) => {
284
+ const state = {
285
+ language: translationService.getDefaultLang(),
286
+ };
287
+ return state;
288
+ }),
289
+ // Computed Signals
290
+ // withComputed(({ }) => ({
291
+ // })),
292
+ // Methods for State Management
293
+ withMethods((store, settingService = inject(AXPSettingValueProviderService), translationService = inject(AXTranslationService), regionalService = inject(AXPRegionalService)) => {
294
+ return {
295
+ async changeLanguage(lang) {
296
+ if (lang != store.language()) {
297
+ settingService.scope(AXPSettingScope.User).set(AXPRegionalSetting.Language, lang);
298
+ patchState(store, { language: lang });
299
+ }
300
+ translationService.setActiveLang(lang);
301
+ const reg = await (await regionalService.getRegionalFormats()).find(c => c.locale == lang);
302
+ const html = document.getElementsByTagName('html')[0];
303
+ reg?.layout == 'rtl' ? html.setAttribute('dir', 'rtl') : html.removeAttribute('dir');
304
+ },
305
+ async loadSetting() {
306
+ const lang = (await settingService.get(AXPRegionalSetting.Language)) ?? translationService.getDefaultLang();
307
+ await this.changeLanguage(lang);
308
+ },
309
+ };
310
+ }), withHooks((store, settingService = inject(AXPSettingValueProviderService)) => ({
311
+ onInit() {
312
+ settingService.onChanged.subscribe(async (setting) => {
313
+ if (setting.keys.includes(AXPRegionalSetting.Language)) {
314
+ await store.loadSetting();
315
+ }
316
+ });
317
+ },
318
+ onDestroy() {
319
+ },
320
+ })));
321
+
310
322
  class AXMLanguageSlotComponent {
311
323
  constructor() {
324
+ this.regionalService = inject(AXPRegionalService);
312
325
  this.store = inject(AXPRegionalStoreService);
313
326
  this.items = signal([]);
314
327
  }
315
328
  async ngOnInit() {
316
- const items = await this.store.getAvailableLanguages();
329
+ const items = await this.regionalService.getAvailableLanguages();
317
330
  this.items.set(items);
318
331
  }
319
332
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMLanguageSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
@@ -324,6 +337,203 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
324
337
  args: [{ imports: [AXDropdownModule, AXDecoratorModule, AXPopoverModule, AXButtonModule, CommonModule], template: "<ax-button look=\"blank\">\n <ax-icon class=\"fa-regular fa-globe\"> </ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n @for(lang of items(); track lang){\n <ax-button-item [text]=\"lang.title\" [selected]=\"store.language()===lang.code\"\n (onClick)=\"store.changeLanguage(lang.code)\">\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-flag\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n</ax-button>" }]
325
338
  }] });
326
339
 
340
+ const path = 'settings:organization:';
341
+ var AXPOrganizationSetting;
342
+ (function (AXPOrganizationSetting) {
343
+ AXPOrganizationSetting["OrganizationName"] = "settings:organization:organization-name";
344
+ AXPOrganizationSetting["OrganizationID"] = "settings:organization:organization-id";
345
+ AXPOrganizationSetting["ContactEmail"] = "settings:organization:contact-email";
346
+ AXPOrganizationSetting["ContactPhone"] = "settings:organization:contact-phone";
347
+ AXPOrganizationSetting["OrganizationAddress"] = "settings:organization:organization-address";
348
+ AXPOrganizationSetting["OrganizationCity"] = "settings:organization:organization-city";
349
+ AXPOrganizationSetting["OrganizationCountry"] = "settings:organization:organization-country";
350
+ AXPOrganizationSetting["BrandingColor"] = "settings:organization:branding-color";
351
+ AXPOrganizationSetting["BrandingLogo"] = "settings:organization:branding-logo";
352
+ AXPOrganizationSetting["CopyrightText"] = "settings:organization:copyright-text";
353
+ AXPOrganizationSetting["ApplicationHeaderTitle"] = "settings:organization:application-header-title";
354
+ AXPOrganizationSetting["SupportEmail"] = "settings:organization:support-email";
355
+ AXPOrganizationSetting["InfoEmail"] = "settings:organization:info-email";
356
+ AXPOrganizationSetting["FaxNumber"] = "settings:organization:fax-number";
357
+ })(AXPOrganizationSetting || (AXPOrganizationSetting = {}));
358
+
359
+ class AXMOrganizationSettingProvider {
360
+ constructor() {
361
+ this.sessionService = inject(AXPSessionService);
362
+ }
363
+ async provide(context) {
364
+ context
365
+ .addGroup('organization-settings', 'Organization Settings', 'Manage organizational preferences.', 'fa-solid fa-building')
366
+ // Branding Section
367
+ .addSection('branding', 'Branding', 'Configure company branding.')
368
+ .addSetting({
369
+ key: AXPOrganizationSetting.OrganizationName,
370
+ title: 'Company Name',
371
+ scope: 'T',
372
+ isInherited: false,
373
+ defaultValue: this.sessionService.tenant?.title,
374
+ widget: {
375
+ type: AXPWidgetsCatalog.text,
376
+ },
377
+ description: 'Specify the official name of the company.',
378
+ })
379
+ .addSetting({
380
+ key: 'branding-logo',
381
+ title: 'Company Logo',
382
+ scope: 'T',
383
+ isInherited: false,
384
+ defaultValue: '',
385
+ widget: {
386
+ type: AXPWidgetsCatalog.avatar,
387
+ options: {
388
+ fileTypes: ['image/png', 'image/jpeg'],
389
+ },
390
+ },
391
+ description: 'Upload the company logo.',
392
+ })
393
+ .addSetting({
394
+ key: 'copyright-text',
395
+ title: 'Copyright Text',
396
+ scope: 'T',
397
+ isInherited: true,
398
+ defaultValue: '© 2024 Your Company',
399
+ widget: {
400
+ type: AXPWidgetsCatalog.text,
401
+ },
402
+ description: 'Text displayed in the footer of the application.',
403
+ })
404
+ .addSetting({
405
+ key: 'application-header-title',
406
+ title: 'Application Header Title',
407
+ scope: 'T',
408
+ isInherited: true,
409
+ defaultValue: this.sessionService.application?.title,
410
+ widget: {
411
+ type: AXPWidgetsCatalog.text,
412
+ },
413
+ description: 'Title displayed in the application header.',
414
+ })
415
+ .endSection()
416
+ // Contact Details Section
417
+ .addSection('contact', 'Contact Details', 'Set company contact information.')
418
+ .addSetting({
419
+ key: AXPOrganizationSetting.ContactEmail,
420
+ title: 'Company Email',
421
+ scope: 'T',
422
+ isInherited: false,
423
+ defaultValue: '',
424
+ widget: {
425
+ type: AXPWidgetsCatalog.contact,
426
+ options: {
427
+ type: 'email',
428
+ hasLabel: false,
429
+ }
430
+ },
431
+ description: 'Primary email address for the company.',
432
+ })
433
+ .addSetting({
434
+ key: 'support-email',
435
+ title: 'Support Email',
436
+ scope: 'T',
437
+ isInherited: false,
438
+ defaultValue: '',
439
+ widget: {
440
+ type: AXPWidgetsCatalog.contact,
441
+ options: {
442
+ type: 'email',
443
+ hasLabel: false,
444
+ }
445
+ },
446
+ description: 'Support email address for customer inquiries.',
447
+ })
448
+ .addSetting({
449
+ key: 'info-email',
450
+ title: 'Info Email',
451
+ scope: 'T',
452
+ isInherited: false,
453
+ defaultValue: '',
454
+ widget: {
455
+ type: AXPWidgetsCatalog.contact,
456
+ options: {
457
+ type: 'email',
458
+ hasLabel: false,
459
+ }
460
+ },
461
+ description: 'General information email address.',
462
+ })
463
+ .addSetting({
464
+ key: AXPOrganizationSetting.ContactPhone,
465
+ title: 'Company Phone',
466
+ scope: 'T',
467
+ isInherited: false,
468
+ defaultValue: '',
469
+ widget: {
470
+ type: AXPWidgetsCatalog.contact,
471
+ options: {
472
+ type: 'phone',
473
+ hasLabel: false,
474
+ }
475
+ },
476
+ description: 'Primary contact phone number.',
477
+ })
478
+ .addSetting({
479
+ key: 'fax-number',
480
+ title: 'Fax Number',
481
+ scope: 'T',
482
+ isInherited: false,
483
+ defaultValue: '',
484
+ widget: {
485
+ type: AXPWidgetsCatalog.contact,
486
+ options: {
487
+ type: 'phone',
488
+ hasLabel: false,
489
+ }
490
+ },
491
+ description: 'Fax number for the company.',
492
+ })
493
+ .endSection()
494
+ // Address Section
495
+ .addSection('address', 'Address', 'Manage company address details.')
496
+ .addSetting({
497
+ key: AXPOrganizationSetting.OrganizationAddress,
498
+ title: 'Street Address',
499
+ scope: 'T',
500
+ isInherited: false,
501
+ defaultValue: '',
502
+ widget: {
503
+ type: AXPWidgetsCatalog.text,
504
+ },
505
+ description: 'Street address of the company.',
506
+ })
507
+ .addSetting({
508
+ key: AXPOrganizationSetting.OrganizationCity,
509
+ title: 'City',
510
+ scope: 'T',
511
+ isInherited: false,
512
+ defaultValue: '',
513
+ widget: {
514
+ type: AXPWidgetsCatalog.text,
515
+ },
516
+ description: 'City where the company is located.',
517
+ })
518
+ .addSetting({
519
+ key: AXPOrganizationSetting.OrganizationCountry,
520
+ title: 'Country',
521
+ scope: 'T',
522
+ isInherited: false,
523
+ defaultValue: '',
524
+ widget: {
525
+ type: AXPWidgetsCatalog.select,
526
+ options: {
527
+ dataSource: ['United States', 'United Kingdom', 'France', 'Germany', 'Japan', 'China'],
528
+ },
529
+ },
530
+ description: 'Country where the company is based.',
531
+ })
532
+ .endSection()
533
+ .endGroup();
534
+ }
535
+ }
536
+
327
537
  class AXMPlatformManagementCommonModule {
328
538
  constructor(appInitService, injector) {
329
539
  const service = injector.get(AXPRegionalStoreService);
@@ -348,6 +558,11 @@ class AXMPlatformManagementCommonModule {
348
558
  useClass: AXMRegionalSettingProvider,
349
559
  multi: true
350
560
  },
561
+ {
562
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
563
+ useClass: AXMOrganizationSettingProvider,
564
+ multi: true
565
+ },
351
566
  ], imports: [AXPComponentSlotModule.forChild({
352
567
  'header-end': [
353
568
  {
@@ -383,6 +598,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
383
598
  useClass: AXMRegionalSettingProvider,
384
599
  multi: true
385
600
  },
601
+ {
602
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
603
+ useClass: AXMOrganizationSettingProvider,
604
+ multi: true
605
+ },
386
606
  ],
387
607
  }]
388
608
  }], ctorParameters: () => [{ type: i1$1.AXPAppStartUpService }, { type: i0.Injector }] });
@@ -464,7 +684,7 @@ async function globalVariableEntityFactory(injector) {
464
684
  ],
465
685
  },
466
686
  {
467
- name: 'dataValue',
687
+ name: 'value',
468
688
  title: 'Data Value',
469
689
  groupId: 'section',
470
690
  schema: {
@@ -510,11 +730,11 @@ async function globalVariableEntityFactory(injector) {
510
730
  ],
511
731
  },
512
732
  ],
513
- columns: [{ name: 'title' }, { name: 'dataValue' }, { name: 'dataType' }],
733
+ columns: [{ name: 'title' }, { name: 'value' }, { name: 'dataType' }],
514
734
  commands: {
515
735
  create: {
516
736
  execute: async (data) => {
517
- return Promise.resolve(dataService.insertOne(data));
737
+ return Promise.resolve({ id: await dataService.insertOne(data) });
518
738
  },
519
739
  },
520
740
  delete: {
@@ -585,7 +805,7 @@ async function globalVariableEntityFactory(injector) {
585
805
  },
586
806
  },
587
807
  {
588
- name: 'dataValue',
808
+ name: 'value',
589
809
  layout: {
590
810
  positions: {
591
811
  lg: {
@@ -634,7 +854,7 @@ async function globalVariableEntityFactory(injector) {
634
854
  },
635
855
  },
636
856
  {
637
- name: 'dataValue',
857
+ name: 'value',
638
858
  layout: {
639
859
  positions: {
640
860
  lg: {
@@ -684,7 +904,7 @@ async function globalVariableEntityFactory(injector) {
684
904
  },
685
905
  },
686
906
  {
687
- name: 'dataValue',
907
+ name: 'value',
688
908
  layout: {
689
909
  positions: {
690
910
  lg: {
@@ -782,15 +1002,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
782
1002
  class AXMPlatformManagmentModuleMenuProvider {
783
1003
  constructor() {
784
1004
  this.entityService = inject(AXPEntityService);
1005
+ this.sessionService = inject(AXPSessionService);
785
1006
  }
786
1007
  async provide(context) {
787
1008
  const scope = AXMPlatformManagementModuleConst.i18n;
1009
+ const appName = this.sessionService.application?.name;
788
1010
  context.addItems([
789
1011
  {
790
1012
  name: 'administration-group',
791
1013
  priority: 2000,
792
1014
  text: `t('administration',{scope: "${scope}"})`,
793
1015
  type: 'group',
1016
+ data: {
1017
+ // requiredPermission: 'admin',
1018
+ },
1019
+ },
1020
+ {
1021
+ name: 'tenant-application-settings',
1022
+ priority: 10000,
1023
+ text: `t('settings.tenant.title', {scope: "${scope}"})`,
1024
+ type: 'menu',
1025
+ icon: 'fa-solid fa-gear',
1026
+ path: `/${appName}/settings/tenant`,
794
1027
  data: {
795
1028
  requiredPermission: 'admin',
796
1029
  },
@@ -801,7 +1034,7 @@ class AXMPlatformManagmentModuleMenuProvider {
801
1034
  type: 'menu',
802
1035
  priority: 9100,
803
1036
  data: {
804
- // requiredPermission: 'demo.admin.settings',
1037
+ requiredPermission: 'platform',
805
1038
  },
806
1039
  children: [
807
1040
  {