@acorex/platform 21.0.0-next.5 → 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.
Files changed (32) hide show
  1. package/auth/index.d.ts +228 -3
  2. package/fesm2022/acorex-platform-auth.mjs +162 -2
  3. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  4. package/fesm2022/acorex-platform-common.mjs +1 -1
  5. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-layout-builder.mjs +11 -2
  7. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-layout-components.mjs +7 -7
  9. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-layout-entity.mjs +79 -34
  11. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-layout-widget-core.mjs +108 -1
  13. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-layout-widgets.mjs +224 -89
  15. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  16. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs → acorex-platform-themes-default-entity-master-list-view.component-D3qZa5fM.mjs} +4 -4
  17. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3qZa5fM.mjs.map +1 -0
  18. package/fesm2022/acorex-platform-themes-default.mjs +2 -2
  19. 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
  20. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-Dz0cylyQ.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-themes-shared.mjs +1 -1
  22. package/fesm2022/acorex-platform-workflow.mjs +1084 -456
  23. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  24. package/layout/builder/index.d.ts +6 -0
  25. package/layout/components/index.d.ts +4 -3
  26. package/layout/entity/index.d.ts +9 -0
  27. package/layout/widget-core/index.d.ts +42 -1
  28. package/layout/widgets/index.d.ts +12 -7
  29. package/package.json +9 -9
  30. package/workflow/index.d.ts +798 -939
  31. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
  32. 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 = {};
@@ -710,7 +735,49 @@ class PropertyFilter {
710
735
  this.externalMode = mode;
711
736
  return this;
712
737
  }
738
+ async build() {
739
+ const dialog = await this.buildDialog();
740
+ return dialog.build();
741
+ }
713
742
  async show() {
743
+ const dialog = await this.buildDialog();
744
+ // Context: load record by id for update/single and merge with provided context (context overrides)
745
+ let baseContext = {};
746
+ // Only fetch by key if we don't already have initial data
747
+ const hasInitialData = this.initialContext && Object.keys(this.initialContext).length > 0;
748
+ if ((this.kind === 'update' || this.kind === 'single') && !hasInitialData) {
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
+ }
766
+ }
767
+ catch {
768
+ baseContext = {};
769
+ }
770
+ }
771
+ }
772
+ const effectiveContext = merge({}, baseContext, this.initialContext);
773
+ dialog.setContext(effectiveContext);
774
+ return await dialog.show();
775
+ }
776
+ /**
777
+ * Builds the dialog node structure without showing it.
778
+ * This method is shared by both build() and show() methods.
779
+ */
780
+ async buildDialog() {
714
781
  const { moduleName, entityName } = parseEntityFullName(this.fullName);
715
782
  const entity = await this.entityRegistry.resolve(moduleName, entityName);
716
783
  // Select the appropriate interface based on kind
@@ -819,28 +886,7 @@ class PropertyFilter {
819
886
  d.setActions((a) => a.cancel().submit());
820
887
  }
821
888
  });
822
- // Context: load record by id for update/single and merge with provided context (context overrides)
823
- let baseContext = {};
824
- // Only fetch by key if we don't already have initial data
825
- const hasInitialData = this.initialContext && Object.keys(this.initialContext).length > 0;
826
- if ((this.kind === 'update' || this.kind === 'single') && !hasInitialData) {
827
- try {
828
- const id = this.recordId;
829
- if (!id) {
830
- throw new Error(`Record id is required for ${this.kind}().`);
831
- }
832
- const byKeyFn = entity?.queries?.byKey?.execute;
833
- if (typeof byKeyFn === 'function') {
834
- baseContext = (await byKeyFn(id)) ?? {};
835
- }
836
- }
837
- catch {
838
- baseContext = {};
839
- }
840
- }
841
- const effectiveContext = merge({}, baseContext, this.initialContext);
842
- dialog.setContext(effectiveContext);
843
- return await dialog.show();
889
+ return dialog;
844
890
  }
