@acorex/platform 19.1.16 → 19.2.0

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 (33) hide show
  1. package/fesm2022/acorex-platform-layout-designer.mjs +12 -12
  2. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  3. package/fesm2022/acorex-platform-layout-entity.mjs +58 -23
  4. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-layout-search.mjs +14 -12
  6. package/fesm2022/acorex-platform-layout-search.mjs.map +1 -1
  7. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-Cpzt0cCT.mjs → acorex-platform-themes-default-entity-master-list-view.component-DarhCaO1.mjs} +5 -5
  8. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DarhCaO1.mjs.map +1 -0
  9. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-Cpdymm-f.mjs → acorex-platform-themes-default-entity-master-single-view.component-Bwgawuvl.mjs} +3 -3
  10. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-Cpdymm-f.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-Bwgawuvl.mjs.map} +1 -1
  11. package/fesm2022/acorex-platform-themes-default-theme-palette-preview.page-D7Y93deN.mjs +118 -0
  12. package/fesm2022/acorex-platform-themes-default-theme-palette-preview.page-D7Y93deN.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-themes-default.mjs +29 -17
  14. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-themes-shared.mjs +1 -1
  16. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  17. package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-jeZBOEhl.mjs → acorex-platform-widgets-checkbox-widget-column.component-C8NRF4BO.mjs} +9 -9
  18. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-C8NRF4BO.mjs.map +1 -0
  19. package/fesm2022/{acorex-platform-widgets-checkbox-widget-view.component-DU1niJES.mjs → acorex-platform-widgets-checkbox-widget-view.component-bf272Wuo.mjs} +9 -9
  20. package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-bf272Wuo.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-widgets.mjs +14 -22
  22. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  23. package/layout/entity/lib/entity-detail-list.viewmodel.d.ts +1 -0
  24. package/layout/entity/lib/entity-middleware.d.ts +11 -0
  25. package/layout/entity/lib/entity-registery.service.d.ts +1 -0
  26. package/package.json +9 -9
  27. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +6 -0
  28. package/themes/default/lib/pages/theme-palette-preview/theme-palette-preview.page.d.ts +77 -0
  29. package/themes/shared/index.d.ts +1 -0
  30. package/widgets/lib/widgets/filters/select-filter/select-filter-widget-edit.component.d.ts +0 -1
  31. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-Cpzt0cCT.mjs.map +0 -1
  32. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-jeZBOEhl.mjs.map +0 -1
  33. package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-DU1niJES.mjs.map +0 -1
@@ -9,9 +9,9 @@ import * as i0 from '@angular/core';
9
9
  import { InjectionToken, inject, Injectable, computed, signal, Injector, effect, Component, ChangeDetectionStrategy, HostBinding, DestroyRef, ViewChild, NgModule } from '@angular/core';
10
10
  import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
11
11
  import { cloneDeep, set, merge, isNil, get, sortBy } from 'lodash-es';
12
- import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
13
12
  import * as i7 from '@acorex/platform/layout/builder';
14
- import { AXPWidgetRegistryService, AXPWidgetComponent, AXPLayoutBuilderModule, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_GROUP, AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
13
+ import { AXPWidgetsCatalog, AXPWidgetRegistryService, AXPWidgetComponent, AXPLayoutBuilderModule, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_GROUP } from '@acorex/platform/layout/builder';
14
+ import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
15
15
  import { Subject, takeUntil } from 'rxjs';
16
16
  import * as i8 from '@acorex/core/translation';
17
17
  import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
@@ -138,9 +138,7 @@ class AXPEntityDetailListViewModel {
138
138
  });
139
139
  //****************** Title ******************//
140
140
  this.title = computed(() => {
141
- return (this.detailEntityConfig.title ??
142
- this.detailEntity()?.interfaces?.detail?.list?.title ??
143
- this.detailEntity()?.formats.plural);
141
+ return this.detailEntityConfig.title ?? this.detailEntity()?.interfaces?.detail?.list?.title ?? this.detailEntity()?.formats.plural;
144
142
  });
145
143
  //****************** Inline filter ******************//
