@acorex/platform 21.0.0-next.5 → 21.0.0-next.51

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 (124) hide show
  1. package/fesm2022/acorex-platform-auth.mjs +281 -23
  2. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  3. package/fesm2022/acorex-platform-common-common-settings.provider-Bi1RYif5.mjs +163 -0
  4. package/fesm2022/acorex-platform-common-common-settings.provider-Bi1RYif5.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-common.mjs +1047 -263
  6. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-core.mjs +1138 -510
  8. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-domain.mjs +557 -826
  10. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-layout-builder.mjs +804 -186
  12. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs +121 -0
  14. package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-layout-components.mjs +6208 -2344
  16. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-designer.mjs +456 -204
  18. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-entity.mjs +18632 -10286
  20. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-layout-views.mjs +538 -168
  22. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-layout-widget-core.mjs +720 -456
  24. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  25. package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs → acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs} +10 -10
  26. package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs +103 -0
  28. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs → acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs} +6 -7
  30. package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
  31. package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs → acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs} +12 -12
  32. package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGO75IMz.mjs +116 -0
  34. package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGO75IMz.mjs.map +1 -0
  35. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs} +6 -6
  36. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs.map +1 -0
  37. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs} +5 -5
  38. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs.map +1 -0
  39. package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs} +6 -6
  40. package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
  41. package/fesm2022/acorex-platform-layout-widgets.mjs +8728 -4269
  42. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  43. package/fesm2022/acorex-platform-native.mjs +8 -7
  44. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  45. package/fesm2022/acorex-platform-runtime.mjs +391 -166
  46. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  47. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs +160 -0
  48. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs.map +1 -0
  49. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs +120 -0
  50. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs.map +1 -0
  51. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs → acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs} +19 -26
  52. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs.map +1 -0
  53. package/fesm2022/{acorex-platform-themes-default-error-401.component-cfREo88K.mjs → acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs} +4 -4
  54. package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs.map +1 -0
  55. package/fesm2022/{acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs → acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs} +4 -4
  56. package/fesm2022/acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs.map +1 -0
  57. package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
  58. package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
  59. package/fesm2022/acorex-platform-themes-default.mjs +1836 -67
  60. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  61. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs → acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs} +6 -6
  62. package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs} +6 -6
  64. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs.map +1 -0
  65. package/fesm2022/{acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs → acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs} +24 -25
  66. package/fesm2022/acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs.map +1 -0
  67. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs +94 -0
  68. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs.map +1 -0
  69. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs +86 -0
  70. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs.map +1 -0
  71. package/fesm2022/acorex-platform-themes-shared.mjs +674 -573
  72. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  73. package/fesm2022/acorex-platform-workflow.mjs +1715 -535
  74. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  75. package/fesm2022/acorex-platform.mjs.map +1 -1
  76. package/package.json +37 -37
  77. package/{auth/index.d.ts → types/acorex-platform-auth.d.ts} +241 -4
  78. package/{common/index.d.ts → types/acorex-platform-common.d.ts} +598 -80
  79. package/{core/index.d.ts → types/acorex-platform-core.d.ts} +595 -132
  80. package/{domain/index.d.ts → types/acorex-platform-domain.d.ts} +744 -412
  81. package/{layout/builder/index.d.ts → types/acorex-platform-layout-builder.d.ts} +193 -48
  82. package/types/acorex-platform-layout-components.d.ts +2979 -0
  83. package/{layout/designer/index.d.ts → types/acorex-platform-layout-designer.d.ts} +96 -18
  84. package/{layout/entity/index.d.ts → types/acorex-platform-layout-entity.d.ts} +1601 -261
  85. package/{layout/views/index.d.ts → types/acorex-platform-layout-views.d.ts} +116 -55
  86. package/{layout/widget-core/index.d.ts → types/acorex-platform-layout-widget-core.d.ts} +272 -124
  87. package/{layout/widgets/index.d.ts → types/acorex-platform-layout-widgets.d.ts} +1055 -157
  88. package/{native/index.d.ts → types/acorex-platform-native.d.ts} +0 -7
  89. package/types/acorex-platform-runtime.d.ts +571 -0
  90. package/{themes/default/index.d.ts → types/acorex-platform-themes-default.d.ts} +122 -5
  91. package/{themes/shared/index.d.ts → types/acorex-platform-themes-shared.d.ts} +1 -1
  92. package/types/acorex-platform-workflow.d.ts +1884 -0
  93. package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs +0 -71
  94. package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map +0 -1
  95. package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map +0 -1
  96. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs +0 -135
  97. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +0 -1
  99. package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +0 -157
  104. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs +0 -1542
  106. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +0 -101
  108. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map +0 -1
  111. package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs +0 -19
  113. package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map +0 -1
  114. package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +0 -1
  115. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map +0 -1
  116. package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +0 -1
  117. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs +0 -65
  118. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs.map +0 -1
  119. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs +0 -64
  120. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map +0 -1
  121. package/layout/components/index.d.ts +0 -1669
  122. package/runtime/index.d.ts +0 -307
  123. package/workflow/index.d.ts +0 -1808
  124. /package/{index.d.ts → types/acorex-platform.d.ts} +0 -0
