@acorex/platform 21.0.0-next.3 → 21.0.0-next.7

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 (30) hide show
  1. package/auth/index.d.ts +6 -6
  2. package/common/index.d.ts +10 -5
  3. package/core/index.d.ts +55 -315
  4. package/fesm2022/acorex-platform-auth.mjs +18 -22
  5. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-common.mjs +62 -38
  7. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-core.mjs +150 -246
  9. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-layout-builder.mjs +11 -2
  11. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-layout-components.mjs +3 -3
  13. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-layout-entity.mjs +67 -83
  15. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-layout-widget-core.mjs +110 -33
  17. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-layout-widgets.mjs +19 -11
  19. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  20. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs → acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs} +2 -2
  21. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs.map +1 -0
  22. package/fesm2022/acorex-platform-themes-default.mjs +2 -2
  23. package/fesm2022/acorex-platform-workflow.mjs +1268 -1699
  24. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  25. package/layout/builder/index.d.ts +6 -0
  26. package/layout/entity/index.d.ts +2 -9
  27. package/layout/widget-core/index.d.ts +42 -4
  28. package/package.json +5 -5
  29. package/workflow/index.d.ts +650 -1074
  30. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
@@ -3,7 +3,7 @@ import * as i6 from '@acorex/core/translation';
3
3
  import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
4
4
  import * as i4$1 from '@acorex/platform/common';
