@acorex/platform 20.3.0-next.21 → 20.3.0-next.23

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.
@@ -1081,6 +1081,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
1081
1081
  args: [{ providedIn: 'root' }]
1082
1082
  }], ctorParameters: () => [{ type: i0.Injector }, { type: AXPErrorHandlerRegistryService }] });
1083
1083
 
1084
+ const AXP_GLOBAL_VARIABLE_DEFINITION_PROVIDER = new InjectionToken('AXP_GLOBAL_VARIABLE_DEFINITION_PROVIDER', {
1085
+ factory: () => [],
1086
+ });
1087
+
1088
+ //#region ---- Imports ----
1089
+ //#endregion
1090
+ class AXPGlobalVariableDefinitionService {
1091
+ constructor() {
1092
+ //#region ---- Providers & Caches ----
1093
+ this.definitionProviders = inject(AXP_GLOBAL_VARIABLE_DEFINITION_PROVIDER, { optional: true }) || [];
1094
+ /** Cache for definitions by name. */
1095
+ this.definitionsByName = new Map();
1096
+ }
1097
+ //#endregion
1098
+ //#region ---- Public API ----
1099
+ /**
1100
+ * Returns a report definition by its id.
1101
+ * First checks the cache, then queries all providers if not found.
1102
+ * @param name The global variable name.
1103
+ * @returns The global variable definition if found, undefined otherwise.
1104
+ */
1105
+ async getByName(name) {
1106
+ // Check cache first
1107
+ if (this.definitionsByName.has(name)) {
1108
+ return this.definitionsByName.get(name);
1109
+ }
1110
+ // Not in cache, query providers (each provider is itself a global variable definition)
1111
+ const resolvedProviders = await Promise.all(this.definitionProviders);
1112
+ const match = resolvedProviders.find(def => def?.name === name);
1113
+ if (match) {
1114
+ this.definitionsByName.set(name, match);
1115
+ return match;
1116
+ }
1117
+ return undefined;
1118
+ }
1119
+ async execute(name) {
1120
+ const definition = await this.getByName(name);
1121
+ if (definition) {
1122
+ return await definition.execute();
1123
+ }
1124
+ return undefined;
1125
+ }
1126
+ //#endregion
1127
+ //#region ---- Cache Management ----
1128
+ /** Clears the definitions by name cache. */
1129
+ clearDefinitionsCache() {
1130
+ this.definitionsByName.clear();
1131
+ }
1132
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGlobalVariableDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1133
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGlobalVariableDefinitionService, providedIn: 'root' }); }
1134
+ }
1135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGlobalVariableDefinitionService, decorators: [{
1136
+ type: Injectable,
1137
+ args: [{
1138
+ providedIn: 'root',
1139
+ }]
1140
+ }] });
1141
+
1142
+ class AXPGlobalVariableEvaluatorScopeProvider {
1143
+ constructor() {
1144
+ this.globalVariableService = inject(AXPGlobalVariableDefinitionService);
1145
+ }
1146
+ async provide(context) {
1147
+ context.addScope('variables', {
1148
+ execute: async (name) => {
1149
+ return await this.globalVariableService.execute(name);
1150
+ }
1151
+ });
1152
+ }
1153
+ }
1154
+
1084
1155
  class AXPStickyDirective {
1085
1156
  get isSticky() {
1086
1157
  return this._isSticky;
@@ -1225,16 +1296,355 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
1225
1296
  type: Input
1226
1297
  }] } });
1227
1298
 
