@flusys/ng-iam 1.1.1-beta → 3.0.0-rc

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/README.md +175 -24
  2. package/fesm2022/flusys-ng-iam-action-form-page.component-CVN8sV-c.mjs +389 -0
  3. package/fesm2022/flusys-ng-iam-action-form-page.component-CVN8sV-c.mjs.map +1 -0
  4. package/fesm2022/flusys-ng-iam-action-list-page.component-CQ6RazN0.mjs +262 -0
  5. package/fesm2022/flusys-ng-iam-action-list-page.component-CQ6RazN0.mjs.map +1 -0
  6. package/fesm2022/{flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs → flusys-ng-iam-flusys-ng-iam-DrGHlTiz.mjs} +1016 -1585
  7. package/fesm2022/flusys-ng-iam-flusys-ng-iam-DrGHlTiz.mjs.map +1 -0
  8. package/fesm2022/flusys-ng-iam-iam-container.component-BToYxEej.mjs +92 -0
  9. package/fesm2022/flusys-ng-iam-iam-container.component-BToYxEej.mjs.map +1 -0
  10. package/fesm2022/flusys-ng-iam-permission-page.component-BS7xXmsn.mjs +137 -0
  11. package/fesm2022/flusys-ng-iam-permission-page.component-BS7xXmsn.mjs.map +1 -0
  12. package/fesm2022/{flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs → flusys-ng-iam-role-form-page.component-BjPwXkip.mjs} +106 -148
  13. package/fesm2022/flusys-ng-iam-role-form-page.component-BjPwXkip.mjs.map +1 -0
  14. package/fesm2022/flusys-ng-iam-role-list-page.component-Cz-jk-R_.mjs +299 -0
  15. package/fesm2022/flusys-ng-iam-role-list-page.component-Cz-jk-R_.mjs.map +1 -0
  16. package/fesm2022/flusys-ng-iam.mjs +1 -1
  17. package/package.json +5 -5
  18. package/types/flusys-ng-iam.d.ts +75 -454
  19. package/fesm2022/flusys-ng-iam-action-form-page.component-C1j10Qhw.mjs +0 -467
  20. package/fesm2022/flusys-ng-iam-action-form-page.component-C1j10Qhw.mjs.map +0 -1
  21. package/fesm2022/flusys-ng-iam-action-list-page.component-BCzSardO.mjs +0 -281
  22. package/fesm2022/flusys-ng-iam-action-list-page.component-BCzSardO.mjs.map +0 -1
  23. package/fesm2022/flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs.map +0 -1
  24. package/fesm2022/flusys-ng-iam-iam-container.component-BkhqmzLi.mjs +0 -97
  25. package/fesm2022/flusys-ng-iam-iam-container.component-BkhqmzLi.mjs.map +0 -1
  26. package/fesm2022/flusys-ng-iam-permission-page.component-BSQFPt_N.mjs +0 -143
  27. package/fesm2022/flusys-ng-iam-permission-page.component-BSQFPt_N.mjs.map +0 -1
  28. package/fesm2022/flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs.map +0 -1
  29. package/fesm2022/flusys-ng-iam-role-list-page.component-BObCxHiB.mjs +0 -266
  30. package/fesm2022/flusys-ng-iam-role-list-page.component-BObCxHiB.mjs.map +0 -1