845
891
  computeAllowedNames(allNames) {
846
892
  if (this.includeList && this.includeList.size > 0) {
@@ -2260,7 +2306,7 @@ class AXPEntityCreateViewElementViewModel {
2260
2306
  triggers: widget.triggers,
2261
2307
  defaultValue: schema.defaultValue,
2262
2308
  valueTransforms: widget.valueTransforms,
2263
- options: merge(schema.interface?.options, {
2309
+ options: merge({}, schema.interface?.options, {
2264
2310
  validations: this.property.validations?.map((c) => ({ rule: c.rule, message: c.message, options: c.options })),
2265
2311
  }),
2266
2312
  };
@@ -3568,7 +3614,7 @@ class AXPEntityMasterUpdateElementViewModel {
3568
3614
  children: widget.children,
3569
3615
  triggers: widget.triggers,
3570
3616
  valueTransforms: widget.valueTransforms,
3571
- options: merge(schema.interface?.options, {
3617
+ options: merge({}, schema.interface?.options, {
3572
3618
  validations: this.property.validations?.map((c) => ({ rule: c.rule, message: c.message, options: c.options })),
3573
3619
  }),
3574
3620
  };
@@ -3824,7 +3870,7 @@ class AXPEntityMasterSingleElementViewModel {
3824
3870
  path: this.path(),
3825
3871
  children: widget.children,
3826
3872
  valueTransforms: widget.valueTransforms,
3827
- options: merge(schema.interface?.options),
3873
+ options: merge({}, schema.interface?.options),
3828
3874
  };
3829
3875
  }, ...(ngDevMode ? [{ debugName: "node" }] : []));
3830
3876
  }
@@ -5260,7 +5306,6 @@ class AXPMainEntityContentBuilder {
5260
5306
  : editablePropertyNames.has(p.name);
5261
5307
  // Check if property has its own disabled option
5262
5308
  const hasOwnDisabled = p.schema.interface?.options?.disabled !== undefined;
5263
- console.log('visible: ', p.schema.visible);
5264
5309
  return {
5265
5310
  type: 'grid-item-layout',
5266
5311
  name: prefixed,
@@ -5286,7 +5331,7 @@ class AXPMainEntityContentBuilder {
5286
5331
  children: p.schema.interface?.children,
5287
5332
  triggers: p.schema.interface?.triggers,
5288
5333
  valueTransforms: p.schema.interface?.valueTransforms,
5289
- options: merge(p.schema.interface?.options, {
5334
+ options: merge({}, p.schema.interface?.options, {
5290
5335
  validations: p.validations?.map((c) => ({
5291
5336
  rule: c.rule,
5292
5337
  message: c.message,
@@ -8227,7 +8272,7 @@ class AXPEntityCategoryTreeSelectorComponent extends AXBasePageComponent {
8227
8272
  ></ax-button>
8228
8273
  </ax-suffix>
8229
8274
  </ax-footer>
8230
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "component", type: i2$1.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "isLoading", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i4$2.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i5$1.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: AXTreeViewComponent, selector: "ax-tree-view", inputs: ["datasource", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "nodeTemplate", "idField", "titleField", "tooltipField", "iconField", "expandedField", "selectedField", "indeterminateField", "disabledField", "hiddenField", "childrenField", "childrenCountField", "dataField", "inheritDisabled", "expandOnDoubleClick"], outputs: ["datasourceChange", "onBeforeDrop", "onNodeToggle", "onNodeSelect", "onNodeDoubleClick", "onNodeClick", "onSelectionChange", "onOrderChange", "onMoveChange", "onItemsChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "variant"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8275
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "component", type: i2$1.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "isLoading", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i4$2.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i5$1.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: AXTreeViewComponent, selector: "ax-tree-view", inputs: ["datasource", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "nodeTemplate", "idField", "titleField", "tooltipField", "iconField", "expandedField", "selectedField", "indeterminateField", "disabledField", "hiddenField", "childrenField", "childrenCountField", "dataField", "inheritDisabled", "expandOnDoubleClick", "doubleClickDuration", "tooltipDelay"], outputs: ["datasourceChange", "onBeforeDrop", "onNodeToggle", "onNodeSelect", "onNodeDoubleClick", "onNodeClick", "onSelectionChange", "onOrderChange", "onMoveChange", "onItemsChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "variant"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8231
8276
  }
8232
8277
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityCategoryTreeSelectorComponent, decorators: [{
8233
8278
  type: Component,