@acorex/platform 19.2.2 → 19.2.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.
- package/common/lib/app/application.types.d.ts +2 -1
- package/common/lib/search/search-definition.builder.d.ts +1 -1
- package/common/lib/search/search-definition.provider.d.ts +1 -0
- package/common/lib/search/search.types.d.ts +1 -0
- package/core/lib/types.d.ts +2 -2
- package/fesm2022/acorex-platform-common.mjs +12 -20
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +23 -7
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +52 -70
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-setting.mjs +1 -1
- package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-theme-palette-preview.page-Cet1sYXJ.mjs → acorex-platform-themes-default-theme-palette-preview.page-C3RJdApv.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-theme-palette-preview.page-C3RJdApv.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +1215 -38
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/builder/lib/builder/widget-groups.d.ts +2 -1
- package/layout/builder/lib/builder/widget-map.d.ts +9 -0
- package/layout/builder/lib/builder/widget.types.d.ts +1 -1
- package/package.json +5 -5
- package/widgets/lib/properties/groups.d.ts +2 -1
- package/widgets/lib/properties/validation.props.d.ts +10 -0
- package/widgets/lib/widgets/editors/contact/contact-widget-edit.component.d.ts +1 -0
- package/widgets/lib/widgets/editors/text/text-box-widget-edit.component.d.ts +1 -0
- package/widgets/lib/widgets/filters/boolean-filter/boolean-filter-widget-edit.component.d.ts +1 -0
- package/widgets/lib/widgets/index.d.ts +9 -0
- package/widgets/lib/widgets/layout/advanced-grid/advanced-grid-widget-designer.component.d.ts +0 -1
- package/widgets/lib/widgets/validations/base-validation/base-validation.component.d.ts +13 -0
- package/widgets/lib/widgets/validations/base-validation/base-validation.d.ts +8 -0
- package/widgets/lib/widgets/validations/between-validation/between-validation-widget-edit.component.d.ts +25 -0
- package/widgets/lib/widgets/validations/between-validation/between-validation-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/validations/between-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/callback-validation/callback-validation-widget-edit.component.d.ts +23 -0
- package/widgets/lib/widgets/validations/callback-validation/callback-validation-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/validations/callback-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/equal-validation/equal-validation-widget-edit.component.d.ts +23 -0
- package/widgets/lib/widgets/validations/equal-validation/equal-validation-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/validations/equal-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/greater-than-validation/greater-than-validation-widget-edit.component.d.ts +24 -0
- package/widgets/lib/widgets/validations/greater-than-validation/greater-than-validation-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/validations/greater-than-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/less-than-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/less-than-validation/less-than-validation-widget-edit.component.d.ts +24 -0
- package/widgets/lib/widgets/validations/less-than-validation/less-than-validation-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/validations/max-length-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/max-length-validation/max-length-validation-widget-edit.component.d.ts +23 -0
- package/widgets/lib/widgets/validations/max-length-validation/max-length-validation-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/validations/min-length-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/min-length-validation/min-length-validation-widget-edit.component.d.ts +23 -0
- package/widgets/lib/widgets/validations/min-length-validation/min-length-validation-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/validations/regular-expression-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/regular-expression-validation/regular-expression-validation-widget-edit.component.d.ts +23 -0
- package/widgets/lib/widgets/validations/regular-expression-validation/regular-expression-validation-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/validations/required-validation/index.d.ts +2 -0
- package/widgets/lib/widgets/validations/required-validation/required-validation-widget-edit.component.d.ts +21 -0
- package/widgets/lib/widgets/validations/required-validation/required-validation-widget.config.d.ts +7 -0
- package/fesm2022/acorex-platform-themes-default-theme-palette-preview.page-Cet1sYXJ.mjs.map +0 -1
|
@@ -312,7 +312,9 @@ class AXPEntityDefinitionRegistryService {
|
|
|
312
312
|
this.entityResolver = inject(AXPEntityResolver); // Assuming AXPEntityLoader is the correct type
|
|
313
313
|
}
|
|
314
314
|
async preload() {
|
|
315
|
-
const providers = Array.isArray(this.providers)
|
|
315
|
+
const providers = Array.isArray(this.providers)
|
|
316
|
+
? this.providers
|
|
317
|
+
: [this.providers];
|
|
316
318
|
const promises = [];
|
|
317
319
|
providers.forEach((provider) => {
|
|
318
320
|
const items = typeof provider.preload == 'function' ? provider.preload() : [];
|
|
@@ -321,7 +323,10 @@ class AXPEntityDefinitionRegistryService {
|
|
|
321
323
|
});
|
|
322
324
|
});
|
|
323
325
|
const entities = await Promise.all(promises);
|
|
324
|
-
entities.forEach((entity) =>
|
|
326
|
+
entities.forEach((entity) => {
|
|
327
|
+
if (entity != null)
|
|
328
|
+
this.register(this.middleware.process(entity));
|
|
329
|
+
});
|
|
325
330
|
}
|
|
326
331
|
/**
|
|
327
332
|
* Registers a new entity configuration. Entities are identified uniquely by a combination
|
|
@@ -331,7 +336,7 @@ class AXPEntityDefinitionRegistryService {
|
|
|
331
336
|
*/
|
|
332
337
|
register(config) {
|
|
333
338
|
const key = this.createEntityKey(config.module, config.name);
|
|
334
|
-
this.entities.set(key, config);
|
|
339
|
+
this.entities.set(key, this.middleware.process(config));
|
|
335
340
|
}
|
|
336
341
|
/**
|
|
337
342
|
* Returns an array of all registered entity configurations.
|
|
@@ -368,7 +373,7 @@ class AXPEntityDefinitionRegistryService {
|
|
|
368
373
|
throw new Error(`Invalid entity name: ${key}`);
|
|
369
374
|
}
|
|
370
375
|
}
|
|
371
|
-
return
|
|
376
|
+
return config;
|
|
372
377
|
}
|
|
373
378
|
/**
|
|
374
379
|
* Creates a unique key for an entity based on its module and name.
|
|
@@ -449,6 +454,7 @@ class AXPEntityCreateViewElementViewModel {
|
|
|
449
454
|
children: widget.children,
|
|
450
455
|
formula: widget.formula,
|
|
451
456
|
triggers: widget.triggers,
|
|
457
|
+
valueTransforms: widget.valueTransforms,
|
|
452
458
|
options: merge(schema.interface?.options,
|
|
453
459
|
//this.property.options?.create?.widget,
|
|
454
460
|
{ validationRules: this.property.validations }),
|
|
@@ -631,14 +637,7 @@ class AXPEntityMasterListViewModel {
|
|
|
631
637
|
},
|
|
632
638
|
{
|
|
633
639
|
title: this.title(),
|
|
634
|
-
url: [
|
|
635
|
-
`/${this.session.application?.name}`,
|
|
636
|
-
'm',
|
|
637
|
-
`${this.entityDef.module}`,
|
|
638
|
-
'e',
|
|
639
|
-
`${this.entityDef.name}`,
|
|
640
|
-
'list',
|
|
641
|
-
],
|
|
640
|
+
url: [`/${this.session.application?.name}`, 'm', `${this.entityDef.module}`, 'e', `${this.entityDef.name}`, 'list'],
|
|
642
641
|
},
|
|
643
642
|
];
|
|
644
643
|
});
|
|
@@ -648,14 +647,10 @@ class AXPEntityMasterListViewModel {
|
|
|
648
647
|
return list.map((tr) => new AXPEntityCommandTriggerViewModel(this.entityDef, tr)) ?? [];
|
|
649
648
|
});
|
|
650
649
|
this.primaryActions = computed(() => {
|
|
651
|
-
return this.allActions().filter((a) => a.priority == 'primary' &&
|
|
652
|
-
((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) ||
|
|
653
|
-
(a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
|
|
650
|
+
return this.allActions().filter((a) => a.priority == 'primary' && ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) || (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
|
|
654
651
|
});
|
|
655
652
|
this.secondaryActions = computed(() => {
|
|
656
|
-
return this.allActions().filter((a) => a.priority == 'secondary' &&
|
|
657
|
-
((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) ||
|
|
658
|
-
(a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
|
|
653
|
+
return this.allActions().filter((a) => a.priority == 'secondary' && ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) || (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
|
|
659
654
|
});
|
|
660
655
|
this.selectedScopeActionsCount = computed(() => {
|
|
661
656
|
return this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Selected).length;
|
|
@@ -738,8 +733,7 @@ class AXPEntityMasterListViewModel {
|
|
|
738
733
|
const columnVisibilityMap = new Map(listViewSetting.columns.map((col) => [col.name, col.visible]));
|
|
739
734
|
this.columns.update((prev) => prev
|
|
740
735
|
.map((c) => ({ ...c, visible: columnVisibilityMap.get(c.name) ?? c.visible })) // Update visibility
|
|
741
|
-
.sort((a, b) => listViewSetting.columns.findIndex((col) => col.name === a.name) -
|
|
742
|
-
listViewSetting.columns.findIndex((col) => col.name === b.name)));
|
|
736
|
+
.sort((a, b) => listViewSetting.columns.findIndex((col) => col.name === a.name) - listViewSetting.columns.findIndex((col) => col.name === b.name)));
|
|
743
737
|
}
|
|
744
738
|
}
|
|
745
739
|
clearSelection() {
|
|
@@ -749,9 +743,7 @@ class AXPEntityMasterListViewModel {
|
|
|
749
743
|
const props = this.entityDef.properties.filter((c) => c.options?.filter?.advance?.enabled);
|
|
750
744
|
return props.map((e) => {
|
|
751
745
|
const widgetConfig = this.widgetResolver.resolve(e.schema.interface?.type);
|
|
752
|
-
const type = (e.options?.filter?.advance?.widgetType ||
|
|
753
|
-
widgetConfig?.defaultFilterWidgetName ||
|
|
754
|
-
e.schema.interface?.type);
|
|
746
|
+
const type = (e.options?.filter?.advance?.widgetType || widgetConfig?.defaultFilterWidgetName || e.schema.interface?.type);
|
|
755
747
|
return {
|
|
756
748
|
title: e.title,
|
|
757
749
|
field: e.name,
|
|
@@ -824,10 +816,7 @@ class AXPEntityMasterListViewModel {
|
|
|
824
816
|
this.dataSource.sort(...this.sortedFields()
|
|
825
817
|
.filter((sf) => sf.dir)
|
|
826
818
|
.map((s) => ({ dir: s.dir, field: s.name })));
|
|
827
|
-
const allFilters = [
|
|
828
|
-
this.inlineFilters.filters?.length && this.inlineFilters,
|
|
829
|
-
this.simpleFilters().filters?.length && this.simpleFilters(),
|
|
830
|
-
].filter(Boolean);
|
|
819
|
+
const allFilters = [this.inlineFilters.filters?.length && this.inlineFilters, this.simpleFilters().filters?.length && this.simpleFilters()].filter(Boolean);
|
|
831
820
|
const cleanedAllFilters = this.cleanNestedFilters(allFilters);
|
|
832
821
|
this.lastFiltersApplied.set(this.simpleFilters());
|
|
833
822
|
this.dataSource.filter(this.filterOperatorMiddleware.transformFilter({
|
|
@@ -845,6 +834,9 @@ class AXPEntityMasterListViewModel {
|
|
|
845
834
|
return undefined;
|
|
846
835
|
if (filter.filters?.length) {
|
|
847
836
|
const cleanedNestedFilters = this.cleanNestedFilters(filter.filters);
|
|
837
|
+
if (!filter.field && !filter.operator && cleanedNestedFilters.length === 0) {
|
|
838
|
+
return undefined;
|
|
839
|
+
}
|
|
848
840
|
return {
|
|
849
841
|
...filter,
|
|
850
842
|
filters: cleanedNestedFilters.filter(Boolean),
|
|
@@ -910,11 +902,7 @@ class AXPEntityMasterListViewModel {
|
|
|
910
902
|
}
|
|
911
903
|
//****************** Commands ******************//
|
|
912
904
|
async executeCommand(commandName, data = null) {
|
|
913
|
-
const action = this.allActions().find((c) => c.name == commandName &&
|
|
914
|
-
((this.selectedItems().length
|
|
915
|
-
? c.scope == AXPEntityCommandScope.Selected
|
|
916
|
-
: c.scope == AXPEntityCommandScope.Individual) ||
|
|
917
|
-
c.scope == AXPEntityCommandScope.TypeLevel));
|
|
905
|
+
const action = this.allActions().find((c) => c.name == commandName && ((this.selectedItems().length ? c.scope == AXPEntityCommandScope.Selected : c.scope == AXPEntityCommandScope.Individual) || c.scope == AXPEntityCommandScope.TypeLevel));
|
|
918
906
|
await this.workflow.execute(commandName, {
|
|
919
907
|
entity: getEntityInfo(this.entityDef).source,
|
|
920
908
|
entityInfo: {
|
|
@@ -1124,6 +1112,7 @@ class AXPEntityMasterUpdateElementViewModel {
|
|
|
1124
1112
|
children: widget.children,
|
|
1125
1113
|
formula: widget.formula,
|
|
1126
1114
|
triggers: widget.triggers,
|
|
1115
|
+
valueTransforms: widget.valueTransforms,
|
|
1127
1116
|
options: merge(schema.interface?.options,
|
|
1128
1117
|
//this.property.options?.create?.widget,
|
|
1129
1118
|
{ validationRules: this.property.validations })
|
|
@@ -1208,10 +1197,12 @@ class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
|
|
|
1208
1197
|
const { properties, id, title } = context.getVariable('data');
|
|
1209
1198
|
const entityRef = await this.entityRegistery.resolve(moduleName, entityName);
|
|
1210
1199
|
const vm = await this.factory.create(moduleName, entityName, id, properties);
|
|
1200
|
+
const options = context.getVariable('options');
|
|
1201
|
+
const decoration = options?.['decoration'];
|
|
1202
|
+
const headerTitle = decoration?.header?.title;
|
|
1211
1203
|
const com = await this.config.viewers.master.modify();
|
|
1212
1204
|
const popup = await this.popupService.open(com, {
|
|
1213
|
-
title: title ??
|
|
1214
|
-
`${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
1205
|
+
title: headerTitle ? headerTitle : title ?? `${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
1215
1206
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1216
1207
|
data: {
|
|
1217
1208
|
vm,
|
|
@@ -1341,6 +1332,7 @@ class AXPEntityMasterSingleElementViewModel {
|
|
|
1341
1332
|
path: this.name(),
|
|
1342
1333
|
children: widget.children,
|
|
1343
1334
|
formula: widget.formula,
|
|
1335
|
+
valueTransforms: widget.valueTransforms,
|
|
1344
1336
|
options: merge(schema.interface?.options
|
|
1345
1337
|
//this.property.options?.create?.widget,
|
|
1346
1338
|
//{ validationRules: this.property.validations },
|
|
@@ -1504,7 +1496,7 @@ const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEnti
|
|
|
1504
1496
|
|
|
1505
1497
|
class AXPEntityCommandSearchDefinitionProvider {
|
|
1506
1498
|
async provide(context) {
|
|
1507
|
-
context.addDefinition('command', 'Commands', 'fa-solid fa-command', 1, {
|
|
1499
|
+
context.addDefinition('command', 'Commands', 'command', 'fa-solid fa-command', 1, {
|
|
1508
1500
|
format: {
|
|
1509
1501
|
id: '{{id}}',
|
|
1510
1502
|
},
|
|
@@ -1524,33 +1516,21 @@ class AXPEntitySearchDefinitionProvider {
|
|
|
1524
1516
|
this.entityRegister = inject(AXPEntityDefinitionRegistryService);
|
|
1525
1517
|
}
|
|
1526
1518
|
async provide(context) {
|
|
1527
|
-
|
|
1519
|
+
console.log(this.entityRegister.getAll());
|
|
1528
1520
|
this.entityRegister.getAll().forEach((entity) => {
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
actions: [
|
|
1536
|
-
{
|
|
1537
|
-
name: 'open-entity',
|
|
1538
|
-
type: 'view',
|
|
1539
|
-
priority: 'primary',
|
|
1540
|
-
},
|
|
1541
|
-
],
|
|
1542
|
-
format: {
|
|
1543
|
-
title: entity.formats.searchResult?.title,
|
|
1544
|
-
description: (entity.formats.searchResult?.description ?? entity.module) + ' / ' + entity.title,
|
|
1545
|
-
id: '{{data.id}}',
|
|
1521
|
+
context.addDefinition(`Module.${entity.module}.${entity.name}`, entity.formats.searchResult?.description ?? entity.module, `Module.${entity.module}`, 'fa-solid fa-objects-column', 4, {
|
|
1522
|
+
actions: [
|
|
1523
|
+
{
|
|
1524
|
+
name: 'open-entity',
|
|
1525
|
+
type: 'view',
|
|
1526
|
+
priority: 'primary',
|
|
1546
1527
|
},
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
actions: definition.actions,
|
|
1528
|
+
],
|
|
1529
|
+
format: {
|
|
1530
|
+
title: entity.formats.searchResult?.title,
|
|
1531
|
+
description: (entity.formats.searchResult?.description ?? entity.module) + ' / ' + entity.title,
|
|
1532
|
+
id: '{{data.id}}',
|
|
1533
|
+
},
|
|
1554
1534
|
});
|
|
1555
1535
|
});
|
|
1556
1536
|
}
|
|
@@ -2597,10 +2577,12 @@ class AXPQuickEntityModifyPopupAction extends AXPWorkflowAction {
|
|
|
2597
2577
|
const { interfaces, title } = entityRef;
|
|
2598
2578
|
const properties = interfaces?.master?.update?.properties?.map((p) => p.name) || [];
|
|
2599
2579
|
const vm = await this.factory.create(moduleName, entityName, id, properties);
|
|
2580
|
+
const options = context.getVariable('options');
|
|
2581
|
+
const decoration = options?.['decoration'];
|
|
2582
|
+
const headerTitle = decoration?.header?.title;
|
|
2600
2583
|
const com = await this.config.viewers.master.modify();
|
|
2601
2584
|
const popup = await this.popupService.open(com, {
|
|
2602
|
-
title: title ??
|
|
2603
|
-
`${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
2585
|
+
title: headerTitle ? headerTitle : title ?? `${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
2604
2586
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
2605
2587
|
data: {
|
|
2606
2588
|
vm,
|
|
@@ -2765,14 +2747,14 @@ function routesFacory() {
|
|
|
2765
2747
|
class AXPEntityModule {
|
|
2766
2748
|
constructor(appInitService, injector) {
|
|
2767
2749
|
const service = injector.get(AXPEntityDefinitionRegistryService);
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2750
|
+
appInitService.registerTask({
|
|
2751
|
+
name: 'layout-theme',
|
|
2752
|
+
statusText: 'Preload entities ...',
|
|
2753
|
+
run: async () => {
|
|
2754
|
+
// load in background
|
|
2755
|
+
service.preload();
|
|
2756
|
+
},
|
|
2757
|
+
});
|
|
2776
2758
|
}
|
|
2777
2759
|
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 }); }
|
|
2778
2760
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i2$3.AXPWorkflowModule, i7.AXPLayoutBuilderModule] }); }
|