@@ -1,8 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injector, Injectable, signal, inject, Input, Directive, provideAppInitializer, Optional, Inject, NgModule } from '@angular/core';
2
+ import { InjectionToken, Injector, Injectable, signal, inject, Input, Directive, provideAppInitializer, Optional, Inject, NgModule, input, output, Component } from '@angular/core';
3
3
  import { AXPBroadcastEventService, AXP_SESSION_SERVICE } from '@acorex/platform/core';
4
4
  import { isEmpty } from 'lodash-es';
5
5
  import { map, BehaviorSubject, shareReplay, defaultIfEmpty, switchMap, filter, from, first } from 'rxjs';
6
+ import { AXDataSource } from '@acorex/cdk/common';
7
+ import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
6
8
 
7
9
  const AXP_APPLICATION_LOADER = new InjectionToken('AXP_APPLICATION_LOADER', {
8
10
  providedIn: 'root',
@@ -72,10 +74,10 @@ class AXPAuthStrategyRegistryService {
72
74
  get(strategyKey) {
73
75
  return this.strategies.get(strategyKey);
74
76
  }
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthStrategyRegistryService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
76
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthStrategyRegistryService, providedIn: 'root' }); }
77
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthStrategyRegistryService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
78
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthStrategyRegistryService, providedIn: 'root' }); }
77
79
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthStrategyRegistryService, decorators: [{
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthStrategyRegistryService, decorators: [{
79
81
  type: Injectable,
80
82
  args: [{
81
83
  providedIn: 'root'
@@ -98,7 +100,7 @@ class AXPFeatureDirective {
98
100
  constructor(templateRef, viewContainer) {
99
101
  this.templateRef = templateRef;
100
102
  this.viewContainer = viewContainer;
101
- this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : []));
103
+ this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : /* istanbul ignore next */ []));
102
104
  this.sessionService = inject(AXPSessionService);
103
105
  }
104
106
  set feature(featureKeys) {
@@ -132,10 +134,10 @@ class AXPFeatureDirective {
132
134
  ngOnDestroy() {
133
135
  this.subscription?.unsubscribe();
134
136
  }
135
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPFeatureDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
136
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: AXPFeatureDirective, isStandalone: false, selector: "[feature]", inputs: { feature: "feature", featureElse: "featureElse" }, ngImport: i0 }); }
137
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPFeatureDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
138
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: AXPFeatureDirective, isStandalone: false, selector: "[feature]", inputs: { feature: "feature", featureElse: "featureElse" }, ngImport: i0 }); }
137
139
  }
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPFeatureDirective, decorators: [{
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPFeatureDirective, decorators: [{
139
141
  type: Directive,
140
142
  args: [{
141
143
  selector: '[feature]',
@@ -352,6 +354,8 @@ class AXPSessionService {
352
354
  if (!result)
353
355
  return;
354
356
  if (result?.succeed) {
357
+ this.permissionsSubject.next([]);
358
+ this.featuresSubject.next([]);
355
359
  this.currentUserSubject.next(result.data.user);
356
360
  this.setSession({
357
361
  accessToken: result.data.accessToken,
@@ -363,6 +367,8 @@ class AXPSessionService {
363
367
  expiresIn: result.data?.expiresIn,
364
368
  idToken: result.data?.idToken ?? null,
365
369
  });
370
+ await this.loadPermissions();
371
+ await this.loadFeatures();
366
372
  }
367
373
  else {
368
374
  this.status.next(AXPSessionStatus.Unauthenticated);
@@ -633,10 +639,10 @@ class AXPSessionService {
633
639
  application: this.application,
634
640
  });
635
641
  }
636
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
637
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, providedIn: 'root' }); }
642
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
643
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, providedIn: 'root' }); }
638
644
  }