146
144
  this.inlineFiltersPlaceholders = computed(() => {
@@ -155,15 +153,14 @@ class AXPEntityDetailListViewModel {
155
153
  const list = this.detailEntity()?.interfaces?.master?.list?.actions ?? [];
156
154
  return list.map((tr) => new AXPEntityCommandTriggerViewModel(this.detailEntity(), tr)) ?? [];
157
155
  });
156
+ this.selectedScopeActionsCount = computed(() => {
157
+ return this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Selected).length;
158
+ });
158
159
  this.primaryActions = computed(() => {
159
- return this.allActions().filter((a) => a.priority == 'primary' &&
160
- ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) ||
161
- (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
160
+ return this.allActions().filter((a) => a.priority == 'primary' && ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) || (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
162
161
  });
163
162
  this.secondaryActions = computed(() => {
164
- return this.allActions().filter((a) => a.priority == 'secondary' &&
165
- ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) ||
166
- (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
163
+ return this.allActions().filter((a) => a.priority == 'secondary' && ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) || (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
167
164
  });
168
165
  this.primaryRowActions = computed(() => this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'primary'));
169
166
  this.secondaryRowActions = computed(() => this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'secondary'));
@@ -259,11 +256,7 @@ class AXPEntityDetailListViewModel {
259
256
  }
260
257
  //****************** Commands ******************//
261
258
  async executeCommand(commandName, data = null) {
262
- const action = this.allActions().find((c) => c.name == commandName &&
263
- ((this.selectedItems().length
264
- ? c.scope == AXPEntityCommandScope.Selected
265
- : c.scope == AXPEntityCommandScope.Individual) ||
266
- c.scope == AXPEntityCommandScope.TypeLevel));
259
+ const action = this.allActions().find((c) => c.name == commandName && ((this.selectedItems().length ? c.scope == AXPEntityCommandScope.Selected : c.scope == AXPEntityCommandScope.Individual) || c.scope == AXPEntityCommandScope.TypeLevel));
267
260
  if (action?.scope == AXPEntityCommandScope.TypeLevel) {
268
261
  if (data == null) {
269
262
  data = {};
@@ -294,19 +287,51 @@ class AXPEntityDetailListViewModel {
294
287
  }
295
288
  }
296
289
 
290
+ class AXPEntityMiddleware {
291
+ }
292
+ class AXPEntityMiddlewareImpl extends AXPEntityMiddleware {
293
+ process(entity) {
294
+ return entity;
295
+ }
296
+ processUsersEntity(entity) {
297
+ const customEntity = {
298
+ ...entity,
299
+ properties: [
300
+ ...entity.properties,
301
+ {
302
+ name: 'customProperty',
303
+ title: 'Custom Property',
304
+ schema: {
305
+ dataType: 'string',
306
+ interface: {
307
+ type: AXPWidgetsCatalog.text,
308
+ },
309
+ },
310
+ },
311
+ ],
312
+ };
313
+ return customEntity;
314
+ }
315
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMiddlewareImpl, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
316
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMiddlewareImpl, providedIn: 'root' }); }
317
+ }
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityMiddlewareImpl, decorators: [{
319
+ type: Injectable,
320
+ args: [{ providedIn: 'root' }]
321
+ }] });
322
+
297
323
  class AXPEntityDefinitionRegistryService {
298
324
  constructor() {
299
325
  this.providers = inject(AXP_ENTITY_DEFINITION_LOADER);
300
326
  this.resolver = inject(AXPEntityResolver);
327
+ this.middleware = inject(AXPEntityMiddleware);
301
328
  // Stores AXPEntityConfig objects, keyed by a combination of module and entity name.
302
329
  this.entities = new Map();
303
330
  // Entity resolver service for dynamically loading entity configurations.
304
331
  this.entityResolver = inject(AXPEntityResolver); // Assuming AXPEntityLoader is the correct type
305
332
  }
306
333
  async preload() {
307
- const providers = Array.isArray(this.providers)
308
- ? this.providers
309
- : [this.providers];
334
+ const providers = Array.isArray(this.providers) ? this.providers : [this.providers];
310
335
  const promises = [];
311
336
  providers.forEach((provider) => {
312
337
  const items = typeof provider.preload == 'function' ? provider.preload() : [];
@@ -362,7 +387,7 @@ class AXPEntityDefinitionRegistryService {
362
387
  throw new Error(`Invalid entity name: ${key}`);
363
388
  }
364
389
  }
365
- return config;
390
+ return this.middleware.process(config);
366
391
  }
367
392
  /**
368
393
  * Creates a unique key for an entity based on its module and name.
@@ -500,8 +525,10 @@ class AXPEntityMasterCreateViewModel {
500
525
  await this.workflow.execute('create-entity', {
501
526
  entity: getEntityInfo(this.entityDef).source,
502
527
  options: {
503
- redirect: false,
504
- canCreateNewOne: this.canCreateNewOne,
528
+ process: {
529
+ redirect: this.redirect(),
530
+ canCreateNewOne: this.canCreateNewOne(),
531
+ },
505
532
  },
506
533
  });
507
534
  }
@@ -618,7 +645,7 @@ class AXPEntityMasterListViewModel {
618
645
  return [
619
646
  {
620
647
  title: 'entity.home',
621
- icon: 'fa-solid fa-home ax-text-xs ax-me-2',
648
+ icon: 'fa-solid ax-text-xs ax-me-2',
622
649
  url: [`/${this.session.application?.name}`],
623
650
  },
624
651
  {
@@ -2784,6 +2811,10 @@ class AXPEntityModule {
2784
2811
  useClass: AXPEntityCommandSearchDefinitionProvider,
2785
2812
  multi: true,
2786
2813
  },
2814
+ {
2815
+ provide: AXPEntityMiddleware,
2816
+ useClass: AXPEntityMiddlewareImpl,
2817
+ },
2787
2818
  ], imports: [RouterModule,
2788
2819
  AXPWorkflowModule.forChild({
2789
2820
  actions: {
@@ -2864,6 +2895,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2864
2895
  useClass: AXPEntityCommandSearchDefinitionProvider,
2865
2896
  multi: true,
2866
2897
  },
2898
+ {
2899
+ provide: AXPEntityMiddleware,
2900
+ useClass: AXPEntityMiddlewareImpl,
2901
+ },
2867
2902
  ],
2868
2903
  }]
2869
2904
  }], ctorParameters: () => [{ type: i1$3.AXPAppStartUpService }, { type: i0.Injector }] });