@acorex/platform 19.3.0-next.3 → 19.3.0-next.5

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 (29) hide show
  1. package/auth/lib/permission/index.d.ts +2 -1
  2. package/auth/lib/permission/permission-definition.builder.d.ts +24 -0
  3. package/auth/lib/permission/permission-definition.service.d.ts +20 -0
  4. package/auth/lib/permission/permission.types.d.ts +10 -3
  5. package/common/lib/settings/index.d.ts +1 -1
  6. package/core/lib/types/actions.types.d.ts +282 -0
  7. package/core/lib/types/index.d.ts +1 -0
  8. package/fesm2022/acorex-platform-auth.mjs +114 -20
  9. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-core.mjs +272 -1
  12. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-entity.mjs +9 -5
  14. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  15. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-CnqS3y7P.mjs → acorex-platform-themes-default-entity-master-create-view.component-ClHHAoed.mjs} +1 -2
  16. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-ClHHAoed.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-themes-default.mjs +2 -2
  18. package/fesm2022/acorex-platform-widgets.mjs +349 -87
  19. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  20. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +1 -0
  21. package/package.json +2 -1
  22. package/widgets/lib/shared/multi-language-component/popup/select-language.popup.d.ts +23 -0
  23. package/widgets/lib/widgets/editors/large-text/large-text-widget-edit.component.d.ts +12 -0
  24. package/widgets/lib/widgets/editors/rich-text/rich-text-widget-edit.component.d.ts +11 -0
  25. package/widgets/lib/widgets/editors/text/text-box-widget-edit.component.d.ts +10 -0
  26. package/widgets/lib/widgets/filters/number-filter/number-filter-widget-edit.component.d.ts +1 -0
  27. package/auth/lib/permission/permission.service.d.ts +0 -18
  28. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CnqS3y7P.mjs.map +0 -1
  29. /package/common/lib/settings/{setting-definition.provider.d.ts → setting-definition.service.d.ts} +0 -0
@@ -1,5 +1,6 @@
1
1
  export * from './permission.directive';
2
2
  export * from './permission.guard';
3
3
  export * from './permission.loader';
4
- export * from './permission.service';
4
+ export * from './permission-definition.service';
5
5
  export * from './permission.types';