1299
+ //#region ---- Menu Context Builder ----
1300
+ /**
1301
+ * Creates a rich context for menu manipulation
1302
+ * Similar to entity modifier context pattern
1303
+ */
1304
+ function createMenuContext(items) {
1305
+ const context = {
1306
+ get items() {
1307
+ return items;
1308
+ },
1309
+ find(nameOrPattern) {
1310
+ if (typeof nameOrPattern === 'string') {
1311
+ return context.findByName(nameOrPattern);
1312
+ }
1313
+ const found = context.findByPattern(nameOrPattern);
1314
+ return found.length > 0 ? found[0] : createEmptyFinder();
1315
+ },
1316
+ findByName(name) {
1317
+ return createMenuItemFinder(items, name);
1318
+ },
1319
+ findByPattern(pattern) {
1320
+ const regex = typeof pattern === 'string' ? wildcardToRegex(pattern) : pattern;
1321
+ const results = [];
1322
+ const searchRecursive = (itemList) => {
1323
+ for (const item of itemList) {
1324
+ if (item.name && regex.test(item.name)) {
1325
+ results.push(createMenuItemFinder(items, item.name));
1326
+ }
1327
+ if (item.children) {
1328
+ searchRecursive(item.children);
1329
+ }
1330
+ }
1331
+ };
1332
+ searchRecursive(items);
1333
+ return results;
1334
+ },
1335
+ add(...newItems) {
1336
+ items.push(...newItems);
1337
+ return context;
1338
+ },
1339
+ remove(predicate) {
1340
+ removeRecursive(items, predicate);
1341
+ return context;
1342
+ },
1343
+ sort() {
1344
+ sortItemsRecursively(items);
1345
+ return context;
1346
+ },
1347
+ toArray() {
1348
+ return items;
1349
+ },
1350
+ };
1351
+ return context;
1352
+ }
1353
+ //#endregion
1354
+ //#region ---- Menu Item Finder Implementation ----
1355
+ /**
1356
+ * Creates a finder for a specific menu item
1357
+ */
1358
+ function createMenuItemFinder(rootItems, targetName) {
1359
+ const findItemWithParent = (items, name, parent = { items: rootItems }) => {
1360
+ for (const item of items) {
1361
+ if (item.name === name) {
1362
+ return { item, parent };
1363
+ }
1364
+ if (item.children) {
1365
+ const result = findItemWithParent(item.children, name, { items: item.children });
1366
+ if (result.item) {
1367
+ return result;
1368
+ }
1369
+ }
1370
+ }
1371
+ return { item: undefined, parent };
1372
+ };
1373
+ const finder = {
1374
+ get() {
1375
+ return findItemWithParent(rootItems, targetName).item;
1376
+ },
1377
+ exists() {
1378
+ return finder.get() !== undefined;
1379
+ },
1380
+ update(updater) {
1381
+ const { item } = findItemWithParent(rootItems, targetName);
1382
+ if (item) {
1383
+ const updates = typeof updater === 'function' ? updater(item) : updater;
1384
+ Object.assign(item, updates);
1385
+ }
1386
+ return finder;
1387
+ },
1388
+ remove() {
1389
+ const { item, parent } = findItemWithParent(rootItems, targetName);
1390
+ if (item) {
1391
+ const index = parent.items.indexOf(item);
1392
+ if (index !== -1) {
1393
+ parent.items.splice(index, 1);
1394
+ }
1395
+ }
1396
+ return finder;
1397
+ },
1398
+ hide() {
1399
+ // Hide by removing the item from menu
1400
+ return finder.remove();
1401
+ },
1402
+ show() {
1403
+ // Show is a no-op since items are visible by default
1404
+ // To truly implement show, we'd need to track removed items and re-add them
1405
+ console.warn('show() is not fully implemented - items are visible by default');
1406
+ return finder;
1407
+ },
1408
+ setPriority(priority) {
1409
+ return finder.update({ priority });
1410
+ },
1411
+ addChildren(...children) {
1412
+ const { item } = findItemWithParent(rootItems, targetName);
1413
+ if (item) {
1414
+ item.children = item.children || [];
1415
+ item.children.push(...children);
1416
+ }
1417
+ return finder;
1418
+ },
1419
+ removeChildren(predicate) {
1420
+ const { item } = findItemWithParent(rootItems, targetName);
1421
+ if (item && item.children) {
1422
+ item.children = item.children.filter((c) => !predicate(c));
1423
+ }
1424
+ return finder;
1425
+ },
1426
+ moveTo(parentName) {
1427
+ const { item, parent: oldParent } = findItemWithParent(rootItems, targetName);
1428
+ if (!item) {
1429
+ return finder;
1430
+ }
1431
+ // Remove from old parent
1432
+ const oldIndex = oldParent.items.indexOf(item);
1433
+ if (oldIndex !== -1) {
1434
+ oldParent.items.splice(oldIndex, 1);
1435
+ }
1436
+ // Add to new parent
1437
+ if (parentName === null) {
1438
+ // Move to root
1439
+ rootItems.push(item);
1440
+ }
1441
+ else {
1442
+ const { item: newParentItem } = findItemWithParent(rootItems, parentName);
1443
+ if (newParentItem) {
1444
+ newParentItem.children = newParentItem.children || [];
1445
+ newParentItem.children.push(item);
1446
+ }
1447
+ }
1448
+ return finder;
1449
+ },
1450
+ insertBefore(...items) {
1451
+ const { item, parent } = findItemWithParent(rootItems, targetName);
1452
+ if (item) {
1453
+ const index = parent.items.indexOf(item);
1454
+ if (index !== -1) {
1455
+ parent.items.splice(index, 0, ...items);
1456
+ }
1457
+ }
1458
+ return finder;
1459
+ },
1460
+ insertAfter(...items) {
1461
+ const { item, parent } = findItemWithParent(rootItems, targetName);
1462
+ if (item) {
1463
+ const index = parent.items.indexOf(item);
1464
+ if (index !== -1) {
1465
+ parent.items.splice(index + 1, 0, ...items);
1466
+ }
1467
+ }
1468
+ return finder;
1469
+ },
1470
+ };
1471
+ return finder;
1472
+ }
1473
+ /**
1474
+ * Creates an empty finder for items not found
1475
+ */
1476
+ function createEmptyFinder() {
1477
+ return {
1478
+ get: () => undefined,
1479
+ exists: () => false,
1480
+ update: () => createEmptyFinder(),
1481
+ remove: () => createEmptyFinder(),
1482
+ hide: () => createEmptyFinder(),
1483
+ show: () => createEmptyFinder(),
1484
+ setPriority: () => createEmptyFinder(),
1485
+ addChildren: () => createEmptyFinder(),
1486
+ removeChildren: () => createEmptyFinder(),
1487
+ moveTo: () => createEmptyFinder(),
1488
+ insertBefore: () => createEmptyFinder(),
1489
+ insertAfter: () => createEmptyFinder(),
1490
+ };
1491
+ }
1492
+ //#endregion
1493
+ //#region ---- Helper Functions ----
1494
+ /**
1495
+ * Converts wildcard pattern to regex
1496
+ */
1497
+ function wildcardToRegex(pattern) {
1498
+ const escaped = pattern.replace(/[.+?^${}()|\[\]\\]/g, '\\$&');
1499
+ const regexStr = `^${escaped.replace(/\*/g, '.*')}$`;
1500
+ return new RegExp(regexStr);
1501
+ }
1502
+ /**
1503
+ * Recursively removes items matching predicate
1504
+ */
1505
+ function removeRecursive(items, predicate) {
1506
+ for (let i = items.length - 1; i >= 0; i--) {
1507
+ const item = items[i];
1508
+ if (predicate(item)) {
1509
+ items.splice(i, 1);
1510
+ }
1511
+ else if (item.children) {
1512
+ removeRecursive(item.children, predicate);
1513
+ }
1514
+ }
1515
+ }
1516
+ /**
1517
+ * Recursively sorts items by priority
1518
+ */
1519
+ function sortItemsRecursively(items) {
1520
+ items.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0));
1521
+ items.forEach((item) => {
1522
+ if (item.children && item.children.length > 0) {
1523
+ sortItemsRecursively(item.children);
1524
+ }
1525
+ });
1526
+ }
1527
+ //#endregion
1528
+
1529
+ /**
1530
+ * Injection token for menu middlewares (multi-provider)
1531
+ */
1532
+ const AXP_MENU_MIDDLEWARE = new InjectionToken('AXP_MENU_MIDDLEWARE');
1533
+ //#endregion
1534
+
1535
+ //#region ---- Menu Middleware Registry ----
1536
+ /**
1537
+ * Central service for managing menu middlewares with priority-based ordering
1538
+ * Similar to token registry pattern used in identifier-management
1539
+ */
1540
+ class AXPMenuMiddlewareRegistry {
1541
+ constructor() {
1542
+ //#region ---- Fields ----
1543
+ /**
1544
+ * Manually registered middlewares
1545
+ */
1546
+ this.manualMiddlewares = new Map();
1547
+ /**
1548
+ * Provider-based middlewares (multi-provider injection)
1549
+ */
1550
+ this.providerMiddlewares = inject(AXP_MENU_MIDDLEWARE, { optional: true }) ?? [];
1551
+ }
1552
+ //#endregion
1553
+ //#region ---- Registration Methods ----
1554
+ /**
1555
+ * Manually register a middleware
1556
+ * @param middleware - The middleware to register
1557
+ */
1558
+ register(middleware) {
1559
+ const name = middleware.name || `middleware_${Date.now()}_${Math.random()}`;
1560
+ const existing = this.manualMiddlewares.get(name);
1561
+ if (!existing || (middleware.priority ?? 0) > (existing.priority ?? 0)) {
1562
+ this.manualMiddlewares.set(name, middleware);
1563
+ }
1564
+ }
1565
+ /**
1566
+ * Unregister a middleware by name
1567
+ * @param name - The name of the middleware to remove
1568
+ */
1569
+ unregister(name) {
1570
+ this.manualMiddlewares.delete(name);
1571
+ }
1572
+ /**
1573
+ * Get a specific middleware by name
1574
+ * @param name - The middleware name
1575
+ */
1576
+ get(name) {
1577
+ // Provider-provided middlewares take precedence
1578
+ const fromProvider = this.providerMiddlewares
1579
+ .filter((m) => m.name === name)
1580
+ .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0))[0];
1581
+ if (fromProvider) {
1582
+ return fromProvider;
1583
+ }
1584
+ return this.manualMiddlewares.get(name);
1585
+ }
1586
+ /**
1587
+ * Get all middlewares sorted by priority (highest first)
1588
+ * Combines provider-based and manually registered middlewares
1589
+ */
1590
+ list() {
1591
+ const map = new Map();
1592
+ // Helper to add middleware, respecting priority
1593
+ const addMiddleware = (m) => {
1594
+ const name = m.name || `anonymous_${Date.now()}`;
1595
+ const existing = map.get(name);
1596
+ if (!existing || (m.priority ?? 0) > (existing.priority ?? 0)) {
1597
+ map.set(name, m);
1598
+ }
1599
+ };
1600
+ // Add provider middlewares first (higher precedence)
1601
+ this.providerMiddlewares.forEach(addMiddleware);
1602
+ // Add manual middlewares
1603
+ Array.from(this.manualMiddlewares.values()).forEach(addMiddleware);
1604
+ // Return sorted by priority (highest first)
1605
+ return Array.from(map.values()).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
1606
+ }
1607
+ /**
1608
+ * Check if a middleware exists
1609
+ * @param name - The middleware name
1610
+ */
1611
+ exists(name) {
1612
+ return this.get(name) !== undefined;
1613
+ }
1614
+ /**
1615
+ * Clear all manually registered middlewares
1616
+ * Provider-based middlewares are not affected
1617
+ */
1618
+ clear() {
1619
+ this.manualMiddlewares.clear();
1620
+ }
1621
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMenuMiddlewareRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1622
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMenuMiddlewareRegistry, providedIn: 'root' }); }
1623
+ }
1624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMenuMiddlewareRegistry, decorators: [{
1625
+ type: Injectable,
1626
+ args: [{ providedIn: 'root' }]
1627
+ }] });
1628
+
1228
1629
  const AXP_MENU_PROVIDER = new InjectionToken('AXP_MENU_PROVIDER');
