@acorex/platform 21.0.0-next.7 → 21.0.0-next.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.
- package/auth/index.d.ts +228 -3
- package/fesm2022/acorex-platform-auth.mjs +162 -2
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +1 -1
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +7 -7
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +54 -23
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +213 -80
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs → acorex-platform-themes-default-entity-master-list-view.component-D3qZa5fM.mjs} +3 -3
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs.map → acorex-platform-themes-default-entity-master-list-view.component-D3qZa5fM.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +2 -2
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-Dz0cylyQ.mjs} +8 -8
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-Dz0cylyQ.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +27 -21
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/components/index.d.ts +4 -3
- package/layout/entity/index.d.ts +7 -0
- package/layout/widgets/index.d.ts +12 -7
- package/package.json +5 -5
- package/workflow/index.d.ts +117 -469
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs.map +0 -1
|
@@ -606,7 +606,30 @@ class AXPEntityFormBuilderService {
|
|
|
606
606
|
//#endregion
|
|
607
607
|
//#region ---- Public API ----
|
|
608
608
|
entity(fullName) {
|
|
609
|
-
return new InterfaceSelector(this.entityRegistry, this.layoutBuilder, this.deviceService, fullName);
|
|
609
|
+
return new InterfaceSelector(this.entityRegistry, this.layoutBuilder, this.deviceService, fullName, this);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Fetches a record by ID for the specified entity.
|
|
613
|
+
* @param fullName - Entity full name in "module.entity" format
|
|
614
|
+
* @param id - Record ID to fetch
|
|
615
|
+
* @returns Promise resolving to the record data, or empty object if not found
|
|
616
|
+
*/
|
|
617
|
+
async getRecordById(fullName, id) {
|
|
618
|
+
if (!id) {
|
|
619
|
+
throw new Error('Record id is required.');
|
|
620
|
+
}
|
|
621
|
+
const { moduleName, entityName } = parseEntityFullName(fullName);
|
|
622
|
+
const entity = await this.entityRegistry.resolve(moduleName, entityName);
|
|
623
|
+
try {
|
|
624
|
+
const byKeyFn = entity?.queries?.byKey?.execute;
|
|
625
|
+
if (typeof byKeyFn === 'function') {
|
|
626
|
+
return (await byKeyFn(id)) ?? {};
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
catch {
|
|
630
|
+
// Return empty object if fetch fails
|
|
631
|
+
}
|
|
632
|
+
return {};
|
|
610
633
|
}
|
|
611
634
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityFormBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
612
635
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityFormBuilderService, providedIn: 'root' }); }
|
|
@@ -617,14 +640,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
617
640
|
}] });
|
|
618
641
|
//#region ---- Builders ----
|
|
619
642
|
class InterfaceSelector {
|
|
620
|
-
constructor(entityRegistry, layoutBuilder, deviceService, fullName) {
|
|
643
|
+
constructor(entityRegistry, layoutBuilder, deviceService, fullName, formBuilderService) {
|
|
621
644
|
this.entityRegistry = entityRegistry;
|
|
622
645
|
this.layoutBuilder = layoutBuilder;
|
|
623
646
|
this.deviceService = deviceService;
|
|
624
647
|
this.fullName = fullName;
|
|
648
|
+
this.formBuilderService = formBuilderService;
|
|
625
649
|
}
|
|
626
650
|
create(initialData) {
|
|
627
|
-
const filter = new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.deviceService, this.fullName, 'create');
|
|
651
|
+
const filter = new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.deviceService, this.fullName, 'create', undefined, this.formBuilderService);
|
|
628
652
|
if (initialData) {
|
|
629
653
|
filter.context(initialData);
|
|
630
654
|
}
|
|
@@ -640,7 +664,7 @@ class InterfaceSelector {
|
|
|
640
664
|
initialData = data;
|
|
641
665
|
recordId = data['id'] || data['_id'];
|
|
642
666
|
}
|
|
643
|
-
const filter = new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.deviceService, this.fullName, 'update', recordId);
|
|
667
|
+
const filter = new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.deviceService, this.fullName, 'update', recordId, this.formBuilderService);
|
|
644
668
|
return filter;
|
|
645
669
|
}
|
|
646
670
|
single(data) {
|
|
@@ -653,7 +677,7 @@ class InterfaceSelector {
|
|
|
653
677
|
initialData = data;
|
|
654
678
|
recordId = data['id'] || data['_id'];
|
|
655
679
|
}
|
|
656
|
-
const filter = new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.deviceService, this.fullName, 'single', recordId);
|
|
680
|
+
const filter = new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.deviceService, this.fullName, 'single', recordId, this.formBuilderService);
|
|
657
681
|
if (Object.keys(initialData).length > 0) {
|
|
658
682
|
filter.context(initialData);
|
|
659
683
|
}
|
|
@@ -661,12 +685,13 @@ class InterfaceSelector {
|
|
|
661
685
|
}
|
|
662
686
|
}
|
|
663
687
|
class PropertyFilter {
|
|
664
|
-
constructor(entityRegistry, layoutBuilder, deviceService, fullName, kind, recordId) {
|
|
688
|
+
constructor(entityRegistry, layoutBuilder, deviceService, fullName, kind, recordId, formBuilderService) {
|
|
665
689
|
this.entityRegistry = entityRegistry;
|
|
666
690
|
this.layoutBuilder = layoutBuilder;
|
|
667
691
|
this.deviceService = deviceService;
|
|
668
692
|
this.fullName = fullName;
|
|
669
693
|
this.kind = kind;
|
|
694
|
+
this.formBuilderService = formBuilderService;
|
|
670
695
|
this.includeList = null;
|
|
671
696
|
this.excludeList = null;
|
|
672
697
|
this.initialContext = {};
|
|
@@ -721,21 +746,28 @@ class PropertyFilter {
|
|
|
721
746
|
// Only fetch by key if we don't already have initial data
|
|
722
747
|
const hasInitialData = this.initialContext && Object.keys(this.initialContext).length > 0;
|
|
723
748
|
if ((this.kind === 'update' || this.kind === 'single') && !hasInitialData) {
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
749
|
+
const id = this.recordId;
|
|
750
|
+
if (!id) {
|
|
751
|
+
throw new Error(`Record id is required for ${this.kind}().`);
|
|
752
|
+
}
|
|
753
|
+
// Use the public method if service is available, otherwise fallback to direct entity access
|
|
754
|
+
if (this.formBuilderService) {
|
|
755
|
+
baseContext = await this.formBuilderService.getRecordById(this.fullName, id);
|
|
756
|
+
}
|
|
757
|
+
else {
|
|
758
|
+
// Fallback to original implementation if service is not available
|
|
759
|
+
const { moduleName, entityName } = parseEntityFullName(this.fullName);
|
|
760
|
+
const entity = await this.entityRegistry.resolve(moduleName, entityName);
|
|
761
|
+
try {
|
|
762
|
+
const byKeyFn = entity?.queries?.byKey?.execute;
|
|
763
|
+
if (typeof byKeyFn === 'function') {
|
|
764
|
+
baseContext = (await byKeyFn(id)) ?? {};
|
|
765
|
+
}
|
|
730
766
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
baseContext = (await byKeyFn(id)) ?? {};
|
|
767
|
+
catch {
|
|
768
|
+
baseContext = {};
|
|
734
769
|
}
|
|
735
770
|
}
|
|
736
|
-
catch {
|
|
737
|
-
baseContext = {};
|
|
738
|
-
}
|
|
739
771
|
}
|
|
740
772
|
const effectiveContext = merge({}, baseContext, this.initialContext);
|
|
741
773
|
dialog.setContext(effectiveContext);
|
|
@@ -2274,7 +2306,7 @@ class AXPEntityCreateViewElementViewModel {
|
|
|
2274
2306
|
triggers: widget.triggers,
|
|
2275
2307
|
defaultValue: schema.defaultValue,
|
|
2276
2308
|
valueTransforms: widget.valueTransforms,
|
|
2277
|
-
options: merge(schema.interface?.options, {
|
|
2309
|
+
options: merge({}, schema.interface?.options, {
|
|
2278
2310
|
validations: this.property.validations?.map((c) => ({ rule: c.rule, message: c.message, options: c.options })),
|
|
2279
2311
|
}),
|
|
2280
2312
|
};
|
|
@@ -3582,7 +3614,7 @@ class AXPEntityMasterUpdateElementViewModel {
|
|
|
3582
3614
|
children: widget.children,
|
|
3583
3615
|
triggers: widget.triggers,
|
|
3584
3616
|
valueTransforms: widget.valueTransforms,
|
|
3585
|
-
options: merge(schema.interface?.options, {
|
|
3617
|
+
options: merge({}, schema.interface?.options, {
|
|
3586
3618
|
validations: this.property.validations?.map((c) => ({ rule: c.rule, message: c.message, options: c.options })),
|
|
3587
3619
|
}),
|
|
3588
3620
|
};
|
|
@@ -3838,7 +3870,7 @@ class AXPEntityMasterSingleElementViewModel {
|
|
|
3838
3870
|
path: this.path(),
|
|
3839
3871
|
children: widget.children,
|
|
3840
3872
|
valueTransforms: widget.valueTransforms,
|
|
3841
|
-
options: merge(schema.interface?.options),
|
|
3873
|
+
options: merge({}, schema.interface?.options),
|
|
3842
3874
|
};
|
|
3843
3875
|
}, ...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
3844
3876
|
}
|
|
@@ -5274,7 +5306,6 @@ class AXPMainEntityContentBuilder {
|
|
|
5274
5306
|
: editablePropertyNames.has(p.name);
|
|
5275
5307
|
// Check if property has its own disabled option
|
|
5276
5308
|
const hasOwnDisabled = p.schema.interface?.options?.disabled !== undefined;
|
|
5277
|
-
console.log('visible: ', p.schema.visible);
|
|
5278
5309
|
return {
|
|
5279
5310
|
type: 'grid-item-layout',
|
|
5280
5311
|
name: prefixed,
|
|
@@ -5300,7 +5331,7 @@ class AXPMainEntityContentBuilder {
|
|
|
5300
5331
|
children: p.schema.interface?.children,
|
|
5301
5332
|
triggers: p.schema.interface?.triggers,
|
|
5302
5333
|
valueTransforms: p.schema.interface?.valueTransforms,
|
|
5303
|
-
options: merge(p.schema.interface?.options, {
|
|
5334
|
+
options: merge({}, p.schema.interface?.options, {
|
|
5304
5335
|
validations: p.validations?.map((c) => ({
|
|
5305
5336
|
rule: c.rule,
|
|
5306
5337
|
message: c.message,
|