@acorex/platform 19.1.7 → 19.1.8

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 (45) hide show
  1. package/common/lib/common.module.d.ts +6 -7
  2. package/common/lib/layout/menu/menu.types.d.ts +2 -2
  3. package/common/lib/layout/menu/search.provider.d.ts +2 -2
  4. package/common/lib/search/search.provider.d.ts +4 -0
  5. package/common/lib/store/common.actions.d.ts +0 -12
  6. package/common/lib/store/index.d.ts +0 -1
  7. package/common/lib/workflows/index.d.ts +1 -0
  8. package/common/lib/workflows/navigate.workflow.d.ts +9 -0
  9. package/core/lib/types.d.ts +19 -0
  10. package/fesm2022/acorex-platform-common.mjs +805 -793
  11. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-builder.mjs +1 -0
  14. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-entity.mjs +93 -6
  16. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-search.mjs +18 -5
  18. package/fesm2022/acorex-platform-layout-search.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-themes-default-search-popup.component-BiKt6Mvr.mjs +84 -0
  20. package/fesm2022/acorex-platform-themes-default-search-popup.component-BiKt6Mvr.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-themes-default.mjs +5 -5
  22. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-widgets.mjs +308 -33
  24. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  25. package/layout/builder/lib/builder/widget-map.d.ts +1 -0
  26. package/layout/entity/lib/entity-registery.service.d.ts +16 -0
  27. package/layout/entity/lib/entity.config.d.ts +2 -2
  28. package/layout/entity/lib/entity.module.d.ts +3 -0
  29. package/layout/entity/lib/search-definition.provider.d.ts +6 -0
  30. package/layout/entity/lib/search.provider.d.ts +4 -0
  31. package/layout/search/lib/search.viewmodel.d.ts +5 -1
  32. package/layout/search/lib/workflows/search.workflow.d.ts +2 -1
  33. package/package.json +13 -13
  34. package/themes/default/lib/layouts/search-layout/search-popup.component.d.ts +3 -1
  35. package/widgets/lib/properties/layout.props.d.ts +1 -0
  36. package/widgets/lib/widgets/index.d.ts +1 -0
  37. package/widgets/lib/widgets/layout/grid/grid-widget-designer.component.d.ts +3 -1
  38. package/widgets/lib/widgets/property-editors/grid-options/grid-options-widget-editor.component.d.ts +39 -0
  39. package/widgets/lib/widgets/property-editors/grid-options/grid-options-widget.config.d.ts +7 -0
  40. package/widgets/lib/widgets/property-editors/grid-options/grid-options-widget.type.d.ts +19 -0
  41. package/widgets/lib/widgets/property-editors/grid-options/index.d.ts +3 -0
  42. package/widgets/lib/widgets/property-editors/property-editor-helper.d.ts +15 -0
  43. package/common/lib/store/common.effects.d.ts +0 -13
  44. package/fesm2022/acorex-platform-themes-default-search-popup.component-Blpan821.mjs +0 -62
  45. package/fesm2022/acorex-platform-themes-default-search-popup.component-Blpan821.mjs.map +0 -1
@@ -1,8 +1,9 @@
1
1
  import * as i2$1 from '@acorex/components/common';
2
2
  import { AXDataSource, AXCommonModule } from '@acorex/components/common';
3
3
  import { AXFormatService } from '@acorex/core/format';