1229
1630
  class AXPMenuProviderService {
1230
1631
  constructor() {
1632
+ //#region ---- Dependencies ----
1231
1633
  this.providers = inject(AXP_MENU_PROVIDER, { optional: true });
1634
+ this.middlewareRegistry = inject(AXPMenuMiddlewareRegistry);
1635
+ //#endregion
1636
+ //#region ---- State ----
1232
1637
  this.cache = null;
1233
1638
  this.pendingInserts = [];
1234
1639
  this.pendingRemovals = [];
1235
1640
  this.pendingUpdates = [];
1236
1641
  this.pendingAdditions = [];
1237
1642
  }
1643
+ //#endregion
1644
+ //#region ---- Public API ----
1645
+ /**
1646
+ * Get menu items with middlewares applied (for end-user display)
1647
+ */
1238
1648
  async items() {
1239
1649
  // Return cached items if available
1240
1650
  if (this.cache) {
@@ -1251,12 +1661,65 @@ class AXPMenuProviderService {
1251
1661
  this.applyPendingOperations(items);
1252
1662
  // Sort items by priority
1253
1663
  items.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0));
1664
+ // Apply middlewares using registry (sorted by priority)
1665
+ await this.applyMiddlewares(items);
1254
1666
  // ADD level property to items
1255
1667
  setMenuItemMeta(items);
1256
1668
  // Cache the computed items
1257
1669
  this.cache = items;
1258
1670
  return items;
1259
1671
  }
1672
+ /**
1673
+ * Get raw menu items WITHOUT middleware applied (for management/editing)
1674
+ * Used by menu management pages to show original items before customization
1675
+ */
1676
+ async rawItems() {
1677
+ const items = [];
1678
+ const context = this.createMenuProviderContext(items);
1679
+ if (Array.isArray(this.providers)) {
1680
+ for (const provider of this.providers) {
1681
+ await provider.provide(context);
1682
+ }
1683
+ }
1684
+ // Apply pending operations
1685
+ this.applyPendingOperations(items);
1686
+ // Sort items by priority
1687
+ items.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0));
1688
+ // ADD level property to items (but NO middleware)
1689
+ setMenuItemMeta(items);
1690
+ return items;
1691
+ }
1692
+ /**
1693
+ * Clear the cache to force reload of menu items
1694
+ */
1695
+ clearCache() {
1696
+ this.cache = null;
1697
+ this.pendingInserts = [];
1698
+ this.pendingRemovals = [];
1699
+ this.pendingUpdates = [];
1700
+ this.pendingAdditions = [];
1701
+ }
1702
+ //#endregion
1703
+ //#region ---- Private Methods ----
1704
+ /**
1705
+ * Apply middlewares in priority order using the enhanced context API
1706
+ */
1707
+ async applyMiddlewares(items) {
1708
+ const middlewares = this.middlewareRegistry.list();
1709
+ for (const middleware of middlewares) {
1710
+ try {
1711
+ const context = createMenuContext(items);
1712
+ await middleware.process(context);
1713
+ // The context mutates the items array, so no need to reassign
1714
+ }
1715
+ catch (error) {
1716
+ console.error(`Error in menu middleware ${middleware.name || 'anonymous'}:`, error);
1717
+ }
1718
+ }
1719
+ }
1720
+ /**
1721
+ * Create provider context for menu providers
1722
+ */
1260
1723
  createMenuProviderContext(items) {
1261
1724
  return {
1262
1725
  addItems: (newItems) => {
@@ -1353,14 +1816,6 @@ class AXPMenuProviderService {
1353
1816
  }
1354
1817
  return { foundItem: null, parentItems: items };
1355
1818
  }
1356
- // Method to clear the cache, if needed (e.g., when providers change)
1357
- clearCache() {
1358
- this.cache = null;
1359
- this.pendingInserts = [];
1360
- this.pendingRemovals = [];
1361
- this.pendingUpdates = [];
1362
- this.pendingAdditions = [];
1363
- }
1364
1819
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMenuProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1365
1820
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMenuProviderService, providedIn: 'root' }); }
1366
1821
  }