6
+ export * from './permission-definition.builder';
@@ -0,0 +1,24 @@
1
+ import { AXPPermissionDefinition, AXPPermissionGroupDefinition } from "./permission.types";
2
+ export declare class AXPPermissionDefinitionProviderContext {
3
+ private builders;
4
+ addGroup(name: string, title: string, description?: string): AXPPermissionDefinitionGroupBuilder;
5
+ getGroupDefinitions(): AXPPermissionGroupDefinition[];
6
+ findGroup(name: string): AXPPermissionDefinitionGroupBuilder | undefined;
7
+ }
8
+ export declare class AXPPermissionDefinitionGroupBuilder {
9
+ private context;
10
+ private _group;
11
+ get group(): AXPPermissionGroupDefinition;
12
+ constructor(context: AXPPermissionDefinitionProviderContext, group: AXPPermissionGroupDefinition);
13
+ addPermission(name: string, title: string, description: string): AXPPermissionDefinitionBuilder;
14
+ endGroup(): AXPPermissionDefinitionProviderContext;
15
+ findPermission(path: string): AXPPermissionDefinition | undefined;
16
+ findGroup(name: string): AXPPermissionDefinitionGroupBuilder | undefined;
17
+ }
18
+ export declare class AXPPermissionDefinitionBuilder {
19
+ private groupBuilder;
20
+ private permission;
21
+ constructor(groupBuilder: AXPPermissionDefinitionGroupBuilder, permission: AXPPermissionDefinition);
22
+ addChild(name: string, title: string, description: string): AXPPermissionDefinitionBuilder;
23
+ endPermission(): AXPPermissionDefinitionGroupBuilder;
24
+ }
@@ -0,0 +1,20 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { AXPPermissionDefinition, AXPPermissionGroupDefinition } from './permission.types';
3
+ import { AXPPermissionDefinitionProviderContext } from './permission-definition.builder';
4
+ import * as i0 from "@angular/core";
5
+ export interface AXPPermissionDefinitionProvider {
6
+ define(context: AXPPermissionDefinitionProviderContext): Promise<void>;
7
+ }
8
+ export declare const AXP_PERMISSION_DEFINITION_PROVIDER: InjectionToken<AXPPermissionDefinitionProvider[]>;
9
+ export declare class AXPPermissionDefinitionService {
10
+ private providers;
11
+ private cache;
12
+ private load;
13
+ reload(): Promise<void>;
14
+ getGroups(): Promise<AXPPermissionGroupDefinition[]>;
15
+ getPermissions(): Promise<AXPPermissionDefinition[]>;
16
+ getGroup(name: string): Promise<AXPPermissionGroupDefinition | null>;
17
+ getPermission(name: string): Promise<AXPPermissionDefinition | null>;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPPermissionDefinitionService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPPermissionDefinitionService>;
20
+ }
@@ -1,6 +1,13 @@
1
- export type AXPPermissionDefinition = {
1
+ export type AXPPermission = string;
2
+ export interface AXPPermissionGroupDefinition {
2
3
  name: string;
3
4
  title: string;
4
- isArchived: boolean;
5
+ description?: string;
6
+ permissions: AXPPermissionDefinition[];
7
+ }
8
+ export type AXPPermissionDefinition = {
9
+ name: AXPPermission;
10
+ title: string;
11
+ description: string;
12
+ children: AXPPermissionDefinition[];
5
13
  };
6
- export type AXPPermission = string;
@@ -1,4 +1,4 @@
1
- export * from './setting-definition.provider';
1
+ export * from './setting-definition.service';
2
2
  export * from './settings.provider';
3
3
  export * from './settings.service';
4
4
  export * from './setting.builder';
@@ -0,0 +1,282 @@
1
+ export interface AXPSystemAction {
2
+ key: string;
3
+ title: string;
4
+ icon?: string;
5
+ color?: string;
6
+ critical?: boolean;
7
+ descriptions: {
8
+ button: string;
9
+ tooltip: string;
10
+ permission: string;
11
+ audit: string;
12
+ };
13
+ }
14
+ export declare const AXPSystemActions: Readonly<{
15
+ readonly View: {
16
+ readonly key: "view";
17
+ readonly title: string;
18
+ readonly icon: "fa-light fa-eye";
19
+ readonly color: "default";
20
+ readonly descriptions: {
21
+ readonly button: string;
22
+ readonly tooltip: string;
23
+ readonly permission: string;
24
+ readonly audit: string;
25
+ };
26
+ };
27
+ readonly Create: {
28
+ readonly key: "create";
29
+ readonly title: string;
30
+ readonly icon: "fa-light fa-plus";
31
+ readonly color: "success";
32
+ readonly descriptions: {
33
+ readonly button: string;
34
+ readonly tooltip: string;
35
+ readonly permission: string;
36
+ readonly audit: string;
37
+ };
38
+ };
39
+ readonly Edit: {
40
+ readonly key: "edit";
41
+ readonly title: string;
42
+ readonly icon: "fa-light fa-pencil";
43
+ readonly color: "primary";
44
+ readonly descriptions: {
45
+ readonly button: string;
46
+ readonly tooltip: string;
47
+ readonly permission: string;
48
+ readonly audit: string;
49
+ };
50
+ };
51
+ readonly Delete: {
52
+ readonly key: "delete";
53
+ readonly title: string;
54
+ readonly icon: "fa-light fa-trash";
55
+ readonly color: "danger";
56
+ readonly critical: true;
57
+ readonly descriptions: {
58
+ readonly button: string;
59
+ readonly tooltip: string;
60
+ readonly permission: string;
61
+ readonly audit: string;
62
+ };
63
+ };
64
+ readonly Approve: {
65
+ readonly key: "approve";
66
+ readonly title: string;
67
+ readonly icon: "fa-light fa-circle-check";
68
+ readonly color: "success";
69
+ readonly critical: true;
70
+ readonly descriptions: {
71
+ readonly button: string;
72
+ readonly tooltip: string;
73
+ readonly permission: string;
74
+ readonly audit: string;
75
+ };
76
+ };
77
+ readonly Submit: {
78
+ readonly key: "submit";
79
+ readonly title: string;
80
+ readonly icon: "fa-light fa-paper-plane";
81
+ readonly color: "primary";
82
+ readonly descriptions: {
83
+ readonly button: string;
84
+ readonly tooltip: string;
85
+ readonly permission: string;
86
+ readonly audit: string;
87
+ };
88
+ };
89
+ readonly Reject: {
90
+ readonly key: "reject";
91
+ readonly title: string;
92
+ readonly icon: "fa-light fa-ban";
93
+ readonly color: "danger";
94
+ readonly critical: true;
95
+ readonly descriptions: {
96
+ readonly button: string;
97
+ readonly tooltip: string;
98
+ readonly permission: string;
99
+ readonly audit: string;
100
+ };
101
+ };
102
+ readonly Export: {
103
+ readonly key: "export";
104
+ readonly title: string;
105
+ readonly icon: "fa-light fa-download";
106
+ readonly color: "default";
107
+ readonly descriptions: {
108
+ readonly button: string;
109
+ readonly tooltip: string;
110
+ readonly permission: string;
111
+ readonly audit: string;
112
+ };
113
+ };
114
+ readonly Import: {
115
+ readonly key: "import";
116
+ readonly title: string;
117
+ readonly icon: "fa-light fa-upload";
118
+ readonly color: "default";
119
+ readonly descriptions: {
120
+ readonly button: string;
121
+ readonly tooltip: string;
122
+ readonly permission: string;
123
+ readonly audit: string;
124
+ };
125
+ };
126
+ readonly Print: {
127
+ readonly key: "print";
128
+ readonly title: string;
129
+ readonly icon: "fa-light fa-print";
130
+ readonly color: "default";
131
+ readonly descriptions: {
132
+ readonly button: string;
133
+ readonly tooltip: string;
134
+ readonly permission: string;
135
+ readonly audit: string;
136
+ };
137
+ };
138
+ readonly Duplicate: {
139
+ readonly key: "duplicate";
140
+ readonly title: string;
141
+ readonly icon: "fa-light fa-clone";
142
+ readonly color: "warning";
143
+ readonly descriptions: {
144
+ readonly button: string;
145
+ readonly tooltip: string;
146
+ readonly permission: string;
147
+ readonly audit: string;
148
+ };
149
+ };
150
+ readonly Archive: {
151
+ readonly key: "archive";
152
+ readonly title: string;
153
+ readonly icon: "fa-light fa-box-archive";
154
+ readonly color: "neutral";
155
+ readonly descriptions: {
156
+ readonly button: string;
157
+ readonly tooltip: string;
158
+ readonly permission: string;
159
+ readonly audit: string;
160
+ };
161
+ };
162
+ readonly Restore: {
163
+ readonly key: "restore";
164
+ readonly title: string;
165
+ readonly icon: "fa-light fa-arrow-rotate-left";
166
+ readonly color: "info";
167
+ readonly descriptions: {
168
+ readonly button: string;
169
+ readonly tooltip: string;
170
+ readonly permission: string;
171
+ readonly audit: string;
172
+ };
173
+ };
174
+ readonly Assign: {
175
+ readonly key: "assign";
176
+ readonly title: string;
177
+ readonly icon: "fa-light fa-user-plus";
178
+ readonly color: "primary";
179
+ readonly descriptions: {
180
+ readonly button: string;
181
+ readonly tooltip: string;
182
+ readonly permission: string;
183
+ readonly audit: string;
184
+ };
185
+ };
186
+ readonly Lock: {
187
+ readonly key: "lock";
188
+ readonly title: string;
189
+ readonly icon: "fa-light fa-lock";
190
+ readonly color: "warning";
191
+ readonly descriptions: {
192
+ readonly button: string;
193
+ readonly tooltip: string;
194
+ readonly permission: string;
195
+ readonly audit: string;
196
+ };
197
+ };
198
+ readonly Unlock: {
199
+ readonly key: "unlock";
200
+ readonly title: string;
201
+ readonly icon: "fa-light fa-unlock";
202
+ readonly color: "success";
203
+ readonly descriptions: {
204
+ readonly button: string;
205
+ readonly tooltip: string;
206
+ readonly permission: string;
207
+ readonly audit: string;
208
+ };
209
+ };
210
+ readonly Share: {
211
+ readonly key: "share";
212
+ readonly title: string;
213
+ readonly icon: "fa-light fa-share-nodes";
214
+ readonly color: "info";
215
+ readonly descriptions: {
216
+ readonly button: string;
217
+ readonly tooltip: string;
218
+ readonly permission: string;
219
+ readonly audit: string;
220
+ };
221
+ };
222
+ readonly Configure: {
223
+ readonly key: "configure";
224
+ readonly title: string;
225
+ readonly icon: "fa-light fa-sliders";
226
+ readonly color: "primary";
227
+ readonly descriptions: {
228
+ readonly button: string;
229
+ readonly tooltip: string;
230
+ readonly permission: string;
231
+ readonly audit: string;
232
+ };
233
+ };
234
+ readonly Reorder: {
235
+ readonly key: "reorder";
236
+ readonly title: string;
237
+ readonly icon: "fa-light fa-arrow-down-up-across-line";
238
+ readonly color: "default";
239
+ readonly descriptions: {
240
+ readonly button: string;
241
+ readonly tooltip: string;
242
+ readonly permission: string;
243
+ readonly audit: string;
244
+ };
245
+ };
246
+ readonly Preview: {
247
+ readonly key: "preview";
248
+ readonly title: string;
249
+ readonly icon: "fa-light fa-magnifying-glass";
250
+ readonly color: "default";
251
+ readonly descriptions: {
252
+ readonly button: string;
253
+ readonly tooltip: string;
254
+ readonly permission: string;
255
+ readonly audit: string;
256
+ };
257
+ };
258
+ readonly Publish: {
259
+ readonly key: "publish";
260
+ readonly title: string;
261
+ readonly icon: "fa-light fa-globe";
262
+ readonly color: "success";
263
+ readonly descriptions: {
264
+ readonly button: string;
265
+ readonly tooltip: string;
266
+ readonly permission: string;
267
+ readonly audit: string;
268
+ };
269
+ };
270
+ readonly Unpublish: {
271
+ readonly key: "unpublish";
272
+ readonly title: string;
273
+ readonly icon: "fa-light fa-globe-slash";
274
+ readonly color: "neutral";
275
+ readonly descriptions: {
276
+ readonly button: string;
277
+ readonly tooltip: string;
278
+ readonly permission: string;
279
+ readonly audit: string;
280
+ };
281
+ };
282
+ }>;
@@ -6,3 +6,4 @@ export * from './layout.types';
6
6
  export * from './logo.types';
7
7
  export * from './scope.types';
8
8
  export * from './validation.types';
9
+ export * from './actions.types';
@@ -526,37 +526,131 @@ const AXPPermissionGuard = (route, state) => {
526
526
  }));