639
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, decorators: [{
645
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, decorators: [{
640
646
  type: Injectable,
641
647
  args: [{
642
648
  providedIn: 'root',
@@ -647,7 +653,7 @@ class AXPPermissionDirective {
647
653
  constructor(templateRef, viewContainer) {
648
654
  this.templateRef = templateRef;
649
655
  this.viewContainer = viewContainer;
650
- this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : []));
656
+ this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : /* istanbul ignore next */ []));
651
657
  this.sessionService = inject(AXPSessionService);
652
658
  }
653
659
  set permission(permissionKeys) {
@@ -680,10 +686,10 @@ class AXPPermissionDirective {
680
686
  ngOnDestroy() {
681
687
  this.subscription?.unsubscribe();
682
688
  }
683
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
684
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: AXPPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission", permissionElse: "permissionElse" }, ngImport: i0 }); }
689
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
690
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: AXPPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission", permissionElse: "permissionElse" }, ngImport: i0 }); }
685
691
  }
686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDirective, decorators: [{
692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDirective, decorators: [{
687
693
  type: Directive,
688
694
  args: [{
689
695
  selector: '[permission]',
@@ -886,14 +892,106 @@ class AXPPermissionDefinitionService {
886
892
  await this.load();
887
893
  return this.cache?.find(g => g.permissions.find(p => p.name === name))?.permissions.find(p => p.name === name) ?? null;
888
894
  }
889
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
890
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, providedIn: 'root' }); }
895
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
896
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, providedIn: 'root' }); }
891
897
  }
892
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, decorators: [{
898
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, decorators: [{
893
899
  type: Injectable,
894
900
  args: [{ providedIn: 'root' }]
895
901
  }] });
896
902
 
903
+ //#region ---- Imports ----
904
+ //#endregion
905
+ //#region ---- Helpers ----
906
+ function flattenPermissionDefinitions(nodes, groupPrefix) {
907
+ const rows = [];
908
+ for (const node of nodes) {
909
+ const displayTitle = groupPrefix ? `${groupPrefix} / ${node.title}` : node.title;
910
+ if (node.children?.length) {
911
+ rows.push(...flattenPermissionDefinitions(node.children, displayTitle));
912
+ }
913
+ else {
914
+ rows.push({
915
+ id: String(node.name),
916
+ title: displayTitle,
917
+ });
918
+ }
919
+ }
920
+ return rows;
921
+ }
922
+ //#endregion
923
+ //#region ---- Permission definitions data source ----
924
+ /**
925
+ * Registered permission definitions for select widgets via dataSource name {@link PERMISSION_DEFINITIONS_DATASOURCE_NAME}.
926
+ */
927
+ const PERMISSION_DEFINITIONS_DATASOURCE_NAME = 'platform-permission-definitions';
928
+ /**
929
+ * Data source definition for leaf permissions from {@link AXPPermissionDefinitionService#getGroups}.
930
+ */
931
+ class AXPPermissionDefinitionsDataSourceDefinition {
932
+ constructor() {
933
+ //#region ---- Services & Dependencies ----
934
+ this.permissionDefinitionService = inject(AXPPermissionDefinitionService);
935
+ //#endregion
936
+ }
937
+ //#endregion
938
+ //#region ---- Public API ----
939
+ async items() {
940
+ return [
941
+ {
942
+ name: PERMISSION_DEFINITIONS_DATASOURCE_NAME,
943
+ title: 'Permissions',
944
+ source: () => new AXDataSource({
945
+ key: 'id',
946
+ load: async () => {
947
+ const groups = await this.permissionDefinitionService.getGroups();
948
+ const list = [];
949
+ for (const g of groups) {
950
+ list.push(...flattenPermissionDefinitions(g.permissions, g.title));
951
+ }
952
+ return { items: list, total: list.length };
953
+ },
954
+ byKey: async (key) => {
955
+ const groups = await this.permissionDefinitionService.getGroups();
956
+ const list = [];
957
+ for (const g of groups) {
958
+ list.push(...flattenPermissionDefinitions(g.permissions, g.title));
959
+ }
960
+ return list.find((item) => item.id === key);
961
+ },
962
+ pageSize: 1000,
963
+ }),
964
+ columns: [
965
+ {
966
+ name: 'id',
967
+ title: 'ID',
968
+ datatype: 'string',
969
+ type: AXPWidgetsCatalog.text,
970
+ },
971
+ {
972
+ name: 'title',
973
+ title: 'Title',
974
+ datatype: 'string',
975
+ type: AXPWidgetsCatalog.text,
976
+ },
977
+ ],
978
+ filters: [
979
+ {
980
+ field: 'title',
981
+ title: 'Title',
982
+ operator: { type: 'equal' },
983
+ widget: { type: AXPWidgetsCatalog.text },
984
+ filterType: { advance: true, inline: true },
985
+ },
986
+ ],
987
+ textField: { name: 'title', title: 'Title' },
988
+ valueField: { name: 'id', title: 'ID' },
989
+ },
990
+ ];
991
+ }
992
+ }
993
+ //#endregion
994
+
897
995
  class AXPPermissionEvaluatorScopeProvider {
898
996
  constructor() {
899
997
  this.sessionService = inject(AXPSessionService);
@@ -983,9 +1081,9 @@ class AXPAuthModule {
983
1081
  f();
984
1082
  });
985
1083
  }
986
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, deps: [{ token: 'AXPAuthModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
987
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, declarations: [AXPPermissionDirective, AXPFeatureDirective], exports: [AXPPermissionDirective, AXPFeatureDirective] }); }
988
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, providers: [
1084
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, deps: [{ token: 'AXPAuthModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
1085
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, declarations: [AXPPermissionDirective, AXPFeatureDirective], exports: [AXPPermissionDirective, AXPFeatureDirective] }); }
1086
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, providers: [
989
1087
  provideAppInitializer(() => {
990
1088
  const initializerFn = initializeAppState(inject(AXPSessionService));
991
1089
  return initializerFn();
@@ -996,7 +1094,7 @@ class AXPAuthModule {
996
1094
  },
997
1095
  ] }); }
998
1096
  }