@@ -1384,6 +1839,57 @@ function setMenuItemMeta(items, parentIndex = '', depth = 0) {
1384
1839
  });
1385
1840
  }
1386
1841
 
1842
+ //#region ---- Menu Middleware Provider Helper ----
1843
+ /**
1844
+ * Helper function to provide menu middlewares with proper DI setup
1845
+ * Similar to provideCommandMiddleware pattern
1846
+ *
1847
+ * @example
1848
+ * ```typescript
1849
+ * // In app.config.ts or module providers
1850
+ * export const appConfig: ApplicationConfig = {
1851
+ * providers: [
1852
+ * provideMenuMiddleware([
1853
+ * customizationMiddleware,
1854
+ * securityMiddleware,
1855
+ * loggingMiddleware
1856
+ * ])
1857
+ * ]
1858
+ * };
1859
+ * ```
1860
+ */
1861
+ function provideMenuMiddleware(middlewares) {
1862
+ return makeEnvironmentProviders([
1863
+ ...middlewares.map((middleware) => ({
1864
+ provide: AXP_MENU_MIDDLEWARE,
1865
+ useValue: middleware,
1866
+ multi: true,
1867
+ })),
1868
+ ]);
1869
+ }
1870
+ /**
1871
+ * Helper to create a class-based middleware with priority
1872
+ *
1873
+ * @example
1874
+ * ```typescript
1875
+ * const myMiddleware = createMenuMiddleware({
1876
+ * name: 'my-middleware',
1877
+ * priority: 100,
1878
+ * process: async (context) => {
1879
+ * context.find('dashboard').setPriority(1);
1880
+ * }
1881
+ * });
1882
+ * ```
1883
+ */
1884
+ function createMenuMiddleware(config) {
1885
+ return {
1886
+ name: config.name,
1887
+ priority: config.priority ?? 0,
1888
+ process: config.process,
1889
+ };
1890
+ }
1891
+ //#endregion
1892
+
1387
1893
  const AXPMenuService = signalStore({ providedIn: 'root' },
1388
1894
  // Initial State
1389
1895
  withState((router = inject(Router)) => {
@@ -1851,6 +2357,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
1851
2357
  args: [{ providedIn: 'root' }]
1852
2358
  }] });