5
5
  import { AXPSettingsService, AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPRefreshEvent, AXPReloadEvent, AXPCommonSettings, AXPEntityQueryType, AXPCleanNestedFilters, AXPWorkflowNavigateAction, AXPToastAction, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
6
- import { AXPModuleProviderRegistry, AXP_MODULE_PROVIDER_LOADER, AXPModuleManifestRegistry, AXPDeviceService, AXPBroadcastEventService, resolveActionLook, AXPExpressionEvaluatorService, AXPDistributedEventListenerService, AXPPlatformScope, AXHighlightService, extractValue, setSmart, getChangedPaths, AXPSystemActionType } from '@acorex/platform/core';
6
+ import { AXPDeviceService, AXPBroadcastEventService, resolveActionLook, AXPExpressionEvaluatorService, AXPDistributedEventListenerService, AXPPlatformScope, AXHighlightService, extractValue, setSmart, getChangedPaths, AXPSystemActionType } from '@acorex/platform/core';
7
7
  import * as i0 from '@angular/core';
8
8
  import { InjectionToken, inject, Injector, runInInjectionContext, Injectable, input, viewChild, signal, ElementRef, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, createComponent, computed, effect, Input, afterNextRender, ViewEncapsulation, ChangeDetectorRef, viewChildren, linkedSignal, untracked, HostBinding, NgModule } from '@angular/core';
9
9
  import { Subject, takeUntil } from 'rxjs';
@@ -407,28 +407,37 @@ const AXP_ENTITY_DEFINITION_LOADER = new InjectionToken('AXP_ENTITY_DEFINITION_P
407
407
  class AXPEntityResolver {
408
408
  constructor() {
409
409
  this.providers = inject(AXP_ENTITY_DEFINITION_LOADER);
410
- this.providerRegistry = inject(AXPModuleProviderRegistry);
411
410
  }
412
411
  async get(moduleName, entityName) {
413
- // Load from DI tokens (backward compatibility)
412
+ // Load from DI tokens
414
413
  if (Array.isArray(this.providers)) {
415
414
  for (const loader of this.providers) {
416
- const entity = await loader.get(moduleName, entityName);
415
+ let resolvedLoader;
416
+ if (loader instanceof Promise) {
417
+ // If loader is a promise, resolve it
418
+ resolvedLoader = await loader;
419
+ }
420
+ else {
421
+ // If loader is a direct instance, use it directly
422
+ resolvedLoader = loader;
423
+ }
424
+ const entity = await resolvedLoader.get(moduleName, entityName);
417
425
  if (entity) {
418
426
  return entity;
419
427
  }
420
428
  }
421
429
  }
422
430
  else {
423
- const entity = await this.providers.get(moduleName, entityName);
424
- if (entity) {
425
- return entity;
431
+ let resolvedLoader;
432
+ if (this.providers instanceof Promise) {
433
+ // If loader is a promise, resolve it
434
+ resolvedLoader = await this.providers;
426
435
  }
427
- }
428
- // Load from registry (manifest-based, conditionally loaded)
429
- const registryProviders = this.providerRegistry.getEntityProviders();
430
- for (const loader of registryProviders) {
431
- const entity = await loader.get(moduleName, entityName);
436
+ else {
437
+ // If loader is a direct instance, use it directly
438
+ resolvedLoader = this.providers;
439
+ }
440
+ const entity = await resolvedLoader.get(moduleName, entityName);
432
441
  if (entity) {
433
442
  return entity;
434
443
  }
@@ -446,8 +455,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
446
455
  class AXPEntityDefinitionRegistryService {
447
456
  constructor() {
448
457
  this.middleware = inject(AXPEntityMiddleware);
449
- this.moduleProviderLoader = inject(AXP_MODULE_PROVIDER_LOADER, { optional: true });
450
- this.manifestRegistry = inject(AXPModuleManifestRegistry, { optional: true });
451
458
  this.onChanged = new Subject();
452
459
  // Stores AXPEntityConfig objects, keyed by a combination of module and entity name.
453
460
  this.entities = new Map();
@@ -547,8 +554,6 @@ class AXPEntityDefinitionRegistryService {
547
554
  const key = this.createEntityKey(moduleName, entityName);
548
555
  let config = this.entities.get(key) ?? null;
549
556
  if (!config) {
550
- // Wait for module provider to be loaded if module exists in manifest but provider isn't registered yet
551
- await this.waitForModuleProviderIfNeeded(moduleName);
552
557
  try {
553
558
  config = await this.entityResolver.get(moduleName, entityName);
554
559
  if (config) {
@@ -570,46 +575,6 @@ class AXPEntityDefinitionRegistryService {
570
575
  const key = this.createEntityKey(moduleName, entityName);
571
576
  return this.entities.has(key);
572
577
  }
573
- /**
574
- * Waits for module provider to be loaded if the module exists in manifest but provider isn't registered yet.
575
- * This handles race conditions where entity resolution happens before module providers finish loading.
576
- * Only waits for required modules or waits briefly for non-required modules (which may not be accessible to current user).
577
- */
578
- async waitForModuleProviderIfNeeded(moduleName) {
579
- if (!this.moduleProviderLoader || !this.manifestRegistry) {
580
- return;
581
- }
582
- try {
583
- await this.manifestRegistry.initialize();
584
- const manifest = this.manifestRegistry.get(moduleName);
585
- if (!manifest || this.moduleProviderLoader.isModuleRegistered(moduleName)) {
586
- return;
587
- }
588
- const isRequired = manifest.required === true;
589
- // Increase wait time for non-required modules to handle cases where providers are still loading
590
- // This prevents "Invalid entity name" errors during page refresh when entities are accessed
591
- // before module providers finish loading
592
- const maxRetries = isRequired ? 10 : 20; // Increased from 2 to 20 for non-required modules
593
- const retryDelay = isRequired ? 100 : 100; // Increased from 50ms to 100ms for consistency
594
- for (let attempt = 0; attempt < maxRetries; attempt++) {
595
- await new Promise((resolve) => setTimeout(resolve, retryDelay));
596
- if (this.moduleProviderLoader.isModuleRegistered(moduleName)) {
597
- return;
598
- }
599
- }
600
- // Warn for both required and non-required modules if provider still not registered
601
- // This helps debug race conditions during page refresh
602
- console.warn(`[AXPEntityDefinitionRegistryService] Module '${moduleName}' exists in manifest but provider not registered after ${maxRetries} retries (${maxRetries * retryDelay}ms). ` +
603
- `Entity resolution will proceed, but may fail if provider is not available.`);
604
- }
605
- catch (error) {
606
- // Only log for required modules to reduce noise
607
- const manifest = this.manifestRegistry?.get(moduleName);
608
- if (manifest?.required) {
609
- console.warn(`[AXPEntityDefinitionRegistryService] Error checking module provider status for '${moduleName}':`, error);
610
- }
611
- }
612
- }
613
578
  /**
614
579
  * Creates a unique key for an entity based on its module and name.
615
580
  *
@@ -745,7 +710,42 @@ class PropertyFilter {
745
710
  this.externalMode = mode;
746
711
  return this;
747
712
  }
713
+ async build() {
714
+ const dialog = await this.buildDialog();
715
+ return dialog.build();
716
+ }
748
717
  async show() {
718
+ const dialog = await this.buildDialog();
719
+ // Context: load record by id for update/single and merge with provided context (context overrides)
720
+ let baseContext = {};
721
+ // Only fetch by key if we don't already have initial data
722
+ const hasInitialData = this.initialContext && Object.keys(this.initialContext).length > 0;
723
+ if ((this.kind === 'update' || this.kind === 'single') && !hasInitialData) {
724
+ const { moduleName, entityName } = parseEntityFullName(this.fullName);
725
+ const entity = await this.entityRegistry.resolve(moduleName, entityName);
726
+ try {
727
+ const id = this.recordId;
728
+ if (!id) {
729
+ throw new Error(`Record id is required for ${this.kind}().`);
730
+ }
731
+ const byKeyFn = entity?.queries?.byKey?.execute;
732
+ if (typeof byKeyFn === 'function') {
733
+ baseContext = (await byKeyFn(id)) ?? {};
734
+ }
735
+ }
736
+ catch {
737
+ baseContext = {};
738
+ }
739
+ }
740
+ const effectiveContext = merge({}, baseContext, this.initialContext);
741
+ dialog.setContext(effectiveContext);
742
+ return await dialog.show();
743
+ }
744
+ /**
745
+ * Builds the dialog node structure without showing it.
746
+ * This method is shared by both build() and show() methods.
747
+ */
748
+ async buildDialog() {
749
749
  const { moduleName, entityName } = parseEntityFullName(this.fullName);
750
750
  const entity = await this.entityRegistry.resolve(moduleName, entityName);
751
751
  // Select the appropriate interface based on kind
@@ -854,28 +854,7 @@ class PropertyFilter {
854
854
  d.setActions((a) => a.cancel().submit());
855
855
  }
856
856
  });
857
- // Context: load record by id for update/single and merge with provided context (context overrides)
858
- let baseContext = {};
859
- // Only fetch by key if we don't already have initial data
860
- const hasInitialData = this.initialContext && Object.keys(this.initialContext).length > 0;
861
- if ((this.kind === 'update' || this.kind === 'single') && !hasInitialData) {
862
- try {
863
- const id = this.recordId;
864
- if (!id) {
865
- throw new Error(`Record id is required for ${this.kind}().`);
866
- }
867
- const byKeyFn = entity?.queries?.byKey?.execute;
868
- if (typeof byKeyFn === 'function') {
869
- baseContext = (await byKeyFn(id)) ?? {};
870
- }
871
- }
872
- catch {
873
- baseContext = {};
874
- }
875
- }
876
- const effectiveContext = merge({}, baseContext, this.initialContext);
877
- dialog.setContext(effectiveContext);
878
- return await dialog.show();
857
+ return dialog;
879
858
  }
880
859
  computeAllowedNames(allNames) {
881
860
  if (this.includeList && this.includeList.size > 0) {
@@ -1807,7 +1786,15 @@ class AXPDataSeederService {
1807
1786
  }
1808
1787
  async seed() {
1809
1788
  for (const loader of castArray(this.loaders)) {
1810
- await loader?.seed();
1789
+ if (!loader)
1790
+ continue;
1791
+ const seederName = loader.constructor?.name || 'UnknownSeeder';
1792
+ const startTime = performance.now();
1793
+ await loader.seed();
1794
+ const duration = performance.now() - startTime;
1795
+ if (duration > 3000) {
1796
+ console.warn(`[AXPDataSeeder] Seeder "${seederName}" took ${duration.toFixed(2)}ms (>3000ms threshold)`);
1797
+ }
1811
1798
  }
1812
1799
  }
1813
1800
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPDataSeederService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -2284,7 +2271,6 @@ class AXPEntityCreateViewElementViewModel {
2284
2271
  path: this.name(),
2285
2272
  name: this.name(),
2286
2273
  children: widget.children,
2287
- formula: widget.formula,
2288
2274
  triggers: widget.triggers,
2289
2275
  defaultValue: schema.defaultValue,
2290
2276
  valueTransforms: widget.valueTransforms,
@@ -3594,7 +3580,6 @@ class AXPEntityMasterUpdateElementViewModel {
3594
3580
  path: this.name(),
3595
3581
  name: this.name(),
3596
3582
  children: widget.children,
3597
- formula: widget.formula,
3598
3583
  triggers: widget.triggers,
3599
3584
  valueTransforms: widget.valueTransforms,
3600
3585
  options: merge(schema.interface?.options, {
@@ -3852,7 +3837,6 @@ class AXPEntityMasterSingleElementViewModel {
3852
3837
  mode: 'view',
3853
3838
  path: this.path(),
3854
3839
  children: widget.children,
3855
- formula: widget.formula,
3856
3840
  valueTransforms: widget.valueTransforms,
3857
3841
  options: merge(schema.interface?.options),
3858
3842
  };
@@ -8257,7 +8241,7 @@ class AXPEntityCategoryTreeSelectorComponent extends AXBasePageComponent {
8257
8241
  ></ax-button>
8258
8242
  </ax-suffix>
8259
8243
  </ax-footer>
8260
- `, 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 }); }
8244
+ `, 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 }); }
8261
8245
  }
8262
8246
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPEntityCategoryTreeSelectorComponent, decorators: [{
8263
8247
  type: Component,