@@ -0,0 +1,92 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { RouterOutlet, RouterLink, RouterLinkActive } from '@angular/router';
4
+ import { APP_CONFIG, getPermissionMode } from '@flusys/ng-core';
5
+
6
+ /**
7
+ * IAM Container Component
8
+ *
9
+ * Main container for IAM module with tab navigation
10
+ * Routes: Actions | Roles (conditional) | Users (permission assignment)
11
+ */
12
+ class IamContainerComponent {
13
+ appConfig = inject(APP_CONFIG);
14
+ /** All available tabs */
15
+ allTabs = [
16
+ {
17
+ id: 'actions',
18
+ label: 'Actions',
19
+ icon: 'pi pi-bolt',
20
+ route: 'actions',
21
+ },
22
+ {
23
+ id: 'roles',
24
+ label: 'Roles',
25
+ icon: 'pi pi-shield',
26
+ route: 'roles',
27
+ requiresRBAC: true,
28
+ },
29
+ {
30
+ id: 'permissions',
31
+ label: 'Permissions',
32
+ icon: 'pi pi-key',
33
+ route: 'permissions',
34
+ },
35
+ ];
36
+ /** Visible tabs based on permission mode */
37
+ visibleTabs = computed(() => {
38
+ const permissionMode = getPermissionMode(this.appConfig);
39
+ return this.allTabs.filter((tab) => !tab.requiresRBAC || permissionMode === 'rbac' || permissionMode === 'full');
40
+ }, ...(ngDevMode ? [{ debugName: "visibleTabs" }] : []));
41
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: IamContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
42
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: IamContainerComponent, isStandalone: true, selector: "lib-iam-container", ngImport: i0, template: `
43
+ <div class="p-4">
44
+ <div class="mb-4">
45
+ <h1 class="text-xl sm:text-2xl font-bold m-0">Identity & Access Management</h1>
46
+ <p class="text-muted-color mt-1">Manage actions, roles, and user permissions</p>
47
+ </div>
48
+
49
+ <div class="scrollbar-hide flex gap-1 mb-4 border-b border-surface overflow-x-auto flex-nowrap">
50
+ @for (tab of visibleTabs(); track tab.id) {
51
+ <a
52
+ [routerLink]="tab.route"
53
+ routerLinkActive="tab-active"
54
+ class="flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-muted-color no-underline border-b-2 border-transparent -mb-px hover:bg-surface-hover [&.tab-active]:text-primary [&.tab-active]:border-primary [&.tab-active]:bg-surface-ground whitespace-nowrap shrink-0">
55
+ <i [class]="tab.icon"></i>
56
+ <span>{{ tab.label }}</span>
57
+ </a>
58
+ }
59
+ </div>
60
+
61
+ <router-outlet />
62
+ </div>
63
+ `, isInline: true, styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"], dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: IamContainerComponent, decorators: [{
66
+ type: Component,
67
+ args: [{ selector: 'lib-iam-container', imports: [RouterOutlet, RouterLink, RouterLinkActive], changeDetection: ChangeDetectionStrategy.OnPush, template: `
68
+ <div class="p-4">
69
+ <div class="mb-4">
70
+ <h1 class="text-xl sm:text-2xl font-bold m-0">Identity & Access Management</h1>
71
+ <p class="text-muted-color mt-1">Manage actions, roles, and user permissions</p>
72
+ </div>
73
+
74
+ <div class="scrollbar-hide flex gap-1 mb-4 border-b border-surface overflow-x-auto flex-nowrap">
75
+ @for (tab of visibleTabs(); track tab.id) {
76
+ <a
77
+ [routerLink]="tab.route"
78
+ routerLinkActive="tab-active"
79
+ class="flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-muted-color no-underline border-b-2 border-transparent -mb-px hover:bg-surface-hover [&.tab-active]:text-primary [&.tab-active]:border-primary [&.tab-active]:bg-surface-ground whitespace-nowrap shrink-0">
80
+ <i [class]="tab.icon"></i>
81
+ <span>{{ tab.label }}</span>
82
+ </a>
83
+ }
84
+ </div>
85
+
86
+ <router-outlet />
87
+ </div>
88
+ `, styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"] }]
89
+ }] });
90
+
91
+ export { IamContainerComponent };
92
+ //# sourceMappingURL=flusys-ng-iam-iam-container.component-BToYxEej.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flusys-ng-iam-iam-container.component-BToYxEej.mjs","sources":["../../../projects/ng-iam/pages/iam-container/iam-container.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';\nimport { APP_CONFIG, getPermissionMode } from '@flusys/ng-core';\n\ninterface ITab {\n id: string;\n label: string;\n icon: string;\n route: string;\n requiresRBAC?: boolean;\n}\n\n/**\n * IAM Container Component\n *\n * Main container for IAM module with tab navigation\n * Routes: Actions | Roles (conditional) | Users (permission assignment)\n */\n@Component({\n selector: 'lib-iam-container',\n imports: [RouterOutlet, RouterLink, RouterLinkActive],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: `\n .scrollbar-hide {\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar { display: none; }\n }\n `,\n template: `\n <div class=\"p-4\">\n <div class=\"mb-4\">\n <h1 class=\"text-xl sm:text-2xl font-bold m-0\">Identity & Access Management</h1>\n <p class=\"text-muted-color mt-1\">Manage actions, roles, and user permissions</p>\n </div>\n\n <div class=\"scrollbar-hide flex gap-1 mb-4 border-b border-surface overflow-x-auto flex-nowrap\">\n @for (tab of visibleTabs(); track tab.id) {\n <a\n [routerLink]=\"tab.route\"\n routerLinkActive=\"tab-active\"\n class=\"flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-muted-color no-underline border-b-2 border-transparent -mb-px hover:bg-surface-hover [&.tab-active]:text-primary [&.tab-active]:border-primary [&.tab-active]:bg-surface-ground whitespace-nowrap shrink-0\">\n <i [class]=\"tab.icon\"></i>\n <span>{{ tab.label }}</span>\n </a>\n }\n </div>\n\n <router-outlet />\n </div>\n `,\n})\nexport class IamContainerComponent {\n private readonly appConfig = inject(APP_CONFIG);\n\n /** All available tabs */\n private readonly allTabs: ITab[] = [\n {\n id: 'actions',\n label: 'Actions',\n icon: 'pi pi-bolt',\n route: 'actions',\n },\n {\n id: 'roles',\n label: 'Roles',\n icon: 'pi pi-shield',\n route: 'roles',\n requiresRBAC: true,\n },\n {\n id: 'permissions',\n label: 'Permissions',\n icon: 'pi pi-key',\n route: 'permissions',\n },\n ];\n\n /** Visible tabs based on permission mode */\n readonly visibleTabs = computed(() => {\n const permissionMode = getPermissionMode(this.appConfig);\n return this.allTabs.filter(\n (tab) => !tab.requiresRBAC || permissionMode === 'rbac' || permissionMode === 'full'\n );\n });\n}\n"],"names":[],"mappings":";;;;;AAYA;;;;;AAKG;MAmCU,qBAAqB,CAAA;AACf,IAAA,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC;;AAG9B,IAAA,OAAO,GAAW;AACjC,QAAA;AACE,YAAA,EAAE,EAAE,SAAS;AACb,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,IAAI,EAAE,YAAY;AAClB,YAAA,KAAK,EAAE,SAAS;AACjB,SAAA;AACD,QAAA;AACE,YAAA,EAAE,EAAE,OAAO;AACX,YAAA,KAAK,EAAE,OAAO;AACd,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,KAAK,EAAE,OAAO;AACd,YAAA,YAAY,EAAE,IAAI;AACnB,SAAA;AACD,QAAA;AACE,YAAA,EAAE,EAAE,aAAa;AACjB,YAAA,KAAK,EAAE,aAAa;AACpB,YAAA,IAAI,EAAE,WAAW;AACjB,YAAA,KAAK,EAAE,aAAa;AACrB,SAAA;KACF;;AAGQ,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;QACnC,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,IAAI,cAAc,KAAK,MAAM,IAAI,cAAc,KAAK,MAAM,CACrF;AACH,IAAA,CAAC,uDAAC;uGAhCS,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EA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gBAAgB,CAAC,EAAA,eAAA,EACpC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAQrC;;;;;;;;;;;;;;;;;;;;;AAqBT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,iHAAA,CAAA,EAAA;;;;;"}
@@ -0,0 +1,137 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { COMPANY_ACTION_PERMISSIONS, USER_ACTION_PERMISSIONS, USER_ROLE_PERMISSIONS, ROLE_ACTION_PERMISSIONS, AngularModule, PrimeModule, HasPermissionDirective } from '@flusys/ng-shared';
4
+ import { APP_CONFIG, getPermissionMode, isCompanyFeatureEnabled } from '@flusys/ng-core';
5
+ import * as i2 from 'primeng/button';
6
+ import { ButtonModule } from 'primeng/button';
7
+ import { TabsModule } from 'primeng/tabs';
8
+ import { b as RoleActionSelectorComponent, C as CompanyActionSelectorComponent, U as UserRoleSelectorComponent, d as UserActionSelectorComponent } from './flusys-ng-iam-flusys-ng-iam-DrGHlTiz.mjs';
9
+
10
+ /** Permission codes for each tab */
11
+ const TAB_PERMISSIONS = {
12
+ 'role-actions': ROLE_ACTION_PERMISSIONS.READ,
13
+ 'user-roles': USER_ROLE_PERMISSIONS.READ,
14
+ 'user-actions': USER_ACTION_PERMISSIONS.READ,
15
+ 'company-actions': COMPANY_ACTION_PERMISSIONS.READ,
16
+ };
17
+ /** Main permission management interface with tabs for role/user/company permission assignment */
18
+ class PermissionPageComponent {
19
+ appConfig = inject(APP_CONFIG);
20
+ activeTab = signal('', ...(ngDevMode ? [{ debugName: "activeTab" }] : []));
21
+ /** Available tabs based on permission mode */
22
+ availableTabs = computed(() => {
23
+ const permissionMode = getPermissionMode(this.appConfig);
24
+ const tabs = [];
25
+ if (permissionMode === 'rbac' || permissionMode === 'full') {
26
+ tabs.push({ id: 'role-actions', label: 'Role-Actions', icon: 'pi pi-shield', permission: TAB_PERMISSIONS['role-actions'] }, { id: 'user-roles', label: 'User-Roles', icon: 'pi pi-user', permission: TAB_PERMISSIONS['user-roles'] });
27
+ }
28
+ if (permissionMode === 'direct' || permissionMode === 'full') {
29
+ tabs.push({ id: 'user-actions', label: 'User-Actions', icon: 'pi pi-key', permission: TAB_PERMISSIONS['user-actions'] });
30
+ }
31
+ if (isCompanyFeatureEnabled(this.appConfig)) {
32
+ tabs.push({ id: 'company-actions', label: 'Company-Actions', icon: 'pi pi-building', permission: TAB_PERMISSIONS['company-actions'] });
33
+ }
34
+ return tabs;
35
+ }, ...(ngDevMode ? [{ debugName: "availableTabs" }] : []));
36
+ constructor() {
37
+ effect(() => {
38
+ const tabs = this.availableTabs();
39
+ const currentTab = untracked(() => this.activeTab());
40
+ if (!currentTab || !tabs.some((t) => t.id === currentTab)) {
41
+ if (tabs.length > 0) {
42
+ this.activeTab.set(tabs[0].id);
43
+ }
44
+ }
45
+ });
46
+ }
47
+ setActiveTab(tabId) {
48
+ this.activeTab.set(tabId);
49
+ }
50
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: PermissionPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
51
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: PermissionPageComponent, isStandalone: true, selector: "lib-permission-page", ngImport: i0, template: `
52
+ <div class="card">
53
+ <h3 class="text-xl font-semibold mb-4">Permission Management</h3>
54
+
55
+ <div class="scrollbar-hide flex gap-2 mb-4 overflow-x-auto flex-nowrap">
56
+ @for (tab of availableTabs(); track tab.id) {
57
+ <p-button
58
+ *hasPermission="tab.permission"
59
+ [label]="tab.label"
60
+ [icon]="tab.icon"
61
+ [outlined]="activeTab() !== tab.id"
62
+ size="small"
63
+ styleClass="shrink-0"
64
+ (onClick)="setActiveTab(tab.id)" />
65
+ }
66
+ </div>
67
+
68
+ <div class="mt-4">
69
+ @switch (activeTab()) {
70
+ @case ('role-actions') {
71
+ <flusys-role-action-selector />
72
+ }
73
+ @case ('user-roles') {
74
+ <flusys-user-role-selector />
75
+ }
76
+ @case ('user-actions') {
77
+ <flusys-user-action-selector />
78
+ }
79
+ @case ('company-actions') {
80
+ <flusys-company-action-selector />
81
+ }
82
+ }
83
+ </div>
84
+ </div>
85
+ `, isInline: true, styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"], dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: TabsModule }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "component", type: RoleActionSelectorComponent, selector: "flusys-role-action-selector" }, { kind: "component", type: CompanyActionSelectorComponent, selector: "flusys-company-action-selector" }, { kind: "component", type: UserRoleSelectorComponent, selector: "flusys-user-role-selector" }, { kind: "component", type: UserActionSelectorComponent, selector: "flusys-user-action-selector" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
86
+ }
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: PermissionPageComponent, decorators: [{
88
+ type: Component,
89
+ args: [{ selector: 'lib-permission-page', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
90
+ AngularModule,
91
+ PrimeModule,
92
+ ButtonModule,
93
+ TabsModule,
94
+ HasPermissionDirective,
95
+ RoleActionSelectorComponent,
96
+ CompanyActionSelectorComponent,
97
+ UserRoleSelectorComponent,
98
+ UserActionSelectorComponent
99
+ ], template: `
100
+ <div class="card">
101
+ <h3 class="text-xl font-semibold mb-4">Permission Management</h3>
102
+
103
+ <div class="scrollbar-hide flex gap-2 mb-4 overflow-x-auto flex-nowrap">
104
+ @for (tab of availableTabs(); track tab.id) {
105
+ <p-button
106
+ *hasPermission="tab.permission"
107
+ [label]="tab.label"
108
+ [icon]="tab.icon"
109
+ [outlined]="activeTab() !== tab.id"
110
+ size="small"
111
+ styleClass="shrink-0"
112
+ (onClick)="setActiveTab(tab.id)" />
113
+ }
114
+ </div>
115
+
116
+ <div class="mt-4">
117
+ @switch (activeTab()) {
118
+ @case ('role-actions') {
119
+ <flusys-role-action-selector />
120
+ }
121
+ @case ('user-roles') {
122
+ <flusys-user-role-selector />
123
+ }
124
+ @case ('user-actions') {
125
+ <flusys-user-action-selector />
126
+ }
127
+ @case ('company-actions') {
128
+ <flusys-company-action-selector />
129
+ }
130
+ }
131
+ </div>
132
+ </div>
133
+ `, styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"] }]
134
+ }], ctorParameters: () => [] });
135
+
136
+ export { PermissionPageComponent };
137
+ //# sourceMappingURL=flusys-ng-iam-permission-page.component-BS7xXmsn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flusys-ng-iam-permission-page.component-BS7xXmsn.mjs","sources":["../../../projects/ng-iam/pages/permission/permission-page.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, inject, signal, untracked } from '@angular/core';\nimport {\n AngularModule,\n HasPermissionDirective,\n PrimeModule,\n ROLE_ACTION_PERMISSIONS,\n USER_ROLE_PERMISSIONS,\n USER_ACTION_PERMISSIONS,\n COMPANY_ACTION_PERMISSIONS,\n} from '@flusys/ng-shared';\nimport { APP_CONFIG, getPermissionMode, isCompanyFeatureEnabled } from '@flusys/ng-core';\nimport { ButtonModule } from 'primeng/button';\nimport { TabsModule } from 'primeng/tabs';\nimport { RoleActionSelectorComponent } from '../../components/role-action-selector.component';\nimport { CompanyActionSelectorComponent } from '../../components/company-action-selector.component';\nimport { UserRoleSelectorComponent } from '../../components/user-role-selector.component';\nimport { UserActionSelectorComponent } from '../../components/user-action-selector.component';\n\n/** Permission codes for each tab */\nconst TAB_PERMISSIONS = {\n 'role-actions': ROLE_ACTION_PERMISSIONS.READ,\n 'user-roles': USER_ROLE_PERMISSIONS.READ,\n 'user-actions': USER_ACTION_PERMISSIONS.READ,\n 'company-actions': COMPANY_ACTION_PERMISSIONS.READ,\n} as const;\n\n/** Main permission management interface with tabs for role/user/company permission assignment */\n@Component({\n selector: 'lib-permission-page',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n AngularModule,\n PrimeModule,\n ButtonModule,\n TabsModule,\n HasPermissionDirective,\n RoleActionSelectorComponent,\n CompanyActionSelectorComponent,\n UserRoleSelectorComponent,\n UserActionSelectorComponent\n ],\n styles: `\n .scrollbar-hide {\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar { display: none; }\n }\n `,\n template: `\n <div class=\"card\">\n <h3 class=\"text-xl font-semibold mb-4\">Permission Management</h3>\n\n <div class=\"scrollbar-hide flex gap-2 mb-4 overflow-x-auto flex-nowrap\">\n @for (tab of availableTabs(); track tab.id) {\n <p-button\n *hasPermission=\"tab.permission\"\n [label]=\"tab.label\"\n [icon]=\"tab.icon\"\n [outlined]=\"activeTab() !== tab.id\"\n size=\"small\"\n styleClass=\"shrink-0\"\n (onClick)=\"setActiveTab(tab.id)\" />\n }\n </div>\n\n <div class=\"mt-4\">\n @switch (activeTab()) {\n @case ('role-actions') {\n <flusys-role-action-selector />\n }\n @case ('user-roles') {\n <flusys-user-role-selector />\n }\n @case ('user-actions') {\n <flusys-user-action-selector />\n }\n @case ('company-actions') {\n <flusys-company-action-selector />\n }\n }\n </div>\n </div>\n `,\n})\nexport class PermissionPageComponent {\n private readonly appConfig = inject(APP_CONFIG);\n\n readonly activeTab = signal<string>('');\n\n /** Available tabs based on permission mode */\n readonly availableTabs = computed(() => {\n const permissionMode = getPermissionMode(this.appConfig);\n const tabs: Array<{ id: string; label: string; icon: string; permission: string }> = [];\n\n if (permissionMode === 'rbac' || permissionMode === 'full') {\n tabs.push(\n { id: 'role-actions', label: 'Role-Actions', icon: 'pi pi-shield', permission: TAB_PERMISSIONS['role-actions'] },\n { id: 'user-roles', label: 'User-Roles', icon: 'pi pi-user', permission: TAB_PERMISSIONS['user-roles'] }\n );\n }\n\n if (permissionMode === 'direct' || permissionMode === 'full') {\n tabs.push({ id: 'user-actions', label: 'User-Actions', icon: 'pi pi-key', permission: TAB_PERMISSIONS['user-actions'] });\n }\n\n if (isCompanyFeatureEnabled(this.appConfig)) {\n tabs.push({ id: 'company-actions', label: 'Company-Actions', icon: 'pi pi-building', permission: TAB_PERMISSIONS['company-actions'] });\n }\n\n return tabs;\n });\n\n constructor() {\n effect(() => {\n const tabs = this.availableTabs();\n const currentTab = untracked(() => this.activeTab());\n if (!currentTab || !tabs.some((t) => t.id === currentTab)) {\n if (tabs.length > 0) {\n this.activeTab.set(tabs[0].id);\n }\n }\n });\n }\n\n setActiveTab(tabId: string): void {\n this.activeTab.set(tabId);\n }\n}\n"],"names":["i1"],"mappings":";;;;;;;;;AAkBA;AACA,MAAM,eAAe,GAAG;IACtB,cAAc,EAAE,uBAAuB,CAAC,IAAI;IAC5C,YAAY,EAAE,qBAAqB,CAAC,IAAI;IACxC,cAAc,EAAE,uBAAuB,CAAC,IAAI;IAC5C,iBAAiB,EAAE,0BAA0B,CAAC,IAAI;CAC1C;AAEV;MA0Da,uBAAuB,CAAA;AACjB,IAAA,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC;AAEtC,IAAA,SAAS,GAAG,MAAM,CAAS,EAAE,qDAAC;;AAG9B,IAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;QACrC,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;QACxD,MAAM,IAAI,GAA2E,EAAE;QAEvF,IAAI,cAAc,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,EAAA,CAAA,SAAA,EAAA,SAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACX,YAAY,8BACZ,UAAU,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACV,sBAAsB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACtB,2BAA2B,EAAA,QAAA,EAAA,6BAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC3B,8BAA8B,EAAA,QAAA,EAAA,gCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC9B,yBAAyB,sEACzB,2BAA2B,EAAA,QAAA,EAAA,6BAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FA6ClB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAzDnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAAA,eAAA,EACd,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,aAAa;wBACb,WAAW;wBACX,YAAY;wBACZ,UAAU;wBACV,sBAAsB;wBACtB,2BAA2B;wBAC3B,8BAA8B;wBAC9B,yBAAyB;wBACzB;qBACD,EAAA,QAAA,EAQS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,iHAAA,CAAA,EAAA;;;;;"}
@@ -1,5 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { inject, signal, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { toSignal } from '@angular/core/rxjs-interop';
3
4
  import { form, required, FormField } from '@angular/forms/signals';
4
5
  import { ActivatedRoute, Router } from '@angular/router';
5
6
  import { APP_CONFIG, isCompanyFeatureEnabled } from '@flusys/ng-core';
@@ -7,15 +8,12 @@ import { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';
7
8
  import { AngularModule, PrimeModule } from '@flusys/ng-shared';
8
9
  import { MessageService } from 'primeng/api';
9
10
  import { firstValueFrom } from 'rxjs';
10
- import { R as RoleApiService } from './flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs';
11
+ import { R as RoleApiService } from './flusys-ng-iam-flusys-ng-iam-DrGHlTiz.mjs';
11
12
  import * as i1 from '@angular/forms';
12
13
  import * as i2 from 'primeng/button';
13
- import * as i3 from 'primeng/inputtext';
14
+ import * as i3 from 'primeng/checkbox';
15
+ import * as i4 from 'primeng/inputtext';
14
16
 
15
- /**
16
- * Role Form Page Component
17
- * Create/Edit role with signal-based form pattern (matches ng-auth)
18
- */
19
17
  class RoleFormPageComponent {
20
18
  route = inject(ActivatedRoute);
21
19
  router = inject(Router);
@@ -23,16 +21,11 @@ class RoleFormPageComponent {
23
21
  companyContext = inject(LAYOUT_AUTH_STATE);
24
22
  roleApi = inject(RoleApiService);
25
23
  messageService = inject(MessageService);
26
- /** Loading state */
24
+ routeParams = toSignal(this.route.paramMap);
25
+ initialized = false;
27
26
  isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
28
- /** Existing role data when editing */
29
27
  existingRole = signal(null, ...(ngDevMode ? [{ debugName: "existingRole" }] : []));
30
- /** Whether in edit mode */
31
28
  isEditMode = computed(() => !!this.existingRole(), ...(ngDevMode ? [{ debugName: "isEditMode" }] : []));
32
- // ============================================
33
- // Form (Signal Forms)
34
- // ============================================
35
- /** Form model */
36
29
  formModel = signal({
37
30
  id: '',
38
31
  name: '',
@@ -40,20 +33,24 @@ class RoleFormPageComponent {
40
33
  serial: '',
41
34
  isActive: true,
42
35
  }, ...(ngDevMode ? [{ debugName: "formModel" }] : []));
43
- /** Form with validation schema */
44
36
  roleForm = form(this.formModel, (f) => {
45
37
  required(f.name, { message: 'Name is required' });
46
38
  });
47
- /** Check if form is valid */
48
39
  isFormValid = computed(() => {
49
40
  const model = this.formModel();
50
41
  return model.name.trim().length > 0;
51
42
  }, ...(ngDevMode ? [{ debugName: "isFormValid" }] : []));
52
- ngOnInit() {
53
- const id = this.route.snapshot.paramMap.get('id');
54
- if (id && id !== 'new') {
55
- this.loadRole(id);
56
- }
43
+ constructor() {
44
+ effect(() => {
45
+ const params = this.routeParams();
46
+ if (!params || this.initialized)
47
+ return;
48
+ this.initialized = true;
49
+ const id = params.get('id');
50
+ if (id && id !== 'new') {
51
+ this.loadRole(id);
52
+ }
53
+ });
57
54
  }
58
55
  async loadRole(id) {
59
56
  this.isLoading.set(true);
@@ -71,20 +68,12 @@ class RoleFormPageComponent {
71
68
  });
72
69
  }
73
70
  else {
74
- this.messageService.add({
75
- severity: 'error',
76
- summary: 'Error',
77
- detail: 'Role not found.',
78
- });
71
+ // Error toast handled by global interceptor
79
72
  this.router.navigate(['/iam/roles']);
80
73
  }
81
74
  }
82
- catch (error) {
83
- this.messageService.add({
84
- severity: 'error',
85
- summary: 'Error',
86
- detail: 'Failed to load role.',
87
- });
75
+ catch {
76
+ // Error toast handled by global interceptor
88
77
  this.router.navigate(['/iam/roles']);
89
78
  }
90
79
  finally {
@@ -132,12 +121,8 @@ class RoleFormPageComponent {
132
121
  }
133
122
  this.router.navigate(['/iam/roles']);
134
123
  }
135
- catch (error) {
136
- this.messageService.add({
137
- severity: 'error',
138
- summary: 'Error',
139
- detail: error.message || 'Failed to save role.',
140
- });
124
+ catch {
125
+ // Error toast handled by global interceptor
141
126
  }
142
127
  finally {
143
128
  this.isLoading.set(false);
@@ -149,66 +134,53 @@ class RoleFormPageComponent {
149
134
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RoleFormPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
150
135
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: RoleFormPageComponent, isStandalone: true, selector: "lib-role-form-page", ngImport: i0, template: `
151
136
  <div class="card">
152
- <div class="flex justify-between items-center mb-4">
153
- <h3 class="text-xl font-semibold">
154
- {{ isEditMode() ? 'Edit Role' : 'New Role' }}
155
- </h3>
156
- <p-button
157
- label="Back"
158
- icon="pi pi-arrow-left"
159
- [outlined]="true"
160
- (onClick)="onBack()" />
161
- </div>
137
+ <h3 class="text-lg sm:text-xl font-semibold mb-4">
138
+ {{ isEditMode() ? 'Edit Role' : 'New Role' }}
139
+ </h3>
162
140
 
163
- <form (ngSubmit)="onSubmit()">
164
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
165
- <!-- Name -->
166
- <div class="md:col-span-2">
167
- <label for="name" class="block font-medium mb-2">Name *</label>
168
- <input
169
- pInputText
170
- id="name"
171
- [formField]="roleForm.name"
172
- class="w-full"
173
- placeholder="Enter role name" />
174
- </div>
141
+ <form (ngSubmit)="onSubmit()" class="grid grid-cols-1 md:grid-cols-2 gap-4">
142
+ <!-- Name -->
143
+ <div class="flex flex-col gap-2">
144
+ <label for="name" class="font-medium">Name *</label>
145
+ <input
146
+ pInputText
147
+ id="name"
148
+ [formField]="roleForm.name"
149
+ placeholder="Enter role name" />
150
+ </div>
175
151
 
176
- <!-- Description -->
177
- <div class="md:col-span-2">
178
- <label for="description" class="block font-medium mb-2">Description</label>
179
- <input
180
- pInputText
181
- id="description"
182
- [formField]="roleForm.description"
183
- class="w-full"
184
- placeholder="Enter description" />
185
- </div>
152
+ <!-- Description -->
153
+ <div class="flex flex-col gap-2">
154
+ <label for="description" class="font-medium">Description</label>
155
+ <input
156
+ pInputText
157
+ id="description"
158
+ [formField]="roleForm.description"
159
+ placeholder="Enter description" />
160
+ </div>
186
161
 
187
- <!-- Order -->
188
- <div>
189
- <label for="serial" class="block font-medium mb-2">Display Order</label>
190
- <input
191
- pInputText
192
- id="serial"
193
- type="number"
194
- [formField]="roleForm.serial"
195
- class="w-full"
196
- placeholder="Enter display order" />
197
- </div>
162
+ <!-- Order -->
163
+ <div class="flex flex-col gap-2">
164
+ <label for="serial" class="font-medium">Display Order</label>
165
+ <input
166
+ pInputText
167
+ id="serial"
168
+ type="number"
169
+ [formField]="roleForm.serial"
170
+ placeholder="Enter display order" />
171
+ </div>
198
172
 
199
- <!-- Is Active -->
200
- <div class="flex items-center pt-6">
201
- <label class="p-checkbox-native">
202
- <input
203
- type="checkbox"
204
- [formField]="roleForm.isActive" />
205
- <span>Active</span>
206
- </label>
207
- </div>
173
+ <!-- Is Active -->
174
+ <div class="flex items-end gap-2 pb-1">
175
+ <p-checkbox
176
+ [formField]="roleForm.isActive"
177
+ [binary]="true"
178
+ inputId="isActive" />
179
+ <label for="isActive">Active</label>
208
180
  </div>
209
181
 
210
182
  <!-- Actions -->
211
- <div class="flex justify-end gap-2 mt-6">
183
+ <div class="flex justify-end gap-2 md:col-span-2 pt-4">
212
184
  <p-button
213
185
  label="Cancel"
214
186
  severity="secondary"
@@ -222,77 +194,63 @@ class RoleFormPageComponent {
222
194
  </div>
223
195
  </form>
224
196
  </div>
225
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i3.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
197
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
226
198
  }
227
199
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RoleFormPageComponent, decorators: [{
228
200
  type: Component,
229
201
  args: [{
230
202
  selector: 'lib-role-form-page',
231
- standalone: true,
232
203
  imports: [AngularModule, PrimeModule, FormField],
233
204
  changeDetection: ChangeDetectionStrategy.OnPush,
234
205
  template: `
235
206
  <div class="card">
236
- <div class="flex justify-between items-center mb-4">
237
- <h3 class="text-xl font-semibold">
238
- {{ isEditMode() ? 'Edit Role' : 'New Role' }}
239
- </h3>
240
- <p-button
241
- label="Back"
242
- icon="pi pi-arrow-left"
243
- [outlined]="true"
244
- (onClick)="onBack()" />
245
- </div>
207
+ <h3 class="text-lg sm:text-xl font-semibold mb-4">
208
+ {{ isEditMode() ? 'Edit Role' : 'New Role' }}
209
+ </h3>
246
210
 
247
- <form (ngSubmit)="onSubmit()">
248
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
249
- <!-- Name -->
250
- <div class="md:col-span-2">
251
- <label for="name" class="block font-medium mb-2">Name *</label>
252
- <input
253
- pInputText
254
- id="name"
255
- [formField]="roleForm.name"
256
- class="w-full"
257
- placeholder="Enter role name" />
258
- </div>
211
+ <form (ngSubmit)="onSubmit()" class="grid grid-cols-1 md:grid-cols-2 gap-4">
212
+ <!-- Name -->
213
+ <div class="flex flex-col gap-2">
214
+ <label for="name" class="font-medium">Name *</label>
215
+ <input
216
+ pInputText
217
+ id="name"
218
+ [formField]="roleForm.name"
219
+ placeholder="Enter role name" />
220
+ </div>
259
221
 
260
- <!-- Description -->
261
- <div class="md:col-span-2">
262
- <label for="description" class="block font-medium mb-2">Description</label>
263
- <input
264
- pInputText
265
- id="description"
266
- [formField]="roleForm.description"
267
- class="w-full"
268
- placeholder="Enter description" />
269
- </div>
222
+ <!-- Description -->
223
+ <div class="flex flex-col gap-2">
224
+ <label for="description" class="font-medium">Description</label>
225
+ <input
226
+ pInputText
227
+ id="description"
228
+ [formField]="roleForm.description"
229
+ placeholder="Enter description" />
230
+ </div>
270
231
 
271
- <!-- Order -->
272
- <div>
273
- <label for="serial" class="block font-medium mb-2">Display Order</label>
274
- <input
275
- pInputText
276
- id="serial"
277
- type="number"
278
- [formField]="roleForm.serial"
279
- class="w-full"
280
- placeholder="Enter display order" />
281
- </div>
232
+ <!-- Order -->
233
+ <div class="flex flex-col gap-2">
234
+ <label for="serial" class="font-medium">Display Order</label>
235
+ <input
236
+ pInputText
237
+ id="serial"
238
+ type="number"
239
+ [formField]="roleForm.serial"
240
+ placeholder="Enter display order" />
241
+ </div>
282
242
 
283
- <!-- Is Active -->
284
- <div class="flex items-center pt-6">
285
- <label class="p-checkbox-native">
286
- <input
287
- type="checkbox"
288
- [formField]="roleForm.isActive" />
289
- <span>Active</span>
290
- </label>
291
- </div>
243
+ <!-- Is Active -->
244
+ <div class="flex items-end gap-2 pb-1">
245
+ <p-checkbox
246
+ [formField]="roleForm.isActive"
247
+ [binary]="true"
248
+ inputId="isActive" />
249
+ <label for="isActive">Active</label>
292
250
  </div>
293
251
 
294
252
  <!-- Actions -->
295
- <div class="flex justify-end gap-2 mt-6">
253
+ <div class="flex justify-end gap-2 md:col-span-2 pt-4">
296
254
  <p-button
297
255
  label="Cancel"
298
256
  severity="secondary"
@@ -308,7 +266,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
308
266
  </div>
309
267
  `,
310
268
  }]
311
- }] });
269
+ }], ctorParameters: () => [] });
312
270
 
313
271
  export { RoleFormPageComponent };
314
- //# sourceMappingURL=flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs.map
272
+ //# sourceMappingURL=flusys-ng-iam-role-form-page.component-BjPwXkip.mjs.map