1853
2359
 
2360
+ var AXPCommonSettings;
2361
+ (function (AXPCommonSettings) {
2362
+ AXPCommonSettings["EnableOperationToasts"] = "general:notifications:enable-operation-toasts";
2363
+ })(AXPCommonSettings || (AXPCommonSettings = {}));
2364
+
1854
2365
  //TODO Loading, Redirect, Drawer, Show toast
1855
2366
  const AXPRedirectEvent = createWorkFlowEvent('Redirect Event Fired');
1856
2367
  const AXPRefreshEvent = createWorkFlowEvent('Refresh Event Fired');
@@ -1903,11 +2414,10 @@ class AXPToastAction extends AXPWorkflowAction {
1903
2414
  super(...arguments);
1904
2415
  this.toastService = inject(AXToastService);
1905
2416
  this.translationService = inject(AXTranslationService);
2417
+ this.settingService = inject(AXPSettingService);
1906
2418
  }
1907
2419
  async execute(context) {
1908
- const options = context.getVariable('options');
1909
- const process = options?.['process'];
1910
- const showResult = process?.showResult ?? true;
2420
+ const showResult = await this.settingService.get(AXPCommonSettings.EnableOperationToasts);
1911
2421
  if (showResult) {
1912
2422
  this.toastService.show({
1913
2423
  color: this.color,
@@ -2007,77 +2517,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
2007
2517
  type: Injectable
2008
2518
  }] });