4
- import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingScope, AXPSettingValueProviderService, AXPRefreshEvent, AXPWorkflowNavigateAction, AXPToastAction } from '@acorex/platform/common';
5
- import * as i1$3 from '@acorex/platform/workflow';
4
+ import * as i1$3 from '@acorex/platform/common';
5
+ import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingScope, AXPSettingValueProviderService, AXPRefreshEvent, AXPWorkflowNavigateAction, AXP_SEARCH_DEFINITION_PROVIDER, AXPToastAction } from '@acorex/platform/common';
6
+ import * as i2$3 from '@acorex/platform/workflow';
6
7
  import { AXPWorkflowService, ofType, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
7
8
  import * as i0 from '@angular/core';
8
9
  import { InjectionToken, inject, Injectable, computed, signal, Injector, effect, Component, ChangeDetectionStrategy, HostBinding, DestroyRef, ViewChild, NgModule } from '@angular/core';
@@ -286,11 +287,27 @@ class AXPEntityDetailListViewModel {
286
287
 
287
288
  class AXPEntityDefinitionRegistryService {
288
289
  constructor() {
290
+ this.providers = inject(AXP_ENTITY_DEFINITION_LOADER);
291
+ this.resolver = inject(AXPEntityResolver);
289
292
  // Stores AXPEntityConfig objects, keyed by a combination of module and entity name.
290
293
  this.entities = new Map();
291
294
  // Entity resolver service for dynamically loading entity configurations.
292
295
  this.entityResolver = inject(AXPEntityResolver); // Assuming AXPEntityLoader is the correct type
293
296
  }
297
+ async preload() {
298
+ const providers = Array.isArray(this.providers)
299
+ ? this.providers
300
+ : [this.providers];
301
+ const promises = [];
302
+ providers.forEach((provider) => {
303
+ const items = typeof provider.preload == 'function' ? provider.preload() : [];
304
+ items.forEach((item) => {
305
+ promises.push(this.resolver.get(item.module, item.entity));
306
+ });
307
+ });
308
+ const entities = await Promise.all(promises);
309
+ entities.forEach((entity) => this.register(entity));
310
+ }
294
311
  /**
295
312
  * Registers a new entity configuration. Entities are identified uniquely by a combination
296
313
  * of their module and name.
@@ -301,6 +318,14 @@ class AXPEntityDefinitionRegistryService {
301
318
  const key = this.createEntityKey(config.module, config.name);
302
319
  this.entities.set(key, config);
303
320
  }
321
+ /**
322
+ * Returns an array of all registered entity configurations.
323
+ *
324
+ * @returns An array of AXPEntity objects.
325
+ */
326
+ getAll() {
327
+ return Array.from(this.entities.values());
328
+ }
304
329
  /**
305
330
  * Resolves an entity configuration based on module and entity name. If the configuration
306
331
  * is not already registered, attempts to load it dynamically. Throws an error if the
@@ -436,7 +461,6 @@ class AXPEntityMasterCreateViewModel {
436
461
  });
437
462
  if (!initialData)
438
463
  initialData = {};
439
- debugger;
440
464
  this.config.properties
441
465
  .filter((c) => c.schema.defaultValue != null)
442
466
  .forEach((p) => {
@@ -1392,6 +1416,38 @@ const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEnti
1392
1416
  return service.create(moduleName, entityName, id);
1393
1417
  };
1394
1418
 
1419
+ class AXPEntitySearchDefinitionProvider {
1420
+ constructor() {
1421
+ this.entityRegister = inject(AXPEntityDefinitionRegistryService);
1422
+ }
1423
+ async provide(context) {
1424
+ this.entityRegister.getAll().forEach((entity) => {
1425
+ const definitionName = `record.${entity.module}.${entity.name}`;
1426
+ if (!context.hasEntity(definitionName)) {
1427
+ context.addDefinition(definitionName, entity.title, 'fa-solid fa-objects-column', [
1428
+ {
1429
+ name: 'open',
1430
+ command: {
1431
+ name: 'view',
1432
+ options: {},
1433
+ },
1434
+ type: 'view',
1435
+ priority: 'primary',
1436
+ },
1437
+ ]);
1438
+ }
1439
+ });
1440
+ }
1441
+ }
1442
+
1443
+ class AXPEntityCommandSearchDefinitionProvider {
1444
+ async provide(context) {
1445
+ context.addDefinition('command', 'Commands', 'fa-solid fa-command', [
1446
+ { name: 'open', command: { name: 'view', options: {} }, type: 'view', priority: 'primary' },
1447
+ ]);
1448
+ }
1449
+ }
1450
+
1395
1451
  class AXPLookupWidgetViewComponent extends AXPWidgetComponent {
1396
1452
  constructor() {
1397
1453
  super(...arguments);
@@ -2598,14 +2654,35 @@ function routesFacory() {
2598
2654
  return routes;
2599
2655
  }
2600
2656
  class AXPEntityModule {
2601
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2602
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i1$3.AXPWorkflowModule, i7.AXPLayoutBuilderModule] }); }
2657
+ constructor(appInitService, injector) {
2658
+ const service = injector.get(AXPEntityDefinitionRegistryService);
2659
+ appInitService.registerTask({
2660
+ name: 'layout-theme',
2661
+ statusText: 'Preload entities ...',
2662
+ run: async () => {
2663
+ // load in background
2664
+ service.preload();
2665
+ },
2666
+ });
2667
+ }
2668
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModule, deps: [{ token: i1$3.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
2669
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i2$3.AXPWorkflowModule, i7.AXPLayoutBuilderModule] }); }
2603
2670
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModule, providers: [
2604
2671
  {
2605
2672
  provide: ROUTES,
2606
2673
  multi: true,
2607
2674
  useFactory: routesFacory,
2608
2675
  },
2676
+ {
2677
+ provide: AXP_SEARCH_DEFINITION_PROVIDER,
2678
+ useClass: AXPEntitySearchDefinitionProvider,
2679
+ multi: true,
2680
+ },
2681
+ {
2682
+ provide: AXP_SEARCH_DEFINITION_PROVIDER,
2683
+ useClass: AXPEntityCommandSearchDefinitionProvider,
2684
+ multi: true,
2685
+ },
2609
2686
  ], imports: [RouterModule,
2610
2687
  AXPWorkflowModule.forChild({
2611
2688
  actions: {
@@ -2674,9 +2751,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2674
2751
  multi: true,
2675
2752
  useFactory: routesFacory,
2676
2753
  },
2754
+ {
2755
+ provide: AXP_SEARCH_DEFINITION_PROVIDER,
2756
+ useClass: AXPEntitySearchDefinitionProvider,
2757
+ multi: true,
2758
+ },
2759
+ {
2760
+ provide: AXP_SEARCH_DEFINITION_PROVIDER,
2761
+ useClass: AXPEntityCommandSearchDefinitionProvider,
2762
+ multi: true,
2763
+ },
2677
2764
  ],
2678
2765
  }]
2679
- }] });
2766
+ }], ctorParameters: () => [{ type: i1$3.AXPAppStartUpService }, { type: i0.Injector }] });
2680
2767
 
2681
2768
  class AXPEntityService {
2682
2769
  constructor() {