999
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, decorators: [{
1097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, decorators: [{
1000
1098
  type: NgModule,
1001
1099
  args: [{
1002
1100
  imports: [],
@@ -1100,9 +1198,169 @@ class TimeUtil {
1100
1198
  }
1101
1199
  //#endregion
1102
1200
 
1201
+ //#region ---- Challenge Data Types ----
1202
+ //#endregion
1203
+
1204
+ //#region ---- Abstract Challenge Provider ----
1205
+ /**
1206
+ * Abstract base class for login challenge providers
1207
+ *
1208
+ * Implement this class to create custom challenge mechanisms like:
1209
+ * - Image CAPTCHA
1210
+ * - reCAPTCHA
1211
+ * - SMS verification
1212
+ * - Email verification
1213
+ *
1214
+ * @example
1215
+ * ```typescript
1216
+ * @Injectable()
1217
+ * export class MyImageCaptchaProvider extends AXPLoginChallengeProvider {
1218
+ * readonly name = 'image-captcha';
1219
+ *
1220
+ * checkResponse(error: unknown): AXPChallengeCheckResult | null {
1221
+ * if (error instanceof HttpErrorResponse) {
1222
+ * if (error.error?.requiresCaptcha) {
1223
+ * return { required: true };
1224
+ * }
1225
+ * }
1226
+ * return null;
1227
+ * }
1228
+ *
1229
+ * async getChallenge(): Promise<AXPLoginChallengeData> {
1230
+ * const response = await this.http.get('/api/captcha').toPromise();
1231
+ * return {
1232
+ * id: response.id,
1233
+ * content: response.image,
1234
+ * contentType: 'image-base64'
1235
+ * };
1236
+ * }
1237
+ *
1238
+ * async refreshChallenge(): Promise<AXPLoginChallengeData> {
1239
+ * return this.getChallenge();
1240
+ * }
1241
+ *
1242
+ * getChallengeComponent(): Type<AXPLoginChallengeComponentBase> {
1243
+ * return MyCaptchaChallengeComponent;
1244
+ * }
1245
+ * }
1246
+ * ```
1247
+ */
1248
+ class AXPLoginChallengeProvider {
1249
+ /**
1250
+ * Returns the component type for rendering the challenge UI
1251
+ *
1252
+ * Override this method to provide a custom challenge UI component.
1253
+ * If not overridden (returns null), the login component will use
1254
+ * a default built-in UI.
1255
+ *
1256
+ * @returns Component type extending AXPLoginChallengeComponentBase, or null for default UI
1257
+ */
1258
+ getChallengeComponent() {
1259
+ return null;
1260
+ }
1261
+ }
1262
+ //#endregion
1263
+
1264
+ //#region ---- Injection Token ----
1265
+ /**
1266
+ * Injection token for the login challenge provider
1267
+ *
1268
+ * This token is optional - if not provided, no challenge mechanism will be used.
1269
+ *
1270
+ * @example
1271
+ * ```typescript
1272
+ * // In your app module or provider configuration:
1273
+ * providers: [
1274
+ * {
1275
+ * provide: AXP_LOGIN_CHALLENGE_PROVIDER,
1276
+ * useClass: MyImageCaptchaProvider
1277
+ * }
1278
+ * ]
1279
+ *
1280
+ * // In a component:
1281
+ * private challengeProvider = inject(AXP_LOGIN_CHALLENGE_PROVIDER, { optional: true });
1282
+ * ```
1283
+ */
1284
+ const AXP_LOGIN_CHALLENGE_PROVIDER = new InjectionToken('AXP_LOGIN_CHALLENGE_PROVIDER');
1285
+ //#endregion
1286
+
1287
+ //#region ---- Base Challenge Component ----
1288
+ /**
1289
+ * Base class for login challenge UI components
1290
+ *
1291
+ * Providers can extend this class to create custom challenge UIs.
1292
+ * The login component will render this component and listen to its outputs.
1293
+ *
1294
+ * @example
1295
+ * ```typescript
1296
+ * @Component({
1297
+ * selector: 'my-captcha-challenge',
1298
+ * template: `
1299
+ * <div class="captcha-container">
1300
+ * <img [src]="'data:image/png;base64,' + challengeData().content" />
1301
+ * <input
1302
+ * type="text"
1303
+ * [value]="response()"
1304
+ * (input)="onResponseChange($event)"
1305
+ * />
1306
+ * <button (click)="onRefreshClick()">Refresh</button>
1307
+ * </div>
1308
+ * `
1309
+ * })
1310
+ * export class MyCaptchaChallengeComponent extends AXPLoginChallengeComponentBase {
1311
+ * response = signal('');
1312
+ *
1313
+ * onResponseChange(event: Event) {
1314
+ * const value = (event.target as HTMLInputElement).value;
1315
+ * this.response.set(value);
1316
+ * this.responseChange.emit(value);
1317
+ * }
1318
+ *
1319
+ * onRefreshClick() {
1320
+ * this.refreshRequest.emit();
1321
+ * }
1322
+ * }
1323
+ * ```
1324
+ */
1325
+ class AXPLoginChallengeComponentBase {
1326
+ constructor() {
1327
+ //#region ---- Inputs ----
1328
+ /**
1329
+ * Challenge data to display
1330
+ * Contains the image/content and metadata from the server
1331
+ */
1332
+ this.challengeData = input.required(...(ngDevMode ? [{ debugName: "challengeData" }] : /* istanbul ignore next */ []));
1333
+ /**
1334
+ * Whether the challenge is currently loading (e.g., refreshing)
1335
+ */
1336
+ this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
1337
+ //#endregion
1338
+ //#region ---- Outputs ----
1339
+ /**
1340
+ * Emits when the user enters or changes their response
1341
+ * The login component will capture this value and include it in credentials
1342
+ */
1343
+ this.responseChange = output();
1344
+ /**
1345
+ * Emits when the user requests a new challenge (e.g., clicks refresh button)
1346
+ * The login component will call provider.refreshChallenge()
1347
+ */
1348
+ this.refreshRequest = output();
1349
+ }
1350
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLoginChallengeComponentBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1351
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: AXPLoginChallengeComponentBase, isStandalone: true, selector: "ng-component", inputs: { challengeData: { classPropertyName: "challengeData", publicName: "challengeData", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { responseChange: "responseChange", refreshRequest: "refreshRequest" }, ngImport: i0, template: '', isInline: true }); }
1352
+ }
1353
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLoginChallengeComponentBase, decorators: [{
1354
+ type: Component,
1355
+ args: [{
1356
+ template: '',
1357
+ standalone: true,
1358
+ }]
1359
+ }], propDecorators: { challengeData: [{ type: i0.Input, args: [{ isSignal: true, alias: "challengeData", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], responseChange: [{ type: i0.Output, args: ["responseChange"] }], refreshRequest: [{ type: i0.Output, args: ["refreshRequest"] }] } });
1360
+
1103
1361
  /**
1104
1362
  * Generated bundle index. Do not edit.
1105
1363
  */
1106
1364
 
1107
- export { AXPAuthGuard, AXPAuthModule, AXPAuthStrategy, AXPAuthStrategyRegistryService, AXPFeatureDirective, AXPFeatureGuard, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, AXPPermissionDirective, AXPPermissionEvaluatorScopeProvider, AXPPermissionGuard, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_CHECKER, AXP_FEATURE_LOADER, AXP_PERMISSION_CHECKER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, JwtUtil, PkceUtil, TimeUtil, initializeAppState };
1365
+ export { AXPAuthGuard, AXPAuthModule, AXPAuthStrategy, AXPAuthStrategyRegistryService, AXPFeatureDirective, AXPFeatureGuard, AXPLoginChallengeComponentBase, AXPLoginChallengeProvider, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, AXPPermissionDefinitionsDataSourceDefinition, AXPPermissionDirective, AXPPermissionEvaluatorScopeProvider, AXPPermissionGuard, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_CHECKER, AXP_FEATURE_LOADER, AXP_LOGIN_CHALLENGE_PROVIDER, AXP_PERMISSION_CHECKER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, JwtUtil, PERMISSION_DEFINITIONS_DATASOURCE_NAME, PkceUtil, TimeUtil, initializeAppState };
1108
1366
  //# sourceMappingURL=acorex-platform-auth.mjs.map