2009
2519
 
2010
- const AXP_GLOBAL_VARIABLE_DEFINITION_PROVIDER = new InjectionToken('AXP_GLOBAL_VARIABLE_DEFINITION_PROVIDER', {
2011
- factory: () => [],
2012
- });
2013
-
2014
- //#region ---- Imports ----
2015
- //#endregion
2016
- class AXPGlobalVariableDefinitionService {
2017
- constructor() {
2018
- //#region ---- Providers & Caches ----
2019
- this.definitionProviders = inject(AXP_GLOBAL_VARIABLE_DEFINITION_PROVIDER, { optional: true }) || [];
2020
- /** Cache for definitions by name. */
2021
- this.definitionsByName = new Map();
2022
- }
2023
- //#endregion
2024
- //#region ---- Public API ----
2025
- /**
2026
- * Returns a report definition by its id.
2027
- * First checks the cache, then queries all providers if not found.
2028
- * @param name The global variable name.
2029
- * @returns The global variable definition if found, undefined otherwise.
2030
- */
2031
- async getByName(name) {
2032
- // Check cache first
2033
- if (this.definitionsByName.has(name)) {
2034
- return this.definitionsByName.get(name);
2035
- }
2036
- // Not in cache, query providers (each provider is itself a global variable definition)
2037
- const resolvedProviders = await Promise.all(this.definitionProviders);
2038
- const match = resolvedProviders.find(def => def?.name === name);
2039
- if (match) {
2040
- this.definitionsByName.set(name, match);
2041
- return match;
2042
- }
2043
- return undefined;
2044
- }
2045
- async execute(name) {
2046
- const definition = await this.getByName(name);
2047
- if (definition) {
2048
- return await definition.execute();
2049
- }
2050
- return undefined;
2051
- }
2052
- //#endregion
2053
- //#region ---- Cache Management ----
2054
- /** Clears the definitions by name cache. */
2055
- clearDefinitionsCache() {
2056
- this.definitionsByName.clear();
2057
- }
2058
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGlobalVariableDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2059
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGlobalVariableDefinitionService, providedIn: 'root' }); }
2060
- }
2061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGlobalVariableDefinitionService, decorators: [{
2062
- type: Injectable,
2063
- args: [{
2064
- providedIn: 'root',
2065
- }]
2066
- }] });
2067
-
2068
- class AXPGlobalVariableEvaluatorScopeProvider {
2069
- constructor() {
2070
- this.globalVariableService = inject(AXPGlobalVariableDefinitionService);
2071
- }
2072
- async provide(context) {
2073
- context.addScope('variables', {
2074
- execute: async (name) => {
2075
- return await this.globalVariableService.execute(name);
2076
- }
2077
- });
2078
- }
2079
- }
2080
-
2081
2520
  class AXPCommonModule {
2082
2521
  static forRoot(configs) {
2083
2522
  return {
@@ -2160,12 +2599,21 @@ class AXPCommonModule {
2160
2599
  useClass: AXPGlobalVariableEvaluatorScopeProvider,
2161
2600
  multi: true,
2162
2601
  },
2602
+ {
2603
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
2604
+ useFactory: async () => {
2605
+ const injector = inject(Injector);
2606
+ const provider = (await import('./acorex-platform-common-common-settings.provider-9OHien_H.mjs')).AXPCommonSettingProvider;
2607
+ return new provider(injector);
2608
+ },
2609
+ multi: true,
2610
+ },
2163
2611
  ], imports: [AXPWorkflowModule.forChild({
2164
2612
  actions: {
2165
2613
  'navigate-router': AXPWorkflowRouterNavigateAction,
2166
2614
  'show-prompt-dialog': AXPDialogConfirmAction,
2167
2615
  'show-toast': AXPToastAction,
2168
- 'reload': AXPReloadAction,
2616
+ reload: AXPReloadAction,
2169
2617
  },
2170
2618
  workflows: {
2171
2619
  navigate: AXPNavigateWorkflow,
@@ -2184,7 +2632,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
2184
2632
  'navigate-router': AXPWorkflowRouterNavigateAction,
2185
2633
  'show-prompt-dialog': AXPDialogConfirmAction,
2186
2634
  'show-toast': AXPToastAction,
2187
- 'reload': AXPReloadAction,
2635
+ reload: AXPReloadAction,
2188
2636
  },
2189
2637
  workflows: {
2190
2638
  navigate: AXPNavigateWorkflow,
@@ -2224,6 +2672,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
2224
2672
  useClass: AXPGlobalVariableEvaluatorScopeProvider,
2225
2673
  multi: true,
2226
2674
  },
2675
+ {
2676
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
2677
+ useFactory: async () => {
2678
+ const injector = inject(Injector);
2679
+ const provider = (await import('./acorex-platform-common-common-settings.provider-9OHien_H.mjs')).AXPCommonSettingProvider;
2680
+ return new provider(injector);
2681
+ },
2682
+ multi: true,
2683
+ },
2227
2684
  ],
2228
2685
  }]
2229
2686
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -2588,5 +3045,5 @@ class AXPVersioningService {
2588
3045
  * Generated bundle index. Do not edit.
2589
3046
  */
2590
3047
 
2591
- export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPGlobalVariableDefinitionService, AXPGlobalVariableEvaluatorScopeProvider, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPLogoComponent, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingService, AXPStickyDirective, AXPToastAction, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_GLOBAL_VARIABLE_DEFINITION_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_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, createAllQueryView, createQueryView, getEntityInfo, provideDynamicHomePage };
3048
+ export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPGlobalVariableDefinitionService, AXPGlobalVariableEvaluatorScopeProvider, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPLogoComponent, AXPMenuMiddlewareRegistry, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingService, AXPStickyDirective, AXPToastAction, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_GLOBAL_VARIABLE_DEFINITION_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_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, createAllQueryView, createMenuContext, createMenuMiddleware, createQueryView, getEntityInfo, provideDynamicHomePage, provideMenuMiddleware };
2592
3049
  //# sourceMappingURL=acorex-platform-common.mjs.map