527
527
  };
528
528
 
529
- const AXP_PERMISSION_PROVIDER = new InjectionToken('AXP_PERMISSION_PROVIDER');
530
- class AXPPermissionProviderService {
529
+ class AXPPermissionDefinitionProviderContext {
531
530
  constructor() {
532
- this.providers = inject(AXP_PERMISSION_PROVIDER, { optional: true });
531
+ this.builders = new Map();
532
+ }
533
+ addGroup(name, title, description) {
534
+ const group = {
535
+ name,
536
+ title,
537
+ description,
538
+ permissions: []
539
+ };
540
+ const builder = new AXPPermissionDefinitionGroupBuilder(this, group);
541
+ this.builders.set(name, builder);
542
+ return builder;
543
+ }
544
+ getGroupDefinitions() {
545
+ return Array.from(this.builders.values()).map(b => b.group);
546
+ }
547
+ findGroup(name) {
548
+ return this.builders.get(name);
549
+ }
550
+ }
551
+ class AXPPermissionDefinitionGroupBuilder {
552
+ get group() {
553
+ return this._group;
554
+ }
555
+ constructor(context, group) {
556
+ this.context = context;
557
+ this._group = group;
558
+ }
559
+ addPermission(name, title, description) {
560
+ const permission = {
561
+ name,
562
+ title,
563
+ description,
564
+ children: []
565
+ };
566
+ this._group.permissions.push(permission);
567
+ return new AXPPermissionDefinitionBuilder(this, permission);
568
+ }
569
+ endGroup() {
570
+ return this.context;
571
+ }
572
+ findPermission(path) {
573
+ return undefined;
574
+ }
575
+ findGroup(name) {
576
+ return undefined;
577
+ }
578
+ }
579
+ class AXPPermissionDefinitionBuilder {
580
+ constructor(groupBuilder, permission) {
581
+ this.groupBuilder = groupBuilder;
582
+ this.permission = permission;
583
+ }
584
+ addChild(name, title, description) {
585
+ const permission = {
586
+ name,
587
+ title,
588
+ description,
589
+ children: []
590
+ };
591
+ this.permission.children.push(permission);
592
+ return this;
593
+ }
594
+ endPermission() {
595
+ return this.groupBuilder;
596
+ }
597
+ }
598
+
599
+ const AXP_PERMISSION_DEFINITION_PROVIDER = new InjectionToken('AXP_PERMISSION_DEFINITION_PROVIDER', {
600
+ providedIn: 'root',
601
+ factory: () => {
602
+ return [];
603
+ }
604
+ });
605
+ class AXPPermissionDefinitionService {
606
+ constructor() {
607
+ this.providers = inject(AXP_PERMISSION_DEFINITION_PROVIDER, { optional: true });
533
608
  this.cache = null;
534
609
  }
535
- async permissions() {
610
+ async load() {
536
611
  if (this.cache) {
537
- return this.cache;
612
+ return;
538
613
  }
539
- const permissions = [];
540
- const context = this.createPermissionProviderContext(permissions);
614
+ const context = new AXPPermissionDefinitionProviderContext();
541
615
  if (Array.isArray(this.providers)) {
542
616
  for (const provider of this.providers) {
543
- await provider.provide(context);
617
+ if (provider instanceof Promise) {
618
+ // If provider is a promise, resolve it
619
+ const resolvedProvider = await provider;
620
+ await resolvedProvider.define(context);
621
+ }
622
+ else {
623
+ // If provider is a direct instance, use it directly
624
+ await provider.define(context);
625
+ }
544
626
  }
545
627
  }
546
- this.cache = permissions;
547
- return permissions;
628
+ this.cache = context.getGroupDefinitions();
548
629
  }
549
- createPermissionProviderContext(permissions) {
550
- return {
551
- addPermissions: (newPermissions) => {
552
- permissions.push(...newPermissions);
553
- },
554
- };
630
+ async reload() {
631
+ this.cache = null;
632
+ await this.load();
633
+ }
634
+ async getGroups() {
635
+ await this.load();
636
+ return this.cache ?? [];
637
+ }
638
+ async getPermissions() {
639
+ await this.load();
640
+ return this.cache?.flatMap(g => g.permissions) ?? [];
641
+ }
642
+ async getGroup(name) {
643
+ await this.load();
644
+ return this.cache?.find(g => g.name === name) ?? null;
645
+ }
646
+ async getPermission(name) {
647
+ await this.load();
648
+ return this.cache?.find(g => g.permissions.find(p => p.name === name))?.permissions.find(p => p.name === name) ?? null;
555
649
  }
556
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPermissionProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
557
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPermissionProviderService, providedIn: 'root' }); }
650
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPermissionDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
651
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPermissionDefinitionService, providedIn: 'root' }); }
558
652
  }
559
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPermissionProviderService, decorators: [{
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPPermissionDefinitionService, decorators: [{
560
654
  type: Injectable,
561
655
  args: [{ providedIn: 'root' }]
562
656
  }] });
@@ -657,5 +751,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
657
751
  * Generated bundle index. Do not edit.
658
752
  */
659
753
 
660
- export { AXPAuthGuard, AXPAuthModule, AXPFeatureDirective, AXPFeatureGuard, AXPPermissionDirective, AXPPermissionGuard, AXPPermissionProviderService, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_LOADER, AXP_PERMISSION_LOADER, AXP_PERMISSION_PROVIDER, AXP_TENANT_LOADER, initializeAppState };
754
+ export { AXPAuthGuard, AXPAuthModule, AXPFeatureDirective, AXPFeatureGuard, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, AXPPermissionDirective, AXPPermissionGuard, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_LOADER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, initializeAppState };
661
755
  //# sourceMappingURL=acorex-platform-auth.mjs.map